summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/subr-x.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-08-04 03:17:49 -0400
committerEli Zaretskii <eliz@gnu.org>2023-08-04 03:17:49 -0400
commit23f4999989607950dbed7d34d251c31b81c8e0c1 (patch)
tree1f9cc06c4bf1b726d7573fe38038d46e59f374cc /lisp/emacs-lisp/subr-x.el
parent12427976c8a8157fc2fe8ffa3a7fe157a8fe2e45 (diff)
parent0c29f53ab8723dd5a9f31ce8a6e913cc08132e56 (diff)
downloademacs-23f4999989607950dbed7d34d251c31b81c8e0c1.tar.gz
emacs-23f4999989607950dbed7d34d251c31b81c8e0c1.tar.bz2
emacs-23f4999989607950dbed7d34d251c31b81c8e0c1.zip
Merge from origin/emacs-29
0c29f53ab87 Fix 'string-pixel-width' under 'line-prefix' 7bbd7cae074 Fix find-dired-with-command for remote directories c4a8572025e ; * etc/HISTORY: Fix Emacs 28.3 entry.
Diffstat (limited to 'lisp/emacs-lisp/subr-x.el')
-rw-r--r--lisp/emacs-lisp/subr-x.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 9e906930b92..78dc58e0bcd 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -337,12 +337,15 @@ as the new values of the bound variables in the recursive invocation."
;; Keeping a work buffer around is more efficient than creating a
;; new temporary buffer.
(with-current-buffer (get-buffer-create " *string-pixel-width*")
- ;; `display-line-numbers-mode' is enabled in internal buffers
- ;; that breaks width calculation, so need to disable (bug#59311)
+ ;; If `display-line-numbers-mode' is enabled in internal
+ ;; buffers, it breaks width calculation, so disable it (bug#59311)
(when (bound-and-true-p display-line-numbers-mode)
(display-line-numbers-mode -1))
(delete-region (point-min) (point-max))
- (insert string)
+ ;; Disable line-prefix and wrap-prefix, for the same reason.
+ (setq line-prefix nil
+ wrap-prefix nil)
+ (insert (propertize string 'line-prefix nil 'wrap-prefix nil))
(car (buffer-text-pixel-size nil nil t)))))
;;;###autoload