GNU bug report logs - #80181
31.0.50; move-to-column sometimes unexpectedly changes the result of recentering

Previous Next

Package: emacs;

Reported by: Markus Triska <triska <at> metalevel.at>

Date: Sun, 11 Jan 2026 07:41:02 UTC

Severity: normal

Found in version 31.0.50

To reply to this bug, email your comments to 80181 AT debbugs.gnu.org.

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#80181; Package emacs. (Sun, 11 Jan 2026 07:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Markus Triska <triska <at> metalevel.at>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 11 Jan 2026 07:41:02 GMT) Full text and rfc822 format available.

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

From: Markus Triska <triska <at> metalevel.at>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; move-to-column sometimes unexpectedly changes the result
 of recentering
Date: Sun, 11 Jan 2026 08:30:27 +0100
To reproduce this issue, please start Emacs with:

    $ emacs -Q

and then evaluate the following form:

    (defun unexpected-recenter ()
      (interactive)
      (switch-to-buffer (get-buffer-create "recenter"))
      (erase-buffer)
      (prolog-mode)
      (insert "hello.")
      (redisplay)
      (font-lock-mode 0)
      (move-to-column 10 t)
      (redisplay)
      (insert "\n\n")
      (recenter 0))

Then, when I do:

    M-x unexpected-recenter RET

and then:

    M-: (= (line-number-at-pos (window-start)) (line-number-at-pos)) RET

then I unexpectedly get: nil.

In contrast, the expected result is: t, on the grounds that the final
(recenter 0) is expected to put point on the first line of the window.

However, when I comment out the line:

      (move-to-column 10 t)

and apply the same steps, then the result is as expected: t.

Likewise, when I use the orginal function definition, and do:

    M-: (setq font-lock-support-mode nil) RET

followed by:

    M-x unexpected-recenter RET
    M-: (= (line-number-at-pos (window-start)) (line-number-at-pos)) RET

then I also get the expected result: t.

So, `move-to-column' and `font-lock-support-mode' sometimes
unexpectedly change the outcome of recentering.

Would it be possible to make recentering work reliably also if these
features are used? I would greatly appreciate any help!

Thank you and all the best,
Markus


In GNU Emacs 31.0.50 (build 9, x86_64-pc-linux-gnu, X toolkit, Xaw
 scroll bars) of 2026-01-10 built on laptop
Repository revision: 7d14e35498209e45290f5c1297ded6d7175bf1ea
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12302000
System Description: Ubuntu 23.10

Configured using:
 'configure --with-x-toolkit=lucid --with-xpm=ifavailable
 --with-gif=ifavailable --with-tiff=ifavailable
 --with-gnutls=ifavailable --enable-checking=yes,glyphs
 --enable-check-lisp-object-type 'CFLAGS=-O0 -g3''

Configured features:
FREETYPE GMP JPEG LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP
SOUND THREADS TOOLKIT_SCROLL_BARS X11 XDBE XFT XIM XPM LUCID ZLIB

Important settings:
  value of $LC_MONETARY: de_DE.UTF-8
  value of $LC_NUMERIC: de_DE.UTF-8
  value of $LC_TIME: de_DE.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix





This bug report was last modified today.

Previous Next


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