Resolution
With help from commenters, I have things kind of working.
- I removed
:comments link
from Properties. - I manually added comments to the top of every code block to replicate what
:comments link
would do. - I had to install modes for each language I was missing (lua, vimrc, maybe others?).
Now I can tangle in Doom Emacs or in default Emacs. I wish I could solve this without manually adding comments, but this is Good Enough®
Ask
In an org file, how do I define a comment syntax for lua and vimrc?
Explanation
I am moving all my various config files into 1 org file. When trying to tangle it, I get a prompt "No comment syntax is defined. Use: " for each lua and vimrc code block. I don't want to have to specify this for every lua and vimrc code block I have, every time I tangle the file, for each block. I don't see a way to specify the comment syntax in the header, but that's the kind of solution I'm looking for.
Environment
I use Doom Emacs in case that's relevant. I'm experiencing this issue on two different machines.
Machine 1
- OS: macOS 12.1
- Emacs: GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0, Carbon Version 158 AppKit 1671.6) of 2021-03-27
- Org Mode: Org mode version 9.6 (9.6-??-e7ea951ac)
Machine 2
I'm not on this machine at the moment so I'm only going by memory here, but I update my software about weekly.
- OS: macOS 12.1
- Emacs: 28.0.92
- Org Mode: 9.6
Example org file
#+TITLE: Configs
#+PROPERTY: header-args :tangle yes :mkdirp yes :comments link :tangle-mode (identity #o444)
** Nvim
#+NAME: nvim_init
#+begin_src lua :tangle ~/.config/nvim/init.lua
vim.cmd('set runtimepath^=~/.vim runtimepath+=~/.vim/after')
-- etc
#+end_src
#+NAME: vimrc
#+begin_src vimrc :tangle ~/.vim/vimrc
set nocompatible
" etc
#+end_src
- EDIT: Mar 25 Add Environment section
- EDIT: Mar 26 Add Resolution section
comment-normalize-vars
. It would be interesting to find out how that gets called. You could instrument the function with e.,g. edebug and when execution stops in the function, you could get a backrace withd
. That might (or might not) help with debugging the problem.emacs -Q
? If not, I thought you can raise an issue if you can reproduce this with empty doom config.PROPERTY
before, and I find out it is because you set:comment link
and Emacs doesn't know the comment syntax for both modes.