]> git.eshelyaron.com Git - emacs.git/commitdiff
* emacs-lisp/lisp-mnt.el (lm-keywords): Allow multi-line keywords.
authorKevin Ryde <user42@zip.com.au>
Mon, 16 Nov 2009 22:59:09 +0000 (22:59 +0000)
committerKevin Ryde <user42@zip.com.au>
Mon, 16 Nov 2009 22:59:09 +0000 (22:59 +0000)
(lm-keywords-list): Allow comma-only separator like "foo,bar".
Ignore trailing spaces by omit-nulls to split-string (fixing
regression from Emacs 21 due to the incompatible split-string
change).  (Bug #4928.)

lisp/ChangeLog
lisp/emacs-lisp/lisp-mnt.el

index cfe1492a962df0e49dc6603ae40a3b4d93b7e9a6..5c657be31803a28de5ff8246ead14892694ab0e7 100644 (file)
@@ -4,6 +4,12 @@
        `sgml-lexical-context' instead of own parse for tag.  (Further to
        Bug#4511).
 
+       * emacs-lisp/lisp-mnt.el (lm-keywords): Allow multi-line keywords.
+       (lm-keywords-list): Allow comma-only separator like "foo,bar".
+       Ignore trailing spaces by omit-nulls to split-string (fixing
+       regression from Emacs 21 due to the incompatible split-string
+       change).  (Bug #4928.)  
+
 2009-11-16  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * vc.el (vc-log-show-limit): Default to 2000.
index a748835d477a099619cccf31ccb1ca5480d53cd2..22d79c066c3daeb3c66eb4009b5767c86265fcf4 100644 (file)
@@ -445,16 +445,20 @@ This can be found in an RCS or SCCS header."
            (match-string-no-properties 1)))))))
 
 (defun lm-keywords (&optional file)
-  "Return the keywords given in file FILE, or current buffer if FILE is nil."
+  "Return the keywords given in file FILE, or current buffer if FILE is nil.
+The return is a `downcase'-ed string, or nil if no keywords
+header.  Multi-line keywords are joined up with a space between
+each line."
   (lm-with-file file
-    (let ((keywords (lm-header "keywords")))
-      (and keywords (downcase keywords)))))
+    (let ((keywords (lm-header-multiline "keywords")))
+      (and keywords
+          (mapconcat 'downcase keywords " ")))))
 
 (defun lm-keywords-list (&optional file)
   "Return list of keywords given in file FILE."
   (let ((keywords (lm-keywords file)))
     (if keywords
-       (split-string keywords ",?[ \t]"))))
+       (split-string keywords "[, \t\n]+" t))))
 
 (defvar finder-known-keywords)
 (defun lm-keywords-finder-p (&optional file)