Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message with inline ICS #1625

Closed
Chris00 opened this issue Mar 22, 2020 · 12 comments · Fixed by #1633
Closed

Message with inline ICS #1625

Chris00 opened this issue Mar 22, 2020 · 12 comments · Fixed by #1633

Comments

@Chris00
Copy link
Contributor

Chris00 commented Mar 22, 2020

Expected or desired behavior

View the message

Actual behavior

The attached message (composed with Mu4e) triggers an error when displaying it with the Gnus mode (not the original one).
(I can send privately the original message which also starts the debugger when “Enter Debugger on Error” is set.)

Versions of mu, mu4e/emacs, operating system etc.

Emacs 26.3
Mu: commit 441f005

@Chris00
Copy link
Contributor Author

Chris00 commented Mar 22, 2020

Same with the latest Mu version (commit efd6710).

@Chris00
Copy link
Contributor Author

Chris00 commented Mar 22, 2020

The problem is with gnus-icalendar-with-decoded-handle: it does

  (let ((charset (make-symbol "charset")))
    `(let ((,charset (cdr (assoc 'charset (mm-handle-type ,handle)))))

and this returns an invalid charset.

@djcb
Copy link
Owner

djcb commented Mar 25, 2020

Any idea how to fix this?

@Chris00
Copy link
Contributor Author

Chris00 commented Mar 25, 2020 via email

@Chris00
Copy link
Contributor Author

Chris00 commented Mar 27, 2020

Temporary fix (a better solution must be found to use the charset in mu4e~view-gnus).

(define-advice gnus-icalendar-event-from-handle
    (:filter-args (handle-attendee) fix-missing-charset)
  "Fix mu not passing the charset."
  (let* ((handle (car handle-attendee))
         (attendee (cdr handle-attendee))
         (buf (mm-handle-buffer handle))
         (ty (mm-handle-type handle))
         (rest (cddr handle)))
    ;; Put the fallback at the end:
    (setq ty (append ty '((charset . "utf-8"))))
    (setq handle (cons buf (cons ty rest)))
    (list handle attendee)))

@djcb
Copy link
Owner

djcb commented Mar 28, 2020

Ah, thanks. But should the advise perhaps have a guard so it only works when used in mu4e? Otherwise it could affect people trying to use the 'real' gnus after this is defined. Or?

@Chris00
Copy link
Contributor Author

Chris00 commented Mar 28, 2020

I filed a bug against Emacs. The following variant only apply the customization inside mu:

(define-advice gnus-icalendar-event-from-handle
    (:filter-args (handle-attendee) fix-missing-charset)
  "Fix mu not passing the charset."
  (if (boundp 'mu4e~view-rendering)
      (let* ((handle (car handle-attendee))
             (attendee (cdr handle-attendee))
             (buf (mm-handle-buffer handle))
             (ty (mm-handle-type handle))
             (rest (cddr handle)))
        ;; Put the fallback at the end:
        (setq ty (append ty '((charset . "utf-8"))))
        (setq handle (cons buf (cons ty rest)))
        (list handle attendee))
  handle-attendee))

@Chris00
Copy link
Contributor Author

Chris00 commented Mar 30, 2020

Emacs bug.

@djcb
Copy link
Owner

djcb commented Mar 30, 2020

Ah, thanks again. But shouldn't the check be wether we're currently in an mu4e buffer? Otherwise the advise would still kick in if you use gnus after mu4e?

@Chris00
Copy link
Contributor Author

Chris00 commented Mar 30, 2020

One should replace (boundp 'mu4e~view-rendering)by (and (boundp 'mu4e~view-rendering) mu4e~view-rendering). mu4e~view-rendering may indeed be known outside mu4e buffers but is supposed to be set to t only in the code using Gnus view.

@djcb
Copy link
Owner

djcb commented Apr 4, 2020

Ah, thanks. Do you want to make a PR, or do you think we can do this post-1.4?

@Chris00
Copy link
Contributor Author

Chris00 commented Apr 4, 2020

I'll try to make a PR later today — it will not affect many people but it is annoying when this bug is triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants