0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-24 15:02:52 +00:00

Agenda: New command to revert all Org-mode buffers from files

This commit is contained in:
Carsten Dominik 2009-02-10 13:51:53 +01:00
parent f8cc236c26
commit ce42b4be86
3 changed files with 30 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2009-02-10 Carsten Dominik <carsten.dominik@gmail.com>
* 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 <carsten.dominik@gmail.com>
* org.el (org-return): Implement `org-return-follows-link' in the

View file

@ -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."

View file

@ -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