emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: [Patch] ob-tangle.el: New value 'ascii' for the header argument ':comments'
Date: Tue, 14 Jun 2022 11:11:06 +0000	[thread overview]
Message-ID: <87o7yvlctx.fsf@posteo.net> (raw)
In-Reply-To: <87y1xzq4k9.fsf@localhost> (Ihor Radchenko's message of "Tue, 14 Jun 2022 11:58:30 +0800")

Ihor Radchenko writes:

> I think that the existing code can be improved. Relying on the
> undocumented behavior of (org-back-to-heading) is not ideal. Not to
> mention code blocks before first headline.
>
> It would be great if you rewrite the existing code to suite both the
> defaults and the proposed behavior.

Yes, I agree that this needs a more robust approach. Also, I've noticed
that the patch I've proposed has a rather silly bug: replacing the
second `match-end 0' with `match-beginning 0' naturally causes
intermediate code blocks to be exported as comments (!). Returning it to
`match-end 0' everything is OK, but the present approach is still
tricky.

I'm going to see if I can try something cleaner these days. Ideally,
everything should be controlled from org-babel-process-comment-text...

On the other hand, I have a curiosity. I understand that the behavior of
the `:comments org' option should be left intact to ensure backwards
compatibility. But I've always wondered if there is any use case where
this value, as it behaves, might be practical. I don't quite understand
how useful all the Org metadata in the comments of the tangled file can
be. The expectation with `:comments org' is that only the content of the
Org document will be rendered (as comments), but not its metadata, that
all they do is unnecessarily fatten up the source file. I'm thinking,
for example, of headers with lots of properties. or comment blocks,
which would be visible in the tangled source file:

┌────
│ ;;   Header
│ ;;   :PROPERTIES:
│ ;;   :A_LOT_OF: properties
│ ;;   :END:
│ 
│ ;; #+begin_comment
│ ;; Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor tellus.
│ ;; Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis eget, convallis nec,
│ ;; purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus
│ ;; mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras placerat
│ ;; accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl.
│ ;; #+end_comment
└────

Best regards,

Juan Manuel 


  reply	other threads:[~2022-06-14 11:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10 18:28 Juan Manuel Macías
2022-06-11  5:39 ` Ihor Radchenko
2022-06-11 11:20   ` Juan Manuel Macías
2022-06-14  3:58     ` Ihor Radchenko
2022-06-14 11:11       ` Juan Manuel Macías [this message]
2022-06-14 11:55         ` Ihor Radchenko
2022-06-15 10:30           ` Juan Manuel Macías
2022-07-21 13:44           ` Juan Manuel Macías
2022-07-25 13:34             ` Ihor Radchenko
2022-07-25 17:13               ` Juan Manuel Macías
2022-07-26  5:35                 ` Ihor Radchenko
2022-06-12 19:18 ` Rudolf Adamkovič
2022-06-12 19:55   ` Juan Manuel Macías
2022-06-13  8:24     ` Rudolf Adamkovič
2022-06-13 10:22       ` Juan Manuel Macías

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=87o7yvlctx.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \
    --subject='Re: [Patch] ob-tangle.el: New value '\''ascii'\'' for the header argument '\'':comments'\''' \
    /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

Code repositories for project(s) associated with this 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).