unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nikolaj Schumacher <me@nschum.de>
To: Davin Pearson <davin.pearson@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Trying to disable the fontification of strings in fundamental-mode
Date: Mon, 15 Sep 2008 00:54:46 +0200	[thread overview]
Message-ID: <m2vdwyfidl.fsf@nschum.de> (raw)
In-Reply-To: <cb34d874-71e3-4d67-83b0-45b8ec97b25a@a18g2000pra.googlegroups.com> (Davin Pearson's message of "Fri\, 12 Sep 2008 19\:57\:40 -0700 \(PDT\)")

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




      reply	other threads:[~2008-09-14 22:54 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
2008-09-13  2:57     ` Davin Pearson
2008-09-14 22:54       ` Nikolaj Schumacher [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m2vdwyfidl.fsf@nschum.de \
    --to=me@nschum.de \
    --cc=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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).