Skip to content

Commit

Permalink
Fix bug where parinfer-rust-mode wouldn't disable itself
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbarclay committed May 4, 2024
1 parent 398dc4d commit 35d31ab
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions parinfer-rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -558,19 +558,19 @@ This includes stopping tracking of all changes."
(defun parinfer-rust-mode-enable ()
"Enable Parinfer."
;; Make sure the library is installed at the appropriate location or offer to download it
(if (parinfer-rust--check-for-library parinfer-rust-supported-versions
(if (and (parinfer-rust--check-for-library parinfer-rust-supported-versions
parinfer-rust-library
parinfer-rust--lib-name
parinfer-rust-auto-download)
(require 'parinfer-rust parinfer-rust-library t)
(parinfer-rust--check-version parinfer-rust-supported-versions
(parinfer-rust-version)
parinfer-rust-library
parinfer-rust--lib-name))
(progn
(require 'parinfer-rust parinfer-rust-library t)
;; Check version and prompt to download latest version if out of date Problem: Emacs can't
;; reload dynamic libraries, which means that if we download a new library the user has to
;; restart Emacs for changes to take effect.
(parinfer-rust--check-version parinfer-rust-supported-versions
(parinfer-rust-version)
parinfer-rust-library
parinfer-rust--lib-name)
(parinfer-rust-mode-setup)
(cond ((or (eq 'defer parinfer-rust-check-before-enable)
buffer-read-only)
Expand All @@ -585,7 +585,7 @@ This includes stopping tracking of all changes."
(parinfer-rust--execute)))))
(progn
(message "Unable to load library parinfer-rust disabling parinfer-rust-mode")
(parinfer-rust-mode-disable))))
(parinfer-rust-mode -1))))

;;;###autoload
(defun parinfer-rust-switch-mode ()
Expand Down Expand Up @@ -622,7 +622,7 @@ not available."
:init-value nil
:keymap parinfer-rust-mode-map
(cond
(parinfer-rust-mode
((not parinfer-rust-mode)
(parinfer-rust-mode-disable))
;; Don't do anything if the buffer is not selected
;; TODO: Come up with a better way to defer and disable loading
Expand Down

0 comments on commit 35d31ab

Please sign in to comment.