emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* problem with mime conversion for emails
@ 2010-08-29 20:03 Eric S Fraga
  2010-08-29 20:52 ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Eric S Fraga @ 2010-08-29 20:03 UTC (permalink / raw)
  To: org-mode mailing list

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

Hello,

I am hoping somebody can suggest a workaround for a simple problem
with org-mime.  Specifically, I am in charge of a project in which I
need to email around a to do list with checkboxes.  I have been using
PDF export for this and this works perfectly fine.  However, given the
existence of org-mime, I thought this would remove a step from those
reading my emails.

The problem is that the HTML conversion for checkbox lists uses the 
construct

: <span style="visibility:hidden;">X</span>

(generated on line 1765 of org-html.el) to fill in the checkboxes for
items *not* done.  Unfortunately, the visibility attribute is ignored
by some email readers, with /Gmail/ being one of the prominent guilty
ones.  This makes my todo lists look like everything is already done
and we can all go home early!  How I wish this were true... ;-)

The whole reason for the use of the visibility attribute, I assume, is
to line entries up.

I am happy to do some post-processing on the HTML output but I think a
better solution may be to do this export differently.  Does anybody
have any suggestions?  Would replacing the X in the above with &nbsp;
be good enough?

Thanks,
eric

[-- Attachment #2: Type: text/plain, Size: 75 bytes --]

-- 
Eric S Fraga
GnuPG: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D

[-- Attachment #3: 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] 3+ messages in thread

* Re: problem with mime conversion for emails
  2010-08-29 20:03 problem with mime conversion for emails Eric S Fraga
@ 2010-08-29 20:52 ` Eric Schulte
  2010-08-30 13:05   ` Eric S Fraga
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2010-08-29 20:52 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: org-mode mailing list

Hi Eric,

An easy fix may be using the `org-mime-html-hook' to post-process the
html, the following (untested) should be sufficient.

--8<---------------cut here---------------start------------->8---
(add-hook 'org-mime-html-hook
          (lambda ()
            (replace-regexp
             (regexp-quote "<span style=\"visibility:hidden;\">X</span>")
             "&nbsp;")))
--8<---------------cut here---------------end--------------->8---

To me, this seems easier than having an email-specific export target.

Best -- Eric

Eric S Fraga <ucecesf@ucl.ac.uk> writes:

> Hello,
>
> I am hoping somebody can suggest a workaround for a simple problem
> with org-mime.  Specifically, I am in charge of a project in which I
> need to email around a to do list with checkboxes.  I have been using
> PDF export for this and this works perfectly fine.  However, given the
> existence of org-mime, I thought this would remove a step from those
> reading my emails.
>
> The problem is that the HTML conversion for checkbox lists uses the 
> construct
>
> : <span style="visibility:hidden;">X</span>
>
> (generated on line 1765 of org-html.el) to fill in the checkboxes for
> items *not* done.  Unfortunately, the visibility attribute is ignored
> by some email readers, with /Gmail/ being one of the prominent guilty
> ones.  This makes my todo lists look like everything is already done
> and we can all go home early!  How I wish this were true... ;-)
>
> The whole reason for the use of the visibility attribute, I assume, is
> to line entries up.
>
> I am happy to do some post-processing on the HTML output but I think a
> better solution may be to do this export differently.  Does anybody
> have any suggestions?  Would replacing the X in the above with &nbsp;
> be good enough?
>
> Thanks,
> eric

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

* Re: problem with mime conversion for emails
  2010-08-29 20:52 ` Eric Schulte
@ 2010-08-30 13:05   ` Eric S Fraga
  0 siblings, 0 replies; 3+ messages in thread
From: Eric S Fraga @ 2010-08-30 13:05 UTC (permalink / raw)
  To: Eric Schulte; +Cc: org-mode mailing list

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

On Sun, 29 Aug 2010 14:52:10 -0600, "Eric Schulte" <schulte.eric@gmail.com> wrote:
> 
> Hi Eric,
> 
> An easy fix may be using the `org-mime-html-hook' to post-process the
> html, the following (untested) should be sufficient.
> 
> --8<---------------cut here---------------start------------->8---
> (add-hook 'org-mime-html-hook
>           (lambda ()
>             (replace-regexp
>              (regexp-quote "<span style=\"visibility:hidden;\">X</span>")
>              "&nbsp;")))
> --8<---------------cut here---------------end--------------->8---
> 
> To me, this seems easier than having an email-specific export target.

Yes, this is probably the best approach (and thanks for the actual
elisp code which is nice and succinct!).

I do still wonder at the need for the extra level of complexity
introduced by the visibility attribute, especially given that the
checkboxes only line up if none of them is of the type [-]...

Anyway, I've put this code in my config!  Thanks again.
eric

[-- Attachment #2: Type: text/plain, Size: 75 bytes --]

-- 
Eric S Fraga
GnuPG: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D

[-- Attachment #3: 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] 3+ messages in thread

end of thread, other threads:[~2010-08-30 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-29 20:03 problem with mime conversion for emails Eric S Fraga
2010-08-29 20:52 ` Eric Schulte
2010-08-30 13:05   ` Eric S Fraga

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