[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Org mode and Emacs
From: |
Ihor Radchenko |
Subject: |
Re: Org mode and Emacs |
Date: |
Sat, 09 Sep 2023 09:36:26 +0000 |
Richard Stallman <rms@gnu.org> writes:
> > The way I see Org markup extension would make it easy to users add new
> > custom markup, as needed. Then, no frequent changes to the base markup
> > will be necessary to accommodate for less common use cases.
>
> I see a possible ambiguity and point of confusion. When you say,
> "extension", do you mean "a package that gets loaded on top of
> ordinary Org mode"? That's what I thought it meant.
A package or user Elisp snippet.
For example, Org currently allows extending hyperlinks like
(defun org-man-export (link description format _)
"Export a man page link from Org files."
(let ((path (format "http://man.he.net/?topic=%s§ion=all" link))
(desc (or description link)))
(pcase format
(`html (format "<a target=\"_blank\" href=\"%s\">%s</a>" path desc))
(`latex (format "\\href{%s}{%s}" path desc))
(`texinfo (format "@uref{%s,%s}" path desc))
(`ascii (format "%s (%s)" desc path))
(t path))))
(org-link-set-parameters "man" :export #'org-man-export)
Then, <man:emacs> links will be formatted arbitrarily during export.
The same idea will be for markup syntax:
@var{variable-name} will, in future, be defined as
(org-markup-set-parameters "var" :export #'my-export-function-for-var)
@var is probably something we will have within Org, but if one needs
some weird markup for a specific manual, it will equally be possible to
define
@my-special-markup{contents}
via (org-markup-set-parameters "my-special-markup" :export
#'custom-export-formatter)
> Implementing some of the Texinfo constructs in such a package, perhaps
> called org-texinfo, is an implementation detail as far as I'm
> concerned.
>
> But now I think maybe you mean something else -- that you propose
> to add some sort of limited macro definition facility and have the
> missing Texinfo constructs be defined using that. Is that it?
We might allow in-document definitions like:
#+markup[html]: my-special-markup <foo>%s</foo>
#+markup[latex]: my-special-markup \foo{%s}
...
but the `org-markup-set-parameters' is what we preliminarily agreed upon
for now. Further features are to be discussed later.
> To be adequate for this job, the macro definition facility needs to be
> more powerful than they usually are. The expansion of one construct
> needs to depend on the output format being generated, and sometimes
> the expansion of construct A depends on whether it is inside construct
> B.
> If the facility can do that, I think it will suffice for nearly all of
> the missing Texinfo constructs. If you think of this as a method to
> simplify part of the implementation of Texinfo in Org, it may work.
Org is already capable to provide access to the full parse tree when
expanding links with custom :export function. The same can be done for
markup constructs. Much more difficult if one wants in-document
definitions though.
> But be prepared for exeptions, constructs that need special handling!
> If you think of this as a way to keep Org itself free of Texinfo
> impurities, it won't work.
May you elaborate about special handling?
--
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>
- Re: Org mode and Emacs, (continued)
- Re: Org mode and Emacs, Eli Zaretskii, 2023/09/06
- Re: Org mode and Emacs, Ihor Radchenko, 2023/09/06
- Re: Org mode and Emacs, Eli Zaretskii, 2023/09/06
- Re: Org mode and Emacs, Ihor Radchenko, 2023/09/06
- Re: Org mode and Emacs, Eli Zaretskii, 2023/09/06
- Re: Org mode and Emacs, Ihor Radchenko, 2023/09/07
- Re: Org mode and Emacs, Richard Stallman, 2023/09/09
- Re: Org mode and Emacs, Richard Stallman, 2023/09/08
- Re: Org mode and Emacs,
Ihor Radchenko <=
- Re: Org mode and Emacs, Richard Stallman, 2023/09/09
- Re: Org mode and Emacs, Richard Stallman, 2023/09/08
Re: Org mode and Emacs, Richard Stallman, 2023/09/01
Re: Org mode and Emacs, Richard Stallman, 2023/09/03