GNU bug report logs - #14390
24.3.50; (wrong-type-argument stringp t) from `read-regexp'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Sat, 11 May 2013 21:55:01 UTC

Severity: normal

Found in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14390 in the body.
You can then email your comments to 14390 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14390; Package emacs. (Sat, 11 May 2013 21:55:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 11 May 2013 21:55:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.3.50; (wrong-type-argument stringp t) from `read-regexp'
Date: Sat, 11 May 2013 14:54:12 -0700
The backtrace is not from emacs -Q, but I think the same problem is there.
 
`read-regexp' binds SUGGESTIONS to this:
 
(append
  suggestions
  (list
   (find-tag-default-as-regexp) ; <======= SHOULD return a string
   (car regexp-search-ring)
   (regexp-quote (or (car search-ring) ""))
   (car (symbol-value query-replace-from-history-variable))))
 
The problem is (find-tag-default-as-regexp), which will return `t' when
TAG is nil.  `t' is not a valid suggestion: SUGGESTIONS must be a list
of strings.
 
Debugger entered--Lisp error: (wrong-type-argument stringp t)
* icicle-ORIG-read-from-minibuffer("Flush lines containing match for regexp: " t
nil nil regexp-history (t "^\\*.*" "keep-lines-read-args"
"bookmarkp-bmenu-show-only-varlists") t)
* read-from-minibuffer("Flush lines containing match for regexp: " nil nil nil
regexp-history (t "^\\*.*" "keep-lines-read-args"
"bookmarkp-bmenu-show-only-varlists") t)
* read-regexp("Flush lines containing match for regexp")
* (list (read-regexp prompt) nil nil t)
* (lambda (prompt) "Read arguments for `keep-lines' and friends.\nPrompt for a
regexp with PROMPT.\nValue is a list, (REGEXP)." (list (read-regexp prompt) nil
nil t))("Flush lines containing match for regexp")
* apply((lambda (prompt) "Read arguments for `keep-lines' and friends.\nPrompt
for a regexp with PROMPT.\nValue is a list, (REGEXP)." (list (read-regexp
prompt) nil nil t)) "Flush lines containing match for regexp")
* keep-lines-read-args("Flush lines containing match for regexp")
  (progn (barf-if-buffer-read-only) (keep-lines-read-args "Flush lines
containing match for regexp"))
  call-interactively(flush-lines record-it)
  icicle-execute-extended-command-1("flush-lines")
  ...
  funcall(...)
  icicle-execute-extended-command()
  call-interactively(icicle-execute-extended-command nil nil)
  command-execute(icicle-execute-extended-command)
 
 
 

In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-05-10 on ODIEONE
Bzr revision: 112542 rgm <at> gnu.org-20130510102119-fklj7xlajezey0tr
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14390; Package emacs. (Sat, 11 May 2013 23:23:02 GMT) Full text and rfc822 format available.

Message #8 received at 14390 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 14390 <at> debbugs.gnu.org
Subject: Re: bug#14390: 24.3.50;
	(wrong-type-argument stringp t) from `read-regexp'
Date: Sun, 12 May 2013 02:17:05 +0300
> The problem is (find-tag-default-as-regexp), which will return `t' when
> TAG is nil.  `t' is not a valid suggestion: SUGGESTIONS must be a list
> of strings.

An empty string return value for the case when TAG is nil
was lost when copying this code from `read-regexp'
to `find-tag-default-as-regexp' in revno:111971.
It could be restored back with:

=== modified file 'lisp/subr.el'
--- lisp/subr.el	2013-04-27 23:07:46 +0000
+++ lisp/subr.el	2013-05-11 23:16:36 +0000
@@ -2715,7 +2715,7 @@ (defun find-tag-default-as-regexp ()
 		   (get major-mode 'find-tag-default-function)
 		   'find-tag-default))
 	 (tag (funcall tagf)))
-    (cond ((not tag))
+    (cond ((not tag) "")
 	  ((eq tagf 'find-tag-default)
 	   (format "\\_<%s\\_>" (regexp-quote tag)))
 	  (t (regexp-quote tag)))))

BTW, the same commit revno:111971 introduced the function
`hi-lock-read-regexp-defaults'.  I think this is a good thing,
and I propose to improve it by adding `read-regexp-defaults-or-tag'
and `read-regexp-defaults-or-history' as we were discussing a month ago.




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Tue, 14 May 2013 23:44:02 GMT) Full text and rfc822 format available.

Notification sent to "Drew Adams" <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Tue, 14 May 2013 23:44:02 GMT) Full text and rfc822 format available.

Message #13 received at 14390-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 14390-done <at> debbugs.gnu.org
Subject: Re: bug#14390: 24.3.50;
	(wrong-type-argument stringp t) from `read-regexp'
Date: Wed, 15 May 2013 02:40:50 +0300
> === modified file 'lisp/subr.el'
> --- lisp/subr.el	2013-04-27 23:07:46 +0000
> +++ lisp/subr.el	2013-05-11 23:16:36 +0000
> @@ -2715,7 +2715,7 @@ (defun find-tag-default-as-regexp ()
>  		   (get major-mode 'find-tag-default-function)
>  		   'find-tag-default))
>  	 (tag (funcall tagf)))
> -    (cond ((not tag))
> +    (cond ((not tag) "")

After looking more at this, I think it should return nil
because its accompanying function `find-tag-default' returns nil,
not an empty string, if there is no default tag at point.

This is fixed now.

> BTW, the same commit revno:111971 introduced the function
> `hi-lock-read-regexp-defaults'.  I think this is a good thing,
> and I propose to improve it by adding `read-regexp-defaults-tag'
> and `read-regexp-defaults-history' as we were discussing a month ago.

I'll create a separate request for this.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 12 Jun 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 341 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.