From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc-Oliver Ihm Subject: Re: Tiny piece of customization for ctrl-c ctrl-c within a timestamp Date: Sun, 17 Oct 2010 08:31:27 +0200 Message-ID: References: <9500.1287259085@gamaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=57801 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P7MmY-0002Gf-TI for emacs-orgmode@gnu.org; Sun, 17 Oct 2010 02:31:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P7MmX-0000aP-Tt for emacs-orgmode@gnu.org; Sun, 17 Oct 2010 02:31:46 -0400 Received: from lo.gmane.org ([80.91.229.12]:51933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P7MmX-0000aI-Jf for emacs-orgmode@gnu.org; Sun, 17 Oct 2010 02:31:45 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P7MmT-00022u-HU for emacs-orgmode@gnu.org; Sun, 17 Oct 2010 08:31:41 +0200 Received: from p54a8993f.dip0.t-ipconnect.de ([84.168.153.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Oct 2010 08:31:41 +0200 Received: from ihm by p54a8993f.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Oct 2010 08:31:41 +0200 In-Reply-To: <9500.1287259085@gamaville.dokosmarshall.org> 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 Am 16.10.2010 21:58, schrieb Nick Dokos: > Jeff Horn wrote: > >> Very useful, since I often do the same! Thanks for this. >> >> On Sat, Oct 16, 2010 at 12:34 PM, Marc-Oliver Ihm 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 >>> > > My hack for this is S- S-: it advances the date up and down > by 1 but has the side effect of setting the day of the week correctly. > > Nick > > _______________________________________________ > 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 > S- S- is nearly as short, and I did not think about it :-) The only remaining advantage of my hack (besides the apparent disadvantage of needing explicit customization) is, that it increases the dwimity of ctrl-c ctrl-c ... Thanx and kind regards, Marc-Oliver Ihm