[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 0128495afde: Fix string-pixel-width with global setting of disp
From: |
Dmitry Gutov |
Subject: |
emacs-29 0128495afde: Fix string-pixel-width with global setting of display-line-numbers |
Date: |
Sat, 18 Nov 2023 11:35:31 -0500 (EST) |
branch: emacs-29
commit 0128495afded0f1bd153925f99c19290760c7d65
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
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).
---
lisp/emacs-lisp/subr-x.el | 7 +++----
1 file 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."
;; Keeping a work buffer around is more efficient than creating a
;; new temporary buffer.
(with-current-buffer (get-buffer-create " *string-pixel-width*")
- ;; 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))
+ ;; If `display-line-numbers' is enabled in internal buffers
+ ;; (e.g. globally), it breaks width calculation (bug#59311)
+ (setq-local display-line-numbers nil)
(delete-region (point-min) (point-max))
;; Disable line-prefix and wrap-prefix, for the same reason.
(setq line-prefix nil
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 0128495afde: Fix string-pixel-width with global setting of display-line-numbers,
Dmitry Gutov <=