emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Time shifting functions
@ 2018-02-15  8:45 Andrei Beliankou
  2018-04-26 23:34 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Beliankou @ 2018-02-15  8:45 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Time shifting functions
  2018-02-15  8:45 Time shifting functions Andrei Beliankou
@ 2018-04-26 23:34 ` Bastien
  2018-04-27 15:53   ` Matt Price
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2018-04-26 23:34 UTC (permalink / raw)
  To: Andrei Beliankou; +Cc: emacs-orgmode

Hi Andrei,

Andrei Beliankou <arbox@yandex.ru> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Time shifting functions
  2018-04-26 23:34 ` Bastien
@ 2018-04-27 15:53   ` Matt Price
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Price @ 2018-04-27 15:53 UTC (permalink / raw)
  To: Bastien; +Cc: Andrei Beliankou, Org Mode

[-- Attachment #1: Type: text/plain, Size: 1468 bytes --]

On Thu, Apr 26, 2018 at 7:34 PM, Bastien <bzg@gnu.org> wrote:

> Hi Andrei,
>
> Andrei Beliankou <arbox@yandex.ru> 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.

[-- Attachment #2: Type: text/html, Size: 2367 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-27 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-15  8:45 Time shifting functions Andrei Beliankou
2018-04-26 23:34 ` Bastien
2018-04-27 15:53   ` Matt Price

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).