Re: time-warping - retroactively marking DONE?

2023-06-25 Thread Adam Spiers
On Sun, 25 Jun 2023 at 17:03, Adam Spiers  wrote:
> Three years later, I finally tried this:

Apologies for the noise; apparently three years is enough time for me
to completely forget that I'd already found a better solution to this:

https://list.orgmode.org/caokdye-dwkh4_kw1q5bzhaig1-eyxnjnt4nw_dhhyhui12u...@mail.gmail.com/T/#me7c7a5f2d750217c47ec27c1a4ed712a62991a9d



Re: time-warping - retroactively marking DONE?

2023-06-25 Thread Adam Spiers
Three years later, I finally tried this:

On Wed, 8 Jul 2020 at 05:53, Kyle Meyer  wrote:
> Adam Spiers writes:
> > I'm looking for a way to retroactively mark a task as having been done
> > at a previous time/date.  I know that I can just change the keyword to
> > DONE and then edit the timestamp, but this is tedious when it's a
> > repeating event, e.g.:
> [...]
>
> I'm not aware of any built-in support for this.
>
> > If this is not currently possible, would it make sense to write a
> > wrapper around `org-todo', e.g. `org-todo-timewarp' or
> > `org-retroactive-todo', which interactively prompts for a timestamp
> > before invoking `org-todo'?
>
> I think this is the easiest approach, though I'm not sure such a wrapper
> needs to live in Org proper.  Here's a snippet from a recent thread [*]
> that should get you most of the way there:
>
> (defun my-org-todo-time-machine ()
>   (interactive)
>   (cl-letf (((symbol-function 'current-time)
>  (lambda ()
>(apply #'encode-time (org-parse-time-string
>  "2019-11-27 Mi 16:44")
> (call-interactively #'org-todo)))
>
>
> [*] 
> https://orgmode.org/list/875zj42rpx@passepartout.tim-landscheidt.de/T/#u

I made it read a time interactively:

(defun as-org-todo-time-machine (arg)
  (interactive "P")
  (let ((fake-time
 (apply #'encode-time (org-parse-time-string
   (org-read-date)
   
(cl-letf (((symbol-function 'current-time)
   (lambda () fake-time)))
  (call-interactively #'org-todo

It almost works perfectly, although monkey-patching current-time doesn't affect
the code in org-auto-repeat-maybe which sets LAST_REPEAT, since that uses
the built-in format-time-string:

(org-entry-put nil "LAST_REPEAT" (format-time-string
  (org-time-stamp-format t t

I found that adding (current-time) as the optional time parameter fixed it:

(org-entry-put nil "LAST_REPEAT" (format-time-string
  (org-time-stamp-format t t)
  (current-time

since that allows the monkey-patching to apply there too.  Is it worth
submitting
a patch for this?



Re: [PATCH] org-agenda.el: Add a M-, binding for org-priority-show

2021-05-01 Thread Adam Spiers
On Sat, 1 May 2021 at 11:45, Bastien  wrote:
> Kyle Meyer  writes:
> > With a C-u, org-agenda-priority calls org-priority-show.  So perhaps
> > instead of adding a new binding, the documentation should be improved.
>
> I pushed a small enhancement for org-agenda-priority's docstring
> with commit e080eb759.
>
> I am reluctant adding another keybinding to the agenda especially
> since there is no keybinding for `org-priority-show'.

Thanks, that sounds like a better approach.



Re: overloading of internal priority calculations in agenda

2021-03-09 Thread Adam Spiers
Thanks Jack for the helpful response and support of my assessment.

I do intend to fix this as part of my ongoing (but currently delayed)
work on improving agenda sorting and adding an option to manually sort.

On Tue, 9 Mar 2021 at 07:07, Jack Kamm  wrote:
>
> Hi Adam,
>
> > I further noticed that this overloading of the internal priority by
> > including timestamp and habit data causes disruption to the behaviour
> > I imagine most users would expect from `org-agenda-sorting-strategy'.
> > For example, if you have `priority-down' as the first entry in the
> > `agenda' section and `category-keep' as the second, then differences
> > in the SCHEDULED timestamp are included in the priority calculation
> > and can therefore prevent sorting of two adjacent [#B] items by
> > category.  This seems like a bug to me, or at least breaks the
> > Principle of Least Surprise.
>
> I just ran into this issue you highlight here.
>
> In particular, I was trying to set the org-agenda-sorting-strategy to
>
> (priority-down scheduled-down)
>
> i.e., sorting by priority (highest first), and then within priority,
> sorting by scheduled (most recent first).
>
> However, the fact that the priority includes the scheduled timestamp
> makes this sorting strategy impossible.
>
> I agree this seems like a bug, in that it contradicts the written
> documentation as far as I can tell (for example, the *Help* for
> org-agenda-sorting-strategy mentions nothing of the fact that the
> priority includes the scheduled timestamp, and I don't see anything
> about it in the *Info* either).
>
> I imagine that many have gotten used to the default behavior of sort by
> highest priority, then by earliest scheduled timestamp, but we could
> keep this default behavior by adding "scheduled-up" after
> "priority-down" in org-agenda-sorting-strategy, as you allude.
>
> Jack



Re: overloading of internal priority calculations in agenda

2020-12-22 Thread Adam Spiers
Thanks a lot - appreciate the feedback!

On Tue, 22 Dec 2020 at 23:38, Samuel Wales  wrote:

> if my opinion is worth anything [perhaps not much here :]], i like
> your proposals and the idea of being able to re-sort an existing
> agenda assuming that is your goal.
>
> i don't use any priority sorting except in user-customizable but it
> makes sense to decouple them for those who do.  and i frequently want
> to differently sort an existing agenda view.
>
>
> On 12/22/20, Adam Spiers  wrote:
> > Hi again,
> >
> > On Wed, Dec 02, 2020 at 02:20:53PM +, Adam Spiers wrote:
> >>Hi all,
> >>
> >>I'm currently working on adding a feature to org-agenda which allows
> >>manual ordering of entries in combination with the existing automatic
> >>ordering (as dictated by `org-agenda-sorting-strategy').
> >>
> >>During my investigations I noticed that while `org-get-priority' converts
> >>[#B] style cookies into a numeric priority which is a multiple of
> >>1000, further adjustments are made in functions like
> >>`org-agenda-get-scheduled' before adding this numeric priority as a
> >>text property on the entry:
> >>
> >>'priority (if habitp (org-habit-get-priority habitp)
> >>(+ 99 diff (org-get-priority item)))
> >>
> >>In this case `diff' refers to the number of days between now and when
> >>the item was scheduled.  A slightly different calculation is made in
> >>`org-agenda-get-timestamps':
> >>
> >>(org-add-props item props
> >>  'priority (if habit?
> >>(org-habit-get-priority (org-habit-parse-todo))
> >>  (org-get-priority item))
> >>
> >>I further noticed that this overloading of the internal priority by
> >>including timestamp and habit data causes disruption to the behaviour
> >>I imagine most users would expect from `org-agenda-sorting-strategy'.
> >>For example, if you have `priority-down' as the first entry in the
> >>`agenda' section and `category-keep' as the second, then differences
> >>in the SCHEDULED timestamp are included in the priority calculation
> >>and can therefore prevent sorting of two adjacent [#B] items by
> >>category.  This seems like a bug to me, or at least breaks the
> >>Principle of Least Surprise.
> >
> > [snipped]
> >
> >>Given that `org-agenda-sorting-strategy' now supports all manner of
> >>sorting criteria, many of which are time-sensitive, I would like to
> >>know if there is any reason not to remove this overloading of the
> >>priority calculation, i.e. decoupling it to depend purely on the
> >>result of `org-get-priority' and `org-habit-get-priority'?
> >>
> >>If fact, perhaps we could go one step further and add support for new
> >>habit-priority-{up,down} sorters to `org-agenda-sorting-strategy', so
> >>that the priority-{up,down} sorters sort purely by the priority cookie
> >>and nothing else?
> >
> > Gently bumping this as I didn't get any replies yet.  I would like to
> > continue working on a solution, but obviously don't want to waste time
> > on something which would be rejected.
> >
> > If it is considered important to preserve the exact behaviour
> > currently offered by `org-agenda-sorting-strategy' then I would
> > propose the following:
> >
> > - Keep the existing priority-{up,down} which combine priority cookies
> >with timestamp data and the result from `org-habit-get-priority',
> >but probably also deprecate it and remove it from the default value.
> >
> > - Introduce new priority-cookie-{up,down} sorters which operate purely
> >on [#A] and [#1] style priority cookies and nothing else.
> >
> > This would facilitate decoupling of the sortable criteria whilst
> > remaining backwards compatible.
> >
> > Does this sound reasonable?  I am keen to proceed very soon (ideally
> > over the Xmas break).  I have already written some new ert tests for
> > `org-agenda-sorting-strategy' which would be included in any submitted
> > patches.
> >
> > Thanks!
> > Adam
> >
> >
>
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
>
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
>


Re: overloading of internal priority calculations in agenda

2020-12-22 Thread Adam Spiers

Hi again,

On Wed, Dec 02, 2020 at 02:20:53PM +, Adam Spiers wrote: 

Hi all,

I'm currently working on adding a feature to org-agenda which allows 
manual ordering of entries in combination with the existing automatic 
ordering (as dictated by `org-agenda-sorting-strategy'). 

During my investigations I noticed that while `org-get-priority' converts 
[#B] style cookies into a numeric priority which is a multiple of 
1000, further adjustments are made in functions like 
`org-agenda-get-scheduled' before adding this numeric priority as a 
text property on the entry: 


   'priority (if habitp (org-habit-get-priority habitp)
   (+ 99 diff (org-get-priority item)))

In this case `diff' refers to the number of days between now and when 
the item was scheduled.  A slightly different calculation is made in 
`org-agenda-get-timestamps': 


   (org-add-props item props
 'priority (if habit?
   (org-habit-get-priority (org-habit-parse-todo))
 (org-get-priority item))

I further noticed that this overloading of the internal priority by 
including timestamp and habit data causes disruption to the behaviour 
I imagine most users would expect from `org-agenda-sorting-strategy'. 
For example, if you have `priority-down' as the first entry in the 
`agenda' section and `category-keep' as the second, then differences 
in the SCHEDULED timestamp are included in the priority calculation 
and can therefore prevent sorting of two adjacent [#B] items by 
category.  This seems like a bug to me, or at least breaks the 
Principle of Least Surprise. 


[snipped]

Given that `org-agenda-sorting-strategy' now supports all manner of 
sorting criteria, many of which are time-sensitive, I would like to 
know if there is any reason not to remove this overloading of the 
priority calculation, i.e. decoupling it to depend purely on the 
result of `org-get-priority' and `org-habit-get-priority'? 

If fact, perhaps we could go one step further and add support for new 
habit-priority-{up,down} sorters to `org-agenda-sorting-strategy', so 
that the priority-{up,down} sorters sort purely by the priority cookie 
and nothing else? 


Gently bumping this as I didn't get any replies yet.  I would like to 
continue working on a solution, but obviously don't want to waste time 
on something which would be rejected. 

If it is considered important to preserve the exact behaviour 
currently offered by `org-agenda-sorting-strategy' then I would 
propose the following: 


- Keep the existing priority-{up,down} which combine priority cookies
  with timestamp data and the result from `org-habit-get-priority',
  but probably also deprecate it and remove it from the default value.

- Introduce new priority-cookie-{up,down} sorters which operate purely
  on [#A] and [#1] style priority cookies and nothing else.

This would facilitate decoupling of the sortable criteria whilst 
remaining backwards compatible. 

Does this sound reasonable?  I am keen to proceed very soon (ideally 
over the Xmas break).  I have already written some new ert tests for 
`org-agenda-sorting-strategy' which would be included in any submitted 
patches. 


Thanks!
Adam



overloading of internal priority calculations in agenda

2020-12-02 Thread Adam Spiers

Hi all,

I'm currently working on adding a feature to org-agenda which allows
manual ordering of entries in combination with the existing automatic
ordering (as dictated by `org-agenda-sorting-strategy').

During my investigations I noticed that while `org-get-priority' converts
[#B] style cookies into a numeric priority which is a multiple of
1000, further adjustments are made in functions like
`org-agenda-get-scheduled' before adding this numeric priority as a
text property on the entry:

'priority (if habitp (org-habit-get-priority habitp)
(+ 99 diff (org-get-priority item)))

In this case `diff' refers to the number of days between now and when
the item was scheduled.  A slightly different calculation is made in
`org-agenda-get-timestamps':

(org-add-props item props
  'priority (if habit?
(org-habit-get-priority (org-habit-parse-todo))
  (org-get-priority item))

I further noticed that this overloading of the internal priority by
including timestamp and habit data causes disruption to the behaviour
I imagine most users would expect from `org-agenda-sorting-strategy'.
For example, if you have `priority-down' as the first entry in the
`agenda' section and `category-keep' as the second, then differences
in the SCHEDULED timestamp are included in the priority calculation
and can therefore prevent sorting of two adjacent [#B] items by
category.  This seems like a bug to me, or at least breaks the
Principle of Least Surprise.

I did some git archaelogy and found that the first ever git commit
4be4c562 (for release 4.12a) already includes
`org-agenda-sorting-strategy', but at that point, time-{up,down} were
the only time-related sorting criteria available.

I was also wondering where the magic 99 number above came from, and I
found that the same (first ever) commit introduced the following
priority calculation:

(+ (- 5 diff) (org-get-priority txt))

Subsequently, commit 70b6cc5d (for release 5.10a) changes this to:

(+ 94 (- 5 diff) (org-get-priority txt))

and then commit 69ec6258 (on 2016-11-25) changes it to

(+ 99 diff (org-get-priority item))

Given that `org-agenda-sorting-strategy' now supports all manner of
sorting criteria, many of which are time-sensitive, I would like to
know if there is any reason not to remove this overloading of the
priority calculation, i.e. decoupling it to depend purely on the
result of `org-get-priority' and `org-habit-get-priority'?

If fact, perhaps we could go one step further and add support for new
habit-priority-{up,down} sorters to `org-agenda-sorting-strategy', so
that the priority-{up,down} sorters sort purely by the priority cookie
and nothing else?

Thanks!
Adam



[PATCH] org-agenda.el: Add a M-, binding for org-priority-show

2020-12-01 Thread Adam Spiers
This offers an easy way to check the internal numeric priority
used for sorting within the agenda.
---
 doc/org-manual.org | 8 
 lisp/org-agenda.el | 1 +
 2 files changed, 9 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 5a84a6de6..e914af42d 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -9891,6 +9891,14 @@ the other commands, point needs to be in the desired 
line.
   Set tags for the current headline.  If there is an active region in
   the agenda, change a tag for all headings in the region.
 
+- {{{kbd(M-\,)}}} (~org-priority-show~) ::
+
+  #+kindex: M-,
+  #+findex: org-priority-show
+  Show the numeric priority for the current item.  This priority is
+  composed of the main priority given with the =[#A]= cookies, and by
+  additional input from the age of a schedules or deadline entry.
+
 - {{{kbd(\,)}}} (~org-agenda-priority~) ::
 
   #+kindex: ,
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index a482b3db4..40ea31fdc 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2399,6 +2399,7 @@ (defun org-agenda-mode ()
 (org-defkey org-agenda-mode-map "\C-c\C-p" #'org-agenda-previous-date-line)
 (org-defkey org-agenda-mode-map "\C-c," #'org-agenda-priority)
 (org-defkey org-agenda-mode-map "," #'org-agenda-priority)
+(org-defkey org-agenda-mode-map [(meta ?,)] #'org-priority-show)
 (org-defkey org-agenda-mode-map "i" #'org-agenda-diary-entry)
 (org-defkey org-agenda-mode-map "c" #'org-agenda-goto-calendar)
 (org-defkey org-agenda-mode-map "C" #'org-agenda-convert-date)
-- 
2.28.0




Re: [PATCH] org-refile.el: Add org-refile-reverse which toggles org-reverse-note-order

2020-11-09 Thread Adam Spiers

On Sun, Sep 06, 2020 at 02:10:09AM -0400, Amin Bandali wrote:

Bastien writes:


Hi Adam,

Adam Spiers  writes:


This is useful for prepending to the start of the target headline
instead of appending to the end, or vice-versa depending on
org-reverse-note-order.


I think this would be useful.  What others think?


[...]

+1; sounds quite useful to me as well.

Thank you both.


Is it time to revisit this yet?

Thanks!



[PATCH] x11idle: Make installation a little smoother

2020-10-25 Thread Adam Spiers
Fix a -Wimplicit-int compiler warning, and make it more obvious how to
obtain scrnsaver.h on three of the most popular Linux distros.

Signed-off-by: Adam Spiers 
---
 contrib/scripts/x11idle.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/contrib/scripts/x11idle.c b/contrib/scripts/x11idle.c
index 22cefe1e6..b8db27560 100644
--- a/contrib/scripts/x11idle.c
+++ b/contrib/scripts/x11idle.c
@@ -1,4 +1,9 @@
+/* This header file is provided by the libxss-dev package on Debian,
+ * by the libXss-devel rpm on openSUSE, and the libXScrnSaver-devel
+ * rpm on Fedora.
+ */
 #include 
+
 #include 
 
 /* Based on code from
@@ -7,7 +12,7 @@
  * compile with 'gcc -l Xss x11idle.c -o x11idle' and copy x11idle into your
  * path
  */
-main() {
+int main() {
 XScreenSaverInfo *info = XScreenSaverAllocInfo();
 //open the display specified by the DISPLAY environment variable
 Display *display = XOpenDisplay(0);
-- 
2.28.0




Re: [PATCH] [WIP] org-agenda.el: Make org-entries-lessp more efficient

2020-10-24 Thread Adam Spiers
On Sat, Oct 24, 2020 at 01:36:05PM +0200, Bastien wrote: 
Hi Adam, 

this looks good to me, thanks a lot. 


Thanks for the review :-) 

Does "WIP" means that you want to wait for other patches to complete 
this one or shall I apply this one already? 


The intention is for it to be a standalone patch, so I don't think 
there's any need to wait for other patches.  The "WIP" was coming more 
from the fact that I haven't done extensive testing to make sure I 
didn't break a single one of the many sorting criteria - especially 
this one:


+('category-keep   (if (org-cmp-category a b) +1 nil)) ;; FIXME: check this

Ideally there would already be unit and/or functional tests covering 
agenda sorting, but I can't see any and I imagine they would be 
non-trivial to add (although perhaps not too difficult either). 

Also, the previous behaviour was to silently ignore 
user-defined-{up,down} if org-agenda-cmp-user-defined was not defined, 
but that intuitively felt wrong to me (IMHO it kind of violates the 
Principle of Least Surprise) so I didn't bother to preserve that 
behaviour.  However I admit that is a pretty subjective choice, so if 
you think the existing behaviour should be preserved, I can tweak the 
code to do that.  In fact, even if you agree with me that it would be 
better to generate an error when user-defined-{up,down} is used with 
org-agenda-cmp-user-defined being nil, I just noticed that it currently 
generates the very unhelpful error: 


org-entries-cmp-1: Symbol’s function definition is void: nil

so we would want to explicitly catch that case and generate a more 
helpful error message, e.g. "org-agenda-sorting-strategy contains 
user-defined sorting but org-agenda-cmp-user-defined is nil". 

BTW, as you can partially see from the below link, I did some 
performance profiling relating to this change and it did indeed seem 
to shave a few milliseconds off org-entries-lessp, although in the 
grand scheme of things, that didn't make as much of a dent in 
org-agenda's running time as I'd hoped for ;-) 



https://gist.github.com/trishume/40bf7045a23412d4c016f5e8533437db#gistcomment-3494087



[PATCH] [WIP] org-agenda.el: Make org-entries-lessp more efficient

2020-10-18 Thread Adam Spiers
[This is only lightly tested and therefore probably not quite ready
for merging yet; however I'm submitting now to get feedback.]

org-entries-lessp was not as efficient a multi-criteria comparator as
it could have been, since it evaluated all criteria and then combined
them via (eval (cons 'or ...)), thereby missing a chance for lazy
evaluation via short-circuiting: if one of the earlier criteria in
org-agenda-sorting-strategy-selected evaluates to non-nil, giving a
definitive comparison result, there is no need to evaluate any of the
later criteria.

So instead iterate over the criteria one by one, and return as soon as
we have a definitive result.

Also remove code duplication by adopting a unified approach to
ascending/descending sorting.

Note that the way org-entries-lessp is invoked by
org-agenda-finalize-entries is still inefficient, because the same
values (e.g. timestamps, priorities, etc.) are extracted from every
pair of entries in each comparison within the sort.  In the future,
introducing a Schwartzian transform can probably address this.

However the refactoring in this commit is a step in the right
direction, and it also allows other code to determine which comparison
is decisive in ordering any two elements.

Signed-off-by: Adam Spiers 
---
 lisp/org-agenda.el | 103 -
 1 file changed, 46 insertions(+), 57 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 88bb3f90d..eadc7fedd 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7187,65 +7187,54 @@ (defsubst org-cmp-habit-p (a b)
 (cond ((and ha (not hb)) -1)
  ((and (not ha) hb) +1
 
+(defun org-entries-cmp (a b)
+  "Iterate through the sorting criteria in
+`org-agenda-sorting-strategy-selected' until a sorter returns a
+definitive comparison, then return a cons cell (RESULT . SORTER)."
+  (let (sorted-by
+   sort-result
+   (ss org-agenda-sorting-strategy-selected))
+(while (and ss (not sorted-by))
+  (let* ((sorter (car ss))
+(sorter-name (symbol-name sorter))
+;; If sorter symbol ends in "-down" then pass the -up version
+;; to org-entries-cmp-1 and then negate the result.
+(sorter-down-p (string-match "-down\\'" sorter-name))
+(up-sorter
+ (if sorter-down-p
+ (replace-regexp-in-string "-down\\'" "-up" sorter-name)
+   sorter-name)))
+   (setq sort-result (org-entries-cmp-1 a b (intern up-sorter)))
+   (setq ss (cdr ss))
+   (when sort-result
+ (setq sort-result (if sorter-down-p (- sort-result) sort-result))
+ (setq sorted-by sorter
+(cons sort-result sorted-by)))
+
+(defun org-entries-cmp-1 (a b sorter)
+  "Compare two entries via the given sorter."
+  (pcase sorter
+('timestamp-up(org-cmp-ts a b ""))
+('scheduled-up(org-cmp-ts a b "scheduled"))
+('deadline-up (org-cmp-ts a b "deadline"))
+('tsia-up (org-cmp-ts a b "timestamp_ia"))
+('ts-up   (org-cmp-ts a b "timestamp"))
+('time-up (org-cmp-time a b))
+('stats-up(org-cmp-values a b 'org-stats))
+('priority-up (org-cmp-values a b 'priority))
+('effort-up   (org-cmp-effort a b))
+('category-up (org-cmp-category a b))
+('category-keep   (if (org-cmp-category a b) +1 nil)) ;; FIXME: check this
+('tag-up  (org-cmp-tag a b))
+('todo-state-up   (org-cmp-todo-state a b))
+('habit-up(org-cmp-habit-p a b))
+('alpha-up(org-cmp-alpha a b))
+('user-defined-up (funcall org-agenda-cmp-user-defined a b
+
 (defun org-entries-lessp (a b)
   "Predicate for sorting agenda entries."
-  ;; The following variables will be used when the form is evaluated.
-  ;; So even though the compiler complains, keep them.
-  (let* ((ss org-agenda-sorting-strategy-selected)
-(timestamp-up(and (org-em 'timestamp-up 'timestamp-down ss)
-  (org-cmp-ts a b "")))
-(timestamp-down  (if timestamp-up (- timestamp-up) nil))
-(scheduled-up(and (org-em 'scheduled-up 'scheduled-down ss)
-  (org-cmp-ts a b "scheduled")))
-(scheduled-down  (if scheduled-up (- scheduled-up) nil))
-(deadline-up (and (org-em 'deadline-up 'deadline-down ss)
-  (org-cmp-ts a b "deadline")))
-(deadline-down   (if deadline-up (- deadline-up) nil))
-(tsia-up (and (org-em 'tsia-up 'tsia-down ss)
-  (org-cmp-ts a b "timestamp_ia")))
-(tsia-down   (if tsia-up (- tsia-up) nil))
-(ts-up   (and (org-em 'ts-up 'ts-down ss)
-  (org-cmp-ts a b "timestamp")))
-(ts-dow

[PATCH] org-agenda.el: Fix 'Maker' typo

2020-10-18 Thread Adam Spiers
TINYCHANGE

Signed-off-by: Adam Spiers 
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index a1b20649d..88bb3f90d 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4127,7 +4127,7 @@ (defvar org-agenda-last-marker-time (float-time)
 
 (defun org-agenda-new-marker ( pos)
   "Return a new agenda marker.
-Maker is at point, or at POS if non-nil.  Org mode keeps a list of
+Marker is at point, or at POS if non-nil.  Org mode keeps a list of
 these markers and resets them when they are no longer in use."
   (let ((m (copy-marker (or pos (point)) t)))
 (setq org-agenda-last-marker-time (float-time))
-- 
2.28.0




Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Adam Spiers
On Wed, Sep 16, 2020 at 11:55:53PM +0100, Adam Spiers wrote: 
I've actually managed it get it working now!  See the attached patch. 
However unfortunately it is not ready to be merged yet.  Firstly, it 
breaks `test-org/tag-align'.  Secondly, since this changes the method 
of alignment from simply using raw spaces to using a single space with 
a display text property, when the file is saved and reloaded, it just 
displays a single space and the alignment is lost.  Another 
unfortunate side-effect is that if the file is simultaneously 
displayed in a graphical window and a text window via the same emacs 
server (e.g. via emacsclient -t), then one of the two windows will 
have incorrect alignment. 

So I think the correct fix will be to keep the original number of 
spaces, but use a display text property to redisplay those spaces as a 
single space with the given width.  I'm guessing that the display text 
property will be ignored on text-only (tty) windows, fixing both 
problems in one go. 

So I'll take another stab at this soon, if Bastien or some other Org 
guru can confirm I'm on the right track. 


Hrm, no this isn't good enough.  For graphical windows we still need 
to set the display text properties to align all tags when the buffer 
initially loads.  AFAICS there's currently no code to trigger this, so 
it would need to be added, and for large files this might actually 
cause problems with file loading time unless it was done in the 
background (a bit like fontification can be done). 

Advice on how to handle this best is very welcome. 



Re: Help administer code.orgmode.org: moderate user access and manage the gogs instance

2020-09-16 Thread Adam Spiers
On Wed, 16 Sep 2020 at 08:21, Bastien  wrote:
> Hi Timothy,
>
> TEC  writes:
>
> >> Is anyone willing to help with (1) and/or (2)?
> >
> > I'm willing to give (2), and potentially (1) a shot :)
>
> Thanks a lot!  I wrote you offlist about this.

It's not nearly as generous an offer, but as I don't have a gogs
account yet, I volunteer to be a guinea pig if TEC wants to practice
giving (1) a shot ;-)

I think I used to have push access to Worg many years ago, and I've
noticed one or two issues which I'd be happy to fix if I regained
that.  Or is Worg also subject to a peer review process these days?

Cheers,
Adam



Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Adam Spiers
On Wed, Sep 16, 2020 at 03:03:02PM -0400, Jeff Filipovits wrote: 
It looks like (window-text-pixel-size) could be used to calculate the 
pixel length of the tags list? 


Ahah!  This indeed did the trick!  I have no idea how I missed this 
handy function previously when I was scouring the manual... 

I am having trouble deciphering the 
manual (https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html#Pixel-Specification) 
for pixel specification for spaces, though. The right alignment 
specification for some reason sends the tags to the next line, as do 
most other solutions that I would expect to align the text to the 
right side of the window. 

I can experiment more in a couple days, but in the meantime maybe 
someone smarter than me give some hints on how to use the pixel 
specification properties. 


I've actually managed it get it working now!  See the attached patch. 
However unfortunately it is not ready to be merged yet.  Firstly, it 
breaks `test-org/tag-align'.  Secondly, since this changes the method 
of alignment from simply using raw spaces to using a single space with 
a display text property, when the file is saved and reloaded, it just 
displays a single space and the alignment is lost.  Another unfortunate 
side-effect is that if the file is simultaneously displayed in a graphical 
window and a text window via the same emacs server (e.g. via emacsclient -t), 
then one of the two windows will have incorrect alignment. 

So I think the correct fix will be to keep the original number of 
spaces, but use a display text property to redisplay those spaces as a 
single space with the given width.  I'm guessing that the display text 
property will be ignored on text-only (tty) windows, fixing both 
problems in one go. 

So I'll take another stab at this soon, if Bastien or some other Org 
guru can confirm I'm on the right track. 

BTW I tried your code and for some reason it didn't insert any space 
for me, but I didn't look into that yet. 


The way it’s written it would only reduce the gap between the headline 
and tags to a space, and it assumes there are multiple spaces there 
already. If there’s no space between the two, I don’t think it’ll 
insert one. Probably not the best way as it was thrown together to 
test the text property fix. 


I figured out that it wasn't working because my `org-tags-column' is a 
negative value in order to align flush-right, and your code didn't 
support that. 

I accepted long ago that the solution to using a variable pitch font 
for org headings was that the tags would not be aligned to the right 
and never looked back, so maybe this is not worth the price of fixing 
it if it is messy. And diving down to calculating the pixel width of 
text seems like it’s getting pretty messy. 


Actually I think it ended up fairly clean.  Huge thanks to you for 
giving me the hint I needed!  I just adapted your code a bit.  I've 
marked you as a co-author in the commit message.  For now your 
contribution probably still falls into the category of "Tiny changes": 


https://orgmode.org/worg/org-contribute.html#org9fbb342

However you might want to preemptively sign the copyright assignment 
papers: 


https://orgmode.org/worg/org-contribute.html#copyrighted-contributors
>From 7655c32847d7abd9da7603b1a1a314b7d1b87ba5 Mon Sep 17 00:00:00 2001
From: Adam Spiers 
Date: Wed, 16 Sep 2020 23:12:04 +0100
Subject: [PATCH] [WIP] org.el: Align tags using specified space display property
To: emacs-orgmode@gnu.org

Previously tags on heading lines were aligned using spaces, which
assumed a fixed width font.  However variable pitch fonts are becoming
increasingly popular, so ensure there is always a single space in
between the heading text and the (colon-delimited) list of tags, and
then if necessary use a display text property to specify the exact
width required by that space to align it in accordance with the value
of `org-tags-column' which the user has chosen:

  https://www.gnu.org/software/emacs/manual/html_node/elisp/Pixel-Specification.html#Pixel-Specification

If the value is positive, align flush-left; if negative, align
flush-right; and if zero, just leave a normal width space.

See the following links for the discussion threads leading to this
patch:

- https://lists.gnu.org/archive/html/emacs-orgmode/2020-09/msg00415.html
- https://gitlab.com/protesilaos/modus-themes/-/issues/85

Signed-off-by: Adam Spiers 
Co-authored-by: Jeff Filipovits 
---
 lisp/org.el | 68 ++---
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 053635c85..e800eb642 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11831,35 +11831,45 @@ (defun org-toggle-tag (tag  onoff)
   res)))
 
 (defun org--align-tags-here (to-col)
-  "Align tags on the current headline to TO-COL.
-Assume point is on a headline.  Preserve point when aligning
-tags."
-  (when (org-mat

Re: variable-pitch-mode misaligns org-mode heading tags

2020-09-16 Thread Adam Spiers

Hi Jeff,

Firstly thanks a lot for looking into this! 


On Tue, Sep 15, 2020 at 01:41:04PM -0400, Jeff Filipovits wrote:
Following the call for help to fix bugs, and with building guilt, I’ve 
taken a stab at fixing aligning tags when using a variable-pitch font. 
I haven’t tested this much because I do not know if it is misguided, 
but it seems to work. 

Seems the only way to do it is to use the ‘display text property and 
expand a single space between the headline and tags. Here is a drop-in 
replacement of org--align-tags-here which ensures there is one space 
between the tags and headline, and then expands that space by setting 
a text property. 


Yes, this is the same conclusion I reached a little while ago: 


   https://gitlab.com/protesilaos/modus-themes/-/issues/85#note_407147422

However as mentioned there, AFAICS this approach only manages to 
*left*-align the tags, not *right*-align them.  When there are several 
tags, this can be problematic as the colon-delimited list of tags will 
either spill over the buffer's right margin, or avoid that by 
requiring an alignment column which is further to the left and ends up 
interfering with the main text of the buffer.  Given that the 
colon-delimited lists have variable numbers of characters, I think 
it's clear that right alignment is the only decent space-efficient 
layout.


BTW I tried your code and for some reason it didn't insert any space for 
me, but I didn't look into that yet. 

I’ve removed the point-preserving code because it does not seem to be 
needed using this method. This would also allow removing 
org-fix-tags-on-the-fly from org-self-insert-command since there is 
only a single space between the headline and the tags and it is 
adjusted automatically. 


Makes sense. 

If this looks promising I can throw some more time at it. If not, I 
will happily abandon it. 


I think it's promising for sure.  But I think there is still a 
remaining problem regarding how to implement the right alignment of 
the colon-delimited list of tags.  If this list uses a fixed-width 
font then it is relatively easy, because then the value to provide to 
:align-to can be calculated as `org-tags-column' minus the column 
width of the tag list.  And indeed this seems to be how the original 
version of `org--align-tags-here' achieves right alignment: 


   (new (max (if (>= to-col 0) to-col
   (- (abs to-col) (string-width (match-string 1

But the whole point of this exercise is to support variable-width 
fonts.  In this case, the correct position for the end of the single 
space is most likely not even a multiple of the fixed column width, so 
it would probably need to be measured in pixels rather than columns. 
And in order to calculate it, it is first necessary to calculate the 
exact width in pixels of the colon-delimited list of tags. 

As I mentioned in the comment linked above, I searched for a way of 
calculating the pixel width of the tag list, and the best I could find 
was `pos-visible-in-window-p' which has some issues which I mentioned 
there.  If you have thoughts on whether I'm right about those, and if 
so how to solve them, I'd love to hear! 


Cheers,
Adam



Re: make org-refile auto-recache when needed?

2020-09-05 Thread Adam Spiers

Hi Bastien,

On Fri, Sep 04, 2020 at 04:12:08PM +0200, Bastien wrote:

Adam Spiers  writes:

I note that when org-refile-use-cache is enabled and the cache becomes
stale, attempting to refile results in this error message (originating
from `org-refile-check-position'):

Invalid refile position, please clear the cache with `C-0 C-c C-w' before 
refiling

Is there any reason why it couldn't just automatically rebuild the
cache when needed?


If we can rebuild the cache for refile target in a reliable way, sure,
we should do this.  I had a quick look and this isn't straightforward,
so help is welcome.  I note the idea for after 9.4.


Thanks for the reply!

I don't see why we need to be able to rebuild it reliably.  Can't we
just try, then if it succeeds, refile as normal, and if it fails, then
output an error saying that the cache rebuild failed and making a
helpful suggestion of what to try next?  Maybe I'm missing something.



Re: [PATCH] doc: Document C-. for jumping to today when choosing a timestamp

2020-09-05 Thread Adam Spiers

On Fri, Sep 04, 2020 at 03:47:08PM +0200, Bastien wrote:

Hi Adam,

Adam Spiers  writes:


This useful key binding was previously missing from the manual.


Thanks for spotting this.  I added it (as 2df7a8fa) together with
the `.'  keybinding, which achieves the same.


Thanks Bastien.  There's actually a subtle but important difference
between the two: when editing a timestamp with a time of day in, e.g.

<2020-08-27 Thu 17:00>

then the prompt in the minibuffer will be:

SCHEDULED Date+time [2020-08-27]: 17:00

While the point is after the "17:00", pressing '.' does not cause a
jump to today's date; instead it just appends the '.' character after
the "17:00".  In contrast, C-. successfully jumps to today without
altering the prompt input.  So in this context, C-. is far more useful
than just '.'.

Funnily enough I found that if I first jump to the beginning of
"17:00" via C-a, then they do indeed behave identically.



Re: time-warping - retroactively marking DONE?

2020-08-29 Thread Adam Spiers
On Wed, 8 Jul 2020 at 23:09, No Wayman  wrote:
> I emailed Adam directly with an experimental package I wrote to
> solve the problem of changing the todo-state of an entry at an
> arbitrary time.
> He suggested I posted here as well:
>
> https://github.com/progfolio/epoch/
>
> The package advises current-time to return `epoch-current-time' if
> is set (falling back to the usual current-time if not).
> A macro, `epoch-with-time' is provided which allows a body to be
> executed with current-time set to an arbitrary time.
> Two commands (which I may separate into their own package),
> `epoch-todo' and `epoch-agenda-todo' call their respective
> org-mode commands.
> `org-read-date' is called with the tasks's SCHEDULED or DEADLINE
> time pre-populated so one can easily edit relative to that time.
>
> Still very much a work in progress, but the two commands are
> useful for me so far.
>
> Any ideas, suggestions, criticisms are appreciated.

Many thanks again for this.  It's working great for me!

In case anyone's interested, here's my use-package config (which uses
the awesome straight.el package manager to install it):

https://github.com/aspiers/emacs/blob/aa62bd84b51a02cb0fc980862a63514349d253bf/.emacs.d/init.d/as-org-mode.el#L111-L116

I agree with your observation that it might be nicer to separate out
the org-specific stuff into a separate package, because the epoch
stuff seems useful in its own right outside org-mode.



[PATCH] org-refile.el: Add org-refile-reverse which toggles org-reverse-note-order

2020-08-29 Thread Adam Spiers
This is useful for prepending to the start of the target headline
instead of appending to the end, or vice-versa depending on
org-reverse-note-order.
---
 doc/org-manual.org | 10 ++
 etc/ORG-NEWS   |  9 +
 lisp/org-keys.el   |  1 +
 lisp/org-refile.el | 11 +++
 4 files changed, 31 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 3eb745b5d..e499367b7 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -7190,6 +7190,16 @@ special command:
   Copying works like refiling, except that the original note is not
   deleted.
 
+- {{{kbd(C-c C-M-w)}}} (~org-refile-reverse~) ::
+
+  #+kindex: C-c C-M-w
+  #+findex: org-refile-reverse
+  Works like refiling, except that it temporarily toggles how the
+  value of ~org-reverse-note-order~ applies to the current buffer.  So
+  if ~org-refile~ would append the entry as the last entry under the
+  target header, ~org-refile-reverse~ will prepend it as the first
+  entry, and vice-versa.
+
 ** Archiving
 :PROPERTIES:
 :DESCRIPTION: What to do with finished products.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 10658a970..a3c8397fc 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -267,6 +267,15 @@ Source code block header argument =:file-mode= can set file
 permissions if =:file= argument is provided.
 
 ** New commands
+*** ~org-refile-reverse~
+
+Use default keybinding == to run command
+~org-refile-reverse~.  It is almost identical to ~org-refile~, except
+that it temporarily toggles how ~org-reverse-note-order~ applies to
+the current buffer.  So if ~org-refile~ would append the entry as the
+last entry under the target heading, ~org-refile-reverse~ will prepend
+it as the first entry, and vice-versa.
+
 *** ~org-table-header-line-mode~
 
 Turn on a minor mode to display the first data row of the table at
diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index 37df29983..902651175 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -582,6 +582,7 @@ (define-key org-mode-map (kbd "") #'org-shifttab)
 (org-defkey org-mode-map (kbd "C-c ;") #'org-toggle-comment)
 (org-defkey org-mode-map (kbd "C-c C-w") #'org-refile)
 (org-defkey org-mode-map (kbd "C-c M-w") #'org-refile-copy)
+(org-defkey org-mode-map (kbd "C-c C-M-w") #'org-refile-reverse)
 (org-defkey org-mode-map (kbd "C-c /") #'org-sparse-tree) ;minor-mode reserved
 (org-defkey org-mode-map (kbd "C-c \\") #'org-match-sparse-tree) ;minor-mode r.
 (org-defkey org-mode-map (kbd "C-c RET") #'org-ctrl-c-ret)
diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index 7eb0a9643..c6ff35535 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -384,6 +384,17 @@ (defun org-refile-copy ()
 
 (defvar org-capture-last-stored-marker)
 
+;;;###autoload
+(defun org-refile-reverse ( arg default-buffer rfloc msg)
+  "Invoke `org-refile', but temporarily toggling how
+~org-reverse-note-order~ applies to the current buffer.  So if
+`org-refile' would append the entry as the last entry under the
+target heading, ~org-refile-reverse~ will prepend it as the first
+entry, and vice-versa."
+  (interactive "P")
+  (let ((org-reverse-note-order (not (org-notes-order-reversed-p
+(org-refile arg default-buffer rfloc msg)))
+
 ;;;###autoload
 (defun org-refile ( arg default-buffer rfloc msg)
   "Move the entry or entries at point to another heading.
-- 
2.27.0




[PATCH] doc: Document C-. for jumping to today when choosing a timestamp

2020-08-29 Thread Adam Spiers
This useful key binding was previously missing from the manual.

Signed-off-by: Adam Spiers 
---
 doc/org-manual.org | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 3eb745b5d..7c291c3a7 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -6028,6 +6028,7 @@ calendar, or by pressing {{{kbd(RET)}}}, the date 
selected in the
 calendar is combined with the information entered at the prompt.  You
 can control the calendar fully from the minibuffer:
 
+#+kindex: C-.
 #+kindex: <
 #+kindex: >
 #+kindex: M-v
@@ -6041,6 +6042,7 @@ can control the calendar fully from the minibuffer:
 #+kindex: M-S-LEFT
 #+kindex: RET
 #+attr_texinfo: :columns 0.25 0.55
+| {{{kbd(C-.)}}}   | Jump to today. |
 | {{{kbd(RET)}}}   | Choose date at point in calendar.  |
 | {{{kbd(mouse-1)}}}   | Select date by clicking on it. |
 | {{{kbd(S-RIGHT)}}}   | One day forward.   |
-- 
2.27.0




make org-refile auto-recache when needed?

2020-07-15 Thread Adam Spiers

Hi all,

I note that when org-refile-use-cache is enabled and the cache becomes
stale, attempting to refile results in this error message (originating
from `org-refile-check-position'):

Invalid refile position, please clear the cache with `C-0 C-c C-w' before 
refiling

Is there any reason why it couldn't just automatically rebuild the
cache when needed?  If it did that then I struggle to imagine why
anyone would ever *not* want the cache enabled, because in the worst
case org-refile would just behave the same as when the cache is
disabled, and in the best case it would perform a lot faster.

Cheers,
Adam



Re: :STYLE: habit causes position in agenda view to change

2020-07-15 Thread Adam Spiers

On Tue, Jul 14, 2020 at 11:33:03PM -0400, Kyle Meyer wrote:

Adam Spiers writes:


I've noticed that adding the :STYLE: habit property to a TODO causes
its position in the agenda view to change; it jumps to the bottom of
the day.  Is there any way to prevent that?


Try customizing org-agenda-sorting-strategy (in particular, dropping
habit-down from agenda's values).


Perfect, thanks so much Kyle!



Re: Org mode for meeting minutes

2020-07-07 Thread Adam Spiers
On Thu, 31 Oct 2019 at 14:04, Christian Egli  wrote:
> Hi all
>
> I'd like to revisit a very old thread[1] where Adam Spiers asks if there
> is support in Org mode for
>
> 1. Allow *fast* production of meeting agendas and minutes, exportable in
>a good-looking legible format which non-org readers can digest.
>
> 2. Allow minutes to be taken as the meeting progresses, minimising the
>amount of work required after the meeting.
>
> 3. Allow actions to be captured and then automatically extracted into a
>simple tabulated report which clearly shows actions grouped by owner.
>
> 4. Track progress of actions *after* the minutes have been issued.

Wow, this makes me feel old! ;-)

Sorry for chiming in late - only just noticed this thread.

> He goes on to say that org mode handles (1) and (2) just fine, but he
> wasn't sure about (3) and (4).
>
> His mail is from 2008 and a lot has happened in the mean time. I would
> suggest that today (1) and (2) can be handled with normal org export or
> even pandoc. Inline tasks[2] help a lot to add, well inline tasks. For (3)
> and (4) he mentions a dynamic block that could collect all action items.
>
> I never found that dynamic block he mentions, so I hacked one up (which
> was suprisingly easy). I haven't packaged it but the gist of it is
> below:

[snip]

I have no doubt that your modern solution is much better than my ancient
hack, but just for the record, the latter can be found here:

https://github.com/aspiers/emacs/blob/master/.emacs.d/init.d/as-gtd.el#L79-L117

Thanks a lot for re-raising this and subsequently writing a very nice blog
post about it too!

Cheers,
Adam

P.S. I recently discovered an exceptionally good service to aid
with capturing information from meetings:

   https://otter.ai/

Sadly it is proprietary, and the speech recognition is sophisticated
enough that I doubt that any FLOSS alternative will appear any time
soon :-(



:STYLE: habit causes position in agenda view to change

2020-07-07 Thread Adam Spiers

Hi all,

I've noticed that adding the :STYLE: habit property to a TODO causes
its position in the agenda view to change; it jumps to the bottom of
the day.  Is there any way to prevent that?

Thanks!
Adam



time-warping - retroactively marking DONE?

2020-07-07 Thread Adam Spiers

Hi all,

I'm looking for a way to retroactively mark a task as having been done
at a previous time/date.  I know that I can just change the keyword to
DONE and then edit the timestamp, but this is tedious when it's a
repeating event, e.g.:

*** NEXT [#A] meditate 15 minutes every day
  SCHEDULED: <2020-07-06 Mon 11:30-11:50 .+1d>
  :PROPERTIES:
  :LAST_REPEAT: [2020-07-05 Sun 11:13]
  :ID:   142a639c-e06d-4d4b-ad1c-edcd0d9ba6ce
  :Effort:   0:20
  :STYLE:habit
  :END:

  - State "DONE"   from "NEXT"   [2020-07-05 Sun 10:15]
  - State "DONE"   from "NEXT"   [2020-07-04 Sat 10:30]
  - State "DONE"   from "NEXT"   [2020-07-03 Fri 10:05]
  - State "DONE"   from "NEXT"   [2020-07-02 Thu 11:15]

I forgot to mark it as done yesterday, which means that I would have
to manually edit /three/ timestamps to log the correct data: 1) the
SCHEDULED timestamp, 2) the :LAST_REPEAT: property, and 3) the state
change history.

If this is not currently possible, would it make sense to write a
wrapper around `org-todo', e.g. `org-todo-timewarp' or
`org-retroactive-todo', which interactively prompts for a timestamp
before invoking `org-todo'?

Another possibility would be to add yet another magic prefix argument
to `org-todo', but it seems that is already heavily overloaded, so it
would have to be 'C-u C-u C-u C-u' which isn't particularly
convenient.

I can even imagine users occasionally wanting to mark stuff done in
the future, e.g. if they have an activity planned for tomorrow while
they're offline.  So maybe using the word 'retroactive' in the wrapper
function name is a bit too limiting.

Cheers,
Adam



[O] integrating org-mode with complice.co?

2018-08-09 Thread Adam Spiers
Hi all,

I know we have some Beeminders here, so it seems reasonable to ask whether
we also have any Complice users?

https://complice.co/

It's a really nice (albeit proprietary) service to help users achieve
direction, focus, and consistent progress with their lives.

https://complice.co/features

However it doesn't really have anything in the way of long-term planning.
So I've been thinking that an org-complice mode which provides a bridge
between long lists of projects / TODOs in org-mode and Complice's
minimalist day-to-day view could be quite an effective strategy.

It has an alpha API:

https://complice.co/apiclient/docs

In particular, when using org-mode as a comprehensive "product backlog for
life", it would be nice to be able to import tasks and goals into Complice,
and then have synchronisation which propagates the completion of tasks back
into org-mode.

Does that make sense, or is it a dumb idea? :-)

Thanks,
Adam


Re: [O] named anchors in HTML export

2017-08-19 Thread Adam Spiers
On 19 August 2017 at 09:50, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> Adam Spiers <orgm...@adamspiers.org> writes:
>> I was also expecting to be able to use #+NAME: foo in front of a
>> headline
>
> You cannot use a NAME keyword to a headline (or an inlinetask).
> CUSTOM_ID is morally equivalent, though.
>
>> or even other elements like paragraphs, but this doesn't
>> work. Is this a bug, or am I misreading the manual?
>
> Currently, "ox-html" doesn't create an anchor for named paragraphs,
> unless the paragraph consists of an image only.
>
> However, you can put targets anywhere in a paragraph using <>
> syntax.
>
>>  Is there any way of creating an anchor for an arbitrary element,
>> short of some ugly "+HTML" hack?
>
> Note that internal references are... internal. You can use them across
> documents only when using Org publishing mechanism. IOW, <>
> doesn't create  anchor, but something like  id="org1234567">.

Thanks Nicolas, that's super helpful!



[O] named anchors in HTML export

2017-08-18 Thread Adam Spiers
Hi there,

I'm using org2blog and trying to mark certain parts of a blog post
with a named anchor for permanent linking. However, org2blog relies on
Org's native HTML export, so really this post is just questions about
HTML Export.

I've managed to get sections anchored using a CUSTOM_ID property.
However based on

http://orgmode.org/manual/Internal-links.html#Internal-links

I was also expecting to be able to use #+NAME: foo in front of a
headline or even other elements like paragraphs, but this doesn't
work. Is this a bug, or am I misreading the manual?

 Is there any way of creating an anchor for an arbitrary element,
short of some ugly "+HTML" hack?

By the way, this question is also being tracked here:

https://github.com/org2blog/org2blog/issues/239

Thanks!
Adam



[O] Securing Org ELPA

2017-04-04 Thread Adam Spiers
Hi all,

Would it be possible to make Org ELPA available via https?

This is the motivation for asking:

https://glyph.twistedmatrix.com/2015/11/editor-malware.html

Thanks!
Adam



Re: [O] unlinking links

2014-12-10 Thread Adam Spiers
On Thu, Dec 04, 2014 at 06:07:53PM +0100, Nicolas Goaziou wrote:
 Adam Spiers orgm...@adamspiers.org writes:
  On Thu, Nov 06, 2014 at 08:30:08PM -0500, John Kitchin wrote:
  Adam Spiers orgm...@adamspiers.org writes:
   Is it just me or is there no quick way to remove the link from some
   hyperlinked text? If so, please consider this a feature request ;-)
  
  Try this:
  
  (defun unlinkify ()
replace an org-link with the path, or description.
(interactive)
(let ((eop (org-element-context)))
  (when (eq 'link (car eop))
 
 (when (eq (org-element-type eop) 'link)
 
  (message %s eop)
(let* ((start (org-element-property :begin eop))
  (end (org-element-property :end eop))
  (contents-begin (org-element-property :contents-begin eop))
  (contents-end (org-element-property :contents-end eop))
  (path (org-element-property :path eop))
  (desc (and contents-begin
 contents-end
 (buffer-substring contents-begin contents-end
 (setf (buffer-substring start end) (or desc path))
 
  Thanks, that worked great!  Can I suggest you submit this for
  inclusion in org itself? :-)  I guess it would need to be called
  `org-unlinkify'.
 
 FWIW, I don't think it is useful enough for inclusion in core.

Why not?  Or perhaps I should ask: how is it determined whether
something's useful enough for core? :-)



Re: [O] FR: refile-and-link

2014-12-10 Thread Adam Spiers
On Thu, Dec 04, 2014 at 07:21:30PM -0500, Kyle Meyer wrote:
 Adam Spiers orgm...@adamspiers.org wrote:
  Forgive me if this has already been implemented, but I couldn't see
  it...
 
 I don't know of a command that does this.
 
  I'm looking for something similar to the extract method operation
  which refactoring IDEs can perform on code.  You would select a
  headline (or maybe even region), hit `refile-and-link', and then after
  the normal refiling, a link to the refiled section would be inserted
  in the place where the refiled section previously lived.
 
  Thoughts?
 
 The last refile location is stored in org-bookmark-names-plist. The
 (lightly tested) function below uses that information to create a link
 to the refiled heading.
 
 #+begin_src emacs-lisp
   (defun org-refile-and-link ()
 Refile heading, adding a link to the new location.
   Prefix arguments are interpreted by `org-refile'.
 (interactive)
 (when (member current-prefix-arg '(3 (4) (16)))
   (user-error Linking is incompatible with that prefix argument))
 (let ((heading  (org-get-heading t t))
   (orig-file (buffer-file-name)))
   (call-interactively #'org-refile)
   (let* ((refile-file
   (bookmark-get-filename
(assoc (plist-get org-bookmark-names-plist :last-refile)
   bookmark-alist)))
  (same-file (string= orig-file refile-file))
  (link (if same-file
(concat * heading)
  (concat refile-file ::* heading)))
  (desc heading))
 (open-line 1)
 (insert (org-make-link-string link desc)
 #+end_src

Thanks a lot!  I've noticed a couple of minor issues - hopefully I'll
fix them when I get time and then maybe submit a patch.



Re: [O] unlinking links

2014-12-04 Thread Adam Spiers
On Thu, Nov 06, 2014 at 08:30:08PM -0500, John Kitchin wrote:
 Adam Spiers orgm...@adamspiers.org writes:
  Is it just me or is there no quick way to remove the link from some
  hyperlinked text? If so, please consider this a feature request ;-)
 
 Try this:
 
 (defun unlinkify ()
   replace an org-link with the path, or description.
   (interactive)
   (let ((eop (org-element-context)))
 (when (eq 'link (car eop))
 (message %s eop)
   (let* ((start (org-element-property :begin eop))
(end (org-element-property :end eop))
(contents-begin (org-element-property :contents-begin eop))
(contents-end (org-element-property :contents-end eop))
(path (org-element-property :path eop))
(desc (and contents-begin
   contents-end
   (buffer-substring contents-begin contents-end
   (setf (buffer-substring start end) (or desc path))

Thanks, that worked great!  Can I suggest you submit this for
inclusion in org itself? :-)  I guess it would need to be called
`org-unlinkify'.



[O] FR: refile-and-link

2014-12-03 Thread Adam Spiers
Hi all!

Forgive me if this has already been implemented, but I couldn't see it...

I'm looking for something similar to the extract method operation
which refactoring IDEs can perform on code.  You would select a
headline (or maybe even region), hit `refile-and-link', and then after
the normal refiling, a link to the refiled section would be inserted
in the place where the refiled section previously lived.

Thoughts?

Thanks!
Adam



[O] unlinking links

2014-11-06 Thread Adam Spiers
Hi all,

Is it just me or is there no quick way to remove the link from some
hyperlinked text?  If so, please consider this a feature request ;-)

Regards,
Adam


Re: [O] org-capture doesn't narrow correctly if :prepend is t

2014-03-15 Thread Adam Spiers
On 13 March 2014 09:45, Bastien b...@gnu.org wrote:
 Hi Adam and Thomas,

 This is now fixed, thanks!

Oh wonderful, thank you so much Bastien!



Re: [O] day boundaries later than midnight?

2014-02-10 Thread Adam Spiers
On Mon, Feb 10, 2014 at 10:01:38AM +0100, Bastien wrote:
 Hi Adam,

 Adam Spiers orgm...@adamspiers.org writes:

  Did any progress ever get made on this
  front since 2006, and if not, is it ever likely to?

 I think this is `org-extend-today-until':

 org-extend-today-until is a variable defined in `org.el'.
 Its value is 0

 Documentation:
 The hour when your day really ends.  Must be an integer.
 This has influence for the following applications:
 - When switching the agenda to today.  It it is still earlier than
   the time given here, the day recognized as TODAY is actually yesterday.
 - When a date is read from the user and it is still before the time given
   here, the current date and time will be assumed to be yesterday, 23:59.
   Also, timestamps inserted in capture templates follow this rule.

Ahah, that's it - thanks!  I guess I missed it because there's only one
fleeting reference in the Clocking commands section of the manual.

 IMPORTANT:  This is a feature whose implementation is and likely will
 remain incomplete.  Really, it is only here because past midnight seems to
 be the favorite working time of John Wiegley :-)

;-)



[O] org-dblock-write:count

2014-02-09 Thread Adam Spiers
Hi all,

I just had an awesome conversation with Sacha about more effective
daily/weekly reviewing with org-mode :-)  One of the things we talked
about was quantifying the number of tasks (TODO keywords) in any given
state, as a means of becoming more aware of your progress over time.
I have had some success in the past using the measure what you want
to manage maxim[1], and wanted to start applying this to my horribly
massive TODO.org file.

Back in 2008, Carsten very generously implemented the
`org-map-entries' API function at my request[2] in order to facilitate
this kind of measurement, and I'm somewhat ashamed to say that I've
only just started to take advantage of it:

(defun org-count-matches (search)
  Count the number of matches from the given tag search in the
current buffer, respecting any scope restriction.
  (interactive sMatch: )
  (length (org-map-entries t search)))

(defun org-dblock-write:count (params)
  Write a table showing the number of occurrences of each of the
specified keywords and tag searches.  Example usage:

#+BEGIN:dynamic block
#+BEGIN: count :keywords (\NEXT\ \DONE\) :searches (\@phone\ 
\@home\)
| NEXT   | 522 |
| DONE   |  69 |
| @phone |  77 |
| @home  | 182 |
#+END:

  (let ((keywords (plist-get params :keywords))
(searches (plist-get params :searches))
(format | %-10s | %3d |\n))
(insert
 (concat
  (mapconcat (lambda (keyword)
   (format format keyword (org-count-matches
   (concat / keyword
 keywords )
  (mapconcat (lambda (search)
   (format format search (org-count-matches search)))
 searches )))
(backward-delete-char 1)))

Sacha deserves a lot of credit for reminding me how easy it would be
to do this :-)

I suppose the next step would be to automate appending counts to a CSV
file or transmitting them to some kind of graphing service like
https://tempo-db.com/ (or preferably some free alternative like
quantifiedawesome ;-) via a REST API.

[1] http://blog.adamspiers.org/2011/05/15/email-nirvana/
[2] http://lists.gnu.org/archive/html/emacs-orgmode/2008-06/msg00208.html



[O] day boundaries later than midnight?

2014-02-09 Thread Adam Spiers
Hi all,

I found this thread from 2006 which talked about the possibility of
org-agenda considering day boundaries later than midnight:

  http://permalink.gmane.org/gmane.emacs.orgmode/369

I'm surely not the only night owls who regularly completes (or even
schedules) tasks after midnight but before going to sleep.  Yes, I
know it's the healthiest way to live - but realistically it would be
far more useful for me if org-agenda treated something like 4am as the
day boundary.  I understand from that thread that supporting this is
technically quite tricky.  Did any progress ever get made on this
front since 2006, and if not, is it ever likely to?

Thanks!
Adam



[O] org-mobile-pull with files in multiple directories?

2014-02-02 Thread Adam Spiers
Hi all,

I'm trying to figure out how to get org-mobile-pull to work for me.  I
want to be able to edit files from multiple directories via MobileOrg,
e.g.:

  ~/org/TODO.org
  ~/work/TODO.org
  ~/my-project/TODO.org
  ~/org/notes/my-hobby.org

I have a sync-org shell-script which copies them into a temporary
directory, and then runs the following via emacs --batch --eval:

(let ((org-mobile-files '(/path/to/tmpdir)))
  (require 'org-mobile nil 'noerror)
  (org-mobile-push))

org-mobile-directory is set to an scpx:... path so that the push
happens via TRAMP to my public server.  This all works fine.

However, when I run org-mobile-pull, edits to ~/org/notes/my-hobby.org
fail, and instead an error is appended to the file pointed to by
`org-mobile-inbox-for-pull', e.g.

* Heading not found on level 1: journal F(edit:body) 
[[olp:my-hobby.org:journal][a heading]]

I have examined the code in org-mobile.el, and I'm pretty sure that
this is due to org-mobile-locate-entry containing the following code:

...
(setq file (expand-file-name file org-directory))
(setq path (mapcar 'org-link-unescape
   (org-split-string path /)))
(org-find-olp (cons file path))

org-directory is ~/org, so it only succeeds in locating files which
live directly in ~/org.

Is this a known limitation, and if so, can anyone suggest a good way
to work around it?

Thanks!

Adam



Re: [O] [Orgmode] Feature Request: Keeping me honest

2013-12-16 Thread Adam Spiers
Thanks Tim.  Perhaps this could go in the contrib/lisp/ directory?

On 16 December 2013 14:02, Tim O'Callaghan tim.ocallag...@gmail.com wrote:
 Hi Adam.

 I still lurk on the org-mode list. I'm not using org as much as a TODO
 system any more, mostly for publishing and notes, so I am not sure if
 it works with the lates version of org.

 Attached is the code, released for those that might find it of value.
 It has not substantially changed in all that time. Its essentially an
 extra highlighter aimed at org-mode nodes that have tags like todo and
 project.

 regards,

 Tim.

 On 15 December 2013 17:08, Adam Spiers orgm...@adamspiers.org wrote:
 Hey Tim,

 I realise this is from over 4 years ago, but I was wondering if you'd
 made any progress with org-action-verbs since then?  It's a great idea
 and IMHO worthy of being made into a package.

 Cheers,
 Adam

 On 1 October 2009 03:29, Tim O'Callaghan tim.ocallag...@gmail.com wrote:
 Small update. Fixes the problem of the highlighting not disappearing
 when headline is fixed.

 - Still has some issues with removing highlighting when TODO becomes
 something else.

 - Added new default verbs:
 TODO, NEXT - Call, Email, Fix, Find, Fill out, Give, Print, Re-Do, Take
 PROJECT - Configure, Draft, Purge, Gather

 Enjoy,

 Tim.



Re: [O] [Orgmode] Feature Request: Keeping me honest

2013-12-15 Thread Adam Spiers
Hey Tim,

I realise this is from over 4 years ago, but I was wondering if you'd
made any progress with org-action-verbs since then?  It's a great idea
and IMHO worthy of being made into a package.

Cheers,
Adam

On 1 October 2009 03:29, Tim O'Callaghan tim.ocallag...@gmail.com wrote:
 Small update. Fixes the problem of the highlighting not disappearing
 when headline is fixed.

 - Still has some issues with removing highlighting when TODO becomes
 something else.

 - Added new default verbs:
 TODO, NEXT - Call, Email, Fix, Find, Fill out, Give, Print, Re-Do, Take
 PROJECT - Configure, Draft, Purge, Gather

 Enjoy,

 Tim.



Re: [O] generating ToC for existing PDF?

2013-10-27 Thread Adam Spiers
On 26 October 2013 14:11, Adam Spiers orgm...@adamspiers.org wrote:
 Hi all,

 I have an existing PDF, along with a text file table of contents.  Is
 it possible to use org to generate a new PDF which includes a ToC at
 the beginning, where each item in the ToC is hyperlinked to its
 corresponding page in the original PDF?  I see that org understands
 hyperlinks like:

   docview:papers/last.pdf::NNN

 but I'm not sure if exporting to PDF would preserve those hyperlinks,
 and even if so, when merging the generated ToC with the original PDF,
 there would need to be a way to adjust them to point within the new
 merged file.

I found a solution:

http://unix.stackexchange.com/questions/97695/generate-a-hyperlinked-table-of-contents-and-insert-into-existing-pdf



[O] generating ToC for existing PDF?

2013-10-26 Thread Adam Spiers
Hi all,

I have an existing PDF, along with a text file table of contents.  Is
it possible to use org to generate a new PDF which includes a ToC at
the beginning, where each item in the ToC is hyperlinked to its
corresponding page in the original PDF?  I see that org understands
hyperlinks like:

  docview:papers/last.pdf::NNN

but I'm not sure if exporting to PDF would preserve those hyperlinks,
and even if so, when merging the generated ToC with the original PDF,
there would need to be a way to adjust them to point within the new
merged file.

Thanks,
Adam



[O] org-mode and long lines alerting

2013-10-23 Thread Adam Spiers
Hi all,

I recently configured my emacs with visual alerts for lines longer
than (say) 80 columns.  I used two mechanisms for this:

  1. the built-in `whitespace-mode', with `whitespace-style' including
 the 'lines-tail symbol

  2. the fill-column-indicator package, which draws a vertical line
 at the 80th column

Unfortunately, neither work well with org-mode:

  1. `whitespace-mode' isn't smart enough to realise that a hyperlink
 [[http://foo][bar]] only occupies 3 columns of visual display, so
 it counts every character as occupying a column, leading to the
 `whitespace-line' face being used to highlight more of the end of
 the line than it should.

  2. fill-column-indicator only displays the vertical line for
 fully visible subtrees

I don't know how the display magic in org-mode works, so unfortunately
I've no idea how to address this.  Any help gratefully received!

Thanks,

Adam



[O] different toc levels per headline?

2013-09-26 Thread Adam Spiers
Hi all,

If I have something like:

#+OPTIONS: toc:1

* h1 no options
*** h2
* h3
* h1 toc:2
  :PROPERTIES:
  :EXPORT_OPTIONS: toc:2
  :END:
*** h2
* h3
* h1 toc:3
  :PROPERTIES:
  :EXPORT_OPTIONS: toc:3
  :END:
*** h2
* h3

I would expect a ToC which looks like:

Table of Contents
_

1 h1 no options
2 h1 toc:1
.. 2.1 h2
3 h1 toc:2
.. 3.1 h2
. 3.1.1 h3

In otherwise, I would expect the EXPORT_OPTIONS in the subtrees to
override the file-wide setting for `toc'.  This expectation is based
on what the manual says:

Export options can be set: globally with variables; for an
individual file by making variables buffer-local with in-buffer
settings (*note In-buffer settings::), by setting individual
keywords, or by specifying them in a compact form with the
`#+OPTIONS' keyword; or for a tree by setting properties (*note

Properties and Columns::).  Options set at a specific level
override options set at a more general level.

However instead I get:

Table of Contents
_

1 h1 no options
2 h1 toc:1
3 h1 toc:2

What am I missing, and is there another way to vary the toc level per
subtree?

Thanks!
Adam



Re: [O] different toc levels per headline?

2013-09-26 Thread Adam Spiers
Hi Carsten,

On Thu, Sep 26, 2013 at 01:15:56PM +0200, Carsten Dominik wrote:
 Hi Adam,
 
 EXPORT_OPTIONS are for the special case that you only export that
 specific subtree, by restricting the export to a tree using C-s in
 the dispatcher.  They do not modify the behavior of a tree in a
 larger export of the document, and they also should not do so IMO.

Thanks a lot for the reply.  However, what you say seems to directly
contradict this sentence in the manual:

Options set at a specific level override options set at a more
general level.

which is why this confused me.  I guess that sentence was intended to
refer only to subtree exports, not whole document exports, but that
meaning was not clear to me.  Perhaps it can be clarified via a small
tweak?

 Generating a single document should follow one set of rules, not
 many.

I agree that KISS is valuable when designing the rules.  However, it
also seems a perfectly reasonable requirement to be able to control
the toc: level per subtree during a whole document export, since in an
arbitrary document there's no guarantee that every headline has the
same depth.  E.g. one chapter may have a few deep subsections, whereas
another may contain lots of shallow subsections.  In these scenarios
it is clearly beneficial to allow the author to choose which
subsections appear in the ToC.

So is there a way of achieving this?  If not, please consider this a
feature request ;-)

Thanks!
Adam



Re: [O] different toc levels per headline?

2013-09-26 Thread Adam Spiers
On Thu, Sep 26, 2013 at 04:24:57PM +0200, Nicolas Goaziou wrote:
 Carsten Dominik carsten.domi...@gmail.com writes:
  On 26.9.2013, at 14:16, Adam Spiers orgm...@adamspiers.org wrote:
  Thanks a lot for the reply.  However, what you say seems to directly
  contradict this sentence in the manual:
  
 Options set at a specific level override options set at a more
 general level.
  
  which is why this confused me.  I guess that sentence was intended to
  refer only to subtree exports, not whole document exports, but that
  meaning was not clear to me.
 
  I think it means this in general, but I also think that toc creation
  is done at a global level, and not recursive in the tree.  Maybe Nicolas
  has an authoritative answer on this one.
 
 Not really. For the record, the full paragraph is:
 
   Export options can be set: globally with variables; for an individual
   file by making variables buffer-local with in-buffer settings, by
   setting individual keywords, or by specifying them in a compact form
   with the '#+OPTIONS' keyword; or for a tree by setting properties.
   Options set at a specific level override options set at a more general
   level.

Right, I quoted that in my original post :-)

 There are three ways (four if you use a subtree export) to tweak export
 settings. The last sentence means that more specific ways have
 precedence over more general ones. IOW:
 
   #+OPTIONS or #+KEYWORDS  variables
 
 and in the case of a subtree export:
 
   Properties  #+OPTIONS or #+KEYWORDS  variables

Sure, I understood that.  But AFAICS it doesn't provide a way of
controlling the depth of headings within the ToC _per_heading_,
which as I suggested in my previous email shouldn't be a particularly
rare use case.

Cheers,
Adam



Re: [O] managing a work log

2013-09-21 Thread Adam Spiers
Hi Bastien,

Sorry for the incredibly delayed response to this ...

On Sun, Jun 30, 2013 at 11:22:41PM +0200, Bastien wrote:
 Adam Spiers orgm...@adamspiers.org writes:
  With `org-archive-mark-done' set to `t', entries will be marked as
  done when `org-archive-subtree' is invoked.  However, this does not
  honour the expected behaviour when `org-log-done' is set to `'time',
  i.e. that a `CLOSED: [timestamp]' line will be inserted just after the
  headline.  Is that a bug/feature, or am I missing something?
 
 I get the same behavior but there is a ARCHIVE_TIME property,
 which tells you what time the entry was archived-and-marked-done.
 Why would you want redundant information with a CLOSED timestamp
 here?  Are you handling the CLOSED cookie in a specific way?

ARCHIVE_TIME is not honoured by log-mode.  I have a custom agenda
command which sets org-agenda-start-with-log-mode to '(closed clock)
and org-agenda-entry-types to '(:timestamp :sexp), so that I can
easily create a weekly work report to mail out to my team.  The CLOSED
cookie is required in order for DONE items to appear in this report.



Re: [O] org-capture doesn't narrow correctly if :prepend is t

2013-09-16 Thread Adam Spiers
On 2 September 2013 18:51, Adam Spiers orgm...@adamspiers.org wrote:
 I have an org-capture template as follows:

  (n personal NEXT entry
   (file ~/org/TODO.org)
   * NEXT %? :prepend t)

 but after I hit `C-c C-c', the file's buffer stays narrowed, with the
 new entry invisible.  Anyone who didn't notice the presence of
 'Narrow' in the modeline would be convinced that the capture
 completely failed.  It can be revealed via `C-u C-x n w', but of
 course it's annoying having to do this every time.

 The problem vanishes as soon as I de-select the :prepend flag.  It's
 been an issue for a while, so I guess I'm the only one using this
 flag?

Judging by the lack of response, it seems noone else uses :prepend :-/
It's enough of an itch that I am happy to scratch / fix it myself, but
it would be great if someone could give me a few quick pointers on how
org-capture uses narrowing - otherwise it could take me quite a lot of
time and pain to understand it by myself ...

Thanks!
Adam



Re: [O] org-capture doesn't narrow correctly if :prepend is t

2013-09-16 Thread Adam Spiers
On 16 September 2013 12:59, Carsten Dominik carsten.domi...@gmail.com wrote:
 Hi Adam,

 it is in my queue, but I have not yet had time to look at it.

Oh great, thanks a lot Carsten!  I can wait patiently - even with a wait,
you can almost certainly fix it quicker than I could ;-)



[O] org-capture doesn't narrow correctly if :prepend is t

2013-09-02 Thread Adam Spiers
I have an org-capture template as follows:

 (n personal NEXT entry
  (file ~/org/TODO.org)
  * NEXT %? :prepend t)

but after I hit `C-c C-c', the file's buffer stays narrowed, with the
new entry invisible.  Anyone who didn't notice the presence of
'Narrow' in the modeline would be convinced that the capture
completely failed.  It can be revealed via `C-u C-x n w', but of
course it's annoying having to do this every time.

The problem vanishes as soon as I de-select the :prepend flag.  It's
been an issue for a while, so I guess I'm the only one using this
flag?

Thanks!
Adam



[O] managing a work log

2013-06-12 Thread Adam Spiers
Hi all,

With `org-archive-mark-done' set to `t', entries will be marked as
done when `org-archive-subtree' is invoked.  However, this does not
honour the expected behaviour when `org-log-done' is set to `'time',
i.e. that a `CLOSED: [timestamp]' line will be inserted just after the
headline.  Is that a bug/feature, or am I missing something?

Thanks,
Adam



Re: [O] Sync Org with Google Calendar using google API (rather than caldav)

2013-04-08 Thread Adam Spiers
Thanks a lot for the info!  I agree that natively talking to the JSON API
is a nice feature :)

On 2 April 2013 08:17, Baptiste Fouques bate...@bat.fr.eu.org wrote:
 Adam Spiers orgmode at adamspiers.org writes:

 Sounds interesting.  It would be very helpful if you could explain how it is
 different from the other synchronization possibilities out there, e.g.

 http://orgmode.org/worg/org-tutorials/org-google-sync.html
 https://code.google.com/p/emacs-google/
 https://github.com/travisbhartwell/Emacs-Google-Calendar-Sync
 http://www.emacswiki.org/emacs/GoogleClient

 two  main things  make  my sync  different  (also  this does  not  make it  
 more
 interesting ;)
 - it does not rely on external command
 - it does not rely on ics

 I always found that relying on  external commands makes thing more complex : 
 you
 have to  configure that command, in  its configuration file or  through 
 scripted
 call by passing right arguments, and then you have to integrate it in your 
 Emacs
 workflow.

 Using command in Emacs, configured  through convenient customization group is 
 so
 natural …

 Then, my sync. uses Google json API (and authentification using oauth, stored 
 in
 crypted file, for no secret in your  config file or anywhere else). This make 
 it
 by far less  portable. But, with Google dropping standards,  or juts 
 maintaining
 it at  there minimal  level, it makes  it more  close to what  you can  get 
 from
 Google calendar and events.

 Also using  elisp Json library is  so easy and  robust in regard to  parsing 
 ics
 files that it sounds very natural to use it.

 I don't  mean it is  better than caldav  sync tools, but  that I could  not 
 find
 myself satisfied  with those  tools, worried  about Google  call to  drop 
 caldav
 compatibility,  that  I  feel  I  need   something  more  close  to  Google  
 API
 possibilities. Then I  started it, and just  offer to share (that  how it 
 works,
 right ? ;)

 Thanks for the work of the community,

 Bat.






Re: [O] org-capture equivalent of org-remember's % ?

2013-03-30 Thread Adam Spiers
Bastien,

You are amazing.  That is all. :)

Greetings from the awesome #emacsconf,
Adam

On 30 March 2013 14:44, Bastien b...@altern.org wrote:
 Hi Adam,

 Adam Spiers orgm...@adamspiers.org writes:

 I'm finally switching from org-remember to org-capture.  M-x
 org-capture-import-remember-templates works fine except that it
 doesn't know how to translate %, which causes a jump to the target
 location immediately after storing the note.  Is there an org-capture
 equivalent of org-remember's % ?

 You can now use :jump-to-captured in your template.

 Thanks for reporting this regression,

 --
  Bastien



Re: [O] Sync Org with Google Calendar using google API (rather than caldav)

2013-03-29 Thread Adam Spiers
On 29 March 2013 11:03, Baptiste bate...@bat.fr.eu.org wrote:
 Hi,

 I have started a google calendar synchronization Emacs module. Rather than
 using ical format, I use directly Google API. For sure it is less usefull for
 other calendar services, but it will keep working when Google is stopping
 supporting caldav.


 For now, only fetch from Google is implemented, but extension (then push and
 sync) should be quiet easy to manage.


 You will find it here (github).


 If this can be usefull for you,

Sounds interesting.  It would be very helpful if you could explain how it is
different from the other synchronization possibilities out there, e.g.

http://orgmode.org/worg/org-tutorials/org-google-sync.html
https://code.google.com/p/emacs-google/
https://github.com/travisbhartwell/Emacs-Google-Calendar-Sync
http://www.emacswiki.org/emacs/GoogleClient



[O] org-capture equivalent of org-remember's % ?

2013-03-29 Thread Adam Spiers
Hi all,

I'm finally switching from org-remember to org-capture.  M-x
org-capture-import-remember-templates works fine except that it
doesn't know how to translate %, which causes a jump to the target
location immediately after storing the note.  Is there an org-capture
equivalent of org-remember's % ?

Thanks,
Adam



Re: [O] mobile-org, webdav, can't push (password not accepted)

2012-08-18 Thread Adam Spiers
Hi James,

On Sun, Jul 15, 2012 at 8:18 PM, James Harkins jamshar...@gmail.com wrote:
 At Sat, 14 Jul 2012 12:05:16 -0400,
 James Harkins wrote:

 Hi, I need a little help with mobile-org and webdav. (I need to use webdav 
 because I live year-round in China, and the last time I tried, dropbox was 
 not accessible from the mainland. In any case, I prefer to keep the data 
 local.)

 Okay... the original question isn't solved (webdav server is still not 
 working) but I did just discover that MobileOrg for android supports Ubuntu 
 One as an alternative to dropbox. I don't see any coverage online about that 
 service being blocked in China (whereas there are tons of stories about 
 dropbox), so I guess it's going to be okay. (If not, that would cause a bit 
 of panic as I look for an alternative...)

 It would be worth an update to the manual to list the other sync options. 
 Dropbox or WebDAV sent me on a wild goose chase.

I already provided an answer to this issue on your stackoverflow
question but I'm not sure you noticed:

http://stackoverflow.com/questions/11486719/orgmode-cant-authenticate-to-webdav-for-mobile-org-push/11974188#11974188

I'm pretty sure you're getting confused between ssh and webDAV
passwords.  I agree that with the docstrings as they are, this is a
very easy mistake to make.



Re: [O] MobileOrg, webdav, correct use of org-mobile-directory?

2012-08-18 Thread Adam Spiers
Hi all,

I think some confusion has (quite understandably) arisen in this
thread about how the org-mobile + webDAV + tramp + scp combination is
supposed to work.  At risk of getting it all wrong and looking like a
fool, I *think* I can help explain :-)

On Sun, Aug 12, 2012 at 2:11 PM, Nick Dokos nicholas.do...@hp.com wrote:
 James Harkins jamshar...@gmail.com wrote:
  For my immediate needs, I think I can do without scp, since org-mode
  and Apache are on the same machine.

Correct.

  The broader point is about the
  documentation. It says do it this way but this way doesn't work.

It definitely *can* work (I have it working, finally), but there are
various pitfalls - see below.

 I read the page on worg and I agree it's unclear: it talks about using
 webdav and then does not use webdav at all, just scp.

Yes, it's unclear.  The reason it talks about webDAV is that this is
how the mobile clients (well, Android at least) read and write files.
So when it refers to the webDAV directory, it actually means a
directory on a server which will be read from and written to by *both*
webDAV (on your mobile device) *and* tramp+scp (from emacs on your
computer).

That was the crux of the confusion described here:

  
http://stackoverflow.com/questions/11486719/orgmode-cant-authenticate-to-webdav-for-mobile-org-push/

so from emacs, you should use your ssh password, even though the
intended remote target directory is (also) served via webDAV.

For most people, their mobile device cannot reach their computer
(e.g. home computer behind a NAT firewall) when roaming, which means
that the webDAV server needs to be publically accessible via the
internet.  In this case, org-mobile-directory should be a tramp path
beginning /scp

But for other people such as James, the webDAV server runs on the same
machine where they edit their org files.  In this case,
org-mobile-directory can point directly at the path on the local file
system, and there is no need to use tramp.

 But I don't agree that it does not work: I've done a minimal setup
 with scp and tramp and org-mobile-push/pull worked fine for me. I
 suspect that you are still having some setup problems as indicated
 in my other email.

Yes, and I can hazard a guess what it might be, because I just got
bitten by a similar issue :-)  org-mobile-push was working for me when
invoked via emacs run in batch mode from a shell script, but not
in my running emacs instance.  I noticed that

  (file-exists-p org-mobile-directory)

was returning nil in the running emacs instance, which seemed to imply
that org-mobile-directory must refer to a path on the local
filesystem, but I knew that must be wrong otherwise it couldn't be
working in batch mode.  Eventually I had a light bulb moment where I
realised that tramp intercepts functions like file-exists-p, which is
how the above can return non-nil even for values of
org-mobile-directory beginning with /scp  As a result I finally
traced the answer to a corrupt tramp cache entry.  Once I cleared the
cache:

  (setq tramp-cache-data (make-hash-table :test 'equal))

the error

  Variable `org-mobile-directory' must point to an existing directory

finally went away!

org-mobile-directory: /scpc:**user**@localhost:80/webdav/
  
   This looks wrong

Yes, it doesn't make sense to use tramp to scp files to localhost :-)

 Your other email shows that you figured this out.

  2. This destination is modeled on the docs, so if it's wrong, then so is 
  the doc.

 Not really: the destination in the doc does not specify the port (80).
 That's the HTTP port, so scp won't work with that - that's what I picked
 up when I said it looked wrong. It needs the sshd port (22 by default
 and implied if you leave it out of the scp path in tramp).

Right, but scp'ing to localhost doesn't make sense.  He should just
use the normal local filesystem path instead and skip tramp.

   Where does org-mobile-directory point to if not the physical location
   of the webdav share? The tramp stuff doesn't know or care about webdav
   at all: it is just the mechanism that copies files from your local
   machine to some other machine, so it needs to know exactly where to copy
   it to.
 
  Well, it almost looks to me like org-mobile-directory is asked to
  do two things at once: specify the scp syntax *and* hold a path
  that can be resolved on the local file system. This is the source
  of my confusion.

Hopefully by now I've cleared that up for you :-) It can *either* be
an scp/tramp reference to a remote location, or a normal path to a
local location.  It's never expected to be both at once :-)

 You mean the remote file system I think, but that's true: it does
 specify the protocol (scp) and the path. I think your confusion is that
 you also wanted it to be the webdav path and it just cannot be that.

In his case, there is no remote, because his Apache/webDAV server is on
the local machine.

  At best, the docs are unclear.

 Yup.

  No matter for me. I'll just 

[O] [PATCH] Document ID special property.

2012-05-17 Thread Adam Spiers
* doc/org.texi: add ID to the list of special properties.
---
 doc/org.texi |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 4c48a03..ab8fb67 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -4926,6 +4926,7 @@ column view (@pxref{Column view}), or to use them in 
queries.  The following
 property names are special and (except for @code{:CATEGORY:}) should not be
 used as keys in the properties drawer:
 
+@cindex property, special, ID
 @cindex property, special, TODO
 @cindex property, special, TAGS
 @cindex property, special, ALLTAGS
@@ -4942,6 +4943,8 @@ used as keys in the properties drawer:
 @cindex property, special, ITEM
 @cindex property, special, FILE
 @example
+ID   @r{A globally unique ID used for synchronization during}
+ @r{iCalendar or MobileOrg export.}
 TODO @r{The TODO keyword of the entry.}
 TAGS @r{The tags defined directly in the headline.}
 ALLTAGS  @r{All tags, including inherited ones.}
-- 
1.7.8.206.g71406




[O] [PATCH] Fix typo in manual index's description of the 'Hooks' section

2012-05-17 Thread Adam Spiers
* doc/org.texi: Fix typo in description of the 'Hooks' section
---
 doc/org.texi |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 4c48a03..d6a4353 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -741,7 +741,7 @@ Interaction with other packages
 
 Hacking
 
-* Hooks::   Who to reach into Org's internals
+* Hooks::   How to reach into Org's internals
 * Add-on packages:: Available extensions
 * Adding hyperlink types::  New custom link types
 * Context-sensitive commands::  How to add functionality to such commands
@@ -15310,7 +15310,7 @@ This appendix covers some aspects where users can 
extend the functionality of
 Org.
 
 @menu
-* Hooks::   Who to reach into Org's internals
+* Hooks::   How to reach into Org's internals
 * Add-on packages:: Available extensions
 * Adding hyperlink types::  New custom link types
 * Context-sensitive commands::  How to add functionality to such commands
-- 
1.7.8.206.g71406




[O] [PATCH] Add hyperlink to Org website from HTML export footer

2012-05-17 Thread Adam Spiers
* lisp/org-html.el: add hyperlink to http://orgmode.org/ from export footer
---
 lisp/org-html.el |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index bcbad61..03c39e8 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1857,7 +1857,8 @@ PUB-DIR is set, use this as the publishing directory.
 (insert p class=\email\ email /p\n))
   (when (plist-get opt-plist :creator-info)
 (insert p class=\creator\
-(concat Org version  (org-version)  with Emacs 
version 
+(concat a href=\http://orgmode.org/\;Org/a 
version 
+(org-version)  with Emacs version 
 (number-to-string emacs-major-version) 
/p\n)))
   (insert html-validation-link \n))
  (t
-- 
1.7.8.206.g71406




[O] [PATCH] Fix (wrong-type-argument integer-or-marker-p nil) in org-agenda-get-todos.

2012-03-04 Thread Adam Spiers
org-get-category can sometimes invoke org-refresh-category-properties
which can perform a re-search-forward which destroys the existing
match data.  When called from org-agenda-get-todos, this can result in
its subsequent call to (match-beginning 2) to return nil, which when
passed as the first parameter to buffer-string causes the above error.
---
 lisp/org-agenda.el |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ac1b5b1..4efb332 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4664,10 +4664,11 @@ the documentation of `org-diary'.
(or org-agenda-todo-list-sublevels (org-end-of-subtree 'invisible))
(throw :skip nil)))
(goto-char (match-beginning 2))
-   (setq marker (org-agenda-new-marker (match-beginning 0))
- category (org-get-category)
- org-category-pos (get-text-property (point) 
'org-category-position)
- txt (org-trim
+   (setq marker (org-agenda-new-marker (match-beginning 0)))
+   (save-match-data
+ (setq category (org-get-category)
+   org-category-pos (get-text-property (point) 
'org-category-position)))
+   (setq txt (org-trim
   (buffer-substring (match-beginning 2) (match-end 0)))
  tags (org-get-tags-at (point))
  txt (org-agenda-format-item  txt category tags)
-- 
1.7.8.206.g71406




[O] [PATCH] Fix typos

2012-03-04 Thread Adam Spiers
---
 lisp/org-agenda.el |2 +-
 lisp/org-list.el   |2 +-
 lisp/org.el|2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 4efb332..7b4bc04 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -408,7 +408,7 @@ where
 
 desc   A description string to be displayed in the dispatcher menu.
 cmdAn agenda command, similar to the above.  However, tree commands
-   are no allowed, but instead you can get agenda and global todo list.
+   are not allowed, but instead you can get agenda and global todo list.
So valid commands for a set are:
(agenda \\ settings)
(alltodo \\ settings)
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 531cdd5..b865aed 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -207,7 +207,7 @@ Valid values are ?. and ?\).  To get both terminators, use 
t.
   :group 'org-plain-lists
   :type '(choice (const :tag dot like in \2.\ ?.)
 (const :tag paren like in \2)\ ?\))
-(const :tab both t)))
+(const :tag both t)))
 
 (defcustom org-alphabetical-lists nil
   Non-nil means single character alphabetical bullets are allowed.
diff --git a/lisp/org.el b/lisp/org.el
index 859748a..22d2208 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6844,7 +6844,7 @@ This command works around this by showing a copy of the 
current buffer
 in an indirect buffer, in overview mode.  You can dive into the tree in
 that copy, use org-occur and incremental search to find a location.
 When pressing RET or `Q', the command returns to the original buffer in
-which the visibility is still unchanged.  After RET is will also jump to
+which the visibility is still unchanged.  After RET it will also jump to
 the location selected in the indirect buffer and expose the headline
 hierarchy above.
   (interactive P)
-- 
1.7.8.206.g71406




[O] [PATCH] org-clock-modify-effort-estimate: display a message when no clock is active

2012-03-04 Thread Adam Spiers
---
 lisp/org-clock.el |   57 +++--
 1 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 9206608..1613f77 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -563,39 +563,40 @@ previous clocking intervals.
 (+ currently-clocked-time (or org-clock-total-time 0
 
 (defun org-clock-modify-effort-estimate (optional value)
- Add to or set the effort estimate of the item currently being clocked.
+  Add to or set the effort estimate of the item currently being clocked.
 VALUE can be a number of minutes, or a string with format hh:mm or mm.
 When the string starts with a + or a - sign, the current value of the effort
 property will be changed by that amount.
 This will update the \Effort\ property of currently clocked item, and
 the mode line.
- (interactive)
- (when (org-clock-is-active)
-   (let ((current org-clock-effort) sign)
- (unless value
-   ;; Prompt user for a value or a change
-   (setq value
-(read-string
- (format Set effort (hh:mm or mm%s): 
- (if current
- (format , prefix + to add to %s org-clock-effort)
-   )
- (when (stringp value)
-   ;; A string.  See if it is a delta
-   (setq sign (string-to-char value))
-   (if (member sign '(?- ?+))
-  (setq current (org-duration-string-to-minutes current)
-value (substring value 1))
-(setq current 0))
-   (setq value (org-duration-string-to-minutes value))
-   (if (equal ?- sign)
-  (setq value (- current value))
-(if (equal ?+ sign) (setq value (+ current value)
- (setq value (max 0 value)
-  org-clock-effort (org-minutes-to-hh:mm-string value))
- (org-entry-put org-clock-marker Effort org-clock-effort)
- (org-clock-update-mode-line)
- (message Effort is now %s org-clock-effort
+  (interactive)
+  (if (org-clock-is-active)
+  (let ((current org-clock-effort) sign)
+   (unless value
+ ;; Prompt user for a value or a change
+ (setq value
+   (read-string
+(format Set effort (hh:mm or mm%s): 
+(if current
+(format , prefix + to add to %s org-clock-effort)
+  )
+   (when (stringp value)
+ ;; A string.  See if it is a delta
+ (setq sign (string-to-char value))
+ (if (member sign '(?- ?+))
+ (setq current (org-duration-string-to-minutes current)
+   value (substring value 1))
+   (setq current 0))
+ (setq value (org-duration-string-to-minutes value))
+ (if (equal ?- sign)
+ (setq value (- current value))
+   (if (equal ?+ sign) (setq value (+ current value)
+   (setq value (max 0 value)
+ org-clock-effort (org-minutes-to-hh:mm-string value))
+   (org-entry-put org-clock-marker Effort org-clock-effort)
+   (org-clock-update-mode-line)
+   (message Effort is now %s org-clock-effort))
+(message Clock is not currently active)))
 
 (defvar org-clock-notification-was-shown nil
   Shows if we have shown notification already.)
-- 
1.7.8.206.g71406




[Orgmode] meaning of ampersand in spreadsheet cell references

2010-09-09 Thread Adam Spiers
Hi all,

The manual refers fleetingly to the use of ampersand in spreadsheet
cell references.  Amongst other cell reference examples, it lists:

 $5column 5 in the current row
 Esame as previous

The only other mention I can find is:

  When offering a formula for editing, Org converts references to the
  standard format (like `B3' or `D') if possible.

I assume this means that ampersand can replace the number in cell
references of the format `B3' to means the current row?  However
this doesn't seem to tie in with any of the other syntax listed, and
therefore maybe warrants a slightly more explicit explanation in the
manual?

Thanks!
Adam

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Beamer support in Org-mode

2009-12-18 Thread Adam Spiers
On Tue, Dec 15, 2009 at 04:49:23PM -0300, Darlan Cavalcante Moreira wrote:
 In addition, while I also agree that footnotes shouldn't be in a presentation
 they are allowed when working with beamer and may be useful in some cases. If
 org-mode export footnotes as beamer notes then some months from now someone
 would be asking here in the mailing-list how to enter a standard footnote when
 exporting to beamer.

I agree - unfortunately there are genuinely sensible uses of footnotes
in presentations.  For example, citation of sources for quotations,
data etc. is ideally accomplished by footnotes: they are not used
during the presentation itself, but by distributing paper and/or
electronic copies after the talk, footnotes provide essential
reference data for perusal by the audience at a later date.

Imagine a slide showing the results of a benchmark, claiming X is
much faster than Y!  You might want to talk briefly about how the
results were obtained, and about the impact of the results, but you
would also need to be able to tell the audience they could
independently verify the results by obtaining a copy of the slides and
visiting the URL contained in the footnote - especially if the results
are controversial!  In this case, it would not matter that the URL was
too small to be legible from the back of the room.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Beamer support - 2nd round

2009-12-18 Thread Adam Spiers
On Mon, Dec 14, 2009 at 09:11:49AM +0100, Carsten Dominik wrote:
 On Dec 10, 2009, at 10:32 PM, Adam Spiers wrote:
 2.2 Frames
 ===
 
 The BEAMER_FRAME_LEVEL setting governs which levels become frames.  If
 that option is set to 0, then frames are only created by setting the
 `BEAMER_env' property of an entry to the value `frame'.
 
 The heading of the entry will become the frame title.  If the frame
 title contains the string `\\', the line will be split at that
 location, and the second half will become the frame /subtitle/.  If
 you need a line break in the frame title, use `\newline' or
 `\linebreak'.
 
 If the frame title is long enough to require a line break, most likely
 it will start creeping over the right-hand margin of the emacs frame
 during editing.  Consequently anything which can save a few columns
 might be helpful, so how about allowing \n to mean the same as
 \newline ?
 
 I am not sure I'd like this as a default, because the used of \n may
 be many including in source code examples

Hmm, it seems quite unlikely you'd need a literal \n in the frame
*title*, but it's possible I guess ...

 but why don't you just do this:
 
 (defun my-make-backslash-n-mean-newline ()
   (save-excursion
 (goto-char (point-min))
 (replace-regexp n\\ newline)))
 (add-hook 'org-export-preprocess-hook
   'my-make-backslash-n-mean-newline)

That's cool, thanks :-)  I don't have a strong need for this, but was
just suggesting it as an idea to help promote the legibility and ease
of entry of org-beamer source code.

Thanks,
Adam


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: OrgmodeWiki Support

2009-12-18 Thread Adam Spiers
On Wed, Dec 09, 2009 at 09:38:42AM -0800, Wes Hardaker wrote:
  On Sun, 6 Dec 2009 23:23:35 +0100, Marc li...@barisch.com said:
 
 M If I got it right, this is not completly implemented (e.g. nested
 M bullet lists are not supported).  Are there plans to complete the
 M export function? IMHO, this is a really good feature that might save
 M a lot of time.
 
 I actually almost implemented bullet-parsing yesterday for
 org-export-generic, but in the end I was swamped with other things to
 do.
 
 So yes, I'd like to see it done.  But no, it's not done currently...
 
 M Are there plans to do it vice versa, i.e. translate from wiki syntax
 M to org-mode ?
 
 That'd certainly be helpful as well.  I don't know of anyone with plans
 though (maybes someone else does)

I would *love* to see auto-linking of WikiWords as a customisable
option.  I'm not sure if anyone's looked at supporting WikiWords yet.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] RFC on enhancement for org-cancel-clock with no active clock

2009-12-18 Thread Adam Spiers
Currently org-cancel-clock just warns 'No active clock' when there is
no active clock.  Would it make sense to extend the behaviour in that
case so that it interactively prompts whether you would like to remove
the most recently active clock entry?  This would be a nice kind of
'undo' in the case where you clock out when you actually meant to
cancel the active clock.

Thanks,
Adam


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] resolving idle time after accidentally cancelling prompt

2009-12-18 Thread Adam Spiers
Hi there,

The `org-clock-idle-time' feature is really fantastic.  However I
occasionally miss the [(kK)eep (sS)ubtract (C)ancel] prompt in the
minibuffer and press another key which cancels it; then I have to run
org-resolve-clocks manually.  I can imagine a scenario where I
mistakenly thought that the window manager focus was in another
window, started typing, accidentally cancelled the prompt, and never
even noticed it was there in the first place - resulting in a
permanently dangling clock.  Would it be worth making this code
idiot-proof ...

(if (or (null ch)
(not (memq ch '(?k ?K ?s ?S ?C
(message )

.. so that the only way to cancel the prompt is to press `C' ?  It
would also be nice if upon cancellation it did

  (message Use `M-x org-resolve-clocks' to resolve dangling clocks at any 
time.)

Thanks,
Adam


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: OrgmodeWiki Support

2009-12-18 Thread Adam Spiers
On Fri, Dec 18, 2009 at 01:15:59PM +0100, Carsten Dominik wrote:
 On Dec 18, 2009, at 12:28 PM, Adam Spiers wrote:
 I would *love* to see auto-linking of WikiWords as a customisable
 option.  I'm not sure if anyone's looked at supporting WikiWords yet.
 
 Where should the link go?  To a file WikiWord.org?  Or doing an
 etags search?

To a file WikiWord.org would cater for the majority of my needs.
Would be even cooler if you could specify a list of directories as a
search path, where each directory was either absolute or relative to
the current file!

Maybe others could make use of an etags option too; I'm not sure.  I
guess you might then need a custom function to translate the WikiWord
into a tag to lookup, since a lot of tags are not CamelCase.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: FR: org-remember shortcut to customize-option org-remember-templates

2009-12-17 Thread Adam Spiers
On Wed, Dec 16, 2009 at 05:33:44PM +0100, Tassilo Horn wrote:
 Adam Spiers orgm...@adamspiers.org writes:
 
  I really like the way `M-x org-agenda C' takes you straight to the
  *Customize Option: Org Agenda Custom Commands* buffer.  Similarly, it
  would be nice if `M-x org-remember C' took you straight to the
  *Customize Option: Org Remember Templates* buffer.
 
 But what if I have a org-remember-template assigned to the ?C character?

I addressed that in the sentence you chopped from the end of your
quote :-)


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] FR: org-remember shortcut to customize-option org-remember-templates

2009-12-16 Thread Adam Spiers
I really like the way `M-x org-agenda C' takes you straight to the
*Customize Option: Org Agenda Custom Commands* buffer.  Similarly, it
would be nice if `M-x org-remember C' took you straight to the
*Customize Option: Org Remember Templates* buffer.

Although in both cases it would be even nicer if the keystroke for
this was customisable, as no doubt some people already have `M-x
org-remember C' set up to do something else.

Thanks,
Adam


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] FR: org-hide-context

2009-12-16 Thread Adam Spiers
It would be great to have an opposite to `org-reveal' which folded all
siblings, ancestors, and maybe even all ancestors' siblings of the
current headline.  A suitable key-binding might be C-u C-u C-c C-r
or similar.

Thanks,
Adam


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Mobile org

2009-12-10 Thread Adam Spiers
On Sat, Oct 03, 2009 at 09:25:24AM +0300, [AvataR] wrote:
 I have emacs-23 on n810, tuned for rather quick start with dumps,
 cleaning and other stuff :) Not
 perfect, because of absent of normal virtual keyboard, and LOooOOoww
 memory (emacs-server get about 6-7%), but usable. Also emacs requires some
 tuning for using on RX-44 keyboard (M-x - M-+, wmctrl, etc), and with
 org. I sync my stations with mercurial. I think we must write simple
 client for org-db for opensync, or something in that way - normally
 emacs on portable devices works quite sloow. Or maybe we can do
 clear emacs-org application? (%
 
 Some screenshots:
 
 http://img188.imageshack.us/img188/1055/gnus.png
 http://img44.imageshack.us/img44/4656/menux.png
 http://img43.imageshack.us/img43/1610/emacsgeneral.png

Ooh, very nice!  Would *love* to hear how you got emacs 23 on there,
and more details on the tuning and tweaks you did ...


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Beamer support - 2nd round

2009-12-10 Thread Adam Spiers
On Thu, Dec 03, 2009 at 05:10:44PM +0100, Carsten Dominik wrote:
 Dear all,
 
 after carefully listening to all your comments and thinking
 things through more thoroughly, here is now my second attempt
 to define beamer support in Org-mode.

[snipped]

This is very exciting :-)  Just one comment for now:

 2.2 Frames
 ===
 
 The BEAMER_FRAME_LEVEL setting governs which levels become frames.  If
 that option is set to 0, then frames are only created by setting the
 `BEAMER_env' property of an entry to the value `frame'.
 
 The heading of the entry will become the frame title.  If the frame
 title contains the string `\\', the line will be split at that
 location, and the second half will become the frame /subtitle/.  If
 you need a line break in the frame title, use `\newline' or
 `\linebreak'.

If the frame title is long enough to require a line break, most likely
it will start creeping over the right-hand margin of the emacs frame
during editing.  Consequently anything which can save a few columns
might be helpful, so how about allowing \n to mean the same as
\newline ?


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: Running debian + emacs on my Android G1 [was: [Orgmode] emacs + orgmode on Ubuntu on Android G1]

2009-11-28 Thread Adam Spiers
[sorry this is getting a little off-topic for non-Android users]

On Sat, Nov 28, 2009 at 02:02:06PM +0100, Friedrich Delgado Friedrichs wrote:
 Hi!
 
 I just upgraded (!) my G1 to CyanogenMod yesterday, because I want to
 try out emacs on it, too.
 
 I must say CyanogenMod rocks! It's much more snappy than the stock
 build and the things you can do with it really rock (running debian on
 my phone is so cool) ;)

I agree!  I just upgraded mine to CyanogenMod too, although it's not
required; I was quite happily running emacs and Ubuntu on an older
JesusFreke firmware before.

 Adam Spiers schrieb:
  On Wed, Nov 04, 2009 at 04:01:11PM +0900, Torsten Wagner wrote:
  Sorry for the slow reply.  I don't have time to go into exact details
  but I updated this page:
  
http://www.emacswiki.org/emacs/EmacsOnAndroid
 
 The debian installer you link to on the wiki is technically very
 unsound. If you look at the installer.sh and debootstrap scripts
 you'll see that they are full of magical thinking, smoke and mirrors.

The Debian links were added by someone else - I've only tried the
Ubuntu image which I linked to.

 e.g. if you want debootstrap to run faster, remove all the sleep 1
 calls he inserted, maybe along with the totally fake echo messages.
 You can keep the ascii penguin logo, it's kinda neat. And doing chmod
 4755 on everything in /system/bin is plain madness. It's clear
 indication that the guy who posted that installer didn't know a bit of
 what he was doing.

 (I didn't look at the ubuntu installer.)

Yikes, 4755 certainly sounds mad - however the permissions in my
/system/bin are much saner, so presumably the ubuntu installer doesn't
do that.

 To give you a quick heads up of what I'm doing:
 
 I find the instructions in
 [[http://bayleshanks.com/tips-computer-android-g1][Bayle Shanks's
 website: tips-computer-android-g1]] technically much more sound. It's
 a bit more involved, but someone with sound experience in systems
 administration could quickly make a good installer out of his
 instructions. Yesterday it took me about 30 minutes to an hour, but
 after that I had a fresh debian install, with just the bits I wanted.
 Together with emacs and the application cache it takes about 512MB, so
 I just resized my ext2 partition to 1024MB with gparted, to make room
 for some org-mode and git goodness.
 
 Next step I'm going to do is add a non-root user, not sure how to do
 this properly, yet, and configure it to sync my config and org-mode
 files. I don't feel comfortable working as root all the time.
 
 I'll keep you posted and when I'm done with a working org-mode setup,
 I'll update the entry on the emacs wiki.

That would be great, thanks!

 I didn't run emacs yet, but I have a suspicion that it might run a
 little faster on a native ext3 partition than from an image file.

What do you mean by an image file - does yours involve some kind of
loopback?  My Ubuntu install is simply a root filesystem under
/system/sd/ubuntu (and /system/sd is native ext3) therefore a simple
chroot /system/sd/ubuntu plus mounting of /dev/pts, /proc, and /sys
inside it are sufficient to provide the Ubuntu environment.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] emacs + orgmode on Ubuntu on Android G1

2009-11-26 Thread Adam Spiers
On Wed, Nov 04, 2009 at 04:01:11PM +0900, Torsten Wagner wrote:
 Hi
 
 Looks like fantastic work, congratulations!  Thank heavens I finally
  got Ubuntu/emacs/orgmode/git running natively on my Android phone,
  otherwise I'd be green with envy ;-)
 
 
 That means you run a full emacs23 together with org-mode on your phone :o
 
  oh thanks now I'm be green with envy :P 
 
 Any docs, how-tos, screencasts, screenshots, notes, tips and tricks ?

On Mon, Nov 09, 2009 at 11:49:05AM +0530, Noorul Islam wrote:
 Can you share your experience with us?

Sorry for the slow reply.  I don't have time to go into exact details
but I updated this page:

  http://www.emacswiki.org/emacs/EmacsOnAndroid

so it should have everything you need.

It's all pretty easy really.  The hardest bit is rooting the phone and
setting up an ext2 (or ext3, I can't remember) partition on the SD
card, and even that's well documented by now.

Once you have the Ubuntu chroot image downloaded and unpacked onto
that partition, starting up Ubuntu is trivial, and then installing
emacs and org-mode is as easy as doing it on a normal Linux box :-)

I still need to try and trim down the emacs install, as it takes a
lng time to load, and the phone is already pretty short of memory
in general.  Scot already posted some ideas to this list on how to do
it; I added a link to his article from the wiki page.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] org batch job using emacsclient?

2009-11-16 Thread Adam Spiers
Hi Stefan,

On Mon, Nov 16, 2009 at 09:51:38AM +0100, Stefan Vollmar wrote:

[snipped]

 To improve performance, we want to switch to emacsclient but we are
 not sure how to adapt the above code to do this. Our first attempt:
 
 cmd = emacsclient +  --eval  \
   +  \(add-to-list 'load-path \\\ + ORGLIB + \\\)\ \
   +  \(require 'org)\ \
   +  \(require 'org-exp)\ \
   +  \(setq org-export-headline-levels 2)\ \
   +  \(load-file \\\ + orgfile + \\\)\ \
   +  \(org-export-as-html)\
 
 did not work.
 Any help is appreciated.

Can you elaborate on what you mean by did not work - what happened
exactly?

Regards,
Adam


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] the great^n grand-daddy of orgmode? :)

2009-11-14 Thread Adam Spiers
In case you haven't seen it, this is probably the first ever public
demo of outlining software in 1968:

  http://www.youtube.com/watch?v=6epbmU7_fvg

Some of the similarities to org-mode are fairly staggering - it was
also the first public demo of hyperlinks, anchors, the mouse ...

(This video is the 2nd in a series of 9.)

Enjoy :-)


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [babel] demonstration mode-switching between code blocks

2009-11-04 Thread Adam Spiers
Torsten Wagner (torsten.wag...@gmail.com) wrote:
 Hi everybody,
 
 Abstract: This is a very quick (and I assume very dirty) hack, how to switch 
 between org-mode and any other mode which you like to use in the source code 
 blocks. It is far from being addable to org-babel yet but might be a good 
 starting point.

[snipped]

 Solution: I found on emacs-wiki the minor-mode two-mode-mode.el [1] from 
 David 
 N. Welton. I was able to modify it with a minimum to allow switching between 
 org-mode and python-mode. However, other (multiple) modes should be possible 
 as well.

Thanks for sharing.  Just for reference, there are few major modes out
there implementing this kind of approach:

  http://www.emacswiki.org/emacs/MultipleModes

For example I have used mmm-mode to good effect in the past, to
auto-switch between HTML and Perl:

  http://mmm-mode.sourceforge.net/


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] RSI

2009-11-04 Thread Adam Spiers
On Tue, Sep 01, 2009 at 01:22:13PM -0500, Keith Lancaster wrote:
 Emacs can definitely lead to RSI - Richard Stallman, the creator,
 developed it.
 
 I am quite prone to RSI, which led me to VIM due to its modal
 operation (very few modifier key combos). I used VIM for quite a
 while and did not have any issues, but org-mode pulled me to emacs.
 I now use a kinesis keyboard and have no RSI issues. The keyboard
 combined with the idea expressed below that you use different hands
 when pressing control key combinations has really helped. The
 Kinesis puts all the control keys (control, meta, command) on your
 thumbs. Its expensive, but worth every penny to me at least. Check
 them out at http://www.kinesis-ergo.

I've come to this discussion a few months late, but I just wanted to
add my strongest recommendation for Kinesis keyboards to Keith's and
Ben's.  Their contoured keyboards have quite simply saved my career
from certain demise:

  http://www.kinesis-ergo.com/contoured.htm

I can't say that about any other piece of electronic kit I've ever
bought, no matter how fancy - when viewed in that light, it transforms
the seemingly crazy investment of several hundred dollars on a couple
of keyboards into a complete no-brainer.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Subversion for backups?

2009-11-04 Thread Adam Spiers
On Thu, Aug 27, 2009 at 05:27:40PM +, Robert Goldman wrote:
 FWIW, my feelings are the exact opposite of Matt's --- I find the added
 complexity of having multiple repositories to manage and the general added
 complexity of git quite unwelcome.
 
 If you are trying to keep multiple machines in sync, I find that a centralized
 repository scheme is far simpler:  all you need to do is manage the 
 relationship
 between your working copies and the repository, and that relationship is a 
 very
 simple one.

This centralized model is also entirely possible with git.

 If you have a distributed revision control system and multiple different
 repositories, you must manage the relationship between the different
 repositories and the relationship between those repositories and your working
 copies.  Because of the peer-to-peer aspect, this is a complex quadratic mesh 
 of
 relationships to manage, instead of the simple linear relationship you have 
 with
 a centralized repository.

It's not quadratic - it's still linear because it's quite unnecessary
to have every repository interacting with every other.

 I would say that if (1) you generally are connected to the internet, with only
 minor intervals offline and (2) have access to a hosted svn repository (so you
 don't manage it yourself, and so that you can use the simple https protocol
 instead of fussing with ssh tunneling), then you are likely to find svn much
 simpler.  I am fortunate that both of these hold for me.

I disagree - I think using git with a centralized model provides the
best of both worlds: simplicity but also all the nice benefits of
decentralization such as offline commit and history access,
intelligent merging etc.  Lots of people do it this way, e.g.

http://feeding.cloud.geek.nz/2008/12/setting-up-centralied-git-repository.html


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] suggestion: automatically recording entry creation date

2009-11-04 Thread Adam Spiers
On Tue, Nov 03, 2009 at 12:01:42AM +, Adam Spiers wrote:
 This would be useful to me too.  It would be valuable not just for
 finding recently created ones, but for sorting any generated list of
 entries by creation date.  This would for example make it easier to
 ensure that entries don't get stale with age.

Doh - I just found contrib/lisp/org-expiry.el :-)

 Bernt's approach is nice, but I agree that a completely clutter-free
 solution (i.e. :PROPERTIES: drawers completely hidden by default)
 would be extremely nice.

I suspect this might be tricky to implement :-/


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] FR: org-agenda-skip-deadline-if-scheduled

2009-11-03 Thread Adam Spiers
Damn :-) In that case, would it be easier to support boolean AND in
`org-agenda-skip-if' or in a similarly named function?  Or is there
another workaround you can think of?

Thanks!

On Tue, Nov 03, 2009 at 07:21:15AM +0100, Carsten Dominik wrote:
 This is, unfortunately, hard because it depends on the sequence
 in which scheduled and deadline are collected.
 
 - Carsten
 
 On Nov 2, 2009, at 2:40 PM, Adam Spiers wrote:
 
 Hi all,
 
 Quick feature suggestion:
 
 I just discovered `org-agenda-skip-scheduled-if-deadline-is-shown',
 which is a very nice option, but I actually want the opposite, i.e.
 `org-agenda-skip-deadline-if-scheduled'.  The reason for this is that
 if I have missed a deadline (sadly all too common), I want to be able
 to schedule it for tomorrow and not have it show in today's agenda,
 otherwise when planning today's activities, the total effort estimate
 for today gets over-inflated by the deadlined task.
 
 If `org-agenda-skip-if' supported boolean AND of the conditions then I
 could have achieved this by customising all my agenda views, but a
 global setting would be more convenient.
 
 Thanks,
 Adam


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] org-show-effort ideas

2009-11-03 Thread Adam Spiers
On Tue, Nov 03, 2009 at 07:47:48AM +0100, Carsten Dominik wrote:
 On Nov 2, 2009, at 2:49 PM, Adam Spiers wrote:
 
 I wanted an easy way to see an effort estimate when not in column
 view, so I wrote this:
 
 (defun org-show-effort ()
 Shows the effort of the entry at the current point.
 (interactive)
 (let ((effort (org-entry-get (point) org-effort-property)))
  (message (if effort (format Effort is %s effort)
 No effort defined
 
 However it would be nice to have a keystroke that would do this in
 agenda view.  Another nice touch would be to change 'e' which
 currently allows you to edit the effort from agenda view, so that the
 prompt for the new value shows the existing effort estimate if there
 is one.
 
 Admit it: you did not try this :-
 
 The prompt of e already does to this, and when you reply
 with RET, the same value stays.  I guess this might be good enough
 for showing the effort as well?  Otherwise:  Propose a key!

I definitely did try it, and I just did another 'git pull' and tried
again, and I still don't see it, so I guess we're talking about
different things ;-)

To clarify, I'm referring to showing effort via a single keystroke
when on a todo line in the *Org Agenda* buffer.  Currently, when I hit
e on a todo which has an existing Effort property value set, my
minibuffer prompt shows Value: .  The same applies with C-c C-x e in
a normal .org file buffer.

The only free single keystroke I could find is ' which actually has a
reasonable mnemonic: imagine a contractor providing you with a quote
estimating the effort for a task.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] shortcut key for switching between custom agenda viewss

2009-11-03 Thread Adam Spiers
Agreed, and so I will change my global binding for `org-agenda'.
Nevertheless it will end up requiring multiple keystrokes, so it would
be nice if there was also a single keystroke bound to this.  My
preference would be 'r' since 'g' already covers `org-agenda-redo' and
is the conventional emacs choice for refreshing the display, but I
suspect that several users might already be accustomed to using 'r'
rather than 'g'.

On Tue, Nov 03, 2009 at 07:30:08AM +0100, Carsten Dominik wrote:
 Hi Adam,
 
 I think it does make a lot of sense to have a *global* key to run
 a new agenda command. Keys like `C-c C-a' belong to the major mode,
 keys like `C-c a' belong to you and therefore are yours to set to
 global commands.  If you choose `C-c C-a', you will have to overwrite
 this key in all major modes where it gets in your way.
 
 On Nov 2, 2009, at 3:05 PM, Adam Spiers wrote:
 
 Within a custom agenda view, the key 'e' used to allow returning to
 the *Agenda Commands* buffer to choose another agenda view, but this
 no longer works.  I know that executing `org-agenda' produces the same
 view, but I have it bound to C-c C-a which in the agenda view is
 overloaded to `org-attach'.  I can rethink my key binding strategy
 (IIRC most people bind `org-agenda' to C-c a?), but it would be nice
 if there was a single keystroke to achieve the same by default.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: org-show-effort ideas

2009-11-03 Thread Adam Spiers
Benjamin Andresen (be...@in-ulm.de) wrote:
 Adam Spiers orgm...@adamspiers.org writes:
 
  I definitely did try it, and I just did another 'git pull' and tried
  again, and I still don't see it, so I guess we're talking about
  different things ;-)
 
  To clarify, I'm referring to showing effort via a single keystroke
  when on a todo line in the *Org Agenda* buffer.  Currently, when I hit
  e on a todo which has an existing Effort property value set, my
  minibuffer prompt shows Value: .  The same applies with C-c C-x e in
  a normal .org file buffer.
 
 When I press 'e' in an agenda on an item that has the Effort property
 value set, I get a minibuffer prompt that shows Value [5]:  when the
 Effort value is 5.
 
 This is with a git version from Sunday morning.
 
 Check the source of the function org-set-effort, it will show you that
 it concats [ cur ], where cur is the current Effort prop value.

Thanks for the pointer - it seems that the [ cur ] is only
included when

  (org-property-get-allowed-values nil prop 'table)

is nil - and in my case I have a global Effort_ALL property set which
means that this is never the case.  So I think this is a bug which can
be trivially fixed by assigning the prompt string in the let* variable
list, and then using it in both invocations of org-completing-read.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] MobileOrg 1.0 for iPhone/iPod Touch now available

2009-11-03 Thread Adam Spiers
Richard Moreland (r...@ncogni.to) wrote:
 Hi all,
 
 MobileOrg 1.0 is now available in the iTunes AppStore:
 http://bit.ly/1kpHqg  Documentation (including a screencast
 demonstrating the app) is available on the website at
 http://mobileorg.ncogni.to.
 
 Many thanks to Carsten and all the beta testers who helped get it
 ready for release.  Feel free to contact me with any questions or
 support requests.  If there is a question related to Org-mode
 integration, CC: Carsten too, he's the expert on that side of
 things.
 
 Be sure to use Org-mode 6.32 or later.

Looks like fantastic work, congratulations!  Thank heavens I finally
got Ubuntu/emacs/orgmode/git running natively on my Android phone,
otherwise I'd be green with envy ;-)


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Logging rescheduled tasks

2009-11-03 Thread Adam Spiers
Rick Moynihan (rick.moyni...@gmail.com) wrote:
 Hi all,
 
 I'm wondering if anyone logs rescheduled tasks with org-mode...  As I
 find myself sometimes scheduling tasks for a future date, but then on
 the day not having the capacity to do them.  In these situations I
 just reschedule them, but it'd be nice to record the dates for which
 an item was originally scheduled in the LOGBOOK.

Agreed - that would be nice.  I reschedule very frequently (alas...)


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] FR: org-agenda-skip-deadline-if-scheduled

2009-11-02 Thread Adam Spiers
Hi all,

Quick feature suggestion:

I just discovered `org-agenda-skip-scheduled-if-deadline-is-shown',
which is a very nice option, but I actually want the opposite, i.e.
`org-agenda-skip-deadline-if-scheduled'.  The reason for this is that
if I have missed a deadline (sadly all too common), I want to be able
to schedule it for tomorrow and not have it show in today's agenda,
otherwise when planning today's activities, the total effort estimate
for today gets over-inflated by the deadlined task.

If `org-agenda-skip-if' supported boolean AND of the conditions then I
could have achieved this by customising all my agenda views, but a
global setting would be more convenient.

Thanks,
Adam


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] org-show-effort ideas

2009-11-02 Thread Adam Spiers
I wanted an easy way to see an effort estimate when not in column
view, so I wrote this:

(defun org-show-effort ()
  Shows the effort of the entry at the current point.
  (interactive)
  (let ((effort (org-entry-get (point) org-effort-property)))
(message (if effort (format Effort is %s effort)
   No effort defined

However it would be nice to have a keystroke that would do this in
agenda view.  Another nice touch would be to change 'e' which
currently allows you to edit the effort from agenda view, so that the
prompt for the new value shows the existing effort estimate if there
is one.

Regards,
Adam


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] key bindings for quickly setting effort estimates

2009-11-02 Thread Adam Spiers
I found myself needing a quick way of setting effort estimates outside
column view, and came up with the following:

;; Zero effort is last (10th) element of global Effort_ALL property
;; so that we get zero effort when pressing '0' in the Effort column
;; in Column view, since this invokes `org-set-effort' with arg 0,
;; which stands for the 10th allowed value.
(let ((effort-values
   (org-property-get-allowed-values nil org-effort-property)))
  (dotimes (effort-index 10)
(let* ((effort (nth effort-index effort-values))
   (key-suffix (number-to-string
 (if (= effort-index 9) 0 (1+ effort-index
   (fn-name (concat org-set-effort-
(number-to-string effort-index)))
   (fn (intern fn-name)))
  ;; (message Binding M-o %s to %s which sets effort to %s
  ;;  key-suffix fn-name effort)
  (fset fn `(lambda ()
  ,(format Sets effort to %s. effort)
  (interactive)
  (org-set-effort ,(1+ effort-index
  (global-set-key (concat \eo key-suffix) fn

This assumes that Effort_ALL has 9 non-zero effort values, which in my
case is conveniently true:

(0:10 0:20 0:30 1:00 2:00 3:00 4:00 8:00 16:00 0)

Hope this is of interest.

Adam


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] FR: prefix maps for org-remember-templates

2009-11-02 Thread Adam Spiers
I am getting to the stage where I have enough org-remember templates
that the logical choices for shortcut keys are beginning to overlap.
It would be very cool if key sequences were supported, in exactly the
same way that they are for agenda custom commands.

Thanks,
Adam


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] shortcut key for switching between custom agenda viewss

2009-11-02 Thread Adam Spiers
Within a custom agenda view, the key 'e' used to allow returning to
the *Agenda Commands* buffer to choose another agenda view, but this
no longer works.  I know that executing `org-agenda' produces the same
view, but I have it bound to C-c C-a which in the agenda view is
overloaded to `org-attach'.  I can rethink my key binding strategy
(IIRC most people bind `org-agenda' to C-c a?), but it would be nice
if there was a single keystroke to achieve the same by default.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: skip-entry-if category

2009-11-02 Thread Adam Spiers
Carsten Dominik (carsten.domi...@gmail.com) wrote:
 On Aug 22, 2009, at 2:47 PM, Matt Lundin wrote:
 Hi Memnon
 
 Memnon Anon wrote:
 However, there is one thing I am not able to figure out:
 
 Using skipping, it is easy to limit my daily agenda to certain
 tags like:
 (org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp
 :STUDIUM:
 
 Is it possible to do the same with Categories?
 I think there must be a way, but all my attempts did not work :(.
 
 I believe this is not possible with the built in org agenda skip
 functions, since they search only the text within the subtree and do
 not recognize inherited tags and properties.
 
 However, I suspect that one could build a skip function using
 org-entry-properties that would accomplish this goal.
 
 Much faster in this special case will be to use `org-get-category'
 instead of accessing all properties of the entry with
 org-entry-properties.

I wrote the following to accomplish this, but it would be much nicer
if you could use (org-agenda-skip-entry-if 'category mycategory).

(defun org-agenda-skip-select-category-function (category-to-select)
  Creates a function suitable for use with
`org-agenda-skip-function' which skips all items except for those
in the provided category.
  `(lambda ()
(if (equal (org-get-category) ,category-to-select)
nil ;; don't skip
  ;; The invisible-ok param below seems to be needed
  ;; in order to avoid infinite loops:
  (org-end-of-subtree t


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] FR: org-agenda-skip-deadline-if-scheduled

2009-11-02 Thread Adam Spiers
Adam Spiers (orgm...@adamspiers.org) wrote:
 Hi all,
 
 Quick feature suggestion:
 
 I just discovered `org-agenda-skip-scheduled-if-deadline-is-shown',
 which is a very nice option, but I actually want the opposite, i.e.
 `org-agenda-skip-deadline-if-scheduled'.  The reason for this is that
 if I have missed a deadline (sadly all too common), I want to be able
 to schedule it for tomorrow and not have it show in today's agenda,
 otherwise when planning today's activities, the total effort estimate
 for today gets over-inflated by the deadlined task.

I just realised that this also applies not just to missed deadlines
but also upcoming ones.  In both cases, marking as scheduled indicates
that the deadline is being managed correctly and can safely be
excluded from the agenda view for today to avoid clutter and the
impact on today's time estimates.


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] making org-time-stamp a bit more interactive

2009-11-02 Thread Adam Spiers
If I have an existing time stamp (e.g. SCHEDULED/DEADLINE)
corresponding to (say) several months ago, and I want to update it to
some date in the future, but I want to see the calendar in order to
help decide the new date, I find the org-time-stamp interface slightly
lacking.  Ideally I could:

  - hit C-c . to start editing the time stamp
  - hit '.' to change it to the current day
  - use all the standard time stamp navigation bindings to move
from today to a new date

Unfortunately the 2nd step does not update the Calendar buffer, so the
3rd step navigates relative to the original date, not relative to
today.  Would it be easy to fix this?  Ideally the fix would also
apply if the 2nd step involved typing something like '+2w'.

Thanks,
Adam


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


  1   2   3   >