Commit d4b44a07 authored by Katsumi Yamaoka's avatar Katsumi Yamaoka

[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.
parent b16cdc27
......@@ -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.
......
......@@ -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
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment