summaryrefslogtreecommitdiffhomepage
path: root/init.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-10-24 00:09:58 +0100
committerjao <jao@gnu.org>2021-10-24 00:09:58 +0100
commitddaedd037d689af3e11bf2d86b7e4d32bd981c4d (patch)
treef075c3dc84dd09a2510c3bc365f102dd8e081a09 /init.org
parent78b83125d08b974e9025f2a2c51f485235ea5d91 (diff)
downloadelibs-ddaedd037d689af3e11bf2d86b7e4d32bd981c4d.tar.gz
elibs-ddaedd037d689af3e11bf2d86b7e4d32bd981c4d.tar.bz2
el-spice is too intrusive, let's keep only the good bits
Diffstat (limited to 'init.org')
-rw-r--r--init.org63
1 files changed, 52 insertions, 11 deletions
diff --git a/init.org b/init.org
index 7eed54f..ff51dc3 100644
--- a/init.org
+++ b/init.org
@@ -2225,18 +2225,59 @@
#+begin_src emacs-lisp
(use-package edit-list :ensure t)
(use-package package-lint :ensure t)
- (use-package el-spice
- :ensure t
-
- :init (setq el-spice-lighter "")
- :config
- (add-hook 'emacs-lisp-mode-hook 'el-spice-mode)
- (add-hook 'lisp-interaction-mode-hook 'el-spice-mode)
- (define-key el-spice-mode-map (kbd "C-c C-c") nil)
- (define-key el-spice-mode-map (kbd "C-c C-l") nil)
- (define-key el-spice-mode-map (kbd "C-c l") nil)
- (define-key el-spice-mode-map (kbd "C-c C-z") nil))
+ (defun elisp-disassemble (function)
+ (interactive (list (function-called-at-point)))
+ (disassemble function))
+
+ (defun elisp-pp (sexp)
+ (with-output-to-temp-buffer "*Pp Eval Output*"
+ (pp sexp)
+ (with-current-buffer standard-output
+ (emacs-lisp-mode))))
+
+ (defun elisp-macroexpand (form)
+ (interactive (list (form-at-point 'sexp)))
+ (elisp-pp (macroexpand form)))
+
+ (defun elisp-macroexpand-all (form)
+ (interactive (list (form-at-point 'sexp)))
+ (elisp-pp (cl-macroexpand-all form)))
+
+ (defun elisp-find-definition (name)
+ (interactive (list (thing-at-point 'symbol)))
+ (cond (name
+ (let ((symbol (intern-soft name))
+ (search (lambda (fun sym)
+ (let* ((r (save-excursion (funcall fun sym)))
+ (buffer (car r))
+ (point (cdr r)))
+ (cond ((not point)
+ (error "Found no definition for %s in %s"
+ name buffer))
+ (t
+ (switch-to-buffer buffer)
+ (goto-char point)
+ (recenter 1)))))))
+ (cond ((fboundp symbol)
+ (xref-push-marker-stack)
+ (funcall search 'find-function-noselect symbol))
+ ((boundp symbol)
+ (xref-push-marker-stack)
+ (funcall search 'find-variable-noselect symbol))
+ (t
+ (message "Symbol not bound: %S" symbol)))))
+ (t (message "No symbol at point"))))
+
+ (use-package emacs-lisp
+ :bind (:map emacs-lisp-mode-map
+ (("C-c C-m" . elisp-macroexpand)
+ ("C-c C-M" . elisp-macroexpand-all)
+ ("C-c C-k" . elisp-bytecompile-and-load)
+ ("C-c C-p" . pp-eval-last-sexp)
+ ("M-." . elisp-find-definition)
+ ("M-," . pop-tag-mark)
+ ("C-c <" . lc-show-package-summary))))
#+end_src
*** Erlang
#+begin_src emacs-lisp