emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#17723: closed (24.3.91; Improvements for ffap)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#17723: closed (24.3.91; Improvements for ffap)
Date: Thu, 12 Jun 2014 02:32:02 +0000

Your message dated Wed, 11 Jun 2014 22:31:53 -0400
with message-id <address@hidden>
and subject line Re: bug#17723: 24.3.91; Improvements for ffap
has caused the debbugs.gnu.org bug report #17723,
regarding 24.3.91; Improvements for ffap
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
17723: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17723
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.91; Improvements for ffap Date: Sat, 7 Jun 2014 01:51:02 -0600
Find file at point has two annoyances for me (I've rebound C-x C-f to ffap).

The first is that closing xml tags take me to the root directory since
they start with "/".  I fixed by simply disallowing "/" as a valid match
in this case.

The second is that when editing C++ code, namespaced functions (like
std::find) get picked up as URLs.  I changed this by adding an option.
I personally haven't found a reason for it to be non-nil (use lax
matching), but I presume there must have been one so I defaulted to no
behavior change.

Here's a proposed ChangeLog entry (please let me know if the format is wrong):

2014-06-07  Ivan Andrus  <address@hidden>

        * ffap.el (ffap-url-at-point): Added `ffap-lax-url' to disallow
        lax URL matching.
        (ffap-file-at-point): Disallow "/" so closing xml tags don't
        interfere.


Thanks,
Ivan


diff --git a/lisp/ffap.el b/lisp/ffap.el
index 119e0ad..e36e613 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 t
+  "If non-nil, allow lax URL matching."
+  :type 'boolean
+  :group 'ffap
+  :version "24.4")
+
(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))))




--- End Message ---
--- Begin Message --- Subject: Re: bug#17723: 24.3.91; Improvements for ffap Date: Wed, 11 Jun 2014 22:31:53 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)
> The second is that when editing C++ code, namespaced functions (like
> std::find) get picked up as URLs.  I changed this by adding an option.
> I personally haven't found a reason for it to be non-nil (use lax
> matching), but I presume there must have been one so I defaulted to no
> behavior change.

Thanks, installed into `trunk', and changed the default.
The patch was mangled, tho, please try and make sure you use a MUA that
doesn't try to be too clever.


        Stefan


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]