emacs-devel
[Top][All Lists]
Advanced

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

Re: Permanently fix org versioning breakage during builds?


From: Ihor Radchenko
Subject: Re: Permanently fix org versioning breakage during builds?
Date: Sun, 24 Dec 2023 17:16:57 +0000

João Távora <joaotavora@gmail.com> writes:

> On Sun, Dec 24, 2023 at 4:32 PM João Távora <joaotavora@gmail.com> wrote:
>
>>
>> No, it didn't, I'm afraid.  If you know one of these macros (you alluded
>> earlier to "some macros"), type its name here, please.
>
> IIn the absence of examples (so far), I went looking for one myself.
> I found 'org-export-with-buffer-copy' in lisp/org/ox.el.  It's expanded
> in ox-html.el and ox-publish.el in the same directory.

It is not about a specific macro. Any macro may be broken this way.

There may be confusion about `org-assert-version' macro vs. all other
macros. The former is my attempt to detect potential breakage of the
latter.

> [  Tangent: one thing I notice is that the expansion in ox-html.el is
> buggy.  It evaluates the keyword arguments to the macros multiple times
> for no effect.  The solution would be to change the macro calling
> convention to be:
>
> (cl-defmacro org-export-with-buffer-copy ((&key to-buffer drop-visibility
>                                           drop-narrowing drop-contents
>                                           drop-locals
>                                           &allow-other-keys) &body body)
>   ...)

May you elaborate?

> Anyway, let's apply the "CALL-WITH" technique:
>
> (cl-defmacro org-export-with-buffer-copy ( &rest body
>                                            &key to-buffer drop-visibility
>                                            drop-narrowing drop-contents
>                                            drop-locals
>                                            &allow-other-keys)
>   "..."
>   `(org-export--call-with-buffer-copy (lambda () ,@body)

AFAIU, this technique will prevent compiler optimizations, won't it?

> As a bonus, no more "with-gensyms" needed or hairy commas.  Easier
> debugging.  I did a make -C test org/tests but that doesn't have any
> good tests and I don't know how to exercise the "publish" and "html"
> functionality, so I ask that you test.

We do not sync Org tests with Emacs tree. They are only a part of Org
repository: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/
Also, do note that development version of Org mode is not what you see
in Emacs tree - Emacs has only stable version. Your patch will not apply
on the latest Org main branch.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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