0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 23:17:49 +00:00

org-colview: Fix length of columns

* lisp/org-colview.el (org-columns-display-here): Do not add star to
  headlines at the display level...
(org-columns): ... but when collecting values, here...
(org-agenda-columns): ... and there.

Reported-by: Michael Brand <michael.ch.brand@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104846>
This commit is contained in:
Nicolas Goaziou 2016-02-06 00:04:35 +01:00
parent aee808987d
commit 3178fcb90d

View file

@ -162,8 +162,7 @@ This is the compiled version of the format.")
(interactive) (interactive)
(save-excursion (save-excursion
(beginning-of-line) (beginning-of-line)
(let* ((level (or (org-current-level) 0)) (let* ((level-face (and (looking-at "\\(\\**\\)\\(\\* \\)")
(level-face (and (looking-at "\\(\\**\\)\\(\\* \\)")
(org-get-level-face 2))) (org-get-level-face 2)))
(ref-face (or level-face (ref-face (or level-face
(and (eq major-mode 'org-agenda-mode) (and (eq major-mode 'org-agenda-mode)
@ -212,10 +211,7 @@ This is the compiled version of the format.")
((functionp org-columns-modify-value-for-display-function) ((functionp org-columns-modify-value-for-display-function)
(funcall org-columns-modify-value-for-display-function (funcall org-columns-modify-value-for-display-function
title val)) title val))
((equal property "ITEM") ((equal property "ITEM") (org-columns-compact-links val))
(concat (make-string level ?*)
" "
(org-columns-compact-links val)))
(fc (org-columns-number-to-string (fc (org-columns-number-to-string
(org-columns-string-to-number val fm) fm fc)) (org-columns-string-to-number val fm) fm fc))
((and calc (functionp calc) ((and calc (functionp calc)
@ -717,8 +713,14 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format."
(org-map-entries (org-map-entries
(lambda () (lambda ()
(cons (point) (cons (point)
(mapcar (lambda (p) (mapcar
(cons p (org-columns--value p (point)))) (lambda (p)
(cons p
(let ((v (org-columns--value p (point))))
(if (not (equal "ITEM" p)) v
(concat (make-string (org-current-level) ?*)
" "
v)))))
column-names))) column-names)))
nil nil (and org-columns-skip-archived-trees 'archive)))) nil nil (and org-columns-skip-archived-trees 'archive))))
(when cache (when cache
@ -1430,20 +1432,25 @@ and tailing newline characters."
(let ((value (org-columns--value name (point)))) (let ((value (org-columns--value name (point))))
(cons (cons
name name
(if (and org-agenda-columns-add-appointments-to-effort-sum (cond
((and org-agenda-columns-add-appointments-to-effort-sum
(not value) (not value)
(eq (compare-strings name nil nil (eq (compare-strings name nil nil
org-effort-property nil nil org-effort-property nil nil
t) t)
t) t)
;; Effort property is not defined. Try ;; Effort property is not defined. Try ;
;; to use appointment duration. ;; to use appointment duration. ;
(get-text-property (point) 'duration)) (get-text-property (point) 'duration))
(org-propertize (org-propertize
(org-minutes-to-clocksum-string (org-minutes-to-clocksum-string
(get-text-property (point) 'duration)) (get-text-property (point) 'duration))
'face 'org-warning) 'face 'org-warning))
value)))) ((equal "ITEM" name)
(concat (make-string (org-current-level) ?*)
" "
value))
(t value)))))
names))) names)))
cache)) cache))
(forward-line))) (forward-line)))