emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Q/Bug?] Comment for noweb reference comments content
@ 2024-05-04  3:11 João Pedro
  2024-05-04 11:32 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: João Pedro @ 2024-05-04  3:11 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Ok so I don't know whether this is a bug or intended behaviour (though
if its the latter I propose we reconsider), but if I have the following

#+begin_src emacs-lisp :noweb yes :comments noweb :tangle /tmp/foo.el
(progn
  <<foo>>)
#+end_src

#+name: foo
#+begin_src emacs-lisp
(message "foo")
#+end_src

the resulting foo.el will have a syntax error, since the closing ) for
`progn' will have been commented like so

;; [[file:...][No heading:1]]
(progn
  ;; [[file:...][foo]]
  (message "foo")
  ;; foo ends here)
                  ^
;; No heading:1 ends here

It seems like some macro let-bound in `org-babel-expand-noweb-refereces'
is doing this, but I couldn't pinpoint exactly what or where. What I
could achieve though, is to add a newline after the second call to
`c-wrap' inside `expand-body''s definition, which at least solve the
problem of throwing syntax errors, but I don't think that would be the
best solution.

Best regards,

-- 
João Pedro de A. Paula
IT bachelors at Universidade Federal do Rio Grande do Norte (UFRN)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Q/Bug?] Comment for noweb reference comments content
  2024-05-04  3:11 [Q/Bug?] Comment for noweb reference comments content João Pedro
@ 2024-05-04 11:32 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-05-04 11:32 UTC (permalink / raw)
  To: João Pedro; +Cc: emacs-orgmode

João Pedro <jpedrodeamorim@gmail.com> writes:

> #+begin_src emacs-lisp :noweb yes :comments noweb :tangle /tmp/foo.el
> (progn
>   <<foo>>)
> #+end_src
>
> #+name: foo
> #+begin_src emacs-lisp
> (message "foo")
> #+end_src
> ...
> ;; [[file:...][No heading:1]]
> (progn
>   ;; [[file:...][foo]]
>   (message "foo")
>   ;; foo ends here)

Thanks for reporting!
Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1523e21d8

-- 
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>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-04 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-04  3:11 [Q/Bug?] Comment for noweb reference comments content João Pedro
2024-05-04 11:32 ` Ihor Radchenko

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).