0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-13 04:10:29 +00:00

org-string-width: Reuse buffer when calculating string width

* lisp/org-macs.el (org-string-width): Use dedicated buffer instead of
creating a new one every time.  The idea is from `string-pixel-width'.
This commit is contained in:
Ihor Radchenko 2023-07-17 12:33:03 +03:00
parent c730caf512
commit 3007511f3f
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -1115,7 +1115,7 @@ Return width in pixels when PIXELS is non-nil."
(push el result)))
result)))
(current-char-property-alias-alist char-property-alias-alist))
(with-temp-buffer
(with-current-buffer (get-buffer-create " *Org string width*")
(setq-local display-line-numbers nil)
(setq-local buffer-invisibility-spec
(if (listp current-invisibility-spec)