[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/inf-clojure abb5a53 017/313: Add macroexpand command
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/inf-clojure abb5a53 017/313: Add macroexpand command |
Date: |
Wed, 11 Aug 2021 09:59:37 -0400 (EDT) |
branch: elpa/inf-clojure
commit abb5a53e68ded09353873855d0b1d98568d2c4e6
Author: Bozhidar Batsov <bozhidar@batsov.com>
Commit: Bozhidar Batsov <bozhidar@batsov.com>
Add macroexpand command
---
inf-clojure.el | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/inf-clojure.el b/inf-clojure.el
index 78a0d1a..d126f4e 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -101,6 +101,7 @@ mode. Default is whitespace followed by 0 or 1
single-letter colon-keyword
(define-key map "\C-c\C-s" 'clojure-show-var-source)
(define-key map "\C-c\C-i" 'clojure-show-ns-vars)
(define-key map "\C-c\C-A" 'clojure-apropos)
+ (define-key map "\C-c\C-m" 'clojure-macroexpand)
map))
;;;###autoload
@@ -407,6 +408,12 @@ Used by this command to determine defaults."
(println (str var)))\n"
"Command to invoke apropos.")
+(defvar clojure-macroexpand-command
+ "(clojure.core/macroexpand '%s)\n")
+
+(defvar clojure-macroexpand-1-command
+ "(clojure.core/macroexpand-1 '%s)\n")
+
;;; Ancillary functions
;;; ===================
@@ -478,6 +485,19 @@ See variable `clojure-apropos-command'."
(interactive (clojure-symprompt "Var apropos" (clojure-var-at-pt)))
(comint-proc-query (inf-clojure-proc) (format clojure-apropos-command var)))
+(defun clojure-macroexpand (&optional macro-1)
+ "Send a command to the inferior Clojure to give apropos for VAR.
+See variable `clojure-macroexpand-command'.
+With a prefix arg MACRO-1 uses `clojure-macroexpand-1-command'."
+ (interactive "P")
+ (let ((last-sexp (buffer-substring-no-properties (save-excursion
(backward-sexp) (point)) (point))))
+ (comint-send-string
+ (inf-clojure-proc)
+ (format (if macro-1
+ clojure-macroexpand-1-command
+ clojure-macroexpand-command)
+ last-sexp))))
+
;; "Returns the current inferior Clojure process.
;; See variable `inf-clojure-buffer'."
- [nongnu] elpa/inf-clojure f65ce48 021/313: Enable completion in inf-clojure-minor-mode, (continued)
- [nongnu] elpa/inf-clojure f65ce48 021/313: Enable completion in inf-clojure-minor-mode, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 7b9e0d1 029/313: Code style, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ef8c830 030/313: Use #' where appropriate, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure b897bb8 031/313: Show arglist in the minibuffer for better usability, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 89035ee 033/313: Merge pull request #9 from mavbozo/ms-windows-hang, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure dd2b4fc 038/313: Code style, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 898a319 041/313: Improve the README a bit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ff20773 044/313: Release 1.2.0, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0652692 012/313: Preprocess the output from interactive commands, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 85d3d41 014/313: Extract a chomp helper, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure abb5a53 017/313: Add macroexpand command,
ELPA Syncer <=
- [nongnu] elpa/inf-clojure 3c2a1ed 022/313: Rename switch-to-clojure to inf-clojure-switch-to-repl, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure f00b2b5 026/313: Add a menu for inf-clojure-minor-mode, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 0d5f715 027/313: Unify the style of the REPL and minor mode menus, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 9a0323d 028/313: [Fix #4] Start subprocess in the root of lein and boot projects, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure b2d6d0e 009/313: Add a command to show a var's source, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 52f9404 016/313: Add apropos command, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure ecf614e 018/313: Use inf-clojure prefix consistently, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure 2627825 025/313: Move inf-clojure-mode menu definition, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure de88e4f 032/313: Solution to unresponsive repl in Windows OS, ELPA Syncer, 2021/08/11
- [nongnu] elpa/inf-clojure c3a9283 035/313: Use #' in the keymaps, ELPA Syncer, 2021/08/11