mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-04 19:29:37 +00:00
Enhance fix-expansion to take surrounding let bindings into account
This commit is contained in:
parent
65caa3b423
commit
64ffdb6863
1 changed files with 13 additions and 3 deletions
|
@ -81,9 +81,19 @@
|
|||
(goto-char (match-beginning 0))
|
||||
(let ((decl (read (current-buffer))))
|
||||
(kill-sexp)
|
||||
(let ((use-package-verbose 'errors)
|
||||
(use-package-expand-minimally t))
|
||||
(insert ?\n ?\` (pp-to-string (macroexpand-1 decl))))))))
|
||||
(let (vars)
|
||||
(catch 'exit
|
||||
(save-excursion
|
||||
(while (ignore-errors (backward-up-list) t)
|
||||
(when (looking-at "(let\\s-+")
|
||||
(goto-char (match-end 0))
|
||||
(setq vars (read (current-buffer)))
|
||||
(throw 'exit t)))))
|
||||
(eval
|
||||
`(let (,@ (append vars
|
||||
'((use-package-verbose 'errors)
|
||||
(use-package-expand-minimally t))))
|
||||
(insert ?\n ?\` (pp-to-string (macroexpand-1 decl))))))))))
|
||||
|
||||
(bind-key "C-c C-u" #'fix-expansion emacs-lisp-mode-map)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue