summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2009-11-16 22:59:09 +0000
committerKevin Ryde <user42@zip.com.au>2009-11-16 22:59:09 +0000
commit497de631d51619e0717e740ba50bf182bb3482f7 (patch)
tree4f40d63bfe38bab006bc7e2e9709fe5c0f3c97c7 /lisp/emacs-lisp
parentaf42a9cc3816ffea36927c2d2ceea6beec534298 (diff)
downloademacs-497de631d51619e0717e740ba50bf182bb3482f7.tar.gz
emacs-497de631d51619e0717e740ba50bf182bb3482f7.tar.bz2
emacs-497de631d51619e0717e740ba50bf182bb3482f7.zip
* 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.)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp-mnt.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index a748835d477..22d79c066c3 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -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)