unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>,
	"'Juri Linkov'" <juri@jurta.org>
Cc: 12686@debbugs.gnu.org, "'Aaron S. Hawley'" <aaron.s.hawley@gmail.com>
Subject: bug#12686: PATCH: ambiguous help doc strings
Date: Tue, 23 Oct 2012 09:15:05 -0700	[thread overview]
Message-ID: <B4E0159D95BD43B9922FFF4F914F691E@us.oracle.com> (raw)
In-Reply-To: <jwvmwzd8j8u.fsf-monnier+emacs@gnu.org>

> BTW, a common cause of ambiguity is minor modes which use the same
> symbol as a function and as a variable.  But in most such 
> cases, I think the fix is not to fix the ambiguity but to make
> describe-function/variable aware of minor-modes and display them in
> a unified way (i.e. display a single *Help* buffer that shows the var
> and the fun as a single entity, e.g. giving the args but also the link
> to customize).

+1, but not necessarily in the describe-function/variable code.  It should be
enough to do it once, in `help-make-xrefs'.

And this is already done, to some extent.  `help-make-xrefs' already DTRT,
**IF** the symbol name is not preceded by a keyword such as `function' or
`variable', i.e., if the match against `help-xref-symbol-regexp' does not match
`match-string' 1 through 7, and the symbol is both a var and a fn with doc.

In that case, we use button type `help-symbol', which DTRT: it shows the help
for both the function and the variable.

For example, if `icicle-mode' appears in the help text without any intro word
such as `function', `variable', or `option', then when you click it you get the
help for both the mode function `icicle-mode' and the mode variable (option)
`icicle-mode'.

`help-make-xrefs' could be tweaked to improve the accuracy in the case of a mode
fn/var (or any other symbol that is both a fn and a var): Just change the `cond'
order clauses, moving this clause before the other clauses:

((and (or (boundp sym)
          (get sym 'variable-documentation))
      (fboundp sym))
 ;; We can't intuit whether to use the
 ;; variable or function doc -- supply both.
 (help-xref-button 8 'help-symbol sym))

I.e., instead of providing such all-of-the-above behavior only as a fallback,
provide it anytime we know that a given symbol is both a fn and a var (by using
button type `help-symbol').






  reply	other threads:[~2012-10-23 16:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 20:58 bug#12686: PATCH: ambiguous help doc strings Aaron S. Hawley
2012-10-23  8:04 ` Juri Linkov
2012-10-23 12:32   ` Stefan Monnier
2012-10-23 16:15     ` Drew Adams [this message]
2012-10-23 17:02       ` Stefan Monnier
2012-10-25 18:29         ` Drew Adams
2012-10-25 19:21           ` Stefan Monnier
2012-10-25 20:13             ` Drew Adams
2012-10-25 20:44               ` Aaron S. Hawley
2012-10-25 21:01                 ` Drew Adams
2012-10-25 21:11                   ` Aaron S. Hawley
2012-10-25 21:13                     ` Drew Adams
2012-10-26  1:40                   ` Stefan Monnier
2013-01-11 18:19                     ` Aaron S. Hawley
2013-01-11 23:09                       ` Stefan Monnier
2012-10-23 15:24   ` Aaron S. Hawley

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=B4E0159D95BD43B9922FFF4F914F691E@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=12686@debbugs.gnu.org \
    --cc=aaron.s.hawley@gmail.com \
    --cc=juri@jurta.org \
    --cc=monnier@iro.umontreal.ca \
    /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).