all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 13690@debbugs.gnu.org
Subject: bug#13690: 24.3.50; scroll-conservatively and Info-up
Date: Thu, 14 Feb 2013 00:18:30 +0100	[thread overview]
Message-ID: <871ucj7qgp.fsf@rosalinde.fritz.box> (raw)
In-Reply-To: <83mwv83ydi.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 13 Feb 2013 19:41:13 +0200")

[-- Attachment #1: Type: text/plain, Size: 3569 bytes --]

On Wed, 13 Feb 2013 19:41:13 +0200 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: 13690@debbugs.gnu.org
>> Date: Wed, 13 Feb 2013 14:36:58 +0100
>> 
>> > scroll-conservatively affects _any_ movement within a buffer, not just
>> > to scrolling commands.  
>> 
>> I think this should be made clear in the documentation.  In the Emacs
>> Lisp manual, scroll-conservatively is only mentioned in the context of
>> textual scrolling and there's no indication that it has wider scope.
>> The variable's doc string doesn't say it only affects movement by
>> scrolling, but given its name and the manual discussion, this is a
>> plausible assumption, so its scope should also be made clear here.  A
>> less misleading name would also help, e.g. restore-point-conservatively.
>
> A name change is out of question at this point, I think, as this
> option is very old.  As for documentation, feel free to send patches
> that clarify this.
>
> Note that the applicability of scroll-* options to movement that
> doesn't necessarily look like "scrolling" is not limited to
> scroll-conservatively.  E.g., scroll-margin comes to mind.

I don't feel confident I understand the intended behavior of these
options well enough to formulate satisfactory doc.  But I'll think about
it some more and maybe make an attempt, which could then be refined.

>> *** lisp/info.el	2013-02-01 16:46:46 +0000
>> --- lisp/info.el	2013-02-13 13:25:51 +0000
>> ***************
>> *** 2246,2252 ****
>>   		nil t))
>>   	  (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2)))
>>   	(goto-char p)
>> ! 	(Info-restore-point Info-history)))))
>>   
>>   (defun Info-history-back ()
>>     "Go back in the history to the last node visited."
>> --- 2246,2255 ----
>>   		nil t))
>>   	  (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2)))
>>   	(goto-char p)
>> ! 	(Info-restore-point Info-history))))
>> !   ;; If scroll-conservatively is non-zero, display as much of the
>> !   ;; superior node above the target line as possible (bug#13690).
>> !   (recenter))
>
> I don't mind, but let's hear from others.  In any case, I think this
> re-centering should be conditioned on:
>
>   . scroll-conservatively being less than 100 (people who set it to
>     large values don't want Emacs to recenter, ever)

This is a good condition, since it effectively does the job of an option
to trigger recentering (but according to the doc string, the condition
should be less than 101).  That way both those who never want
recentering, even with Info-up, and those who do are served.  Thanks for
the suggestion.

>   . scroll-conservatively being non-nil

I think you mean non-zero, since only integer values are admissible.
But when scroll-conservatively is zero, recentering happens anyway, so I
don't see the point of adding this condition.  Or is there a problem is
if recentering happens twice (once directly from the display engine and
once by explicitly calling recenter)?  I don't notice any problem.

>   . perhaps also scroll-margin being zero, because otherwise you get
>     several lines of context before point

I tested scroll-margin and found no difference in the behavior of Info-up
whether it is zero or non-zero; do you see something different?  If not,
then perhaps the following patch will make everyone happy.

2013-02-13  Stephen Berman  <stephen.berman@gmx.net>

	* info.el (Info-up): If scroll-conservatively is less than 101,
	display as much of the superior node above the target line as
	possible.  (Bug#13690)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Info-up patch --]
[-- Type: text/x-patch, Size: 841 bytes --]

=== modified file 'lisp/info.el'
*** lisp/info.el	2013-02-01 16:46:46 +0000
--- lisp/info.el	2013-02-13 23:13:49 +0000
***************
*** 2246,2252 ****
  		nil t))
  	  (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2)))
  	(goto-char p)
! 	(Info-restore-point Info-history)))))
  
  (defun Info-history-back ()
    "Go back in the history to the last node visited."
--- 2246,2256 ----
  		nil t))
  	  (progn (beginning-of-line) (if (looking-at "^\\* ") (forward-char 2)))
  	(goto-char p)
! 	(Info-restore-point Info-history))))
!   ;; If scroll-conservatively is less than 101, display as much of the
!   ;; superior node above the target line as possible (bug#13690).
!   (when (< scroll-conservatively 101)
!     (recenter)))
  
  (defun Info-history-back ()
    "Go back in the history to the last node visited."


  parent reply	other threads:[~2013-02-13 23:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11 23:24 bug#13690: 24.3.50; scroll-conservatively and Info-up Stephen Berman
2013-02-12 16:14 ` Eli Zaretskii
2013-02-12 22:00   ` Stephen Berman
2013-02-13  4:02     ` Eli Zaretskii
2013-02-13 13:36       ` Stephen Berman
2013-02-13 17:41         ` Eli Zaretskii
2013-02-13 19:02           ` Dmitry Gutov
2013-02-13 21:48             ` Eli Zaretskii
2013-02-14  1:51               ` Dmitry Gutov
2013-02-14  5:16                 ` Eli Zaretskii
2013-02-13 23:18           ` Stephen Berman [this message]
2013-02-14  5:12             ` Eli Zaretskii
2013-02-14 11:32               ` Stephen Berman
2020-08-25 11:31                 ` Lars Ingebrigtsen
2020-08-25 18:02                   ` Stephen Berman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ucj7qgp.fsf@rosalinde.fritz.box \
    --to=stephen.berman@gmx.net \
    --cc=13690@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.