[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 1efc5f8 2/6: shr link traversal fixup
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 1efc5f8 2/6: shr link traversal fixup |
Date: |
Mon, 28 Dec 2015 23:11:54 +0000 |
branch: master
commit 1efc5f8b09273c359683ce13be95fb5df7a84311
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
shr link traversal fixup
* shr.el (shr-next-link): Don't bug out on adjacent links.
---
lisp/net/shr.el | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 469ef4e..0b80e81 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -316,13 +316,25 @@ redirects somewhere else."
(defun shr-next-link ()
"Skip to the next link."
(interactive)
- (let ((skip (text-property-any (point) (point-max) 'help-echo nil)))
- (if (or (eobp)
- (not (setq skip (text-property-not-all skip (point-max)
- 'help-echo nil))))
- (message "No next link")
+ (let ((current (get-text-property (point) 'shr-url))
+ (start (point))
+ skip)
+ (while (and (not (eobp))
+ (equal (get-text-property (point) 'shr-url) current))
+ (forward-char 1))
+ (cond
+ ((and (not (eobp))
+ (get-text-property (point) 'shr-url))
+ ;; The next link is adjacent.
+ (message "%s" (get-text-property (point) 'help-echo)))
+ ((or (eobp)
+ (not (setq skip (text-property-not-all (point) (point-max)
+ 'shr-url nil))))
+ (goto-char start)
+ (message "No next link"))
+ (t
(goto-char skip)
- (message "%s" (get-text-property (point) 'help-echo)))))
+ (message "%s" (get-text-property (point) 'help-echo))))))
(defun shr-previous-link ()
"Skip to the previous link."
- [Emacs-diffs] master updated (0e99ccb -> 5fcbeaf), Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master 1efc5f8 2/6: shr link traversal fixup,
Lars Ingebrigtsen <=
- [Emacs-diffs] master fc3965e 4/6: IDNA-encode all domain names in `open-network-stream', Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master 5fcbeaf 6/6: Mention the new puny.el library, Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master d686802 1/6: Reconnect erc even on server errors, Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master 341feb3 3/6: Fix puny-encoding all-non-ASCII domains, Lars Ingebrigtsen, 2015/12/28
- [Emacs-diffs] master 8b61c22 5/6: IDNA-related fixes for the URL library, Lars Ingebrigtsen, 2015/12/28