emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Insert time in Org-mode
Date: Thu, 27 Jun 2019 08:04:33 +1000	[thread overview]
Message-ID: <87pnn0ovf2.fsf@gmail.com> (raw)
In-Reply-To: <87y31ow0i2.fsf@mbork.pl>


Marcin Borkowski <mbork@mbork.pl> writes:

> On 2019-06-26, at 21:04, Russell Adams <RLAdams@AdamsInfoServ.Com> wrote:
>
>> On Tue, Jun 25, 2019 at 06:41:15PM +0200, gmx wrote:
>>> Hello,
>>>
>>> How to insert the current time? I have a table in which I want to
>>> indicate the beginning of an oral exam (firt column), the end (second
>>> column), and (third column) make the difference between the two (I can
>>> do that).
>>
>> I use this:
>>
>> ;; Insert immediate timestamp
>> (bind-key "<f9>"
>> 		  '(lambda () (interactive)
>> 			 (when (eq major-mode 'org-mode)
>> 			   (org-insert-time-stamp nil t t)
>> 			   (insert "\n"))))
>>
>> I press f9 all the time while note taking to timestamp my activities.
>
> That is a bit strange - my Emacs doesn't seem to have `bind-key'.
>

It is from a separate package called bind-key that you can install from
MELPA.

The excellent 'use-package' package uses it as a convenience method to
bind keys in use-pacakge definition blocks.

> Also, I would just add f9 to `org-mode-map', e.g. using `define-key' -
> there's no need then to check for `major-mode'.
>

Yep, exactly my first thoughts when I saw the example. I use to have
something similar, but now my capture templates and 'Journal' option
take care of all of that, plus other useful details - like the
place/buffer/mode you were in when you took the note etc. 


-- 
Tim Cross

  reply	other threads:[~2019-06-26 22:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.45.1561392008.19357.emacs-orgmode@gnu.org>
2019-06-25 16:41 ` Insert time in Org-mode gmx
2019-06-25 16:56   ` Fraga, Eric
2019-06-25 17:23     ` gmx
2019-06-26  4:54     ` Spenser Truex
2019-06-26 19:59       ` Daniele Nicolodi
2019-06-30  0:07         ` Spenser Truex
2019-06-25 17:09   ` Robert Pluim
2019-06-26 19:04   ` Russell Adams
2019-06-26 20:32     ` Marcin Borkowski
2019-06-26 22:04       ` Tim Cross [this message]
2019-06-27  9:23         ` Russell Adams
2019-06-27 22:19           ` Tim Cross

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=87pnn0ovf2.fsf@gmail.com \
    --to=theophilusx@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).