Discussion:
[Emacs-diffs] master 306a6f8: * lisp/gnus/gnus-art.el (gnus-article-prepare): Make sure the article
(too old to reply)
Stefan Monnier
2018-04-13 02:27:04 UTC
Permalink
+ ;; Make sure the article begins with the top of the header.
+ (save-selected-window
+ (select-window (get-buffer-window gnus-article-buffer))
+ (goto-char (point-min)))
Any reason this doesn't use `with-selected-window`?


Stefan
martin rudalics
2018-04-13 06:31:32 UTC
Permalink
Post by Stefan Monnier
+ ;; Make sure the article begins with the top of the header.
+ (save-selected-window
+ (select-window (get-buffer-window gnus-article-buffer))
+ (goto-char (point-min)))
Any reason this doesn't use `with-selected-window`?
There's no need to _select_ the window. What Lars wants is probably
something like

(let ((window (get-buffer-window gnus-article-buffer)))
(when window
(with-current-buffer (window-buffer window)
(set-window-point window (point-min)))))

martin
Katsumi Yamaoka
2018-04-13 07:42:41 UTC
Permalink
Post by martin rudalics
There's no need to _select_ the window. What Lars wants is probably
something like
(let ((window (get-buffer-window gnus-article-buffer)))
(when window
(with-current-buffer (window-buffer window)
(set-window-point window (point-min)))))
Cool. I verified it works and committed this change. Thank you.
Stefan Monnier
2018-04-13 17:35:21 UTC
Permalink
Post by martin rudalics
Post by Stefan Monnier
+ ;; Make sure the article begins with the top of the header.
+ (save-selected-window
+ (select-window (get-buffer-window gnus-article-buffer))
+ (goto-char (point-min)))
Any reason this doesn't use `with-selected-window`?
There's no need to _select_ the window. What Lars wants is probably
Duh! I focused on the `save-selected-window` (which is rarely "quite
right" in my experience) and completely missed the rest. Thanks!


Stefan

Loading...