diff options
| author | USAMI Kenta | 2024-02-04 03:20:24 +0900 |
|---|---|---|
| committer | Eli Zaretskii | 2024-02-08 14:04:18 +0200 |
| commit | ebf4ef2022a5f0a69cdd881eb41104e7b59d698e (patch) | |
| tree | ac50ac2453c7ddb44ad567752411fee5b1b87d98 | |
| parent | bc099295dd24d059d3358acf5653ced9c9292e41 (diff) | |
| download | emacs-ebf4ef2022a5f0a69cdd881eb41104e7b59d698e.tar.gz emacs-ebf4ef2022a5f0a69cdd881eb41104e7b59d698e.zip | |
Fix 'browse-url-url-at-point' so that scheme does not duplicate
* lisp/net/browse-url.el (browse-url-url-at-point): Prepend
the default scheme only if no scheme present. (Bug#68913)
| -rw-r--r-- | lisp/net/browse-url.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 359453ca433..bc2a7db9a8b 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -688,8 +688,10 @@ websites are increasingly rare, but they do still exist." | |||
| 688 | (defun browse-url-url-at-point () | 688 | (defun browse-url-url-at-point () |
| 689 | (or (thing-at-point 'url t) | 689 | (or (thing-at-point 'url t) |
| 690 | ;; assume that the user is pointing at something like gnu.org/gnu | 690 | ;; assume that the user is pointing at something like gnu.org/gnu |
| 691 | (let ((f (thing-at-point 'filename t))) | 691 | (when-let ((f (thing-at-point 'filename t))) |
| 692 | (and f (concat browse-url-default-scheme "://" f))))) | 692 | (if (string-match-p browse-url-button-regexp f) |
| 693 | f | ||
| 694 | (concat browse-url-default-scheme "://" f))))) | ||
| 693 | 695 | ||
| 694 | ;; Having this as a separate function called by the browser-specific | 696 | ;; Having this as a separate function called by the browser-specific |
| 695 | ;; functions allows them to be stand-alone commands, making it easier | 697 | ;; functions allows them to be stand-alone commands, making it easier |