GNU bug report logs - #41965
26.3; weird behaviour of 'scroll-down-line'

Previous Next

Package: emacs;

Reported by: cage <cage-dev <at> twistfold.it>

Date: Sat, 20 Jun 2020 16:22:02 UTC

Severity: normal

Found in version 26.3

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41965 in the body.
You can then email your comments to 41965 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41965; Package emacs. (Sat, 20 Jun 2020 16:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to cage <cage-dev <at> twistfold.it>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 20 Jun 2020 16:22:02 GMT) Full text and rfc822 format available.

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

From: cage <cage-dev <at> twistfold.it>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; weird behaviour of 'scroll-down-line'
Date: Sat, 20 Jun 2020 13:36:18 +0200
Hi!

I got  a strange issue  with the command  mentioned in the  subject, not
sure it  is an actual  bug but seems at  least an inconsistency  in this
command.

to reproduce this issue

1. paste the following code in a buffer:

-----8<----8<---------8<----8<----
(let ((prefix-first " \n")
        (stopper      "\n"))
    (list 'face 'default 'display
          (concat prefix-first
                  (propertize "foo"
                              'face '(:background "red" :foreground "yellow"))
                  stopper))))

(defun scroll-note ()
  (add-text-properties 31 32 (scroll-note-property)))

(scroll-note)
-----8<----8<---------8<----8<----

2. move the cursor at the beginning of the buffer (position 1)

3. eval the buffer's content
   - a "note" 'foo' with red background should be shown on the second
   line (as a display property of the first newline character)

4. M-x scroll-up-line -> scroll up two lines (i.e. jump to line 3
   starting from 1)

5. M-x scroll-down-line -> scroll down one line (i.e. jump to line 2
   starting from 1) and get stuck there, any subsequent call to
   scroll-down-line does nothing and the line 1 is never shown
   (using that command)

for context, this is related to the package annotate.el

Thank you!
C.

In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2020-05-17, modified by Debian built on x86-csail-01
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description:	Debian GNU/Linux bullseye/sid

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
user-error: Beginning of history; no preceding item
user-error: End of history; no default available
Making completion list...
user-error: Beginning of history; no preceding item
Making completion list... [2 times]
user-error: Beginning of history; no preceding item

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-mHAik2/emacs-26.3+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: it_IT.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-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-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq dired
dired-loaddefs format-spec rfc822 mml easymenu mml-sec epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils ffap thingatpt
url-parse auth-source cl-seq eieio byte-opt bytecomp byte-compile cconv
eieio-core cl-macs gv eieio-loaddefs cl-loaddefs cl-lib password-cache
url-vars elec-pair time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 103678 6591)
 (symbols 48 21169 1)
 (miscs 40 46 166)
 (strings 32 30831 944)
 (string-bytes 1 812929)
 (vectors 16 15798)
 (vector-slots 8 519276 9326)
 (floats 8 52 69)
 (intervals 56 317 8)
 (buffers 992 14))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41965; Package emacs. (Sat, 20 Jun 2020 17:14:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: cage <cage-dev <at> twistfold.it>
Cc: 41965 <at> debbugs.gnu.org
Subject: Re: bug#41965: 26.3; weird behaviour of 'scroll-down-line'
Date: Sat, 20 Jun 2020 20:12:46 +0300
> Date: Sat, 20 Jun 2020 13:36:18 +0200
> From: cage <cage-dev <at> twistfold.it>
> 
> 1. paste the following code in a buffer:
> 
> -----8<----8<---------8<----8<----
> (let ((prefix-first " \n")
>         (stopper      "\n"))
>     (list 'face 'default 'display
>           (concat prefix-first
>                   (propertize "foo"
>                               'face '(:background "red" :foreground "yellow"))
>                   stopper))))
> 
> (defun scroll-note ()
>   (add-text-properties 31 32 (scroll-note-property)))
> 
> (scroll-note)
> -----8<----8<---------8<----8<----

Thanks, but I couldn't use this recipe to try to reproduce the
problem.  First there are too many closing parentheses after
"stopper".  More importantly, I cannot find the function
scroll-note-property in Emacs, and no package called annotate.el.

So it seems like some details are missing from the recipe.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41965; Package emacs. (Sat, 20 Jun 2020 19:01:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: cage <cage-dev <at> twistfold.it>
Cc: 41965 <at> debbugs.gnu.org
Subject: Re: bug#41965: 26.3; weird behaviour of 'scroll-down-line'
Date: Sat, 20 Jun 2020 21:59:47 +0300
[Please use Reply All to keep the bug address on the CC line.]

> Date: Sat, 20 Jun 2020 20:48:10 +0200
> From: cage <cage-dev <at> twistfold.it>
> 
> > Thanks, but I couldn't use this recipe to try to reproduce the
> > problem.  First there are too many closing parentheses after
> > "stopper".  More importantly, I cannot find the function
> > scroll-note-property in Emacs, and no package called annotate.el.
> >
> > So it seems like some details are missing from the recipe.
> 
> I am deeply sorry, i missed a line from the original code! :(
> 
> this is the correct one (or so I hope! ;-)):
> 
> -----8<----8<---------8<----8<----
> 
> (defun scroll-note-property ()
>   (let ((prefix-first " \n")
>         (stopper      "\n"))
>     (list 'face 'default 'display
>           (concat prefix-first
>                   (propertize "foo"
>                               'face '(:background "red" :foreground "yellow"))
>                   stopper))))
> 
> (defun scroll-note ()
>   (add-text-properties 31 32 (scroll-note-property)))
> 
> (scroll-note)
> 
> -----8<----8<---------8<----8<----

OK, now I see what you see.

However, this is the expected behavior: Emacs cannot display a window
with the window-start position inside a display property.  If you
trick Emacs into doing that, you get what you describe.

Instead of "M-x scroll-down-line RET", you need to scroll 2 lines at
that point, as in "C-u 2 M-x scroll-down-line RET".  You need to make
the window start before the display property.

This is not a bug, just a known limitation of the current display
code.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41965; Package emacs. (Sat, 20 Jun 2020 21:01:01 GMT) Full text and rfc822 format available.

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

From: cage <cage-dev <at> twistfold.it>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41965 <at> debbugs.gnu.org, cage <cage-dev <at> twistfold.it>
Subject: Re: bug#41965: 26.3; weird behaviour of 'scroll-down-line'
Date: Sat, 20 Jun 2020 21:24:33 +0200
On Sat, Jun 20, 2020 at 09:59:47PM +0300, Eli Zaretskii wrote:

Hi Eli!

> [Please use Reply All to keep the bug address on the CC line.]

Sorry, again!

[...]

>
> OK, now I see what you see.
>
> However, this is the expected behavior: Emacs cannot display a window
> with the window-start position inside a display property.  If you
> trick Emacs into doing that, you get what you describe.
>
> Instead of "M-x scroll-down-line RET", you need to scroll 2 lines at
> that point, as in "C-u 2 M-x scroll-down-line RET".

Yes, that's what a clever user of annotate.el actually did! :)

> You need to make
> the window start before the display property.
>
> This is not a bug, just a known limitation of the current display
> code.

Thank you for  clarifying this, i suspected this could  not actually a
bug but  i needed  some more information  from people  with experience
with the Emacs internals to be sure what was happening.

Thank you again for your kind and quick reply and for your work! :)

Bye!
C.




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Thu, 13 Aug 2020 00:52:03 GMT) Full text and rfc822 format available.

Notification sent to cage <cage-dev <at> twistfold.it>:
bug acknowledged by developer. (Thu, 13 Aug 2020 00:52:03 GMT) Full text and rfc822 format available.

Message #19 received at 41965-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41965-done <at> debbugs.gnu.org, cage <cage-dev <at> twistfold.it>
Subject: Re: bug#41965: 26.3; weird behaviour of 'scroll-down-line'
Date: Wed, 12 Aug 2020 17:50:55 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> This is not a bug, just a known limitation of the current display
> code.

I'm therefore closing this bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Sep 2020 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 200 days ago.

Previous Next


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