From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: One-off history for read-string Date: Fri, 25 Sep 2015 19:33:31 -0700 Message-ID: References: <87y4fwt3vq.fsf@mbork.pl> <87twqjpc9h.fsf@debian.uxu> <87oagrt1d0.fsf@mbork.pl> <87zj0arl88.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1443234843 11476 80.91.229.3 (26 Sep 2015 02:34:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Sep 2015 02:34: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 Sep 26 04:34:03 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZffJJ-0002u9-LE for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Sep 2015 04:34:01 +0200 Original-Received: from localhost ([::1]:51655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZffJJ-0008Un-1e for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Sep 2015 22:34:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZffJA-0008UN-26 for help-gnu-emacs@gnu.org; Fri, 25 Sep 2015 22:33:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZffJ9-0000aY-A4 for help-gnu-emacs@gnu.org; Fri, 25 Sep 2015 22:33:51 -0400 Original-Received: from mail-ob0-x22a.google.com ([2607:f8b0:4003:c01::22a]:33200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZffJ9-0000a2-5Y for help-gnu-emacs@gnu.org; Fri, 25 Sep 2015 22:33:51 -0400 Original-Received: by obbbh8 with SMTP id bh8so94841846obb.0 for ; Fri, 25 Sep 2015 19:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=cdUToNtqJiE8dZRO/N2lROcwNx5bumXt4l/4LSNsGcs=; b=TDa/is+2zxTNe3MkDVINnlXjrFGBeZtclys+ixgWbnw2CTst8J4TIUK4+KHtgvf+G6 XhIgnWJzyK6BMU54U7f544rW5lMaCWizCYwaMDwfFF6dPskN5SOBO7UPcDNn5r6n4ihq XGnbX7tkcJp7ztGFX7UDBTGD43qEBII2hdW5ks59A99dFuTlzg7C8SzV9nK1hQt+ygW4 UFt8xwj6Qk0N0umwmiWZkubznJ2434s/Jb2/H5biQAT1M9Sy/tR3yVYMW0Gd6/rsPwK1 +J5g+jUQ3aZ2pECJAGrGM4tVCgi2vHjrLlZnCH+L1Sqie2GI5QP2OXLO+E+3u3pstGWN npjA== X-Received: by 10.60.159.232 with SMTP id xf8mr4683913oeb.34.1443234830589; Fri, 25 Sep 2015 19:33:50 -0700 (PDT) Original-Received: by 10.76.45.8 with HTTP; Fri, 25 Sep 2015 19:33:31 -0700 (PDT) In-Reply-To: <87zj0arl88.fsf@debian.uxu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::22a X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107362 Archived-At: Emanuel Berg wrote: > > However, I don't care about /writing/ it to some > > variable in Emacs, since the new entry will be > > uploaded to the server anyway, and taken from there > > the next time, together with the rest of > > the history. > > So then, what does it matter? He wants history to be available to the user (e.g. `M-p'), but he wants that history to come from a server rather than be accumulated in the usual way. So the history on the server is likely changing over time, but from the Lisp code's perspective it's conceptually a new list each time. Something like this, if I understand him correctly: (defvar readonly-history) (defun get-history-list-from-server () ;; Imagine we fetch this list of HTTP (list "foo" "bar" "baz" "quux")) (defun my-read-string (prompt) (let ((readonly-history (get-history-list-from-server))) (read-string prompt nil 'readonly-history))) -- john