]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/ffap.el (ffap-lax-url): New var.
authorIvan Andrus <darthandrus@gmail.com>
Thu, 12 Jun 2014 02:29:50 +0000 (22:29 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 12 Jun 2014 02:29:50 +0000 (22:29 -0400)
(ffap-url-at-point): Use it.
(ffap-file-at-point): Avoid returning just "/".

Fixes: debbugs:17723
lisp/ChangeLog
lisp/ffap.el

index 5e039a75461f99bd2412c14745cefdc4b1a5e901..618c05ee5effd919e7a5e52a2a8148f58f27460e 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-12  Ivan Andrus  <darthandrus@gmail.com>
+
+       * ffap.el (ffap-lax-url): New var (bug#17723).
+       (ffap-url-at-point): Use it.
+       (ffap-file-at-point): Avoid returning just "/".
+
 2014-06-12  Matthias Meulien  <orontee@gmail.com>
 
        * progmodes/python.el (class skeleton): Don't erase last char of class
index 119e0ad30789aab7f774ac5986a0c6ecbf453214..95a651bbde6c8feaf19a310acf38d6126a82b6d5 100644 (file)
@@ -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))))
 \f