From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc-Oliver Ihm Subject: Tiny piece of customization for ctrl-c ctrl-c within a timestamp Date: Sat, 16 Oct 2010 18:34:16 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=43175 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P79iP-0007Hq-2s for emacs-orgmode@gnu.org; Sat, 16 Oct 2010 12:34:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P79iO-0003B0-0Q for emacs-orgmode@gnu.org; Sat, 16 Oct 2010 12:34:36 -0400 Received: from lo.gmane.org ([80.91.229.12]:45754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P79iN-0003AU-R2 for emacs-orgmode@gnu.org; Sat, 16 Oct 2010 12:34:35 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P79iG-0000db-F7 for emacs-orgmode@gnu.org; Sat, 16 Oct 2010 18:34:28 +0200 Received: from p54a88d1d.dip0.t-ipconnect.de ([84.168.141.29]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Oct 2010 18:34:28 +0200 Received: from ihm by p54a88d1d.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Oct 2010 18:34:28 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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