From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: org-insert-timestamp issue Date: Tue, 24 Jan 2012 20:46:18 -0500 Message-ID: <31466.1327455978@alphaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpsKM-0000Mj-0E for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 21:11:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpsKK-0000Fw-Vu for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 21:11:09 -0500 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:19152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RprwK-0005lX-Ii for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 20:46:20 -0500 In-Reply-To: Message from Marcelo de Moraes Serpa of "Tue, 24 Jan 2012 19:19:07 CST." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Marcelo de Moraes Serpa Cc: nicholas.dokos@hp.com, Org Mode Marcelo de Moraes Serpa wrote: > --485b393aac6dde430a04b7500c79 > Content-Type: text/plain; charset=ISO-8859-1 > > Hi guys, > > I have bound org-insert-timestamp to C-c C-y, like so: > > (global-set-key (kbd "C-c C-y") (lambda() (interactive) > (org-insert-time-stamp nil t nil nil nil nil))) > > However, once in an org-mode buffer, when I press C-c C-y, I get the > following in the mini-buffer: > > if: Not at a time-stamp range, and none found in current line > > What does that mean and how could I fix it so that the current timestamp is > inserted (current datetime)? > Org-mode rebinds C-c C-y to org-evaluate-time-range, so you are not calling the function that you think you are calling when you press C-c C-y in an org-mode buffer. It only works in *other* buffers :-) If you don't care about org-evaluate-time-range, you can probably rebind C-c C-y in a hook: (add-hook 'org-mode-hook (function (lambda () (local-set-key (kbd "C-c C-y") (lambda() (interactive) (org-insert-time-stamp nil t nil nil nil nil)))))) Nick