all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: tromey@redhat.com
Cc: emacs-devel@gnu.org
Subject: Re: Patch: make eldoc indicate current argument
Date: Wed, 27 Jun 2007 19:42:53 -0400	[thread overview]
Message-ID: <E1I3h9x-0005k0-OS@fencepost.gnu.org> (raw)
In-Reply-To: <m3fy4dwcqf.fsf@fleche.redhat.com> (message from Tom Tromey on Wed, 27 Jun 2007 11:04:08 -0600)

    * Emacs formats documentation inconsistently.  Some functions use
      &optional and &rest in their description.  

I think you are talking about calling patterns in doc strings, not
about documentation in general.  Is that right?

&optional and &rest appear in calling patterns of functions.
We use ellipses and square brackets in calling patterns of macros
and special forms.

						 Some use "..." appended
      to an argument name, e.g. "CLAUSES...".  And, some use "..." as a
      standalone argument name (see 'when').

Do you mean this?

    (when COND BODY ...)

If so, I think that is a misunderstanding.  The ellipsis here is not
an argument name, it is just an ellipsis.  The space after `BODY' has
no significance.

Perhaps we should delete that space, for consistency.
Would someone like to do that?

Would you like to make a list of the places where such spurious spaces
appear?

    * If the documentation comments had a bit more structure, this could
      also show the description of the current argument, say as a tooltip.
      I don't think there is a reliable way to extract this information at
      present.

Alas, this would be a tremendous rewrite, and could make the doc
strings less readable for their current use if we're not careful.
Maybe some sort of cookie to indicate where the discussion of an
argument begins, within the doc string, would let you do this,
but it won't be easy.

The difficulty can be seen in the doc string of `when':

    If COND yields non-nil, do BODY, else return nil.
    When COND yields non-nil, eval BODY forms sequentially and return
    value of last one, or nil if there are none.

It is not natural to separate this into a discussion of COND and a
discussion of BODY.

But if you don't insist that each segment discuss only one argument,
we could subdivide each doc string into segments, and they you could
find all the segments in which the argument name is mentioned, and
display them.

Suppose that we use `][' as the segment separator.
Here as an example is the doc string of call-process, showing what
this would look like.

    (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)

    Call PROGRAM synchronously in separate process.
    The remaining arguments are optional.
    ][The program's input comes from file INFILE (nil means `/dev/null').
    ][Insert output in BUFFER before point; t means current buffer;
     nil for BUFFER means discard it; 0 means discard and don't wait.
    BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
    REAL-BUFFER says what to do with standard output, as above,
    while STDERR-FILE says what to do with standard error in the child.
    STDERR-FILE may be nil (discard standard error output),
    t (mix it with ordinary output), or a file name string.

    ][Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted.
    ][Remaining arguments are strings passed as command arguments to PROGRAM.

    ][If executable PROGRAM can't be found as an executable, `call-process'
    signals a Lisp error.  `call-process' reports errors in execution of
    the program only through its return and output.

    ][If BUFFER is 0, `call-process' returns immediately with value nil.
    Otherwise it waits for PROGRAM to terminate
    and returns a numeric exit status or a signal description string.
    ][If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.

If you like, you could try experimenting with this idea and see what
you can make it do.

  reply	other threads:[~2007-06-27 23:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-27 17:04 Patch: make eldoc indicate current argument Tom Tromey
2007-06-27 23:42 ` Richard Stallman [this message]
2007-06-28  4:48   ` Tom Tromey
2007-07-13  5:25   ` Kevin Rodgers
2007-07-13  7:15     ` David Kastrup
2007-07-13 23:09       ` Richard Stallman
2007-07-14 11:11         ` Juanma Barranquero
2007-07-14 16:17           ` David Kastrup
2007-07-14 22:33             ` Richard Stallman
2007-07-15  8:20               ` Juanma Barranquero
2007-07-15 22:54                 ` Richard Stallman
2007-07-15  9:27             ` Johan Bockgård
2007-07-15 22:54               ` Richard Stallman
2007-07-15 23:23               ` Paul Pogonyshev
2007-07-17  3:34                 ` Richard Stallman
2007-07-17  4:36                   ` Stefan Monnier
2007-07-18  4:42                     ` Richard Stallman
2007-06-28 20:35 ` Tom Tromey

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=E1I3h9x-0005k0-OS@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=tromey@redhat.com \
    /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.