emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcelo de Moraes Serpa <celoserpa@gmail.com>
To: nicholas.dokos@hp.com
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-insert-timestamp issue
Date: Tue, 24 Jan 2012 20:52:58 -0600	[thread overview]
Message-ID: <CACHMzOEciJRsDbAU2EnR+Er-yfSY4ZH-BRt+JDjvLFck-77hPA@mail.gmail.com> (raw)
In-Reply-To: <31466.1327455978@alphaville>

[-- Attachment #1: Type: text/plain, Size: 1417 bytes --]

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=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
>
>

[-- Attachment #2: Type: text/html, Size: 2076 bytes --]

  reply	other threads:[~2012-01-25  2:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25  1:19 org-insert-timestamp issue Marcelo de Moraes Serpa
2012-01-25  1:46 ` Nick Dokos
2012-01-25  2:52   ` Marcelo de Moraes Serpa [this message]
2012-01-25  3:48     ` Nick Dokos
2012-01-25  6:15     ` Bastien
2012-01-25  8:58       ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACHMzOEciJRsDbAU2EnR+Er-yfSY4ZH-BRt+JDjvLFck-77hPA@mail.gmail.com \
    --to=celoserpa@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).