[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Difference between help-form and minibuffer-help-form
From: |
Marcin Borkowski |
Subject: |
Difference between help-form and minibuffer-help-form |
Date: |
Thu, 30 Apr 2020 08:04:35 +0200 |
User-agent: |
mu4e 1.1.0; emacs 27.0.50 |
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
- Difference between help-form and minibuffer-help-form,
Marcin Borkowski <=