From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Difference between help-form and minibuffer-help-form
Date: Thu, 30 Apr 2020 22:16:07 +0200 [thread overview]
Message-ID: <871ro4n308.fsf@web.de> (raw)
In-Reply-To: 87o8r9a4r0.fsf@mbork.pl
Marcin Borkowski <mbork@mbork.pl> writes:
> Hi all,
>
> I tried this:
>
> (defun read-string-with-help (help &rest args)
> "Call `read-string' with `C-h' displaying HELP."
> (let ((minibuffer-help-form help))
> (apply #'read-string args)))
>
> (defun demo-read-string-with-help ()
> (interactive)
> (message "%s" (read-string-with-help "this is help" "prompt: ")))
>
> and it works like a charm. However, I'm not sure why binding to
> help-form (not minibuffer-help-form) in `read-string-with-help' above
> doesn't work. My guess is that `help-form' is bound locally in the
> current buffer, and this would work for e.g. `read-char' (as the manual
> suggests), but minibuffer is a separate buffer, so the (local) binding
> of `help-char' wouldn't work there.
`help-char' or `help-form'?
It seems that locality is only a part of the solution: AFAIU
read_minibuf binds `help-form' to the binding of `minibuffer-help-form',
so the old binding of `help-form' just gets shadowed...?
Michael.
prev parent reply other threads:[~2020-04-30 20:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 6:04 Difference between help-form and minibuffer-help-form Marcin Borkowski
2020-04-30 20:16 ` Michael Heerdegen [this message]
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=871ro4n308.fsf@web.de \
--to=michael_heerdegen@web.de \
--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.
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).