Gnus development mailing list
 help / color / mirror / Atom feed
* text/calendar attachments invisible in gnus
@ 2012-11-30 21:46 Uwe Brauer
  2012-11-30 23:42 ` Steinar Bang
  2012-12-24  5:01 ` Leonidas Tsampros
  0 siblings, 2 replies; 11+ messages in thread
From: Uwe Brauer @ 2012-11-30 21:46 UTC (permalink / raw)
  To: ding

Hello

This is bizarre, I send myself with gnus a ics file
containing and invitation. 
When I send it as text/calendar I cannot see it in gnus,
only if I send it as application/octet-stream.

In Thunderbird I see it anyhow.

Uwe Brauer 




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

* Re: text/calendar attachments invisible in gnus
  2012-11-30 21:46 text/calendar attachments invisible in gnus Uwe Brauer
@ 2012-11-30 23:42 ` Steinar Bang
  2012-12-24  5:01 ` Leonidas Tsampros
  1 sibling, 0 replies; 11+ messages in thread
From: Steinar Bang @ 2012-11-30 23:42 UTC (permalink / raw)
  To: ding

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

> This is bizarre, I send myself with gnus a ics file
> containing and invitation. 
> When I send it as text/calendar I cannot see it in gnus, only if I
> send it as application/octet-stream.

Just a guess, but it may be trying to inline everything text/*.

If you want to explore the MIME structure of an article, do `C-d' on the
article from the Summary buffer.

Do `q' to go back to the Summary buffer.






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

* Re: text/calendar attachments invisible in gnus
  2012-11-30 21:46 text/calendar attachments invisible in gnus Uwe Brauer
  2012-11-30 23:42 ` Steinar Bang
@ 2012-12-24  5:01 ` Leonidas Tsampros
  2012-12-25 22:51   ` Adam Sjøgren
  2013-05-02  7:39   ` Deus Max
  1 sibling, 2 replies; 11+ messages in thread
From: Leonidas Tsampros @ 2012-12-24  5:01 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: ding

Uwe Brauer <oub@mat.ucm.es> writes:
> Hello
>
> This is bizarre, I send myself with gnus a ics file
> containing and invitation. 
> When I send it as text/calendar I cannot see it in gnus,
> only if I send it as application/octet-stream.
>
> In Thunderbird I see it anyhow.
>
> Uwe Brauer 

Hey,

i had posted a recipe for this in the past:

http://lists.gnu.org/archive/html/info-gnus-english/2011-10/msg00046.html

Unfortunately I never figured out how to reply to these messages with
RSVP information and I never continued this patch to smooth some rough
edges like time display incl. timezone etc :/

Best Regards,
Leonidas Tsampros




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

* Re: text/calendar attachments invisible in gnus
  2012-12-24  5:01 ` Leonidas Tsampros
@ 2012-12-25 22:51   ` Adam Sjøgren
  2013-01-08 16:36     ` Damon Haley
  2013-01-08 20:54     ` Uwe Brauer
  2013-05-02  7:39   ` Deus Max
  1 sibling, 2 replies; 11+ messages in thread
From: Adam Sjøgren @ 2012-12-25 22:51 UTC (permalink / raw)
  To: ding

  Hi Leonidas.


On Mon, 24 Dec 2012 07:01:35 +0200, Leonidas wrote:

> i had posted a recipe for this in the past:

> http://lists.gnu.org/archive/html/info-gnus-english/2011-10/msg00046.html

> Unfortunately I never figured out how to reply to these messages with
> RSVP information and I never continued this patch to smooth some rough
> edges like time display incl. timezone etc :/

I hacked a little on your recipe recently (my colleagues got a new
version of Outlook and now the HTML parts have no information, none what
so ever).

I grabbed some of the time zone stuff from one the the .el-files that
can import into org-mode (I think it was), and fiddled with various
other things (charset and some formatting).

I haven't figured the reply-bit out either, because my colleagues look
at my calender on the Exchange-server, and I'll bet (but I'll be happy
to lose the bet) that you need to use Outlook for that to work.

Anyway, here is my butchering of your recipe:


(add-to-list 'mm-inlined-types "text/calendar")
(add-to-list 'mm-automatic-display "text/calendar")
(add-to-list 'mm-inline-media-tests '("text/calendar" mm-inline-text-calendar identity))

(require 'icalendar)
(require 'boxquote)

(defun mm-inline-text-calendar (handle)
  (let ((text ""))
    (with-temp-buffer
      (mm-insert-part handle)
      (save-window-excursion
        (setq info (mapcar (lambda (s) (mm-decode-string s "utf-8"))
                           (format-text-calendar-for-display (icalendar--read-element nil nil))))))
    (let ((start (point)))
      (mm-insert-inline handle "\n")
      (mm-insert-inline handle (car info))
      (mm-insert-inline handle "\n")
      (goto-char start)
      (when (search-forward "DESCRIPTION " nil t)
        (replace-match "" nil t)
        (beginning-of-line)
        (fill-region (point) (point-max)))
      (boxquote-region start (point-max)))
    (boxquote-title (car (cdr info)))
    (mm-insert-inline handle "\n")))

(defun format-text-calendar-for-display (element)
  "Format a text/calendar element parsed by icalendar--read-element into text"
  (let ((fields '(LOCATION ORGANIZER DESCRIPTION))
        (fieldformat "%-11s %s\n")
        (content "")
        (first-date "")
        (last-date "")
        (title ""))
    (dolist (event (icalendar--all-events element))
      (let* ((zone-map (icalendar--convert-all-timezones element))
             (dtstart-zone (icalendar--find-time-zone (icalendar--get-event-property-attributes event 'DTSTART) zone-map))
             (dtstart (icalendar--decode-isodatetime (icalendar--get-event-property event 'DTSTART) nil dtstart-zone))
             (dtend-zone (icalendar--find-time-zone (icalendar--get-event-property-attributes event 'DTEND) zone-map))
             (dtend   (icalendar--decode-isodatetime (icalendar--get-event-property event 'DTEND) nil dtend-zone))
             (datestring (concat (icalendar--datetime-to-iso-date dtstart "-") " "
                                 (icalendar--datetime-to-colontime dtstart) "-"
                                 (icalendar--datetime-to-colontime dtend))))
        (when (string-equal first-date "")
          (setq first-date datestring))
        (setq last-date datestring)
        (dolist (field fields)
          (let ((propertyvalue (mapconcat (lambda (property)
                                            (icalendar--convert-string-for-import property)
                                            (replace-regexp-in-string "\\\\n" "\n"
                                                                      (replace-regexp-in-string "^MAILTO:" "" property)))
                                          (icalendar--get-event-properties event field) " ")))
            (when (not (string-equal propertyvalue ""))
              (setq content (concat content (format fieldformat field (replace-regexp-in-string "\\\\ " "" propertyvalue)))))))))
    (setq content (replace-regexp-in-string "\n\n$" "" content))
    (setq title (if (string-equal first-date last-date) first-date (concat first-date " ... " last-date)))
    (list content title)))


I hope some of it is useful.


  Best regards,

    Adam

-- 
 "But they are all following you!                             Adam Sjøgren
  No, they ain't, I'm just in front"                     asjo@koldfront.dk




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

* Re: text/calendar attachments invisible in gnus
  2012-12-25 22:51   ` Adam Sjøgren
@ 2013-01-08 16:36     ` Damon Haley
  2013-01-09 18:57       ` Adam Sjøgren
  2013-01-08 20:54     ` Uwe Brauer
  1 sibling, 1 reply; 11+ messages in thread
From: Damon Haley @ 2013-01-08 16:36 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

>>>>> Adam Sjøgren <asjo@koldfront.dk> writes:

> I hacked a little on your recipe recently (my colleagues got a new version
> of Outlook and now the HTML parts have no information, none what so ever).

> I grabbed some of the time zone stuff from one the the .el-files that can
> import into org-mode (I think it was), and fiddled with various other things
> (charset and some formatting).

> I haven't figured the reply-bit out either, because my colleagues look at my
> calender on the Exchange-server, and I'll bet (but I'll be happy to lose the
> bet) that you need to use Outlook for that to work.

Adam, thanks for this.  Now I can finally see these calendar events I get in
gnus.  It would be great to eventually be able to accept the Exchange invites in gnus,
but this is good enough for now.

Damon

> Anyway, here is my butchering of your recipe:

> (add-to-list 'mm-inlined-types "text/calendar")
> (add-to-list 'mm-automatic-display "text/calendar")
> (add-to-list 'mm-inline-media-tests '("text/calendar" mm-inline-text-calendar identity))

> (require 'icalendar)
> (require 'boxquote)

> (defun mm-inline-text-calendar (handle)
>   (let ((text ""))
>     (with-temp-buffer
>       (mm-insert-part handle)
>       (save-window-excursion
>         (setq info (mapcar (lambda (s) (mm-decode-string s "utf-8"))
>                            (format-text-calendar-for-display (icalendar--read-element nil nil))))))
>     (let ((start (point)))
>       (mm-insert-inline handle "\n")
>       (mm-insert-inline handle (car info))
>       (mm-insert-inline handle "\n")
>       (goto-char start)
>       (when (search-forward "DESCRIPTION " nil t)
>         (replace-match "" nil t)
>         (beginning-of-line)
>         (fill-region (point) (point-max)))
>       (boxquote-region start (point-max)))
>     (boxquote-title (car (cdr info)))
>     (mm-insert-inline handle "\n")))

> (defun format-text-calendar-for-display (element)
>   "Format a text/calendar element parsed by icalendar--read-element into text"
>   (let ((fields '(LOCATION ORGANIZER DESCRIPTION))
>         (fieldformat "%-11s %s\n")
>         (content "")
>         (first-date "")
>         (last-date "")
>         (title ""))
>     (dolist (event (icalendar--all-events element))
>       (let* ((zone-map (icalendar--convert-all-timezones element))
>              (dtstart-zone (icalendar--find-time-zone (icalendar--get-event-property-attributes event 'DTSTART) zone-map))
>              (dtstart (icalendar--decode-isodatetime (icalendar--get-event-property event 'DTSTART) nil dtstart-zone))
>              (dtend-zone (icalendar--find-time-zone (icalendar--get-event-property-attributes event 'DTEND) zone-map))
>              (dtend   (icalendar--decode-isodatetime (icalendar--get-event-property event 'DTEND) nil dtend-zone))
>              (datestring (concat (icalendar--datetime-to-iso-date dtstart "-") " "
>                                  (icalendar--datetime-to-colontime dtstart) "-"
>                                  (icalendar--datetime-to-colontime dtend))))
>         (when (string-equal first-date "")
>           (setq first-date datestring))
>         (setq last-date datestring)
>         (dolist (field fields)
>           (let ((propertyvalue (mapconcat (lambda (property)
>                                             (icalendar--convert-string-for-import property)
>                                             (replace-regexp-in-string "\\\\n" "\n"
>                                                                       (replace-regexp-in-string "^MAILTO:" "" property)))
>                                           (icalendar--get-event-properties event field) " ")))
>             (when (not (string-equal propertyvalue ""))
>               (setq content (concat content (format fieldformat field (replace-regexp-in-string "\\\\ " "" propertyvalue)))))))))
>     (setq content (replace-regexp-in-string "\n\n$" "" content))
>     (setq title (if (string-equal first-date last-date) first-date (concat first-date " ... " last-date)))
>     (list content title)))

> I hope some of it is useful.

>   Best regards,

>     Adam

-- 
app: https://alpha.app.net/haleyscomet
net: https://identi.ca/vinylisl
git: https://github.com/dhaley
irc: dkh on #drupal-colorado/irc/freenode.net




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

* Re: text/calendar attachments invisible in gnus
  2012-12-25 22:51   ` Adam Sjøgren
  2013-01-08 16:36     ` Damon Haley
@ 2013-01-08 20:54     ` Uwe Brauer
  2013-01-09 19:01       ` Adam Sjøgren
  1 sibling, 1 reply; 11+ messages in thread
From: Uwe Brauer @ 2013-01-08 20:54 UTC (permalink / raw)
  To: ding

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

>> "Adam" == Adam Sjøgren <asjo@koldfront.dk> writes:
Hello Adam
   >   Hi Leonidas.

[snip]


   > Anyway, here is my butchering of your recipe:


   > (add-to-list 'mm-inlined-types "text/calendar")
   > (add-to-list 'mm-automatic-display "text/calendar")
   > (add-to-list 'mm-inline-media-tests '("text/calendar" mm-inline-text-calendar identity))

   > (require 'icalendar)
   > (require 'boxquote)

   > (defun mm-inline-text-calendar (handle)

   > (defun format-text-calendar-for-display (element)

I don't understand the last 2 functions. They are supposed to be in some
hook?

Uwe Brauer 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 4474 bytes --]

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

* Re: text/calendar attachments invisible in gnus
  2013-01-08 16:36     ` Damon Haley
@ 2013-01-09 18:57       ` Adam Sjøgren
  0 siblings, 0 replies; 11+ messages in thread
From: Adam Sjøgren @ 2013-01-09 18:57 UTC (permalink / raw)
  To: ding

On Tue, 08 Jan 2013 09:36:23 -0700, Damon wrote:

> Adam, thanks for this. Now I can finally see these calendar events I
> get in gnus. It would be great to eventually be able to accept the
> Exchange invites in gnus, but this is good enough for now.

You really should thank Leonidas Tsampros - I just mucked around a
little with his code :-)


  Best regards,

    Adam

-- 
 "You don't seem very afraid."                                Adam Sjøgren
 "You don't seem very frightening."                      asjo@koldfront.dk




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

* Re: text/calendar attachments invisible in gnus
  2013-01-08 20:54     ` Uwe Brauer
@ 2013-01-09 19:01       ` Adam Sjøgren
  2013-01-10 18:10         ` Uwe Brauer
  0 siblings, 1 reply; 11+ messages in thread
From: Adam Sjøgren @ 2013-01-09 19:01 UTC (permalink / raw)
  To: ding

On Tue, 08 Jan 2013 21:54:43 +0100, Uwe wrote:

>> (add-to-list 'mm-inline-media-tests '("text/calendar" mm-inline-text-calendar identity))

[...]

>> (defun mm-inline-text-calendar (handle)

[...]

>> (defun format-text-calendar-for-display (element)

> I don't understand the last 2 functions. They are supposed to be in some
> hook?

No.

Re-read the two first quoted lines above.

Ok. One function explained.

You cut the part of the code where the second function is used, so I'll
bring that snippet back:

  (defun mm-inline-text-calendar (handle)
    (let ((text ""))
      (with-temp-buffer
        (mm-insert-part handle)
        (save-window-excursion
          (setq info (mapcar (lambda (s) (mm-decode-string s "utf-8"))
                             (format-text-calendar-for-display (icalendar--read-element nil nil))))))

See? The second function is used by the first :-)


  Best regards,

   Adam

-- 
 "It is just what they are gathered here to do, that I        Adam Sjøgren
  find so ineffably, horrificly repugnant."              asjo@koldfront.dk




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

* Re: text/calendar attachments invisible in gnus
  2013-01-09 19:01       ` Adam Sjøgren
@ 2013-01-10 18:10         ` Uwe Brauer
  2013-01-11  0:01           ` Adam Sjøgren
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Brauer @ 2013-01-10 18:10 UTC (permalink / raw)
  To: ding

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

>> "Adam" == Adam Sjøgren <asjo@koldfront.dk> writes:

   > On Tue, 08 Jan 2013 21:54:43 +0100, Uwe wrote:
>> (add-to-list 'mm-inline-media-tests '("text/calendar" mm-inline-text-calendar identity))

   > Ok. One function explained.

   > You cut the part of the code where the second function is used, so I'll
   > bring that snippet back:

   >   (defun mm-inline-text-calendar (handle)
   >     (let ((text ""))
   >       (with-temp-buffer
   >         (mm-insert-part handle)
   >         (save-window-excursion
   >           (setq info (mapcar (lambda (s) (mm-decode-string s "utf-8"))
   >                              (format-text-calendar-for-display (icalendar--read-element nil nil))))))

   > See? The second function is used by the first :-)
oops, right, sorry

Uwe 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 4474 bytes --]

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

* Re: text/calendar attachments invisible in gnus
  2013-01-10 18:10         ` Uwe Brauer
@ 2013-01-11  0:01           ` Adam Sjøgren
  0 siblings, 0 replies; 11+ messages in thread
From: Adam Sjøgren @ 2013-01-11  0:01 UTC (permalink / raw)
  To: ding

On Thu, 10 Jan 2013 19:10:31 +0100, Uwe wrote:

>>> "Adam" == Adam Sjøgren <asjo@koldfront.dk> writes:

>> The second function is used by the first :-)

> oops, right, sorry

It was kind of hidden ;-)


  Best regards,

    Adam

-- 
 "The world is short of delimiters," says Don.                Adam Sjøgren
                                                         asjo@koldfront.dk




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

* Re: text/calendar attachments invisible in gnus
  2012-12-24  5:01 ` Leonidas Tsampros
  2012-12-25 22:51   ` Adam Sjøgren
@ 2013-05-02  7:39   ` Deus Max
  1 sibling, 0 replies; 11+ messages in thread
From: Deus Max @ 2013-05-02  7:39 UTC (permalink / raw)
  To: ding

Problem solved. check out this solution, comes with ical - org integration.

https://github.com/jtatarik/ical-event






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

end of thread, other threads:[~2013-05-02  7:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-30 21:46 text/calendar attachments invisible in gnus Uwe Brauer
2012-11-30 23:42 ` Steinar Bang
2012-12-24  5:01 ` Leonidas Tsampros
2012-12-25 22:51   ` Adam Sjøgren
2013-01-08 16:36     ` Damon Haley
2013-01-09 18:57       ` Adam Sjøgren
2013-01-08 20:54     ` Uwe Brauer
2013-01-09 19:01       ` Adam Sjøgren
2013-01-10 18:10         ` Uwe Brauer
2013-01-11  0:01           ` Adam Sjøgren
2013-05-02  7:39   ` Deus Max

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