Subject: Re: bug#13819: 24.3.50; keywords args are no more font-locked

From: Thierry Volpiatto <[email-masked]>
Date: Tue, 26 Feb 2013 20:43:37 +0100

Thierry Volpiatto <[email-masked]> writes:

> Thierry Volpiatto <[email-masked]> writes:
>
>> Thierry Volpiatto <[email-masked]> writes:
>>
>>> "Drew Adams" <[email-masked]> writes:
>>>
>>>>> >> looks like keywords args are no more font-locked:
>>>>> >> e.g :group, :type, &optional etc...
>>>>> >
>>>>> > See bugs #13767 and #13755.
>>>>> 
>>>>> Thanks Drew, found the last but not #13767.
>>>>
>>>> It is here - see the last part about `&optional'.
>>>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13767
>>>
>>> Ok thanks, got it on gmane too.
>>
>> Looks like the problem comes from this commit:
>>
>> ,----
>> | commit 3885cfcaa8293ce29760022faeab6a8213a87827
>> | Author: Stefan Monnier <[email-masked]>
>> | Date:   Sun Feb 17 11:58:12 2013 -0500
>> `----
> Modifying these regexps make `&optional', `:sources' etc... font-locked
> again :-):
>
> diff --git a/lisp/font-lock.el b/lisp/font-lock.el
> index e5ce4db..de71cf5 100644
> --- a/lisp/font-lock.el
> +++ b/lisp/font-lock.el
> @@ -2336,9 +2336,9 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
>         ("`\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)'"
>          (1 font-lock-constant-face prepend))
>         ;; Constant values.
> -       ("\\<:\\(?:\\sw\\|\\s_\\)+\\>" 0 font-lock-builtin-face)
> +       (":\\(?:\\sw\\|\\s_\\)+" 0 font-lock-builtin-face)
>         ;; ELisp and CLisp `&' keywords as types.
> -       ("\\<\\&\\(?:\\sw\\|\\s_\\)+\\>" . font-lock-type-face)
> +       ("\\&\\(?:\\sw\\|\\s_\\)+" . font-lock-type-face)
>         ;; ELisp regexp grouping constructs
>         ((lambda (bound)
>            (catch 'found

Even better is this one:

diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index e5ce4db..9436012 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2336,9 +2336,9 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
        ("`\\(\\(?:\\sw\\|\\s_\\)\\(?:\\sw\\|\\s_\\)+\\)'"
         (1 font-lock-constant-face prepend))
        ;; Constant values.
-       ("\\<:\\(?:\\sw\\|\\s_\\)+\\>" 0 font-lock-builtin-face)
+       ("\\_<:\\(?:\\sw\\|\\s_\\)+\\_>" 0 font-lock-builtin-face)
        ;; ELisp and CLisp `&' keywords as types.
-       ("\\<\\&\\(?:\\sw\\|\\s_\\)+\\>" . font-lock-type-face)
+       ("\\_<\\&\\(?:\\sw\\|\\s_\\)+\\_>" . font-lock-type-face)
        ;; ELisp regexp grouping constructs
        ((lambda (bound)
           (catch 'found

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997