From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: need obsolete arg in (read-from-minibuffer ...) Date: Fri, 18 Mar 2011 21:59:55 -0400 Organization: A noiseless patient Spider Message-ID: References: <4D83BF4A.1030707@mousecar.com> <57C62106C2FC4A8DABE33A73A9A35201@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1300502463 8706 80.91.229.12 (19 Mar 2011 02:41:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Mar 2011 02:41:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 19 03:40:56 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q0m62-0001CZ-Sh for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Mar 2011 03:40:55 +0100 Original-Received: from localhost ([127.0.0.1]:60610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0m62-0004fR-81 for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Mar 2011 22:40:54 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Injection-Info: mx01.eternal-september.org; posting-host="mUsQcMSlJrmGm10TdiOHWg"; logging-data="15587"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MYAapFUDCSPYRjONQzqAv" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:hgC2rDFFann6XMoIauqzppPqBl0= sha1:vQTw7K5rbSCVx/RL+zdrfxBmprs= Original-Xref: usenet.stanford.edu gnu.emacs.help:186119 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80264 Archived-At: >>> the docs say that 2nd arg is obsolete. However, >>> I've tried a lot of permutations of the args listed and I >>> can't get this function to work without using that obsolete 2nd arg. >>> (defun mygetstr (def-val) >>> (read-from-minibuffer "Enter/Edit string: " >>> def-val nil nil nil def-val t)) First note: you probably don't want to use read-from-minibuffer, but use read-string instead (read-from-minibuffer is lower-level and slightly more tricky to use right). >> What do you mean by "work"? And what do you mean "without" the >> obsolete arg? > Sorry, I should have been clearer. If I change the 2nd arg from > "def-val" to "nil", then def-val isn't displayed in the minibuffer for > editing by the user. Exactly: placing the default value into the minibuffer text is what is discouraged. Instead, you should pass it as the `default-value' argument and manually make your prompt look like " (default ): " I know it sounds silly, but ...blablabla... history ...blablabla... > However, the docs say that this arg is obsolete. > I take this to mean that it should be left as "nil". Unless you really have a good argument why you want the initial minibuffer content to not be empty, of course. The "obsolete" is really about the UI guidelines and should be enforced differently ideally, but for now that's what we have. Stefan