all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Davin Pearson <davin.pearson@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Trying to disable the fontification of strings in  fundamental-mode
Date: Fri, 12 Sep 2008 19:48:27 -0700 (PDT)	[thread overview]
Message-ID: <5934d5fa-e5dc-42b4-9e60-dfe7a3927a79@i20g2000prf.googlegroups.com> (raw)
In-Reply-To: mailman.19100.1221209839.18990.help-gnu-emacs@gnu.org

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?


  parent reply	other threads:[~2008-09-13  2:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12  4:30 Trying to disable the fontification of strings in fundamental-mode Davin Pearson
2008-09-12  8:57 ` Nikolaj Schumacher
     [not found] ` <mailman.19100.1221209839.18990.help-gnu-emacs@gnu.org>
2008-09-13  2:48   ` Davin Pearson [this message]
2008-09-13  2:57     ` Davin Pearson
2008-09-14 22:54       ` Nikolaj Schumacher

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=5934d5fa-e5dc-42b4-9e60-dfe7a3927a79@i20g2000prf.googlegroups.com \
    --to=davin.pearson@gmail.com \
    --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.