From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Org mode and Emacs Date: Fri, 01 Sep 2023 06:46:28 +0000 Message-ID: <87v8cuqtkr.fsf@localhost> References: <83msyemjx8.fsf@gnu.org> <871qfpoij6.fsf@gnu.org> <87fs45ivyo.fsf@localhost> <87h6okga15.fsf@localhost> <87cyz61cbp.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39318"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 01 08:46:27 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qbxvG-000A2F-DF for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Sep 2023 08:46:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbxuz-0007b4-EN; Fri, 01 Sep 2023 02:46:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbxuv-0007Zp-FZ for emacs-devel@gnu.org; Fri, 01 Sep 2023 02:46:08 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbxur-000698-Bp for emacs-devel@gnu.org; Fri, 01 Sep 2023 02:46:05 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 72661240028 for ; Fri, 1 Sep 2023 08:45:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1693550755; bh=p52MsMsg0qTQ9PgCaHubY0Kwnck3Jwi2ckFhm71EQRM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=blO1G19nuXYBdK8KPIrrbwlkg/okmc3YJg1LQHFi/L7/H29LY8RMLLbv91TjjvmwP DFTr58yYcB87jlXALWlog9M606J0r6IogKifvGjuWqql5zIeKKXMJgPyf6GFwh2U81 sTsbaITBjYBWQkEbrSUWuz5kIJida4/LIuFysjerGPQnHSvMj3WSHfL/f9UDLqjOoL jNeW8PY10uJ20OEBFZDxIU2OulZJVH6HKRBVvZRYzkgTIV+gLi1fCUbLIPFm6pHPmQ Nsp0JBFeoMP03tSYzvet72ITrDNtkfckj4EeOcbM9lbIAJuhexTS3p13VYm4QV+cnN 4TKIAGqvsJSUQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RcT7k54kzz9rxK; Fri, 1 Sep 2023 08:45:54 +0200 (CEST) In-Reply-To: Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309725 Archived-At: Richard Stallman 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-Formatte= r-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: or @@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 =E2=80=98#+BEGIN_SRC=E2=80=99 =E2=80=A6 =E2=80=98#+END_SRC=E2=80=99 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=3D"file.csv" cat $file #+end_src #+begin_src elisp :var table=3Dbash-input(file=3D"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-Blo= cks.html #+begin: blockname #+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 ... #+end What you proposed with @latex: ... @end is similar to dropping 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. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at