From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: peter_breton@yahoo.com, pete_lee@swbell.net, eliz@gnu.org,
emacs-devel@gnu.org
Subject: Re: insert-directory
Date: Mon, 24 May 2004 19:11:55 -0500 (CDT) [thread overview]
Message-ID: <200405250011.i4P0BtV17183@raven.dms.auburn.edu> (raw)
In-Reply-To: <200405240416.i4O4GBX08071@raven.dms.auburn.edu> (message from Luc Teirlinck on Sun, 23 May 2004 23:16:11 -0500 (CDT))
Below is my latest corrected version of
`dired-move-to-filename-regexp'. There are actually two regular
expressions. One for MS Windows and one for Unix style names. I
believe that the non-MS Windows one one works for all GNU-Unix style
file names, even if they mimic MS style names. I have tested it quite
a bit on GNU/Linux and it seems to work fine.
Remaining issues with `dired-move-to-filename-regexp':
I do not know anything about VMS, but I believe that the old value
_already_ made no attempt to deal with VMS.
Actually, apart from what I have read in the Elisp manual or learned
from reading emacs-devel, I do not know anything about MS Windows
either. Based on what Eli told me I _believe_ that the value I chose
should work, even after a bunch of recursive `i' 's. However, I have
no way to check and maybe my regexp for MS Windows might contain the
most obvious stupidities. Somebody with access to MS Windows and
interested in using `i' in *Locate* buffers will have to check (and
possibly correct or replace) my regexp.
Other issues:
I propose to replace the first line "Matches for..." with " Matches
for..." Putting one space at the beginning fixes a bug: with the
current first line, doing *! erases the `M", after which the first
line looks weird. Using two instead of one space would interfere with
the new value of `dired-move-to-filename-regexp'.
Mouse-2 currently does not work on the part inserted by `i'.
Moreover, anybody used to dired, or find-dired or similar, will expect
mouse-2 to visit the file in another window. Is there any reason for
doing anything different in locate-mode, especially since the dired
commamd `v' will view the file. Is there any substantial difference
between `dired-view-file' (`v') and `locate-mouse-view-file'?
The patch below just erases the current mouse-2 binding, thereby making
the dired binding visible again. But that part of the patch can, of
course, easily be taken out again if there is disagreement.
I do not know what `dired-permission-flags-regexp' is used for in
locate-mode, but I did not detect any problems resulting from leaving
it unchanged after doing `i'.
I will wait a couple of days before committing, to see whether there
are objections to any of the proposed changes, as well as to think
them over myself.
===File ~/locate-diff=======================================
*** locate.el 20 May 2004 17:14:36 -0500 1.22
--- locate.el 24 May 2004 16:36:07 -0500
***************
*** 281,287 ****
(define-key locate-mode-map [menu-bar mark directories] 'undefined)
(define-key locate-mode-map [menu-bar mark symlinks] 'undefined)
- (define-key locate-mode-map [mouse-2] 'locate-mouse-view-file)
(define-key locate-mode-map "\C-c\C-t" 'locate-tags)
(define-key locate-mode-map "U" 'dired-unmark-all-files)
--- 281,286 ----
***************
*** 345,353 ****
(make-local-variable 'dired-move-to-filename-regexp)
;; This should support both Unix and Windoze style names
(setq dired-move-to-filename-regexp
! (concat "."
! (make-string (1- locate-filename-indentation) ?\ )
! "\\(/\\|[A-Za-z]:\\)"))
(make-local-variable 'dired-actual-switches)
(setq dired-actual-switches "")
(make-local-variable 'dired-permission-flags-regexp)
--- 344,357 ----
(make-local-variable 'dired-move-to-filename-regexp)
;; This should support both Unix and Windoze style names
(setq dired-move-to-filename-regexp
! (if (memq system-type '(ms-dos windows-nt))
! (concat "^."
! (make-string (1- locate-filename-indentation) ?\ )
! "\\(/\\|[A-Za-z]:\\)\\|"
! (default-value 'dired-move-to-filename-regexp))
! (concat "^.\\("
! (make-string (1- locate-filename-indentation) ?\ )
! "/\\| /.*\\| \\)")))
(make-local-variable 'dired-actual-switches)
(setq dired-actual-switches "")
(make-local-variable 'dired-permission-flags-regexp)
***************
*** 386,392 ****
(dired-insert-set-properties (elt pos 0) (elt pos 1)))))
(defun locate-insert-header (search-string)
! (let ((locate-format-string "Matches for %s")
(locate-regexp-match
(concat " *Matches for \\(" (regexp-quote search-string) "\\)"))
(locate-format-args (list search-string))
--- 390,396 ----
(dired-insert-set-properties (elt pos 0) (elt pos 1)))))
(defun locate-insert-header (search-string)
! (let ((locate-format-string " Matches for %s")
(locate-regexp-match
(concat " *Matches for \\(" (regexp-quote search-string) "\\)"))
(locate-format-args (list search-string))
============================================================
next prev parent reply other threads:[~2004-05-25 0:11 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 ` Luc Teirlinck [this message]
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 ` insert-directory Luc Teirlinck
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=200405250011.i4P0BtV17183@raven.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=pete_lee@swbell.net \
--cc=peter_breton@yahoo.com \
/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).