From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Davin Pearson Newsgroups: gmane.emacs.help Subject: Re: Trying to disable the fontification of strings in fundamental-mode Date: Fri, 12 Sep 2008 19:48:27 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5934d5fa-e5dc-42b4-9e60-dfe7a3927a79@i20g2000prf.googlegroups.com> References: <18fb6c75-7414-4372-8626-3b6e46f3580b@e39g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1221277241 27456 80.91.229.12 (13 Sep 2008 03:40:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Sep 2008 03:40:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 13 05:41:37 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KeM0s-00010Q-Lb for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Sep 2008 05:41:34 +0200 Original-Received: from localhost ([127.0.0.1]:32888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeLzr-0001SB-VG for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Sep 2008 23:40:31 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!i20g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 60.234.132.53 Original-X-Trace: posting.google.com 1221274107 3711 127.0.0.1 (13 Sep 2008 02:48:27 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 13 Sep 2008 02:48:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i20g2000prf.googlegroups.com; posting-host=60.234.132.53; posting-account=SVVH0AoAAABplEQzMkIR3gU7a0gK8IuF User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:162163 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57505 Archived-At: On Sep 12, 8:57=A0pm, Nikolaj Schumacher wrote: > Davin Pearson 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! =A0Use hooks, which are cleaner > and safer. > > Second of all, setq changes the variable globally, so naturally it is > disabled everywhere. =A0You need to make the variable buffer-local. > > (defun my-fundamental-mode-hook () > =A0 (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?