[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-insert-timestamp issue

From: Marcelo de Moraes Serpa
Subject: Re: [O] org-insert-timestamp issue
Date: Tue, 24 Jan 2012 20:52:58 -0600

Hi Nick, thank you very much!

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


On Tue, Jan 24, 2012 at 7:46 PM, Nick Dokos <address@hidden> wrote:
Marcelo de Moraes Serpa <address@hidden> 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))))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]