Function: org-revert-all-org-buffers

org-revert-all-org-buffers is an interactive and byte-compiled function defined in org.el.gz.

Signature

(org-revert-all-org-buffers)

Documentation

Revert all Org buffers.

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 (org-save-all-org-buffers)
2. Pull changes from the other machine, resolve conflicts
3. M-x org-revert-all-org-buffers (org-revert-all-org-buffers)

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-revert-all-org-buffers ()
  "Revert all Org buffers.
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. \\[org-save-all-org-buffers]
2. Pull changes from the other machine, resolve conflicts
3. \\[org-revert-all-org-buffers]"
  (interactive)
  (unless (yes-or-no-p "Revert all Org buffers from their files? ")
    (user-error "Abort"))
  (save-excursion
    (save-window-excursion
      (dolist (b (buffer-list))
	(when (and (with-current-buffer b (derived-mode-p 'org-mode))
		   (with-current-buffer b buffer-file-name))
	  (pop-to-buffer-same-window b)
	  (revert-buffer t 'no-confirm)))
      (when (and (featurep 'org-id) org-id-track-globally)
	(org-id-locations-load)))))