From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: [PATCH] Allow caption and header text in clocktable dblocks Date: Tue, 10 Sep 2013 12:19:27 +0200 Message-ID: <86d2ohdln4.fsf_-_@somewhere.org> References: <871u5653or.fsf@somewhere.org> <87a9jt3o2l.fsf@gmail.com> <87a9jtt4er.fsf@somewhere.org> <878uzc4xwt.fsf@gmail.com> <874n9zisux.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello Francesco, "Francesco Pizzolante" wrote: > Nicolas Goaziou wrote: >> "Francesco Pizzolante" writes: >> >>> But if I try what you suggest and move the #+ATTR_LATEX line inside the >>> dynamic block (after the #+BEGIN: clocktable and just before the generated >>> table), then this line gets lost as soon as the dynamic block is >>> regenerated, which is not what I expect. >> >> Then some attribute could be added to dynamic block arguments in order to >> re-create the ATTR_LATEX keyword each time. IIRC we did that for #+CAPTION >> some months ago. It shouldn't be difficult to do it for this one. > > I've seen, indeed (thanks!), that there was a ":header" option, which you > can use to add free text in front of the dynamic table. > > #+BEGIN: clocktable :maxlevel 2 :scope ("clock-file.org") :block 2013-08 :fileskip0 t :lang "en" :header "#+ATTR_LaTeX: :environment longtabu :align lXrr\n" > #+ATTR_LaTeX: :environment longtabu :align lXrr > | File | Headline | Time | | > |----------------+---------------------+--------+------| > | | ALL Total time | 1:44 | | > |----------------+---------------------+--------+------| > | clock-file.org | File time | *1:44* | | > | | Projet management | 1:44 | | > | | \__ Writing reports | | 1:44 | > #+END: > > Though, doing so, there is no CAPTION anymore... > > Maybe adding a ":header" should not strip the autogenerated caption? I need that as well -- here is the patch (if Nicolas is OK with it)... Best regards, Seb From: "Sebastien Vauban" Date: Tue, 10 Sep 2013 12:15:26 +0200 Subject: [PATCH] Allow caption and header text in clocktable dblocks * org-clock.el (org-clocktable-write-default): Allow caption and header text in clocktable dblocks. --- lisp/org-clock.el | 26 ++++++++++++++------------ 1 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index c39b589..27fba2a 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -2388,19 +2388,21 @@ from the dynamic block definition." ;; Now we need to output this tsuff (goto-char ipos) - ;; Insert the text *before* the actual table + ;; Insert the caption (insert-before-markers - (or header - ;; Format the standard header - (concat - "#+CAPTION: " - (nth 9 lwords) " [" - (substring - (format-time-string (cdr org-time-stamp-formats)) - 1 -1) - "]" - (if block (concat ", for " range-text ".") "") - "\n"))) + ;; Format the standard header + (concat + "#+CAPTION: " + (nth 9 lwords) " [" + (substring + (format-time-string (cdr org-time-stamp-formats)) + 1 -1) + "]" + (if block (concat ", for " range-text ".") "") + "\n")) + + ;; Insert the header text *before* the actual table + (insert-before-markers header) ;; Insert the narrowing line (when (and narrow (integerp narrow) (not narrow-cut-p)) -- 1.7.9