all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Basic font-lock without font-locking double-quoted strings
Date: Fri, 20 Dec 2013 18:37:54 +0100	[thread overview]
Message-ID: <87haa31kz8.fsf@nl106-137-194.student.uu.se> (raw)
In-Reply-To: mailman.9722.1387515631.10748.help-gnu-emacs@gnu.org

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


  parent reply	other threads:[~2013-12-20 17:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.9709.1387497505.10748.help-gnu-emacs@gnu.org>
2013-12-20  0:26 ` Basic font-lock without font-locking double-quoted strings Emanuel Berg
2013-12-20  0:30   ` Emanuel Berg
2013-12-20  5:00   ` Joe Riel
     [not found]   ` <mailman.9722.1387515631.10748.help-gnu-emacs@gnu.org>
2013-12-20 17:37     ` Emanuel Berg [this message]
2013-12-19 23:58 Joe Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87haa31kz8.fsf@nl106-137-194.student.uu.se \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.