diff options
author | Thanos Apollo <[email protected]> | 2024-01-14 11:04:01 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-01-14 11:14:13 +0200 |
commit | a272e00ebbd3237a20b800f738b78778dcaa9299 (patch) | |
tree | 06cae905fb26a835346ca2f4de09e07b7bae7575 /gnosis.el | |
parent | 24b2802a19a2a4cc843f98c9ed4800724d94e49f (diff) |
Add gnosis-edit-save-exit
Function to exit recursive edit & save changes
- Add gnosis-edit-exit on gnosis-edit-mode-map
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1048,6 +1048,14 @@ changes." (insert "\n;; After finishing editing, save changes with `<C-c> <C-c>'\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)) |