[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Something like `with-eval-before-load'?
From: |
Alexander Shukaev |
Subject: |
Something like `with-eval-before-load'? |
Date: |
Tue, 25 Nov 2014 17:35:17 +0100 |
`with-eval-after-load' is indeed very handy form. But currently I'm in the
situation where I need its counterpart --- `with-eval-before-load'.
Let me give you an example. Imagine that I want to wipe out
`undo-tree-map'. How would you expect one to do so? Here is one way:
(set 'undo-tree-map (make-sparse-keymap))
(require 'undo-tree)
So far so good, but it will only work if `undo-tree' has not been ever
required before. In my case I don't want to track whether it was required
before or not (by other packages which depend on it of course) because my
configuration is modular and all I would like to do would be to write
something like
(with-eval-before-load 'undo-tree
(set 'undo-tree-map (make-sparse-keymap)))
in some separate file which is dedicated for configuring only `undo-tree'
say `init-undo-tree.el'.
Then in some global configuration file, for example, `init.el' we can have
...
(require 'init-this)
(require 'init-that)
(require 'init-them)
(require 'init-him)
(require 'init-her)
(require 'init-undo-tree)
...
and the key feature here would be that the order where I put `(require
'init-undo-tree)' would not matter.
Is there any facility like `with-eval-before-load' available?
- Something like `with-eval-before-load'?,
Alexander Shukaev <=