emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [Syntax discussion] Should we treat src blocks without LANG as paragraphs?
Date: Sat, 17 Dec 2022 21:47:18 +0700	[thread overview]
Message-ID: <tnkkpn$11am$1@ciao.gmane.io> (raw)
In-Reply-To: <878rj8u2na.fsf@localhost>

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)




  parent reply	other threads:[~2022-12-17 14:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 21:40 [BUG] ox-html does not export captions of source blocks without language Johan Bolmsjö
2022-12-14 21:51 ` Kaushal Modi
2022-12-14 22:05   ` Johan Bolmsjö
2022-12-15  9:31 ` [Syntax discussion] Should we treat src blocks without LANG as paragraphs? (was: [BUG] ox-html does not export captions of source blocks without language) Ihor Radchenko
2022-12-15 10:32   ` Kaushal Modi
2022-12-15 11:32   ` Max Nikulin
2022-12-15 14:29     ` Tim Cross
2022-12-15 15:07       ` Ihor Radchenko
2022-12-17  5:17         ` Tom Gillespie
2022-12-18  1:33           ` Tim Cross
2022-12-17 14:47         ` Max Nikulin [this message]
2022-12-18 13:35           ` [BUG] org-latex-src-block-backend is directly used as variable instead of querying export option (was: [Syntax discussion] Should we treat src blocks without LANG as paragraphs?) Ihor Radchenko
2022-12-18 13:40             ` Timothy
2022-12-21 12:14               ` Ihor Radchenko
2022-12-27 14:18           ` [FR] Present list of errors in separate buffer when running org-export, similar to what org-lint does " Ihor Radchenko
2022-12-27 18:39             ` Tim Cross
2022-12-17  9:56     ` [Syntax discussion] Should we treat src blocks without LANG as paragraphs? (was: [BUG] ox-html does not export captions of source blocks without language) Ihor Radchenko
2022-12-15 13:32   ` Timothy
2022-12-27 14:08 ` [BUG] ox-html does not export captions of source blocks without language Ihor Radchenko
2023-01-16 10:09   ` Ihor Radchenko
2023-01-16 10:31     ` [ANN] orgtbl-fit tbanelwebmin
2023-01-24 19:55       ` Ihor Radchenko
2023-01-25 15:02         ` tbanelwebmin
2023-01-26 10:35           ` Ihor Radchenko
2023-01-26 19:13             ` tbanelwebmin
2023-02-20 10:50               ` Ihor Radchenko
2023-03-01 11:48                 ` tbanelwebmin
2023-03-03 15:13                   ` Ihor Radchenko
2023-03-05 18:46                     ` tbanelwebmin
2023-01-23 13:32     ` [BUG] ox-html does not export captions of source blocks without language Ihor Radchenko

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.orgmode.org/

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

  git send-email \
    --in-reply-to='tnkkpn$11am$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@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/org-mode.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).