From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: email ui choices? Date: Tue, 14 Jul 2015 16:51:41 -0400 Message-ID: References: <20150714084809.GB11584@unser.net> <87lhejvwox.fsf@ericabrahamsen.net> <874ml7vv0j.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec5486072590181051adc01c1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF7B1-0004vV-Rt for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 16:51:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZF7B0-0002EZ-17 for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 16:51:43 -0400 Received: from mail-vn0-x229.google.com ([2607:f8b0:400c:c0f::229]:45030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZF7Az-0002EU-RU for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 16:51:41 -0400 Received: by vnbg129 with SMTP id g129so2384342vnb.11 for ; Tue, 14 Jul 2015 13:51:41 -0700 (PDT) In-Reply-To: <874ml7vv0j.fsf@ericabrahamsen.net> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode --bcaec5486072590181051adc01c1 Content-Type: text/plain; charset=UTF-8 On Tue, Jul 14, 2015 at 7:27 AM, Eric Abrahamsen wrote: > Matt Price writes: > > > On Tue, Jul 14, 2015 at 6:51 AM, Eric Abrahamsen < > eric@ericabrahamsen.net> wrote: > > [...] > > > I'll include a shameless-plug-cum-general-recommendation: I use > org-attach a lot to keep files associated with Org headings, and to me > this feels like a natural use-case for that. > Yes, it sounds like a pretty good idea. I am trying to figure out a couple of attachment issues; to start with, I was hoping to set a dnd-handler, anmd have drag-and-dropping local files create an attachment. I am close, but the actual attachment isn't being created. This is what I have: (setq dnd-protocol-alist `(("^\\(file\\)://" . mwp-file-dnd) ,@dnd-protocol-alist)) (defun mwp-file-dnd (uri action) (cond ((eq major-mode 'org-mode) ;; (message uri) (insert "[[%s][Description Property") (org-attach-attach uri nil "lns" ) ;; this appears to work, but doesn't create the link ) (t (let ((dnd-protocol-alist (rassq-delete-all 'mwp-file-dnd (copy-alist dnd-protocol-alist)))) (dnd-handle-one-url nil action uri))) )) > I wrote a library called Gnorb (in the package manager) that provides > some glue-code between Gnus and Org (and BBDB), and there are a few > hooks in there that might be useful to you. > > It sounds like you're digesting quite a bit all at once, so you probably > don't want to install all of Gnorb. If you're interested in some of the > bits, I might be able to peel those off into separate functions: > specifically, taking files from the org-attach directory and attaching > them to outgoing emails being sent from an Org heading. I can't promise > I could do it cleanly, but I'd be happy to look into it. > If you could do that, that would be just super. Right now my lone mailing function sends me to message-mode: (defun mime-send-mail () "org-mime-subtree and HTMLize" (interactive) (org-mark-subtree) (let ((subject (nth 4 (org-heading-components)))) (org-mime-subtree) (insert "\nBest,\nMP.\n") (org-mime-htmlize) (command-execute 'mml-attach-file) (message-goto-to) ) ) mml-attach-file asks a whole bunch of questions about mime type, etc. I don't know how to fill those values in automatically, but I guess it would be, in pseudo code (dolist (thisfile org-attach-all-attachments) (mml-attach-file thisfile FILL IN OTHER ARGUMENTS) If you have something like that in gnorb that'd be awesome. Thanks once again, Matt --bcaec5486072590181051adc01c1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Tue, Jul 14, 2015 at 7:27 AM, Eric Abrahamsen <= eric@ericabrah= amsen.net> wrote:
Matt Price <moptop99@gmail.com> writes:

> On Tue, Jul 14, 2015 at 6:51 AM, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:

[...]


I'll include a shameless-plug-cum-general-recommendation: I use<= br> org-attach a lot to keep files associated with Org headings, and to me
this feels like a natural use-case for that.

Yes, it sounds like a pretty good idea.=C2=A0 I am trying to figure o= ut a couple of attachment issues; to start with, I was hoping to set a dnd-= handler, anmd have drag-and-dropping local files create an attachment. I am= close, but the actual attachment isn't being created. This is what I h= ave:

(setq dnd-protocol-alist
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `((= "^\\(file\\)://" . mwp-file-dnd) ,@dnd-protocol-alist))

(d= efun mwp-file-dnd (uri action)
=C2=A0 (cond ((eq major-mode 'org-mod= e)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; (message uri)
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (insert "[[%s][Descri= ption Property")
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= org-attach-attach uri nil "lns" ) ;; this appears to work, but do= esn't create the link
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 )
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (t
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((dnd-protocol-alist
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (rassq-delete-all
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 'mwp-file-dnd
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (copy-alist dnd-protocol-alist))))
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (dnd-handle-one-url nil action u= ri)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ))


I wrote a library called Gnorb (in the package manager) that provides
some glue-code between Gnus and Org (and BBDB), and there are a few
hooks in there that might be useful to you.

It sounds like you're digesting quite a bit all at once, so you probabl= y
don't want to install all of Gnorb. If you're interested in some of= the
bits, I might be able to peel those off into separate functions:
specifically, taking files from the org-attach directory and attaching
them to outgoing emails being sent from an Org heading. I can't promise=
I could do it cleanly, but I'd be happy to look into it.

If you could do that, that would be just super.=C2=A0= Right now my lone mailing function sends me to message-mode:

=C2= =A0 (defun mime-send-mail ()
=C2=A0=C2=A0=C2=A0 "org-mime-subtree a= nd HTMLize"
=C2=A0=C2=A0=C2=A0 (interactive)
=C2=A0=C2=A0=C2=A0 = (org-mark-subtree)
=C2=A0=C2=A0=C2=A0 (let ((subject=C2=A0 (nth 4 (org-h= eading-components))))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (org-mime-subtree)<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (insert "\nBest,\nMP.\n")
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (org-mime-htmlize)
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (command-execute 'mml-attach-file)
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (message-goto-to)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )
=C2=A0= =C2=A0=C2=A0 )

mml-attach-file asks a whole bunch of ques= tions about mime type, etc.=C2=A0 I don't know how to fill those values= in automatically, but I guess it would be, in pseudo code
(dolist (thisfile org-attach-all-attachments) (mml-attach-file= thisfile FILL IN OTHER ARGUMENTS)

If you have something = like that in gnorb that'd be awesome.=C2=A0 Thanks once again,
Matt


--bcaec5486072590181051adc01c1--