Gnus development mailing list
 help / color / mirror / Atom feed
* gnorb: minor and mayor suggestions
@ 2016-03-25 17:58 Uwe Brauer
  2016-03-26  4:53 ` Eric Abrahamsen
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2016-03-25 17:58 UTC (permalink / raw)
  To: ding

Hi

First of all thanks to Eric for providing that package.[1] I thought of
sending him a private mail with some questions/suggestions but may be this
newsgroup is the better place.

Now I have 1 minor and two mayor suggestions (maybe they are already
implemented and I failed to find them).

* minor: right now my org template looks like
("r" "Reply" entry (file+headline "~/Mail/TODO-email.org" "Emails")
	 "** REPLY %a %?" :gnus-attachments t)

which is fine for the reply mails, but I would like to have something
similar for *composing messages*. So the idea would be to start from the
bbdb and then add a similar entry to TODO-email.org.


* mayor: editing emails in an org buffer and later send them.

  For some emails it turns out to be better to edit them in an
  org mode buffer, for example if I would like to edit a table and
  orgtbl-mode in message would not be enough. Right now I start editing
  those message in an org-file and then use the following function 

which I found in

http://kitchingroup.cheme.cmu.edu/blog/2014/06/08/Better-integration-of-org-mode-and-email/

(defun email-heading ()
  "Send the current org-mode heading as the body of an email,
  with headline as the subject. use these properties TO
OTHER-HEADERS is an alist specifying additional header fields.
Elements look like (HEADER . VALUE) where both HEADER and VALUE
are strings. save when it was sent as s SENT property. this is
overwritten on subsequent sends. could save them all in a
logbook?"
  (interactive)
  ; store location.
  (setq *email-heading-point* (set-marker (make-marker) (point)))
  (org-mark-subtree)
  (let ((content (buffer-substring (point) (mark)))
	(TO (org-entry-get (point) "TO" t))
	(CC (org-entry-get (point) "CC" t))
	(BCC (org-entry-get (point) "BCC" t))
	(SUBJECT (nth 4 (org-heading-components)))
	(OTHER-HEADERS (eval (org-entry-get (point) "OTHER-HEADERS")))
	(continue nil)
	(switch-function nil)
	(yank-action nil)
	(send-actions '((email-send-action . nil)))
	(return-action '(email-heading-return)))
    
    (compose-mail TO SUBJECT OTHER-HEADERS continue switch-function yank-action send-actions return-action)
    (message-goto-body)
    (insert content)
    (when CC
      (message-goto-cc)
      (insert CC))
    (when BCC
      (message-goto-bcc)
      (insert BCC))
    (if TO
	(message-goto-body)
      (message-goto-to))))

Could gnorb provide a similar functionality?

Whats about replying email? The above functions will copy all the text
below the org header into a message-buffer.

I modified it so that if I already hit the reply button but switch to
the org buffer, then the modified function copies the content below the
org header in that reply buffer.

Could gnorb provide a similar functionality?


Thanks

Uwe Brauer 


Footnotes: 
[1]   Till I got gnorb to work, I usually produced my TODO emails (TODO
      replies) by calling message-mail or reply and saved the message in
      the draft group. Now I run the org-template and save by TODO
      replies in on org buffer.





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

* Re: gnorb: minor and mayor suggestions
  2016-03-25 17:58 gnorb: minor and mayor suggestions Uwe Brauer
@ 2016-03-26  4:53 ` Eric Abrahamsen
  2016-03-26  8:57   ` Uwe Brauer
  2016-03-26 16:23   ` Uwe Brauer
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Abrahamsen @ 2016-03-26  4:53 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

> Hi
>
> First of all thanks to Eric for providing that package.[1] I thought of
> sending him a private mail with some questions/suggestions but may be this
> newsgroup is the better place.

Here's a fine place! I think that everything you're asking for is
already implemented, but let's make sure.

> Now I have 1 minor and two mayor suggestions (maybe they are already
> implemented and I failed to find them).
>
> * minor: right now my org template looks like
> ("r" "Reply" entry (file+headline "~/Mail/TODO-email.org" "Emails")
> 	 "** REPLY %a %?" :gnus-attachments t)
>
> which is fine for the reply mails, but I would like to have something
> similar for *composing messages*. So the idea would be to start from the
> bbdb and then add a similar entry to TODO-email.org.

I think `gnorb-gnus-outgoing-do-todo' is what you're after here. If you
compose a message from scratch, you can call that command from the
message buffer, and a new Org entry will be captured after sending the
message. I've got this:

(eval-after-load "message"
  '(progn
     (define-key message-mode-map (kbd "C-c t") 'gnorb-gnus-outgoing-do-todo)))

(setq gnorb-gnus-new-todo-capture-key "O")

Then the "O" template will be used to capture the sent message.

Alternately, call `gnorb-gnus-outgoing-do-todo' with a prefix argument,
and it will trigger todo state change on an existing Org heading instead
of creating a new one.

(And if you change your mind afterwards, call the command with a double
prefix to reset everything.)

It's all a bit confusing to explain, but once you've tried it, it should
make sense.

> * mayor: editing emails in an org buffer and later send them.
>
>   For some emails it turns out to be better to edit them in an
>   org mode buffer, for example if I would like to edit a table and
>   orgtbl-mode in message would not be enough. Right now I start editing
>   those message in an org-file and then use the following function 

[...]

> Could gnorb provide a similar functionality?

Sounds like you want `gnorb-org-email-subtree'. That will prompt you for
an export backend, and then it composes an email with the exported text
either in the body of the mail, or else attached as a file. The outgoing
message is tracked as usual.

> Whats about replying email? The above functions will copy all the text
> below the org header into a message-buffer.
>
> I modified it so that if I already hit the reply button but switch to
> the org buffer, then the modified function copies the content below the
> org header in that reply buffer.
>
> Could gnorb provide a similar functionality?

I'm not 100% sure I know what you mean here. Are you starting the
process from the Gnus *Summary* buffer? You want to start a reply to
message, but then hop to the associated Org heading, have the text
pasted into the body of the heading, then when you're done writing, jump
back to the message reply buffer and insert the text of the message?

Anyway let me know exactly what workflow you have in mind, and I'd be
happy to try to accommodate in gnorb.

Yours,
Eric




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

* Re: gnorb: minor and mayor suggestions
  2016-03-26  4:53 ` Eric Abrahamsen
@ 2016-03-26  8:57   ` Uwe Brauer
  2016-03-27  2:37     ` Eric Abrahamsen
  2016-03-26 16:23   ` Uwe Brauer
  1 sibling, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2016-03-26  8:57 UTC (permalink / raw)
  To: ding

>>> "Eric" == Eric Abrahamsen <eric@ericabrahamsen.net> writes:

    > Uwe Brauer <oub@mat.ucm.es> writes:
    >> Hi
    >> which is fine for the reply mails, but I would like to have something
    >> similar for *composing messages*. So the idea would be to start from the
    >> bbdb and then add a similar entry to TODO-email.org.

    > I think `gnorb-gnus-outgoing-do-todo' is what you're after here. If you
    > compose a message from scratch, you can call that command from the
    > message buffer, and a new Org entry will be captured after sending the
    > message. I've got this:

    > (eval-after-load "message"
    >   '(progn
    >      (define-key message-mode-map (kbd "C-c t") 'gnorb-gnus-outgoing-do-todo)))

    > (setq gnorb-gnus-new-todo-capture-key "O")

Here I am confused. I used in a compose-message-buffer
gnorb-gnus-outgoing-do-todo
but then what? I did not notice that anything (template) has been saved
to an org file.


    > Then the "O" template will be used to capture the sent message.

And this template I have define?

    > Alternately, call `gnorb-gnus-outgoing-do-todo' with a prefix argument,
    > and it will trigger todo state change on an existing Org heading instead
    > of creating a new one.

    > (And if you change your mind afterwards, call the command with a double
    > prefix to reset everything.)

I tried this as well but it did not work.

    > It's all a bit confusing to explain, but once you've tried it, it should
    > make sense.


    >> * mayor: editing emails in an org buffer and later send them.
    >> 
    >> For some emails it turns out to be better to edit them in an
    >> org mode buffer, for example if I would like to edit a table and
    >> orgtbl-mode in message would not be enough. Right now I start editing
    >> those message in an org-file and then use the following function 

    > [...]

    >> Could gnorb provide a similar functionality?

    > Sounds like you want `gnorb-org-email-subtree'. That will prompt you for
    > an export backend, and then it composes an email with the exported text
    > either in the body of the mail, or else attached as a file. The outgoing
    > message is tracked as usual.

Where do I have to execute that function? In the org buffer? In the mail
buffer? I played a bit around and it seems the the org buffer is the
right place, but where do I have to write the mail address? In the
heading?
So I tried 
** oub@mat.ucm.es
And used gnorb-org-email-subtree but now mail buffer popped up.
Could you give me a bit more details?

    >> Could gnorb provide a similar functionality?

    > I'm not 100% sure I know what you mean here. Are you starting the
    > process from the Gnus *Summary* buffer? You want to start a reply to
    > message, but then hop to the associated Org heading, have the text
    > pasted into the body of the heading, then when you're done writing, jump
    > back to the message reply buffer and insert the text of the message?

Precisely!
    > Anyway let me know exactly what workflow you have in mind, and I'd be
    > happy to try to accommodate in gnorb.

thanks

Uwe 




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

* Re: gnorb: minor and mayor suggestions
  2016-03-26  4:53 ` Eric Abrahamsen
  2016-03-26  8:57   ` Uwe Brauer
@ 2016-03-26 16:23   ` Uwe Brauer
  1 sibling, 0 replies; 5+ messages in thread
From: Uwe Brauer @ 2016-03-26 16:23 UTC (permalink / raw)
  To: ding

>>> "Eric" == Eric Abrahamsen <eric@ericabrahamsen.net> writes:

   > Uwe Brauer <oub@mat.ucm.es> writes:

   > Here's a fine place! I think that everything you're asking for is
   > already implemented, but let's make sure.

   > Sounds like you want `gnorb-org-email-subtree'. That will prompt you for
   > an export backend, and then it composes an email with the exported text
   > either in the body of the mail, or else attached as a file. The outgoing
   > message is tracked as usual.


Ok I got that to work, yes you were right, that was the functionality I
was looking for!


   >> Whats about replying email? The above functions will copy all the text
   >> below the org header into a message-buffer.
   >> 
   >> I modified it so that if I already hit the reply button but switch to
   >> the org buffer, then the modified function copies the content below the
   >> org header in that reply buffer.
   >> 
   >> Could gnorb provide a similar functionality?

   > I'm not 100% sure I know what you mean here. Are you starting the
   > process from the Gnus *Summary* buffer? You want to start a reply to
   > message, but then hop to the associated Org heading, have the text
   > pasted into the body of the heading, then when you're done writing, jump
   > back to the message reply buffer and insert the text of the message?

Precisely! This would be a functionality I would very much appreciate!

   > Anyway let me know exactly what workflow you have in mind, and I'd be
   > happy to try to accommodate in gnorb.

Uwe 




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

* Re: gnorb: minor and mayor suggestions
  2016-03-26  8:57   ` Uwe Brauer
@ 2016-03-27  2:37     ` Eric Abrahamsen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Abrahamsen @ 2016-03-27  2:37 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

>>>> "Eric" == Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>     > Uwe Brauer <oub@mat.ucm.es> writes:
>     >> Hi
>     >> which is fine for the reply mails, but I would like to have something
>     >> similar for *composing messages*. So the idea would be to start from the
>     >> bbdb and then add a similar entry to TODO-email.org.
>
>     > I think `gnorb-gnus-outgoing-do-todo' is what you're after here. If you
>     > compose a message from scratch, you can call that command from the
>     > message buffer, and a new Org entry will be captured after sending the
>     > message. I've got this:
>
>     > (eval-after-load "message"
>     >   '(progn
>     >      (define-key message-mode-map (kbd "C-c t") 'gnorb-gnus-outgoing-do-todo)))
>
>     > (setq gnorb-gnus-new-todo-capture-key "O")
>
> Here I am confused. I used in a compose-message-buffer
> gnorb-gnus-outgoing-do-todo
> but then what? I did not notice that anything (template) has been saved
> to an org file.
>
>
>     > Then the "O" template will be used to capture the sent message.
>
> And this template I have define?

You do have to define this template, but if it's not defined Gnorb
should complain to you: did you see any messages in the echo area?

>     > Alternately, call `gnorb-gnus-outgoing-do-todo' with a prefix argument,
>     > and it will trigger todo state change on an existing Org heading instead
>     > of creating a new one.
>
>     > (And if you change your mind afterwards, call the command with a double
>     > prefix to reset everything.)
>
> I tried this as well but it did not work.

Does it at least say "message associations reset" or something like that?

[...]

>    > Sounds like you want `gnorb-org-email-subtree'. That will prompt you for
>    > an export backend, and then it composes an email with the exported text
>    > either in the body of the mail, or else attached as a file. The outgoing
>    > message is tracked as usual.
>
>
> Ok I got that to work, yes you were right, that was the functionality I
> was looking for!

Good!

>
>    >> Whats about replying email? The above functions will copy all the text
>    >> below the org header into a message-buffer.
>    >> 
>    >> I modified it so that if I already hit the reply button but switch to
>    >> the org buffer, then the modified function copies the content below the
>    >> org header in that reply buffer.
>    >> 
>    >> Could gnorb provide a similar functionality?
>
>    > I'm not 100% sure I know what you mean here. Are you starting the
>    > process from the Gnus *Summary* buffer? You want to start a reply to
>    > message, but then hop to the associated Org heading, have the text
>    > pasted into the body of the heading, then when you're done writing, jump
>    > back to the message reply buffer and insert the text of the message?
>
> Precisely! This would be a functionality I would very much appreciate!

Let me have a little think about how this would work. I can imagine it
getting very messy very easily, but there's definitely something pretty
useful in there...




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

end of thread, other threads:[~2016-03-27  2:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-25 17:58 gnorb: minor and mayor suggestions Uwe Brauer
2016-03-26  4:53 ` Eric Abrahamsen
2016-03-26  8:57   ` Uwe Brauer
2016-03-27  2:37     ` Eric Abrahamsen
2016-03-26 16:23   ` Uwe Brauer

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 NNTP newsgroup(s).