all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'suvayu ali'" <fatkasuvayu+linux@gmail.com>,
	"'Emacs mailing list'" <help-gnu-emacs@gnu.org>
Subject: RE: Minor bug in help+ libraries
Date: Wed, 7 Sep 2011 06:48:50 -0700	[thread overview]
Message-ID: <0478B86DD78D4AA2968FBC5CBB69047D@us.oracle.com> (raw)
In-Reply-To: <CAMXnza3Ht8KS_WHzk5Xx+S_rPcO4VwbcXaw01pwtyWo2pE=O0g@mail.gmail.com>

> I think I found a small bug in the help+ libraries. When in a lisp
> buffer the point is on a variable or function, hitting C-h f or C-h v
> doesn't show the default choice is the function/variable at point.
> However hitting RET without entering any text takes you to the correct
> documentation.

Yes, it's actually a feature, not a bug. :-)
Use `M-n' if you need to see the default value.

If you really want to see the default value in the prompt, then do surgery on
the definitions of `describe-function' and `describe-variable', to replace the
prompts in their calls to `completing-read'.  Just compare the `completing-read'
calls in `help-fns.el' (vanilla) and `help-fns+.el':

vanilla (what you like):
(if fn
    (format "Describe function (default %s): " fn)
  "Describe function: ")

+ (what I like):
(if current-prefix-arg
    "Describe command: "
  "Describe function: ")

You would replace each of those prompt strings by a conditional such as the one
in help-fns.el.

---

[FWIW, I use Icicles, which lets the _user_ decide whether to put the default
value in the prompt.  That's one reason I do not hard-code it into prompts.

Option `icicle-default-value':
  nil               - Do not insert default value or add it to prompt.
  t                 - Add default value to prompt.  Do not insert it.
  `insert-start'    - Insert default value and leave cursor at start.
  `insert-end'      - Insert default value and leave cursor at end.
  `preselect-start' - Insert and preselect default value;
                      leave cursor at beginning.
  `preselect-end'   - Insert and preselect default value;
                      leave cursor at end.

The default value is `t', which gives the behavior you like.  Personally, I use
the value `insert-end'.]




  reply	other threads:[~2011-09-07 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07 10:12 Minor bug in help+ libraries suvayu ali
2011-09-07 13:48 ` Drew Adams [this message]
2011-09-08  8:57   ` suvayu ali

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=0478B86DD78D4AA2968FBC5CBB69047D@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=fatkasuvayu+linux@gmail.com \
    --cc=help-gnu-emacs@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 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.