emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: pareto optimal <pareto.optimal@mailfence.com>
To: emacs-orgmode@gnu.org
Subject: Org babel noweb expansion includes extra newline
Date: Thu, 3 Feb 2022 03:03:29 +0100 (CET)	[thread overview]
Message-ID: <1988480151.334881.1643853809467@ichabod.co-bxl> (raw)

[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2021 bytes --]

             reply	other threads:[~2022-02-03  2:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03  2:03 pareto optimal [this message]
2022-10-23  5:29 ` Org babel noweb expansion includes extra newline 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=1988480151.334881.1643853809467@ichabod.co-bxl \
    --to=pareto.optimal@mailfence.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).