From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim McKim Newsgroups: gmane.emacs.bugs Subject: bug#47549: 26.3; cperl-mode: buffer view is being re-positioned outside user control Date: Thu, 1 Apr 2021 11:40:28 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c4b91405beeb0d9b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26911"; mail-complaints-to="usenet@ciao.gmane.io" To: 47549@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 01 17:56:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRzg7-0006tW-Ac for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Apr 2021 17:56:15 +0200 Original-Received: from localhost ([::1]:40090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRzg6-0008Q8-Bj for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Apr 2021 11:56:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRzdy-00076a-5W for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 11:54:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRzdx-0000Mx-TO for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 11:54:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lRzdx-0003wU-RS for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 11:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim McKim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Apr 2021 15:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47549 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161729240415105 (code B ref -1); Thu, 01 Apr 2021 15:54:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Apr 2021 15:53:24 +0000 Original-Received: from localhost ([127.0.0.1]:58386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRzdL-0003vY-PV for submit@debbugs.gnu.org; Thu, 01 Apr 2021 11:53:24 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRzR8-0003cE-K0 for submit@debbugs.gnu.org; Thu, 01 Apr 2021 11:40:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRzR8-0000ZP-D1 for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 11:40:46 -0400 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:55043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRzR6-0000dq-0s for bug-gnu-emacs@gnu.org; Thu, 01 Apr 2021 11:40:46 -0400 Original-Received: by mail-wm1-x332.google.com with SMTP id k128so1259127wmk.4 for ; Thu, 01 Apr 2021 08:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=2E9/N7Nt1V3rjbXSIhzYEPp8ljMmUBTpAEWZD6YmH5Y=; b=X5zmS2/7SDeYYjTCFMrUd5xO3l/d+EEeg2WTiA6NHYOvs9F75GMVJC/L4/n1DUshit fBi9wK9B/N55ggCcAzybqP3tUknzuWgc0mB0OvuAaWrQ27xZd3rVLcXmqlg5sh39Nrc/ eqnvHxnGFoWuXfp2hxnn3jxL/itJ0du2U/ROwD2oOSt3yT8QWzk6nY2K53T2Ba130vnL 0upUJThzuGCX71HjpL5J6wz9/ZwSKlRi4fqlnlWKPS0kzcGdSbCytYSd9O45BOkeM4wf uaVEOEPV/5ay7itd8ukWb0OB5+SV1dmUzOHt+zcEQdpbBx3z9/NwjdfP9q5bBEKRk+5p rfdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=2E9/N7Nt1V3rjbXSIhzYEPp8ljMmUBTpAEWZD6YmH5Y=; b=AjwNuBU4V1UNpWSAudHVhpEa/c7zM9I8XMzAvrGcmBzOiSdd91TpddLM4eSGP8F7Ot TFp+lRv0iIX6tKg8riYgDgG6Tz+jQSMk661eLtHf3+xE+a4LQhGG7zscGazUNL3TTppN V1a0oUl9mkDwiaFBDtbm8TBnBSQu4qg2rJ7KnGDoNH0m8gbt02vBeGOWeWxz7ocbvI+r w9F5oa/lJ/pGpWCVLJ7dB1xLo8IiLorXuPYC+xxkA9eUYPahqmlUhuKW7mpPLWHF0PUw j5fx3mVYs0IG2Fhll8tqLT0lZGjjCgOC0LPb+O4azt37RM44GusSzUqYCpEliapEVqTT 1jtg== X-Gm-Message-State: AOAM532eYrBSxZ9UtmgjxbMeS/QcrXAR9+IhWnGeDMe6L+1wqde0P5EW hxDKqoZlUJBlwtTP+gU/jfO2Hxqtjqqxmg6JqThSudty3N4= X-Google-Smtp-Source: ABdhPJzDKSRIQFjlJA14tDIDjrzmIc32xEdAUW3La7phsQ/0GbRy/xwKVgjSwo5wssL0mR/WLxkU6y8Thlzu/kEG5Jk= X-Received: by 2002:a7b:ce91:: with SMTP id q17mr8954917wmj.28.1617291641140; Thu, 01 Apr 2021 08:40:41 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=jmckim@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 01 Apr 2021 11:53:22 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203433 Archived-At: --000000000000c4b91405beeb0d9b Content-Type: text/plain; charset="UTF-8" --text follows this line-- - Starting from 'emacs -Q' - Invoke CPerl mode via 'M-X cperl-mode'. - Edit (or create) a buffer that has more lines than the display window. - Open another window (same size), via 'C-x 5 2'. - Position the view in that second window to the end of the buffer, via 'ESC->'. - In the first window, near the top of the buffer, enter this string, the start of a pair of escaped [] brackets within a perl regexp range: my $x = qr/[\[\ - Enter the second escaped ']': my $x = qr/[\[\] When it is entered, a diagnostic like Couldn't find end of charclass in a REx, pos=33584 is displayed in the echo area at the bottom of the edit window and then the other window displaying that buffer is scrolled (repositioned) back to the same view as the window being edited, outside the user's control, abandoning its previous position. The views, the windows, that are repositioned are those of any latter part of the buffer. Peculiarly, identical edits in latter portions of the buffer do not cause a similar repositioning of top-of-buffer views although they do generate the diagnostic. This is just one example of how the repositioning happens. In general, any edit that results in a message being displayed in the echo area causes the view to be repositioned. In the cperl source (git cperl-master), it looks like these diagnostics are generated via elisp's (message) function. Is this repositioning a side effect of that function? The repositioning causes problems when it's important to maintain multiple views of different parts of a large file. It's like shaking all the bookmarks out of a reference book, then trying to find the bookmarked places again. In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian built on lcy01-amd64-020 Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Ubuntu 20.04.2 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. 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-mEZBk7/emacs-26.3+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -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: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction 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 byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache 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 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 94874 11705) (symbols 48 20386 1) (miscs 40 44 143) (strings 32 28402 800) (string-bytes 1 746365) (vectors 16 13898) (vector-slots 8 500864 9876) (floats 8 49 231) (intervals 56 262 0) (buffers 992 11)) --000000000000c4b91405beeb0d9b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
--text follows this line--

- Starting from 'ema= cs -Q'

- Invoke CPerl mode via 'M-X cperl-mode'.

= - Edit (or create) a buffer that has more lines than the display window.
- Open another window (same size), via 'C-x 5 2'.

- Pos= ition the view in that second window to the end of the buffer, via
'= ESC->'.

- In the first window, near the top of the buffe= r, enter this string,
the start of a pair of escaped [] brackets= within a perl regexp range:

my $x =3D qr/[\[\

- Enter the = second escaped ']':

my $x =3D qr/[\[\]

When it is ent= ered, a diagnostic like

=C2=A0 Couldn't find end of charcla= ss in a REx, pos=3D33584

is displayed in the echo = area at the bottom of the edit window and then
the other window displayi= ng that buffer is scrolled (repositioned) back
to the same view as the w= indow being edited, outside the user's control,
abandoning its previ= ous position.

The views, the windows, that are repositioned are thos= e of any latter
part of the buffer.

Peculiarly, identical edits i= n latter portions of the buffer do not
cause a similar repositioning of = top-of-buffer views although they do
generate the diagnostic.

Thi= s is just one example of how the repositioning happens. In general,
any = edit that results in a message being displayed in the echo area
causes t= he view to be repositioned.

In the cperl source (git cperl-master), = it looks like these
diagnostics are generated via elisp's (message) = function. Is this
repositioning a side effect of that function?

T= he repositioning causes problems when it's important to maintain
mul= tiple views of different parts of a large file. It's like shaking
al= l the bookmarks out of a reference book, then trying to find the
bookmar= ked places again.

In GNU Emacs 26.3 (build 2, x86_64-pc-linux= -gnu, GTK+ Version 3.24.14)
=C2=A0of 2020-03-26, modified by Debian buil= t on lcy01-amd64-020
Windowing system distributor 'The X.Org Foundat= ion', version 11.0.12009000
System Description: =C2=A0 =C2=A0 Ubuntu= 20.04.2 LTS

Recent messages:
For information about GNU Emacs and= the GNU system, type C-h C-a.

Configured using:
=C2=A0'confi= gure --build x86_64-linux-gnu --prefix=3D/usr
=C2=A0--sharedstatedir=3D/= var/lib --libexecdir=3D/usr/lib
=C2=A0--localstatedir=3D/var/lib --infod= ir=3D/usr/share/info
=C2=A0--mandir=3D/usr/share/man --enable-libsystemd= --with-pop=3Dyes
=C2=A0--enable-locallisppath=3D/etc/emacs:/usr/local/s= hare/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs= /26.3/site-lisp:/usr/share/emacs/site-lisp
=C2=A0--with-sound=3Dalsa --w= ithout-gconf --with-mailutils --build
=C2=A0x86_64-linux-gnu --prefix=3D= /usr --sharedstatedir=3D/var/lib
=C2=A0--libexecdir=3D/usr/lib --localst= atedir=3D/var/lib
=C2=A0--infodir=3D/usr/share/info --mandir=3D/usr/shar= e/man --enable-libsystemd
=C2=A0--with-pop=3Dyes
=C2=A0--enable-local= lisppath=3D/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/shar= e/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lis= p
=C2=A0--with-sound=3Dalsa --without-gconf --with-mailutils --with-x=3D= yes
=C2=A0--with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS= =3D-g -O2
=C2=A0-fdebug-prefix-map=3D/build/emacs-mEZBk7/emacs-26.3+1=3D= . -fstack-protector-strong
=C2=A0-Wformat -Werror=3Dformat-security -Wal= l' 'CPPFLAGS=3D-Wdate-time
=C2=A0-D_FORTIFY_SOURCE=3D2' '= ;LDFLAGS=3D-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configure= d features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTI= NGS GLIB
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF X= FT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2
Important settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 v= alue of $XMODIFIERS: @im=3Dibus
=C2=A0 locale-coding-system: utf-8-unix<= br>
Major mode: Lisp Interaction

Minor modes in effect:
=C2=A0= tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 eldoc-mode: t
= =C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool= -bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode: t<= br>=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 bl= ink-cursor-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryp= tion-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode:= t
=C2=A0 transient-mark-mode: t

Load-path shadows:
None found= .


Features:
(shadow sort mail-extr emac= sbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loa= ddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-se= c password-cache epa derived epg
epg-config gnus-util rmail rmail-loadde= fs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils= mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-= utils elec-pair time-date
mule-util tooltip eldoc electric uniquify edif= f-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 replac= e newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu= -bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-loc= k
syntax facemenu font-core term/tty-colors frame cl-generic cham georgi= an
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
j= apanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
eth= iopic indian cyrillic chinese composite charscript charprop
case-table e= pa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded= nadvice loaddefs button faces cus-face macroexp files
text-properties o= verlay sha1 md5 base64 format env code-pages mule
custom widget hashtabl= e-print-readable backquote threads dbusbind
inotify lcms2 dynamic-settin= g system-font-setting font-render-setting
move-toolbar gtk x-toolkit x m= ulti-tty make-network-process emacs)

Memory inform= ation:
((conses 16 94874 11705)
=C2=A0(symbols 48 20386 1)
=C2=A0(= miscs 40 44 143)
=C2=A0(strings 32 28402 800)
=C2=A0(string-bytes 1 7= 46365)
=C2=A0(vectors 16 13898)
=C2=A0(vector-slots 8 500864 9876)=C2=A0(floats 8 49 231)
=C2=A0(intervals 56 262 0)
=C2=A0(buffers 99= 2 11))

--000000000000c4b91405beeb0d9b--