I'm new to emacs and try to learn elisp. I've read some tutorials and try to build now my own customized emacs. Looking at this blog I want to write a similar script for automatically installing required packages.
In the blog the author defines a variable required-package which binds to a list of required packages. Then he writes (I quote):
; my-packages.el (require 'cl) ; method to check if all packages are installed (defun packages-installed-p () (loop for p in required-packages when (not (package-installed-p p)) do (return nil) finally (return t))) My goal is to write a similar function which does not depend on the common lisp package (since I would like to learn elisp :)). So I tried:
(defun check-required-packages (list-check) "The function check if the packages in LIST-CHECK are installed" (let ((return '(t))) ; return list (dolist (p list-check return) ; for each p in package execute the body and finally return RERTURN. (when (not (package-installed-p p)) (add-to-list return nil))) return)) Having also a variable required-packages binding to such a list leads to the error:
(check-required-packages required-packages) Wrong type argument: symbolp, (t) I dont understand this. Since I can define
(setq a '(t)) without a problem.