unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* info faces for strings and quotations
@ 2004-10-03  7:05 Drew Adams
  2004-10-05  7:15 ` Drew Adams
  0 siblings, 1 reply; 46+ messages in thread
From: Drew Adams @ 2004-10-03  7:05 UTC (permalink / raw)


I find Info to be a lot more readable with strings ("blah blah toto titi")
and quoted names (`my-foobar-function') highlighted in different faces from
the rest of the text.

What about adding something simple like this to the end of
Info-fontify-node - just before (set-buffer-modified-p nil):

  (goto-char (point-min))
  (while (re-search-forward "`\\([^']+\\)'" nil t)
    (put-text-property (match-beginning 1) (match-end 1)
                       'face info-quoted-name-face))
  (goto-char (point-min))
  (while (re-search-forward "\"\\([^\"]+\\)\"" nil t)
    (put-text-property (match-beginning 1) (match-end 1)
                       'face info-string-face))

Granted, there are a few Info nodes that get thrown off by this simple
matching because of unbalanced double or single quotes. This happens when a
node discusses characters like \", \`, and \' or uses this, where the two
are nested: `""'.

Probably most of these problems could be eliminated by smartening up the
regexps. Most of the "rogue" occurrences of these characters are preceded by
backslashes: \".

Even with these simple regexps, however, 99% of the pages look better, and
the text is much more readable, IMO. In particular, it is very helpful that
quoted names stand out; the double-quoted strings are less important.

To see this at its _worst_, these are the nodes of the Emacs manual that
throw off the regexps to some extent:

 - Glossary
 - Key (Character) Index
 - Minor Modes
 - Init Syntax
 - Printing and MS-DOS
 - Cursor Position Information (at the bottom)
 - TeX Editing Commands
 - Options Controlling Comments
 - Etags Regexps
 - Acknowledgements

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2004-10-16 13:52 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-03  7:05 info faces for strings and quotations Drew Adams
2004-10-05  7:15 ` Drew Adams
2004-10-05  7:30   ` Miles Bader
2004-10-06  8:34     ` Matt Hodges
2004-10-05  8:58   ` Drew Adams
2004-10-05 11:43     ` Stefan
2004-10-05 11:56   ` Stefan
2004-10-05 16:11     ` Drew Adams
2004-10-06  2:25       ` Luc Teirlinck
2004-10-06  4:19         ` Drew Adams
2004-10-06  4:28           ` Miles Bader
2004-10-06  7:40             ` Drew Adams
2004-10-06 21:32               ` Drew Adams
2004-10-06  4:53           ` Stefan Monnier
2004-10-06  7:07             ` Drew Adams
2004-10-06 17:07               ` Robert J. Chassell
2004-10-06 21:36                 ` Drew Adams
2004-10-07  5:53                 ` Juri Linkov
2004-10-07  6:53                   ` Drew Adams
2004-10-07 14:58                     ` Stefan Monnier
2004-10-07 15:13                       ` David Kastrup
2004-10-07 17:01                         ` Stefan Monnier
2004-10-08  5:13                           ` Drew Adams
2004-10-07 15:13                       ` Kim F. Storm
2004-10-07 16:35                         ` David Kastrup
2004-10-08  0:33                   ` Luc Teirlinck
2004-10-08 16:04                   ` Richard Stallman
2004-10-08 16:51                     ` Luc Teirlinck
2004-10-09 15:45                       ` Richard Stallman
2004-10-08 20:00                     ` Robert J. Chassell
2004-10-07  5:57               ` Juri Linkov
2004-10-07 15:22               ` w3 mode Camm Maguire
2004-10-07 17:03                 ` Stefan Monnier
2004-10-07 17:25                   ` Camm Maguire
2004-10-07 17:37                     ` Mark Plaksin
2004-10-07 17:45                     ` Kevin Rodgers
2004-10-08 16:05                 ` Richard Stallman
2004-10-08 17:44                   ` David Kastrup
2004-10-07 15:28               ` unexec development Camm Maguire
2004-10-15 14:10                 ` Camm Maguire
2004-10-15 14:35                   ` Jan D.
2004-10-15 21:11                     ` Camm Maguire
2004-10-16 13:52                   ` Richard Stallman
2004-10-06  8:44         ` info faces for strings and quotations Oliver Scholz
2004-10-07  5:55       ` Juri Linkov
2004-10-07  7:13         ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).