emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Respect buffer-local value of `org-edit-src-content-inde


From: Adam Porter
Subject: Re: [O] [PATCH] Respect buffer-local value of `org-edit-src-content-indentation'
Date: Tue, 15 Oct 2019 19:50:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Sebastian,

Sebastian Miele <address@hidden> writes:

> * lisp/org-src.el (org-src--contents-for-write-back): Use the
> potentially buffer-local value of `org-edit-src-content-indentation'
> from the source buffer instead of that from the editing buffer.
> ---
>  lisp/org-src.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/org-src.el b/lisp/org-src.el
> index 9134d5b5d..b7fe4c0fa 100644
> --- a/lisp/org-src.el
> +++ b/lisp/org-src.el
> @@ -422,7 +422,8 @@ Assume point is in the corresponding edit buffer."
>        (if org-src--preserve-indentation 0
>          (+ (or org-src--block-indentation 0)
>             (if (memq org-src--source-type '(example-block src-block))
> -               org-edit-src-content-indentation
> +               (with-current-buffer (marker-buffer org-src--beg-marker)
> +                 org-edit-src-content-indentation)
>               0))))
>       (use-tabs? (and (> org-src--tab-width 0) t))
>       (source-tab-width org-src--tab-width)

You might consider using the function buffer-local-value instead of the
macro with-current-buffer.  Not that it matters so much here, but
benchmarking shows that it is much faster when simply accessing the
buffer-local value of a variable.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]