bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

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

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Kjetil Matheussen-2
Recipe to reproduce:
(note that it's important that you do _exactly_ as described. The bug
happens very often (and is extremely annoying), but it's very unclear
what triggers it.)

1. wget http://users.notam02.no/~kjetism/emacsindentationbug.scm
2. emacs emacsindentationbug.scm
3. Press Ctrl + S, search for "define column-widths"
4. The cursor should now be placed at line 2790
5. Press down-arrow so that that cursor is placed at line 2791
6. Press up -arrow so that the cursor is placed at line 2790 again.
7. Press TAB.
8. The line is wrongly indented (no indentation).


In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
 of 2020-07-18 built on localhost.localdomain
Windowing system distributor 'Fedora Project', version 11.0.11405000
System Description: Fedora release 20 (Heisenbug)

Recent messages:
Checking 24 files in /home/kjetil/site/share/emacs/26.3/lisp/cedet...
Checking 57 files in /home/kjetil/site/share/emacs/26.3/lisp/calendar...
Checking 87 files in /home/kjetil/site/share/emacs/26.3/lisp/calc...
Checking 105 files in /home/kjetil/site/share/emacs/26.3/lisp/obsolete...
Checking for load-path shadows...done
previous-line: Beginning of buffer [3 times]
Auto-saving...done
previous-line: Beginning of buffer [5 times]
Buffer *unsent mail to [hidden email]* modified; kill anyway? (y or n) y
Mark saved where search started [2 times]

Configured using:
 'configure --prefix=/home/kjetil/site --with-x-toolkit=lucid'

Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS
LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM THREADS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Scheme

Minor modes in effect:
  diff-auto-refine-mode: t
  iswitchb-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(pp shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec
epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader help-fns
radix-tree align two-column iso-transl help-mode xref project ffap
thingatpt make-mode dired-aux dired dired-loaddefs cmuscheme conf-mode
cc-mode cc-fonts cc-guess cc-menus cc-cmds misearch multi-isearch vc-git
diff-mode easy-mmode scheme elec-pair color-theme wid-edit cl sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils reporter
iswitchb finder-inf scala-mode2-autoloads package epg-config
url-handlers url-parse url-vars python easymenu tramp-sh tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time format-spec advice auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json map seq byte-opt gv bytecomp
byte-compile cconv comint ring ansi-color edmacro kmacro cc-styles
cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib 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 dynamic-setting system-font-setting font-render-setting
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 1270767 168270)
 (symbols 48 37217 2)
 (miscs 40 934 9001)
 (strings 32 113664 7701)
 (string-bytes 1 3016589)
 (vectors 16 60156)
 (vector-slots 8 1962000 165392)
 (floats 8 227 660)
 (intervals 56 160970 1318)
 (buffers 992 116)
 (heap 1024 108471 4922))



Reply | Threaded
Open this post in threaded view
|

bug#42622: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Kjetil Matheussen-2
Follow-up: It appears as if the bug is not present in 26.2, at least
when using this recipe.

On Thu, Jul 30, 2020 at 11:08 AM Kjetil Matheussen
<[hidden email]> wrote:

>
> Recipe to reproduce:
> (note that it's important that you do _exactly_ as described. The bug
> happens very often (and is extremely annoying), but it's very unclear
> what triggers it.)
>
> 1. wget http://users.notam02.no/~kjetism/emacsindentationbug.scm
> 2. emacs emacsindentationbug.scm
> 3. Press Ctrl + S, search for "define column-widths"
> 4. The cursor should now be placed at line 2790
> 5. Press down-arrow so that that cursor is placed at line 2791
> 6. Press up -arrow so that the cursor is placed at line 2790 again.
> 7. Press TAB.
> 8. The line is wrongly indented (no indentation).
>
>
> In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars)
>  of 2020-07-18 built on localhost.localdomain
> Windowing system distributor 'Fedora Project', version 11.0.11405000
> System Description: Fedora release 20 (Heisenbug)
>
> Recent messages:
> Checking 24 files in /home/kjetil/site/share/emacs/26.3/lisp/cedet...
> Checking 57 files in /home/kjetil/site/share/emacs/26.3/lisp/calendar...
> Checking 87 files in /home/kjetil/site/share/emacs/26.3/lisp/calc...
> Checking 105 files in /home/kjetil/site/share/emacs/26.3/lisp/obsolete...
> Checking for load-path shadows...done
> previous-line: Beginning of buffer [3 times]
> Auto-saving...done
> previous-line: Beginning of buffer [5 times]
> Buffer *unsent mail to [hidden email]* modified; kill anyway? (y or n) y
> Mark saved where search started [2 times]
>
> Configured using:
>  'configure --prefix=/home/kjetil/site --with-x-toolkit=lucid'
>
> Configured features:
> XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS
> LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM THREADS
>
> Important settings:
>   value of $LANG: en_US.UTF-8
>   locale-coding-system: utf-8-unix
>
> Major mode: Scheme
>
> Minor modes in effect:
>   diff-auto-refine-mode: t
>   iswitchb-mode: t
>   shell-dirtrack-mode: t
>   tooltip-mode: t
>   global-eldoc-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   menu-bar-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   auto-composition-mode: t
>   auto-encryption-mode: t
>   auto-compression-mode: t
>   column-number-mode: t
>   line-number-mode: t
>   transient-mark-mode: t
>
> Load-path shadows:
> None found.
>
> Features:
> (pp shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec
> epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies
> mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader help-fns
> radix-tree align two-column iso-transl help-mode xref project ffap
> thingatpt make-mode dired-aux dired dired-loaddefs cmuscheme conf-mode
> cc-mode cc-fonts cc-guess cc-menus cc-cmds misearch multi-isearch vc-git
> diff-mode easy-mmode scheme elec-pair color-theme wid-edit cl sendmail
> rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils reporter
> iswitchb finder-inf scala-mode2-autoloads package epg-config
> url-handlers url-parse url-vars python easymenu tramp-sh tramp
> tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
> parse-time format-spec advice auth-source cl-seq eieio eieio-core
> cl-macs eieio-loaddefs password-cache json map seq byte-opt gv bytecomp
> byte-compile cconv comint ring ansi-color edmacro kmacro cc-styles
> cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib 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 dynamic-setting system-font-setting font-render-setting
> x-toolkit x multi-tty make-network-process emacs)
>
> Memory information:
> ((conses 16 1270767 168270)
>  (symbols 48 37217 2)
>  (miscs 40 934 9001)
>  (strings 32 113664 7701)
>  (string-bytes 1 3016589)
>  (vectors 16 60156)
>  (vector-slots 8 1962000 165392)
>  (floats 8 227 660)
>  (intervals 56 160970 1318)
>  (buffers 992 116)
>  (heap 1024 108471 4922))



Reply | Threaded
Open this post in threaded view
|

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Kjetil Matheussen-2
In reply to this post by Kjetil Matheussen-2
On Wed, Aug 5, 2020 at 8:06 PM Simen Heggestøyl <[hidden email]> wrote:

>
> I can't reproduce the bug in Emacs 26.3 (nor in the Emacs 27.1 RC) by
> following the recipe from 'emacs -Q'.
>
> Kjetil Matheussen <[hidden email]> writes:
>
> > 8. The line is wrongly indented (no indentation).
>
> Assuming you mean you expect it to keep its indentation at column 2, but
> instead see it deindented to column 0 (which is wrong)?
>

Yes, it's deindented to column 0.

I couldn't reproduce it with "emacs -Q" either, but I minimized my
.emacs file down to the lines below to reproduce it. Can you reproduce
it now?

(defun toggle-fullscreen (&optional f)
      (interactive)
      (let ((current-value (frame-parameter nil 'fullscreen)))
           (set-frame-parameter nil 'fullscreen
                                (if (equal 'fullboth current-value)
                                    (if (boundp 'old-fullscreen)
old-fullscreen nil)
                                    (progn (setq old-fullscreen current-value)
                                           'fullboth)))))

(toggle-fullscreen)



Reply | Threaded
Open this post in threaded view
|

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Kjetil Matheussen-2
On Wed, Aug 5, 2020 at 8:30 PM Kjetil Matheussen
<[hidden email]> wrote:

>
> On Wed, Aug 5, 2020 at 8:06 PM Simen Heggestøyl <[hidden email]> wrote:
> >
> > I can't reproduce the bug in Emacs 26.3 (nor in the Emacs 27.1 RC) by
> > following the recipe from 'emacs -Q'.
> >
> > Kjetil Matheussen <[hidden email]> writes:
> >
> > > 8. The line is wrongly indented (no indentation).
> >
> > Assuming you mean you expect it to keep its indentation at column 2, but
> > instead see it deindented to column 0 (which is wrong)?
> >
>
> Yes, it's deindented to column 0.
>
> I couldn't reproduce it with "emacs -Q" either, but I minimized my
> .emacs file down to the lines below to reproduce it. Can you reproduce
> it now?
>

Actually, it's enough just to maximize the window:

1. emacs -Q
2. maximize emacs window
3.(same procedure)



Reply | Threaded
Open this post in threaded view
|

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Eli Zaretskii
> From: Kjetil Matheussen <[hidden email]>
> Date: Thu, 6 Aug 2020 10:32:30 +0200
> Cc: [hidden email], Kjetil Matheussen <[hidden email]>
>
> 1. wget http://users.notam02.no/~kjetism/emacsindentationbug.scm
> 2. emacs -Q emacsindentationbug.scm
> 3. maximize emacs window
> 4. Press Ctrl + S, search for "define column-widths"
> 5. The cursor should now be placed at line 2790
> 6. Press down-arrow so that that cursor is placed at line 2791
> 7. Press up -arrow so that the cursor is placed at line 2790 again.
> 8. Press TAB.
> 9. The line is wrongly indented (no indentation).

FWIW, I cannot reproduce even with this recipe: in my case the
indentation stays at its original form, i.e. 2 columns.



Reply | Threaded
Open this post in threaded view
|

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Kjetil Matheussen-2
On Thu, Aug 6, 2020 at 3:48 PM Eli Zaretskii <[hidden email]> wrote:

>
> > From: Kjetil Matheussen <[hidden email]>
> > Date: Thu, 6 Aug 2020 10:32:30 +0200
> > Cc: [hidden email], Kjetil Matheussen <[hidden email]>
> >
> > 1. wget http://users.notam02.no/~kjetism/emacsindentationbug.scm
> > 2. emacs -Q emacsindentationbug.scm
> > 3. maximize emacs window
> > 4. Press Ctrl + S, search for "define column-widths"
> > 5. The cursor should now be placed at line 2790
> > 6. Press down-arrow so that that cursor is placed at line 2791
> > 7. Press up -arrow so that the cursor is placed at line 2790 again.
> > 8. Press TAB.
> > 9. The line is wrongly indented (no indentation).
>
> FWIW, I cannot reproduce even with this recipe: in my case the
> indentation stays at its original form, i.e. 2 columns.

Yeah, it's weird that resizing the window should make a difference.
Perhaps font size or screen size makes a difference?
It seems like I can reproduce it just by manually resizing the window
though (using the mouse and drag), not just maximizing it. Make that
works for you.

Also, which toolkit are you using? I've compiled emacs like this:

Configured using:
 'configure --prefix=/home/kjetil/site --with-x-toolkit=lucid'

Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS
LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM THREADS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix



Reply | Threaded
Open this post in threaded view
|

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Simen Heggestøyl-3
In reply to this post by Kjetil Matheussen-2
Kjetil Matheussen <[hidden email]> writes:

> Actually, it's enough just to maximize the window:
>
> 1. emacs -Q
> 2. maximize emacs window
> 3.(same procedure)

I managed to reproduce it with both 26.3 and the 27.1 RC now. Not by
maximizing the window, but by resizing it to be slightly larger than the
initial size, for instance a 114x42 frame size. With the window in its
initial size or maximized the bug doesn't reproduce here.

-- Simen



Reply | Threaded
Open this post in threaded view
|

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Eli Zaretskii
In reply to this post by Kjetil Matheussen-2
> From: Kjetil Matheussen <[hidden email]>
> Date: Thu, 6 Aug 2020 16:03:38 +0200
> Cc: Kjetil Matheussen <[hidden email]>, [hidden email], [hidden email]
>
> > FWIW, I cannot reproduce even with this recipe: in my case the
> > indentation stays at its original form, i.e. 2 columns.
>
> Yeah, it's weird that resizing the window should make a difference.
> Perhaps font size or screen size makes a difference?

Unlikely: indentation works in column units, and that is independent
of the font.

> Also, which toolkit are you using? I've compiled emacs like this:
>
> Configured using:
>  'configure --prefix=/home/kjetil/site --with-x-toolkit=lucid'

I'm on MS-Windows, so this is the native Windows toolkit.  But again,
I'd be surprised if the toolkit had any effect on indentation.



Reply | Threaded
Open this post in threaded view
|

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Kjetil Matheussen-2
On Thu, Aug 6, 2020 at 4:11 PM Eli Zaretskii <[hidden email]> wrote:

>
> > From: Kjetil Matheussen <[hidden email]>
> > Date: Thu, 6 Aug 2020 16:03:38 +0200
> > Cc: Kjetil Matheussen <[hidden email]>, [hidden email], [hidden email]
> >
> > > FWIW, I cannot reproduce even with this recipe: in my case the
> > > indentation stays at its original form, i.e. 2 columns.
> >
> > Yeah, it's weird that resizing the window should make a difference.
> > Perhaps font size or screen size makes a difference?
>
> Unlikely: indentation works in column units, and that is independent
> of the font.

I was mainly thinking of font size/screen size in the sense that it
probably determines how many columns and lines there are room for in
the window when maximizing.



Reply | Threaded
Open this post in threaded view
|

bug#42621: 26.3; Scheme mode: Wrong indentation (no indentation) when pressing tab

Kjetil Matheussen-2
In reply to this post by Kjetil Matheussen-2
On Thu, Aug 6, 2020 at 7:13 PM Simen Heggestøyl <[hidden email]> wrote:

>
> Simen Heggestøyl <[hidden email]> writes:
>
> > Simen Heggestøyl <[hidden email]> writes:
> >
> >> Kjetil Matheussen <[hidden email]> writes:
> >>
> >>> Actually, it's enough just to maximize the window:
> >>>
> >>> 1. emacs -Q
> >>> 2. maximize emacs window
> >>> 3.(same procedure)
> >>
> >> I managed to reproduce it with both 26.3 and the 27.1 RC now. Not by
> >> maximizing the window, but by resizing it to be slightly larger than the
> >> initial size, for instance a 114x42 frame size. With the window in its
> >> initial size or maximized the bug doesn't reproduce here.
> >
> > It may look like it has been fixed on master. At least I haven't been
> > able to reproduce it yet by following the same recipe that made the bug
> > appear for me with 26.3 and 27.1.
>
> Bisection suggests that the bug was fixed by Stefan Monnier in commit
> cdadb7a97cbed523af9f52705d8b03e91d17313f.
>

Thank you Simen. I've tried git HEAD and couldn't reproduce either.