diff options
author | Ivan Andrus <darthandrus@gmail.com> | 2014-06-11 22:29:50 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-06-11 22:29:50 -0400 |
commit | 7c35a922517c140ee7f260e50f01ed291d839178 (patch) | |
tree | cceaa3216307041ba50121430a939ae3c084eece /lisp/ffap.el | |
parent | 82fb2a08db1889ccd57e571e9333c17a0abeeb2e (diff) | |
download | emacs-7c35a922517c140ee7f260e50f01ed291d839178.tar.gz |
* lisp/ffap.el (ffap-lax-url): New var.
(ffap-url-at-point): Use it.
(ffap-file-at-point): Avoid returning just "/".
Fixes: debbugs:17723
Diffstat (limited to 'lisp/ffap.el')
-rw-r--r-- | lisp/ffap.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/ffap.el b/lisp/ffap.el index 119e0ad3078..95a651bbde6 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -163,6 +163,12 @@ schemes (e.g. \"ftp\"); in that case, only convert those URLs." :group 'ffap :version "24.3") +(defcustom ffap-lax-url nil + "If non-nil, allow lax URL matching." + :type 'boolean + :group 'ffap + :version "24.5") + (defcustom ffap-ftp-default-user "anonymous" "User name in FTP file names generated by `ffap-host-to-path'. Note this name may be omitted if it equals the default @@ -1096,7 +1102,7 @@ Assumes the buffer has not changed." (w3-view-this-url t)) (let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp) (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix)) - (thing-at-point-url-at-point t + (thing-at-point-url-at-point ffap-lax-url (if (use-region-p) (cons (region-beginning) (region-end)))))))) @@ -1253,7 +1259,8 @@ which may actually result in an URL rather than a filename." (not (ffap-file-exists-string dir)) (not (equal dir (setq dir (file-name-directory (directory-file-name dir))))))) - (ffap-file-exists-string dir))) + (and (not (string= dir "/")) + (ffap-file-exists-string dir)))) ) (set-match-data data)))) |