emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* feature suggestion: apply datetime prompt magic to selected region
@ 2011-10-06 12:40 Brian van den Broek
  2011-12-28 16:18 ` Bastien
  0 siblings, 1 reply; 13+ messages in thread
From: Brian van den Broek @ 2011-10-06 12:40 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

It wouldn't stun me were orgmode already able to do what I have in
mind, but trying it and consulting the fine manual didn't suggest that
it does.

I very much appreciate orgmode's ability to parse the content of a
yank for date and time information while entering a timestamp. I think
it would be even cooler were orgmode able to parse the content of a
selected region and extract the same information, replacing the region
with the timestamp created on the basis of the text in the region.

It certainly is true that one can select the region, kill it, invoke
the datetime prompt, and then yank to achieve the same effect.
However, having just done that more than 50 times in a row with a
series of dates copied from a webpage, it has occurred to me that the
ability to move directly from a selected region to a datetime prompt
while skipping the kill and yank steps would have saved more than a
hundred key-chords.

Not revolutionary, and surely not a high priority, but I thought I'd
throw the idea out there in case any of the developers think it worth
the time to implement. If not, no biggie.

Thanks and best,

Brian vdB

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

* feature suggestion: apply datetime prompt magic to selected region
@ 2011-10-06 12:48 Brian van den Broek
  2011-10-06 19:46 ` Achim Gratz
  0 siblings, 1 reply; 13+ messages in thread
From: Brian van den Broek @ 2011-10-06 12:48 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

[Apologies to the mods and to all if this goes through twice;
I sent from the wrong gmail tab :-[ ]

It wouldn't stun me were orgmode already able to do what I have in
mind, but trying it and consulting the fine manual didn't suggest that
it does.

I very much appreciate orgmode's ability to parse the content of a
yank for date and time information while entering a timestamp. I think
it would be even cooler were orgmode able to parse the content of a
selected region and extract the same information, replacing the region
with the timestamp created on the basis of the text in the region.

It certainly is true that one can select the region, kill it, invoke
the datetime prompt, and then yank to achieve the same effect.
However, having just done that more than 50 times in a row with a
series of dates copied from a webpage, it has occurred to me that the
ability to move directly from a selected region to a datetime prompt
while skipping the kill and yank steps would have saved more than a
hundred key-chords.

Not revolutionary, and surely not a high priority, but I thought I'd
throw the idea out there in case any of the developers think it worth
the time to implement. If not, no biggie.

Thanks and best,

Brian vdB

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-06 12:48 feature suggestion: apply datetime prompt magic to selected region Brian van den Broek
@ 2011-10-06 19:46 ` Achim Gratz
  2011-10-06 22:38   ` Brian van den Broek
  0 siblings, 1 reply; 13+ messages in thread
From: Achim Gratz @ 2011-10-06 19:46 UTC (permalink / raw)
  To: emacs-orgmode

Brian van den Broek <brian.van.den.broek@gmail.com> writes:
> It wouldn't stun me were orgmode already able to do what I have in
> mind, but trying it and consulting the fine manual didn't suggest that
> it does.
[snip]

I'm not exactly sure what you are trying to achieve, but it seems that
you could define a keyboard macro for that?


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-06 19:46 ` Achim Gratz
@ 2011-10-06 22:38   ` Brian van den Broek
  2011-10-07  8:12     ` suvayu ali
  0 siblings, 1 reply; 13+ messages in thread
From: Brian van den Broek @ 2011-10-06 22:38 UTC (permalink / raw)
  Cc: emacs-orgmode

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

On 6 Oct 2011 21:46, "Achim Gratz" <Stromeko@nexgo.de> wrote:
>
> Brian van den Broek <brian.van.den.broek@gmail.com> writes:
> > It wouldn't stun me were orgmode already able to do what I have in
> > mind, but trying it and consulting the fine manual didn't suggest that
> > it does.
> [snip]
>
> I'm not exactly sure what you are trying to achieve, but it seems that
> you could define a keyboard macro for that?>

Hi Achim,

Thanks for the reply.

Indeed one could and perhaps I ought to have; my data was irregular, so I
didn't have the hope of quickly creating a robust macro. Since I had to
select regions by hand, a macro didn't seem worth it for the kill,
invocation of the datetime prompt, and yank within.

It just seemed that since orgmode parse text yanked into the dt prompt, it
would be in keeping with the general spirit of the mode to parse selected
text, too. But, as I said, it isn't a big deal.

I've weak elisp and know nothing of orgs internals. But, if there's no
uptake, maybe that'd be a small enough coding task for ?e to take some steps
to learning :-)

Best,

Brian vdB

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

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-06 22:38   ` Brian van den Broek
@ 2011-10-07  8:12     ` suvayu ali
  2011-10-07 14:36       ` Brian van den Broek
  0 siblings, 1 reply; 13+ messages in thread
From: suvayu ali @ 2011-10-07  8:12 UTC (permalink / raw)
  To: Brian van den Broek; +Cc: emacs-orgmode

Hi Brian,

On Fri, Oct 7, 2011 at 12:38 AM, Brian van den Broek
<brian.van.den.broek@gmail.com> wrote:
> It just seemed that since orgmode parse text yanked into the dt prompt, it
> would be in keeping with the general spirit of the mode to parse selected
> text, too. But, as I said, it isn't a big deal.

I don't quite understand this, are you saying when I yank text into an
org buffer it converts any random time stamp like information into
proper org format timestamps? So if I were to kill the following text
from some buffer,

some random time stamp 2011/10/07

and yank it into an org buffer, it will be converted to

some random time stamp <2011-10-07>

I have been using org for quite sometime, but I don't think there is
any such feature. And if there was, I would say that's too intrusive
to assume I want every time information to be stored as timestamps. Or
on the other hand, do you mean that the text doesn't change but the
text face does? I would think that is a fontlocking issue.

If I am misunderstanding, could you please illustrate with a small example?

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-07  8:12     ` suvayu ali
@ 2011-10-07 14:36       ` Brian van den Broek
  2011-10-07 15:42         ` Nick Dokos
  2011-10-08  7:33         ` suvayu ali
  0 siblings, 2 replies; 13+ messages in thread
From: Brian van den Broek @ 2011-10-07 14:36 UTC (permalink / raw)
  To: emacs-orgmode

On 7 October 2011 10:12, suvayu ali <fatkasuvayu+linux@gmail.com> wrote:
> Hi Brian,
>
> On Fri, Oct 7, 2011 at 12:38 AM, Brian van den Broek
> <brian.van.den.broek@gmail.com> wrote:
>> It just seemed that since orgmode parse text yanked into the dt prompt, it
>> would be in keeping with the general spirit of the mode to parse selected
>> text, too. But, as I said, it isn't a big deal.
>
> I don't quite understand this, are you saying when I yank text into an
> org buffer it converts any random time stamp like information into
> proper org format timestamps? So if I were to kill the following text
> from some buffer,
>
> some random time stamp 2011/10/07
>
> and yank it into an org buffer, it will be converted to
>
> some random time stamp <2011-10-07>
>
> I have been using org for quite sometime, but I don't think there is
> any such feature. And if there was, I would say that's too intrusive
> to assume I want every time information to be stored as timestamps. Or
> on the other hand, do you mean that the text doesn't change but the
> text face does? I would think that is a fontlocking issue.
>
> If I am misunderstanding, could you please illustrate with a small example?


Hi Suvayu and all,

It is clear that I've not been clear. I'll explain and then let it go. :-)

Say I have a buffer with the following contents:

<------>
Some text in a buffer with orgmode enabled.

Blah blah, Tuesday at 3pm blah blah September 19, 2003, 14:00-15:00 blah blah
<------>

As it is now, if I kill the text "Tuesday at 3pm", and with cursor
where I killed hit C-u C-c . to invoke org-time-stamp with prefix
argument, and then yank the just killed text into the resulting
prompt, and repeat for the text "Sept. ... 15:00", I get

<------>
Some text in a buffer with orgmode enabled.

Blah blah, <2011-10-11 Tue 15:00> blah blah <2003-09-19 Fri
14:00-15:00> blah blah
<------>

(the exact way the org-time-stamp command interprets the text is a
function of the date that it is run and of the value of
org-read-date-prefer-future, and possibly other variables, too.)

What I was suggesting was it would be cool and a small time-saver if I
could select the text "Tuesday at 3pm" and hit C-u C-c . and have the
region replaced with the stamp <2011-10-11 Tue 15:00>, entirely
bypassing the kill and yank steps. (Achim correctly suggested that
what I want to do could be done with a keyboard macro. I still think
it would be neat.)

The reason that I suggested it is that I'd tried it, half-expecting it
to work. It seems to me that orgmode is pretty good at making my life
easier and this is a (very small) way in which it could, but doesn't
currently. Certainly, if I am killing text to yank into the datetime
prompt, there is a high likelihood that what I really want to do is to
replace that text with a timestamp that org derives from it. So, why
not enable that in one swell foop?

I hope that has made my suggestion clear. I'm sorry I was unclear
earlier and thus created a bit of noise.

Best,

Brian vdB

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-07 14:36       ` Brian van den Broek
@ 2011-10-07 15:42         ` Nick Dokos
  2011-10-08  7:33         ` suvayu ali
  1 sibling, 0 replies; 13+ messages in thread
From: Nick Dokos @ 2011-10-07 15:42 UTC (permalink / raw)
  To: Brian van den Broek; +Cc: nicholas.dokos, emacs-orgmode

Brian van den Broek <brian.van.den.broek@gmail.com> wrote:

> ... 
> Say I have a buffer with the following contents:
> 
> <------>
> Some text in a buffer with orgmode enabled.
> 
> Blah blah, Tuesday at 3pm blah blah September 19, 2003, 14:00-15:00 blah blah
> <------>
> 
> As it is now, if I kill the text "Tuesday at 3pm", and with cursor
> where I killed hit C-u C-c . to invoke org-time-stamp with prefix
> argument, and then yank the just killed text into the resulting
> prompt, and repeat for the text "Sept. ... 15:00", I get
> 
> <------>
> Some text in a buffer with orgmode enabled.
> 
> Blah blah, <2011-10-11 Tue 15:00> blah blah <2003-09-19 Fri
> 14:00-15:00> blah blah
> <------>
> 
> (the exact way the org-time-stamp command interprets the text is a
> function of the date that it is run and of the value of
> org-read-date-prefer-future, and possibly other variables, too.)
> 
> What I was suggesting was it would be cool and a small time-saver if I
> could select the text "Tuesday at 3pm" and hit C-u C-c . and have the
> region replaced with the stamp <2011-10-11 Tue 15:00>, entirely
> bypassing the kill and yank steps. (Achim correctly suggested that
> what I want to do could be done with a keyboard macro. I still think
> it would be neat.)

So we are talking about saving two keystrokes: not worth it in my
opinion for interactive use (unless you have a bunch of things to do, as
you apparently did - macros or a wrapped org-time-stamp assigned to some
key is probably the best solution for that).

The reason why I don't think that anything more needs to be done in org,
is that the major time waster here is *not* the two extra keystrokes:
it's selecting the region(s) to cut/paste - I don't see any way to
improve that.

Nick

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-07 14:36       ` Brian van den Broek
  2011-10-07 15:42         ` Nick Dokos
@ 2011-10-08  7:33         ` suvayu ali
  2011-10-24  6:00           ` Bastien
  1 sibling, 1 reply; 13+ messages in thread
From: suvayu ali @ 2011-10-08  7:33 UTC (permalink / raw)
  To: Brian van den Broek; +Cc: emacs-orgmode

On Fri, Oct 7, 2011 at 4:36 PM, Brian van den Broek
<brian.van.den.broek@gmail.com> wrote:
> What I was suggesting was it would be cool and a small time-saver if I
> could select the text "Tuesday at 3pm" and hit C-u C-c . and have the
> region replaced with the stamp <2011-10-11 Tue 15:00>, entirely
> bypassing the kill and yank steps. (Achim correctly suggested that
> what I want to do could be done with a keyboard macro. I still think
> it would be neat.)

Ah I see it now, you want the org-timestamp command to work on a
region. Maybe you can write your own function with lisp if you are
doing this too often. Should be quite simple to try.

GL

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-08  7:33         ` suvayu ali
@ 2011-10-24  6:00           ` Bastien
  2011-10-25 16:56             ` Brian van den Broek
  0 siblings, 1 reply; 13+ messages in thread
From: Bastien @ 2011-10-24  6:00 UTC (permalink / raw)
  To: suvayu ali; +Cc: Brian van den Broek, emacs-orgmode

Hi Brian,

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Ah I see it now, you want the org-timestamp command to work on a
> region. Maybe you can write your own function with lisp if you are
> doing this too often. Should be quite simple to try.

Please check `org-loop-over-headlines-in-active-region' from latest
git repo and see if using `org-schedule' in the region does what you
want.  We can actually implement this for `org-timestamp' as well,
if relevant.

Thanks,

-- 
 Bastien

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-24  6:00           ` Bastien
@ 2011-10-25 16:56             ` Brian van den Broek
  2011-10-26  7:56               ` Eric S Fraga
  0 siblings, 1 reply; 13+ messages in thread
From: Brian van den Broek @ 2011-10-25 16:56 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

On 24 October 2011 08:00, Bastien <bzg@altern.org> wrote:
> Hi Brian,
>
> suvayu ali <fatkasuvayu+linux@gmail.com> writes:
>
>> Ah I see it now, you want the org-timestamp command to work on a
>> region. Maybe you can write your own function with lisp if you are
>> doing this too often. Should be quite simple to try.
>
> Please check `org-loop-over-headlines-in-active-region' from latest
> git repo and see if using `org-schedule' in the region does what you
> want.  We can actually implement this for `org-timestamp' as well,
> if relevant.
>
> Thanks,
>
> --
>  Bastien


Hi Bastien,

Thanks for replying and giving this your attention.

Various people upthread convinced me that my feature request wasn't
really worth it. (I do hope it didn't cost you too much time!) So, I
am content to drop it here :-)

That said, it seems only right to respond and let you know how things
sit. Feel free to let it die.

Unless I misunderstood, that does not do what I had in mind.

With a fresh git pull I invoked emacs with
   emacs --no-site-file -l minimalorgtestdotemacs test.org
where minimalorgtestdotemacs reads:

(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(transient-mark-mode 1)
(setq org-loop-over-headlines-in-active-region t)


and test.org reads:

* test

  2003-01-26


Versions:
    Org-mode version 7.7 (release_7.7.464.g679a0)
    GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of
2010-12-11 on raven, modified by Debian

If I have point and mark on either end of 2003-01-26 and invoke M-x
org-schedule, nothing occurs. By analogy with my original request,
what was desired was for the region to automatically get fed to the
datetime prompt and thus for the test subtree to acquire the scheduled
date of 2003-01-26 without further intervention.

So, thanks again for the attention to the suggestion. I'm more than
happy to let it rest here.

Best,

Brian vdB

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-25 16:56             ` Brian van den Broek
@ 2011-10-26  7:56               ` Eric S Fraga
  2011-10-26 12:00                 ` Brian van den Broek
  0 siblings, 1 reply; 13+ messages in thread
From: Eric S Fraga @ 2011-10-26  7:56 UTC (permalink / raw)
  To: Brian van den Broek; +Cc: Bastien, emacs-orgmode

Brian van den Broek <brian.van.den.broek@gmail.com> writes:

[...]

> Various people upthread convinced me that my feature request wasn't
> really worth it. (I do hope it didn't cost you too much time!) So, I
> am content to drop it here :-)

but did you try a simple keyboard macro in the end as suggested by the
first response?  this requires no elisp programming.  if your actions
consist of selecting region and then applying org-time-stamp on it, the
following keystrokes should record the steps necessary to do what you
want *after* you have selected the desired region:

C-x ( C-w C-c . C-y RET C-x )

(untested sequence of keystrokes)

Your macro is now recorded and can be executed by "C-x e" once you have
selected a region.  You can even save that macro (check the info pages
for emacs) and bind it to a key.

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.90.1
: using Org-mode version 7.7 (release_7.7.381.g05ea.dirty)

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-26  7:56               ` Eric S Fraga
@ 2011-10-26 12:00                 ` Brian van den Broek
  0 siblings, 0 replies; 13+ messages in thread
From: Brian van den Broek @ 2011-10-26 12:00 UTC (permalink / raw)
  To: emacs-orgmode, Bastien, Brian van den Broek

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

On 26 Oct 2011 09:56, "Eric S Fraga" <e.fraga@ucl.ac.uk> wrote:
>
> Brian van den Broek <brian.van.den.broek@gmail.com> writes:
>
> [...]
>
> > Various people upthread convinced me that my feature request wasn't
> > really worth it. (I do hope it didn't cost you too much time!) So, I
> > am content to drop it here :-)
>
> but did you try a simple keyboard macro in the end as suggested by the
> first response?

<snip>

Hi Eric,

I did. That that solution was pointed out helped me see that my suggestion
had little value. :--)

Thanks, though, for making the effort to give explicit details!

Best,

Brian vdB

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

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

* Re: feature suggestion: apply datetime prompt magic to selected region
  2011-10-06 12:40 Brian van den Broek
@ 2011-12-28 16:18 ` Bastien
  0 siblings, 0 replies; 13+ messages in thread
From: Bastien @ 2011-12-28 16:18 UTC (permalink / raw)
  To: Brian van den Broek; +Cc: emacs-orgmode

Hi Brian,

Brian van den Broek <vanden@gmail.com> writes:

> I very much appreciate orgmode's ability to parse the content of a
> yank for date and time information while entering a timestamp. I think
> it would be even cooler were orgmode able to parse the content of a
> selected region and extract the same information, replacing the region
> with the timestamp created on the basis of the text in the region.

I'm not sure I understand: right now, when you select a timestamp and
run `C-c .' on it, the selected timestamp is the default prompt.  Is
this what you have in mind?  If not, can you give a clearer example?

Thanks!

-- 
 Bastien

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

end of thread, other threads:[~2011-12-31  8:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-06 12:48 feature suggestion: apply datetime prompt magic to selected region Brian van den Broek
2011-10-06 19:46 ` Achim Gratz
2011-10-06 22:38   ` Brian van den Broek
2011-10-07  8:12     ` suvayu ali
2011-10-07 14:36       ` Brian van den Broek
2011-10-07 15:42         ` Nick Dokos
2011-10-08  7:33         ` suvayu ali
2011-10-24  6:00           ` Bastien
2011-10-25 16:56             ` Brian van den Broek
2011-10-26  7:56               ` Eric S Fraga
2011-10-26 12:00                 ` Brian van den Broek
  -- strict thread matches above, loose matches on Subject: below --
2011-10-06 12:40 Brian van den Broek
2011-12-28 16:18 ` Bastien

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