emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Syntax discussion] Should we treat src blocks without LANG as parag


From: Max Nikulin
Subject: Re: [Syntax discussion] Should we treat src blocks without LANG as paragraphs?
Date: Sat, 17 Dec 2022 21:47:18 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 15/12/2022 22:07, Ihor Radchenko wrote:
Tim Cross writes:
I don't see any reason not to allow captions for examples either.

In LaTeX, example blocks are exported as verbatim. I am not sure if we
can even put captions into verbatim.

The default backend for source blocks is verbatim as well:

---- >8 ---- org ----
#+caption: Minimal C program
#+begin_src c
  void main() {
    return 0;
  }
#+end_src
---- 8< ---- org ----
---- >8 ---- latex ----
\begin{verbatim}
void main() {
  return 0;
}
\end{verbatim}
\captionof{figure}{Minimal C program}
---- 8< ---- latex ----

So I do not see a problem to support captions for example blocks.

Perhaps page break may happen before the caption, but it is another issue.

You might remember my vote for the symmetry "#+begin_example lang" as "#+begin_src lang :eval never :noweb no" and Tom's one against it in the following thread:
https://list.orgmode.org/874k0vud2l.fsf@localhost/
Re: [DISCUSSION] Refactoring fontification system. Wed, 08 Jun 2022 10:02:58 +0800

Max Nikulin writes:
Source blocks without language may be treated as #+begin_example blocks. I believe, a warning should be issued in such case.

M-x org-lint already does it.

From time to time I write about warnings during export, tangle, etc. I would not mind if you just ignore it. From my point of view, the following should be convenient, however I am unsure if it may be implemented in non-disturbing way. Exporter may issue warnings, they are collected and presented to user in a temporary window with buffer names and line numbers as in compilation-minor-mode. The user may see that something goes wrong, but if their does not switch to the warnings window then it disappears. It would be great if exporters and lint share code generating warnings. Another issue that mature development tools usually allows to suppress particular warning for a specific line. It may be a problem taking into account specific of Org syntax.

As to `org-lint', I believe, it is hard to discover for new users and there should be a reason to run it. It easy to forget about it even when some problem is faced. It is mentioned in the manual, but - https://orgmode.org/manual/Feedback.html does not request to run org-lint before reporting a bug - `org-submit-bug-report' neither suggest `org-lint' nor runs it as a check. Likely it should be suppressed (with appropriate report) for large buffers.

P.S. I have accidentally noticed a suspicious line. I have not tried if it is real bug, but in `org-latex-make-preamble' I expect a property obtained from the INFO argument, not global variable:

lisp/ox-latex.el:2014: (when (and (eq org-latex-src-block-backend 'engraved)





reply via email to

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