Discussion:
eval'ing message-use-idna defcustom hangs emacs
Eric Abrahamsen
2014-04-23 02:04:50 UTC
Permalink
Yesterday, emacs started hanging when I loaded gnus. The problem turned
out to be this defcustom from message.el:

;; (defcustom message-use-idna (and (condition-case nil (require 'idna)
;; (file-error))
;; (mm-coding-system-p 'utf-8)
;; (executable-find idna-program)
;; (string= (idna-to-ascii "räksmörgås")
;; "xn--rksmrgs-5wao1o")
;; t)
;; "Whether to encode non-ASCII in domain names into ASCII according to IDNA.
;; GNU Libidn, and in particular the elisp package \"idna.el\" and
;; the external program \"idn\", must be installed for this
;; functionality to work."
;; :version "22.1"
;; :group 'message-headers
;; :link '(custom-manual "(message)IDNA")
;; :type '(choice (const :tag "Ask" ask)
;; (const :tag "Never" nil)
;; (const :tag "Always" t)))

idna can be required, and the executable is found (/usr/bin/idn).
Archlinux's libidn package is at 1.28-2. I'm using git gnus and
emacs-version "24.3.1". I don't think anything has changed recently.

It seems that the process call to idna never returns. I set
toggle-debug-on-quit, and hit C-g during the hang, and get this
backtrace:

Debugger entered--Lisp error: (quit)
accept-process-output(#<process idna> 1)
(while (and (eq (process-status idna-to-ascii-process) (quote run)) (null idna-to-ascii-response)) (accept-process-output idna-to-ascii-process 1))
idna-to-ascii-response()
(setq string (idna-to-ascii-response))
(if (null proc) (error "Cannot start idn application (to-ascii)") (idna-to-ascii-response-clear) (process-send-string proc (concat str "\n")) (setq string (idna-to-ascii-response)) (if (and string (string= (substring string (1- (length string))) "\n")) (substring string 0 (1- (length string))) string))
(let ((proc (idna-to-ascii-process)) string) (if (null proc) (error "Cannot start idn application (to-ascii)") (idna-to-ascii-response-clear) (process-send-string proc (concat str "\n")) (setq string (idna-to-ascii-response)) (if (and string (string= (substring string (1- (length string))) "\n")) (substring string 0 (1- (length string))) string)))
idna-to-ascii("räksmörgås")
eval((idna-to-ascii "räksmörgås") nil)
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp nil nil)

I've just commented out the defcustom and set the variable directly to
t. That seems to work, but I hope someone can shed some light on the
above!

Thanks,
Eric
Lars Ingebrigtsen
2015-01-28 06:12:03 UTC
Permalink
Post by Eric Abrahamsen
idna can be required, and the executable is found (/usr/bin/idn).
Archlinux's libidn package is at 1.28-2. I'm using git gnus and
emacs-version "24.3.1". I don't think anything has changed recently.
It seems that the process call to idna never returns. I set
toggle-debug-on-quit, and hit C-g during the hang, and get this
Debugger entered--Lisp error: (quit)
accept-process-output(#<process idna> 1)
(while (and (eq (process-status idna-to-ascii-process) (quote run))
[...]
Post by Eric Abrahamsen
(length string))) string)))
idna-to-ascii("räksmörgås")
I'm on a Fedora laptop, and installing libidn doesn't seem to install
idna.el, so I can't test this. Are you still seeing hangs in

(idna-to-ascii "räksmörgås")

?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Eli Zaretskii
2015-01-28 15:32:43 UTC
Permalink
Date: Wed, 28 Jan 2015 17:12:03 +1100
I'm on a Fedora laptop, and installing libidn doesn't seem to install
idna.el
That's a packaging problem: if you build libidn yourself, "make
install" does install the Lisp interface.
Jason L Tibbitts III
2015-01-29 22:36:37 UTC
Permalink
EZ> That's a packaging problem: if you build libidn yourself, "make
EZ> install" does install the Lisp interface.

It's.... not a packaging problem. Why should installing libidn pull in
emacs? In any case, there's a convenient emacs-libidn package in
repoquery -l emacs-libidn
/usr/share/emacs/site-lisp/libidn
/usr/share/emacs/site-lisp/libidn/idna.el
/usr/share/emacs/site-lisp/libidn/idna.elc
/usr/share/emacs/site-lisp/libidn/punycode.el
/usr/share/emacs/site-lisp/libidn/punycode.elc

- J<
Lars Magne Ingebrigtsen
2015-01-29 23:36:08 UTC
Permalink
Post by Jason L Tibbitts III
It's.... not a packaging problem. Why should installing libidn pull in
emacs? In any case, there's a convenient emacs-libidn package in
Thanks. I now have idna support, but I'm not able to reproduce this
bug. `eval' on the defcustom just returns t, as it should...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Eric Abrahamsen
2015-01-30 02:42:23 UTC
Permalink
Post by Lars Magne Ingebrigtsen
Post by Jason L Tibbitts III
It's.... not a packaging problem. Why should installing libidn pull in
emacs? In any case, there's a convenient emacs-libidn package in
Thanks. I now have idna support, but I'm not able to reproduce this
bug. `eval' on the defcustom just returns t, as it should...
I'm not seeing this anymore, either. I just removed the (setq ... nil)
I've had in place for ages, and the defcustom form now simply returns
nil (I don't have idna.el available in this emacs).

Mind you, this bug report is nearly a year old!

Loading...