Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property]

2023-08-27 Thread Samuel Loury
I have a dumb question.

IIUC, it needs a lot of effort to deal with implicit & correctly. I
initially used it because de manual said it was ok, but I would have
used explicit & if the manual had said so.

I wonder if we could just stop saying that & is optional and have a
simpler parsing. 

IMHO, "-tag&-todo=TODO" is totally ok. I even imagine we could say that
& and | are forbidden to say anything else than AND and OR and people
would be ok with that.

IOW, I wonder of the time and effort to deal with optional & is worth
it. WDYT?

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[BUG?] Matching tags: & operator no more implicit between tags and special property

2023-08-23 Thread Samuel Loury
Hi. I've been using org-mode as PKMS for 13 years. Thanks for that
awesome tool.

After upgrading on main yesterday, I realized a change of behavior. I'm
not sure whether it is a bug or not.

The following tags query used to implicitly behave as a AND
"-tag-TODO=\"TODO\"".

It does not anymore.

To reproduce this, simply use the following content.

```
* TODO todo and tag  :tag:
* TODO simply todo
* nothing
* only tag  :tag:
```

And run the following code.

`(org-tags-view nil "-tag-todo=\"TODO\"")`

Before commit f689eb44f175fbbdc4e8ef0ad6f5201b10863438, this showed only
"nothing", as expected.

Now, it shows all the entries.

To get back to the old behavior, I need to explicitly add the boolean
operator & in between.

I attached the code of the example in this mail.

Hope that this bug report is useful.


tag-match-implicit-and.tar.xz
Description: application/xz
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: 3 times a day

2023-04-24 Thread Samuel Loury
Ihor Radchenko  writes:

> Renato Pontefice  writes:
>
>> ** TODO composto I 4 granuli<2023-04-18 Tue 08:38 +1d>
>> ** TODO composto I 4 granuli<2023-04-18 Tue 16:38 +1d>
>> ** TODO composto I 4 granuli<2023-04-18 Tue 22:39 +1d>
>>
>> I mean: can I have one TODO statement I n 3 different hour at same day?
>
> No, AFAIK. At least, not with repeaters.

I most likely don't understand the question correctly. I though that a
way to have ONE todo statement with 3 different hours at the same day is
simply doing this :

** TODO composto I 4 granuli
<2023-04-18 Tue 08:38 +1d>
<2023-04-18 Tue 16:38 +1d>
<2023-04-18 Tue 22:39 +1d>

What is wrong with this approach?

My best,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: Question About Nuking The Priority Of A Task After Its Been Marked As 'DONE'

2021-12-11 Thread Samuel Loury
"Samuel Banya"  writes:

> I often change states of my todo list items to 'DONE', 'CANCELLED', etc.
>
> However, one thing I would want to know is this:
> - Is it possible to automatically delete the '#' priority value of a task 
> after a task has been marked as 'DONE', 'CANCELLED', etc?
>
> Is this done via a hook function?

To do it globally:

--8<---cut here---start->8---
(defun my/org-trigger-hook (change-plist)
  (let* ((type (plist-get change-plist :type))
 (pos (plist-get change-plist :position))
 (from (substring-no-properties (or (plist-get change-plist :from) "")))
 (to (substring-no-properties (or (plist-get change-plist :to) "")))
 )
(when (and
   (eq type 'todo-state-change)
   (member to org-done-keywords)
   (member from org-not-done-keywords)
   )
  (org-priority (string-to-char " "))
  )
)
  )

(add-hook #'org-trigger-hook
  #'my/org-trigger-hook)
--8<---cut here---end--->8---


But if, like me, you want to define this behavior per task, this is one
of the purposes of org-edna. I suggest you try it.

I your particular example, you would simply set the TRIGGER property of
the task for which you want to delete the priority to this content

--8<---cut here---start->8---
* NEXT [#B] some task
:PROPERTIES:
:TRIGGER: self() set-priority!(" ")
:END:
--8<---cut here---end--->8---

Closing it would result in

--8<---cut here---start->8---
* DONE some task
  CLOSED: [2021-12-11 Sat 13:38]
:PROPERTIES:
:TRIGGER: self() set-priority!(" ")
:END:
--8<---cut here---end--->8---

Of course, it also work for repeated task or any complicated scenario
I have tried so far.

I hope that helps,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [QUESTION] Add advice on command org-add-note not working

2021-08-20 Thread Samuel Loury
"Christopher M. Miles"  writes:

> <#secure method=pgpmime mode=sign>

Beware this did not actually sign your message.

> I have following advice code:
>
> #+begin_src emacs-lisp
> (defun my/org-add-note--auto-add-tag ()
>   "Auto add tag 'LOG' when add note log."
>   (org-back-to-heading)
>   ;; DEBUG: the following code is not executed.
>   (message "DEBUG")
>   (require 'seq)
>   (org-set-tags (seq-uniq (cons "LOG" (org-get-tags nil t)
>
> (advice-add 'org-add-note :after #'my/org-add-note--auto-add-tag)
> #+end_src
>
> With Emacs Edebug, I found it only executed to ~(org-back-to-heading)~, then 
> stopped. The following
> "DEBUG" message is not printed and tag "LOG" is not added.
>
> Does anybody have some clue for this issue?

`org-add-note` only sets up a side buffer to write the content of the
note. The "go back to the heading to actually write the note" is done by
`org-store-log-note`, invoked using C-c C-c on your note.

So it is normal that `org-back-to-heading` fails in the org-note buffer
that indeed does not have a heading.

Hint: press p when in edebug session to find out in which buffer context
the code will apply.

I just tried applying the advice to `org-store-log-note` instead of
`org-add-note` and it worked fine :-).

My best,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: Cannot schedule something for 2039?

2021-06-07 Thread Samuel Loury
alan.schm...@polytechnique.org writes:

[...]

> I need to schedule something for 2039, but when I do it the date is set
> for 2037. I tried with a plain emacs config and I see the same issue. Is
> this a bug?

Sounds like the bug of 2038¹. I assume that 32 bit integers are used
somewhere to encode the date.

For the record, I see the same behavior.


¹  https://en.wikipedia.org/wiki/Year_2038_problem
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: stability of toc links

2021-04-30 Thread Samuel Loury
Hi.

I understood differently.

Tim Cross  writes:

[...]

> A question to help me understand this issue.
>
> If I understand correctly, exporting to HTML does not guarantee
> stability of TOC links. If you export as HTML, send someone a link from
> the toc and then re-export the document, the link will possibly be
> broken. Essentially, exporting to HTML has no guarantee of stability in
> toc links.

I think this is right.

> However, if you use publish instead of exporting to HTML, there is a
> guarantee of stability in toc links. When publishing a second time, the
> link will be consistent and still valid.

The publish feature only means exporting several files at once. IIUC,
what was written was that when using the publish feature, the exported
html pages will be coherent and a link in one document pointing to
another document of the same publish call won't be broken.

But IIUC, publishing the whole stuff again will result in totally
different links. They will still be coherent and no broken link from one
document of the whole to another. But a browser bookmark pointing the
published lot the first time won't work with the same lot the second
time.

Did I understand correctly?
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: stability of toc links

2021-04-21 Thread Samuel Loury
Nicolas Goaziou  writes:

[...]

> Samuel Wales  writes:
>
>> i was referring to:
>>
>>   Message ID <87v9dbelky@gmail.com>
>>
>> in this thread.
>>
>> [and other posts in this thread related to it.]
>
> Unfortunately, I won't have time to look at the whole thread anytime
> soon. However, feel free to explain how "tec's fix" works, or point me
> to the exact post where it is explained so I can understand it.
>
>> the problem as i see it is link stability in generated output.
>
> The links are stable if you publish a document. Note that you can even
> "publish" a single document.
>
> For exported (i.e., one off documents), this is not so an issue (IMO)
> since you have custom ID. I assume this was evoked in the thread.

I think you are both talking about the same thing but have different
judgment calls about it.

Say you want to export an org file, then share the link to a friend to a
heading, like https://mysite/#orgd260798

Imagine that for some reason, you re export the file, then new ids are
generated and the links becomes broken.

Nicolas Goaziou, I know you understand this and propose to use CUSTOM_ID
to make those ids static. But IIUC, Samuel Wales does not know in
advance what heading he will share, so he would have to add CUSTOM_ID
everywhere, just in case. This sounds like a lot of unnecessary work.

The solution of tec¹ appears to be a new generation of the html ids based
on the heading content rather than apparently randomly generated, making
the generated link become the same across new generations.

I hope it clarified the discussion.

My best,

¹  https://tecosaur.github.io/emacs-config/config.html#nicer-generated-heading
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Make org-mode multi line shell session work sensibly

2021-01-08 Thread Samuel Loury
Hi,

I've been trying to work more and more with org-babel recently, and
found out that the session in the shell block does not appear to work
well.

The symptom is the following: When I try to run a code block with noop
lines, like comment, the output gets broken

--8<---cut here---start->8---
#+BEGIN_SRC sh :results output :exports both :session 
c66d4791-003d-42af-a4e0-366f5542c604
  echo a
  # noop
  echo b
#+END_SRC

#+RESULTS:
:
: a
: $ b
--8<---cut here---end--->8---

Of course, I would expect
--8<---cut here---start->8---
#+RESULTS:
: a
: b
--8<---cut here---end--->8---

Actually, I went through the code and I think I understand why it has
this behavior, see here for my analysis ->
https://konubinix.eu/braindump/posts/c66d4791-003d-42af-a4e0-366f5542c604/

I tried to patch the code of org-babel-comint-with-output to make it
work correctly, see here ->
https://konubinix.eu/braindump/posts/25b52cc8-71f8-420f-9161-5c60030cede9/

But it feels like it is more of a work around than an elegant solution
to the issue. I am already facing some corner cases and it does not
handle yet the continuation lines, starting with ">".

I was thinking that maybe, in org-babel-sh-evaluate, instead of sending
the lines one by one and interpreting the result, the code could write a
temporary file with the body and source it. Basically all the evaluation
would be

--8<---cut here---start->8---
$ source tmp-file-
$ echo org-babel-sh-eoe
--8<---cut here---end--->8---

It still would suffer from the no newline behavior I am describing here
-> https://konubinix.eu/braindump/posts/f6206181-09d2-4449-b437-960be2b5dfd2/
But, one step at a time, right?

Then I took though about it. I cannot believe I am the only person
trying to run multi line shell programs with comment in session, am I?

So here are a few questions: Is there anyone with the same use case as I
have? If so, how do you cope with the problem I am facing? If I want to
fix it, what do you think would be the more elegant solution: fixing the
line by line parsing like I was trying to do or sourcing the code to
avoid using line by line parsing?

org-mode is really great, org-babel is awesome and I use it more and
more in my daily life, I hope we will be able to fix this annoying
behavior together.

Thank you for your time,
My best,

PS: the real life use case I am using is the following one: I want to
have a few org-babel snippets to ease my code reviews, as presented in here:
https://konubinix.eu/braindump/posts/564621c3-4a9a-4574-abf8-bd9831b29aa4/

the first snippet has the following output

--8<---cut here---start->8---
: 
: $ $ $ $ $ Ready to make the review of XXX on top of YYY
--8<---cut here---end--->8---

instead of the expected

--8<---cut here---start->8---
: Ready to make the review of XXX on top of YYY
--8<---cut here---end--->8---

And the second one with the header ":results output file", have the
following result

--8<---cut here---start->8---
[[file:
the-directory/diff.diff]]
--8<---cut here---end--->8---

instead of the expected

--8<---cut here---start->8---
[[file:the-directory/diff.diff]]
--8<---cut here---end--->8---

With my workaround, the output is ok.
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: Annoyance when resolving clock idle time with emacsclient

2020-10-09 Thread Samuel Loury
Ihor Radchenko  writes:

>> Thanks for the tip, I'll try pressing 10 times the next time it happens
>> (which is probably today).
>
> That sounds really odd. Could it be that there are multiple open
> (without ending time) clocks existing in your org files?

In my case, I am pretty sure to have only one clock open at most. The
clock report don't show any unfinished clock or any overlapping ones
and org-resolve-clock does not find any other unfinished clock other
than the one I am into.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: Annoyance when resolving clock idle time with emacsclient

2020-10-09 Thread Samuel Loury
Budiman Snowman  writes:

> On Thu, Oct 8, 2020 at 10:30 PM Eric S Fraga  wrote:
>
>> On Thursday,  8 Oct 2020 at 16:54, Samuel Loury wrote:
>> > Also, another boring behavior of org-resolve-clocks is that I generally
>> > have to press several times (about ten times) on the "i" key to ignore
>> > the message.
>>
>> Similar with the 'q' key (usually requires 2-3 presses) although not
>> with 'k' (single press sufficient always).
>>
>>
> I almost always choose 'k' (keep) and it is often not responding after the
> first or several presses. But as Samuel Loury pointed out, I'll try
> pressing ten times at least, the next time it happens.

IIRC, pressing 'k', even a lot, did not work. I realized that i might be
linked to the fact that 'k' asks for some minibuffer input and this
input is waited in the other frame. And when emacs is waiting for some
minibuffer input in one frame, there is nothing I could do to get the
control on the other frame.¹

What I am suggesting is to press a lot 'i', until org-mode releases its
grasp on the other frame. You notice that it is so when the letter 'i'
gets written in front of you :-). Then, when org-mode let you go, you
can run M-x org-resolve-clocks and you will be able to press 'k' this
time.

I hope this is clearer this time.

Good luck :-).

¹ Actually, there is one way. Send the SIGUSR2 signal to emacs (pkill
  -SIGUSR2 emacs) so that it starts the debugger (in your current focused
  frame), then close the debugger and re run manually M-x
  org-resolve-clocks. SIGUSR2 would have enabled the debug-on-quit, so
  disable it with M-x toggle-debug-on-quit
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: Annoyance when resolving clock idle time with emacsclient

2020-10-08 Thread Samuel Loury
Hi,

Budiman Snowman  writes:

> several  emacsclient instances open in different tabs. When I start a clock
> and then get away long enough, Emacs will prompt me to resolve the idle
> time in different buffer that has the clock, usually in the first buffer
> that I get back to.
[...]

> Anyone experience the same?

I do :-).

I generally open emacs in my graphical session and when I am AFK, I
connect using ssh in termux on my computer and play with emacs via an
emacsclient in the terminal.

Also, another boring behavior of org-resolve-clocks is that I generally
have to press several times (about ten times) on the "i" key to ignore
the message.

Actually, I realized though that even though the client was appearing
frozen, by pressing several times on "i" (ten times also), it eventually
closes the resolve clock stuff and let me play with emacs like nothing
happened. Then, I can run manually M-x org-resolve-clocks in case I
wanted to really resolve the clocks (using k or g or whathever).

Even if this is an ugly workaround, I Hope that will help :-).
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Writing exams

2017-03-07 Thread Samuel Loury
Samuel Loury <konubi...@gmail.com> writes:

> "Doyley, Marvin M." <m.doy...@rochester.edu> writes:
>
>> Does anybody have a good system for writing exam in Org-mode ?

> - http://kitchingroup.cheme.cmu.edu/blog/2013/10/23/Writing-exams-in-org-mode/
> - https://github.com/jkitchin/jmax/tree/master/techela
> - http://www-public.tem-tsp.eu/~berger_o/org-teaching/
> - https://github.com/gjkerns/samplequiz

Forgot https://github.com/mbork/org-edu-html

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Writing exams

2017-03-07 Thread Samuel Loury
"Doyley, Marvin M."  writes:

> Does anybody have a good system for writing exam in Org-mode ?

Not tested personally, but with a quick look at my mailing archive
(notmuch search to:org-mode exams) , I could find:

- http://kitchingroup.cheme.cmu.edu/blog/2013/10/23/Writing-exams-in-org-mode/
- https://github.com/jkitchin/jmax/tree/master/techela
- http://www-public.tem-tsp.eu/~berger_o/org-teaching/
- https://github.com/gjkerns/samplequiz

Hope that helps.
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Emacs hangs sometimes for no reason

2017-01-19 Thread Samuel Loury
Sebastian Christ  writes:

[...]

> So, aren't you restarting Emacs after pkill -SIGUSR2 emacs? 

pkill -SIGUSR2 emacs does not stop emacs. Emacs will start a debugging
session that you can stop to go back to a "normal" emacs. I found out
that it generally makes emacs responsive enough so that I can launch the
org reset cache function.

I found the USR2 signal trick in irreal¹.

¹  here: http://irreal.org/blog/?p=5218
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only'

2017-01-18 Thread Samuel Loury
Dear all,

I would like to propose a patch for `org-tags-view' to make it stop
setting globally `org--matcher-tags-todo-only'

Setting `org--matcher-tags-todo-only' has side effects on other
commands. For instance, the following clock table changes its behavior
whether `org--matcher-tags-todo-only' is nil or '(4)

--8<---cut here---start->8---
#+BEGIN: clocktable :tags "-perso" :fileskip0 :stepskip0 :link t :maxlevel 5 
:emphasize t :link t :block today-1 :scope agenda :inherit-props t
--8<---cut here---end--->8---

I did not have time to investigate why the behavior of the clock table
is impacted by `org--matcher-tags-todo-only'. I quickly feel lost in
this code.

From c5c763a9aca8cfd8a707b0d7e814bc37f5eeafa1 Mon Sep 17 00:00:00 2001
From: Samuel Loury <konubinix...@gmail.com>
Date: Thu, 19 Jan 2017 08:39:50 +0100
Subject: [PATCH] Make `org-tags-view' stop setting globally
 `org--matcher-tags-todo-only'

`org--matcher-tags-todo-only' is used at several places in the
code.

The first call of `org-tags-view' that changes its value, like C-u
M-x org-tags-view has the side effect of making all other commands
that don't set this value explicitely rely on this value.

* lisp/org-agenda.el (org-tags-view): Add the declaration of
  `org--matcher-tags-todo-only' in the let form
---
 lisp/org-agenda.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 737e1841f..ac4bde389 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4681,6 +4681,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
 	  org-tags-match-list-sublevels)
 	 (completion-ignore-case t)
 	 rtn rtnall files file pos matcher
+	 org--matcher-tags-todo-only
 	 buffer)
 (when (and (stringp match) (not (string-match "\\S-" match)))
   (setq match nil))
-- 
2.11.0


-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Emacs hangs sometimes for no reason

2017-01-18 Thread Samuel Loury
For what it's worth, when this happens, I generally pkill -SIGUSR2
emacs. emacs reacts to the USR2 signal by stopping everything and start
a lisp debugging session. From there, I reset all the org caches with
this command:

--8<---cut here---start->8---
(defun konix/org-element-cache-reset-all ()
  (interactive)
  (mapc
   (lambda (file)
 (save-window-excursion
   (save-excursion
 (find-file file)
 (org-element-cache-reset)
 )
   )
 )
   (org-agenda-files)
   )
  )
--8<---cut here---end--->8---

Finally, I quit the debugging session and reset the debug on quit with
(toggle-debug-on-quit) and everything comes back to normal.

My two cents,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] org-depend: dependencies between TODO entries in different files

2016-12-08 Thread Samuel Loury
Jorge Morais Neto  writes:

> On 8 December 2016 at 04:44, Carsten Dominik  wrote:
>> One additional point is, of course, that org-depend is not part of the core,
>> but was written as a proof of concept.  Is anyone besides Karl using it
>> regularly?  I don't want to break anything by changing it.
> I use it (in a very small number of entries).

Me too. but I don't mind it to break.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A



Re: [O] How are people handling their calendars?

2016-10-24 Thread Samuel Loury
Tristan Strange  writes:

> The world of calendars is a murky one isn't it? After a couple of weeks of
> fiddling around I finally decided I'd keep my TODO's, deadlines, etc in a
> TODO.org and have org-gcal fetch (note not synchronise) my calendar from
> Google.
>
> That way I do all my daily TODO mangling in orgmode, edit calendar when on
> Desktop or Mobile and pull results in to org agenda for easier viewing.
>
> So how do you lot handle your calendars?

The same way you do :-).

> Do any of you have a working two way set up with CalDAV or anything?

So far, I never managed to have a two way sync working correctly, or at
least without being too intrusive.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] [PATCH] Call `org-expiry-expired-p' correctly

2016-10-04 Thread Samuel Loury
`org-expiry-expired-p' was called with one argument while the definition
of the function accepts none.

From 4279659e16e65a8a1a1c772a1144a6564c9990f1 Mon Sep 17 00:00:00 2001
From: Konubinix 
Date: Tue, 4 Oct 2016 10:38:47 +0200
Subject: [PATCH] Call `org-expiry-expired-p' correctly

* org-expiry.el: Call `org-expiry-expired-p' with the correct number of
  arguments.  It does not accept argument anymore.
---
 contrib/lisp/org-expiry.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/org-expiry.el b/contrib/lisp/org-expiry.el
index 67dc89e..45f59a2 100644
--- a/contrib/lisp/org-expiry.el
+++ b/contrib/lisp/org-expiry.el
@@ -240,7 +240,7 @@ Otherwise rely on `org-expiry-confirm-flag' to decide."
   (interactive "P")
   (save-excursion
 (when (called-interactively-p) (org-reveal))
-(when (org-expiry-expired-p 'any)
+(when (org-expiry-expired-p)
   (org-back-to-heading)
   (looking-at org-complex-heading-regexp)
   (let* ((ov (make-overlay (point) (match-end 0)))
-- 
2.9.3

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] [PATCH] Fix the call to `org-expiry-handler-function'

2016-09-19 Thread Samuel Loury
`org-expiry-handler-function' is meant to be a variable containing the symbol of
a function to be called.

Therefore, calling (funcall 'org-expiry-handler-function) results in a
void function error while (funcall org-expiry-handler-function)
correctly calls the contained function.

From 8eedc132e7524b78bf435cf41cf303257b4c73dc Mon Sep 17 00:00:00 2001
From: Konubinix 
Date: Thu, 6 Nov 2014 09:20:22 +0100
Subject: [PATCH 1/2] Fix the call to `org-expiry-handler-function'

* contrib/lisp/org-expiry.el (org-expiry-process-entry): Fix the call to
`org-expiry-handler-function'.

`org-expiry-handler-function' is meant to be a variable containing the symbol of
a function to be called. Therefore, calling
(funcall 'org-expiry-handler-function) results in a void function error while
(funcall org-expiry-handler-function) correctly calls the contained function.
---
 contrib/lisp/org-expiry.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/org-expiry.el b/contrib/lisp/org-expiry.el
index cd36d08..67dc89e 100644
--- a/contrib/lisp/org-expiry.el
+++ b/contrib/lisp/org-expiry.el
@@ -253,7 +253,7 @@ Otherwise rely on `org-expiry-confirm-flag' to decide."
 		 (not (interactive)))
 		(and org-expiry-confirm-flag
 		 (y-or-n-p (format "Entry expired by %d days.  Process? " d
-	  (funcall 'org-expiry-handler-function))
+	  (funcall org-expiry-handler-function))
 	(delete-overlay ov)
 
 (defun org-expiry-process-entries (beg end)
-- 
2.9.3

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] [PATCH] Indicate what happens to CLOCK entries in cloned subtrees

2016-09-19 Thread Samuel Loury
Hello,

This is a very small documentation patch to explain to the user what
will happen to the CLOCK entries of a cloned subtree.

From ea902d50e85c406376f5d54cf0e1652b7afaef26 Mon Sep 17 00:00:00 2001
From: Konubinix 
Date: Fri, 23 Jan 2015 08:53:47 +0100
Subject: [PATCH] Indicate what happens to CLOCK entries in cloned subtrees

* lisp/org.el (org-clone-subtree-with-time-shift): Add into the documentation
  string a precision about the deletion of the CLOCK entries into the cloned
  subtrees. Indicate the rational for this decision.
---
 lisp/org.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index a8ede1d..357731a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8903,6 +8903,9 @@ stamps in the subtree shifted for each clone produced.  If SHIFT
 is nil or the empty string, time stamps will be left alone.  The
 ID property of the original subtree is removed.
 
+In each clone, all the CLOCK entries will be removed. This prevents
+org-mode for considering that the clocked times overlap.
+
 If the original subtree did contain time stamps with a repeater,
 the following will happen:
 - the repeater will be removed in each clone
-- 
2.9.3

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] "atomic knowledge" modeling tool

2016-03-10 Thread Samuel Loury
Eric S Fraga <e.fr...@ucl.ac.uk> writes:

> On Sunday,  6 Mar 2016 at 20:26, Samuel Loury wrote:
>> Samuel Loury <konubi...@gmail.com> writes:
>>
>> [...]
>>
>>> I will clean the *elc files and send another report. I will also
>>> deactivate the advises not to pollute the results.
>>
>> Actually, profiler reports don't look really easy to read. I provide one
>> in here but I don't know if it is helpful.
>
> Your previous profiler report was easier to read... what did you do
> differently this time?

Hmmm... Honestly, I don't know. I am not sure how the profiler works and
what is THE way to share reports.

I will investigate the topic and share a more readable report if I find
some time.

IMHO, it is less (but still) annoying to wait a minute for the data to
be processed than having to use the emacs interface to access the
data. In that sense, I am spending more efforts in finding a way to
control emacs with another user interface (most likely using Kivy for
the UI and pymacs for the interaction with emacs) than in finding a way
to make org mode more efficient.

My best,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] "atomic knowledge" modeling tool

2016-02-29 Thread Samuel Loury
Eric S Fraga <e.fr...@ucl.ac.uk> writes:

> On Monday, 22 Feb 2016 at 10:04, Samuel Loury wrote:
>
> [...]
>
>> Reproducing a slow behavior is not easy. Today, the agenda is produced
>> in about 10s with almost the same contents. I included the profiler
>> report anyway, hoping that you will find something useful in it.
>>
>> - command-execute3301  91%
>
> [...]
>
>>- ad-Advice-org-agenda2868  79%
>> - #  1922  53%
>>  - byte-code 1922  53%
>
> out of curiousity, what or how are you advising org-agenda?

I add two advises on top of org-agenda. The first one, executed before,
compute a set of contexts to filter the agenda view. The second,
is executed after and add coloring text-properties to help separating
the available contexts.

> also, the profile information would be most useful without compiled
> code (although obviously slower...).

I will clean the *elc files and send another report. I will also
deactivate the advises not to pollute the results.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] "atomic knowledge" modeling tool

2016-02-22 Thread Samuel Loury
Hello,
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Samuel Loury <konubi...@gmail.com> writes:
>
>> I have made a custom agenda command¹ to implement a "kind of" GTD
>> workflow.
>>
>> On a quite old computer with no SSD disk, the commands takes about 20
>> seconds. My org files sum up to 27K lines and 2629 headings (with the
>> archives, there are 5630 headings in 66K lines).
>>
>> I attached the result of elp-instrument-package "org-" when running this
>> command without the archives. I don't know if that helps...
>
> So Org is slow only when calling the agenda?

I would not reach that conclusion so fast. Since I spent most of my time
using the agenda, it is the place where I am most likely to experience
slowness, but that does not mean that org is slow only in that
situation.

On the other hand, I often use the following snippet of code to make
sure the org element cache is up to date and it is very fast (~1s).

--8<---cut here---start->8---
(mapc
 (lambda (file)
   (save-window-excursion
 (save-excursion
 (find-file file)
 (org-element-cache-reset)
 )
 )
   )
 (org-agenda-files)
 )
--8<---cut here---end--->8---

> Could you also send a profiler report? Thank you.

Reproducing a slow behavior is not easy. Today, the agenda is produced
in about 10s with almost the same contents. I included the profiler
report anyway, hoping that you will find something useful in it.

- command-execute3301  91%
 - call-interactively3301  91%
  - eval-last-sexp   2868  79%
   - eval-last-sexp-12868  79%
- eval   2868  79%
 - org-agenda2868  79%
  - apply2868  79%
   - ad-Advice-org-agenda2868  79%
- #  1922  53%
 - byte-code 1922  53%
  - org-agenda-run-series1922  53%
   - org-let21221  33%
- eval   1221  33%
 - let   1221  33%
  - let  1221  33%
   - org-todo-list595  16%
- byte-code   583  16%
 - byte-code  463  12%
  - org-agenda-get-day-entries463  12%
   - org-agenda-get-todos 459  12%
- byte-code   431  11%
   org-get-priority   136   3%
 - org-agenda-skip 96   2%
  - org-agenda-skip-eval   96   2%
   - eval  96   2%
- konix/org-agenda-skip-if-tags 96   2%
 - let 96   2%
  - setq   92   2%
   - org-get-tags-at   80   2%
- byte-code72   1%
 - byte-code   72   1%
  - org-up-heading-safe 56   1%
 org-outline-level  8   0%
  - org-remove-uninherited-tags  4  
 0%
 org-delete-all 4   0%
  - error   4   0%
 apply  4   0%
  org-remove-uninherited-tags  4   
0%
   - progn  8   0%
  outline-next-heading  8   0%
  - while   4   0%
 if 4   0%
 - org-agenda-format-item  67   1%
  - replace-regexp-in-string   16   0%
 apply  4   0%

Re: [O] "atomic knowledge" modeling tool

2016-02-20 Thread Samuel Loury
Hi,
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Samuel Loury <konubi...@gmail.com> writes:
>
>> Nevertheless, org-mode is rather slow when my todo.org file becomes
>> quite large (~20K lines).
>
> Could you share some profiler information under typical usage so that we
> can tell which parts are slow?

I have made a custom agenda command¹ to implement a "kind of" GTD
workflow.

On a quite old computer with no SSD disk, the commands takes about 20
seconds. My org files sum up to 27K lines and 2629 headings (with the
archives, there are 5630 headings in 66K lines).

I attached the result of elp-instrument-package "org-" when running this
command without the archives. I don't know if that helps...

My best :-).
org-agenda-redo   1   
18.523051518.5230515
org-agenda-run-series 1   
13.822207838  13.822207838
org-let2  4   
10.361238463  2.5903096157
org-agenda-get-day-entries245 
7.8211318620  0.0319229871
org-todo-list 1   
4.242655788   4.242655788
org-agenda-list   2   
3.819318714   1.909659357
org-agenda-get-todos  35  
3.592892502   0.1026540714
org-let   2   
3.446571314   1.723285657
org-agenda-goto   580 
2.7936375289  0.0048166164
org-tags-view 1   
2.299200757   2.299200757
org-scan-tags 35  
2.293939894   0.0655411398
org-agenda-prepare-buffers6   
2.200799137   0.3667998561
org-agenda-get-sexps  70  
2.0172191590  0.0288174165
org-diary-sexp-entry  9   
2.0077601339  0.2230844593
org-outline-level 9910
1.9457936820  0.0001963464
org-agenda-prepare5   
1.9130132399  0.3826026479
org-diary 3   
1.769465726   0.5898219086
org-agenda-skip-eval  3124
1.6885327159  0.0005405034
org-get-tags-at   2746
1.6866494770  0.0006142204
org-agenda-skip   2126
1.5673435740  0.0007372265
org-agenda-finalize   5   
1.534251945   0.306850389
org-agenda-mode   1   
1.256090736   1.256090736
org-agenda-get-deadlines  210 
1.2349923170  0.0058809157
org-up-heading-safe   3295
1.0934742469  0.0003318586
org-back-to-heading   14062   
1.0211351570  7.261...e-05
org-agenda-to-appt2   
0.860954804   0.430477402
org-end-of-subtree1746
0.8471089869  0.0004851712
org-agenda-finalize-entries   4   
0.636714557   0.1591786392
org-refresh-properties420 
0.5715409850  0.0013608118
org-get-entries-from-diary1   
0.461614148   0.461614148
org-agenda-get-timestamps 210 
0.4608280769  0.0021944194
org-agenda-get-scheduled  210 
0.4060911670  0.0019337674
org-agenda-align-tags 1   
0.381108939   0.381108939
org-agenda-highlight-todo 829 
0.3807340809  0.0004592690
org-get-todo-state2071
0.3624726299  0.0001750229
org-refresh-effort-properties 210 
0.3425058340  0.0016309801
org-flag-heading  1173
0.2918298459  0.0002487892
org-activate-plain-links  363 
0.269716567   0.0007430208
org-refresh-stats-properties  210 
0.236244147   0.0011249721
org-refresh-property  264 
0.2290685090  0.0008676837
org-show-context  580 
0.2155166490  0.0003715804
org-is-habit-p

Re: [O] "atomic knowledge" modeling tool

2016-02-16 Thread Samuel Loury
luke call  writes:

> On 02/02/16 00:23, Robert Klein wrote:

[...]

>> As your 'product' is
>> not relevant to org-mode []
>
> I mentioned OM here only because I thought it of interest to
> org-mode users, which it evidently was to at least two who thanked me,
> and I answered their questions, in order not to be rude to them.

I also thank you for that :-). For the time being, I use org-mode
because of all the features it provides (clocking, reporting, literate
programming, publishing, etc...). I implement a GTD-like workflow in it
with an integrated pomodoro timer and it works like a charm.

Nevertheless, org-mode is rather slow when my todo.org file becomes
quite large (~20K lines).

Also, it is a real pain to implement a tool that uses its information
From in some other language than elisp. I have been trying for some time
to implement a competitor of MobileOrg with python-for-android/kivy and
the most difficult part is by far extracting the information out of the
.org files. Actually, I am no fall-backing on a client/server approach
in which emacs is the server, giving access to the org content.

I still like a lot the liberty of the "plain text approach" of
org-mode. It is VERY powerful, but it becomes a real problem when
needing to use that power without emacs.

I did not try onemodel yet, but it looks like it palliates those two
problems. I will definitely take a look at it.

Thank you again for sharing.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] syncing my life (orgmode :)) to a mobile (android) device..cant find a holistic reliable way..how do you guys manage to do it?

2015-12-07 Thread Samuel Loury
Matt Lundin  writes:

> Xebar Saram  writes:
>>
>> So my question is (sorry for the long intro :)) what do orgmode users
>> (who also are heavy mobile users) do? do they give up on contacts and
>> calendaring on the mobile? maintain 2 separate databases? what tools
>> do people use to overcome this issue?
>
> There are lots of way to sync calendars. See
> http://orgmode.org/worg/org-tutorials/org-google-sync.html
>
> I've found the easiest method is a "poor man's sync" involving a
> read-only ics file (exported from org using the org-icalendar-*
> functions) and a writable calendar for new entries. (Trying to map org
> entries to ics entries gets messy.) The flow looks something like this:
>
> writable calendar (remote calendar for adding new items from android)
> > org files (with new entries pull from remote calendar) >
> read-only calendar (remote ics exported from org)
>
> I use a radicale server[fn:1] for this. Radicale has the advantage of
> using ics files as a backend (rather than a database), so I can pull new
> entries into org with Eric's ical2org.awk.

I do exactly the same thing, also with radicale running in a chrooted
debian in my android phone. I am not happy with this solution since it
is not bidirectional but I agree it is the easiest method as far as I am
concerned.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Help with export filter?

2015-08-12 Thread Samuel Loury
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 I find the solution with the code of Thomas S. Dye very elegant:
 * My heading
   Some content with images.
 * My other heading, totally cleared :clearpage:
   some other content

 I hope I clarified the use and the what for.

 AFAICT, this is a very specific, cosmetic, feature targeting a single
 family of export back-ends (i.e., LaTeX and derivatives).

 I see nothing wrong to letting users implement it themselves, as they
 see fit (e.g., one could prefer using a less visible node property for
 that).

I agree with you.

Thank you for taking the time to answer.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Help with export filter?

2015-08-12 Thread Samuel Loury
Dear Nicolas,

Thank you for the prompt reply.
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 This I just the feature I need today. Thank you for sharing. Do you know
 what is missing to add the feature to org-mode instead of adding in each
 user's .emacs file?

 This function apparently includes many features. Which one are you
 talking about?

I used the clearpage and newpage features. The only other way I found
out was to add a bit of latex just before the heading.

--8---cut here---start-8---
* My heading
  Some content with images.
@@latex:\clearpage@@
* My other heading, totally cleared
  some other content
--8---cut here---end---8---

What I dislike with this way of doing is that the latex fragment is
inside the heading above while I would prefer to associate it with the
second heading. The semantic in my case is I am starting a brand new
topic, clear the floats from the last topic so that they won't pollute
my new topic.

I find the solution with the code of Thomas S. Dye very elegant:
--8---cut here---start-8---
* My heading
  Some content with images.
* My other heading, totally cleared :clearpage:
  some other content
--8---cut here---end---8---

I hope I clarified the use and the what for.

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Help with export filter?

2015-08-12 Thread Samuel Loury
Hi all,
Rasmus ras...@gmx.us writes:

 Hi Tom,

 t...@tsdye.com (Thomas S. Dye) writes:

 Aloha all,

 Inspired by discussions and code on the mailing list, I managed to
 cobble together the headline filter below.  It works in that the
 pdf output from LaTeX export is exactly what I want.  I'm thrilled!

 It has one unwanted side effect.  In the tex file, a headline tagged
 with either :newpage: or :clearpage: includes some extra baggage, like
 this:

   \newpage
   \section*{Introduction\hfill{}\textsc{}}
   \label{sec-5}

 I tried setting the option tags:nil, but then my export tags had no
 effect.  Can someone suggest how I can avoid the \hfill etc.?  Or, am I
 picking nits here?

 * Filter headline tags

 #+name: filter-headline-tags
 #+BEGIN_SRC emacs-lisp :results silent

   (defun tsd-filter-headline-tags (contents backend info)
 Ignore headlines with tag `ignoreheading' and/or start LaTeX
   section with `newpage' or `clearpage' command.
 (cond ((and (org-export-derived-backend-p backend 'latex)
 (string-match \\`.*newpage.*\n (downcase contents))
 (string-match \\`.*ignoreheading.*\n (downcase contents)))
(replace-match newpage\n nil nil contents))
   ((and (org-export-derived-backend-p backend 'latex)
 (string-match \\`.*clearpage.*\n (downcase contents))
 (string-match \\`.*ignoreheading.*\n (downcase contents)))
(replace-match clearpage\n nil nil contents))
   ((and (org-export-derived-backend-p backend 'latex 'html 'ascii)
 (string-match \\`.*ignoreheading.*\n (downcase contents)))
(replace-match  nil nil contents))
   ((and (org-export-derived-backend-p backend 'latex)
 (string-match \\(\\`.*\\)newpage\\(.*\n\\) (downcase 
 contents)))
(replace-match newpage\n\\1\\2  nil nil contents))
   ((and (org-export-derived-backend-p backend 'latex)
 (string-match \\(\\`.*\\)clearpage\\(.*\n\\) (downcase 
 contents)))
(replace-match clearpage\n\\1\\2  nil nil contents
 #+END_SRC

This I just the feature I need today. Thank you for sharing. Do you know
what is missing to add the feature to org-mode instead of adding in each
user's .emacs file?

My best,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] [PATCH] Fix `org-refresh-category-properties'

2015-04-28 Thread Samuel Loury
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Hello,

 Samuel Loury konubi...@gmail.com writes:

 Samuel Loury konubi...@gmail.com writes:

 Dear Nicolas,

 [...]

 --8---cut here---start-8---
 #+CATEGORY: c
 * foo
   :PROPERTIES:
   :CATEGORY: a
   :END:
 ** bar
:PROPERTIES:
:CATEGORY: b
:END:

 --8---cut here---end---8---

 `org-get-category' in the bar headline returns 'a', while I would expect
 it to return 'b'.

 [...]

 I don't understand why one would want to remove this behavior. Does it
 raise a technical issue?

 No, it's a bug.

 After a quick look at the code, I wonder if this new behavior is a
 technical choice or hopefully a simple mistake.

 The latter.

 Please find attached a patch that restores the behavior of taking into
 account the CATEGORY keyword in sub-trees also.
 

 Applied, with an additional test. Thank you.

Thank you for the fast answer.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] [PATCH] Fix `org-refresh-category-properties' (was: `org-get-category' and `org-entry-get' do not return the same value)

2015-04-28 Thread Samuel Loury
Samuel Loury konubi...@gmail.com writes:

 Dear Nicolas,

[...]

 --8---cut here---start-8---
 #+CATEGORY: c
 * foo
   :PROPERTIES:
   :CATEGORY: a
   :END:
 ** bar
:PROPERTIES:
:CATEGORY: b
:END:

 --8---cut here---end---8---

 `org-get-category' in the bar headline returns 'a', while I would expect
 it to return 'b'.

[...]

 I don't understand why one would want to remove this behavior. Does it
 raise a technical issue?

After a quick look at the code, I wonder if this new behavior is a
technical choice or hopefully a simple mistake.

Please find attached a patch that restores the behavior of taking into
account the CATEGORY keyword in sub-trees also.

From 9de5161d4bf8a3a3be2fa91d48667d676233e1a4 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Tue, 28 Apr 2015 08:55:10 +0200
Subject: [PATCH] Fix `org-refresh-category-properties'

* lisp/org.el (org-refresh-category-properties): Prevent the `put-text-property'
  to change the point in order to take into account the CATEGORY keyword
  property in subtrees also.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index e52bf53..5b1dded 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9568,7 +9568,7 @@ The refresh happens only for the current tree (not subtree).
 	(when (org-at-property-p)
 	  (put-text-property
 	   (save-excursion (org-back-to-heading t) (point))
-	   (org-end-of-subtree t t)
+	   (save-excursion (org-end-of-subtree t t) (point))
 	   'org-category
 	   value)
 
-- 
2.1.4

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] `org-get-category' and `org-entry-get' do not return the same value

2015-04-28 Thread Samuel Loury
Dear Nicolas,
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 I use the version cd6fa4c15e8e35afa6beb9e89ad3723fb82df091 (git sha) of
 org-mode.

 Let's say I have a file looking like this:

 #+CATEGORY: c
 * foo
   :PROPERTIES:
   :CATEGORY: a
   :END:
 ** bar
:PROPERTIES:
:CREATED:  [2015-01-30 Fri 08:37]
:END:

 With the point on bar, `org-get-category' returns a while
 (org-entry-get (point) CATEGORY t) returns c. Notice that it returns
 c even if the third argument is INHERIT.

 This should be fixed. Thank you.

Thank you for taking the time to fix the problem.

I just fetched the last version of the sources and realized the CATEGORY
handling still strange. The CATEGORY keyword is taken into account only
at the upper level in the headline hierarchy.

I will illustrate the in the same example as above with a small
modification:

--8---cut here---start-8---
#+CATEGORY: c
* foo
  :PROPERTIES:
  :CATEGORY: a
  :END:
** bar
   :PROPERTIES:
   :CATEGORY: b
   :END:

--8---cut here---end---8---

`org-get-category' in the bar headline returns 'a', while I would expect
it to return 'b'.

I realized that this change was introduced in the following commit:

--8---cut here---start-8---
commit 80bccca4e249cbb5812963863ccffbdcf4b25edd
Author: Nicolas Goaziou m...@nicolasgoaziou.fr
Date:   Tue Mar 31 16:22:10 2015 +0200

Fix `org-refresh-category-properties'

* lisp/org.el (org-refresh-category-properties): Ignore false
  positives when setting category.  Also, deprecate old CATEGORY
  keyword behaviour: new keywords override old ones.
--8---cut here---end---8---

Most of my work flow with org-mode relies on this old behavior.

I searched through the sources, the git history and the mailing list to
find out why this behavior was changed but found nothing.

I don't understand why one would want to remove this behavior. Does it
raise a technical issue?

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Conditional .gitignore for org-mode files

2015-04-27 Thread Samuel Loury
Dear David,
David Dynerman da...@block-party.net writes:

 What I'd like is something like the following gitignore logic:

 if filename.org is tracked by git:
ignore filename.tex, filename.html

 If this isn't possible, does anyone have any nice setups for ignoring
 exported versions of org-mode files?

The manual of gitignore indicates that gitignore don't handle other
behaviors than pattern matching.

--8---cut here---start-8---
man gitignore
--8---cut here---end---8---

My workaround is simply to gather org files into a same directory and
add git ignore rules for each kind of generated file.

--8---cut here---start-8---
*.html
*.tex
*.ps
*.pdf
--8---cut here---end---8---

Hope that helps,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Hiding blocked TODO items

2015-04-07 Thread Samuel Loury
Dear Nikolaus,

Nikolaus Rath nikol...@rath.org writes:

 Is there a way to have TODO items blocking each other?

 For example, if I have this document:

 * TODO Pay water
   :PROPERTIES:
:blocked-on: checks
   :END:
 * TODO Pay electricity
   :PROPERTIES:
:blocked-on: checks
   :END:
 * TODO Get new checks
   :PROPERTIES:
:id: checks
   :END:

 Then I'd like the first two TODO items not to show up in the agenda
 until the third one is DONE (but I don't much care if the items can be
 manually switched to DONE or not).

 I looked at org-depend.el but as far as I can tell, it only allows to
 set up chains of dependencies, i.e. I could have Pay Water and Pay
 electricity in state NEXT, and have a trigger in Get new checks that
 would switch one, but not both, of the NEXT items to TODO.

 Do I understand that correctly? Is there some other way to achieve what
 I want?

I think that the dependency could be declared using org-depend but with
the BLOCKER keyword instead of the TRIGGER one. To allow the elements to
still be set to DONE, you could use the NOBLOCKING keyword.

Then, in the agenda view, you could use the org-agenda-skip-function
variable and put something like org-depend-block-todo that would
indicate to skip the blocked items. Sorry to be to lazy to write the
code here...

The outline would look like this:
--8---cut here---start-8---
* TODO Pay water
  :PROPERTIES:
  :BLOCKER: checks
  :NOBLOCKING: t
  :END:
* TODO Pay electricity
  :PROPERTIES:
  :BLOCKER: checks
  :NOBLOCKING: t
  :END:
* TODO Get new checks
  :PROPERTIES:
  :id: checks
  :END:
--8---cut here---end---8---

Having at the same time BLOCKER and NOBLOCKING appears a bit confusing
to me. May be it is not a so good solution and an org-mode guru will
probably correct me :-).

Hoping this was useful.

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] [OT] A short (less than a minute), informal survey about LaTeX

2015-03-23 Thread Samuel Loury
Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 1. Did you know about the savetrees package by Scott Pakin
 (http://www.ctan.org/pkg/savetrees)?  From the description:

No.

 2. Would you find it useful when producing PDF files other that
 scientific articles (using Org-mode or not)?

Yes
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Publishing orgmode files

2015-02-23 Thread Samuel Loury
Hi,
Xavier Maillard xav...@maillard.im writes:

 Hello,

 I am trying to publish my org project but I am lost in the way I can
 tweak my projects.

 Is there some good tutorial I can follow step by step in order to
 publish several files at once ?

 My site tree is like this:

 web/
 ├── Makefile
 ├── css
 │   └── style.css
 ├── gnupg.org
 ├── header
 │   └── header.org
 ├── index.org
 ├── org-templates
 │   └── level-0.org
 └── publish_config.el

 I am using a Makefile to build it from the command line but it is
 just a gadget that just make a call to `org-publish-project'.

 Where I am totally lost is with how I can tweak my publish option.

 Turns out I can add many options directly into org-mode files but
 that's not practical to clone/duplicate them in several places. This
 is where org-templates should enter the dance but either I use them
 bad or it just not the way to go.

 I am tryng as a simple example, to replace the default (included)
 style with my own (stored in css/style.css).

 My org-templates/level-0.org has this:

 #+STYLE: link rel=stylesheet type=text/css href=css/style.css /

 # Local Variables:
 # org-html-head-include-default-style: nil
 # org-html-head-include-scripts: nil
 # End:

 All of this has been stolen here and there but it just does nothing.
 Elsewhere I have seen we can embed :style in the
 `org-publish-project-alist' (same result). Some people are using
 #+HTML_HEAD_EXTRA instead.

 So what is the way to go just for this basic stuff ?

 I have nothing configured with org-mode (8.2.10 version by the way)
 and I am using the defaults eveywhere.

I don't know of org-template, but I generally set some elisp variables
to provide my own customization before calling
`org-publish-project'. Wouldn't it be enough for your use case? For
instance, I guess your call to `org-publish-project' could look like:
--8---cut here---start-8---
(let (
  (org-export-html-style link rel=\stylesheet\ type=\text/css\ 
href=\css/style.css\ /)
  (org-html-head-include-default-style nil)
  (org-html-head-include-scripts nil)
  )
  (org-publish-project ...)
  )
--8---cut here---end---8---

Would it do the trick?

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] org-expiry not compatible with the new drawer syntax

2015-02-02 Thread Samuel Loury
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 Please find attached the merged patch, as asked for.

 Applied, thank you.

 Therefore, the hooks associated to the insertion of a heading will be
 triggered. Since those hooks may cause the creation of some
 metadata. `org-end-of-meta-data' is used afterward.

 Note that two spaces are required after full stop in commit messages.
Noted, Thank you :-).

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] org-expiry not compatible with the new drawer syntax

2015-02-01 Thread Samuel Loury
Hi,
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 I suggest to provide a helper that would move point after the meta-data
 part to avoid code duplication. Something like (no surprise :-)):
 (defun org-goto-after-metadata-part ()
   (when (org-looking-at-p org-planning-line-re) (forward-line))
   (when (looking-at org-property-drawer-re)
 (goto-char (match-end 0))
 (forward-line)))

 Indeed.

 I would have gladly provided a patch myself but I couldn't find neither
 a good name for the function nor a correct location to store it. Should
 it be in org.el? It is already 24850 lines long...

 I changed `org-end-of-meta-data-and-drawers' into
 `org-end-of-meta-data'.

 Could you merge your other patch and the use of this function?
Please find attached the merged patch, as asked for.

From 02dd79b12d6f19551d1d9648a3a84e53c4cee984 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Thu, 6 Nov 2014 11:02:23 +0100
Subject: [PATCH] Make use of `org-insert-heading' instead of inserting the *
 character

* lisp/org-agenda.el (org-agenda-insert-diary-as-top-level): Make
  use of `org-insert-heading' instead of inserting the * character

Therefore, the hooks associated to the insertion of a heading will be
triggered. Since those hooks may cause the creation of some
metadata. `org-end-of-meta-data' is used afterward.
---
 lisp/org-agenda.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 5f7c9ac..164e2d5 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -9488,7 +9488,10 @@ a timestamp can be added there.
   (widen)
   (goto-char (point-max))
   (or (bolp) (insert \n))
-  (insert *  text \n)
+  (org-insert-heading)
+  (insert text)
+  (org-end-of-meta-data)
+  (unless (bolp) (insert \n))
   (if org-adapt-indentation (org-indent-to-column 2)))
 
 (defun org-agenda-insert-diary-make-new-entry (text)
-- 
2.1.4


Thank you for you support.
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] org-expiry not compatible with the new drawer syntax

2015-01-30 Thread Samuel Loury
Thank you for taking into account this problem.

Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 I just realized that when creating a new entry in my org-diary
 (`org-agenda-add-entry-to-org-agenda-diary-file'), the entry looks like:

 ** test
   2015-01-30 Fri
:PROPERTIES:
:CREATED:  [2015-01-30 Fri 08:00]
:END:

 The property is added by an call to `org-expiry-insert-created' in the
 `org-insert-heading-hook'. see in contrib/lisp/org-expiry.el:179

 With more details:

 In the process in inserting the diary entry,
 `org-agenda-add-entry-to-org-agenda-diary-file'
 calls (lisp/org-agenda.el:9460)
 `org-agenda-insert-diary-as-top-level' (lisp/org-agenda.el:9479).

 The later then calls `org-insert-heading' (calling the org-expiry hook
 that creates the property drawer), and inserts the text of the heading
 followed by a new line, resulting in the insertion of:

 Actually, AFAICT, the sole function calling `org-insert-heading' in
 org-agenda.el is `org-agenda-insert-diary-make-new-entry'. I fixed it
 so it properly puts point on the right spot in the entry.

The function `org-agenda-insert-diary-as-top-level' is a few line above
the one you patched.

I copied the code you've written in
`org-agenda-insert-diary-make-new-entry' and I've put it in
`org-agenda-insert-diary-as-top-level'. This fixes my problem. Please
find attached the associated patch.
From d826e7b8d4208a2cd9129c0b9f411aa662e6d67d Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Fri, 30 Jan 2015 11:19:45 +0100
Subject: [PATCH] Fix `org-agenda-insert-diary-as-top-level'

* lisp/org-agenda.el (org-agenda-insert-diary-as-top-level): Ensure
  point is at a real body line and not in front of meta data, so
  regular contents can be inserted safely after a call to this
  function.
---
 lisp/org-agenda.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index e719c00..ed882ae 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -9489,7 +9489,13 @@ a timestamp can be added there.
   (goto-char (point-max))
   (or (bolp) (insert \n))
   (org-insert-heading)
-  (insert text \n)
+  (insert text)
+  (forward-line)
+  (when (org-looking-at-p org-planning-line-re) (forward-line))
+  (when (looking-at org-property-drawer-re)
+(goto-char (match-end 0))
+(forward-line))
+  (unless (bolp) (insert \n))
   (if org-adapt-indentation (org-indent-to-column 2)))
 
 (defun org-agenda-insert-diary-make-new-entry (text)
-- 
2.1.4


 My opinion is that we should either consider that adding a property in
 `org-insert-heading-hook' is a bad practice or change the functions that
 create entries to make sure they move beyond a potentially created
 properties drawer before adding extra information such as timestamps.

 What is your opinion?

 If a function calls on `org-insert-heading' and puts point in some
 position for further processing, it should take into consideration
 meta-data (i.e., planning info and properties drawer).
I suggest to provide a helper that would move point after the meta-data
part to avoid code duplication. Something like (no surprise :-)):
--8---cut here---start-8---
(defun org-goto-after-metadata-part ()
  (when (org-looking-at-p org-planning-line-re) (forward-line))
  (when (looking-at org-property-drawer-re)
(goto-char (match-end 0))
(forward-line)))
--8---cut here---end---8---

I would have gladly provided a patch myself but I couldn't find neither
a good name for the function nor a correct location to store it. Should
it be in org.el? It is already 24850 lines long...

My best :-),
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] org-expiry not compatible with the new drawer syntax

2015-01-30 Thread Samuel Loury
Samuel Loury konubi...@gmail.com writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 I just realized that when creating a new entry in my org-diary
 (`org-agenda-add-entry-to-org-agenda-diary-file'), the entry looks like:

 ** test
   2015-01-30 Fri
:PROPERTIES:
:CREATED:  [2015-01-30 Fri 08:00]
:END:

 The property is added by an call to `org-expiry-insert-created' in the
 `org-insert-heading-hook'. see in contrib/lisp/org-expiry.el:179

 With more details:

 In the process in inserting the diary entry,
 `org-agenda-add-entry-to-org-agenda-diary-file'
 calls (lisp/org-agenda.el:9460)
 `org-agenda-insert-diary-as-top-level' (lisp/org-agenda.el:9479).

 The later then calls `org-insert-heading' (calling the org-expiry hook
 that creates the property drawer), and inserts the text of the heading
 followed by a new line, resulting in the insertion of:

 Actually, AFAICT, the sole function calling `org-insert-heading' in
 org-agenda.el is `org-agenda-insert-diary-make-new-entry'. I fixed it
 so it properly puts point on the right spot in the entry.

 The function `org-agenda-insert-diary-as-top-level' is a few line above
 the one you patched.

 I copied the code you've written in
 `org-agenda-insert-diary-make-new-entry' and I've put it in
 `org-agenda-insert-diary-as-top-level'. This fixes my problem. Please
 find attached the associated patch.

I just realized that the call to `org-insert-heading' was into one of my
local patches.

Actually, I think this patch may be worth applying to prior to the one I
just sent.

Please, find it attached to this email.
From b975ff7630dcf289a795a9eb0ec6f449d0efd621 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Thu, 6 Nov 2014 11:02:23 +0100
Subject: [PATCH] Make use of `org-insert-heading' instead of inserting the *
 character

* lisp/org-agenda.el (org-agenda-insert-diary-as-top-level): Make
  use of `org-insert-heading' instead of inserting the * character

Therefore, the hooks associated to the insertion of a heading will
be triggered.
---
 lisp/org-agenda.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b83c331..e719c00 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -9488,7 +9488,8 @@ a timestamp can be added there.
   (widen)
   (goto-char (point-max))
   (or (bolp) (insert \n))
-  (insert *  text \n)
+  (org-insert-heading)
+  (insert text \n)
   (if org-adapt-indentation (org-indent-to-column 2)))
 
 (defun org-agenda-insert-diary-make-new-entry (text)
-- 
2.1.4


It makes sure the `org-insert-heading' is called instead of hard-coding
its behavior by inserting the * character. I initially made this patch
to make sure the org-expiry hook is called whenever I create diary
entries.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] org-expiry not compatible with the new drawer syntax

2015-01-29 Thread Samuel Loury
Dear All,

I am running the version cd6fa4c15e8e35afa6beb9e89ad3723fb82df091 (git
sha) of org-mode.

I just realized that when creating a new entry in my org-diary
(`org-agenda-add-entry-to-org-agenda-diary-file'), the entry looks like:

--8---cut here---start-8---
** test
  2015-01-30 Fri
   :PROPERTIES:
   :CREATED:  [2015-01-30 Fri 08:00]
   :END:
--8---cut here---end---8---

The property is added by an call to `org-expiry-insert-created' in the
`org-insert-heading-hook'. see in contrib/lisp/org-expiry.el:179

With more details:

In the process in inserting the diary entry,
`org-agenda-add-entry-to-org-agenda-diary-file'
calls (lisp/org-agenda.el:9460)
`org-agenda-insert-diary-as-top-level' (lisp/org-agenda.el:9479).

The later then calls `org-insert-heading' (calling the org-expiry hook
that creates the property drawer), and inserts the text of the heading
followed by a new line, resulting in the insertion of:
--8---cut here---start-8---
** test

   :PROPERTIES:
   :CREATED:  [2015-01-30 Fri 08:00]
   :END:
--8---cut here---end---8---

Then `org-agenda-add-entry-to-org-agenda-diary-file' inserts the
timestamp, resulting in:
--8---cut here---start-8---
** test
  2015-01-30 Fri
   :PROPERTIES:
   :CREATED:  [2015-01-30 Fri 08:00]
   :END:
--8---cut here---end---8---

This is not compatible with the new drawer syntax (see
http://article.gmane.org/gmane.emacs.orgmode/91752).

My opinion is that we should either consider that adding a property in
`org-insert-heading-hook' is a bad practice or change the functions that
create entries to make sure they move beyond a potentially created
properties drawer before adding extra information such as timestamps.

What is your opinion?

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] `org-get-category' and `org-entry-get' do not return the same value

2015-01-29 Thread Samuel Loury
Hi,

I use the version cd6fa4c15e8e35afa6beb9e89ad3723fb82df091 (git sha) of
org-mode.

Let's say I have a file looking like this:

--8---cut here---start-8---
#+CATEGORY: c
* foo
  :PROPERTIES:
  :CATEGORY: a
  :END:
** bar
   :PROPERTIES:
   :CREATED:  [2015-01-30 Fri 08:37]
   :END:
--8---cut here---end---8---

With the point on bar, `org-get-category' returns a while
(org-entry-get (point) CATEGORY t) returns c. Notice that it returns
c even if the third argument is INHERIT.

This causes the strange behavior that I cannot set interactively the
CATEGORY property value to c with C-x C-c p.

The behavior is again more strange in the agenda, where the bar entry is
correctly shown with the CATEGORY a and trying to change it with
--8---cut here---start-8---
C-x C-c p CATEGORY c
--8---cut here---end---8---
does nothing.

Is there a new way to interactively edit the CATEGORY or should
`org-set-property' tackle the special case of CATEGORY?

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] [PATCH] Find a link after point in `org-open-at-point'

2015-01-27 Thread Samuel Loury
Hi,
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 I would like to propose a patch for `org-open-at-point' to find a link
 after point when called inside a paragraph. It had this behavior at some
 time and I think lost it during the org-element re-factoring. This patch
 restores this ancient behavior with the new way the function is
coded.

 Thanks for the patch.

 However, I removed this because it is too sloppy. I want
 `org-open-at-point' to be predictable.

Thank you for the answer.

 If you rely on this, I suggest to defadvice `org-open-at-point'
instead.

I'll do that.

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Requesting some help with scheduled repeated tasks

2015-01-27 Thread Samuel Loury
Sagar Shankar sa...@scubed.in writes:

 Thanks Christopher, the latter option seems to accomplish what I require
 though not very elegant

This discussion is also about this issue. I think you'll find it
interested.

http://mid.gmane.org/871tp74ic2@konixwork.incubateur.ens-lyon.fr

--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] [PATCH] Find a link after point in `org-open-at-point'

2015-01-26 Thread Samuel Loury
Samuel Loury konubi...@gmail.com writes:

 I would like to propose a patch for `org-open-at-point' to find a link
 after point when called inside a paragraph. It had this behavior at some
 time and I think lost it during the org-element re-factoring. This patch
 restores this ancient behavior with the new way the function is coded.

 Please find the patch attached in this mail.

Actually, I just found out that the behavior could be the same in items.

Please find attached the modified patch.

Best regards,
From e05f1a54af26f2eebc4b33fe961951af65e70195 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Mon, 26 Jan 2015 08:44:06 +0100
Subject: [PATCH] Find a link after point in `org-open-at-point'

* lisp/org.el (org-open-at-point): Look for a link after point but in the same
line as (point) when called inside a paragraph or an item.

Now, the user doesn't have to move the cursor to the link to call
`org-open-at-point'.
---
 lisp/org.el | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1041c13..73ff1fc 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10694,7 +10694,8 @@ link in a property drawer line.
 	  (org-element-lineage
 	   (org-element-context)
 	   '(comment comment-block footnote-definition footnote-reference
-			 headline inlinetask link node-property timestamp)
+			 headline inlinetask link node-property
+			 timestamp paragraph item)
 	   t))
 	 (type (org-element-type context))
 	 (value (org-element-property :value context)))
@@ -10870,6 +10871,12 @@ link in a property drawer line.
 			 (= (org-element-property :post-affiliated context)
 			(line-beginning-position)))
 	  (org-footnote-action))
+	 ;; On a paragraph, find a link on the current line after point.
+	 ((memq type '(paragraph item))
+	  (save-excursion
+	(if (re-search-forward org-any-link-re (line-end-position) t)
+		(org-open-at-point)
+	  (user-error No link found
 	 (t (user-error No link found)
 (move-marker org-open-link-marker nil)
 (run-hook-with-args 'org-follow-link-hook)))
-- 
2.1.4

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] [PATCH] Find a link after point in `org-open-at-point'

2015-01-26 Thread Samuel Loury
Dear all,

I would like to propose a patch for `org-open-at-point' to find a link
after point when called inside a paragraph. It had this behavior at some
time and I think lost it during the org-element re-factoring. This patch
restores this ancient behavior with the new way the function is coded.

Please find the patch attached in this mail.

Best regards,
From ea1d4d061a74d7797bf5cf78dc2722eb0baaf7be Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Mon, 26 Jan 2015 08:44:06 +0100
Subject: [PATCH] Find a link after point in `org-open-at-point'

* lisp/org.el (org-open-at-point): Look for a link after point but in the same
line as (point) when called inside a paragraph.

Now, the user doesn't have to move the cursor to the link to call
`org-open-at-point'.
---
 lisp/org.el | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1041c13..5373179 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10694,7 +10694,9 @@ link in a property drawer line.
 	  (org-element-lineage
 	   (org-element-context)
 	   '(comment comment-block footnote-definition footnote-reference
-			 headline inlinetask link node-property timestamp)
+			 headline inlinetask link node-property
+			 timestamp paragraph
+			 )
 	   t))
 	 (type (org-element-type context))
 	 (value (org-element-property :value context)))
@@ -10870,6 +10872,12 @@ link in a property drawer line.
 			 (= (org-element-property :post-affiliated context)
 			(line-beginning-position)))
 	  (org-footnote-action))
+	 ;; On a paragraph, find a link on the current line after point.
+	 ((memq type '(paragraph))
+	  (save-excursion
+	(if (re-search-forward org-any-link-re (line-end-position) t)
+		(org-open-at-point)
+	  (user-error No link found
 	 (t (user-error No link found)
 (move-marker org-open-link-marker nil)
 (run-hook-with-args 'org-follow-link-hook)))
-- 
2.1.4

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] can I refile or archive from the agenda without rebuilding?

2014-12-17 Thread Samuel Loury
Kyle Meyer k...@kyleam.com writes:

 Alan Schmitt alan.schm...@polytechnique.org wrote:
 On 2014-12-15 09:31, Samuel Loury konubi...@gmail.com writes:
 [...]
 This is how I did it:

 #+begin_src emacs-lisp
 (defun as/org-agenda-refile-noupdate (optional goto rfloc)
   Call `org-agenda-refile' with arguments GOTO, RFLOC, and t.
   (interactive P)
   (org-agenda-refile goto rfloc t))

 (add-hook 'org-agenda-mode-hook
   (lambda ()
 (local-set-key (kbd C-c C-w) 'as/org-agenda-refile-noupdate)))
 #+end_src

 You could also use

 (define-key org-agenda-mode-map [remap org-agenda-refile]
   'as/org-agenda-refile-noupdate)

 I'm curious: is it better to use an advice or to redefine a function?

 I usually prefer to define a new function because it allows you to use
 both the old and new variant.

That makes sense. Thanks for the advice (no pun intended).

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] can I refile or archive from the agenda without rebuilding?

2014-12-15 Thread Samuel Loury
Alan Schmitt alan.schm...@polytechnique.org writes:

 On 2014-12-12 12:01, Kyle Meyer k...@kyleam.com writes:

 Alan Schmitt alan.schm...@polytechnique.org wrote:
 My agenda is fairly big, and it takes a few minutes to generate it.

 Wow.

 I meant seconds (about 20 seconds). But is feels like minutes ;)

I have the same feeling :-).

 When I need to refile many items to different places (so bulk edit is
 not an option), it slows me down quite a bit. Is there an option to
 prevent rebuilding the agenda after archiving or refiling?

 org-agenda-refile takes a NO-UPDATE argument.  To set this
 interactively, you could advise org-agenda-refile (or wrap it in another
 command).

 This is a great suggestion, thanks! It works perfectly.

For other readers to take advantage of the code, this is my
implementation of the advise.

--8---cut here---start-8---
(defun my/org-agenda-refile (orig optional goto rfloc no-update)
  (funcall orig goto rfloc t))

(add-function :around
  (symbol-function 'org-agenda-refile)
  #'my/org-agenda-refile)
--8---cut here---end---8---

My two cents,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] constellations Re: relative deadlines

2014-12-15 Thread Samuel Loury
J. David Boyd dbo...@mmm.com writes:

 Tom Baker tombake...@gmail.com writes:

 Date: Tue, 09 Dec 2014 12:05:39 -0500
 From: dbo...@mmm.com (J. David Boyd)
 To: emacs-orgmode@gnu.org
 Subject: Re: [O] relative deadlines

 J. David Boyd  dbo...@mmm.com  wrote on Dec 9:
 Jeffrey Brent McBeth mcb...@broggs.org writes:
  From time to time (each time I delve into using org-mode for
 deadlines
  before my habits fall apart), I find the desire to have some form
 of
  relative deadlines. By this I mean, that there are often sequences
 of
  tasks that I know the time required to complete and when things
 are
  due. These tasks may repeat (usually do).
 
  It would be awful helpful to me, but I would guess few others, as
 a
  search didn't find much, for there to be some annotation like this
  (example is farcical, notation is notional)
 
  * Go on date
  DEADLINE: 2014-12-25
  ** Ask Girl #-3w#
  ** Wash Hair #-2w#
  ** Make Money #-1w2d#
  ** Get in Car #-0d#
  ** Call her back #+1w#
 
  that in the agenda view would show as a sequence of tasks with the
 following dates
  Go on date 2014-12-25
  Ask Girl 2014-12-04
  Wash Hair 2014-12-11
  Make Money 2014-12-16
  Get in Car 2014-12-25
  Call her back 2015-01-01
 
  I have a python function that can take a stripped down org file
 and
  places an active date after each #block# (or inactive after
  #[block]#), that I hacked up today to see if it would really be as
  useful as I thought, but I keep thinking that someone somewhere
 must
  have scratched this itch elsewhere, and having to partially parse
 org
  in python and modify the text rather than having my agenda smart
  enough to figure it out gives me pause...
 
  If nobody have better ideas, are the block delimiters I'm using
 going
  to conflict with some other feature in org that I'm just not using
  yet?
 
  The main functuionality I'm stumbling toward is having an easily
  moveable end date (so replacing the block with absolute dates is a
  nono).
 
  Thanks for your attention,
  Jeffrey McBeth
 
 I think like that as well. I know when some _thing_ has to be done.
 Then I
 start thinking of all the support items in relative terms to the
 main one.
 
 You should add this to org mode, if able. It would be a nice
 addition...
 
 Dave

 The relative deadline part should be implemented, I agree.

 I also like the collection of intermediate tasks. Does Emacs have a
 name for that? Because I used to call that a constellation of
 deadlines, and if we have the relative timestamps, the constellation
 would be easy to implement on the fly.

 This addresses Jeffrey's original intention, you see, if I explain. If
 I have an appointment at 4pm and I know it is a 40m drive AND I may
 need to get dressed formally (that takes 30m), then I really can't
 tell the Org system Notify me at 4pm. Instead, I *need* to have it
 say, Get me driving by 320pm, and if I need to dress up, then get
 that started by 250pm. Really, for me, the appointment at 4 starts
 much earlier. Also, keep track of the fact that I will probably come
 right back, so if the appointment ends at 530, then I won't get back
 until 610pm.

 Now if Jeffrey wants to schedule something like this BUT needs to take
 into account that he already has a 6pm appointment, then his request
 for an easily movable end is reasonable. When he is setting up the
 appointment, Org needs to tell him, as soon as possible, that there is
 a conflict, and so when they suggest 330pm instead of 4pm? he can
 try that.

 Tom

 Yup, exactly what I would like.  I hate modern appointment calendars, as they
 have no means of accomplishing this...

 Dave

I also think I would use such feature.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Export Org-mode content to Reveal.js presentations

2014-12-08 Thread Samuel Loury
Yujie Wen yjwen...@gmail.com writes:

   I'd like to introduce a new Org-Mode exporter, Org-reveal, that exports
 Org-mode contents to Reveaj.js presentations.

I have to write a presentation and though about giving org-reveal a
try. I managed to get something nice looking in about 10 minutes.

Did you think about proposing org-reveal in the org contributions? Is
the dependency on reveal.js a problem?

Anyway, thank you very much for this very good work.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Org-edu-HTML

2014-11-19 Thread Samuel Loury
Hi,
Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 as I mentioned some time ago, I started working on a custom exporter
 from Org to HTML for educational materials.  My vision is that there
 will be (some kind) of syntax in Org (most probably, I'm going to
 (ab)use the existing syntax) for specifying various kinds of exercises.

I really like the idea.

Unfortunately, I don't have any use of this library for now. I hope that
when I will, the project will still be alive :-)!

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Coursera class on reproducible research

2014-11-16 Thread Samuel Loury
Hi,
John Hendy jw.he...@gmail.com writes:

 Thought this might interest the list:
 - https://www.coursera.org/course/repdata

[...]

 just wanted to pass it along as I know there are others who implement
 these principles in their work on the ML.

That very kind. Thank you for sharing.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpVF8UikrA9j.pgp
Description: PGP signature


Re: [O] Repeated teaching classes and stopping date

2014-11-14 Thread Samuel Loury
Eric S Fraga e.fr...@ucl.ac.uk writes:

 On Thursday, 13 Nov 2014 at 11:44, Samuel Loury wrote:


[...]

 and I use sticky agenda views to help avoid unnecessary regeneration.

Wow, sticky agenda views are cool!

 I don't understand how the SD card speed is to be taken into account
 since org mode by default loads into emacs (and then in memory) all the
 org files prior to computing the agenda.

 Are you sure?  I had the impression that my org files were not accessed
 until I asked for the agenda.  But maybe they are in which case you are
 correct that the SD card doesn't matter.

Actually, the first agenda generation appears to load all the buffers
and next generations only use the existing buffers.

Therefore, the SD card matters indeed for the first generation.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpC6DtalrLvJ.pgp
Description: PGP signature


Re: [O] Repeated teaching classes and stopping date

2014-11-13 Thread Samuel Loury
Dear all,
James Harkins jamshar...@qq.com writes:

 Rasmus rasmus at gmx.us writes:

 Also check
 `org-clone-subtree-with-time-shift'.

 FWIW, I always create a separate subtree, with a single timestamp, for every
 class session. Advantages:

 - Individual status for each session: DONE, POSTPONED or CANCELED.

 - If a single class in a series needs to be rescheduled, it's easy.

 - I can add notes under the subtree, to plan for the session or note
 important things that happened in class. So then my calendar is not just a
 calendar -- it also helps with content organization. (That IMO is the whole
 point of org-mode: it's not just a calendar!)

I like the idea of `org-clone-subtree-with-time-shift', but wouldn't it
make the parsing of the files slower?

I admit that in the example, this would not have a big impact since
there would be only 9 entries. Nevertheless, I wonder if this can be
considered as a general solution.

In my org files that sum up to 51425 lines (not taking into account the
archives), the creation of the agendas takes minutes to generate. There
are a lot of repeated items with final date¹. I cannot imagine the time
it would take if I would use `org-clone-subtree-with-time-shift'...

My two cents :-)

¹  Like in the case mentioned by Xavier
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpfJmOtqwxXD.pgp
Description: PGP signature


Re: [O] Repeated teaching classes and stopping date

2014-11-13 Thread Samuel Loury
Eric S Fraga e.fr...@ucl.ac.uk writes:

 On Thursday, 13 Nov 2014 at 09:26, Samuel Loury wrote:

[...]

 In my org files that sum up to 51425 lines (not taking into account the
 archives), the creation of the agendas takes minutes to generate. There

 Minutes!  What version of org and what kind of system?

Org version 8.2.7c.
The system is a Samsung galaxy S3.
--8---cut here---start-8---
$ cat /proc/cpuinfo 
Processor   : ARMv7 Processor rev 0 (v7l)
processor   : 0
BogoMIPS: 1592.52

processor   : 1
BogoMIPS: 2189.72

processor   : 2
BogoMIPS: 2189.72

processor   : 3
BogoMIPS: 1592.52

Features: swp half thumb fastmult vfp edsp neon vfpv3 tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part: 0xc09
CPU revision: 0

Chip revision   : 0011
Hardware: SMDK4x12
Revision: 000c
Serial  : cfca7043323016d7
--8---cut here---end---8---

With a RAM of 800Mo.

 I have 35k lines in my org agenda files and generating an agenda on a
5
 year old system takes seconds.  On my wee Pandora, it takes a minute or
 so but this is a very slow system with slow SD cards...

I don't understand how the SD card speed is to be taken into account
since org mode by default loads into emacs (and then in memory) all the
org files prior to computing the agenda.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpNsyfoXxwMy.pgp
Description: PGP signature


Re: [O] Org-mode Habit with Varying Description

2014-10-21 Thread Samuel Loury
Hi,
Eric Abrahamsen e...@ericabrahamsen.net writes:

 I've been (very gradually) working on something I'm calling org-log, for
 just this sort of situation -- a library that would possibly go
 underneath org-habit and maybe even org-clock. It would look like:

 * Read book
   :LOGBOOK:
   - Note taken on [2014-10-20 Mon 10:33] \\
 PAGES: 49
   - Note taken on [2014-10-20 Mon 10:32] \\
 PAGES: 150
   :END:

 When adding notes (or state-change log notes) the user would be prompted
 to record values for the key(s) already existing in the logbook (in this
 case, PAGES). Multiple key-value pairs would be possible. Generic tables
 could be created for a heading, with more specialized tables with
 user-defined column formulas and all that.

 Add unit manipulation/calculation from the calc-units package, and I
 think this could be a nice extension to Org.

 I originally started thinking of this while translating a novel. I had a
 certain number of characters to translate, and a certain deadline. What
 I wanted was a single heading where I logged my progress, and a
 reporting facility that said given today's date and how many characters
 you've already done, you'll need to average XXX characters per day to
 hit the deadline. I envisioned a gnuplot table that showed
 actual-characters-per-day against the shifting
 average-characters-per-day.

That is a very interesting idea. Do you think we could see your actual
work?

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpfBBpIgK_2X.pgp
Description: PGP signature


Re: [O] Formal description of Org files

2014-10-06 Thread Samuel Loury
Hi,
Gustav Wikström gustav.e...@gmail.com writes:

 Just curious: what is it you wish to do in a mobile environment.  I have
 everything I need with MobileOrg and running full emacs + org on an
 OpenPandora.  Obviously, your needs may be different than mine.

 (email composed on train offline on my OpenPandora in Emacs with gnus ;-)

 --
 : Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.3beta-372-gdd70cf

 My wish is to be able to do mostly everything related to
 task-tracking, scheduling, working with references and so on. General
 GTD stuff. OpenPandora sounds neat, except it's not quite the standard
 tool available out there ;-) And a general idea of Emacs in your
 pocket is nice, except it's not really possible without a different UI
 than the keyboard. So; what way forward with GTD in Emacs Org-mode
 then, while still having the wish of it to be more accessible?

 Thus the idea of a more formal (and parsable) grammar in a
 standardized format. My hope is that it will make Org-mode more
 general than it already is. As I said already; Org-mode to me is more
 than Emacs. To think BIG, Org-mode grammar could be a standard for PIM
 or GTD related software. To think a bit less big, it might help
 developers create software with non-Emacs tools. By using the formal
 grammar to work with Org-mode source documents in more accessible
 ways. Maybe with UI's available through mobile phones or tablets (and
 without the use of special schedules of read/write in Emacs to keep
 the mobile system synced; MobileOrg).
This sounds like a good idea. And since there are a lot of parsers in
other languages recognizing a subset of org mode syntax, other people
like this idea too.

I think a difficulty with that solution is that it won't capture the
heavy customization the user can make on org-mode using hooks or
customizing variables.

Having a real emacs in the pocket would provide org-mode along with the
customization. Nevertheless, as you stated, emacs is not really user
friendly when you don't have a keyboard at hand.

For that reason, I think that as well as embedding emacs into the phone,
we could provide a UI communicating with it using an IPC mechanism.

This way, we would have the solution with more to gain (a functional
org-mode as well as the customization) and less to write (only the
needed UI code). I already tried using epc to perform a two way
communication between a python shell and emacs. I talked about this in
another thread¹.

What do you think of this approach?

¹ http://mid.gmane.org/87iokv4659@gmail.com
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgppBCRIOoCxe.pgp
Description: PGP signature


Re: [O] Formal description of Org files

2014-10-02 Thread Samuel Loury

Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Gustav Wikström gustav.e...@gmail.com writes:

 So my question is; have there been more discussions of constructing
 such a formal grammar? Maybe in EBNF form. I suspect getting every
 aspect of Org mode into such a description would be difficult. But
 imagine the possibilities. Tools such as ANTLR and similar would
 straight away have a way of parsing Org mode. 
 Org mode source files could be parsed in many other languages,
 simplifying the process of expanding Org mode to other platforms (
 Android  iOS, web ).


[...]


 See

   (info (org) Org syntax)
I just read the document on worg¹. It is really good! I imagine we are
not far from a formal grammar. I suppose we could write one in EBNF
form.

Nicolas, I can see on the worg version that it is in draft status. Could
you say what is left to do to consider it mature?

¹  http://orgmode.org/worg/dev/org-syntax.html
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpE1rSh6E3xE.pgp
Description: PGP signature


Re: [O] [help] need help with a skip function

2014-09-26 Thread Samuel Loury
Subhan Michael Tindall subh...@familycareinc.org writes:

 Hi, I'm looking for an example org-agenda-skip-function that I can use to 
 include all items for an agenda (IE alltodo) that have a certain property set 
 (value doesn't particularly matter)
 IE:
* TODO H1
  :PROPERTIES:
  :P1: date
  :END:
* TODO H2
  :PROPERTIES:
  :END:
 So that H1 gets included, but H2 does not.
 I know, it's simple to do with a search-type agenda, but unfortunately a bug 
 in sorting for inactive time stamps makes that route unsuitable for my 
 purposes.


 Thanks!
 Subhan
I would do

--8---cut here---start-8---
(defun my/skip-if-not-p1 ()
 (not (org-entry-get (point) P1)))
...

(setq org-agenda-custom-commands
  '(
(p Todo entries with property p1
 (
  (todo nil)
  )
 (
  (org-agenda-skip-function 'my/skip-if-not-p1)
  )
 )
)
)
--8---cut here---end---8---

I have not tested it so beware the typo and reasoning errors but the
idea is there.

I think you could use org-element.el instead of the probably obsolete
`org-entry-get' but I don't know it well enough to propose a solution...

I hope it helps.

Best regards
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpyux0YJXMb7.pgp
Description: PGP signature


Re: [O] Some thoughts on MobileOrg and its development ....

2014-09-10 Thread Samuel Loury
Samuel Loury konubi...@gmail.com writes:

 I have been using the XML-RPC trac plugin³ for a while now and I made we
 wonder if we could reproduce this in the scope of mobile org. With an
 RPC interface, one would be free to create their own interface easily
 (at least python xml-rpc library is really easy to manipulate) and an
 official interface could emerge from that.
I have made a some research on the net and found epc¹. This library
appears to do exactly what I am looking for: a remote procedure call
mechanism in emacs.

For what I have tried so far, it looks very promising.

To install the python side, just run:
--8---cut here---start-8---
pip install epc
--8---cut here---end---8---

To install the emacs server part, it is a bit trickier since elpa ships
only the client part. It was not so hard though.  I installed deferred²,
ctable³ and epc⁴. Then I could launch the emacs rpc server.

For the time being, I only tried exporting the org agenda files. And it
was really easy.

The server code (in emacs) looks like:
--8---cut here---start-8---
(require 'cl)
(require 'epcs)

(defvar pyepc-epcs
  (epcs:server-start
   (lambda (mngr)
 (lexical-let ((mngr mngr))
   (epc:define-method mngr 'org-agenda-files 'org-agenda-files)
   )
 )
   9998
   )
  )
--8---cut here---end---8---

The client code (in python) looks like:
--8---cut here---start-8---
From epc.client import EPCClient
client = EPCClient((localhost, 9998), log_traceback=True)
print str(client.methods_sync())
print str(client.call_sync('org-agenda-files', []))
client.close()
--8---cut here---end---8---

In conclusion, the communication between emacs and python is very
easy. The difficult part now, is to re-factorise the emacs org-mode code
that creates the agenda so that it may provide a data structure
representing the information. I have only had a quick look, but it does
not look straight.

I think it is not much work to get a workable emacs on android⁵ and I
honestly don't know on iPhone.

Once it is done, it would be hopefully easy to configure emacs to run
the epcs code and use anything python based to communicate with it. I
will probably use sl4a⁶ since it is totally awesome.

The aspect I like about the design I propose is that the core (emacs +
epcs) is loosely coupled with the interface. This way, anyone would be
free to provide their one.

What do you think about this project. Do you think it could work? I
think I will eventually start it anyway (just to see). Off course, since
I am also a busy person, it would probably slow, but I honestly think it
would be worth it. Anyone would like to contribute?

Thanks for reading.

¹ http://python-epc.readthedocs.org/en/latest/
² https://github.com/kiwanami/emacs-deferred.git
³ https://github.com/kiwanami/emacs-ctable.git
⁴ https://github.com/kiwanami/emacs-epc.git
⁵ http://article.gmane.org/gmane.emacs.orgmode/77698
⁶ https://code.google.com/p/android-scripting/
--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpEzYPVBLQ0D.pgp
Description: PGP signature


Re: [O] Managing articles in orgmode and collaboration

2014-09-09 Thread Samuel Loury
Vikas Rawal vikasli...@agrarianresearch.org writes:

 There is bibretrieve (https://github.com/pzorin/bibretrieve) and bibfetch 
 (https://github.com/dschoepe/bibfetch/blob/master/bibfetch.el).
Is it only a result of a google search or did you personally use one of those?

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpkKynkteJEg.pgp
Description: PGP signature


[O] [PATCH] Add a support for linking against an attachment of current entry (was: easy way to link to file in attachment directory?)

2014-09-05 Thread Samuel Loury
Hi,
Darlan Cavalcante Moreira darc...@gmail.com writes:

 I have this
   #+LINK: attach elisp:(org-open-file (org-attach-expand %s))
 in all of my org-mode files. In fact, I have this line, among others, in
 an org-mode setup file which is included in all of my org-mode files
 using #+SETUPFILE:

 Then I can create a link to an attachment with
 [[attach:filename_without_any_path.extension][description]]

 Also, just after attaching a new file org will automatically store the
 link so that you can use C-c C-l to include the link.
I like your solution, but I was quite frustrated by the lack of
completion against the attached files,

Here, I propose a solution using `org-add-link-type' and adding
attach: kind of links.

I actually propose to patch org mode to add this feature. I realized
that the part about finding the attached file was already implemented
into `org-attach-open', so I first extracted the functionality into a
separated function, then I made use of it to implement the new attach:
link and the associated completion.

For that reason, I split the work into two commits that you'll find
attached to this mail.

From d4b87312d96d4d1ec44562df5b951aa4df1f7a16 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Fri, 5 Sep 2014 12:11:41 +0200
Subject: [PATCH 1/2] Get the part finding an attachment out of
 `org-attach-open'.

* lisp/org-attach.el (org-attach-find-file): Created
* lisp/org-attach.el (org-attach-open): Make use of `org-attach-open'

This will allow other functions to make use of the `org-attach-find-file'
feature.
---
 lisp/org-attach.el | 35 +++
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index bcf7ba7..eb22b39 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -443,20 +443,39 @@ This will attempt to use an external program to show the directory.
   (let ((attach-dir (org-attach-dir t)))
 (dired attach-dir)))
 
+
+(defun org-attach-find-file (prompt)
+  Provides the name of a file available in the attachments of current
+heading.
+If there are more than one attachment, you will be prompted for the file name.
+  (let* ((attach-dir (org-attach-dir t))
+	 (files (org-attach-file-list attach-dir)))
+(and
+ ;; return nil if not files
+ files
+ (or
+  ;; return the only available file
+  (and
+   (= (length files) 1)
+   (car files)
+   )
+  ;; or return the result of the completion
+  (org-icompleting-read
+   prompt
+   (mapcar 'list files) nil t)
+
 (defun org-attach-open (optional in-emacs)
   Open an attachment of the current task.
-If there are more than one attachment, you will be prompted for the file name.
+Use `org-attach-complete-file' to find the desired file.
 This command will open the file using the settings in `org-file-apps'
 and in the system-specific variants of this variable.
 If IN-EMACS is non-nil, force opening in Emacs.
   (interactive P)
-  (let* ((attach-dir (org-attach-dir t))
-	 (files (org-attach-file-list attach-dir))
-	 (file (if (= (length files) 1)
-		   (car files)
-		 (org-icompleting-read Open attachment: 
-   (mapcar 'list files) nil t
-(org-open-file (expand-file-name file attach-dir) in-emacs)))
+  (let* ((file (org-attach-find-file Open attachment: ))
+	 (attach-dir (org-attach-dir t)))
+(if file
+	(org-open-file (expand-file-name file attach-dir) in-emacs)
+  (user-error Current heading has no attached file
 
 (defun org-attach-open-in-emacs ()
   Open attachment, force opening in Emacs.
-- 
2.1.0

From 916a86e8db6ce6b2dc02ea663d70d07f952bbc33 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Fri, 5 Sep 2014 12:19:12 +0200
Subject: [PATCH 2/2] Add a support for linking against an attachment of
 current entry.

* lisp/org-attach.el (org-attach-open-link, org-attach-complete-link): Created

Add a call to `org-add-link-type' to make use of the feature.
---
 lisp/org-attach.el | 13 +
 1 file changed, 13 insertions(+)

diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index eb22b39..3d6dc71 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -494,6 +494,19 @@ Basically, this adds the path to the attachment directory, and a \file:\
 prefix.
   (concat file: (org-attach-expand file)))
 
+(defun org-attach-open-link (file-name)
+  Open a link to a file attached to the current entry.
+  (let ((attach-dir (org-attach-dir t)))
+	(org-open-file (expand-file-name file-name attach-dir
+
+(defun org-attach-complete-link ()
+  Completion on the attachments when creating a link.
+  (let* ((file (org-attach-find-file Attached file:)))
+(format attach:%s file)))
+
+;; Install the link type
+(org-add-link-type attach 'org-attach-open-link)
+
 (provide 'org-attach)
 
 ;; Local variables:
-- 
2.1.0

Best regards,
--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A



Re: [O] [PATCH] Make use of the constant `org-clock-string' whenever possible

2014-08-27 Thread Samuel Loury
Hi,

Finally, I don't have time to dig into org-element.el for the time
being.

Nonetheless, please find attached a revised version of the patch with
your comments taken into account.

In order to avoid creating the regexp each time `org-at-clock-log-p' is
called, I added the constant `org-clock-line-re', following the same
naming convention as `org-planning-or-clock-line-re' defined above.

From d0247756c9a9c8a753dfba6c2de0c4f1d9ed4fc5 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Tue, 26 Aug 2014 09:11:23 +0200
Subject: [PATCH] [PATCH] Use `org-clock-string' whenever possible

* lisp/org-clock.el (org-find-open-clocks):
* lisp/org.el (org-clone-subtree-with-time-shift,
 org-insert-property-drawer, org-at-clock-log-p): Use
 `org-clock-string' whenever possible instead of hardcoded CLOCK.
 Add the `org-clock-line-re' regexp matching a line with clock info.
---
 lisp/org-clock.el |  3 ++-
 lisp/org.el   | 21 +
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 179d395..2ffcbfa 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -795,11 +795,12 @@ If CLOCK-SOUND is non-nil, it overrides `org-clock-sound'.
   Search through the given file and find all open clocks.
   (let ((buf (or (get-file-buffer file)
 		 (find-file-noselect file)))
+	(org-clock-re (concat org-clock-string  \\(\\[.*?\\]\\)$))
 	clocks)
 (with-current-buffer buf
   (save-excursion
 	(goto-char (point-min))
-	(while (re-search-forward CLOCK: \\(\\[.*?\\]\\)$ nil t)
+	(while (re-search-forward org-clock-re nil t)
 	  (push (cons (copy-marker (match-end 1) t)
 		  (org-time-string-to-time (match-string 1))) clocks
 clocks))
diff --git a/lisp/org.el b/lisp/org.el
index 750b9d1..2dd3e80 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -396,6 +396,10 @@ a timestamp with \\[org-schedule].)
   Matches a line with planning or clock info.
 Matched keyword is in group 1.)
 
+(defconst org-clock-line-re
+  (concat ^[ \t]* org-clock-string)
+  Matches a line with clock info.)
+
  Drawer
 
 (defconst org-drawer-regexp ^[ \t]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ \t]*$
@@ -8659,6 +8663,7 @@ and still retain the repeater to cover future instances of the task.
 	   ))) ;; No time shift
 	(n-no-remove -1)
 	(drawer-re org-drawer-regexp)
+	(org-clock-re (format ^[ \t]*%s.*$ org-clock-string))
 	beg end template task idprop
 	shift-n shift-what doshift nmin nmax)
 (if (not (and (integerp n) ( n 0)))
@@ -8698,7 +8703,8 @@ and still retain the repeater to cover future instances of the task.
 			(org-entry-delete nil ID)
 			  (org-id-get-create t)))
 	(unless (= n 0)
-	  (while (re-search-forward ^[ \t]*CLOCK:.*$ nil t)
+	  (while (re-search-forward
+		  org-clock-re nil t)
 		(kill-whole-line))
 	  (goto-char (point-min))
 	  (while (re-search-forward drawer-re nil t)
@@ -15883,6 +15889,10 @@ formats in the current buffer.
 		  0))
 	(beg (point))
 	(re (concat ^[ \t]* org-keyword-time-regexp))
+	(org-clock-re (format
+	 ^[ \t]*\\(:CLOCK:\\|:LOGBOOK:\\|%s\\|:END:\\)
+	 org-clock-string))
+	(org-skip-line-list (list org-clock-string :END:))
 	end hiddenp)
 (outline-next-heading)
 (setq end (point))
@@ -15891,8 +15901,10 @@ formats in the current buffer.
 (setq hiddenp (outline-invisible-p))
 (end-of-line 1)
 (and (equal (char-after) ?\n) (forward-char 1))
-(while (looking-at ^[ \t]*\\(:CLOCK:\\|:LOGBOOK:\\|CLOCK:\\|:END:\\))
-  (if (member (match-string 1) '(CLOCK: :END:))
+(while (looking-at
+	org-clock-re)
+  (if (member (match-string 1)
+		  org-skip-line-list)
 	  ;; just skip this line
 	  (beginning-of-line 2)
 	;; Drawer start, find the end
@@ -17589,7 +17601,8 @@ With prefix ARG, change that many days.
   Is the cursor on the clock log line?
   (save-excursion
 (move-beginning-of-line 1)
-(looking-at ^[ \t]*CLOCK:)))
+(looking-at
+ org-clock-line-re)))
 
 (defvar org-clock-history) ; defined in org-clock.el
 (defvar org-clock-adjust-closest nil)  ; defined in org-clock.el
-- 
2.1.0.rc1

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpUQASVtqeH1.pgp
Description: PGP signature


[O] [PATCH] Make use of the constant `org-clock-string' whenever possible

2014-08-26 Thread Samuel Loury
Hi,

I would like to submit a tiny patch to make use of `org-clock-string'
instead of the hard coded value CLOCK: whenever possible.

I also found out that :CLOCK: was hard coded in
`org-insert-property-drawer' (git sha
67ae102b4be87976240555d1c0d80ee55906f53c, file lisp/org.el:15897)
instead of using `org-clock-drawer-start-re' but I did not have time to
fix this one.

Please find the patch attached to this mail.
From 8eedb019d277f7f1e8baa6641244ddf7e298d397 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Tue, 26 Aug 2014 09:11:23 +0200
Subject: [PATCH] Make use of the constant `org-clock-string' whenever possible

Instead of the hardcoded value CLOCK:.

* lisp/org-clock.el (org-find-open-clocks)
* lisp/org.el (org-clone-subtree-with-time-shift)
* lisp/org.el (org-insert-property-drawer)
* lisp/org.el (org-at-clock-log-p)

TINYCHANGE
---
 lisp/org-clock.el |  2 +-
 lisp/org.el   | 14 ++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 179d395..14b613e 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -799,7 +799,7 @@ If CLOCK-SOUND is non-nil, it overrides `org-clock-sound'.
 (with-current-buffer buf
   (save-excursion
 	(goto-char (point-min))
-	(while (re-search-forward CLOCK: \\(\\[.*?\\]\\)$ nil t)
+	(while (re-search-forward (concat org-clock-string  \\(\\[.*?\\]\\)$) nil t)
 	  (push (cons (copy-marker (match-end 1) t)
 		  (org-time-string-to-time (match-string 1))) clocks
 clocks))
diff --git a/lisp/org.el b/lisp/org.el
index 750b9d1..4559280 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8698,7 +8698,8 @@ and still retain the repeater to cover future instances of the task.
 			(org-entry-delete nil ID)
 			  (org-id-get-create t)))
 	(unless (= n 0)
-	  (while (re-search-forward ^[ \t]*CLOCK:.*$ nil t)
+	  (while (re-search-forward
+		  (format ^[ \t]*%s.*$ org-clock-string) nil t)
 		(kill-whole-line))
 	  (goto-char (point-min))
 	  (while (re-search-forward drawer-re nil t)
@@ -15891,8 +15892,12 @@ formats in the current buffer.
 (setq hiddenp (outline-invisible-p))
 (end-of-line 1)
 (and (equal (char-after) ?\n) (forward-char 1))
-(while (looking-at ^[ \t]*\\(:CLOCK:\\|:LOGBOOK:\\|CLOCK:\\|:END:\\))
-  (if (member (match-string 1) '(CLOCK: :END:))
+(while (looking-at
+	(format
+	 ^[ \t]*\\(:CLOCK:\\|:LOGBOOK:\\|%s\\|:END:\\)
+	 org-clock-string))
+  (if (member (match-string 1)
+		  (list org-clock-string :END:))
 	  ;; just skip this line
 	  (beginning-of-line 2)
 	;; Drawer start, find the end
@@ -17589,7 +17594,8 @@ With prefix ARG, change that many days.
   Is the cursor on the clock log line?
   (save-excursion
 (move-beginning-of-line 1)
-(looking-at ^[ \t]*CLOCK:)))
+(looking-at
+ (concat ^[ \t]* org-clock-string
 
 (defvar org-clock-history) ; defined in org-clock.el
 (defvar org-clock-adjust-closest nil)  ; defined in org-clock.el
-- 
2.1.0.rc1

--
Samuel


pgpWJH_PMqqkl.pgp
Description: PGP signature


Re: [O] [PATCH] Make use of the constant `org-clock-string' whenever possible

2014-08-26 Thread Samuel Loury
Hi,

Thank you for the comments, I will try to improve the commit as soon as
possible.

About org-element.el, I would be happy to try. I guess the best
documentation is the file itself (it appears to be quite well
commented). Is it a good way to start?

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpPo5Rcun9_x.pgp
Description: PGP signature


[O] [PATCH] Make the regexp matching the beginning of a table more explicit

2014-08-20 Thread Samuel Loury
Hi,

I would like to provide a very tiny change in the regexp matching a
beginning of table in org-table.el.

Its current value is ^\\(\\*+ \\)\\|[ \t]*|. The second part of the
regexp ([ \t]*|) indicates that it matches any | character, following
spaces or not. This means that the [ \t] is useless.

Actually, it matches my :tags expression in the #+BEGIN: clocktable part
because its value is :tags @home|@computer.

I think that Carsten Dominik wanted the | character to be matched only
when at the beginning of a line (modulo indentation spaces).

I then added the ^ character in this part of the regexp to make it work
that way.

Please find the patch attached.

From 04fe96d8782719b2ef90afd16c6b3dcfbd9349c6 Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Wed, 20 Aug 2014 14:32:47 +0200
Subject: [PATCH] Make the regexp matching the beginning of a table more
 explicit

* org-table.el (org-table-get-remote-range): Make the regexp matching the
beginning of a table more explicit, all | characters were matched, even those
contained into the :tags value (like in :tags @home|@computer). This caused
the | character to be interpreted as the beginning of a line. Now, the | is
matched only if it is at the beginning at a line (modulo beginning spaces).
---
 lisp/org-table.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index d1609f9..5654783 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -42,7 +42,7 @@
 		  (string backend optional body-only ext-plist))
 (declare-function aa2u ext:ascii-art-to-unicode ())
 (declare-function calc-eval calc (str optional separator rest args))
-		  
+
 (defvar orgtbl-mode) ; defined below
 (defvar orgtbl-mode-menu) ; defined when orgtbl mode get initialized
 (defvar constants-unit-system)
@@ -2768,7 +2768,7 @@ not overwrite the stored one.
 	(user-error Invalid field specifier \%s\
 			(match-string 0 form)))
 	  (setq form (replace-match formrpl t t form)))
-	
+
 	(if lispp
 	(setq ev (condition-case nil
 			 (eval (eval (read form)))
@@ -5053,7 +5053,7 @@ list of the fields in the rectangle.
 		(widen)
 		(goto-char loc)
 		(forward-char 1)
-		(unless (and (re-search-forward ^\\(\\*+ \\)\\|[ \t]*| nil t)
+		(unless (and (re-search-forward ^\\(\\*+ \\)\\|^[ \t]*| nil t)
 			 (not (match-beginning 1)))
 		  (user-error Cannot find a table at NAME or ID %s name-or-id))
 		(setq tbeg (point-at-bol))
-- 
2.0.1

--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpWYPfLyerkh.pgp
Description: PGP signature


Re: [O] Some thoughts on MobileOrg and its development ....

2014-08-18 Thread Samuel Loury
Xebar Saram zelt...@gmail.com writes:

 would LOVE to try it as well

So would I !

 Henning Weiss hdwe...@gmail.com writes:

 I have been working over the last couple of months on a private
 prototype. I'm currently using it in my daily life and it works for me. It
 uses Git (and only Git) for synchronization and doesn't use org-mobile at
 all. The idea is that you keep all org files under git version control.
 Synchronization of all clients (apps or Emacs) is done against that
 repository. It is also possible to configure whether to use ours or
 theirs merge strategy when conflicts occur. I have focused on designing
 an app I can trust.
 It already has an outline view like MobileOrg, an agenda view, you can
 add and edit nodes, synchronize changes with a remote repository and
 synchronize scheduled entries to the calendar. I ported some of my code
 from MobileOrg, but a lot of it is written from scratch.

I only used the android version, but I was not satisfied with its design
either.

I find the org double synchronization scheme (org - org mobile inbox
- internal phone database) really annoying.

Actually, I have been thinking about how to use my org file with my
phone and the way I found the more practical was to synchronize the
files with my phone using git (git annex actually) and using emacs in a
debian chrooted environment.

With the constantly evolving org-mode code in emacs-lisp, I don't think
a re-implementation would survive.

Besides, emacs-lisp allows to customize pretty everything, so much that
two org-mode setup may easily be made barely compatible with each
other. See the setup of Bernt Hansen for instance that is the most
advanced I have seen so far⁴.

An other point of the evolving characteristic of org is the lack of
definition of what the org-mode grammar is. Without this, it is most
likely that someday, both emacs org-mode and mobile org will diverge at
some point. There has been a very good draft of org mode syntax¹ made by
Nicolas Goaziou. May be this could be the basis of a new
implementation, but it should be worked on to be considered stable and
used as a reference for future implementations.

Those are the reasons why I am not convinced that a new implementation
would work and one of the main reasons each time I wanted to contribute
to mobileorg-android, I was stopped by the feeling that it would be a
useless effort (and the lack of time of course :-)).

Therefore, I wonder if we could let emacs implementation do all the
heavy stuff and customization, and only provide a mobile UI on top of
it.

Emacs could be accessed remotely or be run into the phone. In my Galaxy
S3 with chrooted debian, emacs runs fast enough for my user experience
not to be disturbed.

I have tried the excellent org-ehtml² from Eric Schulte. It already
allows to make basic edition of TODO entries and view the agenda views
(only the basic org-agenda export to html for new). The main problem I
see with this html/js view is that we often encounter strange issues due
to bad browser implementations.

I have been using the XML-RPC trac plugin³ for a while now and I made we
wonder if we could reproduce this in the scope of mobile org. With an
RPC interface, one would be free to create their own interface easily
(at least python xml-rpc library is really easy to manipulate) and an
official interface could emerge from that.

The interface could provide functions like:
--8---cut here---start-8---
getAgendaFiles() - list of files names
getTODOsFromFile(file) - list of todos
getAllTODOs() - list of todos
getAgendaViews() - list of names
getAgendaView(name) - list of todos ?
clockIn(id)
clockOut(id)
refile(id, parent_id)
getKeywords() - list of keywords
setKeyword(id, keyword)
...
--8---cut here---end---8---
I don't know if those functions would be good, but they give an idea.

¹ http://orgmode.org/worg/dev/org-syntax.html
² https://github.com/eschulte/org-ehtml
³ http://trac-hacks.org/wiki/XmlRpcPlugin
⁴ http://doc.norang.ca/org-mode.html
--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgp8ITS7zhZVp.pgp
Description: PGP signature


Re: [O] Repeated tasks repeats even if the time stamp is commented

2014-07-29 Thread Samuel Loury
Hi,
Bastien b...@gnu.org writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 Thank you for the answer, do you know where I should look at to start
 investigating to fix the issue?

 I think `org-add-planning-info' may be a good candidate, though I didn't
 look closely into it.

 Is anyone having a closer look at this?

 Otherwise I will, but at the end of august.
I don't think I will look at this soon. I added an entry in my todo.org
but I couldn't find any time to schedule it yet...

If I work on it, I'll let you know.

Best regards,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgp_0Jc029obO.pgp
Description: PGP signature


[O] [BUG] org-open-at-point does not work anymore in comment blocks

2014-07-18 Thread Samuel Loury
Hi,

On version baa2c5943a4afce71a6336cbd957139e840bd952.

Links are not followed anymore in comment blocks.

You may test it by launching (org-open-at-point) with the cursor into
the link in the following example.
--8---cut here---start-8---
* Test
#+BEGIN_COMMENT
[[http://orgmode.org/]]
#+END_COMMENT
--8---cut here---end---8---

It triggers a user error in lisp/org.el at line 10641 since there is no
computed context.

Indeed, org-element-context does not appear to do anything for this
case.

I have no time left to investigate further, but I think someone out
there could find this bit of information useful.
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpI8fhZZP0vd.pgp
Description: PGP signature


[O] Repeated tasks repeats even if the time stamp is commented

2014-07-18 Thread Samuel Loury
Hi,

In baa2c5943a4afce71a6336cbd957139e840bd952,

If the user toggles the TODO to DONE, the tasks repeats even though the
scheduled item is commented.
--8---cut here---start-8---
* TODO Test
#  SCHEDULED: 2014-07-18 Fri ++1d
--8---cut here---end---8---
My first though is that this behavior is unexpected, but I guess this
needs discussion.

I dug a bit and found two issues with this:
1. In org-add-planning-info, file lisp/org.el line 13446, the following
   code may be seen:
--8---cut here---start-8---
(if (and (not (looking-at org-outline-regexp))
 (looking-at (concat [^\r\n]*? org-keyword-time-regexp
 [^\r\n]*))
 (not (equal (match-string 1) org-clock-string)))
(narrow-to-region (match-beginning 0) (match-end 0))
  (insert-before-markers \n)
  (backward-char 1)
  (narrow-to-region (point) (point))
  (and org-adapt-indentation (org-indent-to-column col)))
--8---cut here---end---8---
  It assumes that (concat [^\r\n]*? org-keyword-time-regexp
  [^\r\n]*) is a suitable regexp for time entry. It then make the
  buffer look like
--8---cut here---start-8---
* DONE Test
  CLOSED: [2014-07-18 Fri 11:13] #  SCHEDULED: 2014-07-21 Mon ++1d
--8---cut here---end---8---
2. afterward, into the org-get-repeat function, in the same file, line
   13094, the code is
--8---cut here---start-8---
  (and (re-search-forward (if tagline
  (concat tagline \\s-* org-repeat-re)
org-repeat-re)
  (org-entry-end-position) t)
   (match-string-no-properties 1)
--8---cut here---end---8---
  This assumes also ignores a line starting with a #.

This case is a bit tricky to fix since if string matching org-repeat-re
is commented, then one has to search till the remaining of the entry to
find another one.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpP5svU8NmEf.pgp
Description: PGP signature


Re: [O] [BUG] org-open-at-point does not work anymore in comment blocks

2014-07-18 Thread Samuel Loury
Hi,
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 On version baa2c5943a4afce71a6336cbd957139e840bd952.

 Links are not followed anymore in comment blocks.

 You may test it by launching (org-open-at-point) with the cursor into
 the link in the following example.
 * Test #+BEGIN_COMMENT [[http://orgmode.org/]] #+END_COMMENT

 It triggers a user error in lisp/org.el at line 10641 since there is no
 computed context.

 If you want to ignore that part only during export, but still want to
 use keep it active in the buffer, I suggest to use a drawer, with an
 appropriate `org-export-with-drawers' value, e.g.,

   #+OPTIONS: d:(not IGNORE_ME)
   
   :IGNORE_ME:
   [[http://orgmode.org]]
   :END:

Thank you for the answer. It is exactly what I want to do.
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgp9WqibFBuIP.pgp
Description: PGP signature


Re: [O] Repeated tasks repeats even if the time stamp is commented

2014-07-18 Thread Samuel Loury
Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Samuel Loury konubi...@gmail.com writes:

 In baa2c5943a4afce71a6336cbd957139e840bd952,

 If the user toggles the TODO to DONE, the tasks repeats even though the
 scheduled item is commented.
 * TODO Test # SCHEDULED: 2014-07-18 Fri ++1d
 My first though is that this behavior is unexpected, but I guess this
 needs discussion.

 This is a long standing bug. It could be fixed if the part of Org
 handling planning lines used the parser.

Thank you for the answer, do you know where I should look at to start
investigating to fix the issue?

 I dug a bit and found two issues with this:
 1. In org-add-planning-info, file lisp/org.el line 13446, the following
code may be seen:
  (if (and (not (looking-at org-outline-regexp))
   (looking-at (concat [^\r\n]*? org-keyword-time-regexp
   [^\r\n]*))
   (not (equal (match-string 1) org-clock-string)))
  (narrow-to-region (match-beginning 0) (match-end 0))
(insert-before-markers \n)
(backward-char 1)
(narrow-to-region (point) (point))
(and org-adapt-indentation (org-indent-to-column col)))
   It assumes that (concat [^\r\n]*? org-keyword-time-regexp
   [^\r\n]*) is a suitable regexp for time entry. It then make the
   buffer look like
 * DONE Test
   CLOSED: [2014-07-18 Fri 11:13] #  SCHEDULED: 2014-07-21 Mon ++1d
 2. afterward, into the org-get-repeat function, in the same file, line
13094, the code is
   (and (re-search-forward (if tagline
(concat tagline \\s-* org-repeat-re)
  org-repeat-re)
(org-entry-end-position) t)
 (match-string-no-properties 1)
   This assumes also ignores a line starting with a #.

 This case is a bit tricky to fix since if string matching org-repeat-re
 is commented, then one has to search till the remaining of the entry to
 find another one.

 The search should use `org-element-context' in order to know if point is
 really at a timestamp.
I totally agree.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpbDIwd698sm.pgp
Description: PGP signature


[O] [PATCH] org-git-link.el: Add support for line in org-git-link

2014-07-11 Thread Samuel Loury
Hi,

I would like to submit a small enhancement of the org-git-link package
to add the storing and use of a line third argument.

Please find the patch attached to this mail. I hope you'll find it
useful.

Thanks for your attention.
From 7144b05b9d024222cb7e46a370ba3d974ae235af Mon Sep 17 00:00:00 2001
From: Konubinix konubi...@gmail.com
Date: Fri, 11 Jul 2014 09:10:02 +0200
Subject: [PATCH] org-git-link.el: Add support for line in org-git-ling

* org-git-link.el (org-git-open): Jump to the line if provided in the link.
(org-git-split-string): Parse a third element of the list and change the error
message accordingly.
(org-git-create-git-link): Accept the third optional line argument.
(org-git-store-link): call `org-git-create-git-link' with the current line
number.
---
 contrib/lisp/org-git-link.el | 27 +--
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/contrib/lisp/org-git-link.el b/contrib/lisp/org-git-link.el
index 7d95bbb..ad0ce71 100644
--- a/contrib/lisp/org-git-link.el
+++ b/contrib/lisp/org-git-link.el
@@ -98,10 +98,12 @@
   (let* ((strlist (org-git-split-string str))
  (filepath (first strlist))
  (commit (second strlist))
+ (line (third strlist))
  (dirlist (org-git-find-gitdir (file-truename filepath)))
  (gitdir (first dirlist))
  (relpath (second dirlist)))
-(org-git-open-file-internal gitdir (concat commit : relpath
+(org-git-open-file-internal gitdir (concat commit : relpath))
+(when line (goto-line (string-to-int line)
 

 ;; Utility functions (file names etc)
@@ -141,16 +143,19 @@
 ;; splitting the link string
 
 ;; Both link open functions are called with a string of
-;; consisting of two parts separated by a double colon (::).
+;; consisting of three parts separated by a double colon (::).
 (defun org-git-split-string (str)
-  Given a string of the form \str1::str2\, return a list of
-  two substrings \'(\str1\ \str2\). If the double colon is mising, take str2 to be the empty string.
+  Given a string of the form \str1::str2::str3\, return a list of
+  three substrings \'(\str1\ \str2\ \str3\). If there are less
+than two double colons, str2 and/or str3 may be set the empty string.
   (let ((strlist (split-string str ::)))
 (cond ((= 1 (length strlist))
-   (list (car strlist) ))
+   (list (car strlist)  ))
   ((= 2 (length strlist))
+   (append strlist (list )))
+  ((= 3 (length strlist))
strlist)
-  (t (error org-git-split-string: only one :: allowed: %s str)
+  (t (error org-git-split-string: only one or two :: allowed: %s str)
 
 ;; finding the file name part of a commit
 (defun org-git-link-filename (str)
@@ -168,22 +173,24 @@
   (concat branch @{ timestring }))
 
 
-(defun org-git-create-git-link (file)
+(defun org-git-create-git-link (file optional line)
   Create git link part to file at specific time
   (interactive FFile: )
   (let* ((gitdir (first (org-git-find-gitdir (file-truename file
  (branchname (org-git-get-current-branch gitdir))
  (timestring (format-time-string %Y-%m-%d (current-time
-(concat git: file :: (org-git-create-searchstring branchname timestring
+(concat git: file :: (org-git-create-searchstring branchname timestring)
+	(if line (format ::%s line) 
 
 (defun org-git-store-link ()
   Store git link to current file.
   (when (buffer-file-name)
-(let ((file (abbreviate-file-name (buffer-file-name
+(let ((file (abbreviate-file-name (buffer-file-name)))
+	  (line (line-number-at-pos)))
   (when (org-git-gitrepos-p file)
 	(org-store-link-props
 	 :type git
-	 :link (org-git-create-git-link file))
+	 :link (org-git-create-git-link file line))
 
 (add-hook 'org-store-link-functions 'org-git-store-link)
 
-- 
2.0.0.rc2

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpRw1PqBxmZs.pgp
Description: PGP signature


Re: [O] [ANN] Org-gamify

2014-07-09 Thread Samuel Loury
Hi,
Paul Sexton psexton...@gmail.com writes:

 I have written a plugin for org agenda, which allows gamification of
 task management. Define currencies, earn them by completing tasks, and
 spend them on rewards. Inspired by HabitRPG, Epic Win and similar
 systems.

 http://bitbucket.org/eeeickythump/org-gamify
It sounds fun.

I just read the description and something intrigues me: how do you
choose the CURRENCY_DELTAS for the tasks? I honestly don't think I would
be able to decide the price of each of my TODOs, at least without a
method.

Moreover, this property appears to be something we could derive from the
other properties like the EFFORT. We could say for instance that the
more the EFFORT is, the more the CURRENCY_DELTAS should be. Is that
possible to do with the library?

Anyway, thank you for sharing this library. I think it may help me keep
my agendas cleaner than they are now.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpCF8iCRm5_N.pgp
Description: PGP signature


Re: [O] Advice needed: Cant find a decent way to autosync my work TODO org file between laptop and work pc

2014-05-26 Thread Samuel Loury
Melleus mell...@openmailbox.org writes:

 Richard Lawrence richard.lawre...@berkeley.edu writes:

 Also, Unison (http://www.cis.upenn.edu/~bcpierce/unison/) promises to do
 two-way file sync between *nix and Windows.  I've never tried it; has
 anyone else?

 I can recommend rsync (you can get it from Cygwin for Windows) for such
 things. No fancy GUIs though. It just works.
I have not tried it yet, but
https://github.com/dooblem/bsync/blob/master/README.md could be of some
help. I guess it does like unison but using rsync.

Also, if you handle big files also, you may try git-annex
(http://git-annex.branchable.com/). I could be used to simply
synchronize files with git config annex.largefiles 'exclude=*' and
git annex sync.

--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpnQ7lfyjwxH.pgp
Description: PGP signature


Re: [O] Agenda view in Fortnight mode

2014-05-14 Thread Samuel Loury
Hi,
Esben Stien b...@esben-stien.name writes:

 Charles Millar mill...@verizon.net writes:

 (setq org-agenda-span 14)

 This specifies this week plus the next week, but is there any way to
 specify this week plus the next week plus the previous week?;)

Try this:

--8---cut here---start-8---
(setq org-agenda-span 14
  org-agenda-start-day -7d)
--8---cut here---end---8---
--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpH14gKeN4iZ.pgp
Description: PGP signature


Re: [O] Is OrgMode really GTD compliant?

2014-04-29 Thread Samuel Loury
Hi,
Alan Schmitt alan.schm...@polytechnique.org writes:

 On 2014-04-28 19:18, Rene jl...@yahoo.com writes:
 I have not defined an Energy property, but I recently played with date
 properties (and a user defined sorting function). If it's helpful to
 you, the code is there:
 https://github.com/brabalan/org-review/blob/master/org-review.el#L156
I looked at the code and I don't get what means the part of the code
getting the org-marker text property of a:
--8---cut here---start-8---
(get-text-property (point-min) 'org-marker a)
--8---cut here---end---8---
In this part, the point-min returns the point-min of the current buffer
(the agenda buffer in that case) while the function looks for the
property into a.

I tried launching this code into a custom agenda compare function and I
get the error:
--8---cut here---start-8---
Args out of range: 1197, 1197
--8---cut here---end---8---
This makes sense since the agenda appears to be narrowed at that time so
that (point-min) returns 1197 and the a string at this time is not 1197
characters long.

Replacing (point-min) by 0 appears to work (I assumed the 0th character
of the string has the wanted text property).

My first guess of an energy cmp function is:

--8---cut here---start-8---
(defun org-energy-compare (a b)
  (let* (
 (ma (or (get-text-property 0 'org-marker a)
 (get-text-property 0 'org-hd-marker a)))
 (mb (or (get-text-property 0 'org-marker b)
 (get-text-property 0 'org-hd-marker b)))
 (energy_a (org-entry-get ma Energy))
 (energy_b (org-entry-get mb Energy))
 )
(cond
 ((and
   (not energy_a)
   (not energy_b)
   )
  nil
  )
 ((and
   energy_a
   (not energy_b)
   )
  1
  )
 ((and
   (not energy_a)
   energy_b
   )
  -1
  )
 (( energy_a energy_b)
  1
  )
 (( energy_a energy_b)
  -1
  )
 (t
  nil
  )
 )
)
  )
--8---cut here---end---8---

Incidentally, I don't manage to have edebug triggered in a custom org
agenda cmp function. I load the function with C-u C-M-x. the message
Edebug: org-energy-compare appears as usual. When I launch the agenda
I can see the function has been called since the entries are correctly
sorted. But I was never given the input to debug it. Do you know why?

--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpGnBb1TO42j.pgp
Description: PGP signature


Re: [O] Is OrgMode really GTD compliant?

2014-04-29 Thread Samuel Loury
Alan Schmitt alan.schm...@polytechnique.org writes:

 On 2014-04-29 12:30, Samuel Loury konubi...@gmail.com writes:
 Alan Schmitt alan.schm...@polytechnique.org writes:
 On 2014-04-28 19:18, Rene jl...@yahoo.com writes:
 I have not defined an Energy property, but I recently played with date
 properties (and a user defined sorting function). If it's helpful to
 you, the code is there:
 https://github.com/brabalan/org-review/blob/master/org-review.el#L156
 I looked at the code and I don't get what means the part of the code
 getting the org-marker text property of a:
 (get-text-property (point-min) 'org-marker a)
 In this part, the point-min returns the point-min of the current buffer
 (the agenda buffer in that case) while the function looks for the
 property into a.

 I tried launching this code into a custom agenda compare function and I
 get the error:
 Args out of range: 1197, 1197
 This makes sense since the agenda appears to be narrowed at that time so
 that (point-min) returns 1197 and the a string at this time is not 1197
 characters long.

 Replacing (point-min) by 0 appears to work (I assumed the 0th character
 of the string has the wanted text property).

 I used to have `1' instead of `point-min', but I changed it following
 a suggestion from Bastien
 (http://thread.gmane.org/gmane.emacs.orgmode/85217/focus=85241).
Thanks for the link.

I am not a good lisp hacker, so I cannot be sure of this, but I suppose
Bastien did not notice the last argument 'a'. Indeed, the function is
defined as:

--8---cut here---start-8---
(get-text-property POSITION PROP optional OBJECT)
Return the value of POSITION's property PROP, in OBJECT.
OBJECT should be a buffer or a string; if omitted or nil, it defaults
to the current buffer.
If POSITION is at the end of OBJECT, the value is nil.
--8---cut here---end---8---

Then, the POSITION argument is the position in OBJECT to look for the
property. Therefore, the use of a function related to the current buffer
(like point-min) seems to strongly assume that OBJECT is the current
buffer (or nil).

In that case, OBJECT is not the current buffer but a string called
'a'. Thus, IIUC, it makes no sense to use OBJECT=a and
POSITION=(point-min).

--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpO58u27dsZj.pgp
Description: PGP signature


Re: [O] Org Bash Utils

2014-03-11 Thread Samuel Loury
Hi,
OSiUX xu...@osiux.com.ar writes:

 Try: org-clock | org-timeline

 https://github.com/osiris/org-bash-utils
Awesome :-)!

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Dynsite: easier configuration of projects, with config.or instead of emacs lisp and dynamic relative paths

2013-12-03 Thread Samuel Loury
Hi,
Iannis Zannos zan...@gmail.com writes:

 I'd like to present my project Dynsite for orgmode here
I just tested it. It is really cool.

Thanks!

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Drag images from Firefox to org-mode

2013-10-17 Thread Samuel Loury

Marcin Borkowski mb...@wmi.amu.edu.pl writes:

 Dnia 2013-10-16, o godz. 17:52:51
 Oleh ohwoeo...@gmail.com napisał(a):

 The address and date are auto-added as a comment now.
 The updated source can be found at
 https://github.com/abo-abo/org-download
 
 Images can be stored in a custom dir with:
 
 (setq org-download-image-dir ~/Pictures/org)
 
 I still want to add some rescaling option via ImageMagick and
 an option for local files.
 Other suggestions can be raised as issues on github, so it's
 easier to keep track of them.

 It's not something I need (at least not often), but I wanted to say
 that this is really, really cool.  Thank you, sir.
Same here.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Time remaining report, anyone done it?

2013-10-08 Thread Samuel Loury
Hi,
Myles English mylesengl...@gmail.com writes:

 Before I get too stuck in I thought I would ask: Has anyone already done
 this or thought about a good way to do it (I really hope so)?
I did not but I am hoping you will manage to do it. I have already taken
a quick look into org code to understand how to do it without
success.

For what I can understand by tracing the CLOCKSUM property usage (grep
'CLOCKSUM' being a starting point), it seems to be doable by modifying
the org-columns and org-agenda-colview-compute defuns to set a text
property like org-clock-sum does with :org-clock-minutes. Then, the
defun org-dblock-write:clocktable should be edited to use that property.

Hope that helps.
--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Collaborating with TODO lists and clocks.

2013-09-05 Thread Samuel Loury
Hi,
Richard Lawrence richard.lawre...@berkeley.edu writes:

 Hi Gareth,

 Gareth Smith g...@doc.ic.ac.uk writes:

 I hadn't thought of using :tags on a clock table. I still worry if we'll
 find ourselves in a situation where more than one of us has clocked in
 some time on the same task.

 Yes, I agree this might not be optimal, for that case in particular.
 One nice thing about this use of tags is that you have a representation
 of when more than one person is working on a task, but that makes the
 clock less useful, as it can no longer represent an individual's working
 time without some effort to separate the clocks of the different owners.
I recently encountered the issues of having to collaborate with other
persons on the same task (all of us would need at some point to clock
into this task).

I thought that changing the value of the variable org-clock-string could
help, but I have not tried it yet. Let me explain why it could help:

It is for the time being set to CLOCK:, but imagine that the user A
set it to CLOCK-A: and the user B set it to CLOCK-B: (in their
respective .emacs files), then after some time a clocked task would then
look like:

--8---cut here---start-8---
* Do something
  CLOCK-A: [2013-09-05 Thu 07:55]--[2013-09-05 Thu 08:46] =  0:51
  CLOCK-A: [2013-09-04 Wed 09:05]--[2013-09-04 Wed 09:41] =  0:36
  CLOCK-B: [2013-09-04 Wed 08:00]--[2013-09-04 Wed 09:03] =  1:03
--8---cut here---end---8---

Then the agenda for each user would report only the time spent by
himself.

The time spent by each participant is clearly separated.

There are some problems with doing so:
- I don't know yet how to configure a report showing the time spent by
every body,
- I am not sure the clock time sum would work.
- grepping for CLOCK: on org sources shows:
  --8---cut here---start-8---
  ./lisp/org-clock.el:782:  (while (re-search-forward CLOCK: 
\\(\\[.*?\\]\\)$ nil t)
  ./lisp/org.el:851: (defcustom org-clock-string CLOCK:
  ./lisp/org.el:8501: (while (re-search-forward ^[ \t]*CLOCK:.*$ nil 
t)
  ./lisp/org.el:15007: (defconst org-clock-drawer-start-re ^[ \t]*:CLOCK:[ 
\t]*$
  ./lisp/org.el:15578: (while (looking-at ^[ 
\t]*\\(:CLOCK:\\|:LOGBOOK:\\|CLOCK:\\|:END:\\))
  ./lisp/org.el:15579:   (if (member (match-string 1) '(CLOCK: :END:))
  ./lisp/org.el:17278: (looking-at ^[ \t]*CLOCK:)))
  --8---cut here---end---8---
  Those look like hard coded CLOCK: instead of using
  org-clock-string. They would need to be fixed.

What do you think of this solution? Has anyone already use a solution
like this?

Best,

PS: I have tried changing the org-clock-into-drawer variable to be
CLOCK-A and CLOCK-B so that the task would then look like 
--8---cut here---start-8---
* Do something
  :CLOCK-A:
  CLOCK: [2013-09-05 Thu 07:55]--[2013-09-05 Thu 08:46] =  0:51
  CLOCK: [2013-09-04 Wed 09:05]--[2013-09-04 Wed 09:41] =  0:36
  :END:
  :CLOCK-B:
  CLOCK: [2013-09-04 Wed 08:00]--[2013-09-04 Wed 09:03] =  1:03
  :END:
--8---cut here---end---8---
But it needs org-drawers to contain the values for each collaborators
for it to work (and then should be maintained) and the folding mechanism
did not seem to work for those special drawers.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Collaborating with TODO lists and clocks.

2013-09-05 Thread Samuel Loury
Sebastien Vauban sva-n...@mygooglest.com writes:

 Having thought about that in the past, I had thought of adding tags after
 clock lines, such as:

 --8---cut here---start-8---
 CLOCK: [2013-09-05 Thu 07:55]--[2013-09-05 Thu 08:46] =  0:51  :userA:
 CLOCK: [2013-09-04 Wed 09:05]--[2013-09-04 Wed 09:41] =  0:36  :devB:
 --8---cut here---end---8---
That sounds good also.

 Though, having separate CLOCK drawers would even be better for Git merges,
 such as (keeping the idea of pseudo-tags):

 --8---cut here---start-8---
 :CLOCK:userA:
 CLOCK: [2013-09-05 Thu 07:55]--[2013-09-05 Thu 08:46] =  0:51
 CLOCK: [2013-09-04 Wed 09:05]--[2013-09-04 Wed 09:41] =  0:36
 :END:
 :CLOCK:devB:
 CLOCK: [2013-09-04 Wed 08:00]--[2013-09-04 Wed 09:03] =  1:03
 :END:
 --8---cut here---end---8---
I really like this solution.

 But, of course, a lot of development is required to make this become usable:

 - clocking reports (`R') must be updated with the knowledge of the current
   user

 - clock checking functions (`v c') must be enhanced to ignore clocks from
   other users

 - etc.
That is my point with the solution by customization of
org-clock-string. It appears to need only a few corrections of the hard
coded CLOCK: string (that would be required anyway) and it looks like
it would work out of the box without further development. Wouldn't it?

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Collaborating with TODO lists and clocks.

2013-09-05 Thread Samuel Loury
Sebastien Vauban sva-n...@mygooglest.com writes:

 Samuel Loury wrote:
 Sebastien Vauban sva-n...@mygooglest.com writes:
 For example, IIUC, different users will share one file with tasks, where they
 will clock in/out. Then, what about the SCHEDULED and DEADLINE properties?
 Will the tasks be in all the user agendas? Not acceptable. Then, we need first
 to add an ASSIGNEE property, and ignore tasks which wouldn't be assigned to
 me [2]?
You are totally right. I guess the ASSIGNEE property would be a really
good implementation.

We should also create a variable org-collaborative-whoami to know what
tasks to filter.

--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Collaborating with TODO lists and clocks.

2013-09-05 Thread Samuel Loury
Thorsten Jolitz tjol...@gmail.com writes:

 A kind of team agende would indeed be useful, accessible form Org-mode
 _and_ other calendar/planning tools (I can't imagine a pure
 Emacs/Org-mode team).
Why not?

 I remember an attempt to make Org-mode a collaborative software (ColOrg
 or so) - whats the state of it? I would guess this is very difficult
 stuff. 
IIRC, the ColOrg project was more about allowing people to edit the same
org buffer simultaneously while the purpose of this thread of for org
documents to contain traces from separate people. In my use case for
instance, we would synchronize via git and would merge the task file.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] [SYNC] How do you sync your org-mode files between n devices (n 2)

2013-09-04 Thread Samuel Loury
Hi,

nore...@maillard.im writes:

 How do you sync your files easily and share them between 3, 4 or even
 more places ?
You might find the answer to that question in a previous thread:

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg73502.html

Hope that helps.
Best,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] Bug report: Heading in example considered as true heading

2013-08-06 Thread Samuel Loury
Hi,

I realized recently the following behavior, running on org version 8.0.3
got from commit d7e884d86c8560477ca1e69fb8423db6770981ac (git sha).

Use the following org sample:

---Beginning
* test1
#+BEGIN_EXAMPLE
* stuff
#+END_EXAMPLE
* test2
---End

Then in test, do M-down to get test1 down.

Even though the example is badly indented, it is part of the test1 heading.

The buffer I expect after the command is:
---Beginning
* test2
* test1
#+BEGIN_EXAMPLE
* stuff
#+END_EXAMPLE
---End

What I got is
---Beginning
* stuff
#+BEGIN_EXAMPLE
* test1
#+END_EXAMPLE
* test2
---End

My 2 cents.
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Bug report: Heading in example considered as true heading

2013-08-06 Thread Samuel Loury
Hi,
Nicolas Goaziou n.goaz...@gmail.com writes:

 Samuel Loury konubi...@gmail.com writes:

 Use the following org sample:

 ---Beginning
 * test1
 #+BEGIN_EXAMPLE
 * stuff
 #+END_EXAMPLE
 * test2
 ---End

 Headlines have precedence over blocks. Therefore * stuff is really
 a headline in your example.

 If you want to start a line with a star within an example block, escape
 it with a comma. See section 11.3 in manual for more information.
Thanks for the answer.

Next time I fill a bug report, I will look closer to the manual :-).
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] bug#14910: bug#14910: org-mode `org-open-at-point' doesn't follow id links

2013-07-23 Thread Samuel Loury
Hi,
Oleh Krehel o.kre...@tue.nl writes:

 As for requiring org-id for `org-open-at-point', I'm not sure this
 is the right thing to do since it will require it for all users, even
 those who don't use org-id at all.

 The issue is that the current solution isn't portable.[...]
 In my opinion it would be best to require 'org-id implicitly so that
 the links work the same for all users.

We could have a lazy loading of the file in case the id: string is
encountered. Actually, we could have a lazy loading of a default package
for each supported link. That would avoid the pain of loading the
package when users don't use it and still make those links work.

IIRC, the difficulty of that solution is that each package implementing
a link (like org-id) explicitly registers to indicate it can handle some
link while my solution assumes that there is some knowledge of which
package handle what link before loading it. For that reason, it is not
so easy to implement. I guess though that the behavior is more close to
what we should want to have.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Simplifying the weekly agenda a tiny bit, howto?

2013-07-20 Thread Samuel Loury
Hi,
François Pinard pin...@iro.umontreal.ca writes:

 There are a pile of commands for shifting
 timestamps/scheduled/deadline

 Which I often use.  The annoyance of doing explicit shifting is that I
 have to look at the repeater to decide the shifting amount.  I much
 prefer if it could be automatic, not requiring human scrutiny each time.

What about providing a new command to shift the timestamp with the step
being the shifting amount? The command could do exactly the same thing
as what is done when you close the repeated TODO task, except for the
TODO - DONE - TODO transition.

Would that command fulfil your need?

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpsVpY9a9Wwn.pgp
Description: PGP signature


Re: [O] scrum with emacs org-mode

2013-07-03 Thread Samuel Loury
Hi,
thk...@koch.ro writes:

 has anybody some success stories to share how to use org-mode in scrum 
 projects?
Unfortunately, I won't be able to help with that. I am quite interested
by ideas as well.

 If you have some free software tools besides org-mode please tell us for 
 comparison!
I use Trac¹. It seems extensible enough to fit with most of the scrum
methodology. At least most of the scrum methodology I know
about. Besides, I use the EstimationToolsPlugin² to display burndown
charts.

Hope that helps.

¹ http://trac.edgewall.org/
² http://trac-hacks.org/wiki/EstimationToolsPlugin#BurndownChart

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] advice needed: how do you guys sync org files between devices?

2013-07-03 Thread Samuel Loury
Hi,
Xebar Saram zelt...@gmail.com writes:

 I was wondering what you guys do for syncing org files between PC's, Os's,
 devices (android etc)..

There have been lot's of awesome solutions provided in this thread. Mine
is quite similar but I think it is worth describing it anyway.

I use git (a hand made script¹) to synchronize my personal files (not
only the org files) with a usb key. In fact, into the key, there is only
a encrypted version (via encfs) of a git bare repository. The data are
encrypted in case someone get access to my key.

I am now used to launch the script first thing in the morning, just
after plugging the key, and just before I unplug it.

The script has been in use for 2 years now and works quite well.

The problem with synchronizing with git is that the history might grow
out of control after some time. My workaround for the time being (it is
still being thought about) is to cut the repository. The idea is that
I only need most recent history, not the full one. My current
implementation² uses git clone --depth and results in a shallow
repository.  This implementation really sucks because shallow
repositories are really limited. Any better idea would be welcome.

To get access to my org files from android, I tested two years ago
mobile org without success. Recently, I exported my errand tasks³ as a
ics file that I looked via a home made python script (thanks to sl4a⁴)
with a webview⁵ graphical interface. Nonetheless, I lost the python
script (CyanogenMod paaaa) and I am too lazy to rewrite it. Then I
guess I will give mobile org another chance.

Best

¹ https://github.com/Konubinix/Devel/blob/master/bin/konix_perso-sync.sh
² https://github.com/Konubinix/Devel/blob/master/bin/konix_perso-shorten.sh
³ 
https://github.com/Konubinix/Devel/blob/master/config/elfiles/config/after-loads/KONIX_AL-org.el#L1909
⁴ http://code.google.com/p/android-scripting/
⁵ http://code.google.com/p/android-scripting/wiki/ApiReference#webViewShow

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] Org-mode as a replacement for Google Reader

2013-03-27 Thread Samuel Loury
Karl Voit devn...@karl-voit.at writes:

 OK, so as I assumed, there is no method out there to read RSS feeds
 with Emacs and sync to mobile Android devices (content and
 read/unread information).

Let me propose another way to fulfill the same need:

To my mind, there is not much difference between fetching unread rss and
fetching unread mails. Then why bother trying to duplicate the effort in
mail readers and rss readers?

I use feed2imap for 2 years now and it works really well. It is a ruby
script that sync your rss (atom) feeds and put new resources on an imap
server with a specified label. Nonetheless, AFAIK, It does not provide a
way to get to the full content of the resources like Full Text RSS does.

If you put a dedicated (let's say RSS) label to all the rss and with a
little bit of configuration, You are able to read unread mails and
unread rss independently.

It fulfills the needs (read rss within emacs and android with a 2 ways
sync) indirectly for me because I read my mails in emacs and I have a
mail reader in android (K9Mail).

There are also alternatives using smtp protocol to send the items as
mail.

 Well, in this case I have to switch to another cloud based services
 which hopefully does not quit soon.

My proposal relies on a server constantly connected to the Internet and
updating some imap account with the rss items. I guess you may want a
more decentralized solution with a sync between android and emacs.

If it is the case and you find a solution providing that, I would love
to read it in that mailing list.

Greetings,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgprkIgy0FoXv.pgp
Description: PGP signature


Re: [O] Timestamp practices?

2013-03-21 Thread Samuel Loury
Thorsten Jolitz tjol...@gmail.com writes:

 Lawrence Bottorff galaxybeinglam...@gmail.com writes:

 I'm trying to give each header entry a timestamp.

 This is from Bernt Hansen and automagically inserts a timestamp each
 time you insert a new header - if you want so. 
 If not, you can toggle the behaviour. Nice.

 ,
 | (defvar bh/insert-inactive-timestamp t)
 | 
 | (defun bh/toggle-insert-inactive-timestamp ()
 |   (interactive)
 |   (setq bh/insert-inactive-timestamp (not bh/insert-inactive-timestamp))
 |   (message Heading timestamps are %s
 |(if bh/insert-inactive-timestamp ON OFF)))
 | 
 | (defun bh/insert-inactive-timestamp ()
 |   (interactive)
 |   (org-insert-time-stamp nil t t nil nil nil))
 | 
 | (defun bh/insert-heading-inactive-timestamp ()
 |   (save-excursion
 | (when bh/insert-inactive-timestamp
 |   (org-return)
 |   (org-cycle)
 |   (bh/insert-inactive-timestamp
 | 
 | (add-hook 'org-insert-heading-hook
 | 'bh/insert-heading-inactive-timestamp 'append)
 `-

 ,-
 | (global-set-key (kbd f9 T) 'bh/toggle-insert-inactive-timestamp)
 | (global-set-key (kbd f9 t) 'bh/insert-inactive-timestamp)
 `-

 -- 
 cheers,
 Thorsten



Moreover, if you also use org-capture. You may precise a timestamp to be
put in the captured template. IIRC, This is also inspired from Bernt's
configuration.

╭
│ (add-to-list 'org-capture-templates
│ '(t Todo Item entry (file+headline 
(expand-file-name todo.org org-directory) Refile) * TODO %?
│   :LOGBOOK:
│   - Captured   %U
│   :END:
│ 
│:kill-buffer
│)
│   )
╰
The useful part here is the %U. (see info:org#Template expansion).

This is of course to adjust according to your needs.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgp5Yimd_s0P1.pgp
Description: PGP signature


Re: [O] [PATCH] Fix uncaught error when trying to open a link at point

2013-03-16 Thread Samuel Loury
Hi,

Bastien b...@altern.org writes:

 No problem at all.  I decided to go and accept patches from people
 that did not confirm they got the FSF papers because merging 8.0
 into Emacs trunk is not likely to happen to soon... So.

Good news, I got the confirmation that my assignment/disclaimer process
with the FSF is currently complete. I do not know however if I have to
do something to prove that in order to submit patches to this mailing
list.

I then propose in attachment a set of four tests testing the problem
mentioned in this thread: the behavior of org-open-at-point in front of
bracket links and plain links.

From 5bd8eb52cb047b5290300fe850fca894babf05ff Mon Sep 17 00:00:00 2001
From: Samuel Loury konubinix...@gmail.com
Date: Sat, 16 Mar 2013 20:12:42 +0100
Subject: [PATCH] Test the org-open-at-point function.

* testing/examples/open-at-point.org: new file.
* testing/lisp/test-org-open-at-point.el: new file.

This tests only the function when inside or before bracket links
and plain links.
---
 testing/examples/open-at-point.org |8 +
 testing/lisp/test-org-open-at-point.el |   61 
 2 files changed, 69 insertions(+)
 create mode 100644 testing/examples/open-at-point.org
 create mode 100644 testing/lisp/test-org-open-at-point.el

diff --git a/testing/examples/open-at-point.org b/testing/examples/open-at-point.org
new file mode 100644
index 000..b3bb92d
--- /dev/null
+++ b/testing/examples/open-at-point.org
@@ -0,0 +1,8 @@
+
+* Header 1
+  :PROPERTIES:
+  :ID:   header1_with_great_id
+  :END:
+* Header 2
+  [[id:header1_with_great_id][Header 1]]
+  id:header1_with_great_id
diff --git a/testing/lisp/test-org-open-at-point.el b/testing/lisp/test-org-open-at-point.el
new file mode 100644
index 000..78724c8
--- /dev/null
+++ b/testing/lisp/test-org-open-at-point.el
@@ -0,0 +1,61 @@
+;;; test-org-open-at-point.el
+
+;; Copyright (c) Samuel Loury
+;; Authors: Samuel Loury
+
+;; Released under the GNU General Public License version 3
+;; see: http://www.gnu.org/licenses/gpl-3.0.html
+
+ Comments:
+
+;; Test for the org-open-at-point function
+
+;;; Code:
+
+(save-excursion
+  (set-buffer (get-buffer-create test-org-open-at-point.el))
+  (setq ly-here
+(file-name-directory
+ (or load-file-name (buffer-file-name)
+
+(defun test-org-open-at-point/goto-fixture ()
+  (find-file-other-window
+   (concat ly-here ../examples/open-at-point.org))
+  (set-buffer open-at-point.org))
+
+(ert-deftest test-org-open-at-point/bracket-link-inside ()
+  Test `org-open-at-point' from inside a bracket link.
+  (test-org-open-at-point/goto-fixture)
+  ;; go inside the bracket link
+  (goto-char 113)
+  (org-open-at-point)
+  ;; should now be in front of the header
+  (should (equal (point) 2)))
+
+(ert-deftest test-org-open-at-point/plain-link-inside ()
+  Test `org-open-at-point' from inside a plain link.
+  (test-org-open-at-point/goto-fixture)
+  ;; go inside the plain link
+  (goto-char 126)
+  (org-open-at-point)
+  ;; should now be in front of the header
+  (should (equal (point) 2)))
+
+(ert-deftest test-org-open-at-point/bracket-link-before ()
+  Test `org-open-at-point' from before a bracket link but in the same line.
+  (test-org-open-at-point/goto-fixture)
+  ;; go before the bracket link
+  (goto-char 83)
+  (message point %s (point))
+  (org-open-at-point)
+  ;; should now be in front of the header
+  (should (equal (point) 2)))
+
+(ert-deftest test-org-open-at-point/plain-link-before ()
+  Test `org-open-at-point' from before a plain link but in the same line.
+  (test-org-open-at-point/goto-fixture)
+  ;; go before the plain link
+  (goto-char 124)
+  (org-open-at-point)
+  ;; should now be in front of the header
+  (should (equal (point) 2)))
-- 
1.7.10.4


--
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpJOvuA5BCP_.pgp
Description: PGP signature


Re: [O] need: custom agenda for last 7 days

2013-02-21 Thread Samuel Loury
Subhan Tindall subhan.tind...@rentrakmail.com writes:

 I have a question regarding a custom agenda report.  I've found the
 variable org-agenda-span to set the number of days shown.  But, I
 can't seem to some up with a way to make it start in the past.
 IE I want to see all agenda items for today and the previous 6 days.
 Also, can someone point me at a good tutorial for customized agendas
 including all option variables  what they do? I can't seem to put my
 fingers on one.
 Thanks!
 Subhan
 '(org-agenda-custom-commands (quote ((w Weekly Logs agenda 
 ((org-agenda-span 8))


 -- 
 Subhan Michael Tindall | Software Developer
 | s...@rentrakmail.com
 RENTRAK | www.rentrak.com | NASDAQ: RENT


Hi, this is what I have

╭
│ (defun my/org-last-week ()
│   (- (org-today) 7)
│   )
│ 
│ 
│ (add-to-list 'org-agenda-custom-commands
│'(w Weekly Logs
│  (
│   (agenda nil
│   (
│(org-agenda-overriding-header
│ Review for last week)
│(org-agenda-span 8)
│)
│   )
│   )
│  (
│   (org-agenda-start-day 'my/org-last-week)
│   (org-agenda-start-with-clockreport-mode t)
│   (org-agenda-start-with-log-mode t)
│   (org-agenda-archives-mode t)
│   (org-agenda-show-log 'clockcheck)
│   )
│  )
│)
╰
Hope it helps.
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgpHsftn3PDMi.pgp
Description: PGP signature


Re: [O] need: custom agenda for last 7 days

2013-02-21 Thread Samuel Loury
Nick Dokos nicholas.do...@hp.com writes:

 Samuel Loury konubi...@gmail.com wrote:

 ╭
 │ (defun my/org-last-week ()
 │   (- (org-today) 7)
 │   )
 │ 
 │ 
 │ (add-to-list 'org-agenda-custom-commands
 │ '(w Weekly Logs
 │   (
 │(agenda nil
 │(
 │ (org-agenda-overriding-header
 │  Review for last week)
 │ (org-agenda-span 8)
 │ )
 │)
 │)
 │   (
 │(org-agenda-start-day 'my/org-last-week)

 I think that's wrong: there is no support afaik for this variable to have
 a function value.

Hum. You're right. I forgot I also patched the org-agenda.el code for
this to work.

 Should that  be

   (org-agenda-start-day (my/org-last-week))

That works well indeed. And does not need any patch.
Thanks for the correction.

-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


pgp4HQ_kj8AOG.pgp
Description: PGP signature


  1   2   >