diff options
-rw-r--r-- | nroam.el | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -99,11 +99,16 @@ Make the region inserted by BODY read-only, and marked with (nroam--init-work-buffer) (add-hook 'before-save-hook #'nroam--prune nil t) (add-hook 'after-save-hook #'nroam--update-maybe nil t) - (nroam-update)) + (nroam--maybe-insert-immediately)) (remove-hook 'before-save-hook #'nroam--prune t) (remove-hook 'after-save-hook #'nroam--update-maybe t) (nroam--prune))) +(defun nroam--maybe-insert-immediately () + "Insert nroam sections iff the buffer file exists." + (when (file-exists-p buffer-file-name) + (nroam-update))) + ;;;###autoload (defun nroam-ctrl-c-ctrl-c () "Update the sections for the current buffer, or fallback to `org-ctrl-c-ctrl-c'." |