From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Font-Locking for Allout Mode Date: Fri, 09 Mar 2007 15:27:13 +0100 Organization: University Koblenz-Landau Campus Koblenz Message-ID: <873b4ev6f2.fsf@baldur.tsdh.de> References: <87mz2o3jib.fsf@baldur.tsdh.de> <877itrn86x.fsf@baldur.tsdh.de> <87tzwvlmad.fsf@baldur.tsdh.de> <87k5xrl3xp.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173454845 11749 80.91.229.12 (9 Mar 2007 15:40:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2007 15:40:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 09 16:40:39 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 1HPhCs-0008QJ-Lh for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Mar 2007 16:40:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPhD8-0000yb-7V for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Mar 2007 10:40:50 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!cache.uni-koblenz.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: dslb-084-063-030-236.pools.arcor-ip.net Original-X-Trace: cache.uni-koblenz.de 1173450434 22562 84.63.30.236 (9 Mar 2007 14:27:14 GMT) Original-X-Complaints-To: news@cache.uni-koblenz.de Original-NNTP-Posting-Date: Fri, 9 Mar 2007 14:27:14 +0000 (UTC) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUSEQ9eW1Dkxz/6+fjQ w52JeEi7Imd/AAAACXBIWXMAAAsSAAALEgHS3X78AAAATnRFWHRSYXcgcHJvZmlsZSB0eXBlIGV4 aWYACmV4aWYKICAgICAgMjAKNDU3ODY5NjYwMDAwNGQ0ZDAwMmEwMDAwMDAwODAwMDAwMDAwMDAw MAqJuBZbAAAACXZwQWcAAAAwAAAAMADO7oxXAAABk0lEQVQ4y32TS3KDMAxAxQB7uyEHiGvvoSh7 sMSeJnD/q9Q/DBmYamNZz/oioM8ySkn7DbL2bHiUV+CODTflGXTSC5xBWwRAJzBAkPIEhLMWANUZ 3ETRt1CcAbcVdhdgmMZq5CsPsS6iufJ4EY7rFVg0WwNwblA5+Q/QCbADtLeewUxKcT/n1g8x0UVp c5Lt7Op4ANw+wfwOB+YxJoA5wlZXMnSwT788gmEbhUtSHMFWPuEnwK0WD6IOKUDISIckkFYk+KWl qHYgUvGIOKYkEeQJEQ5H0EETrERIbWoxgTLmQCLvsQNRhpqQELvmF3Kop17Ce+yJf6WsM7D8CMNF 7pcZoN5C4cLWlUXsiHY5bAKsmXn2c2BCPYkGI0BtHTGFrxX5RUz8jkBZ1tqKt8vOrC1bNgk4M6v5 5jyYvzQrtjqCICN7+8hWaaXNAahvwn66R92QA88ENCPPCSze4ycBI6WQdVBXOoYy/ndeN3tocH35 68MDH8os26zQGHd/+XcYE+xbMpk1LuC0mo9NdANOX10n5Q8J6syYNMm6EgAAABp6VFh0SlBFRy1D b2xvcnNwYWNlAAB42jMCAAAzADMRFn5jAAAAJ3pUWHRKUEVHLVNhbXBsaW5nLWZhY3RvcnMAAHja M6ow0jGsMARhABGDAulkDxtiAAAAAElFTkSuQmCC User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.95 (gnu/linux) Cancel-Lock: sha1:gSepwIsajc20ZFG7E/y6PE9u5Kw= Original-Xref: shelby.stanford.edu gnu.emacs.help:146227 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:41831 Archived-At: Stephen Berman writes: Hi Stephen, > Our discussion convinced me that the code from the Emacs wiki wasn't > playing well with Emacs lisp mode, so I fiddled with it and came up > with a variant that works in Emacs lisp mode. Replace your > th-allout-font-lock-keywords with the following: > > (defvar th-allout-font-lock-keywords > '((eval . (list (concat "^\\(?:" allout-regexp "\\).+") > 0 '(cond ((= (allout-depth) 1) > '(1 . font-lock-function-name-face)) > ((= (allout-depth) 2) > '(2 . font-lock-variable-name-face)) > ((= (allout-depth) 3) > '(3 . font-lock-keyword-face)) > ((= (allout-depth) 4) > '(4 . font-lock-builtin-face)) > ((= (allout-depth) 5) > '(5 . font-lock-comment-face)) > ((= (allout-depth) 6) > '(6 . font-lock-constant-face)) > ((= (allout-depth) 7) > '(7 . font-lock-type-face)) > ((= (allout-depth) 8) > '(8 . font-lock-string-face)) > (t font-lock-warning-face)) > t nil))) > "Additional expressions to highlight in Allout mode.") Yes, now it works. But I get a lot of the messages below in *Messages*: ,---- | Invalid face reference: 2 | Invalid face reference: 1 [9 times] | Invalid face reference: 2 [2 times] `---- > I still don't understand why the other version doesn't work with Emacs > lisp mode while the above does. I don't, too. > Another puzzling thing is that with the above, allout fontification > works in Emacs lisp mode even without the file local variable "mode: > allout"; however, in text mode that file local variable is still > needed to get the allout fontification. I can confirm this behavior. > So there are still some problems with the code, but we've made > progress. :-) Indeed. Thanks a lot. Bye, Tassilo