aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-11-16 06:11:56 +0100
committerLars Ingebrigtsen2019-11-16 06:11:56 +0100
commit246f050ab4ba0ec9b12f03ddfa7ee3f74030f850 (patch)
tree7ef1466d263caf4d56804087ee801db29b6cb3ba
parent461101d67cc5f9f9dbe01ac0406c5c9762adf10c (diff)
downloademacs-246f050ab4ba0ec9b12f03ddfa7ee3f74030f850.tar.gz
emacs-246f050ab4ba0ec9b12f03ddfa7ee3f74030f850.zip
Don't move point on undefined keystrokes in the article buffer
* lisp/gnus/gnus-art.el (gnus-article-read-summary-keys): Don't move point on undefined commands (bug#38227).
-rw-r--r--lisp/gnus/gnus-art.el47
1 files changed, 21 insertions, 26 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 99f23713636..cfb185b3d1c 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -6678,43 +6678,41 @@ not have a face in `gnus-article-boring-faces'."
6678 "An" "Ap" [?A (meta return)] [?A delete])) 6678 "An" "Ap" [?A (meta return)] [?A delete]))
6679 (nosave-in-article 6679 (nosave-in-article
6680 '("AS" "\C-d")) 6680 '("AS" "\C-d"))
6681 keys new-sum-point) 6681 keys new-sum-point gnus-pick-mode func)
6682 (with-current-buffer gnus-article-current-summary 6682 (with-current-buffer gnus-article-current-summary
6683 (let (gnus-pick-mode) 6683 (setq unread-command-events (nconc unread-command-events
6684 (setq unread-command-events (nconc unread-command-events 6684 (list (or key last-command-event)))
6685 (list (or key last-command-event))) 6685 keys (read-key-sequence nil t)
6686 keys (read-key-sequence nil t)))) 6686 func (key-binding keys t)))
6687 6687
6688 (message "") 6688 (message "")
6689 6689
6690 (when (eq func 'undefined)
6691 (error "%s is undefined" keys))
6692
6690 (cond 6693 (cond
6691 ((eq (aref keys (1- (length keys))) ?\C-h) 6694 ((eq (aref keys (1- (length keys))) ?\C-h)
6692 (gnus-article-describe-bindings (substring keys 0 -1))) 6695 (gnus-article-describe-bindings (substring keys 0 -1)))
6693 ((or (member keys nosaves) 6696 ((or (member keys nosaves)
6694 (member keys nosave-but-article) 6697 (member keys nosave-but-article)
6695 (member keys nosave-in-article)) 6698 (member keys nosave-in-article))
6696 (let (func) 6699 (if (or (not func)
6697 (with-current-buffer gnus-article-current-summary 6700 (numberp func))
6698 ;; We disable the pick minor mode commands. 6701 (ding)
6699 (let (gnus-pick-mode) 6702 (unless (member keys nosave-in-article)
6700 (setq func (key-binding keys t)))) 6703 (set-buffer gnus-article-current-summary))
6701 (if (or (not func) 6704 (when (and (symbolp func)
6702 (numberp func)) 6705 (get func 'disabled))
6703 (ding) 6706 (error "Function %s disabled" func))
6704 (unless (member keys nosave-in-article) 6707 (call-interactively func)
6705 (set-buffer gnus-article-current-summary)) 6708 (setq new-sum-point (point)))
6706 (when (and (symbolp func) 6709 (when (member keys nosave-but-article)
6707 (get func 'disabled)) 6710 (pop-to-buffer gnus-article-buffer)))
6708 (error "Function %s disabled" func))
6709 (call-interactively func)
6710 (setq new-sum-point (point)))
6711 (when (member keys nosave-but-article)
6712 (pop-to-buffer gnus-article-buffer))))
6713 (t 6711 (t
6714 ;; These commands should restore window configuration. 6712 ;; These commands should restore window configuration.
6715 (let ((obuf (current-buffer)) 6713 (let ((obuf (current-buffer))
6716 (owin (current-window-configuration)) 6714 (owin (current-window-configuration))
6717 win func in-buffer selected new-sum-start new-sum-hscroll err) 6715 win in-buffer selected new-sum-start new-sum-hscroll err)
6718 (cond (not-restore-window 6716 (cond (not-restore-window
6719 (pop-to-buffer gnus-article-current-summary) 6717 (pop-to-buffer gnus-article-current-summary)
6720 (setq win (selected-window))) 6718 (setq win (selected-window)))
@@ -6733,9 +6731,6 @@ not have a face in `gnus-article-boring-faces'."
6733 (select-frame-set-input-focus (window-frame win)) 6731 (select-frame-set-input-focus (window-frame win))
6734 (select-window win)))) 6732 (select-window win))))
6735 (setq in-buffer (current-buffer)) 6733 (setq in-buffer (current-buffer))
6736 ;; We disable the pick minor mode commands.
6737 (setq func (let (gnus-pick-mode)
6738 (key-binding keys t)))
6739 (when (and (symbolp func) 6734 (when (and (symbolp func)
6740 (get func 'disabled)) 6735 (get func 'disabled))
6741 (error "Function %s disabled" func)) 6736 (error "Function %s disabled" func))