Pergunta

The question arises with connection to the problem of adding child dirs to the load-path. Here's a solution. Unfortunately - it seems to revert the load-path. I tried to fix it myself, but can't do and need help.

So my question is: how do I revert a load-path.

I tried (setq load-path (reverse load-path)) but it fails - which suggests that load-path is not a list...

Edit:

Reversing load path works, indeed - I don't know what I did wrong when I tried it before posting.

I'm facing a very strange problem simple.el shadows sunrise-commander.el - while it supposed to load before that. I thought - the problem is in the order in which I have dirs in a load path - but now - when I reversed the load-path - progmodes dir is before the sunrise one - the problem is still around. I'm puzzled.

I'll reformulate my question then: how do I make sure that a given extension is loading after the core Emacs's code?

Edit 2:

In case shadow doesn't mean, what I think - my actual problem is that many sunrise-commander and icicles keys are binded to core emacs functions. For example when I use icicles M-p is binded to

M-p runs the command recenter-top-bottom, which is an interactive
compiled Lisp function in `window.el'.

While it should be previous-history-element. Similarly, when I use sunrise-commander M-u is binded to

M-u runs the command subword-backward, which is an interactive
compiled Lisp function in `subword.el'.

while it realy should be sr-history-next.

Edit 3:

Oh I solved it! In the old days I used to install emacs things system-wide, thru synaptic package manager. Then I came with a resolution - that this way it is impossible to have my customizations with me. And after that I maintain a local emacs and emacs packages. So all I has to do is to remove all the system-wide emacs stuff.

** Edit 4**:

Nope it is not that. It way ErgoEmacs keybindings extension. After I commented it out I have M-n and M-p working fine in icicles. Though RET in Sunrise commander still calls dired function - not the sunrise one. Hopefully will solve it later.

Foi útil?

Solução

Extensions are loaded by either require or load. The load-path simply specifies a list of folders in which require will search. Imagine you have the .emacs.d/vendor dir full of Emacs extensions and it's added to your load-path (the order of entries in the load path doesn't matter unless the same extension is in several of the folders there - something known as load-path shadowing, that can be examined with M-x list-load-path-shadows). You can do one of two things at this point:

(require 'extension)
;; or
(load "~/emacs.d/vendor/extension.el)

require has the added benefit, that it wouldn't load a library twice. So, to answer you question - to make sure that an extensions is loaded after the core (very few things are loaded automatically by Emacs) it just has to be required or loaded after the stuff you want it loaded after.

After you second edit I think you should take a look at this great article on keybindings in Emacs.

Outras dicas

Not sure if it matters, but regarding "how do I load something before simple.el": you can't because simple.el is preloaded in the `emacs' executable, so it's loaded long before the .emacs is loaded.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top