lang/org: report deleted files after +org-attach/sync
This commit is contained in:
parent
68fed155ad
commit
318f51cfff
1 changed files with 8 additions and 6 deletions
|
@ -54,12 +54,14 @@ and END (defaults to `point-min' and `point-max')."
|
||||||
(insert-file-contents-literally org-file))
|
(insert-file-contents-literally org-file))
|
||||||
(setq +org-attachments (+org-attachments--list)))
|
(setq +org-attachments (+org-attachments--list)))
|
||||||
;; clean up
|
;; clean up
|
||||||
|
(let ((deleted 0))
|
||||||
(dolist (file (cl-set-difference +org-attachments-files +org-attachments
|
(dolist (file (cl-set-difference +org-attachments-files +org-attachments
|
||||||
:test #'string=))
|
:test #'string=))
|
||||||
(message "Deleting orphaned attachment: %s" file)
|
(message "Deleting orphaned attachment: %s" file)
|
||||||
|
(cl-incf deleted)
|
||||||
(unless arg
|
(unless arg
|
||||||
(delete-file (expand-file-name file org-attach-directory))))
|
(delete-file (expand-file-name file org-attach-directory))))
|
||||||
(message "Buffer's attachments synced"))
|
(message "Buffer's attachments synced (%d deleted)" deleted)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org-attach/find-file ()
|
(defun +org-attach/find-file ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue