emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jules Tamagnan <jtamagnan@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Have org-string-width's temporary buffer be declared as such
Date: Sun, 02 Feb 2025 11:38:43 -0800	[thread overview]
Message-ID: <87lduo87cs.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 744 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Have org-string-width's temporary buffer be declared as such --]
[-- Type: text/x-patch, Size: 945 bytes --]

From cc8dc0a9d8d4b72f2a820dd901b6ddcb9727b9fb Mon Sep 17 00:00:00 2001
From: Jules Tamagnan <jtamagnan@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	other threads:[~2025-02-02 19:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lduo87cs.fsf@gmail.com \
    --to=jtamagnan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).