all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Emacs-Devel" <emacs-devel@gnu.org>
Subject: let HISTORY arg to read functions be a list of history variables
Date: Sat, 30 Jun 2007 17:42:59 -0700	[thread overview]
Message-ID: <BDEIJAFNGDOAGCJIPKPBOEGJCFAA.drew.adams@oracle.com> (raw)

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).

             reply	other threads:[~2007-07-01  0:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-01  0:42 Drew Adams [this message]
2007-07-01 13:48 ` let HISTORY arg to read functions be a list of history variables Mathias Dahl
2007-07-01 16:31 ` Richard Stallman
2007-07-01 21:01 ` Juri Linkov
2007-07-01 22:06   ` Drew Adams
2007-07-02 16:09     ` Davis Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BDEIJAFNGDOAGCJIPKPBOEGJCFAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.