emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 7a94f28: Fix bug in thing-at-point--bounds-of-well-


From: Leo Liu
Subject: [Emacs-diffs] master 7a94f28: Fix bug in thing-at-point--bounds-of-well-formed-url
Date: Thu, 09 Jul 2015 02:19:55 +0000

branch: master
commit 7a94f28a470d640eda3f36016f4fc8946aac63be
Author: Leo Liu <address@hidden>
Commit: Leo Liu <address@hidden>

    Fix bug in thing-at-point--bounds-of-well-formed-url
    
    * lisp/thingatpt.el (thing-at-point--bounds-of-well-formed-url): Make
      sure boundary contains current point.
---
 lisp/thingatpt.el |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index c26b9be..84ffcca 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -361,7 +361,7 @@ the bounds of a possible ill-formed URI (one lacking a 
scheme)."
       (if found
          (cons (match-beginning 1) (match-end 1))))))
 
-(defun thing-at-point--bounds-of-well-formed-url (beg end _pt)
+(defun thing-at-point--bounds-of-well-formed-url (beg end pt)
   (save-excursion
     (goto-char beg)
     (let (url-beg paren-end regexp)
@@ -388,7 +388,11 @@ the bounds of a possible ill-formed URI (one lacking a 
scheme)."
                                 (scan-lists (1- url-beg) 1 0))))
             (not (blink-matching-check-mismatch (1- url-beg) paren-end))
             (setq end (1- paren-end)))
-       (cons url-beg end)))))
+       ;; Ensure PT is actually within BOUNDARY. Check the following
+       ;; example with point on the beginning of the line:
+       ;;
+       ;; 3,1406710489,http://gnu.org,0,"0";
+       (and (<= url-beg pt end) (cons url-beg end))))))
 
 (put 'url 'thing-at-point 'thing-at-point-url-at-point)
 



reply via email to

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