(no title)
spellcard199 | 6 years ago
I completely agree with the others who say:
- learn elisp instead of learning "emacs"
- if you want to memorize something, just learn the name of the command: if you use it very often then learn/define a keybinding for it
---- part 1: I'm happy I've learned elisp in the last yearPeople complain about memorizing emacs keybindings, but most of the time I just call the command name with M-x command-name. Only if I find myself using it often I bother memorizing or setting a keybinding for it.
As for why I use emacs, I started using it for org-mode, which I considered it's only killer feature at the time. Since 1 year ago I started learning elisp and I think only now I can see what's the whole point of emacs.
In just 1 year of (beginner-level) elisp I wrote 75 files containing elisp functions to help myself with dozens of tasks that comprise:
- move/mirror parts of ascii diagrams
- automate some tasks just clicking on custom org-mode links
- wrap ammonite-term-repl to get Ammonite completion for scala scripts [1] [2]
- add rudimentary support for kawa scheme to geiser (my first pull request ever (still waiting for response))
- control video player from within emacs while I'm writing subtitles
---- part 2: you can have different emacs configurationsAnother common complain is that emacs tends to become slower as you add more and more packages. As a spacemacs user, I noticed that too. For this reason when I don't need spacemacs goodies I use multiple, different emacs configurations (with evil-mode though).
This is how I do it:
1 - Make a new ".emacs.d" user directory somewhere
2 - Make a new "init.el" user file inside it
3 - Add to the beginning of init.el :
(setq user-init-file (or load-file-name "path-to-init.el"))
(setq user-emacs-directory (file-name-directory user-init-file))
4 - Call emacs with: emacs -Q --load "path-to-init.el"
That's it.You could achieve the same result using cask, which would be more elegant imo, but takes a couple of seconds more to start.
---- part 3: use elisp to call other languages
As for elisp, once you have learned enough of it (not much), if you are determined not to use it, there are different ways to call other languages from it:
- clojure through cider plus clomacs
- common lisp through slime
- shen through shen-elisp [3]
- different compiled languages through dynamic modules:
- C (example at [4])
- go (example at [5])
- ... many others I haven't investigated...
Just out of curiosity, I explored the shen-elisp path. I tried a whole week to see if I could replace it with shen-elisp. At the end of the week I learnt how to call elisp from shen-elisp and shen-elisp from elisp... and the fact that every time you restart shen-elisp you have to re-declare types. However I abandoned the idea for 2 reasons: - Plain elisp is faster: I don't know the implications
- I wanted to focus on elisp so I can contribute better to other elisp projects
---- references [1] https://github.com/zwild/ammonite-term-repl
[2] https://github.com/spellcard199/ammonite-term-repl-completion
[3] https://github.com/deech/shen-elisp
[4] http://kitchingroup.cheme.cmu.edu/blog/2017/07/08/Adding-numerical-methods-to-emacs-with-dynamic-modules/
[5] https://mrosset.github.io/emacs-module/
No comments yet.