Subject: bug#13769: gnus-tree-hightlight-article moves point in summary buffer

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 06 Jul 2013 18:17:01 +0200

Dave Abrahams <[email-masked]> writes:

> This bug affects gnus-summary-mark-forward; the point moves backward in
> the summary buffer quite perplexingly.  The following patch seems to
> suppress the symptoms of the bug:

[...]

>  (defun gnus-tree-highlight-article (article face)
> +  (save-excursion
>    (with-current-buffer (gnus-get-tree-buffer)
>      (let (region)
>        (when (setq region (gnus-tree-article-region article))
>  	(gnus-put-text-property (car region) (cdr region) 'face face)
>  	(set-window-point
>  	 (gnus-get-buffer-window (current-buffer) t) (cdr region))))))
> +  )

Hm.  I don't quite understand this patch.  `save-excursion' saves the
point in the current buffer, and what the current buffer is.  The bit
inside the save-excursion all happens in a different buffer, so point in
the current buffer shouldn't change at all.

Does anybody have any ideas why this patch would help?  It could be some
magic connected to `set-window-point', I guess...

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/