From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Difference between help-form and minibuffer-help-form Date: Thu, 30 Apr 2020 22:16:07 +0200 Message-ID: <871ro4n308.fsf@web.de> References: <87o8r9a4r0.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="59671"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:jC/0kutP8qIFVq3TnAFnn7aPlZ4= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 30 22:20:51 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUFfu-000FQU-TD for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 22:20:50 +0200 Original-Received: from localhost ([::1]:39080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUFft-0006T0-Mt for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 16:20:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47430) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUFcz-0006QE-Bf for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 16:18:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUFbX-0000oV-7q for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 16:17:48 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:60426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUFbW-0000lV-Fl for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 16:16:18 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jUFbU-000AHE-AN for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 22:16:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=159.69.161.202; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/30 16:09:35 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Received-From: 159.69.161.202 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122989 Archived-At: Marcin Borkowski 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.