From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Insert time in Org-mode Date: Wed, 26 Jun 2019 22:32:53 +0200 Message-ID: <87y31ow0i2.fsf@mbork.pl> References: <00e1adf1-aa75-4c82-9b6a-ed6592f105a6@gmx.fr> <20190626190427.GS24867@volibear> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42005) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgEdI-0004da-Oc for emacs-orgmode@gnu.org; Wed, 26 Jun 2019 16:35:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgEdG-0003Iw-Un for emacs-orgmode@gnu.org; Wed, 26 Jun 2019 16:35:08 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:59958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hgEdG-00030Y-Ks for emacs-orgmode@gnu.org; Wed, 26 Jun 2019 16:35:06 -0400 In-reply-to: <20190626190427.GS24867@volibear> 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: Russell Adams Cc: emacs-orgmode@gnu.org 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'. 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'. Hth, -- Marcin Borkowski http://mbork.pl