help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Basic font-lock without font-locking double-quoted strings


From: Emanuel Berg
Subject: Re: Basic font-lock without font-locking double-quoted strings
Date: Fri, 20 Dec 2013 18:37:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Joe Riel <joer@san.rr.com> writes:

>>> (define-derived-mode msdbg-mode fundamental-mode
>>> (setq > font-lock-keywords '(("EA" >
>>> . font-lock-warning-face))))
>>  Does that work at all?
>
> Yes.

Really?

If you check out the help for `define-derived-mode', it
says:

(define-derived-mode CHILD PARENT NAME &optional
DOCSTRING &rest BODY)

and

NAME - a string which will appear in the status line
(e.g. "Hypertext")

So when you invoke the mode (with `M-x CHILD', as CHILD
is "the name of the command for the derived mode"),
won't it produce an error because in general it doesn't
make sense, and in particular, '(("EA"
. font-lock-warning-face)) is not a string?

At least this is what happens to me on GNU Emacs 24.3.

Compare:

(define-derived-mode msdbg-mode fundamental-mode
  (setq font-lock-keywords '(("EA" . font-lock-warning-face))))
(msdbg-mode)
(message mode-name) ;; (wrong-type-argument stringp ...

(define-derived-mode msdbg-mode fundamental-mode
  "MS Debug")
(msdbg-mode)
(message mode-name) ;; "MS Debug"

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


reply via email to

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