Subject: Re: bug#14390: 24.3.50; (wrong-type-argument stringp t) from `read-regexp'

From: Juri Linkov <[email-masked]>
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.