Save commands-file when killing application from Org page
This commit is contained in:
parent
dd84835a4b
commit
2e5d679d25
1 changed files with 16 additions and 11 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue