all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Adding an item to the agenda from the agenda view
@ 2018-03-04 22:22 Shérab
  2018-03-05  6:52 ` Eric S Fraga
  0 siblings, 1 reply; 12+ messages in thread
From: Shérab @ 2018-03-04 22:22 UTC (permalink / raw)
  To: Emacs-orgmode

Dear org-mode friends,

I use currently only one agenda file. Sometimes, when I need to plan for
something, I check the agenda
views to find a day when I am available to do that thing. Once I have
found this day in the view, I would like to add an item with the
corresponding date to my agenda file. What would be the most direct /
straightforward / idiomatic way to achieve this, please?

I read section 10.5 in the manual and the closest thing I could find was
k to capture, but I think even this is not doing exactly what I am
looking for.

Many thanks in advance for your help!

Shérab.

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-04 22:22 Adding an item to the agenda from the agenda view Shérab
@ 2018-03-05  6:52 ` Eric S Fraga
  2018-03-05  9:05   ` Neil Jerram
  0 siblings, 1 reply; 12+ messages in thread
From: Eric S Fraga @ 2018-03-05  6:52 UTC (permalink / raw)
  To: Emacs-orgmode

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

On Sunday,  4 Mar 2018 at 23:22, Shérab wrote:
> I would like to add an item with the
> corresponding date to my agenda file. What would be the most direct /
> straightforward / idiomatic way to achieve this, please?

try "i d".  "i" should be bound to org-agenda-diary-entry.  This is the
route I use for adding entries to my agenda all the time.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-05  6:52 ` Eric S Fraga
@ 2018-03-05  9:05   ` Neil Jerram
  2018-03-05 10:31     ` Eric S Fraga
  0 siblings, 1 reply; 12+ messages in thread
From: Neil Jerram @ 2018-03-05  9:05 UTC (permalink / raw)
  To: emacs-orgmode, Eric S Fraga, Emacs-orgmode

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

Eric,

IIUC, that would add an entry to the 'diary' file.  I thought perhaps that Shérab meant something different, namely to capture a new TODO item that was scheduled for that date.

In any case, I think that latter thing is also an interesting thing to do. Is there an easy way to do that?

Best wishes - Neil


On 5 March 2018 06:52:40 GMT+00:00, Eric S Fraga <esflists@gmail.com> wrote:
>On Sunday,  4 Mar 2018 at 23:22, Shérab wrote:
>> I would like to add an item with the
>> corresponding date to my agenda file. What would be the most direct /
>> straightforward / idiomatic way to achieve this, please?
>
>try "i d".  "i" should be bound to org-agenda-diary-entry.  This is the
>route I use for adding entries to my agenda all the time.
>
>-- 
>Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d

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

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-05  9:05   ` Neil Jerram
@ 2018-03-05 10:31     ` Eric S Fraga
  2018-03-05 17:50       ` Manuel Hermenegildo
  2018-03-05 19:20       ` Eduardo Mercovich
  0 siblings, 2 replies; 12+ messages in thread
From: Eric S Fraga @ 2018-03-05 10:31 UTC (permalink / raw)
  To: Neil Jerram; +Cc: emacs-orgmode

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

On Monday,  5 Mar 2018 at 09:05, Neil Jerram wrote:
> Eric,
>
> IIUC, that would add an entry to the 'diary' file.

Hi Neil,

You are correct.  However, if you have defined org-agenda-diary-file, an
org entry is added via org-agenda-diary-entry-in-org-file.

> I thought perhaps that Shérab meant something different, namely to
> capture a new TODO item that was scheduled for that date.

Maybe.  The post was vague.  I read it the other way.  Shérab?

For TODO, org-agenda-capture (bound to "k" I believe?) already does what
you think Shérab wanted, I would have thought?  What is missing?

For me, looking at dates in the agenda is about checking availability
and this usually means I am looking at creating a new appointment.  "i
d" is perfect for this.


-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-05 10:31     ` Eric S Fraga
@ 2018-03-05 17:50       ` Manuel Hermenegildo
  2018-03-05 19:20       ` Eduardo Mercovich
  1 sibling, 0 replies; 12+ messages in thread
From: Manuel Hermenegildo @ 2018-03-05 17:50 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: Neil Jerram, emacs-orgmode


I enclose some code that I find quite useful for this purpose (i.e.,
to get a similar "feel" to inserting tasks in a traditional
agenda). It basically uses capture but speeds things up a bit and
allows taking times from an agenda time grid. Cheers, --Manuel


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; A handy shortcut to use capture in today in agenda
;; 
;; The idea is that you type "+" while at an agenda day, fill in the
;; TODO that pops up, and type "C-CC-c": the TODO gets added to the
;; first file in your org-agenda-files, after an "* Auto-inserted
;; tasks" entry. It also tries to capture the time if you are on an
;; agenda schedule.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Use the current date when possible
(setq org-capture-use-agenda-date t)
;; Recalculate agenda after captures
(add-hook 'org-capture-after-finalize-hook 'org-agenda-redo)
;; Key binding (+)
(add-hook 
 'org-mode-hook
 (lambda ()
   (define-key org-agenda-keymap   "+" 'my-org-agenda-capture-in-date-at-point)
   (define-key org-agenda-mode-map "+" 'my-org-agenda-capture-in-date-at-point)
 ))
;; Quick interface to capture
(defun my-org-agenda-capture-in-date-at-point ()
  "Call parts of `org-capture' with the date at point (and time if available)."
  (interactive)
  (if (not (eq major-mode 'org-agenda-mode))
      (user-error "You cannot do this outside of agenda buffers")
    (let ((org-overriding-default-time (org-get-cursor-date t)))
      ; (print (concat "*** " (format-time-string "%F %T" org-overriding-default-time)))
      (org-capture 1 "+")
      )))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Connection w/org-capture
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The org file in which tasks are inserted. An entry:
;; "* Auto-inserted tasks"
;; should exist in that file. 
;; In this case we take the first org file in org-agenda-files:
(setq org-default-notes-file (car org-agenda-files))
;; The capture template (You may have other org-capture-templates --
;; in that case simply add this one to the list)
(setq org-capture-templates 
'(("+" "Special template used by + keybinding" entry 
   (file+headline "" "Auto-inserted tasks")
   "** TODO %? %(if (string= (substring \"%T\" 16 21) \"00:00\") \"%t\" \"%T\")"
   :prepend t :empty-lines-after 1)
  ))


On Monday, March 5, 2018 at 10:31:28 (+0000), Eric S Fraga wrote:
 > On Monday,  5 Mar 2018 at 09:05, Neil Jerram wrote:
 > > Eric,
 > >
 > > IIUC, that would add an entry to the 'diary' file.
 > 
 > Hi Neil,
 > 
 > You are correct.  However, if you have defined org-agenda-diary-file, an
 > org entry is added via org-agenda-diary-entry-in-org-file.
 > 
 > > I thought perhaps that Shérab meant something different, namely to
 > > capture a new TODO item that was scheduled for that date.
 > 
 > Maybe.  The post was vague.  I read it the other way.  Shérab?
 > 
 > For TODO, org-agenda-capture (bound to "k" I believe?) already does what
 > you think Shérab wanted, I would have thought?  What is missing?
 > 
 > For me, looking at dates in the agenda is about checking availability
 > and this usually means I am looking at creating a new appointment.  "i
 > d" is perfect for this.
 > 
 > 
 > -- 
 > Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d
 > x[DELETED ATTACHMENT signature.asc, application/pgp-signature]

-- 
-------------------------------------------------------------------------
 Manuel Hermenegildo                       manuel.hermenegildo@imdea.org
-------------------------------------------------------------------------

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-05 10:31     ` Eric S Fraga
  2018-03-05 17:50       ` Manuel Hermenegildo
@ 2018-03-05 19:20       ` Eduardo Mercovich
  2018-03-06 21:15         ` Shérab
  1 sibling, 1 reply; 12+ messages in thread
From: Eduardo Mercovich @ 2018-03-05 19:20 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: Neil Jerram, emacs-orgmode

Dear all.

[...]
> For TODO, org-agenda-capture (bound to "k" I believe?) already 
> does what you think Shérab wanted, I would have thought? What is 
> missing?

I understood it this way too. If you have a template defined for 
"event" it is "k e" and you're done...


-- 
eduardo mercovich

 Donde se cruzan tus talentos 
 con las necesidades del mundo, 
 ahí está tu vocación. 
 (Anónimo)

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-05 19:20       ` Eduardo Mercovich
@ 2018-03-06 21:15         ` Shérab
  2018-03-06 23:06           ` Eric Abrahamsen
  2018-03-07  7:13           ` Eric S Fraga
  0 siblings, 2 replies; 12+ messages in thread
From: Shérab @ 2018-03-06 21:15 UTC (permalink / raw)
  To: emacs-orgmode

Dear all,

Many thanks for your responses.

So as I understand it,there are two ways to achieve what I am trying to
do: either through diary, or through capture.

I am not sure which I should choose, though.

Since it seems my initial message was somehow unclear, let me try to
explain what I am trying to achieve again.

I have only one agenda file, ~/gtd/agenda.org.

It consists of only headings with active timestamps.

When I want to schedule a dinner with John, what I currently do is:

1. C-c a a

2. Look for a date

3. (say I find that April 1st isalright)

4. quit the agenda view

5. Visit the buffer corresponding to ~/gtd/agenda.org

6. Go to the end of that buffer with M->

7. Add a heading like
* Dinner with John

8. Use C-c . to add the date, 1 apr <ret>

I am fine with steps 1 to 3 but would like to do steps 4 to 8 in a much
more efficient way, without having to re-enter the date, but with the
same result,i.e. the heading being added atthe endo of ~/gtd/agenda.org

Do I make more sense this time?

Thanks again for you help!

Shérab.

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-06 21:15         ` Shérab
@ 2018-03-06 23:06           ` Eric Abrahamsen
  2018-03-07  7:13           ` Eric S Fraga
  1 sibling, 0 replies; 12+ messages in thread
From: Eric Abrahamsen @ 2018-03-06 23:06 UTC (permalink / raw)
  To: emacs-orgmode

Shérab <Sebastien.Hinderer@ens-lyon.org> writes:

> Dear all,

[...]

> When I want to schedule a dinner with John, what I currently do is:
>
> 1. C-c a a
>
> 2. Look for a date
>
> 3. (say I find that April 1st isalright)
>
> 4. quit the agenda view
>
> 5. Visit the buffer corresponding to ~/gtd/agenda.org
>
> 6. Go to the end of that buffer with M->
>
> 7. Add a heading like
> * Dinner with John
>
> 8. Use C-c . to add the date, 1 apr <ret>

Yup, it's "k" in the Agenda that you want. First, set up your
org-capture templates appropriately. I've got one for exactly this
purpose that looks like:

("e" "Event" entry (file "~/org/schedule.org")
 "* %?\n%^T")

Any capture template that has one of the "t/T" expansion elements will
default to the date under point in the Agenda. So after step 3 above,
hit "k", choose this template, and it will help you fill in the correct
information. "C-c C-c", and you're done. You actually never have to look
at the agenda.org file.

Eric

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-06 21:15         ` Shérab
  2018-03-06 23:06           ` Eric Abrahamsen
@ 2018-03-07  7:13           ` Eric S Fraga
  2018-03-09 19:23             ` Shérab
  1 sibling, 1 reply; 12+ messages in thread
From: Eric S Fraga @ 2018-03-07  7:13 UTC (permalink / raw)
  To: emacs-orgmode

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

On Tuesday,  6 Mar 2018 at 22:15, Shérab wrote:

[...]

> I am fine with steps 1 to 3 but would like to do steps 4 to 8 in a much
> more efficient way, without having to re-enter the date, but with the
> same result,i.e. the heading being added atthe endo of ~/gtd/agenda.org
>
> Do I make more sense this time?

Yes.  And my original response is what you want.

Set org-agenda-diary-file to "~/gtd/agenda.org".  Then, from within the
agenda view, if you type "i d", you will be creating a new agenda entry
for the day you are looking at.  That's steps 4 to 8 in a nutshell.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-07  7:13           ` Eric S Fraga
@ 2018-03-09 19:23             ` Shérab
  2018-03-09 21:27               ` Nick Dokos
  0 siblings, 1 reply; 12+ messages in thread
From: Shérab @ 2018-03-09 19:23 UTC (permalink / raw)
  To: emacs-orgmode

Dear all,

Many, many thanks for all your responses!

I tried the diary one which seemed like the simplest to set-up. It
indeed adds an entry, but in a strange way:it adds a level 1 headingfor
the year, a level 2 heading for the month, a level 3 heading for the day
and a level 4 heading for the event, that has the actual time-stamp.

I guess it's not very important e.g. if you never read the agenda file
itself but I may still prefer the capture solution which as I understand
it requires a bit more customization but also brings greater
flexibility.

Thanks again for all the solutions you guys provided!

Shérab.

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-09 19:23             ` Shérab
@ 2018-03-09 21:27               ` Nick Dokos
  2018-03-09 21:45                 ` Shérab
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2018-03-09 21:27 UTC (permalink / raw)
  To: emacs-orgmode

Shérab <Sebastien.Hinderer@ens-lyon.org> writes:

> Dear all,
>
> Many, many thanks for all your responses!
>
> I tried the diary one which seemed like the simplest to set-up. It
> indeed adds an entry, but in a strange way:it adds a level 1 headingfor
> the year, a level 2 heading for the month, a level 3 heading for the day
> and a level 4 heading for the event, that has the actual time-stamp.
>
> I guess it's not very important e.g. if you never read the agenda file
> itself but I may still prefer the capture solution which as I understand
> it requires a bit more customization but also brings greater
> flexibility.
>
> Thanks again for all the solutions you guys provided!
>
> Shérab.
>
>

IMO, you should bite the bullet and define a capture template: it
gives you flexibility that you cannot get any other way. Sooner or
later, you are going to go that way anyway, so why not start now?

-- 
Nick

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

* Re: Adding an item to the agenda from the agenda view
  2018-03-09 21:27               ` Nick Dokos
@ 2018-03-09 21:45                 ` Shérab
  0 siblings, 0 replies; 12+ messages in thread
From: Shérab @ 2018-03-09 21:45 UTC (permalink / raw)
  To: emacs-orgmode

Dear Nick,

Nick Dokos (2018/03/09 16:27 -0500):
> IMO, you should bite the bullet and define a capture template: it
> gives you flexibility that you cannot get any other way. Sooner or
> later, you are going to go that way anyway, so why not start now?

Yeah I fully agree. As soon as I'll have the time I'lldo it,taking
inspiration of the responsesreceived here.

I jsut wanted to try the solutions from the "easiest" to the more
elaborated ones.

Cheers!

Shérab.

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

end of thread, other threads:[~2018-03-09 21:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-04 22:22 Adding an item to the agenda from the agenda view Shérab
2018-03-05  6:52 ` Eric S Fraga
2018-03-05  9:05   ` Neil Jerram
2018-03-05 10:31     ` Eric S Fraga
2018-03-05 17:50       ` Manuel Hermenegildo
2018-03-05 19:20       ` Eduardo Mercovich
2018-03-06 21:15         ` Shérab
2018-03-06 23:06           ` Eric Abrahamsen
2018-03-07  7:13           ` Eric S Fraga
2018-03-09 19:23             ` Shérab
2018-03-09 21:27               ` Nick Dokos
2018-03-09 21:45                 ` Shérab

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.