PATCH: "bad format string" error for search-lisp "found" message

Bob Rogers <[email protected]>
Newsgroups gmane.lisp.ilisp.devel
Message-ID <[email protected]>
   lisp-locate-definition has the following broken message call:

	(message "Found %s")

This happens only when it is invoked as a result of search-lisp.  The
patch below fixes the problem.

   Due to this bug, it appears that every hit of any search is greeted
with a "Not enough arguments for format string" error.  This seems to
have been broken "forever," so I would be tempted to conclude that
nobody uses search-lisp, especially since M-x grep is much more
featureful when groveling through sources.  But the search-lisp
functionality is not actually impacted much by this error, since the hit
is already in the window at this point, so it's hard to be sure that
this feature is really ripe for GC.

   However, unless somebody complains, I will not waste time on keeping
search-lisp working when developing ilisp-src.el M-. enhancements.

					-- Bob Rogers
					   http://rgrjr.dyndns.org/

------------------------------------------------------------------------
Index: ilisp-src.el
===================================================================
RCS file: /cvsroot/ilisp/ILISP/ilisp-src.el,v
retrieving revision 1.5
diff -u -r1.5 ilisp-src.el
--- ilisp-src.el	1 Sep 2002 01:51:32 -0000	1.5
+++ ilisp-src.el	18 Sep 2002 21:41:57 -0000
@@ -167,7 +167,8 @@
 		 (type (cdr definition))
 		 (first (not (eq lisp-last-file file)))
 		 (buffer (current-buffer))
-		 name)
+		 (name (if (not (eq type t))
+			   (lisp-buffer-symbol symbol))))
 	    (lisp-find-file file pop)
 	    (if first (setq lisp-first-point (point)))
 	    (if back
@@ -179,10 +180,9 @@
 		(goto-char point)
 		(if (not first) 
 		    (progn (forward-line 1) (beginning-of-line))))
-	    (if (eq type 't)
+	    (if (eq type t)
 		(message "Search %s for %s" file symbol)
-		(message "Searching %s for %s %s" file type
-			 (setq name (lisp-buffer-symbol symbol))))
+		(message "Searching %s for %s %s" file type name))
 	    (if (funcall locator symbol type first back)
 		(progn
 		  (setq lisp-last-file file
@@ -191,9 +191,9 @@
 		      (forward-line -1)
 		      (beginning-of-line))
 		  (recenter 0)
-		  (if name 
+		  (if (eq type t)
 		      (message "Found %s %s definition" type name)
-		      (message "Found %s"))
+		      (message "Found %s" symbol))
 		  t)
 		(if first 
 		    (goto-char lisp-first-point)


-------------------------------------------------------
This SF.NET email is sponsored by: AMD - Your access to the experts
on Hammer Technology! Open Source & Linux Developers, register now
for the AMD Developer Symposium. Code: EX8664
http://www.developwithamd.com/developerlab
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.