diff options
| author | Philipp Stephani | 2017-06-15 11:49:56 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-16 18:06:28 +0200 |
| commit | 3b6e01cccf89ba0f3485751125f43463bc429345 (patch) | |
| tree | 439adae70db311405f2abd6369ad75004eb2eca4 /lisp | |
| parent | ea196ebb93188b0962f478f5dec0ff0645c4da10 (diff) | |
| download | emacs-3b6e01cccf89ba0f3485751125f43463bc429345.tar.gz emacs-3b6e01cccf89ba0f3485751125f43463bc429345.zip | |
Correctly detect URLs surrounded by parentheses in comments
* lisp/thingatpt.el (thing-at-point--bounds-of-well-formed-url):
Make parentheses match work inside comments.
* test/lisp/thingatpt-tests.el (thing-at-point-url-in-comment): Add
unit test.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/thingatpt.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index 25e01df70ee..7c3d73e52b7 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el | |||
| @@ -380,7 +380,9 @@ the bounds of a possible ill-formed URI (one lacking a scheme)." | |||
| 380 | (save-restriction | 380 | (save-restriction |
| 381 | (narrow-to-region (1- url-beg) (min end (point-max))) | 381 | (narrow-to-region (1- url-beg) (min end (point-max))) |
| 382 | (setq paren-end (ignore-errors | 382 | (setq paren-end (ignore-errors |
| 383 | (scan-lists (1- url-beg) 1 0)))) | 383 | ;; Make the scan work inside comments. |
| 384 | (let ((parse-sexp-ignore-comments nil)) | ||
| 385 | (scan-lists (1- url-beg) 1 0))))) | ||
| 384 | (not (blink-matching-check-mismatch (1- url-beg) paren-end)) | 386 | (not (blink-matching-check-mismatch (1- url-beg) paren-end)) |
| 385 | (setq end (1- paren-end))) | 387 | (setq end (1- paren-end))) |
| 386 | ;; Ensure PT is actually within BOUNDARY. Check the following | 388 | ;; Ensure PT is actually within BOUNDARY. Check the following |