emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Marcelo de Moraes Serpa <celoserpa@gmail.com>
Cc: nicholas.dokos@hp.com, Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org-insert-timestamp issue
Date: Tue, 24 Jan 2012 20:46:18 -0500	[thread overview]
Message-ID: <31466.1327455978@alphaville> (raw)
In-Reply-To: Message from Marcelo de Moraes Serpa <celoserpa@gmail.com> of "Tue, 24 Jan 2012 19:19:07 CST." <CACHMzOHVuJf9yrEnuWzzbuWR7QYNKXv71UA2-KLWrzFe0u4iKA@mail.gmail.com>

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

  reply	other threads:[~2012-01-25  2:11 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 [this message]
2012-01-25  2:52   ` Marcelo de Moraes Serpa
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=31466.1327455978@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=celoserpa@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).