summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnosis.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/gnosis.el b/gnosis.el
index 6220d10..eecde0a 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1217,15 +1217,16 @@ changes."
":tags" ":extra-notes" ":image" ":second-image"
":ef" ":ff" ":suspend"))
-(defun gnosis-edit-save-exit ()
- "Save edits and exit."
+(cl-defun gnosis-edit-save-exit (&optional deck-edit (exit-func 'exit-recursive-edit) &rest args)
+ "Save edits and exit.
+
+If not DECK-EDIT and not in a recursive-edit, pop back
+gnosis-dashboard."
(interactive)
- (eval-buffer)
- (quit-window t)
- ;; exit recursive edit if we are in one
- (if (>= (recursion-depth) 1)
- (exit-recursive-edit)
- (gnosis-dashboard)))
+ (let ((deck-edit (or deck-edit nil)))
+ (eval-buffer)
+ (quit-window t)
+ (apply exit-func args)))
(defvar-keymap gnosis-edit-mode-map
:doc "gnosis-edit keymap"