diff options
| author | Lars Ingebrigtsen | 2019-05-13 15:17:00 -0400 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-05-13 15:45:52 -0400 |
| commit | 8fe73515ad08402d16de44b32dc93b98069e0498 (patch) | |
| tree | cb01cfe19437af8b628c0172e8234b13eea75275 /lisp | |
| parent | 967711995ecedc0ed79602ad71af57f45d6a3720 (diff) | |
| download | emacs-8fe73515ad08402d16de44b32dc93b98069e0498.tar.gz emacs-8fe73515ad08402d16de44b32dc93b98069e0498.zip | |
Make eww understand #fragment URLs at point interactively
* lisp/net/eww.el (eww-suggest-uris): Use
thing-at-point-url-at-point instead of url-get-url-at-point
(bug#31927) because it's much better at guessing what the URL
actually is (especially with #fragments).
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/net/eww.el | 8 | ||||
| -rw-r--r-- | lisp/url/url-util.el | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 63afe11f053..206f9cfdf30 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | (require 'shr) | 29 | (require 'shr) |
| 30 | (require 'url) | 30 | (require 'url) |
| 31 | (require 'url-queue) | 31 | (require 'url-queue) |
| 32 | (require 'url-util) ; for url-get-url-at-point | 32 | (require 'thingatpt) |
| 33 | (require 'mm-url) | 33 | (require 'mm-url) |
| 34 | (require 'puny) | 34 | (require 'puny) |
| 35 | (eval-when-compile (require 'subr-x)) ;; for string-trim | 35 | (eval-when-compile (require 'subr-x)) ;; for string-trim |
| @@ -64,17 +64,17 @@ | |||
| 64 | ;;;###autoload | 64 | ;;;###autoload |
| 65 | (defcustom eww-suggest-uris | 65 | (defcustom eww-suggest-uris |
| 66 | '(eww-links-at-point | 66 | '(eww-links-at-point |
| 67 | url-get-url-at-point | 67 | thing-at-point-url-at-point |
| 68 | eww-current-url) | 68 | eww-current-url) |
| 69 | "List of functions called to form the list of default URIs for `eww'. | 69 | "List of functions called to form the list of default URIs for `eww'. |
| 70 | Each of the elements is a function returning either a string or a list | 70 | Each of the elements is a function returning either a string or a list |
| 71 | of strings. The results will be joined into a single list with | 71 | of strings. The results will be joined into a single list with |
| 72 | duplicate entries (if any) removed." | 72 | duplicate entries (if any) removed." |
| 73 | :version "25.1" | 73 | :version "27.1" |
| 74 | :group 'eww | 74 | :group 'eww |
| 75 | :type 'hook | 75 | :type 'hook |
| 76 | :options '(eww-links-at-point | 76 | :options '(eww-links-at-point |
| 77 | url-get-url-at-point | 77 | thing-at-point-url-at-point |
| 78 | eww-current-url)) | 78 | eww-current-url)) |
| 79 | 79 | ||
| 80 | (defcustom eww-bookmarks-directory user-emacs-directory | 80 | (defcustom eww-bookmarks-directory user-emacs-directory |
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 5b8350642ff..a46e7bb3855 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el | |||
| @@ -543,6 +543,7 @@ This uses `url-current-object', set locally to the buffer." | |||
| 543 | (defun url-get-url-at-point (&optional pt) | 543 | (defun url-get-url-at-point (&optional pt) |
| 544 | "Get the URL closest to point, but don't change position. | 544 | "Get the URL closest to point, but don't change position. |
| 545 | Has a preference for looking backward when not directly on a symbol." | 545 | Has a preference for looking backward when not directly on a symbol." |
| 546 | (declare (obsolete thing-at-point-url-at-point "27.1")) | ||
| 546 | ;; Not at all perfect - point must be right in the name. | 547 | ;; Not at all perfect - point must be right in the name. |
| 547 | (save-excursion | 548 | (save-excursion |
| 548 | (if pt (goto-char pt)) | 549 | (if pt (goto-char pt)) |