all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Cc: lennart.borgman.073@student.lu.se,
	Luc Teirlinck <teirllm@dms.auburn.edu>,
	emacs-devel@gnu.org
Subject: RE: info faces for strings and quotations
Date: Wed, 6 Oct 2004 00:07:49 -0700	[thread overview]
Message-ID: <FDELKNEBLPKKDCEBEJCBAEBMCIAA.drew.adams@oracle.com> (raw)
In-Reply-To: <87brfg792y.fsf-monnier+emacs@gnu.org>

OK, sure, sure. Programming languages are formal languages, so your point is
of course correct, technically. And, if existing font-lock code doesn't do a
better job in practice than Info quote highlighting, at least it has the
theoretical advantage that it _could_ be made to parse the language as
needed. My point was a practical one, about the current state of font-lock
code. It is good enough; we live with it; we probably don't want it to spend
much more time trying to be more precise.

I'd much rather hear about results from practicing with this than arguments
of this sort. Or, lets say, in addition to arguments of this sort.

I only have the usual info files delivered with Emacs and Cygwin, and, yes,
none of them are devoted to examples of APL code...sigh. But, based on your
argument about not necessarily being appropriate to other languages than
Lisp, I did take a look at some of the 33 standard Info manuals I do have.
In fact, I checked them all -- all nodes (the highlighting helps to check
them quickly).

Many are of course about Emacs and Emacs Lisp packages. Even in those,
however, there are examples of code in other languages. I did find the
following highlighting problems in all the 33 manuals I checked. I didn't
find any pbs in the manuals not mentioned.

------------

CC MODE -- node Text Filling and Line Breaking: `\' (this case isn't treated
yet, but perhaps should be)

CL -- node Old CL Compatibility: middle of title "The `cl-compat'package"
got highlighted as a `...'

IDLWAVE -- node Getting Started: same pb as CC Mode (`\')
        -- node Code Templates: same

MH-E -- node Moving Your Mail Around: `"lpr -J '%s'"' (first ' ends `...';
second " starts "...")

MESSAGE -- node: Message Actions: lisp quoted sexp --
'(set-window-configuration...

EMACS FAQ -- several nodes have `...' or "..." in node titles. These are
highlighted.

WIDGET -- several nodes have `...' in titles

REFTEX -- node fancyref (LaTeX package): `fancyref' in title highlighted

VIP -- node New Commands: same pb as CC Mode (`\')
    -- node Important Keys: same

VIPER -- node Emacs Preliminaries: `C-\' (' is considered escaped, so
doesn't turn off highlighting)
      -- node Vi State: same
      -- node Insert State: same
      -- node Emacs Related Commands: same
      -- node New Commands: same pb as CC Mode (`\')
      -- node Key Index: isolated " -- * "<a-z1-9>P:

CALC -- node Arithmetic Tutorial: same pb as CC Mode (`\')
     -- node Types Tutorial: isolated " from hours, minutes, seconds entries
in table, such as 2@ 30' 0"
     -- node Programming Tutorial: this comment with isolated `: # Save
local values (Z `)
     -- node List Answer 9: same pb as CC Mode (`\')
     -- node List Tutorial Exercise 13: isolated " -- "Testing, 1, 2, 3
<RET>
     -- node Types Tutorial Exercise 4: more hours, minutes, seconds entries
     -- node Programming Tutorial Exercise 8, 9, and 10: isolated ` -- C-x
( Z `
     -- node HMS Forms: more hours, minutes, seconds as @ ' and "
     -- node HMS Formats: more hours, minutes, seconds as @ ' and "
     -- node Business Days: more hours, minutes, seconds as @ ' and "
     -- node Polynomials: key sequence `a \' (the ' is considered escaped by
the highlighting)
     -- node More About Embedded Mode: same pb as CC Mode (`\')
     -- node Customizing Embedded Mode: regexp `"\\'\\|\n$\\|\\$\\$?"'
(first ' ends `...' and second " starts "...")
     -- Calc Summary: isolated ` and " in table of key sequences
     -- Key Index: same as Calc Summary

     Note: the Calc manual is very large, has zillions of symbolic and
formulaic examples, and deals with the syntaxes of several other languages,
including Eqn, Mathematica, and Tex. It includes tabular material and ASCII
art. And yes, this manual, in particular, _benefits_ greatly from
quoted-name highlighting. I find it very difficult to parse (read) without
highlighting. Here are two typical paragraphs of _text_:

     Quotients of negative-looking values are simplified according to `(-a)
/ (-b)' to `a / b', `(-a) / (b - c)' to `a / (c - b)', and `(a - b) / (-c)'
to `(b - a) / c'.

     Generic identity matrices (*note Matrix Mode::) are simplified by the
following rules:  `idn(a) + b' to `a + b' if `b' is provably scalar, or
expanded out if `b' is a matrix; `idn(a) + idn(b)' to `idn(a + b)';
`-idn(a)' to `idn(-a)'; `a idn(b)' to `idn(a b)' if `a' is provably
scalar, or to `a b' if `a' is provably non-scalar; `idn(a) idn(b)' to
`idn(a b)'; analogous simplifications for quotients involving `idn';
and `idn(a)^n' to `idn(a^n)' where `n' is an integer.

EMACS LISP INTRO -- a few nodes, such as Top: `...' in titles
                 -- a few nodes, such as Height of label: sexp with ' inside
`...': `(apply 'max numbers-list)'
                 -- node beginning-of-buffer complete: same pb as CC Mode
(`\')
                 -- node sentence-end: same
                 -- node the-the: unbalanced "s in text: _I duplicate "the'_

TEXINFO -- several nodes, such as The `subsub' Commands, with `...' in title
        -- node First Line: same pb as CC Mode (`\')
        -- node Command Syntax: same
        -- node math: same
        -- node verb: isolated ' --  @verb{+@'e?`!`{}\+} this?
        -- node Inserting Accents: @`o
        -- node Defining Macros: `\PARAM1\' -- the ' is considered escaped

 - Drew




-----Original Message-----
From: emacs-devel-bounces+drew.adams=oracle.com@gnu.org
[mailto:emacs-devel-bounces+drew.adams=oracle.com@gnu.org]On Behalf Of
Stefan Monnier
Sent: Tuesday, October 05, 2004 9:53 PM
To: Drew Adams
Cc: lennart.borgman.073@student.lu.se; Luc Teirlinck;
emacs-devel@gnu.org
Subject: Re: info faces for strings and quotations


> And, the same rare problems can be seen with font-lock highlighting of
Emacs

It's actually slightly different: the nature of programming languages
implies that there exist an automatic way to unambiguously define what is
a correct parse.  I.e., font-lock highlighting has bugs, but they can
clearly be recognized as such (and often fixed if it matters enough).
Also font-lock bugs generally can be worked around by changing the
source code because such buffers are generally writable.

In Info files, the "..." and `...' syntax is not unambiguous (it is intended
to be parsed by humans only), so there is no automatic system that works
100% percent: any fix for a particular case will introduce problems
elsewhere.  And Info buffers are normally read-only and most Info users will
have a hard time finding the Info or Texinfo files to edit them (and they
often can't edit them because they don't have the required access rights).

Your regexps work great for Info pages describing Elisp code.  For Info
pages relating to some other language where the convention for escape
sequences in strings is significantly different, they may work
very poorly.  But that's what the config var is for, anyway.

I would probably turn it on ;-)


        Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2004-10-06  7:07 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2004-10-05 16:15 LENNART BORGMAN
2004-10-05 16:28 ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FDELKNEBLPKKDCEBEJCBAEBMCIAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman.073@student.lu.se \
    --cc=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.