:tangle no produces a weird tangling behavior #32

Open
opened 2022-05-09 17:10:11 +00:00 by Ziip-dev · 1 comment
Ziip-dev commented 2022-05-09 17:10:11 +00:00 (Migrated from github.com)

Hello, and thanks a lot for making your amazing config this readable and friendly :)
I am learning a lot but I am still struggling on the "Systemd daemon" part with no success.

Although I understood how you leveraged the org-mode literate programming powers, I noticed a weird behavior with a source block:

#+begin_src shell :tangle (if (string= "enabled\n" (shell-command-to-string "systemctl --user is-enabled emacs.service")) "no" "setup.sh")
systemctl --user enable emacs.service
#+end_src

Basically, this one tangles systemctl --user enable emacs.service to setup.sh only if the service is not already enabled, and that works well to create setup.sh the first time.

But then, when I save my config.org after an edit and look at config.el, this very code block was tangled to:

;; [[file:config.org::*prompt to run setup script][prompt to run setup script:2]]
  - ;; Setup script is empty
;; prompt to run setup script:2 ends here

and the "-" causes a (void-variable -) error at the next reboot.
Note: I have not incorporated your "Asynchronous config tangling" part.

Strangely, when I run doom sync, the tangling of this block becomes:

;; [[file:config.org::*prompt to run setup script][prompt to run setup script:2]]
nil
;; prompt to run setup script:2 ends here

Do you have any idea why and how it could be avoided?
If so, could you please demystify this for me? :)

Hello, and thanks a lot for making your amazing config this readable and friendly :) I am learning a lot but I am still struggling on the "Systemd daemon" part with no success. Although I understood how you leveraged the org-mode literate programming powers, I noticed a weird behavior with a source block: ``` #+begin_src shell :tangle (if (string= "enabled\n" (shell-command-to-string "systemctl --user is-enabled emacs.service")) "no" "setup.sh") systemctl --user enable emacs.service #+end_src ``` Basically, this one tangles `systemctl --user enable emacs.service` to `setup.sh` only if the service is not already enabled, and that works well to create `setup.sh` the first time. But then, when I save my `config.org` after an edit and look at `config.el`, this very code block was tangled to: ``` ;; [[file:config.org::*prompt to run setup script][prompt to run setup script:2]] - ;; Setup script is empty ;; prompt to run setup script:2 ends here ``` and the "`-`" causes a `(void-variable -)` error at the next reboot. *Note: I have not incorporated your "Asynchronous config tangling" part.* Strangely, when I run `doom sync`, the tangling of this block becomes: ``` ;; [[file:config.org::*prompt to run setup script][prompt to run setup script:2]] nil ;; prompt to run setup script:2 ends here ``` Do you have any idea why and how it could be avoided? If so, could you please demystify this for me? :)
tecosaur commented 2022-06-10 20:21:32 +00:00 (Migrated from github.com)

Frankly, I'm not sure what's going on there. I haven't ever seen this with my own setup.

Frankly, I'm not sure what's going on there. I haven't ever seen this with my own setup.
Sign in to join this conversation.
No description provided.