aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Andrus2014-06-11 22:29:50 -0400
committerStefan Monnier2014-06-11 22:29:50 -0400
commit7c35a922517c140ee7f260e50f01ed291d839178 (patch)
treecceaa3216307041ba50121430a939ae3c084eece
parent82fb2a08db1889ccd57e571e9333c17a0abeeb2e (diff)
downloademacs-7c35a922517c140ee7f260e50f01ed291d839178.tar.gz
emacs-7c35a922517c140ee7f260e50f01ed291d839178.zip
* lisp/ffap.el (ffap-lax-url): New var.
(ffap-url-at-point): Use it. (ffap-file-at-point): Avoid returning just "/". Fixes: debbugs:17723
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/ffap.el11
2 files changed, 15 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5e039a75461..618c05ee5ef 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-06-12 Ivan Andrus <darthandrus@gmail.com>
2
3 * ffap.el (ffap-lax-url): New var (bug#17723).
4 (ffap-url-at-point): Use it.
5 (ffap-file-at-point): Avoid returning just "/".
6
12014-06-12 Matthias Meulien <orontee@gmail.com> 72014-06-12 Matthias Meulien <orontee@gmail.com>
2 8
3 * progmodes/python.el (class skeleton): Don't erase last char of class 9 * progmodes/python.el (class skeleton): Don't erase last char of class
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."
163 :group 'ffap 163 :group 'ffap
164 :version "24.3") 164 :version "24.3")
165 165
166(defcustom ffap-lax-url nil
167 "If non-nil, allow lax URL matching."
168 :type 'boolean
169 :group 'ffap
170 :version "24.5")
171
166(defcustom ffap-ftp-default-user "anonymous" 172(defcustom ffap-ftp-default-user "anonymous"
167 "User name in FTP file names generated by `ffap-host-to-path'. 173 "User name in FTP file names generated by `ffap-host-to-path'.
168Note this name may be omitted if it equals the default 174Note this name may be omitted if it equals the default
@@ -1096,7 +1102,7 @@ Assumes the buffer has not changed."
1096 (w3-view-this-url t)) 1102 (w3-view-this-url t))
1097 (let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp) 1103 (let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp)
1098 (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix)) 1104 (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix))
1099 (thing-at-point-url-at-point t 1105 (thing-at-point-url-at-point ffap-lax-url
1100 (if (use-region-p) 1106 (if (use-region-p)
1101 (cons (region-beginning) 1107 (cons (region-beginning)
1102 (region-end)))))))) 1108 (region-end))))))))
@@ -1253,7 +1259,8 @@ which may actually result in an URL rather than a filename."
1253 (not (ffap-file-exists-string dir)) 1259 (not (ffap-file-exists-string dir))
1254 (not (equal dir (setq dir (file-name-directory 1260 (not (equal dir (setq dir (file-name-directory
1255 (directory-file-name dir))))))) 1261 (directory-file-name dir)))))))
1256 (ffap-file-exists-string dir))) 1262 (and (not (string= dir "/"))
1263 (ffap-file-exists-string dir))))
1257 ) 1264 )
1258 (set-match-data data)))) 1265 (set-match-data data))))
1259 1266