]> git.eshelyaron.com Git - emacs.git/commitdiff
[Gnus] Catch the invalid-operation that idna.el will issue
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 14 Apr 2015 03:35:02 +0000 (03:35 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 14 Apr 2015 03:35:02 +0000 (03:35 +0000)
* lisp/gnus/gnus-art.el (gnus-use-idna):
* lisp/gnus/gnus-sum.el (gnus-summary-idna-message):
* lisp/gnus/message.el (message-use-idna):
Catch the invalid-operation that idna.el will issue.

lisp/gnus/gnus-art.el
lisp/gnus/gnus-sum.el
lisp/gnus/message.el

index b238d65c2078e83b2bddd89175db5597fb3fef81..14f9adca85d662fa092149d4e001c153686bc477 100644 (file)
@@ -1627,8 +1627,11 @@ It is a string, such as \"PGP\". If nil, ask user."
 
 (defvar idna-program)
 
-(defcustom gnus-use-idna (and (condition-case nil (require 'idna) (file-error))
-                             (mm-coding-system-p 'utf-8)
+(defcustom gnus-use-idna (and (mm-coding-system-p 'utf-8)
+                             (condition-case nil
+                                 (require 'idna)
+                               (file-error)
+                               (invalid-operation))
                              idna-program
                              (executable-find idna-program))
   "Whether IDNA decoding of headers is used when viewing messages.
index 73a0d4b1039ed7d2e4d2e7ad7fd75202574be6a9..1d8ad8e6acb7112569e2646650807290d7746f7a 100644 (file)
@@ -9870,9 +9870,11 @@ invalid IDNA string (`xn--bar' is invalid).
 You must have GNU Libidn (URL `http://www.gnu.org/software/libidn/')
 installed for this command to work."
   (interactive "P")
-  (if (not (and (condition-case nil (require 'idna)
-                 (file-error))
-               (mm-coding-system-p 'utf-8)
+  (if (not (and (mm-coding-system-p 'utf-8)
+               (condition-case nil
+                   (require 'idna)
+                 (file-error)
+                 (invalid-operation))
                (symbol-value 'idna-program)
                (executable-find (symbol-value 'idna-program))))
       (gnus-message
index 3dc29088d840fd3d40d96e5a463476feb9adf632..1371e700281de4e8c57e801b01bcce4a84502bbe 100644 (file)
@@ -1763,7 +1763,10 @@ no, only reply back to the author."
               (let (mucs-ignore-version-incompatibilities)
                 (require 'un-define))
             (error)))
-       (condition-case nil (require 'idna) (file-error))
+       (condition-case nil
+          (require 'idna)
+        (file-error)
+        (invalid-operation))
        idna-program
        (executable-find idna-program)
        (string= (idna-to-ascii "räksmörgås") "xn--rksmrgs-5wao1o")