]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/message.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / gnus / message.el
index 14d8d30f8af1ca74e78e669115396bc64c29cbbf..1ca7c5cafef737f6f6cf5997776a9b46ebfb2a31 100644 (file)
@@ -48,6 +48,7 @@
 (require 'dired)
 (require 'mm-util)
 (require 'rfc2047)
+(require 'puny)
 
 (autoload 'mailclient-send-it "mailclient")
 
@@ -1756,25 +1757,9 @@ no, only reply back to the author."
   :type '(radio (const :format "%v  " nil)
                (string :format "FQDN: %v")))
 
-(defcustom message-use-idna
-  (and (or (mm-coding-system-p 'utf-8)
-          (condition-case nil
-              (let (mucs-ignore-version-incompatibilities)
-                (require 'un-define))
-            (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")
-       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"
+(defcustom message-use-idna t
+  "Whether to encode non-ASCII in domain names into ASCII according to IDNA."
+  :version "25.2"
   :group 'message-headers
   :link '(custom-manual "(message)IDNA")
   :type '(choice (const :tag "Ask" ask)
@@ -1926,7 +1911,6 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'."
 (autoload 'gnus-output-to-rmail "gnus-util")
 (autoload 'gnus-request-post "gnus-int")
 (autoload 'gnus-server-string "gnus")
-(autoload 'idna-to-ascii "idna")
 (autoload 'message-setup-toolbar "messagexmas")
 (autoload 'mh-new-draft-name "mh-comp")
 (autoload 'mh-send-letter "mh-comp")
@@ -3879,8 +3863,13 @@ This function uses `mail-citation-hook' if that is non-nil."
 (defun message-insert-formatted-citation-line (&optional from date tz)
   "Function that inserts a formatted citation line.
 The optional FROM, and DATE are strings containing the contents of
-the From header and the Date header respectively.  The optional TZ
-is a number of seconds, overrides the time zone of DATE.
+the From header and the Date header respectively.
+
+The optional TZ is omitted or nil for Emacs local time, t for
+Universal Time, `wall' for system wall clock time, or a string as
+in the TZ environment variable.  It can also be a list (as from
+`current-time-zone') or an integer (as from `decode-time')
+applied without consideration for daylight saving time.
 
 See `message-citation-line-format'."
   ;; The optional args are for testing/debugging.  They will disappear later.
@@ -3971,7 +3960,7 @@ See `message-citation-line-format'."
                               (>= i ?a)))
                  (push i lst)
                  (push (condition-case nil
-                           (gmm-format-time-string (format "%%%c" i) time tz)
+                           (format-time-string (format "%%%c" i) time tz)
                          (error (format ">%c<" i)))
                        lst))
                (setq i (1+ i)))
@@ -5862,7 +5851,7 @@ subscribed address (and not the additional To and Cc header contents)."
        ;; the domain part, i.e., if it is a local user's address.
        (setq ace (if (string-match "\\`[[:ascii:]]*\\'" rhs)
                      rhs
-                   (downcase (idna-to-ascii rhs))))
+                   (downcase (puny-encode-domain rhs))))
        (when (and (not (equal rhs ace))
                   (or (not (eq message-use-idna 'ask))
                       (y-or-n-p (format "Replace %s with %s in %s:? "