all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to font lock buffer name starts with space
@ 2007-09-28 15:27 Ye Wenbin
  0 siblings, 0 replies; 3+ messages in thread
From: Ye Wenbin @ 2007-09-28 15:27 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Hi, I want some buffers hide from list-buffers, so I add an space to the  
buffer's name.
But it turns that the font lock is inhibit for the buffer name starts with  
space.
How to active font-lock for that buffer?

-- 
Best regards,
Ye Wenbin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to font lock buffer name starts with space
       [not found] <mailman.1432.1190993253.18990.help-gnu-emacs@gnu.org>
@ 2007-09-28 19:33 ` John Paul Wallington
       [not found] ` <mailman.1449.1191008048.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: John Paul Wallington @ 2007-09-28 19:33 UTC (permalink / raw)
  To: Ye Wenbin; +Cc: help-gnu-emacs@gnu.org

"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))))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to font lock buffer name starts with space
       [not found] ` <mailman.1449.1191008048.18990.help-gnu-emacs@gnu.org>
@ 2007-09-28 21:16   ` weber
  0 siblings, 0 replies; 3+ messages in thread
From: weber @ 2007-09-28 21:16 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-28 21:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1432.1190993253.18990.help-gnu-emacs@gnu.org>
2007-09-28 19:33 ` How to font lock buffer name starts with space John Paul Wallington
     [not found] ` <mailman.1449.1191008048.18990.help-gnu-emacs@gnu.org>
2007-09-28 21:16   ` weber
2007-09-28 15:27 Ye Wenbin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.