From: Marcin Borkowski <mbork@mbork.pl>
To: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Difference between help-form and minibuffer-help-form
Date: Thu, 30 Apr 2020 08:04:35 +0200 [thread overview]
Message-ID: <87o8r9a4r0.fsf@mbork.pl> (raw)
Hi all,
I tried this:
--8<---------------cut here---------------start------------->8---
(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: ")))
--8<---------------cut here---------------end--------------->8---
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.
Am I correct?
TIA,
--
Marcin Borkowski
http://mbork.pl
next reply other threads:[~2020-04-30 6:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 6:04 Marcin Borkowski [this message]
2020-04-30 20:16 ` Difference between help-form and minibuffer-help-form Michael Heerdegen
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=87o8r9a4r0.fsf@mbork.pl \
--to=mbork@mbork.pl \
--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).