From: Katsumi Yamaoka Date: Tue, 14 Apr 2015 03:35:02 +0000 (+0000) Subject: [Gnus] Catch the invalid-operation that idna.el will issue X-Git-Tag: emacs-25.0.90~2433 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d4b44a07a75666177f8684876c7337c0b91a95da;p=emacs.git [Gnus] Catch the invalid-operation that idna.el will issue * 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. --- diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index b238d65c207..14f9adca85d 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -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. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 73a0d4b1039..1d8ad8e6acb 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -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 diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 3dc29088d84..1371e700281 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -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")