rememberYou / .emacs.d

🎉 Personal GNU Emacs configuration
The Unlicense
470 stars 43 forks source link

startup error with "Debugger entered--Lisp error: (wrong-type-argument stringp nil)" #7

Closed zetalipse closed 3 years ago

zetalipse commented 3 years ago

hi, i installed emacs-plus@27 with brew on mac, and there's an error when i started up, my backtrace: ''' Debugger entered--Lisp error: (wrong-type-argument stringp nil) file-name-directory(nil) org-babel-tangle-single-block(1) org-babel-tangle-collect-blocks("emacs-lisp\|elisp" nil) org-babel-tangle(nil "/Users/me/.emacs.d/config.el" "emacs-lisp\|elisp") org-babel-tangle-file("/Users/me/.emacs.d/config.org" "/Users/me/.emacs.d/config.el" "emacs-lisp\|elisp") org-babel-load-file("/Users/me/.emacs.d/config.org") (if (file-exists-p (expand-file-name "config.el" user-emacs-directory)) (load-file (expand-file-name "config.el" user-emacs-directory)) (org-babel-load-file (expand-file-name "config.org" user-emacs-directory))) eval-buffer(#<buffer load> nil "/Users/me/.emacs.d/init.el" nil t) ; Reading at buffer position 1516 load-with-code-conversion("/Users/me/.emacs.d/init.el" "/Users/me/.emacs.d/init.el" t t) load("/Users/me/.emacs.d/init" noerror nomessage) startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1fe6d3ca3e49>) #f(compiled-function () #<bytecode 0x1fe6d3ca3e5d>) t) command-line() normal-top-level() ''' Thanks for any help~

rememberYou commented 3 years ago

Hello,

Welcome to GNU Emacs! Unfortunately, if you have installed GNU Emacs and directly copied and pasted my config, there is a good chance that it doesn't work.

In view of the error message, I suspect a wrong file name to your config. Check that the /Users/me/.emacs.d/init.el and /Users/me/.emacs.d/config.el files exist.

If the problem persists, have you ever tried after installing GNU Emacs to start with a blank configuration (e.g., emacs -Q)? If this works then I would recommend you to start with a blank configuration and include snippets from other configs as we go along. Some of these snippets will require adapting some strings and/or installing packages on your OS to make them work.

What you can do to avoid deleting everything in your config, is to comment in config.el half of the code, see if the bug is still there and so on. This will allow you to quickly see the source of the error. Of course, once the bug is solved, remember to solve the config.org file, if you use one.

Let me know what's going on. I'm sure we'll fix this bug :-)

zetalipse commented 3 years ago

Thanks so much. I have confirmed that the init.el file exists while the config.el does NOT. I tried with your suggest, and found the problem occurs in line 2740: #+begin_src emacs-lisp :tangle I replace :tangle with :tangle no and finally the ~/.emacs.d/config.el file auto generated successfully .

And seems that it it's much better to replace #+begin_src bash with #+begin_src shell, needs more test.

Thanks again.

rememberYou commented 3 years ago

With pleasure. Glad to see you ended the week with a working GNU Emacs! :-)