GNU bug report logs - #35860
Delayed window positioning after buffer display

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Wed, 22 May 2019 21:07:02 UTC

Severity: normal

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35860 <at> debbugs.gnu.org
Subject: Re: bug#35860: Delayed window positioning after buffer display
Date: Thu, 23 May 2019 23:56:17 +0300
>> There are commands that set point while the buffer is not displayed,
>> and after displaying the buffer point remains at an old position,
>> not where it was moved while the buffer was undisplayed.
>
> That's a feature, isn't it?  See switch-to-buffer-preserve-window-point.

IIUC, it tries to preserve the previous position of window-point,
but the required feature should set point when the buffer
is displayed for the first time.

>> One solution is to generalize the variable 'help-window-point-marker'
>> currently described as:
>> 
>>   ;; `help-window-point-marker' is a marker you can move to a valid
>>   ;; position of the buffer shown in the help window in order to override
>>   ;; the standard positioning mechanism (`point-min') chosen by
>>   ;; `with-output-to-temp-buffer' and `with-temp-buffer-window'.
>>   ;; `with-help-window' has this point nowhere before exiting.  Currently
>>   ;; used by `view-lossage' to assert that the last keystrokes are always
>>   ;; visible.
>>   (defvar help-window-point-marker (make-marker)
>>     "Marker to override default `window-point' in help windows.")
>
> Why not bind switch-to-buffer-preserve-window-point to nil instead?

I don't know.  I tried to replace

  (set-marker help-window-point-marker (point))

with

  (goto-char (point-max))
  (setq-local switch-to-buffer-preserve-window-point nil)

and it doesn't set point to the end of the Help buffer
when it's displayed for the first time.




This bug report was last modified 6 years and 59 days ago.

Previous Next


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