From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: let HISTORY arg to read functions be a list of history variables Date: Sat, 30 Jun 2007 17:42:59 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1183250661 2023 80.91.229.12 (1 Jul 2007 00:44:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2007 00:44:21 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 01 02:44:14 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I4nXy-0001Z0-C9 for ged-emacs-devel@m.gmane.org; Sun, 01 Jul 2007 02:44:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4nXx-0005CL-Ph for ged-emacs-devel@m.gmane.org; Sat, 30 Jun 2007 20:44:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I4nXu-0005CG-Sh for emacs-devel@gnu.org; Sat, 30 Jun 2007 20:44:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I4nXs-0005Bs-Dl for emacs-devel@gnu.org; Sat, 30 Jun 2007 20:44:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4nXs-0005Bp-7p for emacs-devel@gnu.org; Sat, 30 Jun 2007 20:44:08 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I4nXr-0005lI-Op for emacs-devel@gnu.org; Sat, 30 Jun 2007 20:44:07 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l610i50c029502 for ; Sat, 30 Jun 2007 18:44:05 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l5UNYTRM013190 for ; Sat, 30 Jun 2007 18:44:05 -0600 Original-Received: from dhcp-amer-csvpn-gw1-141-144-64-76.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3003352331183250585; Sat, 30 Jun 2007 17:43:05 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74083 Archived-At: 1. How about letting the HISTORY argument to read functions (e.g. `read-string') be a list of history variables, in addition to letting it be a single history variable? The histories would be appended for user retrieval. The convention for saving the user input could be either that it is added to only the first history or that it is added to each of the histories. Then, for example, you could write this and let users use a regexp from either history: (read-string "Regexp: " nil '(hi-lock-regexp-history regexp-history)) Here, `hi-lock-regexp-history' would presumably be more specific to the task at hand, so it is placed first. Still, the user has access to more general regexps from `regexp-history'. This argument form should cohabit OK with the use of a list argument such as (HISTORY . POS) to indicate a position, since POS cannot be a non-empty list. Either we would not allow the position to be specified in the case of multiple histories, or we would allow it only for the first history - e.g. ((hi-lock-regexp-history . 2) regexp-history). 2. Perhaps(?) even better would be to allow a two-element list as history argumen: (VARS LIST), where VARS is a list of history variables to update with the user's entered input and LIST is a history list (not a symbol) to use for inputting. That is, let the history to use for `M-p' etc. be an actual history list (not a variable), and specify separately the history variables to be updated with the user's entered input. This would let you do more than just append two histories as in #1 - you could combine them in any way, including filtering them. IOW, separate history-as-input (list of past inputs, for M-p) from history-as-output (history variables, updated with the new input).