[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Tiny piece of customization for ctrl-c ctrl-c within a tim
From: |
Jeff Horn |
Subject: |
Re: [Orgmode] Tiny piece of customization for ctrl-c ctrl-c within a timestamp |
Date: |
Sat, 16 Oct 2010 15:43:01 -0400 |
Very useful, since I often do the same! Thanks for this.
On Sat, Oct 16, 2010 at 12:34 PM, Marc-Oliver Ihm <address@hidden> wrote:
> Hello !
>
>
> I sometimes find myself adjusting timestamps just by editing its text;
> e.g. changing <2010-10-16 Su> to <2011-10-16 Su>. However after that
> editing, the day of week is usually wrong (or might be right, I just
> dont know).
>
> With this small piece of lisp, one just needs to press ctrl-c ctrl-c
> while the cursor is in a timestamp and the day of week is adjusted.
>
>
> (defun org-set-weekday-of-timestamp ()
> "Check if cursor is within a timestamp and compute weekday from numeric
> date"
> (interactive)
> (when (org-at-timestamp-p t)
> (org-timestamp-change 0 'year)
> (message "Weekday of timestamp has been adjusted.")
> t
> ))
>
> (add-hook 'org-ctrl-c-ctrl-c-hook 'org-set-weekday-of-timestamp)
>
>
> Maybe someone else might find that useful too.
>
>
> With kind regards, Marc-Oliver Ihm
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
--
Jeffrey Horn
Graduate Lecturer and PhD Student in Economics
George Mason University
(704) 271-4797
address@hidden
address@hidden
http://www.failuretorefrain.com/jeff/