emacs-orgmode
[Top][All Lists]
Advanced

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

Org babel noweb expansion includes extra newline


From: pareto optimal
Subject: Org babel noweb expansion includes extra newline
Date: Thu, 3 Feb 2022 03:03:29 +0100 (CET)

Hi, I hope this org file is descriptive enough along with the subject.

I'm using org 9.5.2.

I believe it might be a bug since the results of calling =all-tangled-filepaths= only has 4 results, so the =org-babel-expand-src-block= function might have a bug.

* Show files I tangle and could delete from git
** currently not working and outputting weird stuff
*** The expansion seems to include an empty result for some reason

#+begin_src emacs-lisp :results verbatim
  (save-excursion
    (progn
      (goto-char
       (org-babel-find-named-block "files-to-remove-from-git"))
      (org-babel-expand-src-block)
      ))
#+end_src

#+RESULTS:
#+begin_example
"git ls-files ~/system/users/profiles/emacs/default.nix
git ls-files ~/system/users/profiles/emacs/emacs-packages.nix
git ls-files ~/system/users/profiles/chat/default.nix
git ls-files ~/system/profiles/misc/default.nix
git ls-files "
#+end_example
*** here's what hapepns if we just run =all-tangled-filepaths=

#+call: all-tangled-filepaths()

#+RESULTS:
: ~/system/users/profiles/emacs/default.nix
: ~/system/users/profiles/emacs/emacs-packages.nix
: ~/system/users/profiles/chat/default.nix
: ~/system/profiles/misc/default.nix

** get tangled blocks

#+name: all-tangled-filepaths
#+begin_src sh :results output
rg -N -o  ' :tangle ([^yesno][^ ]+)' -r '$1' ~/.emacs.d/system.org  | rg '/system/'
#+end_src

** pass those to git-ls-files

#+name: files-to-remove-from-git
#+begin_src sh :noweb yes :dir ~/system
git ls-files <<all-tangled-filepaths()>>
#+end_src
-- Sent with https://mailfence.com Secure and private email
reply via email to

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