bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Eli Zaretskii
 emacs -Q
 C-u C-h i /path/to/emacs/info/emacs RET
 g Narrowing RET
 C-u 1 C-v

Note that the display does not scroll by one line.  "C-u 2 C-v" does
scroll by 2 lines, as well as "C-u 1 C-v" if the breadcrumbs are not
visible.

You can see this in any node, not just in Narrowing, of course.


In GNU Emacs 23.1.96.1 (i386-mingw-nt5.1.2600)
 of 2010-04-20 on HOME-C4E4A596F7
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1255
  default enable-multibyte-characters: t

Major mode: Mail

Minor modes in effect:
  flyspell-mode: t
  desktop-save-mode: t
  show-paren-mode: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  line-number-mode: t
  abbrev-mode: t

Recent input:
<down> <up> C-h c C-z C-z C-z C-z C-z C-z C-z C-u 1
C-v <next> C-u 1 C-v C-z C-z C-z M-z M-z M-z M-z M-z
M-z M-z M-z M-z M-z M-z M-z M-z M-z M-z M-z M-z M-z
M-z M-z M-z M-z M-z M-z M-z M-z M-z M-z M-z M-z M-z
C-z C-z M-z M-z M-z M-z M-z M-z M-z M-z M-z <up> C-z
C-z C-z <down> C-z <down> C-z <down> C-z <down> C-z
<down> C-z <down> C-z <down> C-z <down> C-z <down>
C-z <down> C-z <down> C-z <down> C-z <down> C-z <down>
C-z <down> C-z <down> C-z <down> C-z <down> C-z <down>
C-z <down> C-z <down> C-z C-z C-z <up> <up> <up> <up>
<up> <up> <up> <up> C-z C-z C-z M-z M-z M-z M-z M-z
M-z M-z M-z M-z M-z M-z M-z M-z M-z <up> <up> <up>
C-z C-z M-z M-z M-z M-z M-z M-z M-z M-z C-z C-z C-z
<up> <up> <up> C-z C-z C-z C-z C-z C-z M-z M-z M-z
M-z M-z M-z M-z M-z M-z M-z M-z C-z <up> M-z C-z M-z
M-z C-z <down> <mouse-1> <mouse-1> <mouse-1> <mouse-1>
M-z M-z C-z C-z C-z C-z <help-echo> <help-echo> <help-echo>
<down-mouse-1> <mouse-2> l <help-echo> <left> <left>
<right> <right> <left> <left> <left> <right> <kp-0>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <switch-frame> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <switch-frame>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1>
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1>
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1>
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1>
<mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1> <mouse-1>
<mouse-1> <mouse-1> <mouse-1> <mouse-1> C-z C-z M-z
M-z C-z M-z M-z C-z C-z C-z C-z <switch-frame> <switch-frame>
<switch-frame> <switch-frame> M-x r e p o r t - e m
<tab> <return>

Recent messages:
Mark saved where search started
Quit
"\\|@[a-zA-Z]*[
]\\| \\|[ ]*$"
Making completion list...
Found `paragraph-start' in Index.  (Only match)
Beginning of buffer
C-z runs the command (lambda nil (interactive) (scroll-up 1))
Beginning of buffer [2 times]
call-interactively: Beginning of buffer [2 times]
call-interactively: End of buffer

Load-path shadows:
None found.

Features:
(shadow emacsbug multi-isearch help-mode view texinfo auth-source
message ecomplete rfc822 mml mml-sec password-cache mm-decode
mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp
ietf-drums nnheader gnus-util netrc mm-util mail-prsvr gmm-utils
wid-edit mailheader canlock hashcash smtpmail dabbrev mailalias
mailabbrev sendmail rmailout conf-mode newcomment ld-script sh-script
executable dired-x dired-aux dired tcl generic parse-time nxml-uchnm
rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid rng-loc rng-uri
rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns
nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok
sgml-mode arc-mode archive-mode make-mode python-21 python comint ring
jka-compr vc-cvs info add-log flyspell ispell org-wl org-w3m org-vm
org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html
org-exp org-exp-blocks org-agenda org-info org-gnus org-bibtex
org-bbdb org byte-opt bytecomp byte-compile advice help-fns
advice-preload org-footnote org-src org-list org-faces org-compat
org-macs time-date noutline outline easy-mmode vc-bzr sha1 hex-util
cc-mode cc-fonts easymenu cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs regexp-opt rmailsum rmail mail-utils desktop
server filecache saveplace generic-x paren battery time tooltip
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp
w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
loaddefs button minibuffer faces cus-face files text-properties
overlay md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process multi-tty
emacs)





Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Drew Adams
>  emacs -Q
>  C-u C-h i /path/to/emacs/info/emacs RET
>  g Narrowing RET
>  C-u 1 C-v
>
> Note that the display does not scroll by one line.

And it is a regression: the problem does not exist in
GNU Emacs 23.1.95.1 (i386-mingw-nt5.1.2600)
 of 2010-04-03 on G41R2F1





Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Juri Linkov
In reply to this post by Eli Zaretskii
>  C-u 1 C-v
>
> Note that the display does not scroll by one line.  "C-u 2 C-v" does
> scroll by 2 lines, as well as "C-u 1 C-v" if the breadcrumbs are not
> visible.

It seems the bug is in the display engine.  `move_it_to' in
`window_scroll_pixel_based' doesn't move point when it's on
the overlay with the breadcrumbs line.

--
Juri Linkov
http://www.jurta.org/emacs/




Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Juri Linkov
>>  C-u 1 C-v
>>
>> Note that the display does not scroll by one line.  "C-u 2 C-v" does
>> scroll by 2 lines, as well as "C-u 1 C-v" if the breadcrumbs are not
>> visible.

This patch removes the scrolling problem:

=== modified file 'lisp/info.el'
--- lisp/info.el 2010-04-20 00:49:46 +0000
+++ lisp/info.el 2010-04-22 09:01:46 +0000
@@ -4365,8 +4365,7 @@ (defun Info-fontify-node ()
             (cond
              ((> Info-breadcrumbs-depth 0)
       (let ((ov (make-overlay (point-min) (1+ header-end))))
- (overlay-put ov 'invisible t)
- (overlay-put ov 'after-string (Info-breadcrumbs))
+ (overlay-put ov 'display (Info-breadcrumbs))
  (overlay-put ov 'evaporate t)))
              ((not (bobp))
               ;; Hide the punctuation at the end, too.

--
Juri Linkov
http://www.jurta.org/emacs/




Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Juri Linkov
If there are no objections, I'll install this patch to the
emacs-23 branch.

>>>  C-u 1 C-v
>>>
>>> Note that the display does not scroll by one line.  "C-u 2 C-v" does
>>> scroll by 2 lines, as well as "C-u 1 C-v" if the breadcrumbs are not
>>> visible.
>
> This patch removes the scrolling problem:
>
> === modified file 'lisp/info.el'
> --- lisp/info.el 2010-04-20 00:49:46 +0000
> +++ lisp/info.el 2010-04-22 09:01:46 +0000
> @@ -4365,8 +4365,7 @@ (defun Info-fontify-node ()
>              (cond
>               ((> Info-breadcrumbs-depth 0)
>        (let ((ov (make-overlay (point-min) (1+ header-end))))
> - (overlay-put ov 'invisible t)
> - (overlay-put ov 'after-string (Info-breadcrumbs))
> + (overlay-put ov 'display (Info-breadcrumbs))
>   (overlay-put ov 'evaporate t)))
>               ((not (bobp))
>                ;; Hide the punctuation at the end, too.

--
Juri Linkov
http://www.jurta.org/emacs/




Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Stefan Monnier
> If there are no objections, I'll install this patch to the
> emacs-23 branch.

Fine by me, it's a good change anyway.  But we should still try and fix
the underlying redisplay bug, of course.


        Stefan


>>>> C-u 1 C-v
>>>>
>>>> Note that the display does not scroll by one line.  "C-u 2 C-v" does
>>>> scroll by 2 lines, as well as "C-u 1 C-v" if the breadcrumbs are not
>>>> visible.
>>
>> This patch removes the scrolling problem:
>>
>> === modified file 'lisp/info.el'
>> --- lisp/info.el 2010-04-20 00:49:46 +0000
>> +++ lisp/info.el 2010-04-22 09:01:46 +0000
>> @@ -4365,8 +4365,7 @@ (defun Info-fontify-node ()
>> (cond
>> ((> Info-breadcrumbs-depth 0)
>> (let ((ov (make-overlay (point-min) (1+ header-end))))
>> - (overlay-put ov 'invisible t)
>> - (overlay-put ov 'after-string (Info-breadcrumbs))
>> + (overlay-put ov 'display (Info-breadcrumbs))
>> (overlay-put ov 'evaporate t)))
>> ((not (bobp))
>> ;; Hide the punctuation at the end, too.

> --
> Juri Linkov
> http://www.jurta.org/emacs/







Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Eli Zaretskii
> From: Stefan Monnier <[hidden email]>
> Cc: Eli Zaretskii <[hidden email]>, [hidden email]
> Date: Fri, 23 Apr 2010 10:38:03 -0400
>
> > If there are no objections, I'll install this patch to the
> > emacs-23 branch.
>
> Fine by me, it's a good change anyway.  But we should still try and fix
> the underlying redisplay bug, of course.

For that, I'd request a separate bug report, with a clear recipe to
reproduce ``the bug'' and an explanation what behavior was expected.




Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Juri Linkov
>> Fine by me, it's a good change anyway.  But we should still try and fix
>> the underlying redisplay bug, of course.
>
> For that, I'd request a separate bug report, with a clear recipe to
> reproduce ``the bug'' and an explanation what behavior was expected.

I tried to create a clear recipe to reproduce it:

(progn
  (goto-char (point-min))
  (insert "line 0\nline 1\nline 2\nline 3\n")
  (narrow-to-region (+ 7 (point-min)) (point-max))
  (let ((ov (make-overlay (point-min) (+ 6 (point-min)))))
    (overlay-put ov 'invisible t)
    (overlay-put ov 'after-string "after-string 1")
    (overlay-put ov 'evaporate t))
  (goto-char (point-min))
  (scroll-up 1))

but it doesn't fail.  Something more from Info mode affects it.

--
Juri Linkov
http://www.jurta.org/emacs/




Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Eli Zaretskii
> From: Juri Linkov <[hidden email]>
> Cc: Stefan Monnier <[hidden email]>,  [hidden email]
> Date: Fri, 23 Apr 2010 19:57:31 +0300
>
> >> Fine by me, it's a good change anyway.  But we should still try and fix
> >> the underlying redisplay bug, of course.
> >
> > For that, I'd request a separate bug report, with a clear recipe to
> > reproduce ``the bug'' and an explanation what behavior was expected.
>
> I tried to create a clear recipe to reproduce it:
>
> (progn
>   (goto-char (point-min))
>   (insert "line 0\nline 1\nline 2\nline 3\n")
>   (narrow-to-region (+ 7 (point-min)) (point-max))
>   (let ((ov (make-overlay (point-min) (+ 6 (point-min)))))
>     (overlay-put ov 'invisible t)
>     (overlay-put ov 'after-string "after-string 1")
>     (overlay-put ov 'evaporate t))
>   (goto-char (point-min))
>   (scroll-up 1))
>
> but it doesn't fail.  Something more from Info mode affects it.

Okay, but why do you think the bug is in redisplay?




Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Juri Linkov
>> > For that, I'd request a separate bug report, with a clear recipe to
>> > reproduce ``the bug'' and an explanation what behavior was expected.
>>
>> I tried to create a clear recipe to reproduce it:
>>
>> (progn
>>   (goto-char (point-min))
>>   (insert "line 0\nline 1\nline 2\nline 3\n")
>>   (narrow-to-region (+ 7 (point-min)) (point-max))
>>   (let ((ov (make-overlay (point-min) (+ 6 (point-min)))))
>>     (overlay-put ov 'invisible t)
>>     (overlay-put ov 'after-string "after-string 1")
>>     (overlay-put ov 'evaporate t))
>>   (goto-char (point-min))
>>   (scroll-up 1))
>>
>> but it doesn't fail.  Something more from Info mode affects it.
>
> Okay, but why do you think the bug is in redisplay?

It seems the bug is somewhere in `move_it_by_lines'.
I don't know whether it is redisplay or not.

--
Juri Linkov
http://www.jurta.org/emacs/




Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Andrew Hyatt-2
In reply to this post by Drew Adams
"Drew Adams" <[hidden email]> writes:

>>  emacs -Q
>>  C-u C-h i /path/to/emacs/info/emacs RET
>>  g Narrowing RET
>>  C-u 1 C-v
>>
>> Note that the display does not scroll by one line.
>
> And it is a regression: the problem does not exist in
> GNU Emacs 23.1.95.1 (i386-mingw-nt5.1.2600)
>  of 2010-04-03 on G41R2F1

The problem appears fixed in Emacs 25. Eli, can you reproduce this
still?



Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Eli Zaretskii
> From: Andrew Hyatt <[hidden email]>
> Cc: "'Eli Zaretskii'" <[hidden email]>,  <[hidden email]>
> Date: Mon, 05 Sep 2016 00:42:47 -0400
>
> "Drew Adams" <[hidden email]> writes:
>
> >>  emacs -Q
> >>  C-u C-h i /path/to/emacs/info/emacs RET
> >>  g Narrowing RET
> >>  C-u 1 C-v
> >>
> >> Note that the display does not scroll by one line.
> >
> > And it is a regression: the problem does not exist in
> > GNU Emacs 23.1.95.1 (i386-mingw-nt5.1.2600)
> >  of 2010-04-03 on G41R2F1
>
> The problem appears fixed in Emacs 25. Eli, can you reproduce this
> still?

No.  Juri installed the patched he proposed during the discussion, so
the bug is no longer exposed.  (But the original problem with
scrolling a window that starts with invisible text followed by an
overlay with an after-string -- that problem still exists.)



Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Juri Linkov-2
>> >>  emacs -Q
>> >>  C-u C-h i /path/to/emacs/info/emacs RET
>> >>  g Narrowing RET
>> >>  C-u 1 C-v
>> >>
>> >> Note that the display does not scroll by one line.
>> >
>> > And it is a regression: the problem does not exist in
>> > GNU Emacs 23.1.95.1 (i386-mingw-nt5.1.2600)
>> >  of 2010-04-03 on G41R2F1
>>
>> The problem appears fixed in Emacs 25. Eli, can you reproduce this
>> still?
>
> No.  Juri installed the patched he proposed during the discussion, so
> the bug is no longer exposed.  (But the original problem with
> scrolling a window that starts with invisible text followed by an
> overlay with an after-string -- that problem still exists.)

Or there is no bug at all: with invisible text followed by an overlay
with an after-string you can't put point to the beginning of the Info
buffer - probably for a reason.  OTOH, using more reasonable ‘display’
allows point to move to the top of the window, so perhaps this is why
scrolling works in the latter case but doesn't work in the former one.



Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Eli Zaretskii
> From: Juri Linkov <[hidden email]>
> Cc: Andrew Hyatt <[hidden email]>,  [hidden email],  [hidden email]
> Date: Mon, 05 Sep 2016 22:28:18 +0300
>
> > (But the original problem with
> > scrolling a window that starts with invisible text followed by an
> > overlay with an after-string -- that problem still exists.)
>
> Or there is no bug at all: with invisible text followed by an overlay
> with an after-string you can't put point to the beginning of the Info
> buffer - probably for a reason.  OTOH, using more reasonable ‘display’
> allows point to move to the top of the window, so perhaps this is why
> scrolling works in the latter case but doesn't work in the former one.

The actual problem is that an "empty" overlay (i.e. overlay that hides
no buffer positions) with a before-string or after-string at the
beginning of the window exposes a flaw in the method the Emacs display
engine determines a window-start position: it is specified by a buffer
position.  That makes the actual window-start on display ambiguous,
since both the overlay string and the buffer position after it have
the same value.  If the string also includes a newline, it defeats the
algorithm for scrolling a window by N lines, which just goes to the
window-start point, and then moves forward/back by those N lines.  In
particular, if N = 1, the buffer position after the move is unchanged,
and the scroll will appear to have not happened.

I have a working patch for fixing this, but it sometimes requires to
invoke the scroll command twice, so I'm trying to find a better fix.
If I won't find it, I will commit what I have, because it's an
improvement.



Reply | Threaded
Open this post in threaded view
|

bug#5998: 23.1.96; Breadcrumbs defeat C-u 1 C-v in Info

Eli Zaretskii
> From: Lars Ingebrigtsen <[hidden email]>
> Cc: Juri Linkov <[hidden email]>,  [hidden email],
>   [hidden email],  [hidden email]
> Date: Mon, 14 Sep 2020 15:32:43 +0200
>
> Eli Zaretskii <[hidden email]> writes:
>
> > I have a working patch for fixing this, but it sometimes requires to
> > invoke the scroll command twice, so I'm trying to find a better fix.
> > If I won't find it, I will commit what I have, because it's an
> > improvement.
>
> This was four years ago -- was this fixed?
>
> Skimming this thread, there seems to be no recipe to reproduce this
> bug; the original reported bug (with a test case) has been fixed.

Yes, so I'm closing this bug.