Save commands-file when killing application from Org page

This commit is contained in:
Renaud Casenave-Péré 2022-09-17 15:59:15 +02:00
parent dd84835a4b
commit 2e5d679d25

View file

@ -39,24 +39,29 @@
(make-agenda-files-model agenda-files))
(defun cleanup ()
(close-file)
(save-recentf "recentf")
(save-config-file "config.lisp"))
(defun refresh-agenda-files ()
(refresh-agenda-files-model agenda-files))
(defun open-file (filepath)
(let* ((pathname (parse-namestring filepath))
(org-document (if (probe-file pathname)
(parse-document pathname)
(make-org-document (make-org-line "" "")))))
(make-org-model pathname org-document)
(initialize-commands pathname)
(push-to-recent-files pathname)))
(let (currently-open-file)
(defun open-file (filepath)
(let* ((pathname (parse-namestring filepath))
(org-document (if (probe-file pathname)
(parse-document pathname)
(make-org-document (make-org-line "" "")))))
(make-org-model pathname org-document)
(initialize-commands pathname)
(push-to-recent-files pathname)
(setf currently-open-file pathname)))
(defun close-file (filepath)
(let ((pathname (parse-namestring filepath)))
(save-commands pathname)))
(defun close-file (&optional filepath)
(let ((pathname (if filepath (parse-namestring filepath) currently-open-file)))
(when pathname
(save-commands pathname)
(setf currently-open-file nil)))))
(defun delete-file* (filepath)
(let ((pathname (parse-namestring filepath)))