From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: How to travel into the future? Date: Tue, 14 Feb 2017 06:39:59 -0800 (PST) Message-ID: References: <87zihpgnki.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1487083248 23859 195.159.176.226 (14 Feb 2017 14:40:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 14:40:48 +0000 (UTC) To: Marcin Borkowski , Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 14 15:40:43 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdeHZ-0005KZ-Kg for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 15:40:41 +0100 Original-Received: from localhost ([::1]:35233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdeHZ-0004nW-6U for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 09:40:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdeH6-0004lt-5K for help-gnu-emacs@gnu.org; Tue, 14 Feb 2017 09:40:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdeH2-0005xJ-8v for help-gnu-emacs@gnu.org; Tue, 14 Feb 2017 09:40:12 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:51467) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cdeH2-0005sp-0D for help-gnu-emacs@gnu.org; Tue, 14 Feb 2017 09:40:08 -0500 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v1EEe3Ws016080 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Feb 2017 14:40:04 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v1EEe39V018965 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Feb 2017 14:40:03 GMT Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v1EEe0LL031924; Tue, 14 Feb 2017 14:40:01 GMT In-Reply-To: <87zihpgnki.fsf@mbork.pl> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112313 Archived-At: > I'd like to use in my code the M-n facility in history to enable the > user to have access to a reasonable default value, as described in > (info "(emacs) Minibuffer History"). > How should I do it? Should I use read-string? If so, do I have to put > the default into the history variable and use the (HISTVAR . POSITION) > argument to read-string? If so, should I then manually delete the > default (which might have been used or not by the user) from the history > variable afterwards? >=20 > Any pointers? Just provide a list of default values (strings) as argument DEFAULT to `completing-read', `read-string', or similar. `C-h f read-string': Fourth arg DEFAULT-VALUE is the default value or the list of default value= s. If non-nil, it is used for history commands, and as the value (or the firs= t element of the list of default values) to return if the user enters the empty string.