GNU bug report logs - #77973
30.1; `which-key' breaks `string-rectangle' after popup shown

Previous Next

Package: emacs;

Reported by: Alcor <alcor <at> tilde.club>

Date: Mon, 21 Apr 2025 20:01:02 UTC

Severity: normal

Found in version 30.1

To reply to this bug, email your comments to 77973 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#77973; Package emacs. (Mon, 21 Apr 2025 20:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alcor <alcor <at> tilde.club>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 21 Apr 2025 20:01:02 GMT) Full text and rfc822 format available.

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

From: Alcor <alcor <at> tilde.club>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1; `which-key' breaks `string-rectangle' after popup shown
Date: Mon, 21 Apr 2025 22:00:10 +0200
1. Start Emacs (30.1) with emacs -Q
2. Hit M-< or C-<home> to go to the beginning of the scratch buffer
3. Hit C-x SPC (`rectangle-mark-mode') and do any rectangular selection
4. Do M-x which-key-mode to enable which-key mode
5. Hit C-x (wait for the which-key popup to appear) *then* continue with
r t (`string-rectangle')

Expected result:

The `string-rectangle' command behaves normally, as specified in the
manual.

Observed result:

The following error messages are printed in the *Messages* buffer:

region-beginning: Lisp nesting exceeds ‘max-lisp-eval-depth’: 1601
rectangle--region-beginning: Lisp nesting exceeds ‘max-lisp-eval-depth’


In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
 cairo version 1.18.0) of 2025-03-17 built on lcy02-amd64-052
Repository revision: dcd52678035563e43e3ed80dadb9f3970536f692
Repository branch: master
System Description: Ubuntu 24.04.2 LTS

Configured using:
 'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
 --without-xaw3d --with-modules --with-cairo
 --with-native-compilation=aot --with-pgtk --with-xinput2
 --with-tree-sitter 'CFLAGS=-isystem
 /build/emacs/parts/emacs/install/usr/include -isystem
 /build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu -isystem
 /build/emacs/stage/usr/include -O2' 'CPPFLAGS=-isystem
 /build/emacs/parts/emacs/install/usr/include -isystem
 /build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu -isystem
 /build/emacs/stage/usr/include'
 'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
 -L/build/emacs/parts/emacs/install/usr/lib
 -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
 -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
 -L/build/emacs/stage/usr/lib''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB

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

Major mode: Messages

Minor modes in effect:
  which-key-mode: t
  winner-mode: t
  windmove-mode: t
  recentf-mode: t
  global-auto-revert-mode: t
  fido-vertical-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  fido-mode: t
  desktop-save-mode: t
  minibuffer-depth-indicate-mode: t
  delete-selection-mode: t
  repeat-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-xdcc hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-xdcc
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-truncate hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-truncate
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-track hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-track
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-status-sidebar hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-status-sidebar
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-stamp hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-stamp
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-spelling hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-spelling
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-speedbar hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-speedbar
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-sound hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-sound
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-services hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-services
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-sasl hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-sasl
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-ring hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-ring
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-replace hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-replace
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-pcomplete hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-pcomplete
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-page hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-page
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-notify hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-notify
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-nicks hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-nicks
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-networks hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-networks
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-netsplit hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-netsplit
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-menu hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-menu
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-match hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-match
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-log hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-log
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-loaddefs hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-loaddefs
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-list hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-list
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-lang hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-lang
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-join hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-join
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-imenu hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-imenu
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-identd hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-identd
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-ibuffer hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-ibuffer
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-goodies hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-goodies
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-fill hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-fill
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-ezbounce hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-ezbounce
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-desktop-notifications hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-desktop-notifications
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-dcc hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-dcc
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-compat hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-compat
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-common hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-common
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-capab hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-capab
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-button hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-button
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-backend hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-backend
/home/alcor/.emacs.d/elpa/erc-5.6.1snapshot0.20250416.173013/erc-autoaway hides /snap/emacs/current/usr/share/emacs/30.1/lisp/erc/erc-autoaway

Features:
(shadow sort mail-extr gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime
smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom
gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap
nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int
gnus-range gnus-win compile comint ansi-osc ansi-color comp-run emacsbug
message yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa
derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader shortdoc rect help-fns
radix-tree disp-table whitespace display-line-numbers goto-addr
thingatpt sendmail rfc2047 rfc2045 ietf-drums gnus nnheader gnus-util
text-property-search time-date mail-utils range mm-util mail-prsvr xdg
doom-themes-ext-org doom-themes-ext-visual-bell face-remap
doom-nord-theme pcase doom-themes doom-themes-base which-key cus-edit pp
finder-inf use-package-ensure winner ring windmove recentf tree-widget
wid-edit autorevert filenotify icomplete desktop frameset mb-depth
delsel repeat cus-load edmacro kmacro use-package-bind-key bind-key
easy-mmode use-package-core site-start comp comp-cstr cl-extra help-mode
comp-common warnings rx doom-themes-autoloads erc-irc-format-autoloads
info erc-autoloads markdown-mode-autoloads rainbow-delimiters-autoloads
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie generate-lisp-file url-domsuf url-util mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons
password-cache json subr-x map byte-opt gv bytecomp byte-compile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine 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 emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty move-toolbar make-network-process native-compile emacs)

Memory information:
((conses 16 542067 30817) (symbols 48 25725 0)
 (strings 32 143008 4180) (string-bytes 1 4469408) (vectors 16 36971)
 (vector-slots 8 446370 9839) (floats 8 584 8701) (intervals 56 468 0)
 (buffers 992 11))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77973; Package emacs. (Mon, 21 Apr 2025 20:56:01 GMT) Full text and rfc822 format available.

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

From: Alcor <alcor <at> tilde.club>
To: 77973 <at> debbugs.gnu.org
Subject: Screencast illustrating the issue
Date: Mon, 21 Apr 2025 22:55:19 +0200
[Message part 1 (text/plain, inline)]
Attached is a short video/screencast demonstrating the issue, where
steps #1-#5 are followed on a fresh `emacs -Q' session:

[77973.webm (video/webm, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77973; Package emacs. (Tue, 22 Apr 2025 11:41:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alcor <alcor <at> tilde.club>
Cc: 77973 <at> debbugs.gnu.org
Subject: Re: bug#77973: 30.1;
 `which-key' breaks `string-rectangle' after popup shown
Date: Tue, 22 Apr 2025 14:40:05 +0300
> Date: Mon, 21 Apr 2025 22:55:19 +0200
> From:  Alcor via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Attached is a short video/screencast demonstrating the issue, where
> steps #1-#5 are followed on a fresh `emacs -Q' session:

Thanks, but please in the future try not to change the Subject when
you respond to a bug report, because if you change the Subject, it
makes tracking the discussion a tad harder for some of us.

I've returned the Subject to its original.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77973; Package emacs. (Tue, 22 Apr 2025 11:41:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alcor <alcor <at> tilde.club>
Cc: 77973 <at> debbugs.gnu.org
Subject: Re: bug#77973: 30.1;
 `which-key' breaks `string-rectangle' after popup shown
Date: Tue, 22 Apr 2025 14:40:38 +0300
> Date: Mon, 21 Apr 2025 22:55:19 +0200
> From:  Alcor via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Attached is a short video/screencast demonstrating the issue, where
> steps #1-#5 are followed on a fresh `emacs -Q' session:

Thanks, but please in the future try not to change the Subject when
you respond to a bug report, because if you change the Subject, it
makes tracking the discussion a tad harder for some of us.

I've now returned the Subject to its original.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77973; Package emacs. (Tue, 22 Apr 2025 19:48:02 GMT) Full text and rfc822 format available.

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

From: Alcor <alcor <at> tilde.club>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 77973 <at> debbugs.gnu.org
Subject: bug#77973: 30.1; `which-key' breaks `string-rectangle' after popup
 shown
Date: Tue, 22 Apr 2025 21:46:57 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> I've now returned the Subject to its original.

Thanks Eli, I'm still not very familiar with the bug tracking system -
will keep that in mind.

That aside, I would like to note that the commit:

  3a8222e700304e4dff84fcdfa8ff2a4e48646c82
  Faster region-beginning and region-end for rectangle selections

Solves the issue. The actual underlying problem was the fact that the

  ; rectangle--region-beginning
  ...
  (apply #'min (mapcar #'car (region-bounds)))

  ; rectangle--region-end
  ...
  (apply #'max (mapcar #'cdr (region-bounds)))

forms in the 30.x implementations of rectangle--region-{beginning,end}
may result in a mutual recursion, as `region-bounds' calls
`region-extract-function', which calls `region-{beginning,end}' (both
advised by `rectangle--region-{beginning,end}' during a rectangular
selection).

I'm not sure why `which-key-mode' triggers this, but it seems it's
related to the `rectangle-mark-mode' state, as replacing the above forms
in `region-{beginning,end}' with:

  ; rectangle--region-beginning
  ...
  (let (rectangle-mark-mode) (apply #'min (mapcar #'car (region-bounds))))

  ; rectangle--region-end
  ...
  (let (rectangle-mark-mode) (apply #'max (mapcar #'cdr (region-bounds))))

As done in many other places in rect.el fixes the issue on 30.x -
however, I've also tried backporting
3a8222e700304e4dff84fcdfa8ff2a4e48646c82 onto 30.1 and it worked without
any issues, on top of it being faster as well.

Would it be possible to cherry-pick 3a8222e onto the emacs-30 branch so
a fix is available on 30.2? IMO, this bug is annoyingly easy to trigger
on 30.1 when using `which-key-mode' (see video in previous message), and
it's not trivial to unbreak rectangle-mark-mode after running into it,
so having it in the next bugfix release would improve things
significantly.

Cheers,
-A.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77973; Package emacs. (Wed, 23 Apr 2025 11:52:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alcor <alcor <at> tilde.club>, Mattias Engdegård
 <mattiase <at> acm.org>
Cc: 77973 <at> debbugs.gnu.org
Subject: Re: bug#77973: 30.1; `which-key' breaks `string-rectangle' after popup
 shown
Date: Wed, 23 Apr 2025 14:51:34 +0300
> From: Alcor <alcor <at> tilde.club>
> Cc: 77973 <at> debbugs.gnu.org
> Date: Tue, 22 Apr 2025 21:46:57 +0200
> 
> As done in many other places in rect.el fixes the issue on 30.x -
> however, I've also tried backporting
> 3a8222e700304e4dff84fcdfa8ff2a4e48646c82 onto 30.1 and it worked without
> any issues, on top of it being faster as well.
> 
> Would it be possible to cherry-pick 3a8222e onto the emacs-30 branch so
> a fix is available on 30.2? IMO, this bug is annoyingly easy to trigger
> on 30.1 when using `which-key-mode' (see video in previous message), and
> it's not trivial to unbreak rectangle-mark-mode after running into it,
> so having it in the next bugfix release would improve things
> significantly.

My bother with commit 3a8222e is that it uses move-to-column, which
might behave in surprising ways when there are 'display' properties,
TABs, composed characters, and other display features around.

Did someone try the new code in those cases?  If not, I'd like you or
someone else to try that first, because I'd like to avoid introducing
regressions into Emacs 30.2.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77973; Package emacs. (Wed, 23 Apr 2025 15:35:01 GMT) Full text and rfc822 format available.

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

From: Alcor <alcor <at> tilde.club>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Mattias Engdegård <mattiase <at> acm.org>,
 77973 <at> debbugs.gnu.org
Subject: Re: bug#77973: 30.1; `which-key' breaks `string-rectangle' after
 popup shown
Date: Wed, 23 Apr 2025 17:33:59 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> My bother with commit 3a8222e is that it uses move-to-column, which
> might behave in surprising ways when there are 'display' properties,
> TABs, composed characters, and other display features around.
>
> Did someone try the new code in those cases?  If not, I'd like you or
> someone else to try that first, because I'd like to avoid introducing
> regressions into Emacs 30.2.

I tested a cherry-picked 3a8222e with composite emojis and tabs and
haven't observed any differences vs. plain 30.1 (see attachment). Not
sure about "other display features" though. And 3a8222e isn't a recent
change either - it's about ~9 months old, so I'd assume it has been
incubating long enough for problems to be noticable (?).

As an alternative, the following more trivial patch can be applied onto
the emacs-30 branch. It merely binds `rectangle-mark-mode' to nil during
the `region-bounds' call to protect against infinite recursion (as done
elsewhere in rect.el):

--- lisp/rect.el
+++ #<buffer rect.el.gz>
@@ -766,7 +766,7 @@
    ((not rectangle-mark-mode)
     (funcall orig))
    (t
-    (apply #'min (mapcar #'car (region-bounds))))))
+    (apply #'min (mapcar #'car (let (rectangle-mark-mode) (region-bounds)))))))
 
 (defun rectangle--region-end (orig)
   "Like `region-end' but supports rectangular regions."
@@ -774,7 +774,7 @@
    ((not rectangle-mark-mode)
     (funcall orig))
    (t
-    (apply #'max (mapcar #'cdr (region-bounds))))))
+    (apply #'max (mapcar #'cdr (let (rectangle-mark-mode) (region-bounds)))))))
 
 (defun rectangle--extract-region (orig &optional delete)
   (cond

[rect-3a8222e-emoji.png (image/png, attachment)]
[rect-3a8222e-tabs.png (image/png, attachment)]

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.