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: Font-Locking for Allout Mode Date: Wed, 07 Mar 2007 21:07:24 +0100 Organization: University Koblenz-Landau Campus Koblenz Message-ID: <87mz2o3jib.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 1173300068 21864 80.91.229.12 (7 Mar 2007 20:41:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Mar 2007 20:41:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 07 21:41:00 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 1HP2wU-0004cD-0r for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Mar 2007 21:40:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HP2wb-0000Y2-Li for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Mar 2007 15:41:05 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news-stu1.dfn.de!news.belwue.de!news.uni-kl.de!cache.uni-koblenz.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 52 Original-NNTP-Posting-Host: dslb-084-063-031-169.pools.arcor-ip.net Original-X-Trace: cache.uni-koblenz.de 1173298044 3316 84.63.31.169 (7 Mar 2007 20:07:24 GMT) Original-X-Complaints-To: news@cache.uni-koblenz.de Original-NNTP-Posting-Date: Wed, 7 Mar 2007 20:07:24 +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:5fsPHfX3cV9yUsTlrgjJL6xyIdY= Original-Xref: shelby.stanford.edu gnu.emacs.help:146161 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:41766 Archived-At: Hello, I'm a new user of allout-mode and I really like it. The only thing that has to be improved is the readability of the headings. I would like to use font locking to adjust the faces like the AUCTeX sectioning faces. On EmacsWiki [1] I found some snippets for doing that, although the first one seems to be outline-mode specific. So I adapted it for allout mode and came up with this: ,----[ ~/.emacs ] | (defvar th-allout-font-lock-keywords | '(;; Highlight headings according to the level. | (eval . (list (concat "^\\(" allout-regexp "\\).+") | 0 '(or (cdr (assq (allout-depth) | '((1 . font-lock-function-name-face) | (2 . font-lock-variable-name-face) | (3 . font-lock-keyword-face) | (4 . font-lock-builtin-face) | (5 . font-lock-comment-face) | (6 . font-lock-constant-face) | (7 . font-lock-type-face) | (8 . font-lock-string-face)))) | font-lock-warning-face) | nil t))) | "Additional expressions to highlight in Allout mode.") | | (defun th-font-lock-allout () | (interactive) | (font-lock-add-keywords nil th-allout-font-lock-keywords)) | | (add-hook 'allout-mode-hook | 'th-font-lock-allout) `---- But it seems to have no effect. The regexp from above is "^\\(\\(;;;_[ ]*[\\.,\\*\\+--=>()\\[{}&!\\?#%\"X@\\$~_\\\\:;\\^;;;_]\\)\\|\\(;;;_\\|;;;_\\)+ ?[^;;;_]\\| \\).+" It is for allout mode in a emacs lisp buffer. If I enter it in `re-builder' it matches the allout topic headings just fine. Can anyone see what's wrong with the code? Thanks in advance, Tassilo Footnotes: [1] http://www.emacswiki.org/cgi-bin/wiki/AllOut -- The glass is neither half-full nor half-empty: it's twice as big as it needs to be.