From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Cross Subject: Re: Insert time in Org-mode Date: Thu, 27 Jun 2019 08:04:33 +1000 Message-ID: <87pnn0ovf2.fsf@gmail.com> References: <00e1adf1-aa75-4c82-9b6a-ed6592f105a6@gmx.fr> <20190626190427.GS24867@volibear> <87y31ow0i2.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36454) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgG2J-0006Tr-GT for emacs-orgmode@gnu.org; Wed, 26 Jun 2019 18:05:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgG2G-0005uY-AY for emacs-orgmode@gnu.org; Wed, 26 Jun 2019 18:05:03 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:37286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgG2F-0005hk-SC for emacs-orgmode@gnu.org; Wed, 26 Jun 2019 18:05:00 -0400 Received: by mail-pg1-x530.google.com with SMTP id 25so19525pgy.4 for ; Wed, 26 Jun 2019 15:04:43 -0700 (PDT) In-reply-to: <87y31ow0i2.fsf@mbork.pl> 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" To: emacs-orgmode@gnu.org Marcin Borkowski writes: > On 2019-06-26, at 21:04, Russell Adams 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 "" >> '(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