aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/thingatpt.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index c26b9be1da8..84ffcca5290 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)."
361 (if found 361 (if found
362 (cons (match-beginning 1) (match-end 1)))))) 362 (cons (match-beginning 1) (match-end 1))))))
363 363
364(defun thing-at-point--bounds-of-well-formed-url (beg end _pt) 364(defun thing-at-point--bounds-of-well-formed-url (beg end pt)
365 (save-excursion 365 (save-excursion
366 (goto-char beg) 366 (goto-char beg)
367 (let (url-beg paren-end regexp) 367 (let (url-beg paren-end regexp)
@@ -388,7 +388,11 @@ the bounds of a possible ill-formed URI (one lacking a scheme)."
388 (scan-lists (1- url-beg) 1 0)))) 388 (scan-lists (1- url-beg) 1 0))))
389 (not (blink-matching-check-mismatch (1- url-beg) paren-end)) 389 (not (blink-matching-check-mismatch (1- url-beg) paren-end))
390 (setq end (1- paren-end))) 390 (setq end (1- paren-end)))
391 (cons url-beg end))))) 391 ;; Ensure PT is actually within BOUNDARY. Check the following
392 ;; example with point on the beginning of the line:
393 ;;
394 ;; 3,1406710489,http://gnu.org,0,"0"
395 (and (<= url-beg pt end) (cons url-beg end))))))
392 396
393(put 'url 'thing-at-point 'thing-at-point-url-at-point) 397(put 'url 'thing-at-point 'thing-at-point-url-at-point)
394 398