[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: info faces for strings and quotations
From: |
Drew Adams |
Subject: |
RE: info faces for strings and quotations |
Date: |
Tue, 5 Oct 2004 09:11:02 -0700 |
Thanks for lots of good input, Stephan. You made several good points about
the implementation, which I'll put into practice immediately.
As you know, in my first message, I used just these (separate) simple regexp
searches, which didn't take care of escaped "s but worked 99% of the time:
(re-search-forward "`\\([^']+\\)'" nil t)
(re-search-forward "\"\\([^\"]+\\)\"" nil t)
I mentioned the fact that the regexps could be improved, and Lennart was
kind enough to do some coding and testing. He came up with something that
solved the escaped "s pb, which I tried and sent along to the list (though I
mistakenly left off the non-greedy "?"). I sent the updated code because it
improved the functionality, taking care of some corner cases.
I'll make the implementation changes you suggest. Besides the implementation
issues, you asked this question about the _functionality_:
Why fontify the interior of `...' but fontify both the interior and the
quotes for "..." ? Is it just because your quoted face is bold and you
don't like to see the `
and ' in bold, or is there a deeper reason?
Good question. That was by design. In most Info files, `...' is used to
identify commands, key sequences, filenames and the like; "..." is used
(usually) to identify strings in code. I found that not highlighting the
single-quotes and highlighting the double-quotes improved readability. Try
different combinations of highlighting the quotes (or not), yourself, and
see what you think. My second choice would be to not highlight either kind
of delimiter.
BTW, I didn't test this with a terminal Emacs; I just threw the bold-italic
and italic face attributes in there at the last minute to have something for
the non-(class color) case. Do you have a suggestion on what to use in that
case? (In fact, just before I sent the email, the version I use had face
variables with defvar, which is why I used the names *-face -- a no-no
nowadays, as Miles pointed out.)
The code will be cleaner & leaner thanks to input from Lennart, Miles, and
you.
So, what do you and others think of the _desirability_ of (optionally)
highlighting quoted expressions in Info?
- Drew
- info faces for strings and quotations, Drew Adams, 2004/10/03
- RE: info faces for strings and quotations, Drew Adams, 2004/10/05
- Re: info faces for strings and quotations, Miles Bader, 2004/10/05
- RE: info faces for strings and quotations, Drew Adams, 2004/10/05
- Re: info faces for strings and quotations, Stefan, 2004/10/05
- RE: info faces for strings and quotations,
Drew Adams <=
- Re: info faces for strings and quotations, Luc Teirlinck, 2004/10/05
- RE: info faces for strings and quotations, Drew Adams, 2004/10/06
- Re: info faces for strings and quotations, Miles Bader, 2004/10/06
- RE: info faces for strings and quotations, Drew Adams, 2004/10/06
- RE: info faces for strings and quotations, Drew Adams, 2004/10/06
- Re: info faces for strings and quotations, Stefan Monnier, 2004/10/06
- RE: info faces for strings and quotations, Drew Adams, 2004/10/06
- Re: info faces for strings and quotations, Robert J. Chassell, 2004/10/06
- RE: info faces for strings and quotations, Drew Adams, 2004/10/06
- Re: info faces for strings and quotations, Juri Linkov, 2004/10/07