;;; ffap.el --- find file (or url) at point
-;; Copyright (C) 1995, 96, 97, 2000, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 2000, 2002, 2003, 2004,
+;; 2005 Free Software Foundation, Inc.
;; Author: Michelangelo Grigni <mic@mathcs.emory.edu>
;; Maintainer: Rajesh Vaidheeswarran <rv@gnu.org>
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
\f
;;; Commentary:
"*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'.
+and `ffap-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-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'."
)
:group 'ffap)
+(defcustom ffap-pass-wildcards-to-dired nil
+ "*If non-nil, 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'.
;; * 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" ":;.,!?")
+ (url "--:=&?$+@-Z_a-z~#,%;*" "^A-Za-z0-9" ":;.,!?")
;; Find a string that does *not* contain a colon:
(nocolon "--9$+<>@-Z_a-z~" "<@" "@>;.,!?")
;; A machine:
((ffap-url-p filename)
(let (current-prefix-arg) ; w3 2.3.25 bug, reported by KPC
(funcall ffap-url-fetcher filename)))
+ ((and ffap-pass-wildcards-to-dired
+ ffap-dired-wildcards
+ (string-match ffap-dired-wildcards filename))
+ (funcall ffap-directory-finder filename))
((and ffap-dired-wildcards
(string-match ffap-dired-wildcards filename)
find-file-wildcards
(local-set-key "\M-l" 'ffap-gnus-next)
(local-set-key "\M-m" 'ffap-gnus-menu))
+(defvar gnus-summary-buffer)
+(defvar gnus-article-buffer)
+
(defun ffap-gnus-wrapper (form) ; used by both commands below
(and (eq (current-buffer) (get-buffer gnus-summary-buffer))
(gnus-summary-select-article)) ; get article of current line