org-colview.el: Fix several bugs

* org-colview.el (org-columns-goto-top-level): Correctly move
the marker `org-columns-top-level-marker'.
(org-agenda-columns): Don't set
`org-agenda-overriding-columns-format' as a buffer variable,
as we only need it dynamically.
(org-agenda-colview-summarize): Fix a bug in returning the
match string.

(The problem with `org-columns-goto-top-level' was introduced
by the commit 8d9e83.)

Thanks to Hannes Schulz and Jacob Riko who reported this.
This commit is contained in:
Bastien Guerry 2012-08-31 07:56:58 +02:00
parent 93fcfe4d36
commit eed50349bc

View file

@ -681,10 +681,10 @@ around it."
(defun org-columns-goto-top-level () (defun org-columns-goto-top-level ()
(when (condition-case nil (org-back-to-heading) (error nil)) (when (condition-case nil (org-back-to-heading) (error nil))
(org-entry-get nil "COLUMNS" t) (org-entry-get nil "COLUMNS" t))
(if (marker-position org-entry-property-inherited-from) (if (marker-position org-entry-property-inherited-from)
(move-marker org-columns-top-level-marker org-entry-property-inherited-from) (move-marker org-columns-top-level-marker org-entry-property-inherited-from)
(move-marker org-columns-top-level-marker (point))))) (move-marker org-columns-top-level-marker (point))))
(defun org-columns (&optional columns-fmt-string) (defun org-columns (&optional columns-fmt-string)
"Turn on column view on an org-mode file. "Turn on column view on an org-mode file.
@ -1368,8 +1368,7 @@ and tailing newline characters."
(cond (cond
((and (boundp 'org-agenda-overriding-columns-format) ((and (boundp 'org-agenda-overriding-columns-format)
org-agenda-overriding-columns-format) org-agenda-overriding-columns-format)
(setq fmt org-agenda-overriding-columns-format) (setq fmt org-agenda-overriding-columns-format))
(org-set-local 'org-agenda-overriding-columns-format fmt))
((setq m (org-get-at-bol 'org-hd-marker)) ((setq m (org-get-at-bol 'org-hd-marker))
(setq fmt (or (org-entry-get m "COLUMNS" t) (setq fmt (or (org-entry-get m "COLUMNS" t)
(with-current-buffer (marker-buffer m) (with-current-buffer (marker-buffer m)
@ -1425,7 +1424,8 @@ and tailing newline characters."
This will add overlays to the date lines, to show the summary for each day." This will add overlays to the date lines, to show the summary for each day."
(let* ((fmt (mapcar (lambda (x) (let* ((fmt (mapcar (lambda (x)
(if (string-match "CLOCKSUM.*" (car x)) (if (string-match "CLOCKSUM.*" (car x))
(list (match-string 0) (nth 1 x) (nth 2 x) ":" 'add_times (list (match-string 0 (car x))
(nth 1 x) (nth 2 x) ":" 'add_times
nil '+ nil) nil '+ nil)
x)) x))
org-columns-current-fmt-compiled)) org-columns-current-fmt-compiled))