From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Difference between help-form and minibuffer-help-form Date: Thu, 30 Apr 2020 08:04:35 +0200 Message-ID: <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="82503"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.1.0; emacs 27.0.50 To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 30 08:05:23 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 1jU2K3-000LFJ-1e for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 08:05:23 +0200 Original-Received: from localhost ([::1]:44590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU2K2-0003k9-1l for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Apr 2020 02:05:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55988) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU2Je-0003jy-6L for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 02:04:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU2JY-0003Mb-PB for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 02:04:57 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:52066) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU2JX-0003M6-Pm for help-gnu-emacs@gnu.org; Thu, 30 Apr 2020 02:04:52 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 66FC0E673A for ; Thu, 30 Apr 2020 08:04:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D5jjexopG3AD for ; Thu, 30 Apr 2020 08:04:41 +0200 (CEST) Original-Received: from localhost (jeden09-dwa27.echostar.pl [213.156.109.227]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 02A74E65AD for ; Thu, 30 Apr 2020 08:04:40 +0200 (CEST) Received-SPF: pass client-ip=195.110.48.8; envelope-from=mbork@mbork.pl; helo=mail.mojserwer.eu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/30 02:04:45 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Received-From: 195.110.48.8 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:122984 Archived-At: 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