aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2023-11-18 18:35:18 +0200
committerDmitry Gutov2023-11-18 18:35:18 +0200
commit0128495afded0f1bd153925f99c19290760c7d65 (patch)
tree0aad6eada96cd4fee3022132688bc54348cbe81d
parentd9e43f2197fa1d5ade1d483b15cc50c6d705b969 (diff)
downloademacs-0128495afded0f1bd153925f99c19290760c7d65.tar.gz
emacs-0128495afded0f1bd153925f99c19290760c7d65.zip
Fix string-pixel-width with global setting of display-line-numbers
* lisp/emacs-lisp/subr-x.el (string-pixel-width): Instead of checking for display-line-numbers-mode, set the display-line-numbers variable to nil (bug#67248).
-rw-r--r--lisp/emacs-lisp/subr-x.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index b164071763b..88ac59fd168 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -322,10 +322,9 @@ as the new values of the bound variables in the recursive invocation."
322 ;; Keeping a work buffer around is more efficient than creating a 322 ;; Keeping a work buffer around is more efficient than creating a
323 ;; new temporary buffer. 323 ;; new temporary buffer.
324 (with-current-buffer (get-buffer-create " *string-pixel-width*") 324 (with-current-buffer (get-buffer-create " *string-pixel-width*")
325 ;; If `display-line-numbers-mode' is enabled in internal 325 ;; If `display-line-numbers' is enabled in internal buffers
326 ;; buffers, it breaks width calculation, so disable it (bug#59311) 326 ;; (e.g. globally), it breaks width calculation (bug#59311)
327 (when (bound-and-true-p display-line-numbers-mode) 327 (setq-local display-line-numbers nil)
328 (display-line-numbers-mode -1))
329 (delete-region (point-min) (point-max)) 328 (delete-region (point-min) (point-max))
330 ;; Disable line-prefix and wrap-prefix, for the same reason. 329 ;; Disable line-prefix and wrap-prefix, for the same reason.
331 (setq line-prefix nil 330 (setq line-prefix nil