branch: elpa/idris-mode commit d965f35f9a4131765bc34778e5b228af21bb291c Author: Guillaume Allais <guillaume.all...@ens-lyon.org> Commit: Guillaume Allais <guillaume.all...@ens-lyon.org>
[ fix ] remove ibc deletions for idris2 Idris2 does not have .ibc files so this code is useless (and actively harmful if you try to load a .tex file that happens to be a literate idris file). --- idris-commands.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/idris-commands.el b/idris-commands.el index 00fb152590..de5d81deae 100644 --- a/idris-commands.el +++ b/idris-commands.el @@ -969,19 +969,19 @@ type-correct, so loading will fail." "Delete the IBC file for the current buffer. A prefix argument means to not ask for confirmation." (interactive "P") - (let* ((fname (buffer-file-name)) - (ibc (concat (file-name-sans-extension fname) ".ibc"))) - (if (not (or (string= (file-name-extension fname) "idr") - (string= (file-name-extension fname) "lidr") - (string= (file-name-extension fname) "org") - (string= (file-name-extension fname) "markdown") - (string= (file-name-extension fname) "md") - )) - (error "The current file is not an Idris file") - (when (or no-confirmation (y-or-n-p (concat "Really delete " ibc "?"))) - (when (file-exists-p ibc) - (delete-file ibc) - (message "%s deleted" ibc)))))) + (unless (> idris-protocol-version 1) + (let* ((fname (buffer-file-name)) + (ibc (concat (file-name-sans-extension fname) ".ibc"))) + (if (not (or (string= (file-name-extension fname) "idr") + (string= (file-name-extension fname) "lidr") + (string= (file-name-extension fname) "org") + (string= (file-name-extension fname) "markdown") + (string= (file-name-extension fname) "md"))) + (error "The current file is not an Idris file") + (when (or no-confirmation (y-or-n-p (concat "Really delete " ibc "?"))) + (when (file-exists-p ibc) + (delete-file ibc) + (message "%s deleted" ibc))))))) (defun idris--active-term-beginning (term pos) "Find the beginning of active term TERM that occurs at POS.