[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Difference between help-form and minibuffer-help-form
From: |
Michael Heerdegen |
Subject: |
Re: Difference between help-form and minibuffer-help-form |
Date: |
Thu, 30 Apr 2020 22:16:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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.