GNU bug report logs - #16733
messed up unicode chars in package description

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Thu, 13 Feb 2014 01:48:02 UTC

Severity: normal

Found in version 24.3

Fixed in version 24.4

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #38 received at 16733 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 16733 <at> debbugs.gnu.org
Subject: Re: bug#16733: messed up unicode chars in package description
Date: Wed, 19 Mar 2014 18:43:46 +0100
On Wed, Mar 19, 2014 at 6:11 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> I think you want url-insert from url-handlers.el.

Thanks.

So the following patch is a better fix. I'm OK with installing it,
though it is a bit more intrusive that the previous one.

   J


2014-03-19  Juanma Barranquero  <lekktu <at> gmail.com>

        * emacs-lisp/package.el: Fix bug#16733.
        (url-handlers): Require.
        (package--with-work-buffer): When LOCATION is a URL, use url-insert to
        properly decode the buffer.  Suggested by Eli Zaretskii <eliz <at> gnu.org>.


=== modified file 'lisp/emacs-lisp/package.el'
--- lisp/emacs-lisp/package.el  2014-03-19 16:14:26 +0000
+++ lisp/emacs-lisp/package.el  2014-03-19 17:35:44 +0000
@@ -166,6 +166,7 @@
 (eval-when-compile (require 'cl-lib))

 (require 'tabulated-list)
+(require 'url-handlers)

 (defgroup package nil
   "Manager for Emacs Lisp packages."
@@ -770,15 +771,13 @@
 and evaluates BODY while that buffer is current.  This work
 buffer is killed afterwards.  Return the last value in BODY."
   (declare (indent 2) (debug t))
-  `(let* ((http (string-match "\\`https?:" ,location))
-         (buffer
-          (if http
-              (url-retrieve-synchronously (concat ,location ,file))
-            (generate-new-buffer "*package work buffer*"))))
+  `(let ((buffer (generate-new-buffer "*package work buffer*")))
      (prog1
         (with-current-buffer buffer
-          (if http
-              (progn (package-handle-response)
+          (if (string-match-p "\\`https?:" ,location)
+              (progn (url-insert (url-retrieve-synchronously
+                                  (concat ,location ,file)))
+                     (package-handle-response)
                      (re-search-forward "^$" nil 'move)
                      (forward-char)
                      (delete-region (point-min) (point)))
@@ -1531,8 +1530,7 @@
                        (setq readme-string (buffer-string))
                        t))
                 (error nil))
-              (let ((coding (detect-coding-string readme-string t)))
-                (insert (decode-coding-string readme-string coding t))))
+              (insert readme-string))
              ((file-readable-p readme)
               (insert-file-contents readme)
               (goto-char (point-max))))))))




This bug report was last modified 11 years and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.