GNU bug report logs - #25091
26.0.50; shr-map hides gnus-article keys

Previous Next

Package: emacs;

Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>

Date: Fri, 2 Dec 2016 09:10:01 UTC

Severity: normal

Tags: patch

Found in version 26.0.50

Done: Katsumi Yamaoka <yamaoka <at> jpl.org>

Bug is archived. No further changes may be made.

Full log


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

From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: bug-gnu-emacs <at> gnu.org
Cc: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: 26.0.50; shr-map hides gnus-article keys
Date: Fri, 02 Dec 2016 18:08:39 +0900
[Message part 1 (text/plain, inline)]
Hi,

Jidanni mailed me that TAB doesn't move point to attachments
existing in the bottom of an html article of Gnus like this:

,---- html part
|......
|       ...link...
|               ......
|                       ...link...
|       ......
`----
[2. application/pdf; foo.pdf]...
[3. application/octet-stream; bar.txt]...

An example is attached.

Each link has `shr-map' that overrides `gnus-article-mode-map'
of which the parent is `widget-keymap'.  TAB on a link invokes
`shr-next-link', not `widget-forward', so performing it on the
last link doesn't move point to the attachment, whereas TAB on
the html part other than links, i.e., `widget-forward', moves
point to the next link.  I think the behavior should be the same
as that of non-html articles.

I'm not quite sure if it is the right way, but tried fixing it
as follows:
[Message part 2 (text/x-patch, inline)]
--- shr.el~	2016-11-29 10:20:10.401598400 +0000
+++ shr.el	2016-12-02 09:04:23.642006900 +0000
@@ -344,8 +344,13 @@
      ((or (eobp)
           (not (setq skip (text-property-not-all (point) (point-max)
                                                  'shr-url nil))))
-      (goto-char start)
-      (message "No next link"))
+      (let ((command (lookup-key (current-local-map) (this-command-keys))))
+	(unless (and command
+		     (condition-case nil
+			 (progn (call-interactively command) t)
+		       (error nil)))
+	  (goto-char start)
+	  (message "No next link"))))
      (t
       (goto-char skip)
       (message "%s" (get-text-property (point) 'help-echo))))))
@@ -364,9 +369,13 @@
 		(not (setq found (get-text-property (point) 'help-echo))))
       (forward-char -1))
     (if (not found)
-	(progn
-	  (message "No previous link")
-	  (goto-char start))
+	(let ((command (lookup-key (current-local-map) (this-command-keys))))
+	  (unless (and command
+		       (condition-case nil
+			   (progn (call-interactively command) t)
+			 (error nil)))
+	    (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))
[html+attachments.gz (application/x-gunzip, attachment)]

This bug report was last modified 8 years and 164 days ago.

Previous Next


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