unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: rms@gnu.org
Cc: bojohan+news@dd.chalmers.se, emacs-devel@gnu.org,
	Paul Pogonyshev <pogonyshev@gmx.net>
Subject: Re: Patch: make eldoc indicate current argument
Date: Tue, 17 Jul 2007 00:36:42 -0400	[thread overview]
Message-ID: <jwvsl7nd56b.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1IAdpm-0001Z6-4K@fencepost.gnu.org> (Richard Stallman's message of "Mon\, 16 Jul 2007 23\:34\:46 -0400")

>     I was aware of such things (optional parameters in brackets), but
>     didn't figure out what to do with them:

> 	;; FIXME: What to do with optional arguments, like in
> 	;;        (defun NAME ARGLIST [DOCSTRING] BODY...) case?
> 	;;        The problem is there is no robust way to determine if
> 	;;        the current argument is indeed a docstring.

> Doc strings are so important that eldoc may as well have special-case
> code for them.

Hmm.... I'm trying to figure out in which circumstance it would be useful or
even possible to distinguish the two args in the help info:

- if point is on the second sexp (or further) in the body, it obviously
  won't make any difference.
- so it only makes a potential difference if point is on the first sexp in
  the body.
- if we don't do anything special, this will always be listed as being on
  [DOCSTRING].
- so if we're looking at a string, this is right unless there's
  no sexp afterwards.
- if we're looking at nothing, then selecting [DOCSTRING] is as good
  as any.
- if we're looking at an open paren an open [, then this is wrong,
  although only marginally so: we're just *before* the BODY and the user may
  decide to insert a docstring at point, so showing [DOCSTRING] isn't such
  a bad idea after all.
- we're inside a number or a symbol: this case is indeed just wrong and the
  help data should indicate we're in the BODY part.


-- Stefan

  reply	other threads:[~2007-07-17  4:36 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
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 [this message]
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

  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=jwvsl7nd56b.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bojohan+news@dd.chalmers.se \
    --cc=emacs-devel@gnu.org \
    --cc=pogonyshev@gmx.net \
    --cc=rms@gnu.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).