Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2017-01-17 12:02:02 +01:00
commit 4d0609f8af
1 changed files with 46 additions and 42 deletions

View File

@ -1566,22 +1566,24 @@ This will add overlays to the date lines, to show the summary for each day."
(if (member property '("CLOCKSUM" "CLOCKSUM_T")) (if (member property '("CLOCKSUM" "CLOCKSUM_T"))
(list property title width ":" nil) (list property title width ":" nil)
spec)))) spec))))
org-columns-current-fmt-compiled)) org-columns-current-fmt-compiled)))
entries)
;; Ensure there's at least one summation column. ;; Ensure there's at least one summation column.
(when (cl-some (lambda (spec) (nth 3 spec)) fmt) (when (cl-some (lambda (spec) (nth 3 spec)) fmt)
(goto-char (point-max)) (goto-char (point-max))
(catch :complete (catch :complete
(while t (while t
(when (or (get-text-property (point) 'org-date-line) (when (or (get-text-property (point) 'org-date-line)
(eq (get-text-property (point) 'face) 'org-agenda-structure)) (eq (get-text-property (point) 'face)
'org-agenda-structure))
;; OK, this is a date line that should be used. ;; OK, this is a date line that should be used.
(let (entries)
(let (rest) (let (rest)
(dolist (c cache (setq cache rest)) (dolist (c cache)
(if (> (car c) (point)) (if (> (car c) (point))
(push c entries) (push c entries)
(push c rest)))) (push c rest)))
;; Now ENTRIES contains entries below the current one. (setq cache rest))
;; ENTRIES contains entries below the current one.
;; CACHE is the rest. Compute the summaries for the ;; CACHE is the rest. Compute the summaries for the
;; properties we want, set nil properties for the rest. ;; properties we want, set nil properties for the rest.
(when (setq entries (mapcar #'cdr entries)) (when (setq entries (mapcar #'cdr entries))
@ -1600,21 +1602,23 @@ This will add overlays to the date lines, to show the summary for each day."
(`(,_ ,_ ,_ ,operator ,printf) (`(,_ ,_ ,_ ,operator ,printf)
(let* ((summarize (org-columns--summarize operator)) (let* ((summarize (org-columns--summarize operator))
(values (values
;; Use real values for summary, not those ;; Use real values for summary, not
;; prepared for display. ;; those prepared for display.
(delq nil (delq nil
(mapcar (mapcar
(lambda (e) (lambda (e) (org-string-nw-p
(org-string-nw-p (nth 1 (assoc spec e)))) (nth 1 (assoc spec e))))
entries))) entries)))
(final (if values (funcall summarize values printf) (final (if values
(funcall summarize values printf)
""))) "")))
(unless (equal final "") (unless (equal final "")
(put-text-property 0 (length final) 'face 'bold final)) (put-text-property 0 (length final)
'face 'bold final))
(list spec final final))))) (list spec final final)))))
fmt) fmt)
'dateline) 'dateline)
(setq-local org-agenda-columns-active t))) (setq-local org-agenda-columns-active t))))
(if (bobp) (throw :complete t) (forward-line -1))))))) (if (bobp) (throw :complete t) (forward-line -1)))))))
(defun org-agenda-colview-compute (fmt) (defun org-agenda-colview-compute (fmt)