reddit / emacs

Package cl is deprecated debugging

JacboianMatrix · 2022-12-22 13:21
I am getting "Package cl is deprecated" on EMACS startup. cl is not directly called in my init.el file, so one of my packages must be calling it. I found this video [https://www.youtube.com/watch?v=RVUxjGymcY0](https://www.youtube.com/watch?v=RVUxjGymcY0) which says to use (require 'loadhist) (file-dependents (feature-file 'cl)) To identify the culprit. I am using EMACS 28.1 with ESS. It is unclear to me how to evaluate these commands. I can get loadhist via " ‘C-h v load-history’ " but then I do not know how to evaluate (file-dependents (feature-file 'cl)). ​ I am sure this is a noob question, but any help would be great.
scbagley · 2022-12-22 13:43
`M-x eval-expression`
phr46 · 2022-12-22 15:27
Another way to do this is to write the commands you want to run in some buffer, put your cursor just after the closing ) of the command, and then call `eval-last-sexp` (usually `C-x C-e`). You can also run all commands in the whole buffer with `M-x eval-buffer` Bonus points for enabling `emacs-lisp-mode` and getting syntax highlighting.
janoc · 2022-12-22 20:19
I found this the most useful way identify what is causing some mysterious error message. Simply put this at the start of your `init.el`: `(setq debug-on-message "Package cl is deprecated")` It will drop you into the debugger when that message would be printed out and you can then easily identify where is it coming from. Another useful trick, even though not related to your question is to put this in your `init.el`: `(setq debug-on-error t)` That will drop you into the debugger whenever some kind of error occurs, so you can see what has caused it.
granti128 · 2022-12-23 06:53
In the video, the author has put the code in a source code block in an Org mode buffer and evaluated the block so the results appear directly beneath the code block. I use this method to track things (like drive partition information from shell commands) in a journal file. I don’t know if you use Org mode much at all, but it’s quite simple. Insert the following text in an Org-mode buffer: #+begin_src emacs-lisp :tangle no :results value verbatim (require 'loadhist) (file-dependents (feature-file 'cl)) #+end_src The `:results value verbatim` is just my preference. Play with them all and see which suits your needs. With point somewhere in the source code block, `C-c C-c` to execute. Answer “yes” at the prompt, and you get a #+RESULTS: section like this: #+RESULTS: : ("/home/granti/.emacs.d/elpa/jumblr-20170727.2043/jumblr.elc")
JacboianMatrix · 2022-12-23 09:14
I enabled lisp, but was not that impressed with the changes. Is this because I am using any of the following: Nord theme, ESS, or markdown?
JacboianMatrix · 2022-12-23 09:17
Thanks! The problem is that EMACS is calling site-lisp/site-start.el (from the ESS installation) which has (require 'psvn) in the SVN section. Since I don't use SVN, I commented that section out and the warning is gone.
phr46 · 2022-12-23 10:50
I don't know what you'd call impressive, but it's just basic syntax highlighting :D If you're not sure it's working, try writing a (setq x "hello"), you should see setq and the string in different colors. I also install rainbow-delimiters-mode, makes each level of parentheses a different color. Does everything look the same color when you open your init.el?