(interactive "p")
(gnus-summary-select-article)
(gnus-configure-windows 'article)
- (select-window (gnus-get-buffer-window gnus-article-buffer))
- (widget-forward arg))
+ (let ((win (or (gnus-get-buffer-window gnus-article-buffer t)
+ (error "No article window found"))))
+ (select-window win)
+ (select-frame-set-input-focus (window-frame win))
+ (widget-forward arg)))
(defun gnus-summary-widget-backward (arg)
"Move point to the previous field or button in the article.
(interactive "p")
(gnus-summary-select-article)
(gnus-configure-windows 'article)
- (select-window (gnus-get-buffer-window gnus-article-buffer))
- (unless (widget-at (point))
- (goto-char (point-max)))
- (widget-backward arg))
+ (let ((win (or (gnus-get-buffer-window gnus-article-buffer t)
+ (error "No article window found"))))
+ (select-window win)
+ (select-frame-set-input-focus (window-frame win))
+ (unless (widget-at (point))
+ (goto-char (point-max)))
+ (widget-backward arg)))
(defun gnus-summary-isearch-article (&optional regexp-p)
"Do incremental search forward on the current article.
(require 'gnus)
(require 'gnus-util)
+(require 'seq)
(defgroup gnus-windows nil
"Window configuration."
(delq lowest-buf bufs)))))
(defun gnus-get-buffer-window (buffer &optional frame)
- (cond ((and (null gnus-use-frames-on-any-display)
- (memq frame '(t 0 visible)))
- (car
- (let ((frames (frames-on-display-list)))
- (seq-remove (lambda (win) (not (memq (window-frame win)
- frames)))
- (get-buffer-window-list buffer nil frame)))))
- (t
- (get-buffer-window buffer frame))))
+ "Return a window currently displaying BUFFER, or nil if none.
+Like `get-buffer-window', but respecting
+`gnus-use-frames-on-any-display'."
+ (if (and (not gnus-use-frames-on-any-display)
+ (memq frame '(t 0 visible)))
+ (let ((frames (frames-on-display-list)))
+ (seq-find (lambda (win) (memq (window-frame win) frames))
+ (get-buffer-window-list buffer nil frame)))
+ (get-buffer-window buffer frame)))
(provide 'gnus-win)