diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bfd4ea455..42b24516a 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-02-10 Carsten Dominik + + * org.el (org-save-all-org-buffers): Moved here from org-agenda.el. + (org-revert-all-org-buffers): New command. + 2009-02-09 Carsten Dominik * org.el (org-return): Implement `org-return-follows-link' in the diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 8796fbd36..7d05197a6 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4327,13 +4327,6 @@ So this is just a shortcut for `\\[org-agenda]', available in the agenda." (let ((org-agenda-window-setup 'current-window)) (org-agenda arg))) -(defun org-save-all-org-buffers () - "Save all Org-mode buffers without user confirmation." - (interactive) - (message "Saving all Org-mode buffers...") - (save-some-buffers t 'org-mode-p) - (message "Saving all Org-mode buffers... done")) - (defun org-agenda-redo () "Rebuild Agenda. When this is the global TODO list, a prefix argument will be interpreted." diff --git a/lisp/org.el b/lisp/org.el index ba4963677..de553c646 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -12269,6 +12269,31 @@ If there is already a time stamp at the cursor position, update it." (string-to-number (match-string 2 s))) 0)) +;;;; Files + +(defun org-save-all-org-buffers () + "Save all Org-mode buffers without user confirmation." + (interactive) + (message "Saving all Org-mode buffers...") + (save-some-buffers t 'org-mode-p) + (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." + (interactive) + (unless (yes-or-no-p "Revert all Org buffers from their files? ") + (error "Abort")) + (save-excursion + (save-window-excursion + (mapc + (lambda (b) + (when (and (with-current-buffer b (org-mode-p)) + (with-current-buffer b buffer-file-name)) + (switch-to-buffer b) + (revert-buffer t 'no-confirm))) + (buffer-list))))) + ;;;; Agenda files ;;;###autoload