unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Org mode and Emacs
Date: Fri, 01 Sep 2023 06:46:28 +0000	[thread overview]
Message-ID: <87v8cuqtkr.fsf@localhost> (raw)
In-Reply-To: <E1qbsnq-0007QF-5f@fencepost.gnu.org>

Richard Stallman <rms@gnu.org> writes:

>   > @latex
>   > ...
>   > @end latex
>
>   > it is actually not very intuitive that such construct implies export,
>   > but not something else.
>
> I'd like to understand this issue.  Could you please explain what
> "export" means here?  And what is the "something else", that it might
> have been?  It appears to be a distinction that doesn't exist in
> Texinfo.

You are right, Texinfo has a very narrow focus - authoring manuals in
multiple output formats. Org does a lot more.

-----

One feature of Org we are discussing here is "exporting":
https://orgmode.org/manual/Exporting.html - an ability to convert Org
documents into other textual formats.
Similar to Texinfo's raw formatter commands
(https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Raw-Formatter-Commands.html),
Org provides a special markup that specifies text to be placed into
specific tex/html/odt/etc export output:

#+begin_export html
...
#+end_export
or
#+HTML: <single line>
or
@@html:<inline html>@@

See https://orgmode.org/manual/Quoting-HTML-tags.html, for example.

-----

However, Org has more features, served by other Org's markup.

-----

One of the popular features is implementing literal programming (babel).
https://orgmode.org/manual/Features-Overview.html:

    Org can manage the source code in the block delimited by
    ‘#+BEGIN_SRC’ … ‘#+END_SRC’ in several ways that can simplify
    housekeeping tasks essential to modern source code maintenance. Org
    can edit, format, extract, export, and publish source code blocks.

#+begin_src emacs-lisp :results value
  (+ 1 2)
#+end_src

#+RESULTS[b6b278abd782307b5eca9b1b761906bae5292bcc]:
: 3

Users can execute arbitrary pieces of source code in arbitrary
programming languages, get the results inline and even mix input/output
of code written in different languages:

#+name: bash-input
#+begin_src bash :results output table :var file="file.csv"
cat $file
#+end_src

#+begin_src elisp :var table=bash-input(file="table-input.csv")
(mapcar (lambda (line) (format "%S" line)) table)
#+end_src

The code evaluation results can even be used to generate exported text.
Here is a slightly edited snippet from Org manual that generates a table
of all export customizations:

#+begin_src emacs-lisp :exports results :results table :eval yes
(require 'ox)
(let ((alist org-export-options-alist))
 (let (result)
  (dolist (spec alist)
    (when (and (nth 3 spec) (symbolp (nth 3 spec))) ; has customization
      (push (list (format "~%s~" (car spec)) (format "~%s~" (nth 3 spec))) result)))
  (nreverse result)))
#+end_src

You can see the output in https://orgmode.org/manual/Publishing-options.html

Furthermore, users can "tangle" code from the Org document, extracting
only the appropriate source code pieces into actual code-only files.
https://orgmode.org/manual/Extracting-Source-Code.html
So, one can keep documentation and notes (with markup!) together with
the actual code, tangle the org file to produce the program, or export
the org file to produce readable notes - full literal programming
implementation.

-----

Apart from snippets of source code, Org has a markup for non-code
literal text that is not a subject of Org markup:

#+begin_example
  Some example from a text file.
#+end_example

Some people even prefer to keep snippets of source code as example
blocks as well (when a sole purpose of such source block is exporting):

#+begin_example bash
  ls $HOME
#+end_example

-----

Finally, there are dynamic blocks that can be used to generate parts of
Org file programatically from Elisp: https://orgmode.org/manual/Dynamic-Blocks.html

#+begin: blockname <parameters>
<automatically generated text>
#+end:

One example of built-in dynamic block is clocktable that is used by
people that record their work time using Org mode
(https://orgmode.org/manual/Clocking-Work-Time.html,
https://orgmode.org/manual/The-clock-table.html,
https://olddeuteronomy.github.io/post/org-export-clocktables/)

-----

To conclude, the common pattern for Org's block markup is

#+begin<something>
...
#+end<something>

What you proposed with @latex: ... @end is similar to dropping
<something> part. However, as you see in the above, there is a variety
of different block markups serving for entirely different purposes and
just saying @latex (or rather #+latex, if we follow the common Org
block convention) does make it intuitive whether the block is "export",
or "example" or "src" or dynamic. Furthermore, #+latex is already used
for export one-liners.

In theory, we might drop "begin" parts and get

#+src elisp
...
#+end

#+example
...
#+end

#+export html
#+end

but this is akin converting Pascal's begin/end into C's {/} - possible,
but an alternative convention is already established.

And, generally, we, in Org, try to refrain from changing syntax too much
- a number of external projects are relying upon the existing syntax.
So, making significant syntax changes should not be taken lightly.

-- 
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	other threads:[~2023-09-01  6:46 UTC|newest]

Thread overview: 178+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25  2:52 Org mode and Emacs Payas Relekar
2022-09-25  6:35 ` Bastien
2022-09-25  7:05   ` Ihor Radchenko
2022-09-25  7:47     ` Bastien
2022-09-25  8:01       ` Ihor Radchenko
2022-09-25  8:22       ` Bastien Guerry
2022-09-25  8:01   ` Eli Zaretskii
2022-09-25 19:47     ` Tim Cross
2022-09-26  6:12       ` Bastien
2022-09-26  6:35         ` Ihor Radchenko
2022-09-26  6:57           ` Bastien
2023-08-18 17:09             ` Ihor Radchenko
2023-08-18 18:31               ` Eli Zaretskii
2023-08-18 18:49                 ` Ihor Radchenko
2023-08-18 19:11                   ` Eli Zaretskii
2023-08-18 19:31                     ` Ihor Radchenko
2023-08-19  5:51                       ` Eli Zaretskii
2023-08-19  9:04                         ` Ihor Radchenko
2023-08-19  9:26                           ` Eli Zaretskii
2023-08-19  9:44                             ` Ihor Radchenko
2023-08-19 10:19                               ` Po Lu
2023-08-19 10:47                                 ` Eli Zaretskii
2023-08-19 10:48                                 ` Ihor Radchenko
2023-08-19 10:42                               ` Eli Zaretskii
2023-08-19 10:54                                 ` Ihor Radchenko
2023-08-21  1:12                             ` Richard Stallman
2023-08-21  7:56                               ` Philip Kaludercic
2023-08-23  2:12                   ` Richard Stallman
2023-08-23  9:44                     ` Ihor Radchenko
2023-08-23 11:01                       ` Colin Baxter
2023-08-23 11:12                         ` Ihor Radchenko
2023-08-23 12:49                           ` Po Lu
2023-08-23 17:18                             ` Colin Baxter
2023-08-23 17:47                               ` Ihor Radchenko
2023-08-23 18:02                                 ` Eli Zaretskii
2023-08-23 18:08                                   ` Ihor Radchenko
2023-08-23 18:18                                     ` Eli Zaretskii
2023-08-23 18:36                                       ` Ihor Radchenko
2023-08-23 18:46                                         ` Eli Zaretskii
2023-08-23 18:50                                           ` Ihor Radchenko
2023-08-25  1:11                             ` Richard Stallman
2023-08-23 16:53                           ` Colin Baxter
2023-08-23 17:56                             ` Tassilo Horn
2023-08-24 11:52                     ` Bastien Guerry
2023-08-24 17:51                       ` T.V Raman
2023-08-24 17:55                         ` Ihor Radchenko
2023-08-24 18:35                           ` T.V Raman
2023-08-25  1:16                         ` Richard Stallman
2023-08-25 11:45                           ` Richard Stallman
2023-08-25  1:14                       ` Richard Stallman
2023-08-25  9:04                         ` Bastien Guerry
2023-08-25 18:56                           ` Philip Kaludercic
2023-08-26 10:46                             ` Ihor Radchenko
2023-08-31  2:09                               ` Richard Stallman
2023-08-31  8:50                                 ` Ihor Radchenko
2023-08-26  2:04                           ` Richard Stallman
2023-08-26  5:50                             ` Eli Zaretskii
2023-08-26 16:49                               ` Jose E. Marchesi
2023-08-26 16:56                                 ` Ihor Radchenko
2023-08-26 20:28                                   ` Philip Kaludercic
2023-08-26 20:58                                     ` Ihor Radchenko
2023-08-30  8:11                                       ` Bastien Guerry
2023-08-27  1:32                                   ` Richard Stallman
2023-08-27  8:32                                     ` Ihor Radchenko
2023-08-28  1:32                                       ` Richard Stallman
2023-08-29  8:29                                         ` Ihor Radchenko
2023-09-01  1:18                                           ` Richard Stallman
2023-09-01  6:46                                             ` Ihor Radchenko [this message]
2023-09-04  1:32                                               ` Richard Stallman
2023-09-04 22:05                                                 ` Juergen Fenn
2023-09-05 11:04                                                   ` Ihor Radchenko
2023-09-06  0:58                                                   ` Richard Stallman
2023-09-06 11:29                                                 ` Ihor Radchenko
2023-09-06 12:33                                                   ` Eli Zaretskii
2023-09-06 12:43                                                     ` Ihor Radchenko
2023-09-06 12:49                                                       ` Po Lu
2023-09-06 12:54                                                         ` Ihor Radchenko
2023-09-06 13:04                                                           ` Po Lu
2023-09-06 13:10                                                             ` Ihor Radchenko
2023-09-06 13:33                                                               ` Po Lu
2023-09-06 15:28                                                                 ` Eli Zaretskii
2023-09-06 13:08                                                       ` Eli Zaretskii
2023-09-06 13:20                                                         ` Ihor Radchenko
2023-09-06 15:25                                                           ` Eli Zaretskii
2023-09-06 16:12                                                             ` Ihor Radchenko
2023-09-06 16:34                                                               ` Eli Zaretskii
2023-09-07 11:11                                                                 ` Ihor Radchenko
2023-09-10  0:22                                                                   ` Richard Stallman
2023-09-09  0:37                                                               ` Richard Stallman
2023-09-09  9:36                                                                 ` Ihor Radchenko
2023-09-10  0:22                                                                   ` Richard Stallman
2023-09-09  0:38                                                   ` Richard Stallman
2023-08-30  8:11                                   ` Bastien Guerry
2023-09-02  1:50                                     ` Richard Stallman
2023-09-02  8:19                                       ` Ihor Radchenko
2023-09-02  8:30                                       ` Alfred M. Szmidt
2023-08-27  1:32                                 ` Richard Stallman
2023-08-27  8:35                                   ` Ihor Radchenko
2023-08-28  1:32                                     ` Richard Stallman
2023-08-28 10:04                                       ` Ihor Radchenko
2023-08-28 11:15                                         ` Yuri Khan
2023-08-28 11:21                                           ` Ihor Radchenko
2023-08-31  2:09                                         ` Richard Stallman
2023-08-31  8:53                                           ` Ihor Radchenko
2023-09-04  1:33                                             ` Richard Stallman
2023-08-30  8:14                                   ` Bastien Guerry
2023-08-30  8:32                                     ` Po Lu
2023-08-27  1:33                               ` Richard Stallman
2022-09-26  8:24           ` Eli Zaretskii
2022-09-26  8:32           ` Jean Louis
2022-09-26  9:54             ` Ihor Radchenko
2022-09-26 11:04               ` Robert Pluim
2022-09-27 16:17               ` Richard Stallman
2022-09-30  3:41                 ` Ihor Radchenko
2022-09-26 12:10       ` Richard Stallman
2022-09-26  3:02   ` Ihor Radchenko
2022-09-26  5:37     ` Po Lu
2022-09-26  5:44       ` Emanuel Berg
2022-09-26  6:20       ` Bastien Guerry
2022-09-26 13:58         ` T.V Raman
2022-09-26 16:16           ` Eli Zaretskii
2022-09-26  6:36       ` Ihor Radchenko
2022-09-26  6:18     ` Bastien
2022-09-26  6:29       ` Ihor Radchenko
  -- strict thread matches above, loose matches on Subject: below --
2022-06-13  1:47 Org mode and Emacs (was: Convert README.org to plain text README while installing package) Christopher Dimech
2022-06-13  2:47 ` Ihor Radchenko
2022-06-13  5:04   ` Christopher Dimech
2022-06-13  5:22     ` Org mode and Emacs Werner LEMBERG
2022-06-13  5:59       ` Eli Zaretskii
2022-06-04 17:27 Convert README.org to plain text README while installing package Alan Mackenzie
2022-06-05  8:38 ` Michael Albinus
2022-06-05  8:51   ` Po Lu
2022-06-05 10:26     ` Tassilo Horn
2022-06-05 11:15       ` Michael Albinus
2022-06-06  0:19         ` Tim Cross
2022-06-06 11:33           ` Alan Mackenzie
2022-06-06 13:57             ` Tim Cross
2022-06-06 16:02               ` Eli Zaretskii
2022-06-07  6:14                 ` Tim Cross
2022-06-07 16:02                   ` Alan Mackenzie
2022-06-07 18:14                     ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Stefan Monnier
2022-06-07 18:26                       ` Org mode and Emacs Lars Ingebrigtsen
2022-06-07 18:48                         ` Stefan Monnier
2022-06-07 18:54                           ` Eli Zaretskii
2022-06-07 19:38                             ` Stefan Monnier
2022-06-07 20:54                           ` Lars Ingebrigtsen
2022-06-07 22:10                       ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Tim Cross
2022-06-08  6:06                         ` Org mode and Emacs Visuwesh
2022-06-08  6:58                           ` Tim Cross
2022-06-09 22:31                         ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Richard Stallman
2022-06-09 23:10                           ` Tim Cross
2022-06-10  5:59                             ` Eli Zaretskii
2022-06-10  6:20                               ` Ihor Radchenko
2022-06-10  6:44                                 ` Eli Zaretskii
2022-06-11  4:49                                   ` Tim Cross
2022-06-11  6:58                                     ` Eli Zaretskii
2022-06-12  9:05                                       ` Ihor Radchenko
2022-06-12  9:18                                         ` Eli Zaretskii
2022-06-12 10:04                                           ` Ihor Radchenko
2022-06-12 10:15                                             ` Eli Zaretskii
2022-06-12 10:38                                               ` Ihor Radchenko
2022-06-12 14:36                                                 ` Eli Zaretskii
2022-06-12 15:31                                                   ` Org mode and Emacs Colin Baxter
2022-06-15  5:19                                                   ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Ihor Radchenko
2022-06-15  6:46                                                     ` Org mode and Emacs David Engster
2022-06-15  7:36                                                       ` Ihor Radchenko
2022-06-15 13:01                                                         ` Eli Zaretskii
2022-06-16  5:36                                                           ` Ihor Radchenko
2022-06-16  5:58                                                             ` Eli Zaretskii
2022-06-16  9:55                                                               ` Ihor Radchenko
2022-06-15 13:34                                                         ` David Engster
2022-06-16  6:50                                                           ` Ihor Radchenko
2022-06-16 10:21                                                             ` David Engster
2022-06-15 12:50                                                     ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Eli Zaretskii
2022-06-16  7:03                                                       ` Ihor Radchenko
2022-06-16  8:13                                                         ` Eli Zaretskii
2022-06-16 11:12                                                           ` Mattias Engdegård
2022-06-16 12:58                                                             ` Ihor Radchenko
2022-06-16 16:59                                                               ` Org mode and Emacs Stefan Monnier
2022-06-16  3:19                                                     ` Pankaj Jangid
2022-06-16  4:03                                                       ` Visuwesh
2022-09-25  2:14                                                   ` Bastien
2022-06-12 22:38                                       ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Richard Stallman
2022-06-13  4:38                                         ` Org mode and Emacs Werner LEMBERG
2022-06-12  0:42                                     ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Richard Stallman
2022-06-12  1:27                                       ` Ihor Radchenko
2022-06-12 22:38                                         ` Richard Stallman
2022-06-14 13:18                                           ` Ihor Radchenko
2022-06-14 13:38                                             ` Org mode and Emacs Robert Pluim
2022-06-12  0:42                             ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Richard Stallman
2022-06-12  1:39                               ` Tim Cross
2022-06-12  2:40                                 ` Org mode and Emacs T.V Raman
2022-06-12  1:45                               ` Po Lu
2022-06-12  2:15                                 ` Ihor Radchenko
2022-06-12  2:36                                   ` David Masterson
2022-06-12  3:06                                     ` Ihor Radchenko
2022-06-12  3:39                                       ` David Masterson
2022-06-12  4:43                                         ` Tim Cross
2022-06-12  5:08                                           ` Po Lu
2022-06-12  5:20                                             ` Ihor Radchenko
2022-06-12  5:27                                             ` Tim Cross
2022-06-12  5:53                                           ` David Masterson
2022-06-12  6:56                                             ` Ihor Radchenko
2022-06-12 18:29                                               ` David Masterson
2022-06-14  5:09                                                 ` Ihor Radchenko
2022-06-19 23:48                                                   ` David Masterson
2022-06-20  0:03                                                     ` Ihor Radchenko
2022-06-20  0:24                                                       ` David Masterson
2022-06-12  3:28                                     ` Tim Cross
2022-06-12  2:50                                   ` Po Lu
2022-06-12  3:54                                     ` chad
2022-06-12  5:04                                       ` Po Lu
2022-06-12  7:02                                         ` Ihor Radchenko
2022-06-12 22:38                                         ` Richard Stallman
2022-06-12 22:38                                         ` Richard Stallman
2022-06-12  6:21                                       ` Eli Zaretskii
2022-06-12  6:57                                   ` Eli Zaretskii
2022-06-08 13:22                       ` Org mode and Emacs (was: Convert README.org to plain text README while installing package) Ihor Radchenko
2022-06-08 14:23                         ` Org mode and Emacs Stefan Monnier
2022-06-08 15:08                           ` Ihor Radchenko
2022-06-12 22:38                           ` Richard Stallman

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87v8cuqtkr.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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.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).