[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep-tree should pass default value to read-string
From: |
Magnus Henoch |
Subject: |
grep-tree should pass default value to read-string |
Date: |
Mon, 17 Apr 2006 23:04:11 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (berkeley-unix) |
The interactive spec of grep-tree doesn't pass a default-value
argument to read-string. When it reads the regexp from the
minibuffer, I expect to be able to hit <down> to edit the default
value, but I can't. This patch fixes the problem:
2006-04-17 Magnus Henoch <address@hidden>
* progmodes/grep.el (grep-tree): Pass default value to read-string
in interactive spec (twice).
diff -c /home/magnus/noarchive/src/emacs-arch/lisp/progmodes/grep.el\~
/home/magnus/noarchive/src/emacs-arch/lisp/progmodes/grep.el
*** /home/magnus/noarchive/src/emacs-arch/lisp/progmodes/grep.el~ Wed Apr
5 09:49:50 2006
--- /home/magnus/noarchive/src/emacs-arch/lisp/progmodes/grep.el Mon Apr
17 22:57:22 2006
***************
*** 609,622 ****
(let* ((regexp
(if current-prefix-arg
grep-tree-last-regexp
! (let* ((default (current-word))
! (spec (read-string
! (concat "Search for"
! (if (and default (> (length default) 0))
! (format " (default %s): " default) ":
")))))
! (if (equal spec "") default spec))))
(files
! (read-string (concat "Search for \"" regexp "\" in files (default "
grep-tree-last-files "): ")))
(dir
(read-directory-name "Base directory: " nil default-directory t)))
(list regexp files dir)))
--- 609,623 ----
(let* ((regexp
(if current-prefix-arg
grep-tree-last-regexp
! (let ((default (current-word)))
! (read-string
! (concat "Search for"
! (if (and default (> (length default) 0))
! (format " (default %s): " default) ": "))
! nil nil default))))
(files
! (read-string (concat "Search for \"" regexp "\" in files (default "
grep-tree-last-files "): ")
! nil nil grep-tree-last-files))
(dir
(read-directory-name "Base directory: " nil default-directory t)))
(list regexp files dir)))
Diff finished. Mon Apr 17 22:58:50 2006
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- grep-tree should pass default value to read-string,
Magnus Henoch <=