Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-24 Thread Lele Gaifax
Nicolas Goaziou  writes:

> All your "Effort" values are expressed as HH:MM so Org does its best to
> produce a HH:MM summary. If you write at least one value as a duration,
> e.g., "10 h", the summary will also be expressed as a duration.

I see, thank you!
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-24 Thread Nicolas Goaziou
Lele Gaifax  writes:

> This is the equivalent, made with current master development org-mode:
>
> # -*- coding: utf-8 -*-
>
> #+TITLE: Test with current master revision of org-mode
> #+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)
>
>
> * This is a test
>   :LOGBOOK:
>   CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03
>   :END:
>
>
> #+BEGIN: columnview :hlines 1 :id global
> | Item   | Effort | Work |
>
> |++--|
> | This is a test |  30:00 | 3gg 0:03 |
> | Task A |  10:00 |  |
> | Task B |  10:00 |  |
> | Task C |  10:00 |  |
> #+END:
>
> ** Task A
>:PROPERTIES:
>:Effort:   10:00
>:END:
>
> ** Task B
>:PROPERTIES:
>:Effort:   10:00
>:END:
>
> ** Task C
>:PROPERTIES:
>:Effort:   10:00
>:END:

All your "Effort" values are expressed as HH:MM so Org does its best to
produce a HH:MM summary. If you write at least one value as a duration,
e.g., "10 h", the summary will also be expressed as a duration.


Regards,



Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-24 Thread Lele Gaifax
Nicolas Goaziou  writes:

> Lele Gaifax  writes:
>
>> One minor issue: previously I used a custom setting for the variable
>> `org-time-clocksum-format`, to print something like "2gg 03:10" instead of 
>> "2d
>> 03:10". With the version currently distributed with Emacs 25.1 it was used 
>> for
>> both the "effort" and "clocksum" columns, now only on the latter (matching
>> name and documentation). Is there an equivalent setting for the "effort"
>> sum, to get a table with the two columns sharing the same style?
>
> I don't think so, but I may be wrong. Anyway, you can define your own
> summary function (and formatter) in Org colums. See
> `org-columns-summary-types' for details.

This is a simple file, made with the version of org-mode that comes from
current Emacs 25 branch:

# -*- coding: utf-8 -*-
#+TITLE: Test with Emacs 25.0.95 org-mode
#+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)

* This is a test
  CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03

#+BEGIN: columnview :hlines 1 :id global
| Item |   Effort | Work |
|--+--+--|
| * This is a test | 1gg 6:00 | 3gg 0:03 |
| ** Task A|10:00 |  |
| ** Task B|10:00 |  |
| ** Task C|10:00 |  |
#+END:

** Task A
   :PROPERTIES:
   :Effort:   10:00
   :END:

** Task B
   :PROPERTIES:
   :Effort:   10:00
   :END:

** Task C
   :PROPERTIES:
   :Effort:   10:00
   :END:

# Local Variables:
# org-time-clocksum-format: (:days "%dgg " :hours "%d" :require-hours t 
:minutes ":%02d" :require-minutes t)
# End:

This is the equivalent, made with current master development org-mode:

# -*- coding: utf-8 -*-
#+TITLE: Test with current master revision of org-mode
#+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)

* This is a test
  :LOGBOOK:
  CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03
  :END:

#+BEGIN: columnview :hlines 1 :id global
| Item   | Effort | Work |
|++--|
| This is a test |  30:00 | 3gg 0:03 |
| Task A |  10:00 |  |
| Task B |  10:00 |  |
| Task C |  10:00 |  |
#+END:

** Task A
   :PROPERTIES:
   :Effort:   10:00
   :END:

** Task B
   :PROPERTIES:
   :Effort:   10:00
   :END:

** Task C
   :PROPERTIES:
   :Effort:   10:00
   :END:

# Local Variables:
# org-time-clocksum-format: (:days "%dgg " :hours "%d" :require-hours t 
:minutes ":%02d" :require-minutes t)
# End:

Can you reproduce the case?

>> BTW, in lisp/org-colview.el there is what seems a typo in the name of the
>> function `org-columns-hscoll-title`: since accordingly with "git grep" it is
>> referenced in two places and only in that source, is the following
>> acceptable?
>
> Sure. Could you provide a proper commit message and send the patch using
> "git format-patch" command? See
>  for details.

Sure, I will do that ASAP!

Thank you,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-24 Thread Nicolas Goaziou
Hello,

Lele Gaifax  writes:

> One minor issue: previously I used a custom setting for the variable
> `org-time-clocksum-format`, to print something like "2gg 03:10" instead of "2d
> 03:10". With the version currently distributed with Emacs 25.1 it was used for
> both the "effort" and "clocksum" columns, now only on the latter (matching
> name and documentation). Is there an equivalent setting for the "effort"
> sum, to get a table with the two columns sharing the same style?

I don't think so, but I may be wrong. Anyway, you can define your own
summary function (and formatter) in Org colums. See
`org-columns-summary-types' for details.

> BTW, in lisp/org-colview.el there is what seems a typo in the name of the
> function `org-columns-hscoll-title`: since accordingly with "git grep" it is
> referenced in two places and only in that source, is the following
> acceptable?

Sure. Could you provide a proper commit message and send the patch using
"git format-patch" command? See
 for details.

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-23 Thread Lele Gaifax
Nicolas Goaziou  writes:

>> Do you know if/when it will be merged into Emacs?
>
> I don't know, but that will not happen before Emacs 25.1 release.

Thanks anyway, I installed latest development sources and I appreciate the
work that has been done in this (and many other) areas: the new colview
produces a much nicer LaTeX!

One minor issue: previously I used a custom setting for the variable
`org-time-clocksum-format`, to print something like "2gg 03:10" instead of "2d
03:10". With the version currently distributed with Emacs 25.1 it was used for
both the "effort" and "clocksum" columns, now only on the latter (matching
name and documentation). Is there an equivalent setting for the "effort"
sum, to get a table with the two columns sharing the same style? I tried to
look around in the sources and in the doc but I missed it...

BTW, in lisp/org-colview.el there is what seems a typo in the name of the
function `org-columns-hscoll-title`: since accordingly with "git grep" it is
referenced in two places and only in that source, is the following acceptable?

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index e29f88a..6809305 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -438,9 +438,9 @@ for the duration of the command.")
   (org-add-props " " nil 'display '(space :align-to 0))
   (org-add-props (substring title 0 -1) nil 'face 
'org-column-title)))
 (setq org-columns-previous-hscroll -1)
-(add-hook 'post-command-hook 'org-columns-hscoll-title nil 'local)))
+(add-hook 'post-command-hook 'org-columns-hscroll-title nil 'local)))

-(defun org-columns-hscoll-title ()
+(defun org-columns-hscroll-title ()
   "Set the `header-line-format' so that it scrolls along with the table."
   (sit-for .0001) ; need to force a redisplay to update window-hscroll
   (when (not (= (window-hscroll) org-columns-previous-hscroll))
@@ -463,7 +463,7 @@ for the duration of the command.")
   (when (local-variable-p 'org-previous-header-line-format)
(setq header-line-format org-previous-header-line-format)
(kill-local-variable 'org-previous-header-line-format)
-   (remove-hook 'post-command-hook 'org-columns-hscoll-title 'local))
+   (remove-hook 'post-command-hook 'org-columns-hscroll-title 'local))
   (move-marker org-columns-begin-marker nil)
   (move-marker org-columns-top-level-marker nil)
   (org-with-silent-modifications

Thanks a lot,
bye, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-22 Thread Nicolas Goaziou
Hello,

Lele Gaifax  writes:

> Do you know if/when it will be merged into Emacs?

I don't know, but that will not happen before Emacs 25.1 release.

Regards,

-- 
Nicolas Goaziou



Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-22 Thread Lele Gaifax
Nicolas Goaziou  writes:

> Lele Gaifax  writes:
>
>> I know this is an ancient thread, but it seems the problem is still there, in
>> Emacs 25.
>
> "org-colview" was rewritten recently. IIRC, this is fixed in development
> version of Org.

Great, thank you!

Do you know if/when it will be merged into Emacs? I will probably try it out
on my own machine, but I guess a few coworkers won't be going to install it
from upstream repos...

bye, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.




Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-22 Thread Nicolas Goaziou
Hello,

Lele Gaifax  writes:

> I know this is an ancient thread, but it seems the problem is still there, in
> Emacs 25.

"org-colview" was rewritten recently. IIRC, this is fixed in development
version of Org.

Regards,

-- 
Nicolas Goaziou



Re: [O] latex-export + columnview: misinterpretation of section prefixes as emphasis

2016-06-22 Thread Lele Gaifax
Hi all,

I know this is an ancient thread, but it seems the problem is still there, in
Emacs 25.

FWIW, this is my quick and dirty fix, that at least produce a readable output,
in Emacs as well as in the PDF output.

(require 'org-colview)

;; Quick workaround to 
http://article.gmane.org/gmane.emacs.orgmode/25821: replace
;; asterisks with some other character in the table automatically built by 
org-colview, because
;; when the table is exported to LaTeX they are misinterpreted as emphasis 
markup, resulting in
;; an unreadable hierarchy.

(defun esk/org-replace-section-prefix (s)
  "Replace asterisks in  Org heading with em-dashes."
  (when (string-match org-outline-regexp-bol s)
(setq s (replace-match
 (concat (make-string (- (match-end 0) (match-beginning 0) 1) 
?—)
 " ")
 t t s)))
  s)

(defun org-listtable-to-string (tbl)
  "Convert a listtable TBL to a string that contains the Org-mode table.
The table still need to be aligned.  The resulting string has no leading
and trailing newline characters."
  (mapconcat
   (lambda (x)
 (cond
  ((listp x)
   (concat "|" (esk/org-replace-section-prefix (mapconcat 'identity x 
"|")) "|"))
  ((eq x 'hline) "|-|")
  (t (error "Garbage in listtable: %s" x
   tbl "\n"))

Of course I'll be happy to hear about any better way to do it!

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.