unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41965: 26.3; weird behaviour of 'scroll-down-line'
@ 2020-06-20 11:36 cage
  2020-06-20 17:12 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: cage @ 2020-06-20 11:36 UTC (permalink / raw)
  To: 41965

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))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#41965: 26.3; weird behaviour of 'scroll-down-line'
  2020-06-20 11:36 bug#41965: 26.3; weird behaviour of 'scroll-down-line' cage
@ 2020-06-20 17:12 ` Eli Zaretskii
       [not found]   ` <20200620184810.GA34209@kurosawa.casa.net>
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2020-06-20 17:12 UTC (permalink / raw)
  To: cage; +Cc: 41965

> Date: Sat, 20 Jun 2020 13:36:18 +0200
> From: cage <cage-dev@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#41965: 26.3; weird behaviour of 'scroll-down-line'
       [not found]   ` <20200620184810.GA34209@kurosawa.casa.net>
@ 2020-06-20 18:59     ` Eli Zaretskii
  2020-06-20 19:24       ` cage
  2020-08-13  0:50       ` Stefan Kangas
  0 siblings, 2 replies; 5+ messages in thread
From: Eli Zaretskii @ 2020-06-20 18:59 UTC (permalink / raw)
  To: cage; +Cc: 41965

[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@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#41965: 26.3; weird behaviour of 'scroll-down-line'
  2020-06-20 18:59     ` Eli Zaretskii
@ 2020-06-20 19:24       ` cage
  2020-08-13  0:50       ` Stefan Kangas
  1 sibling, 0 replies; 5+ messages in thread
From: cage @ 2020-06-20 19:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cage, 41965

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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#41965: 26.3; weird behaviour of 'scroll-down-line'
  2020-06-20 18:59     ` Eli Zaretskii
  2020-06-20 19:24       ` cage
@ 2020-08-13  0:50       ` Stefan Kangas
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2020-08-13  0:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cage, 41965-done

Eli Zaretskii <eliz@gnu.org> writes:

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

I'm therefore closing this bug report.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-13  0:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-20 11:36 bug#41965: 26.3; weird behaviour of 'scroll-down-line' cage
2020-06-20 17:12 ` Eli Zaretskii
     [not found]   ` <20200620184810.GA34209@kurosawa.casa.net>
2020-06-20 18:59     ` Eli Zaretskii
2020-06-20 19:24       ` cage
2020-08-13  0:50       ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).