bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16439: [feature request] Highlighting of strings within Info buffers


From: Stefan Monnier
Subject: bug#16439: [feature request] Highlighting of strings within Info buffers
Date: Mon, 20 Jan 2014 09:10:28 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> The problem is how to highlight strings only in code samples
> because in other places highlighting "..." makes no sense.
> Look for example in the node (info "(emacs) Package Keywords"):
>   Most optional features in Emacs are grouped into "packages".
> Should "packages" be highlighted as a string.  Of course not.
> There is no additional emphasis on quotations in books.

Indeed.  The "right answer" is to move away from the Info format and
rely on something more structured that we could render in a much more
pretty way, using bold, italics, and friends.
In the mean time, I use the patch below.


        Stefan


--- lisp/info.el        2014-01-17 20:33:22 +0000
+++ lisp/info.el        2014-01-17 22:51:46 +0000
@@ -4193,5 +4192,12 @@
     st)
   "Syntax table used in `Info-mode'.")
 
+(defface Info-quoted
+  '((t :family "courier"))
+  "Face used for quoted elements.")
+
+(defvar Info-mode-font-lock-keywords
+  '(("‘\\([^’]*\\)’" (1 'Info-quoted))))
+
 ;; Autoload cookie needed by desktop.el
 ;;;###autoload
@@ -4296,1 +4291,2 @@
+  (setq-local font-lock-defaults '(Info-mode-font-lock-keywords t t))
   (Info-set-mode-line)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]