From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?q?Stefan_Reich=F6r?= Newsgroups: gmane.emacs.devel Subject: Re: Improved help from minibuffer prompts Date: Thu, 15 Apr 2004 07:50:14 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1082008822 12213 80.91.224.253 (15 Apr 2004 06:00:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Apr 2004 06:00:22 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Apr 15 08:00:13 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BDzv2-0006vJ-00 for ; Thu, 15 Apr 2004 08:00:12 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BDzv2-0006FO-00 for ; Thu, 15 Apr 2004 08:00:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BDzoA-0006Yy-AT for emacs-devel@quimby.gnus.org; Thu, 15 Apr 2004 01:53:06 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BDzo3-0006Vv-JC for emacs-devel@gnu.org; Thu, 15 Apr 2004 01:52:59 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BDznW-0006Qw-Rd for emacs-devel@gnu.org; Thu, 15 Apr 2004 01:52:58 -0400 Original-Received: from [140.78.161.123] (helo=proxy.riic.at) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1BDzlT-000684-I6 for emacs-devel@gnu.org; Thu, 15 Apr 2004 01:50:19 -0400 Original-Received: from nanni.riic.uni-linz.ac.at.riic.at (nanni.riic.uni-linz.ac.at [140.78.161.79]) by proxy.riic.at (8.12.7/8.12.7/SuSE Linux 0.6) with ESMTP id i3F5oE8a029767 for ; Thu, 15 Apr 2004 07:50:14 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: (Richard Stallman's message of "Wed, 14 Apr 2004 14:02:28 -0400") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (berkeley-unix) X-Virus-Scanned: by AMaViS - amavis-milter (http://www.amavis.org/) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21667 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21667 Hi Richard! > In my mode the user is often asked some questions in the > minibuffer. Sometimes the questions need some more > explanations. So I decided to put the needed help in the > function's docstring. > > You didn't say which function you mean, but according to the code > it looks like the entire doc string of the command that invoked > the minibuffer is the help string you use. I don't think > that will be very natural. I think it is convenient. Every interactive function has already a docstring. When I type M-x grep and get a prompt and I am not sure, what I am asked here, I can just get the help for the function grep. > It would be more natural to have a variable which, if non-nil, has > extra help for the current minibuffer question. The caller would bind > that variable. What do you think of that? That is also a nice idea. I think we should use that AND we should have a fallback solution for the docstring. > Better: the caller binds minibuffer-extra-help to the string > it should use. All entry to the minibuffer binds > minibuffer-current-extra-help to minibuffer-extra-help, > and binds minibuffer-extra-help to nil. This way, a recursive > use of the minibuffer will not mistakenly use a string > meant for the outer minibuffer level. Not sure, if I understand that. Consider the following function: (defun my-defun (name) "Just enter a funny name." (interactive "sEnter a name: ") (message (concat "The name entered was: " name))) Now I hit: M-x my-defun and get the prompt "Enter a name: " Now I hit f1 (or whatever keybinding we choose) and get the following help: Help for my-defun: Just enter a funny name. Where can I bind minibuffer-extra-help? I tried the following: (defun my-defun (name) "Just enter a funny name." (let ((minibuffer-extra-help "Just enter a funny name.")) (interactive "sEnter a name: ") (message (concat "The name entered was: " name)))) (defun my-defun (name) "Just enter a funny name." (interactive "sEnter a name: ") (let ((minibuffer-extra-help "Just enter a funny name.")) (message (concat "The name entered was: " name)))) That did not work. Any ideas? -- Stefan.