unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Difference between help-form and minibuffer-help-form
@ 2020-04-30  6:04 Marcin Borkowski
  2020-04-30 20:16 ` Michael Heerdegen
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Borkowski @ 2020-04-30  6:04 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-30 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-30  6:04 Difference between help-form and minibuffer-help-form Marcin Borkowski
2020-04-30 20:16 ` Michael Heerdegen

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).