From: Juri Linkov <juri@jurta.org>
To: emacs-devel@gnu.org
Subject: Re: Minibuffer default values list
Date: Mon, 12 Nov 2007 01:45:14 +0200 [thread overview]
Message-ID: <874pfsuzf9.fsf@jurta.org> (raw)
In-Reply-To: <87zlycuhrd.fsf@jurta.org> (Juri Linkov's message of "Mon, 22 Oct 2007 03:22:15 +0300")
I remember there were discussions what the default value is better to
use in `occur'. Now there is no need to select only one default value.
The patch below adds a list of default values to `keep-lines',
`flush-lines', `how-many' and `occur':
Index: lisp/replace.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/replace.el,v
retrieving revision 1.260
diff -c -r1.260 replace.el
*** lisp/replace.el 10 Nov 2007 21:48:46 -0000 1.260
--- lisp/replace.el 11 Nov 2007 23:45:09 -0000
***************
*** 533,540 ****
"Read arguments for `keep-lines' and friends.
Prompt for a regexp with PROMPT.
Value is a list, (REGEXP)."
! (list (read-from-minibuffer prompt nil nil nil
! 'regexp-history nil t)
nil nil t))
(defun keep-lines (regexp &optional rstart rend interactive)
--- 533,550 ----
"Read arguments for `keep-lines' and friends.
Prompt for a regexp with PROMPT.
Value is a list, (REGEXP)."
! (list (read-from-minibuffer
! prompt nil nil nil 'regexp-history
! (delq nil (list
! (regexp-quote
! (funcall (or find-tag-default-function
! (get major-mode 'find-tag-default-function)
! 'find-tag-default)))
! (car regexp-search-ring)
! (regexp-quote (car search-ring))
! (car (symbol-value
! query-replace-from-history-variable))))
! t)
nil nil t))
(defun keep-lines (regexp &optional rstart rend interactive)
***************
*** 938,958 ****
(nreverse result))))
(defun occur-read-primary-args ()
! (list (let* ((default (car regexp-history))
(input
(read-from-minibuffer
! (if default
! (format "List lines matching regexp (default %s): "
! (query-replace-descr default))
! "List lines matching regexp: ")
! nil
! nil
! nil
! 'regexp-history
! default)))
! (if (equal input "")
! default
! input))
(when current-prefix-arg
(prefix-numeric-value current-prefix-arg))))
--- 948,972 ----
(nreverse result))))
(defun occur-read-primary-args ()
! (list (let* ((default
! (delq nil (list
! (and transient-mark-mode mark-active
! (regexp-quote
! (buffer-substring-no-properties
! (region-beginning) (region-end))))
! (regexp-quote
! (funcall (or find-tag-default-function
! (get major-mode 'find-tag-default-function)
! 'find-tag-default)))
! (car regexp-search-ring)
! (regexp-quote (car search-ring))
! (car (symbol-value
! query-replace-from-history-variable)))))
(input
(read-from-minibuffer
! "List lines matching regexp: "
! nil nil nil 'regexp-history default)))
! input)
(when current-prefix-arg
(prefix-numeric-value current-prefix-arg))))
--
Juri Linkov
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2007-11-11 23:45 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-22 0:22 Minibuffer default values list Juri Linkov
2007-10-23 7:12 ` Richard Stallman
2007-10-28 10:57 ` Juri Linkov
2007-11-11 23:42 ` Juri Linkov
2007-11-12 5:59 ` Richard Stallman
2007-11-16 1:27 ` Substitute ? in dired without surrounding whitespace (was: Minibuffer default values list) Juri Linkov
2007-11-17 23:30 ` Richard Stallman
2007-11-17 23:57 ` Substitute ? in dired without surrounding whitespace Juri Linkov
2007-11-18 22:46 ` Richard Stallman
2007-11-19 0:48 ` Minibuffer default values list Juri Linkov
2007-11-22 2:28 ` Richard Stallman
2007-11-22 19:02 ` Juri Linkov
2007-11-23 4:35 ` Richard Stallman
2007-11-24 17:54 ` Juri Linkov
2007-11-25 3:43 ` Richard Stallman
2007-11-25 15:18 ` mb-pos.el (was: Minibuffer default values list) Juri Linkov
2007-12-02 21:27 ` Richard Stallman
2007-12-03 0:34 ` Minibuffer default values list Juri Linkov
2007-12-03 18:43 ` Richard Stallman
2007-11-25 15:19 ` Subject: mb-depth.el (was: Minibuffer default values list) Juri Linkov
2008-07-31 17:28 ` Juri Linkov
2008-07-31 18:08 ` Drew Adams
2008-07-31 18:24 ` Juanma Barranquero
2008-07-31 18:35 ` Drew Adams
2008-08-01 12:34 ` Juanma Barranquero
2008-08-01 16:27 ` Drew Adams
2008-08-01 17:09 ` mb-depth.el patch Drew Adams
2008-08-04 13:13 ` Juanma Barranquero
2007-11-23 4:35 ` Minibuffer default values list Richard Stallman
2007-11-23 15:05 ` Stefan Monnier
[not found] ` <E1IvwoM-0004oD-AU@fencepost.gnu.org>
[not found] ` <jwvwss5ptqv.fsf-monnier+emacs@gnu.org>
2007-12-03 18:42 ` Richard Stallman
2007-11-19 0:52 ` Juri Linkov
2007-11-19 19:02 ` Richard Stallman
2007-11-23 0:48 ` Juri Linkov
2007-11-11 23:43 ` Juri Linkov
2007-11-12 5:59 ` Richard Stallman
2007-11-11 23:45 ` Juri Linkov [this message]
2007-11-12 5:59 ` Richard Stallman
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=874pfsuzf9.fsf@jurta.org \
--to=juri@jurta.org \
--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.