aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/ffap.el
diff options
context:
space:
mode:
authorMiles Bader2008-01-30 07:57:28 +0000
committerMiles Bader2008-01-30 07:57:28 +0000
commitd235ca2ff8fab139ce797757fcb159d1e28fa7e0 (patch)
tree96c5cd1a06a0d9dc26e8470c6eabfc032c0046f3 /lisp/ffap.el
parent3709a060f679dba14df71ae64a0035fa2b5b3106 (diff)
parent02cbe062bee38a6705bafb1699d77e3c44cfafcf (diff)
downloademacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.tar.gz
emacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.zip
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
Diffstat (limited to 'lisp/ffap.el')
-rw-r--r--lisp/ffap.el40
1 files changed, 24 insertions, 16 deletions
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 52fb372b8cd..c34478a30de 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -797,7 +797,10 @@ This uses ffap-file-exists-string, which may try adding suffixes from
797 ("\\.bib\\'" . ffap-bib) ; search ffap-bib-path 797 ("\\.bib\\'" . ffap-bib) ; search ffap-bib-path
798 ("\\`\\." . ffap-home) ; .emacs, .bashrc, .profile 798 ("\\`\\." . ffap-home) ; .emacs, .bashrc, .profile
799 ("\\`~/" . ffap-lcd) ; |~/misc/ffap.el.Z| 799 ("\\`~/" . ffap-lcd) ; |~/misc/ffap.el.Z|
800 ("^[Rr][Ff][Cc][- #]?\\([0-9]+\\)" ; no $ 800 ;; This uses to have a blank, but ffap-string-at-point doesn't
801 ;; handle blanks.
802 ;; http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01058.html
803 ("^[Rr][Ff][Cc][-#]?\\([0-9]+\\)" ; no $
801 . ffap-rfc) ; "100% RFC2100 compliant" 804 . ffap-rfc) ; "100% RFC2100 compliant"
802 (dired-mode . ffap-dired) ; maybe in a subdirectory 805 (dired-mode . ffap-dired) ; maybe in a subdirectory
803 ) 806 )
@@ -969,7 +972,7 @@ If t, `ffap-tex-init' will initialize this when needed.")
969 ;; Slightly controversial decisions: 972 ;; Slightly controversial decisions:
970 ;; * strip trailing "@" and ":" 973 ;; * strip trailing "@" and ":"
971 ;; * no commas (good for latex) 974 ;; * no commas (good for latex)
972 (file "--:$+<>@-Z_[:lower:]~*?" "<@" "@>;.,!:") 975 (file "--:\\\\$+<>@-Z_[:lower:]~*?" "<@" "@>;.,!:")
973 ;; An url, or maybe a email/news message-id: 976 ;; An url, or maybe a email/news message-id:
974 (url "--:=&?$+@-Z_[:lower:]~#,%;*" "^[:alnum:]" ":;.,!?") 977 (url "--:=&?$+@-Z_[:lower:]~#,%;*" "^[:alnum:]" ":;.,!?")
975 ;; Find a string that does *not* contain a colon: 978 ;; Find a string that does *not* contain a colon:
@@ -1263,20 +1266,25 @@ which may actually result in an url rather than a filename."
1263 (setq dir (file-name-directory guess)))) 1266 (setq dir (file-name-directory guess))))
1264 (let ((minibuffer-completing-file-name t) 1267 (let ((minibuffer-completing-file-name t)
1265 (completion-ignore-case read-file-name-completion-ignore-case) 1268 (completion-ignore-case read-file-name-completion-ignore-case)
1266 ;; because of `rfn-eshadow-update-overlay'. 1269 (fnh-elem (cons ffap-url-regexp 'url-file-handler)))
1267 (file-name-handler-alist 1270 ;; Explain to `rfn-eshadow' that we can use URLs here.
1268 (cons (cons ffap-url-regexp 'url-file-handler) 1271 (push fnh-elem file-name-handler-alist)
1269 file-name-handler-alist))) 1272 (unwind-protect
1270 (setq guess 1273 (setq guess
1271 (completing-read 1274 (completing-read
1272 prompt 1275 prompt
1273 'ffap-read-file-or-url-internal 1276 'ffap-read-file-or-url-internal
1274 dir 1277 dir
1275 nil 1278 nil
1276 (if dir (cons guess (length dir)) guess) 1279 (if dir (cons guess (length dir)) guess)
1277 (list 'file-name-history) 1280 (list 'file-name-history)
1278 (and buffer-file-name 1281 (and buffer-file-name
1279 (abbreviate-file-name buffer-file-name))))) 1282 (abbreviate-file-name buffer-file-name))))
1283 ;; Remove the special handler manually. We used to just let-bind
1284 ;; file-name-handler-alist to preserve its value, but that caused
1285 ;; other modifications to be lost (e.g. when Tramp gets loaded
1286 ;; during the completing-read call).
1287 (setq file-name-handler-alist (delq fnh-elem file-name-handler-alist))))
1280 ;; Do file substitution like (interactive "F"), suggested by MCOOK. 1288 ;; Do file substitution like (interactive "F"), suggested by MCOOK.
1281 (or (ffap-url-p guess) (setq guess (substitute-in-file-name guess))) 1289 (or (ffap-url-p guess) (setq guess (substitute-in-file-name guess)))
1282 ;; Should not do it on url's, where $ is a common (VMS?) character. 1290 ;; Should not do it on url's, where $ is a common (VMS?) character.