Browse Source

Code clean-up: rename some agenda internals.

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

* org-agenda.el (org-agenda-prepare-window): Rename from
(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.
Bastien Guerry 7 years ago
6 changed files with 23 additions and 23 deletions
  1. 1 1
  2. 14 14
  3. 2 2
  4. 1 1
  5. 1 1
  6. 4 4

+ 1 - 1

@@ -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
 file and store it under the name `org-combined-agenda-remind-file'."
-    (org-prepare-agenda-buffers files)
+    (org-agenda-prepare-buffers files)
     (let* ((dir (org-export-directory
 		 :ical (list :publishing-directory

+ 14 - 14

@@ -2782,7 +2782,7 @@ L   Timeline for current buffer         #   List stuck projects (!=configure)
 (defvar org-agenda-multi-current-cmd nil)
 (defvar org-agenda-multi-overriding-arguments nil)
 (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
   ;; block agenda, the individual blocks do not do that.
@@ -3345,7 +3345,7 @@ generating a new one."
       ;; does not have org variables local
-(defun org-prepare-agenda-window (abuf)
+(defun org-agenda-prepare-window (abuf)
   "Setup agenda buffer in the window."
   (let* ((awin (get-buffer-window abuf))
@@ -3369,11 +3369,11 @@ generating a new one."
     (setq org-pre-agenda-window-conf
 	  (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)
 	;; 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")
 	(or org-agenda-multi (org-fit-agenda-window))
 	(throw 'exit nil))
@@ -3402,7 +3402,7 @@ generating a new one."
       ;; Setting any org variables that are in org-agenda-local-vars
       ;; 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)
       (let ((inhibit-read-only t)) (erase-buffer))
@@ -3410,7 +3410,7 @@ generating a new one."
       (setq org-agenda-buffer (current-buffer))
       (setq org-agenda-contributing-files 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
 	    (org-uniquify org-todo-keywords-for-agenda))
       (setq org-done-keywords-for-agenda
@@ -3709,7 +3709,7 @@ dates."
 	(setq day-numbers (delq nil (mapcar (lambda(x)
 					      (if (>= x today) x nil))
-    (org-prepare-agenda (concat "Timeline " (file-name-nondirectory entry)))
+    (org-agenda-prepare (concat "Timeline " (file-name-nondirectory entry)))
     (org-compile-prefix-format 'timeline)
     (org-set-sorting-strategy 'timeline)
     (if org-agenda-show-log-scoped (push :closed args))
@@ -3867,7 +3867,7 @@ given in `org-agenda-start-on-weekday'."
   (interactive "P")
   (if (and (integerp arg) (> arg 0))
       (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))
   (if 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
 in `org-agenda-text-search-extra-files'."
   (interactive "P")
-  (org-prepare-agenda "SEARCH")
+  (org-agenda-prepare "SEARCH")
   (org-compile-prefix-format 'search)
   (org-set-sorting-strategy 'search)
   (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
   (interactive "P")
-  (org-prepare-agenda "TODO")
+  (org-agenda-prepare "TODO")
   (org-compile-prefix-format 'todo)
   (org-set-sorting-strategy 'todo)
   (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 matcher (org-make-tags-matcher match)
 	  match (car matcher) matcher (cdr matcher))
-    (org-prepare-agenda (concat "TAGS " match))
+    (org-agenda-prepare (concat "TAGS " match))
     (org-compile-prefix-format 'tags)
     (org-set-sorting-strategy 'tags)
     (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-wds (if (member "*" todo)
-			 (org-prepare-agenda-buffers (org-agenda-files
+			 (org-agenda-prepare-buffers (org-agenda-files
 						      nil 'ifmode))
@@ -4862,7 +4862,7 @@ function from a program - use `org-agenda-get-day-entries' instead."
 	      (> (- time
-      (org-prepare-agenda-buffers files))
+      (org-agenda-prepare-buffers files))
     (setq org-diary-last-run-time time)
     ;; If this is called during org-agenda, don't return any entries to
     ;; 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
 	 (org-agenda-buffer nil))
     ;; Get all entries which may contain an appt
-    (org-prepare-agenda-buffers files)
+    (org-agenda-prepare-buffers files)
     (while (setq file (pop files))
       (setq entries
 	    (delq nil

+ 2 - 2

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

+ 1 - 1

@@ -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
 file and store it under the name `org-combined-agenda-icalendar-file'."
-    (org-prepare-agenda-buffers files)
+    (org-agenda-prepare-buffers files)
     (let* ((dir (org-export-directory
 		 :ical (list :publishing-directory

+ 1 - 1

@@ -418,7 +418,7 @@ agenda view showing the flagged items."
 	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 todo-kwds (org-delete-all

+ 4 - 4

@@ -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
 also TODO lines."
   (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))
 (defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
@@ -14259,7 +14259,7 @@ a *different* entry, you cannot use these techniques."
 	  (if (not scope)
-		(org-prepare-agenda-buffers
+		(org-agenda-prepare-buffers
 		 (list (buffer-file-name (current-buffer))))
 		(setq res (org-scan-tags func matcher todo-only start-level)))
 	    ;; Get the right scope
@@ -14275,7 +14275,7 @@ a *different* entry, you cannot use these techniques."
 	      (setq scope (list (buffer-file-name))))
 	     ((eq scope 'file-with-archives)
 	      (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))
 	      (with-current-buffer (org-find-base-buffer-visiting file)
@@ -17060,7 +17060,7 @@ When a buffer is unmodified, it is just killed.  When modified, it is saved
 	(with-current-buffer buf (save-buffer)))
       (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."
   (let ((pa '(:org-archived t))