Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

This commit is contained in:
Bastien Guerry 2010-11-07 14:42:39 +01:00
commit dfb52eb7a7
2 changed files with 21 additions and 10 deletions

View File

@ -5923,9 +5923,8 @@ but you can specify your own function using the @code{:formatter} parameter.
:emphasize @r{When @code{t}, emphasize level one and level two items.}
:link @r{Link the item headlines in the table to their origins.}
:narrow @r{An integer to limit the width of the headline column in}
@r{the org table. Does not work together with @code{:link}.}
@r{If you write it like @samp{50!}, then the headline will also}
@r{be shortened in export, and will work with @code{:link}.}
@r{the org table. If you write it like @samp{50!}, then the}
@r{headline will also be shortened in export.}
:indent @r{Indent each headline field according to its level.}
:tcolumns @r{Number of columns to be used for times. If this is smaller}
@r{than @code{:maxlevel}, lower levels will be lumped into one column.}

View File

@ -1895,6 +1895,7 @@ from the dynamic block defintion."
(te (plist-get params :tend))
(header (plist-get params :header))
(narrow (plist-get params :narrow))
(link (plist-get params :link))
(maxlevel (or (plist-get params :maxlevel) 3))
(emph (plist-get params :emphasize))
(level-p (plist-get params :level))
@ -1902,7 +1903,7 @@ from the dynamic block defintion."
(ntcol (max 1 (or (plist-get params :tcolumns) 100)))
(rm-file-column (plist-get params :one-file-with-archives))
(indent (plist-get params :indent))
link range-text total-time tbl level hlc formula pcol
range-text total-time tbl level hlc formula pcol
file-time entries entry headline
recalc content narrow-cut-p)
@ -1917,8 +1918,8 @@ from the dynamic block defintion."
(when (and narrow (integerp narrow) link)
;; We cannot have both integer narrow and link
(message
"Suppressing :narrow INTEGER in clocktable because :link was also given")
(setq narrow nil))
"Using hard narrowing in clocktable to allow for links")
(setq narrow (intern (format "%d!" narrow))))
(when narrow
(cond
@ -1926,9 +1927,11 @@ from the dynamic block defintion."
((and (symbolp narrow)
(string-match "\\`[0-9]+!\\'" (symbol-name narrow)))
(setq narrow-cut-p t
narrow (string-to-number (substring (symbol-name narrow) 0 -1))))
narrow (string-to-number (substring (symbol-name narrow)
0 -1))))
(t
(error "Invalid value %s of :narrow property in clock table" narrow))))
(error "Invalid value %s of :narrow property in clock table"
narrow))))
(when block
;; Get the range text for the header
@ -2008,8 +2011,17 @@ from the dynamic block defintion."
(setq level (car entry)
headline (nth 1 entry)
hlc (if emph (or (cdr (assoc level hlchars)) "") ""))
(if narrow-cut-p
(setq headline (org-shorten-string headline narrow)))
(when narrow-cut-p
(if (and (string-match (concat "\\`" org-bracket-link-regexp
"\\'")
headline)
(match-end 3))
(setq headline
(format "[[%s][%s]]"
(match-string 1 headline)
(org-shorten-string (match-string 3 headline)
narrow)))
(setq headline (org-shorten-string headline narrow))))
(insert-before-markers
"|" ; start the table line
(if multifile "|" "") ; free space for file name column?