From 3007511f3f61f347b9b52c9d581ce3a06dd1c672 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 17 Jul 2023 12:33:03 +0300 Subject: [PATCH] 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 aa5c4845e..fc3570f84 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)