Re: [Emacs-diffs] emacs-26 aca5f00: Avoid encoding errors in message.el

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Emacs-diffs] emacs-26 aca5f00: Avoid encoding errors in message.el

Stefan Monnier
> -   (set (make-local-variable (car local))
> - (cdr local)))))
> +   ;; Cloning message-default-charset could cause an already
> +   ;; encoded text to be encoded again, yielding raw bytes
> +   ;; instead of characters in the message.
> +   (unless (string-match "message-default-charset"
> + (symbol-name (car local)))
> +     (set (make-local-variable (car local))
> +  (cdr local))))))

Could you add a comment explaining why we do

    (string-match "message-default-charset" (symbol-name (car local))

rather than

    (eq 'message-default-charset (car local))


-- Stefan "puzzled"

Reply | Threaded
Open this post in threaded view
|

Re: [Emacs-diffs] emacs-26 aca5f00: Avoid encoding errors in message.el

Eli Zaretskii
> From: Stefan Monnier <[hidden email]>
> Cc: [hidden email]
> Date: Mon, 09 Oct 2017 11:57:11 -0400
>
> > -   (set (make-local-variable (car local))
> > - (cdr local)))))
> > +   ;; Cloning message-default-charset could cause an already
> > +   ;; encoded text to be encoded again, yielding raw bytes
> > +   ;; instead of characters in the message.
> > +   (unless (string-match "message-default-charset"
> > + (symbol-name (car local)))
> > +     (set (make-local-variable (car local))
> > +  (cdr local))))))
>
> Could you add a comment explaining why we do
>
>     (string-match "message-default-charset" (symbol-name (car local))
>
> rather than
>
>     (eq 'message-default-charset (car local))

No reason except that this was in the patch proposed by Alex.  Feel
free to change.

Reply | Threaded
Open this post in threaded view
|

Re: [Emacs-diffs] emacs-26 aca5f00: Avoid encoding errors in message.el

Stefan Monnier
> No reason except that this was in the patch proposed by Alex.

Good, thanks,


        Stefan