* Property inheritance for MAIL_FMT, MAIL_TO, MAIL_CC and MAIL_BCC
@ 2011-01-13 22:47 niels giesen
2011-01-14 0:11 ` Eric Schulte
0 siblings, 1 reply; 4+ messages in thread
From: niels giesen @ 2011-01-13 22:47 UTC (permalink / raw)
To: Eric Schulte; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1773 bytes --]
Hi Eric,
Please see the patch below, it adds property inheritance for all
MAIL_* properties, based on the value of
`org-use-property-inheritance'.
#+begin_src diff
diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
index 68a3498..ae430fb 100644
--- a/contrib/lisp/org-mime.el
+++ b/contrib/lisp/org-mime.el
@@ -232,9 +232,9 @@ export that region, otherwise export the entire body."
(run-hooks 'org-mime-send-subtree-hook)
(let* ((file (buffer-file-name (current-buffer)))
(subject (nth 4 (org-heading-components)))
- (to (org-entry-get nil "MAIL_TO"))
- (cc (org-entry-get nil "MAIL_CC"))
- (bcc (org-entry-get nil "MAIL_BCC"))
+ (to (org-entry-get nil "MAIL_TO" org-use-property-inheritance))
+ (cc (org-entry-get nil "MAIL_CC" org-use-property-inheritance))
+ (bcc (org-entry-get nil "MAIL_BCC" org-use-property-inheritance))
(body (buffer-substring
(save-excursion (goto-char (point-min))
(forward-line 1)
@@ -311,6 +311,8 @@ export that region, otherwise export the entire body."
exported to a org format or to the format specified by the
MAIL_FMT property of the subtree."
(interactive)
- (org-mime-send-subtree (or (org-entry-get nil "MAIL_FMT") 'org)))
+ (org-mime-send-subtree (or (org-entry-get nil "MAIL_FMT"
+ org-use-property-inheritance)
+ 'org)))
(provide 'org-mime)
#+end_src
The current mail was sent with it, where some parent tree has the
mail_cc set to this list, but the mail_to set to your email address in
the subtree. I believe this functionality can be quite handy.
niels
--
http://pft.github.com
[-- Attachment #1.2: Type: application/pgp-signature, Size: 196 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Property inheritance for MAIL_FMT, MAIL_TO, MAIL_CC and MAIL_BCC
2011-01-13 22:47 Property inheritance for MAIL_FMT, MAIL_TO, MAIL_CC and MAIL_BCC niels giesen
@ 2011-01-14 0:11 ` Eric Schulte
2011-01-14 9:29 ` Sébastien Vauban
0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2011-01-14 0:11 UTC (permalink / raw)
To: niels giesen; +Cc: emacs-orgmode
This is now applied.
Thanks for the patch, and for the motivating usage example. -- Eric
niels giesen <niels.giesen@gmail.com> writes:
> Hi Eric,
>
> Please see the patch below, it adds property inheritance for all
> MAIL_* properties, based on the value of
> `org-use-property-inheritance'.
>
> #+begin_src diff
> diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
> index 68a3498..ae430fb 100644
> --- a/contrib/lisp/org-mime.el
> +++ b/contrib/lisp/org-mime.el
> @@ -232,9 +232,9 @@ export that region, otherwise export the entire body."
> (run-hooks 'org-mime-send-subtree-hook)
> (let* ((file (buffer-file-name (current-buffer)))
> (subject (nth 4 (org-heading-components)))
> - (to (org-entry-get nil "MAIL_TO"))
> - (cc (org-entry-get nil "MAIL_CC"))
> - (bcc (org-entry-get nil "MAIL_BCC"))
> + (to (org-entry-get nil "MAIL_TO" org-use-property-inheritance))
> + (cc (org-entry-get nil "MAIL_CC" org-use-property-inheritance))
> + (bcc (org-entry-get nil "MAIL_BCC" org-use-property-inheritance))
> (body (buffer-substring
> (save-excursion (goto-char (point-min))
> (forward-line 1)
> @@ -311,6 +311,8 @@ export that region, otherwise export the entire body."
> exported to a org format or to the format specified by the
> MAIL_FMT property of the subtree."
> (interactive)
> - (org-mime-send-subtree (or (org-entry-get nil "MAIL_FMT") 'org)))
> + (org-mime-send-subtree (or (org-entry-get nil "MAIL_FMT"
> + org-use-property-inheritance)
> + 'org)))
>
> (provide 'org-mime)
> #+end_src
>
> The current mail was sent with it, where some parent tree has the
> mail_cc set to this list, but the mail_to set to your email address in
> the subtree. I believe this functionality can be quite handy.
>
> niels
> --
> http://pft.github.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Property inheritance for MAIL_FMT, MAIL_TO, MAIL_CC and MAIL_BCC
2011-01-14 0:11 ` Eric Schulte
@ 2011-01-14 9:29 ` Sébastien Vauban
2011-01-14 13:32 ` Eric Schulte
0 siblings, 1 reply; 4+ messages in thread
From: Sébastien Vauban @ 2011-01-14 9:29 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Eric and Niels,
"Eric Schulte" wrote:
> niels giesen <niels.giesen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>> Please see the patch below, it adds property inheritance for all
>> MAIL_* properties, based on the value of
>> `org-use-property-inheritance'.
>
> Thanks for the patch, and for the motivating usage example. -- Eric
If I understand correctly, one must enable =org-use-property-inheritance= for
the above to be in effect.
Though, this is discouraged in the doc:
,----
| org-use-property-inheritance is a variable defined in `org.el'.
| Its value is nil
|
| Documentation:
| Non-nil means properties apply also for sublevels.
|
| This setting is chiefly used during property searches. Turning it on can
| cause significant overhead when doing a search, which is why it is not
| on by default.
`----
Couldn't we either:
- consider the MAIL_* properties as the *_ALL ones that well have inheritance
enabled by default?
,----
| However, note that some special properties use inheritance under special
| circumstances (not in searches). Examples are CATEGORY, ARCHIVE, COLUMNS,
| and the properties ending in "_ALL" when they are used as descriptor
| for valid values of a property.
`----
- have a setting allowing for the inheritance of just these special
properties, as an extra, in order not to penalize too much the searches?
Best regards,
Seb
--
Sébastien Vauban
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: Property inheritance for MAIL_FMT, MAIL_TO, MAIL_CC and MAIL_BCC
2011-01-14 9:29 ` Sébastien Vauban
@ 2011-01-14 13:32 ` Eric Schulte
0 siblings, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2011-01-14 13:32 UTC (permalink / raw)
To: Sébastien Vauban; +Cc: emacs-orgmode
Hi Seb,
Good idea, I've just placed this behind a new
`org-mime-use-property-inheritance' variable which will default to nil.
I was originally going to have this variable default to t, but the idea
of causing people to accidentally add unintended recipients to emails is
too scary.
Thanks for the suggestion -- Eric
Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> writes:
> Hi Eric and Niels,
>
> "Eric Schulte" wrote:
>> niels giesen <niels.giesen@gmail.com> writes:
>>> Please see the patch below, it adds property inheritance for all
>>> MAIL_* properties, based on the value of
>>> `org-use-property-inheritance'.
>>
>> Thanks for the patch, and for the motivating usage example. -- Eric
>
> If I understand correctly, one must enable =org-use-property-inheritance= for
> the above to be in effect.
>
> Though, this is discouraged in the doc:
>
> ,----
> | org-use-property-inheritance is a variable defined in `org.el'.
> | Its value is nil
> |
> | Documentation:
> | Non-nil means properties apply also for sublevels.
> |
> | This setting is chiefly used during property searches. Turning it on can
> | cause significant overhead when doing a search, which is why it is not
> | on by default.
> `----
>
> Couldn't we either:
>
> - consider the MAIL_* properties as the *_ALL ones that well have inheritance
> enabled by default?
>
> ,----
> | However, note that some special properties use inheritance under special
> | circumstances (not in searches). Examples are CATEGORY, ARCHIVE, COLUMNS,
> | and the properties ending in "_ALL" when they are used as descriptor
> | for valid values of a property.
> `----
>
> - have a setting allowing for the inheritance of just these special
> properties, as an extra, in order not to penalize too much the searches?
>
> Best regards,
> Seb
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-14 13:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 22:47 Property inheritance for MAIL_FMT, MAIL_TO, MAIL_CC and MAIL_BCC niels giesen
2011-01-14 0:11 ` Eric Schulte
2011-01-14 9:29 ` Sébastien Vauban
2011-01-14 13:32 ` Eric Schulte
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).