[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/idris-mode 7a0b5c736d 7/8: Merge pull request #558 from ke
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/idris-mode 7a0b5c736d 7/8: Merge pull request #558 from keram/jump-to-file-from-repl |
Date: |
Fri, 11 Nov 2022 06:58:58 -0500 (EST) |
branch: elpa/idris-mode
commit 7a0b5c736d15fcb6d67fb584f30236a7fedad715
Merge: cba57f7ff4 e7e2a6c3bc
Author: Jan de Muijnck-Hughes <jfdm@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Merge pull request #558 from keram/jump-to-file-from-repl
Add ability to quickly switch from Idris repl to
---
idris-commands.el | 19 +++++++++++++++++++
idris-repl.el | 3 +++
2 files changed, 22 insertions(+)
diff --git a/idris-commands.el b/idris-commands.el
index 6e0f7485db..a11bba322a 100644
--- a/idris-commands.el
+++ b/idris-commands.el
@@ -949,6 +949,25 @@ type-correct, so loading will fail."
(pop-to-buffer buf)
(error "No Idris REPL buffer is open."))))
+(defun idris-switch-to-last-idris-buffer ()
+ "Switch to the last Idris buffer.
+The default keybinding for this command is
+the same as variable `idris-pop-to-repl',
+so that it is very convenient to jump between a
+Idris buffer and the REPL buffer.
+
+Inspired by `cider-switch-to-last-clojure-buffer'
+https://github.com/clojure-emacs/cider"
+ (interactive)
+ (if (derived-mode-p 'idris-repl-mode)
+ (let ((idris-buffer (seq-find
+ (lambda (b) (eq 'idris-mode (buffer-local-value
'major-mode b)))
+ (buffer-list))))
+ (if idris-buffer
+ (pop-to-buffer idris-buffer `(display-buffer-reuse-window))
+ (user-error "No Idris buffer found")))
+ (user-error "Not in a Idris REPL buffer")))
+
(defun idris-quit ()
"Quit the Idris process, cleaning up the state synchronized with Emacs."
(interactive)
diff --git a/idris-repl.el b/idris-repl.el
index bf081eb9c4..509fd1c93d 100644
--- a/idris-repl.el
+++ b/idris-repl.el
@@ -187,6 +187,9 @@ If ALWAYS-INSERT is non-nil, always insert a prompt at the
end of the buffer."
idris-define-general-keys
idris-define-active-term-keys)
do (funcall keyer map))
+ (substitute-key-definition 'idris-pop-to-repl
+ 'idris-switch-to-last-idris-buffer
+ map)
map)
"Keymap used in Idris REPL mode.")
- [nongnu] elpa/idris-mode updated (8933ab84f9 -> 1adee4fe06), ELPA Syncer, 2022/11/11
- [nongnu] elpa/idris-mode d1a9171fd7 1/8: Jump to last Idris Code buffer when we quit buffer, ELPA Syncer, 2022/11/11
- [nongnu] elpa/idris-mode cba57f7ff4 6/8: Merge pull request #557 from keram/jump-back-on-quit, ELPA Syncer, 2022/11/11
- [nongnu] elpa/idris-mode e7e2a6c3bc 3/8: Remove dependency on if-let* defined in subr-x, ELPA Syncer, 2022/11/11
- [nongnu] elpa/idris-mode 1adee4fe06 8/8: Merge pull request #560 from keram/interactive-s-flag, ELPA Syncer, 2022/11/11
- [nongnu] elpa/idris-mode 103f1e5fbf 2/8: Add ability to quickly switch from Idris repl to, ELPA Syncer, 2022/11/11
- [nongnu] elpa/idris-mode e1fd68e494 4/8: Revert removal of s flag from interactive., ELPA Syncer, 2022/11/11
- [nongnu] elpa/idris-mode bc44e934f8 5/8: Stop CI run?, ELPA Syncer, 2022/11/11
- [nongnu] elpa/idris-mode 7a0b5c736d 7/8: Merge pull request #558 from keram/jump-to-file-from-repl,
ELPA Syncer <=