Skip to content

Conversation

keram
Copy link
Contributor

@keram keram commented Sep 23, 2025

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:

  • user visits foo.idr file
  • make some change and wants to verify it in repl
  • presses C-c C-z (default key binding for `idris-switch-to-repl')
  • and it is taken to the repl with the current file loaded

Previously invoking idris-switch-to-repl on a "cold" idr file would return an error: "idris-repl has no process".

@keram keram force-pushed the jump-to-repl-from-cold branch 3 times, most recently from 32a9313 to 76d183c Compare September 23, 2025 16:33
@keram keram marked this pull request as draft September 25, 2025 14:42
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))))
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@keram keram force-pushed the jump-to-repl-from-cold branch from b339073 to 1686c02 Compare September 27, 2025 13:04
"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)
Copy link
Contributor Author

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.

…idris-switch-to-repl`

Why:
Allows to jump to the repl without having to manually start repl
using a shortcut
@keram keram force-pushed the jump-to-repl-from-cold branch from 1686c02 to d0495e9 Compare October 4, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants