I am experiencing a very unusual (concerning) error with my org-mode installation, and I am afraid that something might be broken. First, I have this setup in my .emacs file
;; Use my org-mode file as an init emacs file
(org-babel-load-file
(expand-file-name "~/my_NOTES_file.org"
user-emacs-directory))
and when I try to load emacs there is an error in that org file. Starting with --debug-init reveals
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
string-match("emacs-lisp\\|elisp" nil nil)
org-babel-tangle-collect-blocks("emacs-lisp\\|elisp" nil)
org-babel-tangle(nil "/home/username/my_NOTES_file.el" "emacs-lisp\\|elisp")
org-babel-tangle-file("/home/username/my_NOTES_file.org" "/home/username/my_NOTES_file.el" "emacs-lisp\\|elisp")
org-babel-load-file("/home/username/my_NOTES_file.org")
eval-buffer(#<buffer *load*> nil "/home/username/.emacs" nil t) ; Reading at buffer position 1404
load-with-code-conversion("/home/username/.emacs" "/home/username/.emacs" t t)
load("~/.emacs" t t)
#f(compiled-function () #<bytecode 0x1e0f4d>)()
command-line()
normal-top-level()
so it seems that the functions following org-babel-tangle
are receiving a nil
for some reason. I have tried several things, including
- a full reinstallation of emacs
- tangled the emacs-lisp source blocks in the org file.
- isolate the emacs-lisp code blocks in a separate org-mode file and use that one instead.
The last solution does work, but I'd rather have all my configuration in my main org file. This main file is rather large (31128 lines) and has source blocks from several other programming languages. However, these two factors shouldn't be an impediment right? Thank you in advance for any help.
nil
arguments are not the problem: they are all expected, except for the second argument instring-match
which is supposed to be a string (and therefore cannot be nil). DoesM-x org-lint
point out any problems? – NickD Jan 26 at 1:51M-x org-lint
is EXACTLY what I needed to check for errors in such big org file: very handy tool. At the end, the problem was this line19304 low Possible incomplete block "#+begin_src shell
, i.e., a shell source block which was not properly constructed--the+END_SRC
line had been backspaced to the last line of the code (no idea how/why). Happy to accept this answer if you post it. – Ajned Jan 26 at 8:30org-lint
is not as well known as it should be, so this is a good opportunity to publicize it :-) – NickD Jan 26 at 13:34