Subject: Re: bug#4301: rgrep/lgrep defaults

From: Juri Linkov <[email-masked]>
Date: Thu, 10 Sep 2009 04:07:17 +0300

Currently reading a file name pattern in rgep/lgrep provides no completion.
I think it would be better to provide file completion for the case when
the user wants to limit the search to one particular file in the current
directory, or to build a file name pattern based on the file in the
current directory.

Index: lisp/progmodes/grep.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v
retrieving revision 1.107
diff -c -r1.107 grep.el
*** lisp/progmodes/grep.el	10 Sep 2009 00:57:44 -0000	1.107
--- lisp/progmodes/grep.el	10 Sep 2009 01:06:46 -0000
***************
*** 788,799 ****
  	       default-extension
  	       (car grep-files-history)
  	       (car (car grep-files-aliases))))
! 	 (files (read-string
  		 (concat "Search for \"" regexp
  			 "\" in files"
  			 (if default (concat " (default " default ")"))
  			 ": ")
! 		 nil 'grep-files-history
  		 (delete-dups
  		  (delq nil (append (list default default-alias default-extension)
  				    (mapcar 'car grep-files-aliases)))))))
--- 788,800 ----
  	       default-extension
  	       (car grep-files-history)
  	       (car (car grep-files-aliases))))
! 	 (files (completing-read
  		 (concat "Search for \"" regexp
  			 "\" in files"
  			 (if default (concat " (default " default ")"))
  			 ": ")
! 		 'read-file-name-internal
! 		 nil nil nil 'grep-files-history
  		 (delete-dups
  		  (delq nil (append (list default default-alias default-extension)
  				    (mapcar 'car grep-files-aliases)))))))

-- 
Juri Linkov
http://www.jurta.org/emacs/