Reverting: also handle id locations.

Saving all buffers will now also safe the id locations.
Reverting all buffers will now also reload the id locations.
This commit is contained in:
Carsten Dominik 2009-02-13 07:41:00 +01:00
parent da6fb7448b
commit 304cb36530
3 changed files with 22 additions and 3 deletions

View file

@ -6339,7 +6339,8 @@ Same as @kbd{r}.
@kindex C-x C-s
@item s
@itemx C-x C-s
Save all Org buffers in the current Emacs session.
Save all Org buffers in the current Emacs session, and also the locations of
IDs.
@c
@kindex @key{right}
@item @key{right}

View file

@ -1,3 +1,8 @@
2009-02-13 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-save-all-org-buffers): Also save id locations.
(org-revert-all-org-buffers): Also load id locations.
2009-02-12 Carsten Dominik <carsten.dominik@gmail.com>
* org.el (org-drawers): Add LOGBOOK to the default drawers.
(org-log-state-notes-into-drawer): New option.

View file

@ -12327,11 +12327,22 @@ If there is already a time stamp at the cursor position, update it."
(interactive)
(message "Saving all Org-mode buffers...")
(save-some-buffers t 'org-mode-p)
(when (featurep 'org-id) (org-id-locations-save))
(message "Saving all Org-mode buffers... done"))
(defun org-revert-all-org-buffers ()
"Revert all Org-mode buffers.
Prompt for confirmation when there are unsaved changes."
Prompt for confirmation when there are unsaved changes.
Be sure you know what you are doing before letting this function
overwrite your changes.
This function is useful in a setup where one tracks org files
with a version control system, to revert on one machine after pulling
changes from another. I believe the procedure must be like this:
1. M-x org-save-all-org-buffers
2. Pull changes from the other machine, resolve conflicts
3. M-x org-revert-all-org-buffers"
(interactive)
(unless (yes-or-no-p "Revert all Org buffers from their files? ")
(error "Abort"))
@ -12343,7 +12354,9 @@ Prompt for confirmation when there are unsaved changes."
(with-current-buffer b buffer-file-name))
(switch-to-buffer b)
(revert-buffer t 'no-confirm)))
(buffer-list)))))
(buffer-list))
(when (and (featurep 'org-id) org-id-track-globally)
(org-id-locations-load)))))
;;;; Agenda files