From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Isearch in dired Date: Sun, 09 Nov 2008 23:57:18 +0200 Organization: JURTA Message-ID: <87ej1kmukh.fsf@jurta.org> References: <87d4h6mphd.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1226269496 11765 80.91.229.12 (9 Nov 2008 22:24:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Nov 2008 22:24:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 09 23:25:59 2008 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 1KzIjF-0001B2-33 for ged-emacs-devel@m.gmane.org; Sun, 09 Nov 2008 23:25:57 +0100 Original-Received: from localhost ([127.0.0.1]:37471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzIi7-0005Tv-7o for ged-emacs-devel@m.gmane.org; Sun, 09 Nov 2008 17:24:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzIi1-0005Qo-40 for emacs-devel@gnu.org; Sun, 09 Nov 2008 17:24:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzIi0-0005QO-KN for emacs-devel@gnu.org; Sun, 09 Nov 2008 17:24:40 -0500 Original-Received: from [199.232.76.173] (port=56346 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzIi0-0005Q3-Bq for emacs-devel@gnu.org; Sun, 09 Nov 2008 17:24:40 -0500 Original-Received: from relay01.kiev.sovam.com ([62.64.120.200]:1566) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KzIhy-00013Y-Qn; Sun, 09 Nov 2008 17:24:39 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1KzIhw-000O8d-Fd; Mon, 10 Nov 2008 00:24:36 +0200 In-Reply-To: (Richard M. Stallman's message of "Sat, 08 Nov 2008 19:26:25 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 943bd2add5b59813b566ba206a0ec11c X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Trusted X-SpamTest-Info: Profiles 5651 [Nov 10 2008] X-SpamTest-Info: {received from trusted relay: common white list} X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: white ip list X-SpamTest-Rate: 10 X-SpamTest-Status: Trusted X-SpamTest-Status-Extended: trusted X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.8-5.1 (or MacOS X 10.2-10.3) 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:105511 Archived-At: > I think the most convenient default behavior would be context-dependent, > i.e. match only file names when point is on the file name column - where > point stays most of the time: after opening a dired buffer and through > dired operations including navigation. So it would be natural to do the > same for isearch - never let point leave the file name column. > > To search of the entire buffer, the user can move point outside the > file name column. Since this need is very rare, there's no hassle. > > That sounds quite convenient. If the prompt says "File name Isearch" > when appropriate, people will understand what's going on. While this change is still under discussion, the patch below at least implements the prompt that says "File name Isearch". It adds two new variables isearch-message-prefix and isearch-message-suffix to insert search-specific text before and after the stardard isearch messages. However, I think that one word would be better to understand in the isearch message, because other indications are all one word: "failing", "wrapped", "regexp". Please compare which is more readble: Failing wrapped File name regexp I-search: Failing wrapped Filename regexp I-search: Index: lisp/dired-aux.el =================================================================== RCS file: /sources/emacs/emacs/lisp/dired-aux.el,v retrieving revision 1.180 diff -c -r1.180 dired-aux.el *** lisp/dired-aux.el 22 Oct 2008 20:21:21 -0000 1.180 --- lisp/dired-aux.el 9 Nov 2008 21:54:14 -0000 *************** *** 2355,2368 **** (defun dired-isearch-filenames () "Search for a string using Isearch only in file names in the Dired buffer." (interactive) ! (let ((dired-isearch-filenames t)) (isearch-forward))) ;;;###autoload (defun dired-isearch-filenames-regexp () "Search for a regexp using Isearch only in file names in the Dired buffer." (interactive) ! (let ((dired-isearch-filenames t)) (isearch-forward-regexp))) --- 2355,2370 ---- (defun dired-isearch-filenames () "Search for a string using Isearch only in file names in the Dired buffer." (interactive) ! (let ((dired-isearch-filenames t) ! (isearch-message-prefix "File name ")) (isearch-forward))) ;;;###autoload (defun dired-isearch-filenames-regexp () "Search for a regexp using Isearch only in file names in the Dired buffer." (interactive) ! (let ((dired-isearch-filenames t) ! (isearch-message-prefix "File name ")) (isearch-forward-regexp))) Index: lisp/isearch.el =================================================================== RCS file: /sources/emacs/emacs/lisp/isearch.el,v retrieving revision 1.331 diff -c -r1.331 isearch.el *** lisp/isearch.el 19 Oct 2008 22:33:17 -0000 1.331 --- lisp/isearch.el 9 Nov 2008 21:54:47 -0000 *************** *** 532,537 **** --- 532,539 ---- (defvar isearch-string "") ; The current search string. (defvar isearch-message "") ; text-char-description version of isearch-string + (defvar isearch-message-prefix nil) + (defvar isearch-message-suffix nil) (defvar isearch-success t) ; Searching is currently successful. (defvar isearch-error nil) ; Error message for failed search. *************** *** 2144,2149 **** --- 2162,2168 ---- (< (point) isearch-opoint))) "over") (if isearch-wrapped "wrapped ") + (or isearch-message-prefix "") (if isearch-word "word " "") (if isearch-regexp "regexp " "") (if multi-isearch-next-buffer-current-function "multi " "") *************** *** 2160,2166 **** (concat (if c-q-hack "^Q" "") (if isearch-error (concat " [" isearch-error "]") ! ""))) ;; Searching --- 2179,2186 ---- (concat (if c-q-hack "^Q" "") (if isearch-error (concat " [" isearch-error "]") ! "") ! (or isearch-message-suffix ""))) ;; Searching -- Juri Linkov http://www.jurta.org/emacs/