• Stefan Monnier's avatar
    * lisp/emacs-lisp/package.el: Fix decoding of downloaded files · 5f9671e5
    Stefan Monnier authored
    This is a different fix for bug#34909, which should also fix bug#35739.
    
    Our downloading code used to automatically decode the result according
    to the usual heuristics for files.  This caused problems when we later
    needed to save the data in a file that needed to be byte-for-byte
    equal to the original in order to pass the signature verification,
    especially because we didn't keep track of which coding-system was
    used to decode the data.
    
    (package--unless-error): New macro extracted from
    package--with-response-buffer-1, so that we can specify edebug and
    indent specs.
    (package--with-response-buffer-1): Use it.  More importantly, change
    code so it runs `body` in a unibyte buffer with undecoded data.
    (package--download-one-archive): Don't encode with utf-8 since the data
    is not decoded yet.
    (describe-package-1): Explicitly decode the readem.txt files here.
    
    * lisp/url/url-handlers.el (url-insert-file-contents): Use it.
    (url-insert): Don't decode if buffer is unibyte.
    
    * lisp/url/url-http.el (url-http--insert-file-helper): New function,
    extracted from url-insert-file-contents.
    5f9671e5
package.el 154 KB