Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommended way to customize .emacs.d while being able to keep it in sync? #26

Closed
priyadarshan opened this issue Apr 24, 2012 · 6 comments

Comments

@priyadarshan
Copy link

Hi,

I am using your .emacs.d (and enjoining it a lot), and I would like to install a few packages which are not manageable with ELPA or MELPA, and also incorporate my own elisp programs, customize init.el, etc.

Is there a recommended way to do that, while preserving the ability to keep .emacs.d in sync with the latest git version?

Perhaps a custom directory which is ignored by git? But then, how could one change init.el, and keeping the changes? Would it be possible to add a hook of some kind, so that a custom init file (say, custom/custom-init.el) is loaded?

What if one would need to change some keybindings or variables already defined? How can one safely shadow those?

Also, is there a better way to periodically update all the packages installed by .emacs.d? Perhaps a function to do that at once (git fetch upstream/ git merge upstream/master + refresh ELBA/MELPA packages)?

Thank you so much for your .emacs.d. Very nice!

@purcell
Copy link
Owner

purcell commented Apr 24, 2012

Thanks for taking the time to get in touch. I'm happy if the config is helpful to you.

Regarding customising the config, I kinda figured people would just fork the repo and make changes inline, then either merge in my future changes using git, or rebase their local changes against my master branch.

It's easy enough to add further libs (possibly as git submodules) under ~/.emacs.d/site-lisp without risking conflicts. Equally, adding a line in init.el to load an extra init-mycustomstuff.el is unlikely to result in conflicts.

I confess that I haven't given much thought to providing a general extension mechanism for the config, because I'm not sure that I could provide one that covered all possible requirements. :-)

Regarding updating all the packages: now that almost all upstream dependencies are packaged up in Melpa, you can update them by simply running "M-x package-list-packages" then use "U" (in Emacs 24) to install all available upgrades.

Hope that helps,

-Steve

@purcell purcell closed this as completed Apr 24, 2012
@purcell
Copy link
Owner

purcell commented Apr 24, 2012

P.S. Even though I've closed this issue now, please feel free to add any further comments or suggestions!

@priyadarshan
Copy link
Author

Thank you for your fast reply!

The only thing that is not clear to me is how to shadow settings and possibly packages already included?

Regarding the settings (keybindings, variables, etc), would it be enough to load an extra init-custom.el as very last line in init.el? Or perhaps settings in .emacs would shadow everything else?

To shadow included packages, would it be enough to load a newer (or older) version after the default one is loaded?

By the way, I love Melpa. It feels so "right". I saw that you are a main contributor. Thank you so much for that, too!

priyadarshan

PS: Prelude does offer some kind of custom directory and custom init.el (https://github.com/bbatsov/prelude/blob/master/init.el) although I am not sure if that would work out with yours. A built-in mechanism like that would be very good for me, and I am sure for other users/enjoyers of your .emacs.d. Perhaps you could consider something similar in the future?

@purcell
Copy link
Owner

purcell commented Apr 24, 2012

Okay, so every directory under ~/.emacs.d/site-lisp is added to the load-path, making it easy to add extra upstream or personal libraries. However, Elpa packages will always appear earlier in the load-path than others, so if you want to shadow any Elpa packages, you'd need to remove them from the list in init-elpa.el (and also uninstall them via the package-list-packages interface, if necessary).

I've added support for an optional "init-local.el", which will get loaded after the custom settings file. You can use it to cleanly add overrides and extra code.

Shadowing settings such as keybindings might require some "eval-after-load" magic, since I try to defer configuration until related packages are loaded.

I'm happy that you like Melpa. It seems like a step forward.

-Steve

@priyadarshan
Copy link
Author

Steve, I cannot believe it. I was saying just a few hours ago:

Perhaps you could consider something similar in the future?

It seems that the future is now :)

You made my day.

Thank you so much.

@purcell
Copy link
Owner

purcell commented Apr 24, 2012

My pleasure. Have a great day.

qioixiy pushed a commit to qioixiy/emacs.d that referenced this issue Aug 5, 2017
* lispy.el (lispy-move-up): Simplify.
  (lispy-move-down): Simplify.

Fixes purcell#26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants