summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-12 14:49:02 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-12 14:49:02 +0200
commit1e268ad334fad655f3f2748143206b54f18a1d6c (patch)
tree44ab7ccda0cae732f60a9744a9a7328746c8a14c
parent0359f7550a1702538b676e681df093fdd11c3eb6 (diff)
downloadorg-mode-1e268ad334fad655f3f2748143206b54f18a1d6c.tar.gz
org-colview: Fix column view area
* lisp/org-colview.el (org-columns-goto-top-level): Actually move point. (org-columns): Adapt to change above. Reported-by: Johan Sandblom <js@ndblom.se> <http://permalink.gmane.org/gmane.emacs.orgmode/99892>
-rw-r--r--lisp/org-colview.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 8ba8c97..3838531 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -680,11 +680,14 @@ around it."
fmt))
(defun org-columns-goto-top-level ()
- (when (condition-case nil (org-back-to-heading) (error nil))
- (org-entry-get nil "COLUMNS" t))
- (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 (point))))
+ "Move to the beginning of the column view area.
+Also sets `org-columns-top-level-marker' to the new position."
+ (goto-char
+ (move-marker
+ org-columns-top-level-marker
+ (cond ((org-before-first-heading-p) (point-min))
+ ((org-entry-get nil "COLUMNS" t) org-entry-property-inherited-from)
+ (t (org-back-to-heading) (point))))))
;;;###autoload
(defun org-columns (&optional columns-fmt-string)
@@ -703,9 +706,8 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(save-excursion
(save-restriction
(narrow-to-region
- org-columns-top-level-marker
- (or (ignore-errors (org-end-of-subtree t t)) (point-max)))
- (goto-char (point-min))
+ (point)
+ (if (org-at-heading-p) (org-end-of-subtree t t) (point-max)))
(when (assoc "CLOCKSUM" org-columns-current-fmt-compiled)
(org-clock-sum))
(when (assoc "CLOCKSUM_T" org-columns-current-fmt-compiled)