[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to font lock buffer name starts with space
From: |
weber |
Subject: |
Re: How to font lock buffer name starts with space |
Date: |
Fri, 28 Sep 2007 14:16:37 -0700 |
User-agent: |
G2/1.0 |
On Sep 28, 4:33 pm, j...@pobox.com (John Paul Wallington) wrote:
> "Ye Wenbin" <wenbi...@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))))
I know its not the answer for your question, but maybe it would be
interesting for you to start using Ido for switching buffers?
Then you can choose which ones to hide from the list like this:
(setq ido-ignore-buffers '("^ " "^\\*" "^\\#" "muse$")) ;; ignore
*Messages* etc
Here is a link: http://www.emacswiki.org/cgi-bin/emacs/InteractivelyDoThings
HTH,
weber