unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <jmbarranquero@wke.es>
Cc: Kenichi Handa <handa@m17n.org>
Subject: Re: new *Help* argument highlighting
Date: Wed, 12 May 2004 13:47:07 +0200	[thread overview]
Message-ID: <20040512133037.FB60.JMBARRANQUERO@wke.es> (raw)
In-Reply-To: <200405121125.UAA11097@etlken.m17n.org>


On Wed, 12 May 2004 20:25:38 +0900 (JST)
Kenichi Handa <handa@m17n.org> wrote:

> Really?  I think it's very rare that a docstring of a
> funciton that has an argument NAME contains a reference to a
> shell/perl variable NAME in the form $NAME?

OK, but we're assuming different things.

With @var{ARG}, it wouldn't be necessary to pre-scan the usage info to
heuristically find the args, as it is done now. A simple walk through
the "doc" part of the docstring would allow to find @var{ARG}s, highlight
them and save them, so in fact the opposite is true: the information
gathered processing the doc would allow to highlight the usage info, so
arguments not referenced would *not* be highlighted in the usage info
either (and, in this way, alerting the doc writer and the user that the
argument is not described in the doc). That would also eliminate any
need to recognize CL-style arglists, BTW.

What you propose is as is done now: scan the usage, recognize the args,
and then substitute the args in the doc. That is helpful, because it
would prevent accidental highlighting, but that case is rare even now 
(defstruct, for example, mentions NAME-SLOT accessors, and the reference
is not highlighted), so perhaps is not worth the change.

To be fair, if implemented as I suggest, both the current
scan-usage-then-doc and my proposed scan-doc-then-usage methods would
have to coexist (we're not going to retroactively update thousands of
docstrings), but at least we could do: scan-doc-then-usage; if it does
not find any @{var}, fall back to old method.

> I grepped "\$[a-z]" in etc/DOC but found none.

Hu?
C:\...\etc> grep "\$[A-Za-z]" DOC
`$FOO' where FOO is an environment variable name means to substitute
`$FOO' where FOO is an environment variable name means to substitute
the entire variable name in braces.  For instance, in `ab$cd-x',
`$cd' is treated as an environment variable.
For example, invoke "emacs -batch -f batch-byte-compile $emacs/ ~/*.el".
Insert a copyright by $ORGANIZATION notice at cursor.
$               type sys$input
For example, invoke "emacs -batch -f batch-info-validate $info/ ~/*.info"
nil means the default, which is ("/usr/spool/mail/$USER")

And \@[A-Za-z] returns 33 hits.

> The reason I prefer a shorter name is that I want to keep
> the first line of a docstring in a source code short because
> we can't fill it.

Yes, I imagine as much.

> And, if we use @var{NAME}, it's get a
> little bit difficult to check if the first line fits in 80
> columns.

On one hand, you're not sure $NAME (or @var{NAME}) is going to be
substituted by a four-letter highlighted NAME (the user could make
help-arg-highlighting-function to do something weird). I admit this is
not likely.

On the other hand, we could "fix" filling for emacs-lisp docstrings so
it recognizes @var{NAME} and acts accordingly.

                                                                Juanma

  reply	other threads:[~2004-05-12 11:47 UTC|newest]

Thread overview: 173+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-07  5:32 new *Help* argument highlighting Miles Bader
2004-05-07  8:39 ` Juanma Barranquero
2004-05-08 22:22   ` Juri Linkov
2004-05-08 23:32     ` Juanma Barranquero
2004-05-08 23:47       ` Juri Linkov
2004-05-09  0:14         ` Juanma Barranquero
2004-05-08 23:49       ` Miles Bader
2004-05-09  0:09         ` Juanma Barranquero
2004-05-09 18:47     ` Richard Stallman
2004-05-09 22:25       ` Miles Bader
2004-05-09 22:54         ` Juanma Barranquero
2004-05-09 23:10           ` Stefan Monnier
2004-05-09 23:48             ` Juanma Barranquero
2004-05-10  0:00               ` Stefan Monnier
2004-05-10  0:11                 ` Juanma Barranquero
2004-05-10  0:25                   ` Stefan Monnier
2004-05-10  0:53                     ` Juanma Barranquero
2004-05-10  1:32                       ` Miles Bader
2004-05-10  7:24                         ` Juanma Barranquero
2004-05-10  2:42                       ` Stefan Monnier
2004-05-10  7:37                         ` Juanma Barranquero
2004-05-10 12:45                           ` Thien-Thi Nguyen
2004-05-10 13:01                             ` Juanma Barranquero
2004-05-10 16:18                     ` Robert J. Chassell
2004-05-10 19:06                       ` Stefan Monnier
2004-05-10 21:54                         ` Robert J. Chassell
2004-05-11 15:57                           ` Juri Linkov
2004-05-11 20:58                             ` Miles Bader
2004-05-11 21:51                               ` Juri Linkov
2004-05-11 22:58                                 ` Miles Bader
2004-05-11 22:08                             ` Robert J. Chassell
2004-05-11  0:07                         ` Juri Linkov
2004-05-11  2:30                           ` Stefan Monnier
2004-05-11 15:28                             ` Juri Linkov
2004-05-11 17:44                               ` Stefan Monnier
2004-05-10 17:54         ` Richard Stallman
2004-05-10 21:10           ` Juanma Barranquero
2004-05-10 21:28             ` David Kastrup
2004-05-10 21:41               ` Juanma Barranquero
2004-05-10 21:59                 ` Stefan Monnier
2004-05-10 22:12                   ` Juanma Barranquero
2004-05-10 21:47               ` Juanma Barranquero
2004-05-10 21:57                 ` David Kastrup
2004-05-10 22:10                   ` Juanma Barranquero
2004-05-10 22:26                     ` Miles Bader
2004-05-11  8:11                       ` Juanma Barranquero
2004-05-12  7:51                         ` Richard Stallman
2004-05-12  8:15                           ` Miles Bader
2004-05-12  8:58                             ` Juanma Barranquero
2004-05-12  9:25                               ` Miles Bader
2004-05-12  9:32                                 ` Juanma Barranquero
2004-05-13 15:45                                   ` Richard Stallman
2004-05-13 17:33                                     ` David Kastrup
2004-05-13 15:45                               ` Richard Stallman
2004-06-11 10:53                                 ` Bug tracking (was: new *Help* argument highlighting) Juanma Barranquero
2004-06-11 11:20                                   ` Bug tracking Lars Hansen
2004-06-11 11:33                                     ` Juanma Barranquero
2004-06-11 11:39                                   ` Bug tracking (was: new *Help* argument highlighting) Kim F. Storm
2004-06-11 12:40                                     ` Bug tracking Juanma Barranquero
2004-06-11 14:21                                     ` Bug tracking (was: new *Help* argument highlighting) Miles Bader
2004-06-11 15:11                                       ` Kim F. Storm
2004-06-11 22:29                                         ` Miles Bader
2004-06-12  9:45                                       ` Richard Stallman
2004-06-12  1:50                                   ` Richard Stallman
2004-06-12  2:12                                     ` Juanma Barranquero
2004-06-12  8:15                                       ` Lars Hansen
2004-06-13  0:01                                       ` Richard Stallman
2004-06-13  0:20                                         ` Juanma Barranquero
2004-06-12  8:37                                     ` Bug tracking Juri Linkov
2004-06-12  9:38                                       ` Lars Hansen
2004-06-12 15:28                                         ` Juri Linkov
2004-06-14 13:52                                           ` Kim F. Storm
2004-06-14 15:09                                             ` Juri Linkov
2004-06-14 15:38                                               ` Juanma Barranquero
2004-06-14 16:32                                                 ` Juri Linkov
2004-06-13  0:01                                         ` Richard Stallman
2004-06-13  0:05                                           ` Juanma Barranquero
2004-06-13 11:55                                           ` Kai Grossjohann
2004-06-13 14:34                                             ` Juanma Barranquero
2004-06-13 16:04                                               ` Juri Linkov
2004-06-14 18:50                                             ` Richard Stallman
2004-06-14 21:41                                               ` Juanma Barranquero
2004-06-14 23:09                                                 ` Kim F. Storm
2004-06-14 23:33                                                   ` Miles Bader
2004-06-15  8:11                                                     ` Kim F. Storm
2004-06-16 16:57                                                 ` Richard Stallman
2004-06-13 22:26                                           ` Kim F. Storm
2004-06-13 23:52                                             ` Miles Bader
2004-06-12 12:47                                       ` Juanma Barranquero
2004-06-12 15:38                                         ` Juri Linkov
2004-06-12 22:09                                           ` Juanma Barranquero
2004-06-12 23:06                                             ` Miles Bader
2004-06-13  0:08                                               ` Juanma Barranquero
2004-06-13  0:50                                                 ` Miles Bader
2004-06-13  1:07                                                   ` Juanma Barranquero
2004-06-13 16:00                                                     ` Juri Linkov
2004-06-13 22:52                                                       ` Juanma Barranquero
2004-06-13 23:56                                                         ` Miles Bader
2004-06-14  7:20                                                           ` Juanma Barranquero
2004-06-14  7:31                                                             ` Juanma Barranquero
2004-06-14 16:40                                                             ` Thien-Thi Nguyen
2004-06-14 21:36                                                               ` Juanma Barranquero
2004-06-15  1:36                                                                 ` Thien-Thi Nguyen
2004-06-15 13:58                                                                   ` Juanma Barranquero
2004-06-13 21:49                                         ` Richard Stallman
2004-06-13 23:03                                           ` Juanma Barranquero
2004-06-13  0:01                                       ` Richard Stallman
2004-06-12 18:26                                   ` Bug tracking (was: new *Help* argument highlighting) Karl Fogel
2004-06-12 20:03                                     ` Karl Fogel
2004-06-13  2:39                                       ` Miles Bader
2004-06-12 21:01                                         ` Karl Fogel
2004-06-13  3:34                                           ` Miles Bader
2004-06-12 21:52                                             ` Karl Fogel
2004-06-13 11:31                                             ` Bug tracking Juanma Barranquero
2004-06-13 13:28                                               ` Miles Bader
2004-06-13 14:38                                                 ` Juanma Barranquero
2004-06-13 12:19                                             ` Bug tracking (was: new *Help* argument highlighting) Jason Rumney
2004-06-13  9:06                                         ` David Kastrup
2004-06-13 14:26                                         ` Robert J. Chassell
2004-06-13 14:36                                           ` Karl Fogel
2004-06-13 23:29                                             ` Robert J. Chassell
2004-06-13 14:29                                         ` Bug tracking Oliver Scholz
2004-06-14 18:50                                           ` Richard Stallman
2004-06-14 21:17                                             ` Tak Ota
2004-06-16 16:57                                               ` Richard Stallman
2004-06-16 17:59                                                 ` Tak Ota
2004-06-14 18:50                                     ` Bug tracking (was: new *Help* argument highlighting) Richard Stallman
2004-06-14 20:19                                       ` Karl Fogel
2004-06-16 16:58                                         ` Richard Stallman
2004-05-12 10:47                             ` new *Help* argument highlighting Kenichi Handa
2004-05-12 11:10                               ` Juanma Barranquero
2004-05-12 11:25                                 ` Kenichi Handa
2004-05-12 11:47                                   ` Juanma Barranquero [this message]
2004-05-12 13:01                                     ` Kenichi Handa
2004-05-12 13:15                                       ` Juanma Barranquero
2004-05-12 14:06                                         ` Miles Bader
2004-05-12 13:09                                           ` Kim F. Storm
2004-05-12 22:18                                             ` Miles Bader
2004-05-17  1:14                                               ` Kenichi Handa
2004-05-17  2:30                                                 ` Miles Bader
2004-05-18 12:54                                                   ` Kenichi Handa
2004-05-17 14:46                                               ` Kim F. Storm
2004-05-17 22:23                                                 ` Miles Bader
2004-05-12 23:28                                           ` fill docstring (Re: new *Help* argument highlighting) Kenichi Handa
2004-05-17  1:16                                         ` new *Help* argument highlighting Kenichi Handa
2004-05-17  7:02                                           ` Juanma Barranquero
2004-05-17  7:16                                             ` Kenichi Handa
2004-05-12 12:53                                   ` Juanma Barranquero
2004-05-12 13:22                                     ` Kenichi Handa
2004-05-12 13:43                                       ` Juanma Barranquero
2004-05-11  9:02                       ` Juanma Barranquero
2004-05-10 23:42                 ` Kenichi Handa
2004-05-11  8:14                   ` Juanma Barranquero
2004-05-11 12:23             ` Richard Stallman
2004-05-11 13:56               ` Juanma Barranquero
2004-05-11 14:36                 ` David Kastrup
2004-05-11 14:53                   ` Juanma Barranquero
2004-05-12 19:40                 ` Richard Stallman
2004-05-12 20:12                   ` Stefan Monnier
2004-05-13  1:18                     ` Miles Bader
2004-05-13  1:30                     ` Juanma Barranquero
2004-05-13  1:41                       ` Stefan Monnier
2004-05-13  7:04                         ` Juanma Barranquero
2004-05-13 14:21                           ` Stefan Monnier
2004-05-13 21:25                             ` Juanma Barranquero
2004-05-13  1:25                   ` Juanma Barranquero
2004-05-14  9:20                     ` Richard Stallman
2004-05-11 16:51             ` Kevin Rodgers
2004-05-11 18:30               ` Juanma Barranquero
2004-05-12  0:04               ` Juanma Barranquero
2004-05-12 18:29                 ` Romain Francoise
2004-05-13  1:31                   ` Juanma Barranquero
2004-05-13  6:55                     ` Romain Francoise

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20040512133037.FB60.JMBARRANQUERO@wke.es \
    --to=jmbarranquero@wke.es \
    --cc=handa@m17n.org \
    /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 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).