Code clean-up: rename some agenda internals.

* org.el (org-agenda-prepare-buffers): Rename from
`org-prepare-agenda-buffers'.
(org-match-sparse-tree, org-map-entries): Use the new names.

* org-agenda.el (org-agenda-prepare-window): Rename from
`org-prepare-agenda-window'.
(org-agenda-prepare): Rename from `org-prepare-agenda'.
(org-agenda-run-series, org-agenda-prepare, org-timeline)
(org-agenda-list, org-search-view, org-todo-list)
(org-tags-view, org-agenda-list-stuck-projects, org-diary)
(org-agenda-to-appt): Use the new names.

* org-mobile.el (org-mobile-create-index-file): Ditto.

* org-icalendar.el (org-export-icalendar): Ditto.

* org-clock.el (org-dblock-write:clocktable)
(org-dblock-write:clocktable): Ditto.

* org2rem.el (org2rem): Ditto.
This commit is contained in:
Bastien Guerry 2012-08-28 13:11:12 +02:00
parent 89cdbda63e
commit a9b8778b0c
6 changed files with 23 additions and 23 deletions

View File

@ -211,7 +211,7 @@ The file is stored under the name `org-combined-agenda-remind-file'."
If COMBINE is non-nil, combine all calendar entries into a single large If COMBINE is non-nil, combine all calendar entries into a single large
file and store it under the name `org-combined-agenda-remind-file'." file and store it under the name `org-combined-agenda-remind-file'."
(save-excursion (save-excursion
(org-prepare-agenda-buffers files) (org-agenda-prepare-buffers files)
(let* ((dir (org-export-directory (let* ((dir (org-export-directory
:ical (list :publishing-directory :ical (list :publishing-directory
org-export-publishing-directory))) org-export-publishing-directory)))

View File

@ -2782,7 +2782,7 @@ L Timeline for current buffer # List stuck projects (!=configure)
(defvar org-agenda-multi-current-cmd nil) (defvar org-agenda-multi-current-cmd nil)
(defvar org-agenda-multi-overriding-arguments nil) (defvar org-agenda-multi-overriding-arguments nil)
(defun org-agenda-run-series (name series) (defun org-agenda-run-series (name series)
(org-let (nth 1 series) '(org-prepare-agenda name)) (org-let (nth 1 series) '(org-agenda-prepare name))
;; We need to reset agenda markers here, because when constructing a ;; We need to reset agenda markers here, because when constructing a
;; block agenda, the individual blocks do not do that. ;; block agenda, the individual blocks do not do that.
(org-agenda-reset-markers) (org-agenda-reset-markers)
@ -3345,7 +3345,7 @@ generating a new one."
;; does not have org variables local ;; does not have org variables local
org-agenda-this-buffer-is-sticky)))) org-agenda-this-buffer-is-sticky))))
(defun org-prepare-agenda-window (abuf) (defun org-agenda-prepare-window (abuf)
"Setup agenda buffer in the window." "Setup agenda buffer in the window."
(let* ((awin (get-buffer-window abuf)) (let* ((awin (get-buffer-window abuf))
wconf) wconf)
@ -3369,11 +3369,11 @@ generating a new one."
(setq org-pre-agenda-window-conf (setq org-pre-agenda-window-conf
(or org-pre-agenda-window-conf wconf)))) (or org-pre-agenda-window-conf wconf))))
(defun org-prepare-agenda (&optional name) (defun org-agenda-prepare (&optional name)
(if (org-agenda-use-sticky-p) (if (org-agenda-use-sticky-p)
(progn (progn
;; Popup existing buffer ;; Popup existing buffer
(org-prepare-agenda-window (get-buffer org-agenda-buffer-name)) (org-agenda-prepare-window (get-buffer org-agenda-buffer-name))
(message "Sticky Agenda buffer, use `r' to refresh") (message "Sticky Agenda buffer, use `r' to refresh")
(or org-agenda-multi (org-fit-agenda-window)) (or org-agenda-multi (org-fit-agenda-window))
(throw 'exit nil)) (throw 'exit nil))
@ -3402,7 +3402,7 @@ generating a new one."
;; Setting any org variables that are in org-agenda-local-vars ;; Setting any org variables that are in org-agenda-local-vars
;; list need to be done after the prepare call ;; list need to be done after the prepare call
(org-prepare-agenda-window (get-buffer-create org-agenda-buffer-name)) (org-agenda-prepare-window (get-buffer-create org-agenda-buffer-name))
(setq buffer-read-only nil) (setq buffer-read-only nil)
(org-agenda-reset-markers) (org-agenda-reset-markers)
(let ((inhibit-read-only t)) (erase-buffer)) (let ((inhibit-read-only t)) (erase-buffer))
@ -3410,7 +3410,7 @@ generating a new one."
(setq org-agenda-buffer (current-buffer)) (setq org-agenda-buffer (current-buffer))
(setq org-agenda-contributing-files nil) (setq org-agenda-contributing-files nil)
(setq org-agenda-columns-active nil) (setq org-agenda-columns-active nil)
(org-prepare-agenda-buffers (org-agenda-files nil 'ifmode)) (org-agenda-prepare-buffers (org-agenda-files nil 'ifmode))
(setq org-todo-keywords-for-agenda (setq org-todo-keywords-for-agenda
(org-uniquify org-todo-keywords-for-agenda)) (org-uniquify org-todo-keywords-for-agenda))
(setq org-done-keywords-for-agenda (setq org-done-keywords-for-agenda
@ -3709,7 +3709,7 @@ dates."
(setq day-numbers (delq nil (mapcar (lambda(x) (setq day-numbers (delq nil (mapcar (lambda(x)
(if (>= x today) x nil)) (if (>= x today) x nil))
day-numbers)))) day-numbers))))
(org-prepare-agenda (concat "Timeline " (file-name-nondirectory entry))) (org-agenda-prepare (concat "Timeline " (file-name-nondirectory entry)))
(org-compile-prefix-format 'timeline) (org-compile-prefix-format 'timeline)
(org-set-sorting-strategy 'timeline) (org-set-sorting-strategy 'timeline)
(if org-agenda-show-log-scoped (push :closed args)) (if org-agenda-show-log-scoped (push :closed args))
@ -3867,7 +3867,7 @@ given in `org-agenda-start-on-weekday'."
(interactive "P") (interactive "P")
(if (and (integerp arg) (> arg 0)) (if (and (integerp arg) (> arg 0))
(setq span arg arg nil)) (setq span arg arg nil))
(org-prepare-agenda "Day/Week") (org-agenda-prepare "Day/Week")
(setq start-day (or start-day org-agenda-start-day)) (setq start-day (or start-day org-agenda-start-day))
(if org-agenda-overriding-arguments (if org-agenda-overriding-arguments
(setq arg (car org-agenda-overriding-arguments) (setq arg (car org-agenda-overriding-arguments)
@ -4120,7 +4120,7 @@ as a whole, to include whitespace.
This command searches the agenda files, and in addition the files listed This command searches the agenda files, and in addition the files listed
in `org-agenda-text-search-extra-files'." in `org-agenda-text-search-extra-files'."
(interactive "P") (interactive "P")
(org-prepare-agenda "SEARCH") (org-agenda-prepare "SEARCH")
(org-compile-prefix-format 'search) (org-compile-prefix-format 'search)
(org-set-sorting-strategy 'search) (org-set-sorting-strategy 'search)
(let* ((props (list 'face nil (let* ((props (list 'face nil
@ -4331,7 +4331,7 @@ the list to these. When using \\[universal-argument], you will be prompted
for a keyword. A numeric prefix directly selects the Nth keyword in for a keyword. A numeric prefix directly selects the Nth keyword in
`org-todo-keywords-1'." `org-todo-keywords-1'."
(interactive "P") (interactive "P")
(org-prepare-agenda "TODO") (org-agenda-prepare "TODO")
(org-compile-prefix-format 'todo) (org-compile-prefix-format 'todo)
(org-set-sorting-strategy 'todo) (org-set-sorting-strategy 'todo)
(if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil)) (if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg nil))
@ -4409,7 +4409,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
(setq match nil)) (setq match nil))
(setq matcher (org-make-tags-matcher match) (setq matcher (org-make-tags-matcher match)
match (car matcher) matcher (cdr matcher)) match (car matcher) matcher (cdr matcher))
(org-prepare-agenda (concat "TAGS " match)) (org-agenda-prepare (concat "TAGS " match))
(org-compile-prefix-format 'tags) (org-compile-prefix-format 'tags)
(org-set-sorting-strategy 'tags) (org-set-sorting-strategy 'tags)
(setq org-agenda-query-string match) (setq org-agenda-query-string match)
@ -4657,7 +4657,7 @@ of what a project is and how to check if it stuck, customize the variable
(todo (nth 1 org-stuck-projects)) (todo (nth 1 org-stuck-projects))
(todo-wds (if (member "*" todo) (todo-wds (if (member "*" todo)
(progn (progn
(org-prepare-agenda-buffers (org-agenda-files (org-agenda-prepare-buffers (org-agenda-files
nil 'ifmode)) nil 'ifmode))
(org-delete-all (org-delete-all
org-done-keywords-for-agenda org-done-keywords-for-agenda
@ -4862,7 +4862,7 @@ function from a program - use `org-agenda-get-day-entries' instead."
(> (- time (> (- time
org-diary-last-run-time) org-diary-last-run-time)
3)) 3))
(org-prepare-agenda-buffers files)) (org-agenda-prepare-buffers files))
(setq org-diary-last-run-time time) (setq org-diary-last-run-time time)
;; If this is called during org-agenda, don't return any entries to ;; If this is called during org-agenda, don't return any entries to
;; the calendar. Org Agenda will list these entries itself. ;; the calendar. Org Agenda will list these entries itself.
@ -9164,7 +9164,7 @@ to override `appt-message-warning-time'."
(files (org-agenda-files 'unrestricted)) entries file (files (org-agenda-files 'unrestricted)) entries file
(org-agenda-buffer nil)) (org-agenda-buffer nil))
;; Get all entries which may contain an appt ;; Get all entries which may contain an appt
(org-prepare-agenda-buffers files) (org-agenda-prepare-buffers files)
(while (setq file (pop files)) (while (setq file (pop files))
(setq entries (setq entries
(delq nil (delq nil

View File

@ -2213,7 +2213,7 @@ the currently selected interval size."
;; we collect from several files ;; we collect from several files
(let* ((files scope) (let* ((files scope)
file) file)
(org-prepare-agenda-buffers files) (org-agenda-prepare-buffers files)
(while (setq file (pop files)) (while (setq file (pop files))
(with-current-buffer (find-buffer-visiting file) (with-current-buffer (find-buffer-visiting file)
(save-excursion (save-excursion
@ -2222,7 +2222,7 @@ the currently selected interval size."
;; Just from the current file ;; Just from the current file
(save-restriction (save-restriction
;; get the right range into the restriction ;; get the right range into the restriction
(org-prepare-agenda-buffers (list (buffer-file-name))) (org-agenda-prepare-buffers (list (buffer-file-name)))
(cond (cond
((not scope)) ; use the restriction as it is now ((not scope)) ; use the restriction as it is now
((eq scope 'file) (widen)) ((eq scope 'file) (widen))

View File

@ -256,7 +256,7 @@ The file is stored under the name `org-combined-agenda-icalendar-file'."
If COMBINE is non-nil, combine all calendar entries into a single large If COMBINE is non-nil, combine all calendar entries into a single large
file and store it under the name `org-combined-agenda-icalendar-file'." file and store it under the name `org-combined-agenda-icalendar-file'."
(save-excursion (save-excursion
(org-prepare-agenda-buffers files) (org-agenda-prepare-buffers files)
(let* ((dir (org-export-directory (let* ((dir (org-export-directory
:ical (list :publishing-directory :ical (list :publishing-directory
org-export-publishing-directory))) org-export-publishing-directory)))

View File

@ -418,7 +418,7 @@ agenda view showing the flagged items."
org-mobile-directory)) org-mobile-directory))
file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds) file link-name todo-kwds done-kwds tags drawers entry kwds dwds twds)
(org-prepare-agenda-buffers (mapcar 'car files-alist)) (org-agenda-prepare-buffers (mapcar 'car files-alist))
(setq done-kwds (org-uniquify org-done-keywords-for-agenda)) (setq done-kwds (org-uniquify org-done-keywords-for-agenda))
(setq todo-kwds (org-delete-all (setq todo-kwds (org-delete-all
done-kwds done-kwds

View File

@ -13326,7 +13326,7 @@ MATCH can contain positive and negative selection of tags, like
If optional argument TODO-ONLY is non-nil, only select lines that are If optional argument TODO-ONLY is non-nil, only select lines that are
also TODO lines." also TODO lines."
(interactive "P") (interactive "P")
(org-prepare-agenda-buffers (list (current-buffer))) (org-agenda-prepare-buffers (list (current-buffer)))
(org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match)) todo-only)) (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match)) todo-only))
(defalias 'org-tags-sparse-tree 'org-match-sparse-tree) (defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
@ -14259,7 +14259,7 @@ a *different* entry, you cannot use these techniques."
(if (not scope) (if (not scope)
(progn (progn
(org-prepare-agenda-buffers (org-agenda-prepare-buffers
(list (buffer-file-name (current-buffer)))) (list (buffer-file-name (current-buffer))))
(setq res (org-scan-tags func matcher todo-only start-level))) (setq res (org-scan-tags func matcher todo-only start-level)))
;; Get the right scope ;; Get the right scope
@ -14275,7 +14275,7 @@ a *different* entry, you cannot use these techniques."
(setq scope (list (buffer-file-name)))) (setq scope (list (buffer-file-name))))
((eq scope 'file-with-archives) ((eq scope 'file-with-archives)
(setq scope (org-add-archive-files (list (buffer-file-name)))))) (setq scope (org-add-archive-files (list (buffer-file-name))))))
(org-prepare-agenda-buffers scope) (org-agenda-prepare-buffers scope)
(while (setq file (pop scope)) (while (setq file (pop scope))
(with-current-buffer (org-find-base-buffer-visiting file) (with-current-buffer (org-find-base-buffer-visiting file)
(save-excursion (save-excursion
@ -17060,7 +17060,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved
(with-current-buffer buf (save-buffer))) (with-current-buffer buf (save-buffer)))
(kill-buffer buf)))) (kill-buffer buf))))
(defun org-prepare-agenda-buffers (files) (defun org-agenda-prepare-buffers (files)
"Create buffers for all agenda files, protect archived trees and comments." "Create buffers for all agenda files, protect archived trees and comments."
(interactive) (interactive)
(let ((pa '(:org-archived t)) (let ((pa '(:org-archived t))