Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lispy.el (lispy-unbind-variable): Call iedit-update-occurrences #607

Open
wants to merge 223 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
0a7d457
lispy.el (lispy-unbind-variable): Call iedit-update-occurrences
papercatlol Sep 20, 2021
06fd624
le-lisp.el (lispy--eval-lisp): Don't use with-current-buffer for SLIME
abo-abo Sep 16, 2021
7fe0803
lispy-test.el (lispy-eval-other-window): Rewrite test
abo-abo Sep 17, 2021
d188986
le-lisp.el (lispy--eval-lisp): In case both out and val are empty, pr…
abo-abo Sep 18, 2021
183bf96
lispy.el (lispy-kill-at-point): Kill lists first in text-mode
abo-abo Sep 19, 2021
b752780
lispy.el (lispy-colon-no-space-regex): Add slime-repl-mode
abo-abo Sep 20, 2021
fc8ef52
lispy.el (lispy--setq-expression): Improve for pcase
abo-abo Sep 21, 2021
55ddbeb
lispy.el (lispy--setq-expression): Replace lispy--read with read
abo-abo Sep 22, 2021
a0d762f
lispy-python.py (print_elisp): collections.abc.KeysView
abo-abo Oct 20, 2021
b8dd0f7
le-clojure.el (lispy-clojure-complete-at-point): Update
abo-abo Oct 28, 2021
b40c285
lispy.el (lispy-font-lock-keywords): Add
abo-abo Oct 29, 2021
607ba21
lispy.el (lispy-colon-no-space-regex): Update
abo-abo Oct 30, 2021
f7207c4
lispy.el (lispy-goto-symbol): Use xref for Emacs 27.2
abo-abo Oct 31, 2021
9590115
lispy.el (lispy--eval-dwim): Add outline-p
abo-abo Nov 1, 2021
8fe6087
lispy.el (lispy--print-object): Extract
abo-abo Nov 2, 2021
f978177
Make the imenu function customizable to drop dependency on counsel
akirak Oct 6, 2021
3a067fa
Drop the dependency on counsel
akirak Oct 6, 2021
c6b75ca
Fix lispy-multiline for commas in Clojure
markgdawson Sep 20, 2021
8e097b5
lispy.el (lispy--read): Decouple hy-mode and lispy-clojure-modes
abo-abo Dec 30, 2021
fe673f6
lispy.el (lispy-kill): Fix kill when line ends in a comma
abo-abo Dec 30, 2021
f59eb20
Move lispy-occur to lispy-occur.el
aaronjensen Dec 31, 2021
ce9dffa
lispy.el: Autoload lispy-occur
abo-abo Jan 2, 2022
5dfef4d
le-clojure.el (lispy-clojure-complete-at-point): Remove dependency on…
abo-abo Jan 2, 2022
147a572
lispy-clojure.clj (use-package): Remove
abo-abo Jan 3, 2022
8ead3f7
lispy.el (lispy-kill): Fix for braces in Elisp
abo-abo Jan 3, 2022
4209b59
le-clojure.el (lispy--eval-clojure-1): Simplify
abo-abo Jan 5, 2022
82443dd
le-clojure.el (lispy--eval-clojure-1): Update
abo-abo Jan 6, 2022
aa666b1
le-clojure.el (lispy--eval-clojure-context): Check for Babashka
abo-abo Jan 7, 2022
13d4c65
le-clojure.el (lispy-clojure-middleware-tests): Default to nil
abo-abo Jan 7, 2022
207dac9
le-clojure.el: Support cider-connect for Babashka
abo-abo Jan 7, 2022
08c2181
le-clojure.el (lispy--clojure-middleware-load): Clean up pomegranate
abo-abo Jan 7, 2022
60cddea
le-clojure.el (lispy--clojure-babashka-p): Extract/fix
abo-abo Jan 10, 2022
c7d2513
lispy-python.py (jedi_completions): Fix API change by Jedi
abo-abo Jan 10, 2022
26fddc4
lispy.el (lispy--idx-from-list): Extract
abo-abo Jan 13, 2022
964ca2e
le-clojure.el: Allow to select element in a for loop
abo-abo Jan 14, 2022
baa12de
le-clojure.el (lispy--eval-clojure-context): Refactor
abo-abo Jan 15, 2022
e4421c7
le-clojure.el (lispy--clojure-debug-step-in): Attach sesman session
abo-abo Jan 16, 2022
547677b
lispy-python.py: Fix error in Autocall repr
abo-abo Jan 17, 2022
defddf9
lispy-python.py (argspec): Use info.getfullargspec
abo-abo Jan 18, 2022
9d6ee03
lispy.el (lispy-message): Add ansi-color-apply
abo-abo Jan 25, 2022
8ed6373
le-clojure.el (lispy--clojure-process-buffer): Adapt for org
abo-abo Feb 3, 2022
8a2b5b9
le-clojure.el (lispy--eval-clojure-context): Add pp for lispy-eval-cu…
abo-abo Feb 4, 2022
e32572c
le-clojure.el (lispy--clojure-debug-step-in): No need for reval
abo-abo Feb 5, 2022
0a14230
lispy.el (lispy-meta-return): Improve
abo-abo Feb 6, 2022
7f1c8f9
lispy.el (lispy-eval-single-outline): Don't print output if outline e…
abo-abo Feb 7, 2022
a8ff4a7
lispy.el (lispy--print-object): More general pred
abo-abo Feb 8, 2022
b310b15
le-python.el (lispy--python-proc): Move cond
abo-abo Mar 8, 2022
62e8124
le-python.el (lispy--eval-python): Get rid of \r
abo-abo Mar 8, 2022
5eb4087
le-python.el (lispy-python-middleware-file): Add
abo-abo Mar 9, 2022
395192e
le-python.el (lispy--python-debug-step-in): Improve goto functionality
abo-abo Mar 9, 2022
cbf7ff6
le-python.el (lispy--python-middleware-load): stty -echo
abo-abo Mar 9, 2022
aec22b5
lispy-clojure.clj (ns-location): Add
abo-abo Mar 9, 2022
3848716
le-clojure.el (lispy--eval-clojure-context): Wrap with-shadows
abo-abo Mar 9, 2022
f0a23d6
lispy-python.py (chdir): Add
abo-abo Mar 9, 2022
fe3461d
lispy.el (lispy-backward-kill-word): Improve
abo-abo Mar 9, 2022
15f48d2
le-python.el: Update
abo-abo Mar 9, 2022
01d6176
lispy.el: Update
abo-abo Mar 9, 2022
fc5d1c6
le-python.el (lispy--python-proc): Add extra python-shell-interpreter…
abo-abo Mar 14, 2022
8f93634
le-python.el (lispy--python-nth-element): Improve
abo-abo Mar 14, 2022
0d4841b
le-python.el (lispy--python-eval-string-dwim): Ignore tripple quoted …
abo-abo Mar 14, 2022
7f4b117
le-python.el (lispy--python-args): Update
abo-abo Mar 14, 2022
e726592
le-python.el (lispy--python-debug-step-in): Add step_into_module_maybe
abo-abo Mar 14, 2022
0918047
le-python.el (lispy--python-middleware-load): Accommodate dir-local m…
abo-abo Mar 14, 2022
e314ec5
le-python.el (lispy--python-nth-element): Allow tuples
abo-abo Mar 28, 2022
cb8af18
lispy.el (lispy-eval-single-outline): Use lispy-message
abo-abo Mar 28, 2022
41ad35d
le-python.el (lispy--python-print): Use lp.pprint for "2e"
abo-abo Mar 28, 2022
04c077e
le-python.el (lispy-goto-symbol-python): Improve
abo-abo Mar 28, 2022
50e6aa3
le-python.el (lispy--python-nth): Extract
abo-abo Mar 28, 2022
259c6e9
le-python.el (lispy-set-python-process-action): Simplify
abo-abo Mar 31, 2022
7b8806e
le-python.el (lispy-short-process-name): Better names for comint
abo-abo Mar 31, 2022
04e0481
le-python.el (lispy--py-to-el): Add
abo-abo Mar 31, 2022
c3ed431
le-python.el (lispy-python-buf): Use instead of lispy-python-proc
abo-abo Apr 17, 2022
2f6ccfd
lispy.el (lispy--insert-eval-result): Update
abo-abo Apr 17, 2022
68252d2
lispy.el (lispy-eval-other-window): Print error message
abo-abo Apr 17, 2022
dd1a147
lispy.el: Swap "g" and "G"
abo-abo Apr 17, 2022
f1f7320
le-python.el (lispy--python-eval-string-dwim): Bind generators
abo-abo Apr 17, 2022
ba4f038
le-python.el: Make "xp" possible to attach to pdb
abo-abo Apr 22, 2022
f95d08f
le-python.el (lispy-python-completion-at-point): Complete imports not…
abo-abo Apr 22, 2022
bf7ba65
lispy-python.py (chfile): Add
abo-abo Apr 22, 2022
db49e5a
le-python.el (lispy--python-middleware-load): Fix missing import
abo-abo Apr 22, 2022
e463ca4
lispy-python.py (top_level): Handle being inside pdb
abo-abo Apr 22, 2022
b9fbe2d
lispy-python.py (definitions): Add
abo-abo Apr 22, 2022
aaf7571
lispy-python.py (get_completions): Add
abo-abo Apr 22, 2022
dda9d88
lispy-python.py (reload): Add
abo-abo Apr 22, 2022
f520d01
lispy-python.py (pp1): Change width to 200
abo-abo Apr 22, 2022
1562b8f
le-python.el (lispy-extended-eval-str): Update regex
abo-abo May 17, 2022
5f0b0bb
le-python.el (lispy-eval-python-str): Support walrus operator
abo-abo May 17, 2022
593e1c5
le-python.el (lispy-python-interaction-mode): Add
abo-abo May 17, 2022
b73b299
le-python.el (lispy-set-python-process-action): Update
abo-abo May 17, 2022
83a9eb2
le-python.el (lispy-python-process-regexes): Update
abo-abo May 17, 2022
003840b
le-python.el (lispy-short-process-name): Update
abo-abo May 17, 2022
247aa3b
le-python.el (lispy--python-eval-string-dwim): Capture tuple assignment
abo-abo May 17, 2022
2f9f59b
le-python.el (lispy--python-debug-step-in): Move step_into_module_may…
abo-abo May 17, 2022
f1e501b
lispy-python.py (print_elisp): Add fallback
abo-abo May 17, 2022
c473f98
lispy.el (lispy--insert-eval-result): Update
abo-abo May 17, 2022
202ad22
lispy.el (lispy--eval): Add lispy-ignore-whitespace
abo-abo May 17, 2022
4cbe567
lispy.el (lispy-eval-expression-history): Add
abo-abo May 17, 2022
f93d524
lispy-python.py (step_into_module_maybe): Update
abo-abo May 17, 2022
00ca5ea
lispy-python.py: Fix linter warnings
abo-abo May 23, 2022
169df2e
le-python.el (lispy--python-debug-step-in): Update
abo-abo May 23, 2022
e826c15
le-python.el (lispy--python-arglist): Update
abo-abo May 23, 2022
8ec775d
lispy.el (lispy-message): Limit pp-buffer
abo-abo May 23, 2022
72863d7
lispy.el (lispy-no-indent-modes): Extend for Emacs 28.1
abo-abo May 23, 2022
f6c7c68
lispy.el (lispy-last-message): Add
abo-abo May 26, 2022
d0aeab7
le-js.el: Add support for JavaScript via Indium
abo-abo Jul 24, 2022
df2f69a
lispy.el (lispy--eval): Require handler first
abo-abo Jul 24, 2022
e296c14
lispy.el (lispy--setq-expression): Handle cl-destructuring-bind better
abo-abo Jul 24, 2022
497e758
le-python.el (lispy-eval-python-str): Improve walrus
abo-abo Jul 24, 2022
9c5b949
le-python.el (lispy--python-eval-string-dwim): Add handler for pytest…
abo-abo Jul 24, 2022
7919fd0
le-python.el (lispy--python-arg-key-re): Make more generic
abo-abo Jul 24, 2022
8e58bf3
le-python.el (lispy-extended-eval-str): Fixup
abo-abo Aug 3, 2022
915bf48
le-python.el (lispy--python-proc): Comment out annoyance
abo-abo Aug 4, 2022
b4169f4
le-python.el (lispy--python-proc): Wait for 0.1s for Python to potent…
abo-abo Aug 4, 2022
fdc3a17
lispy-python.py (arglist_jedi): Update
abo-abo Aug 4, 2022
6f49e25
le-python.el: Use jedi.Script.goto
abo-abo Aug 4, 2022
fbcb224
lispy-python.py (definitions): Improve
abo-abo Aug 4, 2022
e06a283
le-python.el: Update sys.modules["__repl__"]
abo-abo Aug 4, 2022
b9263ce
lispy-python.py (goto_definition): Print path string
abo-abo Aug 9, 2022
f0f5b60
le-python.el (lispy-extended-eval-str): Disable
abo-abo Aug 9, 2022
7b97aa8
le-python.el (lispy--python-eval-string-dwim): ignore-errors
abo-abo Aug 9, 2022
665906f
lispy-python.py: WIP jedi workaround
abo-abo Aug 9, 2022
80677ba
test/test_lispy-python.py: Add
abo-abo Aug 9, 2022
c2ee7c8
lispy-python.py (wrap_return): Add
abo-abo Aug 9, 2022
d9f84ce
lispy-python.py (wrap_return): Bind __result__
abo-abo Aug 9, 2022
58375dd
lispy-python.py (ast_call): Add
abo-abo Aug 10, 2022
da869a6
lispy-python.py (ast_call): Take non-string args too
abo-abo Aug 10, 2022
e34ef10
lispy-python.py (translate_assign): Add
abo-abo Aug 10, 2022
5e73188
lispy-python.py (translate_assign): Operate on ast.Expr
abo-abo Aug 10, 2022
5355a12
le-python.el (lispy--python-eval-string-dwim): Remove super()
abo-abo Aug 10, 2022
414b329
le-python.el (lispy--python-goto-definition): save-buffer
abo-abo Aug 10, 2022
89e085b
lispy-python.py: Print "(ok)" in case nothing was printed
abo-abo Aug 10, 2022
5f47f6c
le-python.el (lispy--eval-python): Send multiline statements via file
abo-abo Aug 10, 2022
3464a05
le-python.el (lispy--eval-python): Add back arg
abo-abo Aug 10, 2022
3c18ed7
lispy-python.py (mapcar): Remove
abo-abo Aug 10, 2022
6527f5c
lispy-python.py (eval_code): Handle __fname__
abo-abo Aug 10, 2022
dca9177
le-python.el (lispy--python-middleware-load): Use python-shell-send-s…
abo-abo Aug 10, 2022
fbc9aad
le-python.el (lispy--eval-python-plain): Add
abo-abo Aug 10, 2022
f23a988
le-python.el (lispy--eval-python): Fix issues with Python code parsing
abo-abo Aug 12, 2022
2f15fc1
lispy-python.py (eval_code): Print all newly bound variables
abo-abo Aug 12, 2022
0e6aaec
Fix mypy warnings
abo-abo Aug 12, 2022
09743ed
lispy-python.py (goto_link_definition): Add
abo-abo Aug 16, 2022
f3167ca
lispy-python.py (eval_code): Add "echo" env
abo-abo Aug 17, 2022
aacf7cc
lispy-python.py (eval_code): Add tr_returns and tests
abo-abo Aug 17, 2022
32bdcb5
test/test_lispy-python.py: Remove capfd fixture
abo-abo Aug 17, 2022
4652019
test/test_lispy-python.py: Prettier tests
abo-abo Aug 17, 2022
0dd8c30
lispy-python.py (tr_print_last_expr): Translate assert
abo-abo Aug 17, 2022
f105a26
lispy-python.py: Split output and binds
abo-abo Aug 18, 2022
e8ca1da
lispy-python.py (eval_code): Split away last expr and attempt to eval it
abo-abo Aug 18, 2022
27ef4f8
mypy.ini: Update
abo-abo Aug 18, 2022
c395c9d
test/test_lispy-python.py (test_translate_return_3): Add
abo-abo Aug 18, 2022
b0b1363
le-python.el (lispy--eval-python): Read strings so that they're not q…
abo-abo Aug 18, 2022
bddd37d
le-python.el (lispy--python-debug-step-in): Fix
abo-abo Aug 18, 2022
a89644b
lispy-python.py: Implement a basic "x in xs" select logic
abo-abo Aug 18, 2022
c223500
lispy-python.py: Implement a more flexible "x in ..." logic
abo-abo Aug 18, 2022
5d5a4bd
lispy-python.py: Clean up unused code
abo-abo Aug 18, 2022
66f9624
le-python.el (lispy-python-completion-at-point): Fixup
abo-abo Aug 19, 2022
b7eff1b
test/test_lispy-python.py (test_eval_bind_vars_2): Add test
abo-abo Aug 19, 2022
74f2efd
lispy-python.py: Add some type annotations
abo-abo Aug 19, 2022
7a58889
lispy-python.py (eval_code): Refactor
abo-abo Aug 19, 2022
35d8a86
lispy-python.py: Echo symbols internal to eval_code
abo-abo Aug 19, 2022
8ee2b73
le-python.el (lispy--eval-python): Workaround uncaptures subprocess o…
abo-abo Aug 19, 2022
26ebc8b
test/test_lispy-python.py (test_eval_in_3): Add
abo-abo Aug 19, 2022
fda45c4
lispy-python.py: Increase repr to 200
abo-abo Aug 26, 2022
5f10ebd
lispy-python.py: Change print_fn based on echo
abo-abo Aug 26, 2022
30cbbcf
lispy-python.py (eval_code): Report more error info and save last err…
abo-abo Aug 26, 2022
2c03948
lispy-python.py (generate_import): Add
abo-abo Aug 26, 2022
874ac0b
lispy-python.py (print_elisp): Add "to_dict"
abo-abo Sep 1, 2022
7c18257
lispy.el (lispy-message): Disable pp-buffer
abo-abo Sep 1, 2022
fc22578
le-python.el (lispy--python-proc): Custom name based on python-shell-…
abo-abo Sep 1, 2022
e73db3d
lispy-python.py (pprint): Don't quote strings
abo-abo Sep 1, 2022
a4f9784
le-python.el (lispy-goto-symbol-python): Simplify
abo-abo Sep 1, 2022
f66a3c5
le-python.el (lispy--python-proc): Broader regex
abo-abo Sep 1, 2022
0288bdf
lispy-python.py (pprint): Revert to quoting strings
abo-abo Sep 1, 2022
1f5c0d2
le-python.el (lispy-eval-python-bnd): Return annotation plus function…
abo-abo Sep 5, 2022
c4cf7b2
test/test_lispy-python.py (test_eval_in_pytest_1): Add
abo-abo Sep 5, 2022
80cf483
lispy-python.py (print_elisp): Add null check
abo-abo Sep 6, 2022
c308a79
le-python.el (lispy--python-proc): Adjust naming once more
abo-abo Sep 6, 2022
7b4666e
le-python.el (lispy--eval-python): Copy fstr on arg=3
abo-abo Sep 6, 2022
9923f26
lispy-newline-and-indent: account for geiser-repl-mode
leungbk Aug 17, 2022
9647fba
lispy-inline.el (lispy--describe-inline): Add arg
abo-abo Sep 10, 2022
3bcd755
lispy-inline.el (lispy--describe-inline): Add pos arg
abo-abo Sep 10, 2022
4aaaec7
Makefile: Mark test as .PHONY
abo-abo Sep 10, 2022
3c69f7c
lispy-test.el (lispy-extended-eval-str): Comment out failing test
abo-abo Sep 11, 2022
d716b29
lispy-test.el: Fixup tests
abo-abo Sep 12, 2022
025d7b3
`lispy-eval': support the `geiser-repl'
nbfalcon Feb 19, 2021
64a65a3
Enable lispy-bind-variable for clojure-script
gmichokostas Oct 3, 2021
fdedfaf
Fix parinfer theme's TAB in eval-expression
daanturo Apr 27, 2022
b337228
lispy-python.py (chfile): Set __name__
abo-abo Oct 28, 2022
55b2b07
lispy-python.py (yaml_definitions): Add "g" support for yaml
abo-abo Oct 28, 2022
d143952
lispy-python.py (get_completions): Improve
abo-abo Oct 28, 2022
760506a
le-python.el: "xp" works on a wider range of buffers
abo-abo Oct 28, 2022
3b6fbac
lispy-python.py (setup): Add to simplify in-Docker setup
abo-abo Oct 28, 2022
e9b24c6
le-python.el (lispy--eval-python): Make "\n" eval work
abo-abo Nov 2, 2022
dfe47ff
lispy-python.py (eval_code): Use empty locals()
abo-abo Nov 2, 2022
2fc2cfb
lispy-python.py: Use eval and exec with the proper frame when testing
abo-abo Nov 6, 2022
174d4e4
lispy-python.py (eval_code): Make "x in xs" an optional feature via "…
abo-abo Nov 6, 2022
7866991
le-python.el (lispy--eval-python-old): Rename
abo-abo Nov 6, 2022
17ef99f
le-python.el (lispy--eval-python): Add use-in-expr
abo-abo Nov 6, 2022
cea8473
lispy-python.py (get_import_name): Add
abo-abo Nov 14, 2022
ac5bccb
lispy-python.py (eval_code): Skip exec if no code
abo-abo Nov 14, 2022
2e0e798
lispy-python.py (eval_code): Use exec instead of eval only on SyntaxE…
abo-abo Nov 14, 2022
c630e0f
lispy-python.py (eval_code): Clean up
abo-abo Nov 14, 2022
ce1488c
le-python.el (lispy--python-poetry-name): Add
abo-abo Nov 14, 2022
822ba9c
le-python.el (lispy-python-completion-at-point): Works for non-string…
abo-abo Nov 14, 2022
fef1c7b
le-python.el (lispy--eval-python): Add output when signalling the error
abo-abo Nov 14, 2022
a61f4d0
le-python.el (lispy--python-proc): Adjust default-directory for poetry
abo-abo Dec 25, 2022
37e5b9d
lispy-python.py (chfile): Update
abo-abo Jan 12, 2023
b6744ff
le-python.el (lispy--python-poetry-name): Update
abo-abo Jan 12, 2023
263c7eb
lispy-python.py (setup): Use tl.f_globals
abo-abo Jan 12, 2023
ca3d416
lispy-python.py: Print a warning if we can't load jedi
abo-abo Mar 2, 2023
34b2727
lispy-python.py (print_elisp): Improve and add test
abo-abo Mar 2, 2023
a20bf01
lispy.el (lispy-kill-at-point-hook): Add
abo-abo Mar 2, 2023
8d1939c
lispy-python.py (reload): Return the module
abo-abo Mar 2, 2023
21695b7
lispy-python.py: Use f_locals before f_globals
abo-abo Mar 2, 2023
7a27139
le-python.el: Find lispy--python-middleware-file better
abo-abo Mar 2, 2023
140c2e9
le-python.el (lispy--dict): Update
abo-abo Mar 2, 2023
ee1183b
le-python.el (lispy--eval-python): 3e will select first element witho…
abo-abo Mar 2, 2023
666835e
le-python.el (lispy-python-completion-at-point): Skip to LISP
abo-abo Mar 2, 2023
f95ad8c
le-python.el: Send the middleware base64 encoded to remote sessions
abo-abo Mar 2, 2023
db5546c
lispy-python.py: Update
abo-abo Mar 10, 2023
6542f07
lispy--read: support clisp special character names
RuijieYu Dec 7, 2022
c3f791f
lispy--read: fix for special CL characters (#\Newline etc)
papercatlol Dec 5, 2024
fa80bd6
lispy-quote: don't insert space after CL reader macro
papercatlol Dec 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cookbook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def test(recipe):
return ["pytest test/test_lispy-python.py"]

def typecheck(recipe):
return "dmypy run -- lispy-python.py"

# del typecheck
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ clojure:
clean:
rm -f *.elc

.PHONY: all clean elisp check-declare
.PHONY: all clean elisp check-declare test
134 changes: 60 additions & 74 deletions le-clojure.el
Original file line number Diff line number Diff line change
Expand Up @@ -68,34 +68,57 @@
"Nil if the Clojure middleware in \"lispy-clojure.clj\" wasn't loaded yet.")

(defun lispy--clojure-process-buffer ()
(let ((cur-type (cider-repl-type-for-buffer)))
(car (cider-repls cur-type nil))))
(if (or org-src-mode (eq major-mode 'org-mode))
(cadr (first (sesman--all-system-sessions 'CIDER)))
(let ((cur-type (cider-repl-type-for-buffer)))
(car (cider-repls cur-type nil)))))

(defun lispy--clojure-middleware-loaded-p ()
(let ((conn (lispy--clojure-process-buffer)))
(and conn (gethash conn lispy--clojure-middleware-loaded-hash))))

(defun lispy--clojure-babashka-p ()
(ignore-errors (cider--babashka-version)))

(defun lispy--eval-clojure-context (e-str)
(cond
((eq major-mode 'clojurescript-mode)
((or (eq major-mode 'clojurescript-mode)
(lispy--clojure-babashka-p))
e-str)
((string-match-p "#break" e-str)
e-str)
((lispy--clojure-middleware-loaded-p)
(format (if (memq this-command '(special-lispy-eval
special-lispy-eval-and-insert))
"(lispy.clojure/pp (lispy.clojure/reval %S %S :file %S :line %S))"
"(lispy.clojure/reval %S %S :file %S :line %S)")
e-str
(condition-case nil
(let ((deactivate-mark nil))
(save-mark-and-excursion
(lispy--out-backward 1 t)
(deactivate-mark)
(lispy--string-dwim)))
(error ""))
(buffer-file-name)
(line-number-at-pos)))
(let ((context-str
(condition-case nil
(let ((deactivate-mark nil))
(save-mark-and-excursion
(lispy--out-backward 1 t)
(deactivate-mark)
(lispy--string-dwim)))
(error ""))))
(when (and (lispy--leftp)
(looking-back "(for[ \t\n]*" (line-beginning-position -1)))
(let* ((e-str-1 (save-excursion
(forward-char 1)
(forward-sexp 2)
(lispy--string-dwim)))
(coll (read (lispy--eval-clojure-1
(format "(lispy.clojure/with-shadows (map str %s))" e-str-1)
nil)))
(idx (lispy--idx-from-list coll))
(sym (save-excursion
(forward-char 1)
(lispy--string-dwim))))
(setq e-str (format "%s (nth %s %d)" sym e-str-1 idx))))
(format (if (memq this-command '(special-lispy-eval
special-lispy-eval-and-insert
lispy-eval-current-outline))
"(lispy.clojure/pp (lispy.clojure/reval %S %S :file %S :line %S))"
"(lispy.clojure/reval %S %S :file %S :line %S)")
e-str
context-str
(buffer-file-name)
(line-number-at-pos))))
(t
e-str)))

Expand All @@ -118,12 +141,7 @@
(remove-hook 'nrepl-connected-hook
'lispy--clojure-eval-hook-lambda))

(defvar lispy-cider-jack-in-dependencies
'(("me.raynes/fs" "1.4.6")
("compliment" "0.3.11")
("com.cemerick/pomegranate" "0.4.0")
("org.tcrawley/dynapath" "0.2.5")
("nrepl" "0.8.2")))
(defvar lispy-cider-jack-in-dependencies nil)

(defvar cider-jack-in-cljs-dependencies)
(defvar cider-jack-in-dependencies)
Expand Down Expand Up @@ -193,14 +211,10 @@ Add the standard output to the result."
(or
(and (stringp e-str)
(lispy--eval-clojure-handle-ns e-str))
(let* (pp
(stra (if (setq pp (string-match "\\`(lispy.clojure/\\(pp\\|reval\\)" f-str))
f-str
f-str))
(res (lispy--eval-nrepl-clojure stra lispy--clojure-ns))
(let* ((res (lispy--eval-nrepl-clojure f-str lispy--clojure-ns))
(status (nrepl-dict-get res "status"))
(res (cond ((or (member "namespace-not-found" status))
(lispy--eval-nrepl-clojure stra))
(lispy--eval-nrepl-clojure f-str))
((member "eval-error" status)
(signal 'eval-error (lispy--clojure-pretty-string
(nrepl-dict-get res "err"))))
Expand All @@ -212,7 +226,7 @@ Add the standard output to the result."
(when out
(setq lispy-eval-output
(concat (propertize out 'face 'font-lock-string-face) "\n")))
(if pp
(if (string-match "\\`(lispy.clojure/\\(pp\\|reval\\)" f-str)
(condition-case nil
(string-trim (read val))
(error val))
Expand Down Expand Up @@ -386,8 +400,6 @@ Besides functions, handles specials, keywords, maps, vectors and sets."
"Mark the Clojure middleware in \"lispy-clojure.clj\" as not loaded."
(puthash (lispy--clojure-process-buffer) nil lispy--clojure-middleware-loaded-hash))

(defvar cider-jdk-src-paths)

(defun lispy-cider-load-file (filename)
(let ((ns-form (cider-ns-form)))
(cider-map-repls :auto
Expand All @@ -400,7 +412,7 @@ Besides functions, handles specials, keywords, maps, vectors and sets."
(file-name-nondirectory filename)
connection)))))

(defcustom lispy-clojure-middleware-tests t
(defcustom lispy-clojure-middleware-tests nil
"When non-nil, run the tests from lispy-clojure.clj when loading it."
:type 'boolean
:group 'lispy)
Expand All @@ -424,24 +436,19 @@ Besides functions, handles specials, keywords, maps, vectors and sets."
(file-attributes middleware-fname))))
(when (or (null access-time) (time-less-p access-time middleware-access-time))
(setq lispy--clojure-ns "user")
(save-window-excursion
(lispy-cider-load-file
(expand-file-name middleware-fname lispy-site-directory)))
(unless (lispy--clojure-babashka-p)
(save-window-excursion
(lispy-cider-load-file
(expand-file-name middleware-fname lispy-site-directory))))
(puthash conn middleware-access-time lispy--clojure-middleware-loaded-hash)
(add-hook 'nrepl-disconnected-hook #'lispy--clojure-middleware-unload)
(when (equal conn-type 'clj)
(when cider-jdk-src-paths
(let ((sources-expr
(format
"(do \n %s)"
(mapconcat
(lambda (p) (format "(cemerick.pomegranate/add-classpath %S)" p))
cider-jdk-src-paths
"\n "))))
(lispy--eval-clojure-cider sources-expr)))
(when lispy-clojure-middleware-tests
(lispy-message
(lispy--eval-clojure-cider "(lispy.clojure/run-lispy-tests)")))))))
(let ((test-fname (expand-file-name "lispy-clojure-test.clj"
lispy-site-directory)))
(when (and lispy-clojure-middleware-tests
(file-exists-p test-fname))
(lispy-message
(lispy--eval-clojure-cider (format "(load-file \"%s\")" test-fname)))))))))

(defun lispy-flatten--clojure (_arg)
"Inline a Clojure function at the point of its call."
Expand Down Expand Up @@ -474,10 +481,13 @@ Besides functions, handles specials, keywords, maps, vectors and sets."
(let* ((e-str (format "(lispy.clojure/debug-step-in\n'%s)"
(lispy--string-dwim)))
(str (substring-no-properties
(lispy--eval-clojure-cider e-str))))
(lispy--eval-clojure-1 e-str nil)))
(old-session (sesman-current-session 'CIDER)))
(lispy-follow)
(when (string-match "(clojure.core/in-ns (quote \\([^)]+\\))" str)
(setq lispy--clojure-ns (match-string 1 str)))
(when (equal (file-name-nondirectory (buffer-file-name)) "lispy-clojure.clj")
(sesman-link-session 'CIDER old-session))
(lispy--eval-clojure-cider str)
(lispy-flow 1)))

Expand Down Expand Up @@ -563,31 +573,7 @@ Besides functions, handles specials, keywords, maps, vectors and sets."
(setq cands (all-completions (lispy--string-dwim bnd) cands)))
(list (car bnd) (cdr bnd) cands)))
((eq (lispy--clojure-process-type) 'cljs)
nil)
((save-excursion
(lispy--out-backward 2 t)
(looking-at "(import"))
(let* ((prefix (save-excursion
(lispy--out-backward 1 t)
(forward-char)
(thing-at-point 'symbol t)))
(cands (read (lispy--eval-clojure-cider
(format
"(lispy.clojure/complete %S)"
prefix))))
(len (1+ (length prefix)))
(candsa (mapcar (lambda (s) (substring s len)) cands)))
(when (> (cdr bnd) (car bnd))
(setq candsa (all-completions (lispy--string-dwim bnd) candsa)))
(list (car bnd) (cdr bnd) candsa)))
(t
(let* ((prefix (lispy--string-dwim bnd))
(cands (read (lispy--eval-clojure-cider-noerror
(format
"(lispy.clojure/complete %S)"
prefix)))))
(when cands
(list (car bnd) (cdr bnd) cands))))))))))
nil)))))))

(defun lispy--eval-clojure-cider-noerror (e-str)
(condition-case nil
Expand Down
41 changes: 41 additions & 0 deletions le-js.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(require 'indium)

(defun lispy--eval-js (str)
(let ((r nil))
(indium-eval
str (lambda (value) (setq r (indium-render-remote-object-to-string value))))
(while (not r)
(accept-process-output))
(substring-no-properties r)))

(defun lispy--eval-js-str ()
(if (region-active-p)
(lispy--string-dwim)
(lispy--string-dwim
(lispy-bounds-python-block))))

(defun lispy--js-completion-at-point ()
(let* ((prefix (buffer-substring-no-properties
(let ((bol (point-at-bol))
(prev-delimiter (1+ (save-excursion
(re-search-backward "[([:space:]]" nil t)))))
(if prev-delimiter
(max bol prev-delimiter)
bol))
(point)))
(expression (if (string-match-p "\\." prefix)
(replace-regexp-in-string "\\.[^\\.]*$" "" prefix)
"this"))
(cands nil))
(indium-client-get-completion
expression
indium-debugger-current-frame
(lambda (candidates)
(setq cands candidates)))
(while (null cands)
(accept-process-output))
(list (- (point) (length (company-grab-symbol)))
(point)
(mapcar #'identity cands))))

(provide 'le-js)
19 changes: 9 additions & 10 deletions le-lisp.el
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@
(defun lispy--eval-lisp (str)
"Eval STR as Common Lisp code."
(let* ((deactivate-mark nil)
(result (with-current-buffer (process-buffer (lispy--cl-process))
(if (lispy--use-sly-p)
(sly-eval `(slynk:eval-and-grab-output ,str))
(slime-eval `(swank:eval-and-grab-output ,str))))))
(if (equal (car result) "")
(cadr result)
(concat (propertize (car result)
'face 'font-lock-string-face)
"\n\n"
(cadr result)))))
(result (if (lispy--use-sly-p)
(with-current-buffer (process-buffer (lispy--cl-process))
(sly-eval `(slynk:eval-and-grab-output ,str)))
(slime-eval `(swank:eval-and-grab-output ,str)))))
(pcase result
(`("" "") "(ok)")
(`("" ,val) val)
(`(,out ,val)
(concat (propertize (string-trim-left out) 'face 'font-lock-string-face) "\n\n" val)))))

(defun lispy--cl-process ()
(unless (lispy--use-sly-p)
Expand Down
Loading