* dolist require help
@ 2011-09-29 23:10 Lachlan Deck
2011-09-29 23:33 ` Lachlan Deck
0 siblings, 1 reply; 2+ messages in thread
From: Lachlan Deck @ 2011-09-29 23:10 UTC (permalink / raw)
To: help-gnu-emacs
Hi there,
I'm trying to auto-require some custom provided stuff -- a list of files containing various settings -- and can't quite make it work.
Any ideas what I'm doing wrong?
(defvar my-el-dir (file-name-directory load-file-name))
(defvar my-custom-dir (concat my-el-dir "custom/"))
(add-to-list 'load-path my-custom-dir)
(require 'my-package-autoloads)
(require 'my-el-get-autoloads)
;; this doesn't work (strack trace below)
(dolist (setting-file (file-expand-wildcards (concat my-custom-dir "*-settings.el")))
(progn (print (concat "---> loading " (file-name-sans-extension (file-name-nondirectory setting-file)))))
(require (make-symbol (file-name-sans-extension (file-name-nondirectory setting-file)))))
;; this does work
(require 'my-ecb-settings)
<..>
Lachlan Deck
lachlan.deck@gmail.com
Debugger entered--Lisp error: (error "Required feature `my-ecb-settings' was not provided")
require(my-ecb-settings)
(while --cl-dolist-temp-- (setq setting-file (car --cl-dolist-temp--)) (progn (print (concat "---> loading " (file-name-sans-extension (file-name-nondirectory setting-file))))) (require (make-symbol ($
(let ((--cl-dolist-temp-- (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) setting-file) (while --cl-dolist-temp-- (setq setting-file (car --cl-dolist-temp--)) (progn (print (concat "--$
(catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) setting-file) (while --cl-dolist-temp-- (setq setting-file (car --cl-dolist-te$
(cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) setting-file) (while --cl-dolist-temp-- (setq setting-file ($
(block nil (let ((--cl-dolist-temp-- (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) setting-file) (while --cl-dolist-temp-- (setq setting-file (car --cl-dolist-temp--)) (progn (print $
(dolist (setting-file (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) (progn (print (concat "---> loading " (file-name-sans-extension (file-name-nondirectory setting-file))))) (require$
eval-buffer(#<buffer *load*<3>> nil "/Users/ldeck/.emacs.d/ldeck/my.el" nil t) ; Reading at buffer position 562
load-with-code-conversion("/Users/ldeck/.emacs.d/ldeck/my.el" "/Users/ldeck/.emacs.d/ldeck/my.el" nil nil)
load("my.el")
<...>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: dolist require help
2011-09-29 23:10 dolist require help Lachlan Deck
@ 2011-09-29 23:33 ` Lachlan Deck
0 siblings, 0 replies; 2+ messages in thread
From: Lachlan Deck @ 2011-09-29 23:33 UTC (permalink / raw)
To: help-gnu-emacs
Answering my own question:
use intern instead of make-symbol.
On 30/09/2011, at 9:10 AM, Lachlan Deck wrote:
> Hi there,
>
> I'm trying to auto-require some custom provided stuff -- a list of files containing various settings -- and can't quite make it work.
>
> Any ideas what I'm doing wrong?
>
> (defvar my-el-dir (file-name-directory load-file-name))
> (defvar my-custom-dir (concat my-el-dir "custom/"))
> (add-to-list 'load-path my-custom-dir)
>
> (require 'my-package-autoloads)
> (require 'my-el-get-autoloads)
>
> ;; this doesn't work (strack trace below)
> (dolist (setting-file (file-expand-wildcards (concat my-custom-dir "*-settings.el")))
> (progn (print (concat "---> loading " (file-name-sans-extension (file-name-nondirectory setting-file)))))
> (require (make-symbol (file-name-sans-extension (file-name-nondirectory setting-file)))))
>
> ;; this does work
> (require 'my-ecb-settings)
> <..>
>
> Lachlan Deck
> lachlan.deck@gmail.com
>
>
> Debugger entered--Lisp error: (error "Required feature `my-ecb-settings' was not provided")
> require(my-ecb-settings)
> (while --cl-dolist-temp-- (setq setting-file (car --cl-dolist-temp--)) (progn (print (concat "---> loading " (file-name-sans-extension (file-name-nondirectory setting-file))))) (require (make-symbol ($
> (let ((--cl-dolist-temp-- (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) setting-file) (while --cl-dolist-temp-- (setq setting-file (car --cl-dolist-temp--)) (progn (print (concat "--$
> (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) setting-file) (while --cl-dolist-temp-- (setq setting-file (car --cl-dolist-te$
> (cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) setting-file) (while --cl-dolist-temp-- (setq setting-file ($
> (block nil (let ((--cl-dolist-temp-- (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) setting-file) (while --cl-dolist-temp-- (setq setting-file (car --cl-dolist-temp--)) (progn (print $
> (dolist (setting-file (file-expand-wildcards (concat my-custom-dir "*-settings.el"))) (progn (print (concat "---> loading " (file-name-sans-extension (file-name-nondirectory setting-file))))) (require$
> eval-buffer(#<buffer *load*<3>> nil "/Users/ldeck/.emacs.d/ldeck/my.el" nil t) ; Reading at buffer position 562
> load-with-code-conversion("/Users/ldeck/.emacs.d/ldeck/my.el" "/Users/ldeck/.emacs.d/ldeck/my.el" nil nil)
> load("my.el")
> <...>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-29 23:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-29 23:10 dolist require help Lachlan Deck
2011-09-29 23:33 ` Lachlan Deck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).