-
Notifications
You must be signed in to change notification settings - Fork 73
Ensure Idris is running and current idr file loaded when using idris-switch-to-repl
#643
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
base: main
Are you sure you want to change the base?
Conversation
32a9313 to
76d183c
Compare
idris-repl.el
Outdated
| (interactive) | ||
| (if (and buffer-file-name | ||
| ;; in Emacs 29.1 > we can use string-equal-ignore-case | ||
| (string= "idr" (downcase (file-name-extension buffer-file-name)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not the case that idris files can have other extensions if we are in literate mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I have updated the implementation to check also for lidr files although I don't have any good lidr examples to test it with.
b339073 to
1686c02
Compare
| "Load the current Idris file buffer and jump to the Idris REPL." | ||
| (interactive) | ||
| (if (or (idris-idr-p) (idris-lidr-p)) | ||
| (idris-load-file-sync) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using synchronous load as async idris-load-file causes point to be moved from repl back to source file.
1686c02 to
d0495e9
Compare
d0495e9 to
ba38636
Compare
| (idris-run) | ||
| (idris-switch-to-repl)) | ||
| (pop-to-buffer (idris-repl-buffer)) | ||
| (goto-char (point-max))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed (idris-switch-to-repl) because user can invoke idris-repl without being in Idris file
and idris-switch-to-repl has now dependency to be invoked only within idr or lidr files.
…idris-switch-to-repl` Why: Allows to jump to the repl without having to manually start repl using a shortcut
Why: When jumping to a repl from non-loaded file we want to do optimistic load. Ergo even if Idris finds errors in the file the jump to the repl should succeed.
ba38636 to
8b42812
Compare
Why:
Allows to jump to the repl without having to manually start repl using a shortcut.
This change improves user experience. For example in scenario:
foo.idrfileC-c C-z(default key binding for `idris-switch-to-repl')Previously invoking
idris-switch-to-replon a "cold" idr file would return an error: "idris-repl has no process".