branch: externals/org
commit 3007511f3f61f347b9b52c9d581ce3a06dd1c672
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    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'.
---
 lisp/org-macs.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index aa5c4845e6..fc3570f849 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -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)

Reply via email to