From: Lars Ingebrigtsen Date: Sun, 9 Feb 2014 03:25:19 +0000 (-0800) Subject: * font-lock.el (font-lock-value-in-major-mode): Doc fix X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~78 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dd1631238d444827387480c84d64d4e7bf6ad0ed;p=emacs.git * font-lock.el (font-lock-value-in-major-mode): Doc fix Clarify the meaning of the parameter. Fixes: debbugs:12282 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6e55544253f..91a85c9b04a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2014-02-09 Lars Ingebrigtsen + * font-lock.el (font-lock-value-in-major-mode): Clarify the + meaning of the parameter (bug#12282). + * files.el (find-file-noselect): Clarify prompt when changing readedness (bug#13261). (locate-file): Suffixes aren't returned, so don't say that they 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.