[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trying to disable the fontification of strings in fundamental-mode
From: |
Nikolaj Schumacher |
Subject: |
Re: Trying to disable the fontification of strings in fundamental-mode |
Date: |
Mon, 15 Sep 2008 00:54:46 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) |
Davin Pearson <davin.pearson@gmail.com> wrote:
> I managed to get the following code to work:
>
>> (defadvice fundamental-mode (after my-remove-strings
>> activate)
>> (if (eq major-mode 'fundamental-
>> mode)
>> (set (make-variable-buffer-local 'font-lock-string-face) nil)))
Sorry that I missed that there's no `fundamental-mode-hook'. You can
use `after-change-major-mode-hook' instead. You'll still need to test
the major-mode variable the way you did.
Also the right function is `make-local-variable', not
`make-variable-buffer-local'. Sorry, I always mix those up.
> I don't see the problem about using advice. I use advice all of the
> time in Emacs.
Advice can certainly do the job. But they are a very powerful tool that
can break a lot of stuff, unless you're careful. Hooks are made for
this very purpose, however.
Some discussion about this is here:
http://www.emacswiki.org/cgi-bin/wiki/AdviceVsHooks
regards,
Nikolaj Schumacher