[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/idris-mode 4a36953e76 9/9: Merge pull request #580 from ke
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/idris-mode 4a36953e76 9/9: Merge pull request #580 from keram/load-file-switch-dir-idris2 |
Date: |
Tue, 6 Dec 2022 05:59:06 -0500 (EST) |
branch: elpa/idris-mode
commit 4a36953e767d627783aaaf3c705bed349cc84ab8
Merge: 7ebd8e721b 6fbd9cff31
Author: Jan de Muijnck-Hughes <jfdm@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Merge pull request #580 from keram/load-file-switch-dir-idris2
Remove conditional for srcdir in `idris-load-file` used to switch work
directory for Idris2
---
idris-commands.el | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/idris-commands.el b/idris-commands.el
index 54f558b19a..54f3d1cc55 100644
--- a/idris-commands.el
+++ b/idris-commands.el
@@ -91,13 +91,23 @@
(idris-repl-buffer))
(defun idris-switch-working-directory (new-working-directory)
- "Switch working directory."
+ "Switch working directory to NEW-WORKING-DIRECTORY."
(unless (string= idris-process-current-working-directory
new-working-directory)
(idris-ensure-process-and-repl-buffer)
- (if (> idris-protocol-version 1)
- (idris-eval `(:interpret ,(concat ":cd " (prin1-to-string
new-working-directory))))
- (idris-eval `(:interpret ,(concat ":cd " new-working-directory))))
- (setq idris-process-current-working-directory new-working-directory)))
+ (let* ((path (if (> idris-protocol-version 1)
+ (prin1-to-string new-working-directory)
+ new-working-directory))
+ (eval-result (idris-eval `(:interpret ,(concat ":cd " path))))
+ (result-msg (or (car-safe eval-result) "")))
+ ;; Check if the message from Idris contains the new directory path.
+ ;; Before check drop the last character (slash) in the path
+ ;; as the message does not include it.
+ (if (string-match-p (file-truename (substring new-working-directory 0
-1))
+ result-msg)
+ (progn
+ (message result-msg)
+ (setq idris-process-current-working-directory
new-working-directory))
+ (error "Failed to switch the working directory %s" eval-result)))))
(defun idris-list-holes-on-load ()
"Use the user's settings from customize to determine whether to list the
holes."
@@ -212,13 +222,7 @@ A prefix argument forces loading but only up to the
current line."
;; Actually do the loading
(let* ((dir-and-fn (idris-filename-to-load))
(fn (cdr dir-and-fn))
- (srcdir
- (if (> idris-protocol-version 1)
- (prin1-to-string (car dir-and-fn))
- (car dir-and-fn)
- )
- )
- )
+ (srcdir (car dir-and-fn)))
(setq idris-currently-loaded-buffer nil)
(idris-switch-working-directory srcdir)
(idris-delete-ibc t) ;; delete the ibc to avoid interfering with
partial loads
- [nongnu] elpa/idris-mode updated (0cae4b8086 -> 4a36953e76), ELPA Syncer, 2022/12/06
- [nongnu] elpa/idris-mode 6fbd9cff31 6/9: Improve `idris-switch-working-directory` by, ELPA Syncer, 2022/12/06
- [nongnu] elpa/idris-mode 4a36953e76 9/9: Merge pull request #580 from keram/load-file-switch-dir-idris2,
ELPA Syncer <=
- [nongnu] elpa/idris-mode ee551230ed 7/9: Merge pull request #579 from keram/tests-impro, ELPA Syncer, 2022/12/06
- [nongnu] elpa/idris-mode 71ab6a35e3 5/9: [semantic-highlight] Remove and rebuild overlays in file on reload only in changed area, ELPA Syncer, 2022/12/06
- [nongnu] elpa/idris-mode 7ebd8e721b 8/9: Merge pull request #581 from keram/highlight-partial, ELPA Syncer, 2022/12/06
- [nongnu] elpa/idris-mode d6ac9524f6 1/9: Simplify `idris-test-idris-type-search` by removing loading a file, ELPA Syncer, 2022/12/06
- [nongnu] elpa/idris-mode 928f785bb7 4/9: Remove conditional for srcdir in `idris-load-file` used to switch work directory, ELPA Syncer, 2022/12/06
- [nongnu] elpa/idris-mode d0d609bff7 3/9: Include tests from idris-navigate.el in idris-tests.el, ELPA Syncer, 2022/12/06
- [nongnu] elpa/idris-mode 8a4ce46373 2/9: Delete AddClause.ibc between and after tests, ELPA Syncer, 2022/12/06