Hi all,

I hope this email finds you well. This is my first time contributing to
this mailing list attempting to contribute to org-mode, so hopefully I
do this correctly.

I recently noticed that `org-string-width` ran all buffer hooks like
`buffer-list-update-hook` for the ` *Org string width*` buffer. This
doesn't seem needed because it feels like ` *Org string width*` should
act like a temporary buffer that is only needed for these simple
operations. With that in mind I wanted to set `inhibit-buffer-hooks` to
`t`.

Hopefully this rationale and patch makes sense. After getting this in I
can also review other places that `get-buffer-create` is used and
possible use `inhibit-buffer-tools` there as well if it would help.

Best,
Jules

>From cc8dc0a9d8d4b72f2a820dd901b6ddcb9727b9fb Mon Sep 17 00:00:00 2001
From: Jules Tamagnan <jtamag...@gmail.com>
Date: Fri, 31 Jan 2025 11:36:13 -0800
Subject: [PATCH] Have org-string-width's temporary buffer be declared as such

---
 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 044c49efb..9d35857e2 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -1199,7 +1199,7 @@ STRING width.  When REFERENCE-FACE is nil, `default' face is used."
                      (push el result)))
                  result)))
           (current-char-property-alias-alist char-property-alias-alist))
-      (with-current-buffer (get-buffer-create " *Org string width*")
+      (with-current-buffer (get-buffer-create " *Org string width*" t)
         (setq-local display-line-numbers nil)
         (setq-local line-prefix nil)
         (setq-local wrap-prefix nil)
--
2.47.1

Reply via email to