From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: How to travel into the future? Date: Tue, 14 Feb 2017 16:05:48 +0700 Message-ID: References: <87zihpgnki.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1487084363 3868 195.159.176.226 (14 Feb 2017 14:59:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Feb 2017 14:59:23 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 14 15:59:18 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 1cdeZX-0000Vr-UA for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 15:59:16 +0100 Original-Received: from localhost ([::1]:35307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdeZd-0006bw-HM for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Feb 2017 09:59:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdZ3s-0004f2-QM for help-gnu-emacs@gnu.org; Tue, 14 Feb 2017 04:06:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdZ3r-0005rr-Il for help-gnu-emacs@gnu.org; Tue, 14 Feb 2017 04:06:12 -0500 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:37048) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdZ3r-0005r2-81 for help-gnu-emacs@gnu.org; Tue, 14 Feb 2017 04:06:11 -0500 Original-Received: by mail-wm0-x22a.google.com with SMTP id v77so11888084wmv.0 for ; Tue, 14 Feb 2017 01:06:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Vz0vBmw8z0ytnnxxAb1SaIDTjp9XFlojK+bUGiH8Ac8=; b=itk6xe/EynGOQw+kEH66006p0hIwmQv2d0NnusfySnqRW2Evx+Emz71nBop5fNZNr2 4F0VVhzg9R7wj9nag1IBsmbr7aulvCiXovKLq6845j2spfmtEEZ6rtwpIFyPorO9K8TK CHp0QvZY6IElDKnwGGEoAnJS9chs5FgyMignEKNC5zzAV9WjSTYf9caWnInzuQbc6RTw UyQt4r3E/3vwNgC+zwDBkoNYmcb1IKrco1Z+EOyuFIcig3ixcdAkM/Jo3tS+HSnrei+G PbRA38PbGmBI9gRxH+el9thREcqw73WQoRCd7H5KFBLYv8SB8YLLJAMvs7obk7gt1duK 9ivA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Vz0vBmw8z0ytnnxxAb1SaIDTjp9XFlojK+bUGiH8Ac8=; b=SYmwdJtLkNNw18wDaVduUYFlJ87roCDddGCRrGxZpPYnZ53jBFcMYNKmFdYB9nV7U3 8hMLEPMxd5AXQaCLSdGf49Y/1sqaNKOJP7wzcm09ymEIMZogydCVwMdcd9o8UlUDcIUS xjzZ9r+DZBAM8iOSlet3evIaPdxyuwpWjkHYCK4ppeHJm9lXCT1TZOgOvwsLsgPKaXuh JDWW4z7GDLk2ahGwK3k/0OVHL7w4A2MczmWYEEUH5BV8jNfnGgBDEYmNomTSIwO+R7c9 qxJjDht9w+0D63ewDSzWIhiDNi5h0bdn01b+udHhnSFCc3YT8ShnXa63UJJnRhvB9Eo4 cQ8w== X-Gm-Message-State: AMke39keVX7XV+zP52c8FweygemOAlcaGWvD+Nhlp7FWXvw7vCXilngNW+nYjQEkW/g8AB86oQ5Pgfz7yneiMg== X-Received: by 10.28.157.70 with SMTP id g67mr2075070wme.111.1487063168649; Tue, 14 Feb 2017 01:06:08 -0800 (PST) Original-Received: by 10.223.142.230 with HTTP; Tue, 14 Feb 2017 01:05:48 -0800 (PST) In-Reply-To: <87zihpgnki.fsf@mbork.pl> X-Google-Sender-Auth: aCAD07qsxvDBIEGQSG4Wze0qIcM X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22a X-Mailman-Approved-At: Tue, 14 Feb 2017 09:58:49 -0500 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:112314 Archived-At: On Tue, Feb 14, 2017 at 3:54 PM, Marcin Borkowski wrote: > 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? As far as I understand: (describe-function 'read-string) Fourth arg DEFAULT-VALUE is the default value or the list of default values. If non-nil, it is used for history commands, and as the value (or the first element of the list of default values) to return if the user enters the empty string.