From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: org-insert-timestamp issue Date: Tue, 24 Jan 2012 20:52:58 -0600 Message-ID: References: <31466.1327455978@alphaville> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0015175d075e78d86d04b7515cf4 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:53909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpsyr-0005ct-E1 for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 21:53:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rpsyp-0005Js-UW for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 21:53:01 -0500 Received: from mail-bk0-f41.google.com ([209.85.214.41]:55282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rpsyp-0005Jl-Md for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 21:52:59 -0500 Received: by bkbzx1 with SMTP id zx1so4502264bkb.0 for ; Tue, 24 Jan 2012 18:52:58 -0800 (PST) In-Reply-To: <31466.1327455978@alphaville> 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: nicholas.dokos@hp.com Cc: Org Mode --0015175d075e78d86d04b7515cf4 Content-Type: text/plain; charset=ISO-8859-1 Hi Nick, thank you very much! Why does org rebinds C-c C-y to that function? Is that a default binding for org? Marcelo. On Tue, Jan 24, 2012 at 7:46 PM, Nick Dokos wrote: > 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 > > --0015175d075e78d86d04b7515cf4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Nick, thank you very much!

Why does org rebinds C-c C= -y to that function? Is that a default binding for org?

Marcelo.

On Tue, Jan 24, 2012 at 7:= 46 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
Marcelo de Moraes Serpa <celoserpa@gmail.com> wrote:

> --485b393aac6dde430a04b7500c79
> Content-Type: text/plain; charset=3DISO-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 timesta= mp 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 rebin= d C-c C-y
in a hook:

(add-hook 'org-mode-hook (function (lambda ()
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (l= ocal-set-key (kbd "C-c C-y")
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(lambda() (interactive)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(org-insert-time-stamp nil t nil nil nil= nil))))))

Nick


--0015175d075e78d86d04b7515cf4--