all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Insert time in Org-mode
       [not found] <mailman.45.1561392008.19357.emacs-orgmode@gnu.org>
@ 2019-06-25 16:41 ` gmx
  2019-06-25 16:56   ` Fraga, Eric
                     ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: gmx @ 2019-06-25 16:41 UTC (permalink / raw)
  To: emacs-orgmode

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).

My apologies for such a question...

Thank you in advance,

Fred

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  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-25 17:09   ` Robert Pluim
  2019-06-26 19:04   ` Russell Adams
  2 siblings, 2 replies; 12+ messages in thread
From: Fraga, Eric @ 2019-06-25 16:56 UTC (permalink / raw)
  To: gmx; +Cc: emacs-orgmode@gnu.org

On Tuesday, 25 Jun 2019 at 18:41, gmx wrote:
> 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).

Easiest immediate way is to insert an inactive time stamp by C-u C-c ! RET.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-379-g1b74ae

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-25 16:41 ` Insert time in Org-mode gmx
  2019-06-25 16:56   ` Fraga, Eric
@ 2019-06-25 17:09   ` Robert Pluim
  2019-06-26 19:04   ` Russell Adams
  2 siblings, 0 replies; 12+ messages in thread
From: Robert Pluim @ 2019-06-25 17:09 UTC (permalink / raw)
  To: gmx; +Cc: emacs-orgmode

>>>>> On Tue, 25 Jun 2019 18:41:15 +0200, gmx <fredstev@gmx.fr> said:

    gmx> Hello,
    gmx> How to insert the current time? I have a table in which I want to
    gmx> indicate the beginning of an oral exam (firt column), the end (second
    gmx> column), and (third column) make the difference between the two (I can
    gmx> do that).

C-u M-x org-time-stamp

will prompt for a date and insert it along with the current time (I
bind org-time-stamp to "C-c ." for convenience)

Robert

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-25 16:56   ` Fraga, Eric
@ 2019-06-25 17:23     ` gmx
  2019-06-26  4:54     ` Spenser Truex
  1 sibling, 0 replies; 12+ messages in thread
From: gmx @ 2019-06-25 17:23 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

Nice! And very easy

Thanks a lot

Fred

Le 25/06/2019 à 18:56, Fraga, Eric a écrit :
> On Tuesday, 25 Jun 2019 at 18:41, gmx wrote:
>> 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).
> Easiest immediate way is to insert an inactive time stamp by C-u C-c ! RET.
>

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  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
  1 sibling, 1 reply; 12+ messages in thread
From: Spenser Truex @ 2019-06-26  4:54 UTC (permalink / raw)
  To: emacs-orgmode

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Tuesday, 25 Jun 2019 at 18:41, gmx wrote:
>> How to insert the current time? 
>
> Easiest immediate way is to insert an inactive time stamp by C-u C-c !
> RET.

Robert Pluim <rpluim@gmail.com> writes:

> C-u M-x org-time-stamp
>
> will prompt for a date and insert it along with the current time (I
> bind org-time-stamp to "C-c ." for convenience)
>

Strange, my system does not insert the current time, only the date. I
have to insert the time manually. Same for inactive and active stamps.
I'm on the latest master versions.

-- 
Spenser Truex
usenet@spensertruex.com
https://spensertruex.com/
San Francisco, USA

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-25 16:41 ` Insert time in Org-mode gmx
  2019-06-25 16:56   ` Fraga, Eric
  2019-06-25 17:09   ` Robert Pluim
@ 2019-06-26 19:04   ` Russell Adams
  2019-06-26 20:32     ` Marcin Borkowski
  2 siblings, 1 reply; 12+ messages in thread
From: Russell Adams @ 2019-06-26 19:04 UTC (permalink / raw)
  To: emacs-orgmode

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.

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-26  4:54     ` Spenser Truex
@ 2019-06-26 19:59       ` Daniele Nicolodi
  2019-06-30  0:07         ` Spenser Truex
  0 siblings, 1 reply; 12+ messages in thread
From: Daniele Nicolodi @ 2019-06-26 19:59 UTC (permalink / raw)
  To: emacs-orgmode

On 25/06/2019 22:54, Spenser Truex wrote:
> "Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
> 
>> On Tuesday, 25 Jun 2019 at 18:41, gmx wrote:
>>> How to insert the current time? 
>>
>> Easiest immediate way is to insert an inactive time stamp by C-u C-c !
>> RET.
> 
> Robert Pluim <rpluim@gmail.com> writes:
> 
>> C-u M-x org-time-stamp
>>
>> will prompt for a date and insert it along with the current time (I
>> bind org-time-stamp to "C-c ." for convenience)
>>
> 
> Strange, my system does not insert the current time, only the date. I
> have to insert the time manually. Same for inactive and active stamps.
> I'm on the latest master versions.

For it to insert the time you need a prefix argument (C-u) to
org-time-stamp, so it should be "C-u C-c ." to add an active time-stamp
and "C-u C-c !" for an inactive one.

Cheers,
Dan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-26 19:04   ` Russell Adams
@ 2019-06-26 20:32     ` Marcin Borkowski
  2019-06-26 22:04       ` Tim Cross
  0 siblings, 1 reply; 12+ messages in thread
From: Marcin Borkowski @ 2019-06-26 20:32 UTC (permalink / raw)
  To: Russell Adams; +Cc: emacs-orgmode


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'.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-26 20:32     ` Marcin Borkowski
@ 2019-06-26 22:04       ` Tim Cross
  2019-06-27  9:23         ` Russell Adams
  0 siblings, 1 reply; 12+ messages in thread
From: Tim Cross @ 2019-06-26 22:04 UTC (permalink / raw)
  To: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-26 22:04       ` Tim Cross
@ 2019-06-27  9:23         ` Russell Adams
  2019-06-27 22:19           ` Tim Cross
  0 siblings, 1 reply; 12+ messages in thread
From: Russell Adams @ 2019-06-27  9:23 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Jun 27, 2019 at 08:04:33AM +1000, Tim Cross wrote:
> > 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.

I could refactor that to use the binding in use-package.

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

I've used this same code since 2007? Perhaps it needs an update. ;]

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-27  9:23         ` Russell Adams
@ 2019-06-27 22:19           ` Tim Cross
  0 siblings, 0 replies; 12+ messages in thread
From: Tim Cross @ 2019-06-27 22:19 UTC (permalink / raw)
  To: Org-mode

Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
>
> I've used this same code since 2007? Perhaps it needs an update. ;]
>

If you don't have code in your .emacs or .init.el which could be
updated, refactored or otherwise improved, your just not trying hard
enough and if you don't have chunks of code 'borrowed' from others which
you only partially understand, your trying too hard!


--
Tim Cross

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Insert time in Org-mode
  2019-06-26 19:59       ` Daniele Nicolodi
@ 2019-06-30  0:07         ` Spenser Truex
  0 siblings, 0 replies; 12+ messages in thread
From: Spenser Truex @ 2019-06-30  0:07 UTC (permalink / raw)
  To: emacs-orgmode

Daniele Nicolodi <daniele@grinta.net> writes:

> On 25/06/2019 22:54, Spenser Truex wrote:
>> "Fraga, Eric" <e.fraga@ucl.ac.uk> writes:
>> 
>>> On Tuesday, 25 Jun 2019 at 18:41, gmx wrote:
>>>> How to insert the current time? 
>>>
>>> Easiest immediate way is to insert an inactive time stamp by C-u C-c !
>>> RET.
>> 
>> Robert Pluim <rpluim@gmail.com> writes:
>> 
>>> C-u M-x org-time-stamp
>>>
>>> will prompt for a date and insert it along with the current time (I
>>> bind org-time-stamp to "C-c ." for convenience)
>>>
>> 
>> Strange, my system does not insert the current time, only the date. I
>> have to insert the time manually. Same for inactive and active stamps.
>> I'm on the latest master versions.
>
> For it to insert the time you need a prefix argument (C-u) to
> org-time-stamp, so it should be "C-u C-c ." to add an active time-stamp
> and "C-u C-c !" for an inactive one.
>

This worked, I must have simply neglected to use the prefix.

Thank you
-- 
Spenser Truex
usenet@spensertruex.com
https://spensertruex.com/
San Francisco, USA

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-06-30  0:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2019-06-27  9:23         ` Russell Adams
2019-06-27 22:19           ` Tim Cross

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.