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

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

Re: Trying to disable the fontification of strings in fundamental-mode


From: Davin Pearson
Subject: Re: Trying to disable the fontification of strings in fundamental-mode
Date: Fri, 12 Sep 2008 19:48:27 -0700 (PDT)
User-agent: G2/1.0

On Sep 12, 8:57 pm, Nikolaj Schumacher <m...@nschum.de> wrote:
> Davin Pearson <davin.pear...@gmail.com> wrote:
> > What do I need to do to restrict the suppressing of the fontification
> > of strings to just fundamental mode?
>
> First of all, don't use advice for this!  Use hooks, which are cleaner
> and safer.
>
> Second of all, setq changes the variable globally, so naturally it is
> disabled everywhere.  You need to make the variable buffer-local.
>
> (defun my-fundamental-mode-hook ()
>   (set (make-variable-buffer-local 'font-lock-string-face) nil))
>
> (add-hook 'fundamental-mode-hook 'my-fundamental-mode-hook)

The above code doesn't work as there is no Emacs hook called
fundamental-mode-hook

Following your advice about local variables I also tried the
following:

(defadvice fundamental-mode (before my-remove-strings
activate)
  (if (eq major-mode 'fundamental-
mode)
      (set (make-variable-buffer-local 'font-lock-string-face)
nil)))

(defadvice fundamental-mode (after my-remove-strings
activate)
  (if (eq major-mode 'fundamental-
mode)
      (set (make-variable-buffer-local 'font-lock-string-face) nil)))

and both of these don't work either.

What gives?


reply via email to

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