From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jpw@pobox.com (John Paul Wallington) Newsgroups: gmane.emacs.help Subject: Re: How to font lock buffer name starts with space Date: Fri, 28 Sep 2007 20:33:44 +0100 Message-ID: <878x6qfuuf.fsf@laptop.shootybangbang.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1191008082 17673 80.91.229.12 (28 Sep 2007 19:34:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Sep 2007 19:34:42 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: "Ye Wenbin" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 28 21:34:35 2007 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 1IbLbV-000389-Me for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Sep 2007 21:34:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IbLbR-00043F-W2 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Sep 2007 15:34:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IbLbC-00042p-Fi for help-gnu-emacs@gnu.org; Fri, 28 Sep 2007 15:34:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IbLbB-000424-3A for help-gnu-emacs@gnu.org; Fri, 28 Sep 2007 15:34:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IbLbA-000421-SG for help-gnu-emacs@gnu.org; Fri, 28 Sep 2007 15:34:04 -0400 Original-Received: from sceptre.pobox.com ([207.106.133.20]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IbLbA-000874-N5 for help-gnu-emacs@gnu.org; Fri, 28 Sep 2007 15:34:04 -0400 Original-Received: from sceptre (localhost.localdomain [127.0.0.1]) by sceptre.pobox.com (Postfix) with ESMTP id 1EB652EF; Fri, 28 Sep 2007 15:34:10 -0400 (EDT) Original-Received: from laptop.shootybangbang.com (host86-144-229-44.range86-144.btcentralplus.com [86.144.229.44]) by sceptre.sasl.smtp.pobox.com (Postfix) with ESMTP id 570C783FD2; Fri, 28 Sep 2007 15:34:08 -0400 (EDT) X-URL: http://www.shootybangbang.com/ X-Mailer: Norman X-Attribution: JPW X-NSA-Fodder: nitrate Croatian argus Honduras FBI afsatcom diwn Europol MD5 X-Face: #uahb@^mo@bA"{q'"a4y[w$n3/V:haD\; YenWcT7)kXYx3/>#[DD9ExVe}; 9FG6X`l!Dm"V peub=u!&&?}s~{TOPtGdH)KA}/qCr; d"Gr*'9_V1PE@+K'tk2/Iq@PBKtJ+]&,CP9_Fl8'*R]LCR0| 6q; Xey'`:DX+)S.]p[KP^sNe`8B\W6(Nw{o5i)y+I!h=0bU5L`Tj`~Q0!G"t(s7o7eh)J\>P>,!~/w $$jGEVa%H%8(jTv In-Reply-To: (Ye Wenbin's message of "Fri\, 28 Sep 2007 23\:27\:08 +0800") User-Agent: Microsoft Gnus Express, Build 511.230501 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:47965 Archived-At: "Ye Wenbin" 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))))