From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: insert-directory
Date: Thu, 27 May 2004 10:51:39 -0500 (CDT) [thread overview]
Message-ID: <200405271551.i4RFpdp28610@raven.dms.auburn.edu> (raw)
In-Reply-To: <86ekp6mjzo.fsf@rumba.de.uu.net> (message from Kai Grossjohann on Thu, 27 May 2004 09:01:31 +0200)
Kai Grossjohann wrote:
Luc Teirlinck <teirllm@dms.auburn.edu> 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.
next prev parent reply other threads:[~2004-05-27 15:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-23 22:18 insert-directory Luc Teirlinck
2004-05-24 0:00 ` insert-directory Luc Teirlinck
2004-05-24 3:29 ` insert-directory Luc Teirlinck
2004-05-24 3:55 ` insert-directory Luc Teirlinck
2004-05-24 3:55 ` insert-directory Luc Teirlinck
2004-05-24 4:16 ` insert-directory Luc Teirlinck
2004-05-25 0:11 ` insert-directory Luc Teirlinck
2004-05-25 2:16 ` insert-directory Luc Teirlinck
2004-05-26 20:26 ` insert-directory Luc Teirlinck
2004-05-26 20:35 ` insert-directory David Kastrup
2004-05-26 20:42 ` insert-directory Luc Teirlinck
2004-05-27 7:01 ` insert-directory Kai Grossjohann
2004-05-27 15:51 ` Luc Teirlinck [this message]
2004-06-07 9:59 ` locate and find-dired (was: insert-directory) Juri Linkov
2004-06-07 11:17 ` locate and find-dired Kai Grossjohann
2004-06-07 11:59 ` Juri Linkov
2004-05-25 16:06 ` insert-directory 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200405271551.i4RFpdp28610@raven.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).