From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: insert-directory Date: Thu, 27 May 2004 10:51:39 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200405271551.i4RFpdp28610@raven.dms.auburn.edu> References: <200405232218.i4NMIw307789@raven.dms.auburn.edu> <200405240000.i4O00ck07917@raven.dms.auburn.edu> <200405240329.i4O3T4B08005@raven.dms.auburn.edu> <200405240416.i4O4GBX08071@raven.dms.auburn.edu> <200405250011.i4P0BtV17183@raven.dms.auburn.edu> <200405250216.i4P2GO717266@raven.dms.auburn.edu> <200405262026.i4QKQSq13079@raven.dms.auburn.edu> <86ekp6mjzo.fsf@rumba.de.uu.net> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1085674511 16728 80.91.224.253 (27 May 2004 16:15:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 May 2004 16:15:11 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu May 27 18:14:57 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTNWy-0003ZU-00 for ; Thu, 27 May 2004 18:14:56 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BTNWy-00057j-00 for ; Thu, 27 May 2004 18:14:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BTNFn-0002jK-AC for emacs-devel@quimby.gnus.org; Thu, 27 May 2004 11:57:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BTNEv-0002iT-M5 for emacs-devel@gnu.org; Thu, 27 May 2004 11:56:17 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BTNEM-0002b2-PQ for emacs-devel@gnu.org; Thu, 27 May 2004 11:56:16 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BTNBI-00027O-G1 for emacs-devel@gnu.org; Thu, 27 May 2004 11:52:33 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i4RFqLuE009033; Thu, 27 May 2004 10:52:21 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i4RFpdp28610; Thu, 27 May 2004 10:51:39 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: kai@emptydomain.de In-reply-to: <86ekp6mjzo.fsf@rumba.de.uu.net> (message from Kai Grossjohann on Thu, 27 May 2004 09:01:31 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24024 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24024 Kai Grossjohann wrote: Luc Teirlinck writes: > 3. Making `i' work _absolutely perfectly_ in _every possible aspect_ > seems theoretically impossible, because the buffer is not in > dired-mode. I wonder if it makes sense to have the locate output look more like the find-dired output? Then the buffer could be in dired mode normally. (One could call file-attributes on each filename returned by locate and construct "ls -l" like output from that.) I am afraid that would force a complete rewrite of locate.el. In spite of my theoretical concerns above, things seem to work well in practice. I am a little bit reluctant to post a new patch each time a make a further minor change but I added: (setq selective-display t) (set (make-local-variable 'page-delimiter) "\n\n") and after that, the parts inserted by `i' are pretty much in dired-mode. The reason why those parts can be while the main listing is not are the "\\|" in the regular expressions. That leaves us with the one problem we can not get around: parts of the dired-code that do: (if (eq major-mode 'dired-mode) and the like. There are several places like that in dired-aux and dired-x, but at first sight they do not seem applicable. The one place in dired.el itself is `dired-sort-other': (if (eq major-mode 'dired-mode) (dired-sort-set-modeline)) But (dired-sort-set-modeline) _really_ only makes sense if the buffer is in dired-mode. After adding the two lines above, the only dired commands that seem to produce problems are the updating commands `g' and `l' (on a directory header line). `g' in locate-mode will produce problems anyway, unless you are running as root. If you are not you get: fatal error: updatedb: You are not authorized to create a default slocate database! Actually, the trouble with `l' (or the remaining problem with `g', if you are root) are a dired problem. Dired does not store the switches used for a subdirectory. (I believe that, sooner or later, this should be fixed.) As a result, not only does `l' on a directory header line give problems in *Locate* and (after applying the patch for find-dired I posted) in *Find* buffers, but it gives problems in ordinary dired buffers as well if `C-u i' was used. In particular, `C-u i' does not work in a dired buffer in which auto-revert-mode is enabled. The switches get overridden after 0 to 5 seconds. Auto-reverting does not work in *Locate* or *Find* buffers anyway. Sincerely, Luc.