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

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

no font locking for some files


From: Thien-Thi Nguyen
Subject: no font locking for some files
Date: Mon, 14 Feb 2011 13:01:16 +0100

Greetings earthlings,

Do you find yourself waiting interminably (more than 1 sec)
for Emacs to font lock the configure script when all you want
is a quick peek at some mis-mangled m4 spewage, reducing your
hacking frequency and inducing overstayed trips to slashdot?

Here is some ~/.emacs extract that might help:

(defvar no-font-locking-filenames '("configure")
  "*List of file names to inhibit font-lock on `find-file'.
See `no-font-locking-please'.")

(defun no-font-locking-please ()
  "Turn off font locking for files in `no-font-locking-filenames'.
Compare using the non-directory part of the `buffer-file-name'."
  (when (and buffer-file-name
             (member (file-name-nondirectory buffer-file-name)
                     no-font-locking-filenames))
    (font-lock-mode -1)))

(add-hook 'find-file-hook 'no-font-locking-please)



reply via email to

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