From a272e00ebbd3237a20b800f738b78778dcaa9299 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sun, 14 Jan 2024 11:04:01 +0200 Subject: Add gnosis-edit-save-exit Function to exit recursive edit & save changes - Add gnosis-edit-exit on gnosis-edit-mode-map --- gnosis.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnosis.el b/gnosis.el index f1d3b19..deeb102 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1048,6 +1048,14 @@ changes." (insert "\n;; After finishing editing, save changes with ` '\n;; Do NOT exit without saving.") (indent-region (point-min) (point-max))))) +(defun gnosis-edit-save-exit () + "Save edits and exit." + (interactive) + (eval-buffer) + (kill-buffer) + (exit-recursive-edit)) + + (define-derived-mode gnosis-edit-mode emacs-lisp-mode "Gnosis EDIT" "Gnosis Edit Mode." :interactive t @@ -1056,7 +1064,7 @@ changes." (defvar-keymap gnosis-edit-mode-map :doc "gnosis-edit keymap" - "C-c C-c" #'(lambda () (interactive) (eval-buffer) (kill-buffer) (exit-recursive-edit))) + "C-c C-c" #'gnosis-edit-save-exit) (cl-defun gnosis-edit-update-note (&key id main options answer tags (extra-notes nil) (image nil) (second-image nil)) -- cgit v1.2.3