diff options
author | Thanos Apollo <[email protected]> | 2024-06-16 20:33:21 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-06-16 20:33:21 +0300 |
commit | 8b24e05f6f02cad2063673271f199b268406a408 (patch) | |
tree | 64e9fb9df555257d02e3cbc8e4beeeed876c2824 /gnosis.el | |
parent | 9b0415cf7590d0185d76fc99f454b4069e77b83a (diff) |
[fix] gnosis-edit-save-exit: Adjust for existing *gnosis-edit* buffers
This should allow to call gnosis-edit-save-exit at the start of
gnosis-edit-* functions. If a user had forgotten to save previous
changes this would have caused an error before.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1539,10 +1539,12 @@ INITIAL-INTERVAL: Initial interval for notes of deck" (cl-defun gnosis-edit-save-exit (&optional exit-func &rest args) "Save edits and exit using EXIT-FUNC, with ARGS." (interactive) - (eval-buffer) - (quit-window t) - (when exit-func - (apply exit-func args))) + (when (get-buffer "*gnosis-edit*") + (switch-to-buffer "*gnosis-edit*") + (eval-buffer) + (quit-window t) + (when exit-func + (apply exit-func args)))) (defvar-keymap gnosis-edit-mode-map :doc "gnosis-edit keymap" |