* make ffap wildcard-friendly
@ 2004-11-25 1:01 Dan Jacobson
0 siblings, 0 replies; 5+ messages in thread
From: Dan Jacobson @ 2004-11-25 1:01 UTC (permalink / raw)
(setq ffap-dired-wildcards "[*?][^/]*\\'") should be the default.
Hmm, the docstring doesn't say what if then there really is a filename
with those...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: make ffap wildcard-friendly
[not found] <mailman.1377.1101361274.27204.bug-gnu-emacs@gnu.org>
@ 2004-12-01 16:25 ` Kevin Rodgers
2004-12-01 20:11 ` Juri Linkov
[not found] ` <mailman.2869.1101932669.27204.bug-gnu-emacs@gnu.org>
0 siblings, 2 replies; 5+ messages in thread
From: Kevin Rodgers @ 2004-12-01 16:25 UTC (permalink / raw)
Dan Jacobson wrote:
> (setq ffap-dired-wildcards "[*?][^/]*\\'") should be the default.
> Hmm, the docstring doesn't say what if then there really is a filename
> with those...
And the comment in the code confirms that is one of the reasons it is
disabled by default:
;; Suggestion from RHOGEE, 07 Jul 1994. Disabled, dired is still
;; available by "C-x C-d <pattern>", and valid filenames may
;; sometimes contain wildcard characters.
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: make ffap wildcard-friendly
2004-12-01 16:25 ` make ffap wildcard-friendly Kevin Rodgers
@ 2004-12-01 20:11 ` Juri Linkov
[not found] ` <mailman.2869.1101932669.27204.bug-gnu-emacs@gnu.org>
1 sibling, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2004-12-01 20:11 UTC (permalink / raw)
Cc: ihs_4664, jidanni
Kevin Rodgers <ihs_4664@yahoo.com> writes:
> Dan Jacobson wrote:
>> (setq ffap-dired-wildcards "[*?][^/]*\\'") should be the default.
>> Hmm, the docstring doesn't say what if then there really is a filename
>> with those...
>
> And the comment in the code confirms that is one of the reasons it is
> disabled by default:
>
> ;; Suggestion from RHOGEE, 07 Jul 1994. Disabled, dired is still
> ;; available by "C-x C-d <pattern>", and valid filenames may
> ;; sometimes contain wildcard characters.
`find-file' can expand wildcards, so it makes sense to call
`find-file' with WILDCARDS argument instead of `dired'.
So I think the following patch will do the right thing:
C-x C-f (find-file-at-point) works like `find-file' wrt wildcards,
and C-x d (dired-at-point) calls `dired' with wildcards.
It contains also fixes to copy correctly all wildcards to the minibuffer.
Index: lisp/ffap.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ffap.el,v
retrieving revision 1.45
diff -c -r1.45 ffap.el
*** lisp/ffap.el 9 Jun 2004 18:32:06 -0000 1.45
--- lisp/ffap.el 1 Dec 2004 20:02:14 -0000
***************
*** 202,214 ****
;; through this section for features that you like, put an appropriate
;; enabler in your .emacs file.
! (defcustom ffap-dired-wildcards nil
! ;; Suggestion from RHOGEE, 07 Jul 1994. Disabled, dired is still
! ;; available by "C-x C-d <pattern>", and valid filenames may
! ;; sometimes contain wildcard characters.
"*A regexp matching filename wildcard characters, or nil.
If `find-file-at-point' gets a filename matching this pattern,
! it passes it on to `dired' instead of `find-file'."
:type '(choice (const :tag "Disable" nil)
(const :tag "Enable" "[*?][^/]*\\'")
;; regexp -- probably not useful
--- 202,218 ----
;; through this section for features that you like, put an appropriate
;; enabler in your .emacs file.
! (defcustom ffap-dired-wildcards "[*?][^/]*\\'"
"*A regexp matching filename wildcard characters, or nil.
+
If `find-file-at-point' gets a filename matching this pattern,
! it passes it on to `find-file' with non-nil WILDCARDS argument,
! which expands wildcards and visits multiple files. To visit
! a file whose name contains wildcard characters you can suppress
! wildcard expansion by setting `find-file-wildcards'.
!
! If `dired-at-point' gets a filename matching this pattern,
! it passes it on to `dired'."
:type '(choice (const :tag "Disable" nil)
(const :tag "Enable" "[*?][^/]*\\'")
;; regexp -- probably not useful
***************
*** 939,945 ****
;; Slightly controversial decisions:
;; * strip trailing "@" and ":"
;; * no commas (good for latex)
! (file "--:$+<>@-Z_a-z~" "<@" "@>;.,!?:")
;; An url, or maybe a email/news message-id:
(url "--:=&?$+@-Z_a-z~#,%;" "^A-Za-z0-9" ":;.,!?")
;; Find a string that does *not* contain a colon:
--- 943,949 ----
;; Slightly controversial decisions:
;; * strip trailing "@" and ":"
;; * no commas (good for latex)
! (file "--:$+<>@-Z_a-z~*?" "<@" "@>;.,!:")
;; An url, or maybe a email/news message-id:
(url "--:=&?$+@-Z_a-z~#,%;" "^A-Za-z0-9" ":;.,!?")
;; Find a string that does *not* contain a colon:
***************
*** 1187,1192 ****
--- 1191,1199 ----
remote-dir (substring name (match-end 1)))))
(ffap-file-exists-string
(ffap-replace-file-component remote-dir name))))))
+ ((and ffap-dired-wildcards
+ (string-match ffap-dired-wildcards name)
+ name))
;; Try all parent directories by deleting the trailing directory
;; name until existing directory is found or name stops changing
((let ((dir name))
***************
*** 1357,1366 ****
((ffap-url-p filename)
(let (current-prefix-arg) ; w3 2.3.25 bug, reported by KPC
(funcall ffap-url-fetcher filename)))
- ;; This junk more properly belongs in a modified ffap-file-finder:
((and ffap-dired-wildcards
! (string-match ffap-dired-wildcards filename))
! (dired filename))
((or (not ffap-newfile-prompt)
(file-exists-p filename)
(y-or-n-p "File does not exist, create buffer? "))
--- 1364,1374 ----
((ffap-url-p filename)
(let (current-prefix-arg) ; w3 2.3.25 bug, reported by KPC
(funcall ffap-url-fetcher filename)))
((and ffap-dired-wildcards
! (string-match ffap-dired-wildcards filename)
! (eq ffap-file-finder 'find-file)
! find-file-wildcards)
! (funcall ffap-file-finder (expand-file-name filename) t))
((or (not ffap-newfile-prompt)
(file-exists-p filename)
(y-or-n-p "File does not exist, create buffer? "))
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: make ffap wildcard-friendly
[not found] ` <mailman.2869.1101932669.27204.bug-gnu-emacs@gnu.org>
@ 2005-03-18 15:30 ` Benjamin Rutt
2005-03-18 17:16 ` Juri Linkov
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Rutt @ 2005-03-18 15:30 UTC (permalink / raw)
I realize that a related change has now been checked into Emacs CVS.
A related lisp/Changelog entry from 2004-12-12 Juri Linkov <juri@jurta.org>:
(find-file-at-point): When filename matches ffap-dired-wildcards, call
ffap-file-finder with t arg `wildcards', instead of dired.
I find that this change interrupts my workflow, as I'm so used to
doing e.g. C-x C-f /tmp/log.* RET etc, to get a nice dired listing of
files, and then I can choose one. Would you consider making the new
behavior an option which is enabled by default which I can then
disable, to preserve my normal workflow? How about the following
patch. Let me know you think.
Thanks,
Benjamin Rutt
*** ffap.el.orig Fri Mar 18 09:59:28 2005
--- ffap.el Fri Mar 18 10:28:48 2005
***************
*** 217,226 ****
"*A regexp matching filename wildcard characters, or nil.
If `find-file-at-point' gets a filename matching this pattern,
! it passes it on to `find-file' with non-nil WILDCARDS argument,
! which expands wildcards and visits multiple files. To visit
! a file whose name contains wildcard characters you can suppress
! wildcard expansion by setting `find-file-wildcards'.
If `dired-at-point' gets a filename matching this pattern,
it passes it on to `dired'."
--- 217,230 ----
"*A regexp matching filename wildcard characters, or nil.
If `find-file-at-point' gets a filename matching this pattern,
! and `ffap-always-pass-wildcards-to-dired' is nil, it passes it on
! to `find-file' with non-nil WILDCARDS argument, which expands
! wildcards and visits multiple files. To visit a file whose name
! contains wildcard characters you can suppress wildcard expansion
! by setting `find-file-wildcards'. If `find-file-at-point' gets a
! filename matching this pattern and
! `ffap-always-pass-wildcards-to-dired' is non-nil, it passes it on
! to `dired'.
If `dired-at-point' gets a filename matching this pattern,
it passes it on to `dired'."
***************
*** 230,235 ****
--- 234,245 ----
)
:group 'ffap)
+ (defcustom ffap-always-pass-wildcards-to-dired nil
+ "*If non-nil, than always pass filenames matching
+ `ffap-dired-wildcards' to dired."
+ :type 'boolean
+ :group 'ffap)
+
(defcustom ffap-newfile-prompt nil
;; Suggestion from RHOGEE, 11 Jul 1994. Disabled, I think this is
;; better handled by `find-file-not-found-hooks'.
***************
*** 1388,1393 ****
--- 1398,1407 ----
(funcall ffap-url-fetcher filename)))
((and ffap-dired-wildcards
(string-match ffap-dired-wildcards filename)
+ ffap-always-pass-wildcards-to-dired)
+ (dired filename))
+ ((and ffap-dired-wildcards
+ (string-match ffap-dired-wildcards filename)
find-file-wildcards
;; Check if it's find-file that supports wildcards arg
(memq ffap-file-finder '(find-file
find-alternate-file)))
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: make ffap wildcard-friendly
2005-03-18 15:30 ` Benjamin Rutt
@ 2005-03-18 17:16 ` Juri Linkov
0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2005-03-18 17:16 UTC (permalink / raw)
Cc: bug-gnu-emacs
Benjamin Rutt <rutt.4+news@osu.edu> writes:
> I realize that a related change has now been checked into Emacs CVS.
> A related lisp/Changelog entry from 2004-12-12 Juri Linkov <juri@jurta.org>:
>
> (find-file-at-point): When filename matches ffap-dired-wildcards, call
> ffap-file-finder with t arg `wildcards', instead of dired.
>
> I find that this change interrupts my workflow, as I'm so used to
> doing e.g. C-x C-f /tmp/log.* RET etc, to get a nice dired listing of
> files, and then I can choose one. Would you consider making the new
> behavior an option which is enabled by default which I can then
> disable, to preserve my normal workflow? How about the following
> patch. Let me know you think.
This change was intended to make ffap key bindings `C-x C-f'
(find-file-at-point) and `C-x d' (dired-at-point) behave exactly
as their standard conterparts without ffap loaded (i.e. `C-x C-f'
(find-file) and `C-x d' (dired)) in regard to wildcards. I think,
if everyone agrees, we could add a ffap option to enable old
non-standard behavior of `C-x C-f' as you proposed.
--
Juri Linkov
http://www.jurta.org/emacs/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-03-18 17:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.1377.1101361274.27204.bug-gnu-emacs@gnu.org>
2004-12-01 16:25 ` make ffap wildcard-friendly Kevin Rodgers
2004-12-01 20:11 ` Juri Linkov
[not found] ` <mailman.2869.1101932669.27204.bug-gnu-emacs@gnu.org>
2005-03-18 15:30 ` Benjamin Rutt
2005-03-18 17:16 ` Juri Linkov
2004-11-25 1:01 Dan Jacobson
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.