Re: org-persist cache for remote files

2021-12-21 Thread Lele Gaifax
Hi Ihor,

I had some trouble testing your patches, and the outcome is still unclear to
me: apparently (again, cannot be sure this is not caused by "improper"
application of the patches) the new version of org-persist, with default value
for o-p-remote-files (100), removes any remote file from the persistent index,
without even prompting for a password.

I will try again (and harder) as time permits.

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: org-persist cache for remote files

2021-12-18 Thread Lele Gaifax
Lele Gaifax  writes:

>> +  :group 'org-persist
>> +  :type '(choice (const :tag "Never" nil)
>> + (const :tag "Always" t)
>> + (number :tag "Keep note more than X files")
>
> Now that you explained the meaning, maybe better to be explicit here,
> mentioning "X remote files"?

Sigh, re-reading, I see one more glitch there: s/Keep note/Keep not/

I'm sorry, but real work swallowed all my day, and could not try this out yet.
Hopefully I will be able to do some test tomorrow morning.

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: org-persist cache for remote files

2021-12-18 Thread Lele Gaifax
Ihor Radchenko  writes:

> Lele Gaifax  writes:
>
>> In the meanwhile, here below some notes:
>
> Thanks! See the updated patch.

Great, you're so fast! :-)

I couldn't test yet, but I saw a couple of other glitches, sorry for not
noticing first.

> ...  
> +(defcustom org-persist-remote-files 100
> +  "Whether to keep persistent data for remote files.
> +
> +When this variable is nil, never save persitent data associated with
> +remote files.  When `t', always keep the data.  When
> +`check-existence', contact remote server containing the file and only
> +keep the data when the file exists on the server. When a number, keep
> +up to that number persistent values for remote files.
> ...

s/persitent/persistent

> +Note that the last option `check-existence' may cause Emacs to show
> +password prompts to log in."

I'd remove "last" above, since `check-existence' is not the last (described)
option anymore.

> +  :group 'org-persist
> +  :type '(choice (const :tag "Never" nil)
> + (const :tag "Always" t)
> + (number :tag "Keep note more than X files")

Now that you explained the meaning, maybe better to be explicit here,
mentioning "X remote files"?

Thanks, 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: org-persist cache for remote files

2021-12-18 Thread Lele Gaifax
Ihor Radchenko  writes:

> Lele Gaifax  writes:
>
>>> Maybe we should better make this a user option?
>>
>> Yes, that's what I had in mind: when (say) org-persist-do-not-auto-gc-remotes
>> is enabled, the cleanup procedure would ignore remote Org documents and a new
>> explicit (interactive) org-persist-gc-remotes would take care of them.
>>
>>> Or we can go a different route and just not garbage collect remote files
>>> until cache gets too large.
>>
>> Yes, a threshold would work too.
>
> Can you test the attached 2 patches? They do not seem to break local
> files, but I do not have remote file caches to test on.

Yes, I'll be able to do some test in a couple of hours.

Thank you!

In the meanwhile, here below some notes:

> ...
> Subject: [PATCH] org-persist.el: Customise persistence of data for remote
>  files
>
> * lisp/org-persist.el (org-persist-remote-files): New defcustom
> defining strategy for persisting data associated with remote files.
> Separate strategy is necessary to avoid unexpected password promtps
> while garbage collecting the cache: remote files may require server
> login.
> ...

s/promtps/prompts

> ...  
> +(defcustom org-persist-remote-files 100
> +  "Whether to keep persistent data for remote files.
> +
> +When this variable is nil, never save persitent data associated with
> +remote files.  When `t', always keep the data.  When
> +`check-existance', contact remote server containing the file and only
> +keep the data when the file exists on the server.

s/check-existance/check-existence

Also, shouldn't the doc mention the meaning of the numberp, expecially since
that's the default?

> +Note that the last option `check-existance' may cause Emacs to show
> +password prompts to log in."

Thanks again,
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: org-persist cache for remote files

2021-12-17 Thread Lele Gaifax
Ihor Radchenko  writes:

> Lele Gaifax  writes:
>
>> I wonder if there is some mechanism I could use to either prevent caching
>> of non-local documents or to avoid the check on existence in the
>> org-persist-gc.
>
> I can easily make a change that always garbage-collect non-local
> documents without trying to connect to remote server. This can be one
> solution of your problem. However, I am not sure if it is the best
> solution.
>
> May I know more about your use cases? Do you frequently open large
> remote Org files? If you do, trashing their cache may not be optimal.

I do not open remote Org files very often, but surely happens now and then,
typically from my laptop to see/edit something I keep on my desktop PC.

> Maybe we should better make this a user option?

Yes, that's what I had in mind: when (say) org-persist-do-not-auto-gc-remotes
is enabled, the cleanup procedure would ignore remote Org documents and a new
explicit (interactive) org-persist-gc-remotes would take care of them.

> Or we can go a different route and just not garbage collect remote files
> until cache gets too large.

Yes, a threshold would work too.

Thanks a lot,
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: org-persist

2021-12-17 Thread Lele Gaifax
Hi, 

Ihor Radchenko  writes:

>> I had originally set org-element-use-cache to nil because I remember
>> reading somewhere that the nil setting would help prevent emacs from
>> hanging in org-mode.
>
> The cache code has been refactored. I tried my best to fix all the bugs
> causing the hangs and I am not seeing hangs anymore. That's why I took a
> risk to enable cache by default on main.

today I spent the required time to investigate on one issue I had with my
Doom-based profile, that uses the "master" version of Orgmode, and found it
related to the org-persist functionality.

Basically since some time ago, quitting Emacs I was sometime prompted for a
password, some other time it took a considerable time to close the instance.

Digging down, I found that it was due to the persistent cache, that contained
several entries about remote (Tramp) documents: upon closing Emacs, the
org-persist-gc function is triggered, and the index is traversed to remove
dangling entries, performing a file-exist-p on each filename. For remote
files, that obviously mean prompting for the remote password (when the
ssh-agent does not carry it) or spending a considerable time in the network
round trip.

I wonder if there is some mechanism I could use to either prevent caching of
non-local documents or to avoid the check on existence in the org-persist-gc.

Thanks for any hint,
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] Preparing a cost estimate with Org

2019-01-24 Thread Lele Gaifax
Ken Mankoff  writes:

> Hi Lele,
>
> On 2019-01-24 at 07:59 -0800, Lele Gaifax 
> wrote...
>> The only problem with this approach is that it requires a manual
>> intervention to build the "cost estimate" table: first I recompute the
>> "efforts" one with C-c C-c, then I copy its body to the other table,
>> delete the third column and eventually do a C-c C-c on its TBLFM to
>> recompute the costs.
>
> You could perhaps do this with code, so it is only one C-c C-c?
> Alternatively, is OrgAggregate useful?
> https://github.com/tbanel/orgaggregate

Thank you Ken, orgaggregate is really intriguing, I will surely try it out
soon!

I did not understand what you mean with "do this with code" though: some kind
of a macro or what?

>> b) filter out entries with a particular tag/property, so that I can
>> keep the original estimate
>
> Here is a hack to filter clock entries by tag:
>
> https://lists.gnu.org/archive/html/emacs-orgmode//2009-09/msg00205.html
>
> Finally, the Clock Table documentation 
> https://orgmode.org/manual/The-clock-table.html mentions
> ‘:match’ with link to
> https://orgmode.org/manual/Matching-tags-and-properties.html#Matching-tags-and-properties
>  which
> lets you do negative matches in one of their examples. Can you include only 
> relevant tags, or
> exclude the tags you want to exclude using that syntax?

Thanks again, I will read those links!

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.




[O] Preparing a cost estimate with Org

2019-01-24 Thread Lele Gaifax
Hi all,

I use Org to produce "cost estimate" documents: the goal is to keep in a
single document a detailed log of what I'm asked to work on, the estimated
effort, the estimated cost and the time I actually spend on each item.

I'm already quite satisfied with the overall process and final result: I can
quickly export it as an elegant PDF document and give it to my customer, who
in turn accepts or rejects any single task, decisions that I bring back to the
document as tags (or todo labels) on the headlines.

For my current engagement, for several reasons I do not want to expose the
actual timings to the customer. Given that I could not find a way to omit a
particular column of a table, I opted to have two separated tables, one with
the summary for my own pleasure inside a COMMENT section, and another with
just the costs.

This is a sample of what I came up:

* COMMENT Efforts summary

  #+NAME: efforts
  #+BEGIN: columnview :id global :indent t :skip-empty-rows t :format 
"%40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)"
  | Item   | Effort | Work |
  |++--|
  | Tasks  |   3:00 | 0:47 |
  | \_  Task A |   1:00 | 0:19 |
  | \_  Task C |   2:00 | 0:28 |
  #+END:

#+CONSTANTS: one_minute_cost=0.5

* Cost estimate

  | Item   | Cost |
  |+--|
  | Tasks  |   90 |
  | \_  Task A |   30 |
  | \_  Task C |   60 |
  #+TBLFM: $1='(identity remote(efforts, @@#$1))::$2='(round (* 
(org-duration-to-minutes (identity remote(efforts, @@#$2))) $one_minute_cost))

* Tasks

** Task A
   :PROPERTIES:
   :Effort:   1:00
   :END:
   :LOGBOOK:
   CLOCK: [2019-01-24 gio 15:51]--[2019-01-24 gio 16:10] =>  0:19
   :END:

** Task B   
:REJ:
   :PROPERTIES:
   :Rejected-Effort:   2:00
   :END:

** Task C
   :PROPERTIES:
   :Effort:   2:00
   :END:
   :LOGBOOK:
   CLOCK: [2019-01-24 gio 15:11]--[2019-01-24 gio 15:39] =>  0:28
   :END:

The only problem with this approach is that it requires a manual intervention
to build the "cost estimate" table: first I recompute the "efforts" one with
C-c C-c, then I copy its body to the other table, delete the third column and
eventually do a C-c C-c on its TBLFM to recompute the costs.

As you can see, "Task B" has been rejected by the customer, so I had to rename
the associated effort property to remove it from the table.

Is there a more efficient/automatic way to achieve a similar result? I mean, is
there a way to

a) keep a single table, but omit a particular column at export time
   or
   have the second table properly populated from the actual tasks tree as it
   happens for the first one

b) filter out entries with a particular tag/property, so that I can keep the
   original estimate
   
?

Thanks in advance for any hints,
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] Local COLUMNS and columnview block

2018-11-18 Thread Lele Gaifax
Nicolas Goaziou  writes:

> Lele Gaifax  writes:
>
>> As said, a the local COLUMNS setting is honored by the transient columns 
>> view,
>> but it is ignored by org-clock-report and org-dbclock-update.
>>
>> Am I doing something wrong or isn't it possible?
>
> COLUMNS property, or keyword, are not related to clocktable and such.
>
> Moreover, in the "columnview" dynamic block, you use ":id global", which
> means calling `org-columns' on the whole buffer, using global COLUMNS
> keyword.

Thanks for confirming that.

> You can use :format property to use the appropriate columns:
>
> :format "%40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Spent)"
>

Nice, that fits my need, and I completely missed the ":format" argument!

Thanks a lot,
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] Local COLUMNS and columnview block

2018-11-17 Thread Lele Gaifax
Sorry, hit C-c C-c in the wrong buffer...

Lele Gaifax  writes:

> The local property in the "Work" node is honored by org-columns (C-c C-x
> C-c),

As said, a the local COLUMNS setting is honored by the transient columns view,
but it is ignored by org-clock-report and org-dbclock-update.

Am I doing something wrong or isn't it possible?

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.




[O] Local COLUMNS and columnview block

2018-11-17 Thread Lele Gaifax
Hi all,

I tried to use a local definition of the COLUMNS property and have a "private"
(that is, not exported to PDF) view of the time spent on something, something
like this:

# -*- coding: utf-8 -*-
#+TITLE: Test local columns
#+COLUMNS: %40ITEM(Item) %13Effort(Effort){:}

#+BEGIN: columnview :id global :maxlevel 1 :skip-empty-rows t
| Item| Effort | Spent |
|-++---|
| Preliminary |   1:00 |   |
#+END:

* Preliminary
  :PROPERTIES:
  :Effort:   1:00
  :END:
  :LOGBOOK:
  CLOCK: [2018-11-16 fri 09:40]--[2018-11-16 fri 10:00] =>  0:20
  :END:

* Soon
  :PROPERTIES:
  :Effort:   1:00
  :END:
  :LOGBOOK:
  CLOCK: [2018-11-16 fri 11:00]--[2018-11-16 fri 12:00] =>  1:00
  :END:

  #+BEGIN: columnview :id local :indent t :skip-empty-rows t
  | Item | Effort |
  |--+|
  | Soon |   1:00 |
  #+END:

* COMMENT Work
  :PROPERTIES:
  :COLUMNS:  %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Spent)
  :END:

  #+BEGIN: clocktable :scope file :maxlevel 2

  #+END:

  #+BEGIN: columnview :id global :indent t :skip-empty-rows t
  | Item| Effort |
  |-+|
  | Preliminary |   1:00 |
  | Soon|   1:00 |
  #+END:

The local property in the "Work" node is honored by org-columns (C-c C-x C-c), 
-- 
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] [PATCH] org-colview.el: Fix typo in function name

2016-06-24 Thread Lele Gaifax
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> I see you didn't add TINYCHANGE at the end of the commit message.
> I assume you have signed FSF papers already. Am I correct?

Yes, sorry for not mentioning it explicitly.

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 Lele Gaifax
Nicolas Goaziou <m...@nicolasgoaziou.fr> 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.




[O] [PATCH] org-colview.el: Fix typo in function name

2016-06-24 Thread Lele Gaifax
>>> 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
>> <http://orgmode.org/worg/org-contribute.html#patches> for details.

Here it is!

>From 7919e3ecb9362451a2f1f5e919e378dadadaf8de Mon Sep 17 00:00:00 2001
From: Lele Gaifax <l...@metapensiero.it>
Date: Fri, 24 Jun 2016 14:14:34 +0200
Subject: [PATCH] org-colview.el: Fix typo in function name

* lisp/org-colview.el (org-columns-hscroll-title): rename from
  `org-columns-hscoll-title'
(org-columns--display-here-title): adjust reference to renamed function
(org-columns-remove-overlays): likewise
---
 lisp/org-colview.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 864b221..d26f16a 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
-- 
2.8.1

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 Lele Gaifax
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Lele Gaifax <l...@metapensiero.it> 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
> <http://orgmode.org/worg/org-contribute.html#patches> 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-23 Thread Lele Gaifax
Nicolas Goaziou <m...@nicolasgoaziou.fr> 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 Lele Gaifax
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Lele Gaifax <l...@metapensiero.it> 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 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.




Re: [O] Exporting columnviews

2015-02-07 Thread Lele Gaifax
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 This is a silly bug actually: *...* is for bold markup, so *** is
 exported as a bold star.

Oh, I see, thank you!

 I'd rather not make an exception and modify bold parsing, so other
 characters should be inserted to represent headline's level. I find
 numbers too verbose. Replacing stars with dots is not possible either as
 ... will be exported differently with some export back-ends.

 Maybe * * * instead of ***? Any better idea?

What about having an option to use alternative chars, maybe some fancy
Unicode glyph? →, ⇒, ⦿, or even some kind of non-breakable-space come to
mind.

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.




[O] Exporting columnviews

2015-02-04 Thread Lele Gaifax
Hi all,

I use Org (Emacs 24.4.90, with Org mode 8.2.10) to analyze and plan the
development of new projects/features, with a persistent columnview containing
a summary, something like the following:

#+TITLE: Test
#+PROPERTY: Effort_ALL 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
#+COLUMNS: %40ITEM(Item) %13Effort(Estimated){:} %CLOCKSUM(Spent)

* Main

#+BEGIN: columnview :hlines 1 :id local
| Item| Estimated | Spent |
|-+---+---|
| * Main  |  3:00 |   |
| ** Subpoint |  1:00 |   |
| *** Subsubpoint |  1:00 |   |
| ** Other|  2:00 |   |
#+END:

** Subpoint

*** Subsubpoint
:PROPERTIES:
:Effort:   1:00
:END:

** Other
   :PROPERTIES:
   :Effort:   2:00
   :END:

When I export the above, while the headings get numbered the columnview table
does contain the items introduced by either one or two asterisks, something
like the following (cutpastedmanually aligned from the HTML output):


Table of Contents

1. Main
1.1. Subpoint
1.1.1. Subsubpoint
1.2. Other

1 Main

Item Estimated  Spent
* Main3:00   
** Subpoint   1:00   
* Subsubpoint 1:00   
** Other  2:00   

...

Apparently, all items at an odd-level get one asterisk and all the others
two. The same happens with PDF and ODT...

I tried to play with some of the options, but I did not find something that
impacts the export of the columnview.

I wonder if there is something I am missing to obtain either

Item Estimated  Spent
* Main3:00   
** Subpoint   1:00   
*** Subsubpoint   1:00   
** Other  2:00   

or

Item   Estimated  Spent
1. Main 3:00   
1.1 Subpoint1:00   
1.1.1 Subsubpoint   1:00   
1.2 Other   2:00   

Thanks in advance for any hints!

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.