zoliky · 2022-12-08 11:56
Hello,
I just started reading "An Introduction to Programming in Emacs Lisp."
https://www.gnu.org/software/emacs/manual/html_node/eintr/index.html
For now I have the rainbow parentheses package installed but I was wondering if there are other useful packages for learning elisp.
thetemp_ · 2022-12-08 12:54
[Vlog: Emacs is my "favourite Emacs package"](https://www.youtube.com/watch?v=RiXK7NALgRs)
Seriously though. It's already got everything you need. Rainbow-parentheses is cool, but `show-paren-mode` is already built-in.
One external package I might recommend (though I haven't actually used it in a while myself) is `aggressive-indent`. It indents everything as it should be indented, as soon as you edit a line. This makes it plainly obvious when you've got one or more parentheses in the wrong places.
Also, the built-in `electric-pair-mode` is great. You might need to tweak the settings a little to get it to work the way you want, but it's very helpful.
deaddyfreddy · 2022-12-08 15:24
(use-package lisp
:hook
(after-save . check-parens))
(use-package elisp-mode
:bind
(:map emacs-lisp-mode-map
("C-c C-d C-d" . describe-function)
("C-c C-d d" . describe-function)
("C-c C-k" . eval-buffer)))
(use-package highlight-defined
:ensure t
:custom
(highlight-defined-face-use-itself t)
:hook
(help-mode . highlight-defined-mode)
(emacs-lisp-mode . highlight-defined-mode))
(use-package highlight-quoted
:ensure t
:hook
(emacs-lisp-mode . highlight-quoted-mode))
(use-package highlight-sexp
:quelpa
(highlight-sexp :repo "daimrod/highlight-sexp" :fetcher github :version original)
:hook
(clojure-mode . highlight-sexp-mode)
(emacs-lisp-mode . highlight-sexp-mode)
(lisp-mode . highlight-sexp-mode))
(use-package eros
:ensure t
:hook
(emacs-lisp-mode . eros-mode))
(use-package suggest
:ensure t
:defer t)
(use-package ipretty
:defer t
:ensure t
:config
(ipretty-mode 1))
(use-package nameless
:ensure t
:hook
(emacs-lisp-mode . nameless-mode)
:custom
(nameless-global-aliases '())
(nameless-private-prefix t))
(use-package erefactor
:ensure t
:defer t)
(use-package flycheck-package
:ensure t
:hook
(emacs-lisp-mode . flycheck-package-setup))
(use-package elsa
:defer t
:ensure t)
(use-package flycheck-elsa
:ensure t
:hook
(emacs-lisp-mode . flycheck-elsa-setup))
arthurno1 · 2022-12-08 15:25
Learn how to use built-in stuff: edebug, built-in elisp manucal (C-h i) and C-h f/v are your best friends. Built-in electric-pair-mode, eldoc-mode and fill-mode are very useful.
Outside packages I use: paredit, speed-of-thought-lisp, lisp-extra-font-lock, macrostep, company, helm + many helm addons ), expand-region and yasnippet are probably ones I use most.
A few snippets I find useful on an everyday basis:
;; From: https://emacs.wordpress.com/2007/01/17/eval-and-replace-anywhere/
(defun fc-eval-and-replace ()
"Replace the preceding sexp with its value."
(interactive)
(backward-kill-sexp)
(condition-case nil
(prin1 (eval (read (current-kill 0)))
(current-buffer))
(error (message "Invalid expression")
(insert (current-kill 0)))))
;; https://stackoverflow.com/questions/2171890/emacs-how-to-evaluate-the-smallest-s-expression-the-cursor-is-in-or-the-follow
(defun eval-next-sexp ()
(interactive)
(save-excursion
(forward-sexp)
(eval-last-sexp nil)))
;; this works sometimes
(defun eval-surrounding-sexp (levels)
(interactive "p")
(save-excursion
(up-list (abs levels))
(eval-last-sexp nil)))
Make your self also some shortcuts you find easy to remember and use. These are what I find useful:
(defkeys emacs-lisp-mode-map
"\C-c a" emacs-lisp-byte-compile-and-load
"\C-c b" emacs-lisp-byte-compile
"\C-c c" emacs-lisp-native-compile-and-load
"\C-c d" eval-defun
"\C-c e" eval-buffer
"\C-c r" eval-region
"\C-c l" eval-last-sexp
"\C-c n" eval-next-sexp
"\C-c i" reindent-buffer
"\C-c p" fc-eval-and-replace
"\C-c s" eval-surrounding-sexp)
But don't put too much time on chasing packages. There is a lot of built-in stuff you can use.
If you are learning Emacs Lisp, I can also recommend this year's [Advent of Code](https://adventofcode.com/).
00-11 · 2022-12-08 18:17
Not a list of packages, but for learning Elisp this might help:
https://www.emacswiki.org/emacs/LearnEmacsLisp
github-alphapapa · 2022-12-09 05:39
I can recommend `prism`, `topsy`, `highlight-function-calls`, `lispy`, and `aggressive-indent`. My Elisping would be much less enjoyable without them.
For more, look at my config here: https://github.com/alphapapa/ap.el