emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/emacs-lisp lisp-mnt.el


From: Kevin Ryde
Subject: [Emacs-diffs] emacs/lisp/emacs-lisp lisp-mnt.el
Date: Mon, 16 Nov 2009 22:58:21 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Kevin Ryde <kryde>      09/11/16 22:58:21

Modified files:
        lisp/emacs-lisp: lisp-mnt.el 

Log message:
        * 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.)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/emacs-lisp/lisp-mnt.el?cvsroot=emacs&r1=1.63&r2=1.64

Patches:
Index: lisp-mnt.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/lisp-mnt.el,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- lisp-mnt.el 2 Oct 2009 03:48:44 -0000       1.63
+++ lisp-mnt.el 16 Nov 2009 22:58:21 -0000      1.64
@@ -445,16 +445,20 @@
            (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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]