summaryrefslogtreecommitdiff
path: root/lisp/font-lock.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2014-02-08 19:25:19 -0800
committerLars Ingebrigtsen <larsi@gnus.org>2014-02-08 19:25:19 -0800
commitdd1631238d444827387480c84d64d4e7bf6ad0ed (patch)
treea7deeecf297ba252d40357948debb4387be1082f /lisp/font-lock.el
parent2356b3168710ec6dc01f611557ea3af78d143c58 (diff)
downloademacs-dd1631238d444827387480c84d64d4e7bf6ad0ed.tar.gz
* font-lock.el (font-lock-value-in-major-mode): Doc fix
Clarify the meaning of the parameter. Fixes: debbugs:12282
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r--lisp/font-lock.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 7e9131df185..11a8466a4d6 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1764,12 +1764,14 @@ If SYNTACTIC-KEYWORDS is non-nil, it means these keywords are used for
(funcall keywords)
(eval keywords)))))
-(defun font-lock-value-in-major-mode (alist)
- "Return value in ALIST for `major-mode', or ALIST if it is not an alist.
-Structure is ((MAJOR-MODE . VALUE) ...) where MAJOR-MODE may be t."
- (if (consp alist)
- (cdr (or (assq major-mode alist) (assq t alist)))
- alist))
+(defun font-lock-value-in-major-mode (values)
+ "If VALUES is an list, use `major-mode' as a key and return the `assq' value.
+VALUES should then be an alist on the form ((MAJOR-MODE . VALUE) ...) where
+MAJOR-MODE may be t.
+If VALUES isn't a list, return VALUES."
+ (if (consp values)
+ (cdr (or (assq major-mode values) (assq t values)))
+ values))
(defun font-lock-choose-keywords (keywords level)
"Return LEVELth element of KEYWORDS.