GNU bug report logs - #19560
24.3.50; Handle adjacent links correctly in shr

Previous Next

Package: emacs;

Reported by: Ivan Shmakov <ivan <at> siamics.net>

Date: Sat, 10 Jan 2015 20:27:02 UTC

Severity: normal

Tags: fixed, patch

Merged with 16415

Found in version 24.3.50

Fixed in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19560 in the body.
You can then email your comments to 19560 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19560; Package emacs. (Sat, 10 Jan 2015 20:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ivan Shmakov <ivan <at> siamics.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 10 Jan 2015 20:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: submit <at> debbugs.gnu.org
Subject: shr.el: skips over adjacent links 
Date: Sat, 10 Jan 2015 20:25:58 +0000
[Message part 1 (text/plain, inline)]
Package:  emacs
Severity: minor

	As of ec7605b4b137 (2015-01-10 16:54:24 +0000), the
	shr-next-link and shr-previous-link commands skip over adjacent
	links, as per the example MIMEd.

	With this same example, shr-previous-link also fails to deal
	with the link at the very beginning of the buffer.

	Please consider the patch MIMEd.

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A
[Message part 2 (text/html, inline)]
[Message part 3 (text/diff, inline)]
--- a/lisp/net/shr.el	2015-01-10 16:54:24 +0000
+++ b/lisp/net/shr.el	2015-01-10 20:20:24 +0000
@@ -265,8 +269,11 @@
 (defun shr-next-link ()
   "Skip to the next link."
   (interactive)
-  (let ((skip (text-property-any (point) (point-max) 'help-echo nil)))
+  (let* ((cur (get-text-property (point) 'help-echo))
+	 (skip (text-property-not-all (point) (point-max)
+				      'help-echo cur)))
     (if (or (eobp)
+	    (not skip)
 	    (not (setq skip (text-property-not-all skip (point-max)
 						   'help-echo nil))))
 	(message "No next link")
@@ -276,25 +283,28 @@
 (defun shr-previous-link ()
   "Skip to the previous link."
   (interactive)
-  (let ((start (point))
+  (let ((cur (get-text-property (point) 'help-echo))
+	(start (point))
 	(found nil))
     ;; Skip past the current link.
     (while (and (not (bobp))
-		(get-text-property (point) 'help-echo))
+		(when-let ((h-e (get-text-property (point) 'help-echo)))
+		  (eq cur h-e)))
       (forward-char -1))
     ;; Find the previous link.
-    (while (and (not (bobp))
-		(not (setq found (get-text-property (point) 'help-echo))))
+    (while (and (not (setq found (get-text-property (point) 'help-echo)))
+		(not (bobp)))
       (forward-char -1))
-    (if (not found)
+    (if (or (not found) (eq start (point)))
 	(progn
 	  (message "No previous link")
 	  (goto-char start))
       ;; Put point at the start of the link.
-      (while (and (not (bobp))
-		  (get-text-property (point) 'help-echo))
-	(forward-char -1))
-      (forward-char 1)
+      (when (not (bobp))
+	(while (and (not (bobp))
+		    (eq found (get-text-property (point) 'help-echo)))
+	  (forward-char -1))
+	(forward-char 1))
       (message "%s" (get-text-property (point) 'help-echo)))))
 
 (defun shr-show-alt-text ()

Severity set to 'normal' from 'minor' Request was from Ivan Shmakov <ivan <at> siamics.net> to control <at> debbugs.gnu.org. (Sun, 11 Jan 2015 09:37:01 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Ivan Shmakov <ivan <at> siamics.net> to control <at> debbugs.gnu.org. (Sun, 11 Jan 2015 09:37:01 GMT) Full text and rfc822 format available.

Merged 16415 19560. Request was from Ivan Shmakov <ivan <at> siamics.net> to control <at> debbugs.gnu.org. (Sun, 11 Jan 2015 09:37:02 GMT) Full text and rfc822 format available.

Changed bug title to '24.3.50; Handle adjacent links correctly in shr' from 'shr.el: skips over adjacent links ' Request was from Ivan Shmakov <ivan <at> siamics.net> to control <at> debbugs.gnu.org. (Sun, 11 Jan 2015 09:37:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 16415 <at> debbugs.gnu.org and Nathan Trapuzzano <nbtrap <at> nbtrap.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 25 Dec 2015 17:38:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 26 Dec 2015 13:09:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 28 Dec 2015 21:22:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 16415 <at> debbugs.gnu.org and Nathan Trapuzzano <nbtrap <at> nbtrap.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 28 Dec 2015 21:22:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 26 Jan 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 199 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.