Skip to content

Commit

Permalink
fix(edit): make edit commands available only in compatible modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Walheimat committed Sep 7, 2024
1 parent 24f380c commit e28afb9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ship-mate-edit.el
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Sets MODE unless already set."

(defun ship-mate-edit-environment-apply ()
"Apply the edited environment."
(interactive)
(interactive nil ship-mate-edit-environment-mode)

(when-let ((warnings (ship-mate-edit-environment--validate)))
(user-error (string-join warnings ", ")))
Expand All @@ -135,13 +135,13 @@ Sets MODE unless already set."

(defun ship-mate-edit-environment-abort ()
"Abort editing."
(interactive)
(interactive nil ship-mate-edit-environment-mode)

(ship-mate-edit-environment--quit))

(defun ship-mate-edit-environment-clear ()
"Clear the environment."
(interactive)
(interactive nil ship-mate-edit-environment-mode)

(ship-mate-edit-environment--set-environment nil)
(ship-mate-edit-environment--quit))
Expand Down Expand Up @@ -187,20 +187,21 @@ This is set in buffer `ship-mate-edit-environment-buffer-name'."

(defun ship-mate-edit-history-apply ()
"Apply the edited history."
(interactive)
(interactive nil ship-mate-edit-history-mode)

(ship-mate-edit-history--set-history (ship-mate-edit-history--listify))
(ship-mate-edit-history--quit))

(defun ship-mate-edit-history-clear ()
"Clear the history."
(interactive)
(interactive nil ship-mate-edit-history-mode)

(ship-mate-edit-history--set-history nil)
(ship-mate-edit-history--quit))

(defun ship-mate-edit-history-abort ()
"Abort editing history."
(interactive)
(interactive nil ship-mate-edit-history-mode)

(ship-mate-edit-history--quit))

Expand Down

0 comments on commit e28afb9

Please sign in to comment.