From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: How to add syntax-highlighting to a Help buffer? Date: Fri, 03 Jul 2015 22:09:49 +0200 Message-ID: <87fv55ovea.fsf@nl106-137-147.student.uu.se> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435954534 17417 80.91.229.3 (3 Jul 2015 20:15:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 3 Jul 2015 20:15:34 +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 Jul 03 22:15:25 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZB7Mp-0003Ma-6v for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2015 22:15:23 +0200 Original-Received: from localhost ([::1]:42462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB7Mo-0002P5-8R for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Jul 2015 16:15:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB7Mc-0002Op-J1 for help-gnu-emacs@gnu.org; Fri, 03 Jul 2015 16:15:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZB7MZ-0003Tv-CH for help-gnu-emacs@gnu.org; Fri, 03 Jul 2015 16:15:10 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZB7MZ-0003RZ-65 for help-gnu-emacs@gnu.org; Fri, 03 Jul 2015 16:15:07 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZB7MY-0003Cm-6m for help-gnu-emacs@gnu.org; Fri, 03 Jul 2015 22:15:06 +0200 Original-Received: from nl106-137-246.student.uu.se ([130.243.137.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Jul 2015 22:15:06 +0200 Original-Received: from embe8573 by nl106-137-246.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Jul 2015 22:15:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-246.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:56XHskPGog63jzFXhTgM+XImhjs= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105405 Archived-At: Raffaele Ricciardi writes: > I would like to add some syntax-highlighting to Help > buffers. I have tried to do that for example with > the Help buffer displayed by C-h f read-string RET, > by following the usual way: You mean, you want *more* than what's already there for buttons etc.? Check out this file - it isn't help, but the one of the buffer menus, but you might find the mechanics interesting for your purposes: http://user.it.uu.se/~embe8573/conf/emacs-init/buffer-menu.el Here are the actual regexps to "help" you to a quick start: (defvar buffer-menu-buffer-font-lock-keywords '( ("\\(KILL\\|my-kill\\) " . font-lock-builtin-face) ("\\*\\(Errors\\|Backtrace\\)\\*" . font-lock-warning-face) ("\\*\\(Group\\|Server\\)\\*" . font-lock-comment-face) ("\\*\\(Help\\|Completions\\|Messages\\|info\\|Apropos\\)\\*" . font-lock-constant-face) ("\\*\\(ielm\\|Article\\)\\*" . 'font-lock-regexp-grouping-backslash) (".* \\(.*\\.txt\\) " (1 font-lock-negation-char-face)) ("[[:space:]]+\\([[:digit:]]+\\) " (1 font-lock-comment-delimiter-face)) ("<.*\\(>\\|\\.\\.\\.\\)" . 'font-lock-regexp-grouping-construct) ("Makefile" . font-lock-comment-face) ("\\(\\*Man\\) \\(.*\\)\\(\\*\\)" (1 font-lock-type-face) (2 'font-lock-regexp-grouping-construct) (3 font-lock-type-face) ) (".* \\(.*\\.\\(el\\|cc?\\|cpp\\)\\) "(1 font-lock-string-face)) ("\\*w3m\\*" . font-lock-function-name-face) (".* \\(.*\\.html?\\) " (1 font-lock-doc-face)) (".* \\(.*\\.\\(hh?\\|tex\\)\\) " (1 font-lock-variable-name-face)) (".* \\(\\.[[:alnum:]_.-]*\\) " (1 font-lock-builtin-face)) )) Be sure to post your results somewhere - here, the repos (ELPA, MELPA, etc.), the EmacsWiki, #emacs, ... And come back with more questions if you'd like. Good luck! -- underground experts united http://user.it.uu.se/~embe8573