|
@@ -2576,15 +2576,12 @@ If CMD-KEY is a string of length 1, it is used as a key in
|
|
|
longer string it is used as a tags/todo match string.
|
|
|
Parameters are alternating variable names and values that will be bound
|
|
|
before running the agenda command."
|
|
|
- (let (pars)
|
|
|
- (while parameters
|
|
|
- (push (list (pop parameters) (if parameters (pop parameters))) pars))
|
|
|
+ (org-eval-in-environment (org-make-parameter-alist parameters)
|
|
|
(if (> (length cmd-key) 2)
|
|
|
- (eval (list 'let (nreverse pars)
|
|
|
- (list 'org-tags-view nil cmd-key)))
|
|
|
- (eval (list 'let (nreverse pars) (list 'org-agenda nil cmd-key))))
|
|
|
- (set-buffer org-agenda-buffer-name)
|
|
|
- (princ (org-encode-for-stdout (buffer-string)))))
|
|
|
+ (org-tags-view nil cmd-key)
|
|
|
+ (org-agenda nil cmd-key)))
|
|
|
+ (set-buffer org-agenda-buffer-name)
|
|
|
+ (princ (org-encode-for-stdout (buffer-string))))
|
|
|
|
|
|
;(defun org-encode-for-stdout (string)
|
|
|
; (if (fboundp 'encode-coding-string)
|
|
@@ -2631,30 +2628,26 @@ extra Sting with extra planning info
|
|
|
priority-l The priority letter if any was given
|
|
|
priority-n The computed numerical priority
|
|
|
agenda-day The day in the agenda where this is listed"
|
|
|
-
|
|
|
- (let (pars)
|
|
|
- (while parameters
|
|
|
- (push (list (pop parameters) (if parameters (pop parameters))) pars))
|
|
|
- (push (list 'org-agenda-remove-tags t) pars)
|
|
|
+ (org-eval-in-environment (append (org-agenda-remove-tags t)
|
|
|
+ (org-make-parameter-alist parameters))
|
|
|
(if (> (length cmd-key) 2)
|
|
|
- (eval (list 'let (nreverse pars)
|
|
|
- (list 'org-tags-view nil cmd-key)))
|
|
|
- (eval (list 'let (nreverse pars) (list 'org-agenda nil cmd-key))))
|
|
|
- (set-buffer org-agenda-buffer-name)
|
|
|
- (let* ((lines (org-split-string (buffer-string) "\n"))
|
|
|
- line)
|
|
|
- (while (setq line (pop lines))
|
|
|
- (catch 'next
|
|
|
- (if (not (get-text-property 0 'org-category line)) (throw 'next nil))
|
|
|
- (setq org-agenda-info
|
|
|
- (org-fix-agenda-info (text-properties-at 0 line)))
|
|
|
- (princ
|
|
|
- (org-encode-for-stdout
|
|
|
- (mapconcat 'org-agenda-export-csv-mapper
|
|
|
- '(org-category txt type todo tags date time extra
|
|
|
- priority-letter priority agenda-day)
|
|
|
- ",")))
|
|
|
- (princ "\n"))))))
|
|
|
+ (org-tags-view nil cmd-key)
|
|
|
+ (org-agenda nil cmd-key)))
|
|
|
+ (set-buffer org-agenda-buffer-name)
|
|
|
+ (let* ((lines (org-split-string (buffer-string) "\n"))
|
|
|
+ line)
|
|
|
+ (while (setq line (pop lines))
|
|
|
+ (catch 'next
|
|
|
+ (if (not (get-text-property 0 'org-category line)) (throw 'next nil))
|
|
|
+ (setq org-agenda-info
|
|
|
+ (org-fix-agenda-info (text-properties-at 0 line)))
|
|
|
+ (princ
|
|
|
+ (org-encode-for-stdout
|
|
|
+ (mapconcat 'org-agenda-export-csv-mapper
|
|
|
+ '(org-category txt type todo tags date time extra
|
|
|
+ priority-letter priority agenda-day)
|
|
|
+ ",")))
|
|
|
+ (princ "\n")))))
|
|
|
|
|
|
(defun org-fix-agenda-info (props)
|
|
|
"Make sure all properties on an agenda item have a canonical form.
|