[Refdb-devel] CVS: elisp refdb-mode.el,1.2,1.3
Status: Beta
Brought to you by:
mhoenicka
From: Michael S. <xm...@us...> - 2003-12-17 10:36:34
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1:/tmp/cvs-serv13993 Modified Files: refdb-mode.el Log Message: Fix for Bug #861419, "handle percent sign in queries". http://sourceforge.net/tracker/index.php?func=detail&aid=861419&group_id=26091&atid=385991 Problem: If you try to use a string that contains a percent sign, e.g., "Walsh%", in a getref query, Emacs emits a "not enough arguments for format call" error, and the query fails. Cause: Message functions with nested format functions, like this: (message (format CONTROL-STRING OBJECTS)) In that case, when objects for that nested format call had percent signs in them, the message function choked on them. Fix: Un-nested content that was in the format function, like this: (message CONTROL-STRING OBJECTS) Because the message function has built-in support for expanding control-strings just as the format function does, the format call was actually unnecessary. Also, added a new function, `refdb-message-getting-refs', for displaying the "Getting datasets for FIELD VALUE" message. All the refdb-getref-by-* functions now call this (instead of having their own hard-coded message calls). Affects: All getref queries, whether from command-line or menu. Index: refdb-mode.el =================================================================== RCS file: /cvsroot/refdb/elisp/refdb-mode.el,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- refdb-mode.el 16 Dec 2003 04:48:07 -0000 1.2 +++ refdb-mode.el 17 Dec 2003 10:36:31 -0000 1.3 @@ -586,4 +586,14 @@ ) +(defun refdb-message-getting-refs (field value) + "Emit appropriate status message for FIELD and VALUE. +This function is called by the various refdb-getref-by commands." + (message + "Getting datasets for %s %s ..." + field + value + ) + ) + (defun refdb-getref-by-field (field value) "Display all RefDB datasets that match the specified FIELD and VALUE. @@ -611,11 +621,10 @@ ) (message - (format - "Displaying output for %s -d %s -t %s :%s:=%s" - refdb-getref-command - refdb-database - refdb-output-type - field - value) + "Displaying output for %s -d %s -t %s :%s:=%s" + refdb-getref-command + refdb-database + refdb-output-type + field + value ) (pop-to-buffer "*refdb-output*") @@ -665,5 +674,5 @@ "Display all RefDB datasets matching AUTHOR." (interactive (list (read-string (format "Author: ")))) - (message (format "Getting datasets for author %s ..." author)) + (refdb-message-getting-refs 'author author) (refdb-getref-by-field "AU" author) ) @@ -672,5 +681,5 @@ "Display all RefDB datasets matching TITLE." (interactive (list (read-string (format "Title: ")))) - (message (format "Getting datasets for title %s ..." title)) + (refdb-message-getting-refs 'title title) (refdb-getref-by-field "TI" title) ) @@ -679,5 +688,5 @@ "Display all RefDB datasets matching KEYWORD." (interactive (list (read-string (format "Keyword: ")))) - (message (format "Getting datasets for keyword %s ..." keyword)) + (refdb-message-getting-refs 'keyword keyword) (refdb-getref-by-field "KW" keyword) ) @@ -686,5 +695,5 @@ "Display all RefDB datasets matching ID." (interactive (list (read-string (format "ID: ")))) - (message (format "Getting datasets for ID %s ..." ID)) + (refdb-message-getting-refs 'id id) (refdb-getref-by-field "ID" id) ) @@ -693,5 +702,5 @@ "Display all RefDB datasets matching CITEKEY." (interactive (list (read-string (format "Citation Key: ")))) - (message (format "Getting datasets for citation key %s ..." citekey)) + (refdb-message-getting-refs 'citekey citekey) (refdb-getref-by-field "CK" citekey) ) @@ -700,5 +709,5 @@ "Display all RefDB datasets matching SEARCHSTRING." (interactive "sSearch string: ") - (message (format "Getting datasets for search string %s ..." searchstring)) + (refdb-message-getting-refs 'searchstring searchstring) (if (not (eq (length refdb-database) 0)) (progn @@ -721,10 +730,9 @@ ) (message - (format - "Displaying output for %s -d %s -t %s %s" - refdb-getref-command - refdb-database - refdb-output-type - searchstring) + "Displaying output for %s -d %s -t %s %s" + refdb-getref-command + refdb-database + refdb-output-type + searchstring ) ) |