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

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

Re: How to font lock buffer name starts with space


From: John Paul Wallington
Subject: Re: How to font lock buffer name starts with space
Date: Fri, 28 Sep 2007 20:33:44 +0100
User-agent: Microsoft Gnus Express, Build 511.230501

"Ye Wenbin" <wenbinye@gmail.com> writes:

> But it turns that the font lock is inhibit for the buffer name starts
> with  space.
> How to active font-lock for that buffer?

That's tricky because skipping hidden buffers is hard-coded in the
`font-lock-mode' function.  Interactively, I guess you could rename
the buffer at an opportune moment using M-x rename-buffer or a piece
of advice like so (largely untested):

(defadvice font-lock-mode (around fontify-hidden-buffers compile activate)
  "Allow hidden buffers."
  (let ((original-buffer-name (buffer-name))
        new-buffer-name)
    (unwind-protect
        (progn
          (setq new-buffer-name
                (generate-new-buffer-name original-buffer-name))
          (rename-buffer new-buffer-name)
          ad-do-it)
      (rename-buffer original-buffer-name))))




reply via email to

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