Created
July 29, 2016 00:01
-
-
Save strburst/ebb9cb0f3a55c89e0bffb4a3ed1d1040 to your computer and use it in GitHub Desktop.
Weird error in Emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Steps to reproduce: | |
;; Put init.el in ~/.emacs.d and thing-thing.el in ~/.emacs.d/lisp | |
;; Start Emacs | |
;; Observe that the following message appears: | |
;; error: Required feature ‘thing-thing’ was not provided | |
;; Observe that in the messages buffer, features contained thing-thing after | |
;; thing-thing.el finished executing | |
;; Observe that features now does not contain thing-thing | |
;; Observe that side-effects of the execution of thing-thing still occurred, | |
;; namely the creation of the variable thing-var and the printing to the | |
;; messages buffer | |
;; Observe the alternate form (commented out) works without error | |
(add-to-list 'load-path "~/.emacs.d/lisp") | |
(defun symbol-append-thing (sym) | |
"Take a symbol and make a new symbol with \"-thing\" appended to it." | |
(make-symbol (concat (symbol-name sym) "-thing"))) | |
(mapc 'require (list (symbol-append-thing 'thing))) | |
; (mapc 'require (list 'thing-thing)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar thing-var 12) | |
(provide 'thing-thing) | |
(message "%s" features) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment