Re: [O] Time shifting functions

2018-04-27 Thread Matt Price
On Thu, Apr 26, 2018 at 7:34 PM, Bastien  wrote:

> Hi Andrei,
>
> Andrei Beliankou  writes:
>
> > I wonder if Org-mode has a convinient function to shift a timestamp with
> > a (weekly) repeating interval by that interval.
>
> Actually the same way `org-read-date' reads the time in the timestamp
> it could also read a repeater interval, so that C-c C-s would present
> you with this repeater interval by default.
>
> Would that make sense for you?
>
>
Huh, that sounds interesting. What I did was define this function:

;; this is the one I'm currently using
(defun get-ts+7 ()
"returns a string of the form <%Y-%m-d %a> where the date elements are 7
days later
than the previous timestamp in the buffer. No error checking or anything
yet."
(interactive)
(let ((base-date (save-excursion
 (re-search-backward
  (org-re-timestamp 'all))
 (match-string 0)))
  (result nil))

  (format-time-string "<%Y-%m-%d %a>"
  (time-add
   (date-to-time base-date) (days-to-time (1+ 7
))

And then I use this macro:

#+MACRO: ts (eval (get-ts+7))

And then my headings look like this:

* Week {{{n}}} (<2017-09-11 Mon>):Intro. On Discussion.
* Week {{{n}}} ({{{ts}}}): What is a River?
* Week {{{n}}} ({{{ts}}}): Rivers in the Broad Sweep of Time

It's not easy to look at in its org-native form, but it's pretty good on
export.


Re: [O] Time shifting functions

2018-04-26 Thread Bastien
Hi Andrei,

Andrei Beliankou  writes:

> I wonder if Org-mode has a convinient function to shift a timestamp with
> a (weekly) repeating interval by that interval.

Actually the same way `org-read-date' reads the time in the timestamp
it could also read a repeater interval, so that C-c C-s would present
you with this repeater interval by default.

Would that make sense for you?

-- 
 Bastien



[O] Time shifting functions

2018-02-15 Thread Andrei Beliankou
Dear list members,

I wonder if Org-mode has a convinient function to shift a timestamp with
a (weekly) repeating interval by that interval.

The idea behind is to simple reschedule the ivent without going through
the state cycle and triggering logbook entries and touching the
:LAST_REPEAT: property. Setting off logging for repetitions and done
state for an item or subtree is not an option.

This shift would be effectively a cancel action for a habit.

Is there a ready solution?

Thanks in advance,

Andrei Beliankou