GNU bug report logs -
#77973
30.1; `which-key' breaks `string-rectangle' after popup shown
Previous Next
Reported by: Alcor <alcor <at> tilde.club>
Date: Mon, 21 Apr 2025 20:01:02 UTC
Severity: normal
Found in version 30.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[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 20 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.