]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/gnus-art.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / gnus / gnus-art.el
index a2dc82e6ff76461b689baf53b70e4ff54b855561..dea8d1f5c9f4a436057a53798423b6d551dfa2d2 100644 (file)
@@ -518,6 +518,12 @@ each invocation of the saving commands."
                 (item :tag "never" nil)
                 (sexp :tag "once" :format "%t\n" :value t)))
 
+(defcustom gnus-article-show-cursor nil
+  "If non-nil, show the cursor in the Article buffer even when not selected."
+  :version "25.1"
+  :group 'gnus-article
+  :type 'bool)
+
 (defcustom gnus-saved-headers gnus-visible-headers
   "Headers to keep if `gnus-save-all-headers' is nil.
 If `gnus-save-all-headers' is non-nil, this variable will be ignored.
@@ -1003,7 +1009,7 @@ on parts -- for instance, adding Vcard info to a database."
 
 (defcustom gnus-article-date-headers '(combined-lapsed)
   "A list of Date header formats to display.
-Valid formats are `ut' (universal time), `local' (local time
+Valid formats are `ut' (Universal Time), `local' (local time
 zone), `english' (readable English), `lapsed' (elapsed time),
 `combined-lapsed' (both the original date and the elapsed time),
 `original' (the original date header), `iso8601' (ISO8601
@@ -1387,7 +1393,7 @@ predicate.  See Info node `(gnus)Customizing Articles'."
   :type gnus-article-treat-custom)
 (put 'gnus-treat-overstrike 'highlight t)
 
-(defcustom gnus-treat-ansi-sequences (if (locate-library "ansi-color") t)
+(defcustom gnus-treat-ansi-sequences t
   "Treat ANSI SGR control sequences.
 Valid values are nil, t, `head', `first', `last', an integer or a
 predicate.  See Info node `(gnus)Customizing Articles'."
@@ -1604,18 +1610,9 @@ It is a string, such as \"PGP\". If nil, ask user."
   :type 'string
   :group 'mime-security)
 
-(defvar idna-program)
-
-(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.
-This requires GNU Libidn, and by default only enabled if it is found."
-  :version "22.1"
+(defcustom gnus-use-idna t
+  "Whether IDNA decoding of headers is used when viewing messages."
+  :version "25.2"
   :group 'gnus-article-headers
   :type 'boolean)
 
@@ -2283,8 +2280,6 @@ long lines if and only if arg is positive."
       (setq truncate-lines nil))
      ((numberp arg)
       (setq truncate-lines t)))
-    ;; In versions of Emacs 22 (CVS) before 2006-05-26,
-    ;; `toggle-truncate-lines' needs an argument.
     (toggle-truncate-lines)))
 
 (defun gnus-article-treat-body-boundary ()
@@ -2587,8 +2582,6 @@ If PROMPT (the prefix), prompt for a coding system to use."
                           t t nil 1))
          (goto-char (point-min)))))))
 
-(autoload 'idna-to-unicode "idna")
-
 (defun article-decode-idna-rhs ()
   "Decode IDNA strings in RHS in various headers in current buffer.
 The following headers are decoded: From:, To:, Cc:, Reply-To:,
@@ -2606,7 +2599,7 @@ Mail-Reply-To: and Mail-Followup-To:."
                         (save-excursion
                           (and (re-search-backward "^[^ \t]" nil t)
                                (looking-at "From\\|To\\|Cc\\|Reply-To\\|Mail-Reply-To\\|Mail-Followup-To")))
-                        (setq unicode (idna-to-unicode ace))))
+                        (setq unicode (puny-decode-domain ace))))
              (unless (string= ace unicode)
                (replace-match unicode nil nil nil 1)))))))))
 
@@ -4481,12 +4474,13 @@ commands:
   (make-local-variable 'gnus-article-ignored-charsets)
   (set (make-local-variable 'bookmark-make-record-function)
        'gnus-summary-bookmark-make-record)
-  ;; Prevent Emacs 22 from displaying non-break space with `nobreak-space'
-  ;; face.
+  ;; Prevent Emacs from displaying non-break space with
+  ;; `nobreak-space' face.
   (set (make-local-variable 'nobreak-char-display) nil)
   ;; Enable `gnus-article-remove-images' to delete images shr.el renders.
   (set (make-local-variable 'shr-put-image-function) 'gnus-shr-put-image)
-  (setq cursor-in-non-selected-windows nil)
+  (unless gnus-article-show-cursor
+    (setq cursor-in-non-selected-windows nil))
   (gnus-set-default-directory)
   (buffer-disable-undo)
   (setq buffer-read-only t
@@ -6567,7 +6561,7 @@ Argument LINES specifies lines to be scrolled up."
 
 (defun gnus-article-beginning-of-window ()
   "Move point to the beginning of the window.
-In Emacs, the point is placed at the line number which `scroll-margin'
+The point is placed at the line number which `scroll-margin'
 specifies."
   ;; There is an obscure bug in Emacs that makes it impossible to
   ;; scroll past big pictures in the article buffer.  Try to fix
@@ -6793,7 +6787,7 @@ not have a face in `gnus-article-boring-faces'."
 (defun gnus-article-describe-key (key)
   "Display documentation of the function invoked by KEY.
 KEY is a string or a vector."
-  (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs.
+  (interactive (list (let ((cursor-in-echo-area t))
                       (read-key-sequence "Describe key: "))))
   (gnus-article-check-buffer)
   (if (memq (key-binding key t) '(gnus-article-read-summary-keys
@@ -6814,7 +6808,7 @@ KEY is a string or a vector."
 (defun gnus-article-describe-key-briefly (key &optional insert)
   "Display documentation of the function invoked by KEY.
 KEY is a string or a vector."
-  (interactive (list (let ((cursor-in-echo-area t)) ;; better for XEmacs.
+  (interactive (list (let ((cursor-in-echo-area t))
                       (read-key-sequence "Describe key: "))
                     current-prefix-arg))
   (gnus-article-check-buffer)
@@ -7355,21 +7349,17 @@ groups."
    "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|"
    "nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)"
    "\\(//[-a-z0-9_.]+:[0-9]*\\)?"
-   (if (string-match "[[:digit:]]" "1") ;; Support POSIX?
-       (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]")
-            (punct "!?:;.,"))
-        (concat
-         "\\(?:"
-         ;; Match paired parentheses, e.g. in Wikipedia URLs:
-         ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com
-         "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)"
-         "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?"
-         "\\|"
-         "[" chars punct "]+" "[" chars "]"
-         "\\)"))
-     (concat ;; XEmacs 21.4 doesn't support POSIX.
-      "\\([-a-z0-9_=!?#$@~%&*+\\/:;.,]\\|\\w\\)+"
-      "\\([-a-z0-9_=#$@~%&*+\\/]\\|\\w\\)"))
+   (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]")
+        (punct "!?:;.,"))
+     (concat
+      "\\(?:"
+      ;; Match paired parentheses, e.g. in Wikipedia URLs:
+      ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com
+      "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)"
+      "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?"
+      "\\|"
+      "[" chars punct "]+" "[" chars "]"
+      "\\)"))
    "\\)")
   "Regular expression that matches URLs."
   :version "24.4"