aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/gnus
diff options
context:
space:
mode:
authorAlan Mackenzie2017-02-12 10:59:03 +0000
committerAlan Mackenzie2017-02-12 10:59:03 +0000
commitf4d5b687150810129b7a1d5b006e31ccf82b691b (patch)
tree4229b13800349032697daae3904dc3773e6b7a80 /lisp/gnus
parentd5514332d4a6092673ce1f78fadcae0c57f7be64 (diff)
parent148100d98319499f0ac6f57b8be08cbd14884a5c (diff)
downloademacs-comment-cache.tar.gz
emacs-comment-cache.zip
Merge branch 'master' into comment-cachecomment-cache
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/gnus-art.el22
-rw-r--r--lisp/gnus/gnus-msg.el9
-rw-r--r--lisp/gnus/gnus-salt.el4
-rw-r--r--lisp/gnus/gnus-start.el9
-rw-r--r--lisp/gnus/gnus-sum.el28
-rw-r--r--lisp/gnus/gnus-topic.el2
-rw-r--r--lisp/gnus/gnus.el4
-rw-r--r--lisp/gnus/message.el132
-rw-r--r--lisp/gnus/mml.el98
-rw-r--r--lisp/gnus/nndoc.el20
-rw-r--r--lisp/gnus/nnimap.el6
11 files changed, 208 insertions, 126 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index e1af859516c..a4ff840f755 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -251,7 +251,12 @@ This can also be a list of the above values."
251 (integer :value 200) 251 (integer :value 200)
252 (number :value 4.0) 252 (number :value 4.0)
253 function 253 function
254 (regexp :value ".*")) 254 (regexp :value ".*")
255 (repeat (choice (const nil)
256 (integer :value 200)
257 (number :value 4.0)
258 function
259 (regexp :value ".*"))))
255 :group 'gnus-article-signature) 260 :group 'gnus-article-signature)
256 261
257(defcustom gnus-hidden-properties 262(defcustom gnus-hidden-properties
@@ -1708,9 +1713,10 @@ regexp."
1708 ;; (modify-syntax-entry ?- "w" table) 1713 ;; (modify-syntax-entry ?- "w" table)
1709 (modify-syntax-entry ?> ")<" table) 1714 (modify-syntax-entry ?> ")<" table)
1710 (modify-syntax-entry ?< "(>" table) 1715 (modify-syntax-entry ?< "(>" table)
1711 ;; make M-. in article buffers work for `foo' strings 1716 ;; make M-. in article buffers work for `foo' strings,
1712 (modify-syntax-entry ?' " " table) 1717 ;; and still allow C-s C-w to yank ' to the search ring
1713 (modify-syntax-entry ?` " " table) 1718 (modify-syntax-entry ?' "'" table)
1719 (modify-syntax-entry ?` "'" table)
1714 table) 1720 table)
1715 "Syntax table used in article mode buffers. 1721 "Syntax table used in article mode buffers.
1716Initialized from `text-mode-syntax-table'.") 1722Initialized from `text-mode-syntax-table'.")
@@ -6841,17 +6847,21 @@ then we display only bindings that start with that prefix."
6841 (let ((keymap (copy-keymap gnus-article-mode-map)) 6847 (let ((keymap (copy-keymap gnus-article-mode-map))
6842 (map (copy-keymap gnus-article-send-map)) 6848 (map (copy-keymap gnus-article-send-map))
6843 (sumkeys (where-is-internal 'gnus-article-read-summary-keys)) 6849 (sumkeys (where-is-internal 'gnus-article-read-summary-keys))
6850 (summap (make-sparse-keymap))
6844 parent agent draft) 6851 parent agent draft)
6845 (define-key keymap "S" map) 6852 (define-key keymap "S" map)
6846 (define-key map [t] nil) 6853 (define-key map [t] nil)
6854 (define-key summap [t] 'undefined)
6847 (with-current-buffer gnus-article-current-summary 6855 (with-current-buffer gnus-article-current-summary
6856 (dolist (key sumkeys)
6857 (define-key summap key (key-binding key (current-local-map))))
6848 (set-keymap-parent 6858 (set-keymap-parent
6849 keymap 6859 keymap
6850 (if (setq parent (keymap-parent gnus-article-mode-map)) 6860 (if (setq parent (keymap-parent gnus-article-mode-map))
6851 (prog1 6861 (prog1
6852 (setq parent (copy-keymap parent)) 6862 (setq parent (copy-keymap parent))
6853 (set-keymap-parent parent (current-local-map))) 6863 (set-keymap-parent parent summap))
6854 (current-local-map))) 6864 summap))
6855 (set-keymap-parent map (key-binding "S")) 6865 (set-keymap-parent map (key-binding "S"))
6856 (let (key def gnus-pick-mode) 6866 (let (key def gnus-pick-mode)
6857 (while sumkeys 6867 (while sumkeys
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 19111171198..a193ab41348 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -546,7 +546,8 @@ instead."
546 (gnus-setup-message 'message 546 (gnus-setup-message 'message
547 (message-mail to subject other-headers continue 547 (message-mail to subject other-headers continue
548 nil yank-action send-actions return-action))) 548 nil yank-action send-actions return-action)))
549 (setq gnus-newsgroup-name group-name)) 549 (with-current-buffer buf
550 (setq gnus-newsgroup-name group-name)))
550 (when switch-action 551 (when switch-action
551 (setq mail-buf (current-buffer)) 552 (setq mail-buf (current-buffer))
552 (switch-to-buffer buf) 553 (switch-to-buffer buf)
@@ -1534,11 +1535,7 @@ If YANK is non-nil, include the original article."
1534 (message-pop-to-buffer "*Gnus Bug*")) 1535 (message-pop-to-buffer "*Gnus Bug*"))
1535 (let ((message-this-is-mail t)) 1536 (let ((message-this-is-mail t))
1536 (message-setup `((To . ,gnus-maintainer) 1537 (message-setup `((To . ,gnus-maintainer)
1537 (Subject . "") 1538 (Subject . ""))))
1538 (X-Debbugs-Package
1539 . ,(format "%s" gnus-bug-package))
1540 (X-Debbugs-Version
1541 . ,(format "%s" (gnus-continuum-version))))))
1542 (when gnus-bug-create-help-buffer 1539 (when gnus-bug-create-help-buffer
1543 (push `(gnus-bug-kill-buffer) message-send-actions)) 1540 (push `(gnus-bug-kill-buffer) message-send-actions))
1544 (goto-char (point-min)) 1541 (goto-char (point-min))
diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el
index 5361c2b86fc..7037328b7a4 100644
--- a/lisp/gnus/gnus-salt.el
+++ b/lisp/gnus/gnus-salt.el
@@ -131,9 +131,7 @@ It accepts the same format specs that `gnus-summary-line-format' does."
131(defvar gnus-pick-line-number 1) 131(defvar gnus-pick-line-number 1)
132(defun gnus-pick-line-number () 132(defun gnus-pick-line-number ()
133 "Return the current line number." 133 "Return the current line number."
134 (if (bobp) 134 (incf gnus-pick-line-number))
135 (setq gnus-pick-line-number 1)
136 (incf gnus-pick-line-number)))
137 135
138(defun gnus-pick-start-reading (&optional catch-up) 136(defun gnus-pick-start-reading (&optional catch-up)
139 "Start reading the picked articles. 137 "Start reading the picked articles.
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 47e33af96e8..be46339cd38 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -2801,8 +2801,13 @@ If FORCE is non-nil, the .newsrc file is read."
2801 (gnus-run-hooks 'gnus-save-newsrc-hook) 2801 (gnus-run-hooks 'gnus-save-newsrc-hook)
2802 (if gnus-slave 2802 (if gnus-slave
2803 (gnus-slave-save-newsrc) 2803 (gnus-slave-save-newsrc)
2804 ;; Save .newsrc. 2804 ;; Save .newsrc only if the select method is an NNTP method.
2805 (when gnus-save-newsrc-file 2805 ;; The .newsrc file is for interoperability with other
2806 ;; newsreaders, so saving non-NNTP groups there doesn't make
2807 ;; much sense.
2808 (when (and gnus-save-newsrc-file
2809 (eq (car (gnus-server-to-method gnus-select-method))
2810 'nntp))
2806 (gnus-message 8 "Saving %s..." gnus-current-startup-file) 2811 (gnus-message 8 "Saving %s..." gnus-current-startup-file)
2807 (gnus-gnus-to-newsrc-format) 2812 (gnus-gnus-to-newsrc-format)
2808 (gnus-message 8 "Saving %s...done" gnus-current-startup-file)) 2813 (gnus-message 8 "Saving %s...done" gnus-current-startup-file))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 72e902a11f8..2631514e425 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1895,6 +1895,7 @@ increase the score of each group you read."
1895 "\C-c\C-s\C-m\C-n" gnus-summary-sort-by-most-recent-number 1895 "\C-c\C-s\C-m\C-n" gnus-summary-sort-by-most-recent-number
1896 "\C-c\C-s\C-l" gnus-summary-sort-by-lines 1896 "\C-c\C-s\C-l" gnus-summary-sort-by-lines
1897 "\C-c\C-s\C-c" gnus-summary-sort-by-chars 1897 "\C-c\C-s\C-c" gnus-summary-sort-by-chars
1898 "\C-c\C-s\C-m\C-m" gnus-summary-sort-by-marks
1898 "\C-c\C-s\C-a" gnus-summary-sort-by-author 1899 "\C-c\C-s\C-a" gnus-summary-sort-by-author
1899 "\C-c\C-s\C-t" gnus-summary-sort-by-recipient 1900 "\C-c\C-s\C-t" gnus-summary-sort-by-recipient
1900 "\C-c\C-s\C-s" gnus-summary-sort-by-subject 1901 "\C-c\C-s\C-s" gnus-summary-sort-by-subject
@@ -2748,6 +2749,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
2748 ["Sort by score" gnus-summary-sort-by-score t] 2749 ["Sort by score" gnus-summary-sort-by-score t]
2749 ["Sort by lines" gnus-summary-sort-by-lines t] 2750 ["Sort by lines" gnus-summary-sort-by-lines t]
2750 ["Sort by characters" gnus-summary-sort-by-chars t] 2751 ["Sort by characters" gnus-summary-sort-by-chars t]
2752 ["Sort by marks" gnus-summary-sort-by-marks t]
2751 ["Randomize" gnus-summary-sort-by-random t] 2753 ["Randomize" gnus-summary-sort-by-random t]
2752 ["Original sort" gnus-summary-sort-by-original t]) 2754 ["Original sort" gnus-summary-sort-by-original t])
2753 ("Help" 2755 ("Help"
@@ -3976,6 +3978,8 @@ If SELECT-ARTICLES, only select those articles from GROUP."
3976 ;; The group was successfully selected. 3978 ;; The group was successfully selected.
3977 (t 3979 (t
3978 (gnus-set-global-variables) 3980 (gnus-set-global-variables)
3981 (when (boundp 'gnus-pick-line-number)
3982 (setq gnus-pick-line-number 0))
3979 (when (boundp 'spam-install-hooks) 3983 (when (boundp 'spam-install-hooks)
3980 (spam-initialize)) 3984 (spam-initialize))
3981 ;; Save the active value in effect when the group was entered. 3985 ;; Save the active value in effect when the group was entered.
@@ -4037,6 +4041,9 @@ If SELECT-ARTICLES, only select those articles from GROUP."
4037 (when kill-buffer 4041 (when kill-buffer
4038 (gnus-kill-or-deaden-summary kill-buffer)) 4042 (gnus-kill-or-deaden-summary kill-buffer))
4039 (gnus-summary-auto-select-subject) 4043 (gnus-summary-auto-select-subject)
4044 ;; Don't mark any articles as selected if we haven't done that.
4045 (when no-article
4046 (setq overlay-arrow-position nil))
4040 ;; Show first unread article if requested. 4047 ;; Show first unread article if requested.
4041 (if (and (not no-article) 4048 (if (and (not no-article)
4042 (not no-display) 4049 (not no-display)
@@ -4941,6 +4948,16 @@ using some other form will lead to serious barfage."
4941 (gnus-article-sort-by-chars 4948 (gnus-article-sort-by-chars
4942 (gnus-thread-header h1) (gnus-thread-header h2))) 4949 (gnus-thread-header h1) (gnus-thread-header h2)))
4943 4950
4951(defsubst gnus-article-sort-by-marks (h1 h2)
4952 "Sort articles by octet length."
4953 (< (gnus-article-mark (mail-header-number h1))
4954 (gnus-article-mark (mail-header-number h2))))
4955
4956(defun gnus-thread-sort-by-marks (h1 h2)
4957 "Sort threads by root article octet length."
4958 (gnus-article-sort-by-marks
4959 (gnus-thread-header h1) (gnus-thread-header h2)))
4960
4944(defsubst gnus-article-sort-by-author (h1 h2) 4961(defsubst gnus-article-sort-by-author (h1 h2)
4945 "Sort articles by root author." 4962 "Sort articles by root author."
4946 (gnus-string< 4963 (gnus-string<
@@ -11925,6 +11942,12 @@ Argument REVERSE means reverse order."
11925 (interactive "P") 11942 (interactive "P")
11926 (gnus-summary-sort 'chars reverse)) 11943 (gnus-summary-sort 'chars reverse))
11927 11944
11945(defun gnus-summary-sort-by-mark (&optional reverse)
11946 "Sort the summary buffer by article marks.
11947Argument REVERSE means reverse order."
11948 (interactive "P")
11949 (gnus-summary-sort 'marks reverse))
11950
11928(defun gnus-summary-sort-by-original (&optional reverse) 11951(defun gnus-summary-sort-by-original (&optional reverse)
11929 "Sort the summary buffer using the default sorting method. 11952 "Sort the summary buffer using the default sorting method.
11930Argument REVERSE means reverse order." 11953Argument REVERSE means reverse order."
@@ -11970,7 +11993,10 @@ save those articles instead.
11970The variable `gnus-default-article-saver' specifies the saver function. 11993The variable `gnus-default-article-saver' specifies the saver function.
11971 11994
11972If the optional second argument NOT-SAVED is non-nil, articles saved 11995If the optional second argument NOT-SAVED is non-nil, articles saved
11973will not be marked as saved." 11996will not be marked as saved.
11997
11998The `gnus-prompt-before-saving' variable says how prompting is
11999performed."
11974 (interactive "P") 12000 (interactive "P")
11975 (require 'gnus-art) 12001 (require 'gnus-art)
11976 (let* ((articles (gnus-summary-work-articles n)) 12002 (let* ((articles (gnus-summary-work-articles n))
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index 8ab8f462885..6d6e20dc129 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -1564,7 +1564,7 @@ If UNINDENT, remove an indentation."
1564 (parent (gnus-topic-parent-topic topic)) 1564 (parent (gnus-topic-parent-topic topic))
1565 (grandparent (gnus-topic-parent-topic parent))) 1565 (grandparent (gnus-topic-parent-topic parent)))
1566 (unless grandparent 1566 (unless grandparent
1567 (error "Nothing to indent %s into" topic)) 1567 (error "Can't unindent %s further" topic))
1568 (when topic 1568 (when topic
1569 (gnus-topic-goto-topic topic) 1569 (gnus-topic-goto-topic topic)
1570 (gnus-topic-kill-group) 1570 (gnus-topic-kill-group)
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index ef6bd89c36e..bbf85fe584a 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -2654,10 +2654,6 @@ such as a mark that says whether an article is stored in the cache
2654 "submit@debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)" 2654 "submit@debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)"
2655 "The mail address of the Gnus maintainers.") 2655 "The mail address of the Gnus maintainers.")
2656 2656
2657(defconst gnus-bug-package
2658 "gnus"
2659 "The package to use in the bug submission.")
2660
2661(defvar gnus-info-nodes 2657(defvar gnus-info-nodes
2662 '((gnus-group-mode "(gnus)Group Buffer") 2658 '((gnus-group-mode "(gnus)Group Buffer")
2663 (gnus-summary-mode "(gnus)Summary Buffer") 2659 (gnus-summary-mode "(gnus)Summary Buffer")
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 4d4ba089434..ce0dad9cb05 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -2286,13 +2286,15 @@ body, set `message-archive-note' to nil."
2286 "Mangles FollowUp-To and Newsgroups header to point to TARGET-GROUP. 2286 "Mangles FollowUp-To and Newsgroups header to point to TARGET-GROUP.
2287With prefix-argument just set Follow-Up, don't cross-post." 2287With prefix-argument just set Follow-Up, don't cross-post."
2288 (interactive 2288 (interactive
2289 (list ; Completion based on Gnus 2289 (list ; Completion based on Gnus
2290 (completing-read "Followup To: " 2290 (replace-regexp-in-string
2291 (if (boundp 'gnus-newsrc-alist) 2291 "\\`.*:" ""
2292 gnus-newsrc-alist) 2292 (completing-read "Followup To: "
2293 nil nil '("poster" . 0) 2293 (if (boundp 'gnus-newsrc-alist)
2294 (if (boundp 'gnus-group-history) 2294 gnus-newsrc-alist)
2295 'gnus-group-history)))) 2295 nil nil '("poster" . 0)
2296 (if (boundp 'gnus-group-history)
2297 'gnus-group-history)))))
2296 (message-remove-header "Follow[Uu]p-[Tt]o" t) 2298 (message-remove-header "Follow[Uu]p-[Tt]o" t)
2297 (message-goto-newsgroups) 2299 (message-goto-newsgroups)
2298 (beginning-of-line) 2300 (beginning-of-line)
@@ -2361,13 +2363,15 @@ been made to before the user asked for a Crosspost."
2361 "Crossposts message and set Followup-To to TARGET-GROUP. 2363 "Crossposts message and set Followup-To to TARGET-GROUP.
2362With prefix-argument just set Follow-Up, don't cross-post." 2364With prefix-argument just set Follow-Up, don't cross-post."
2363 (interactive 2365 (interactive
2364 (list ; Completion based on Gnus 2366 (list ; Completion based on Gnus
2365 (completing-read "Followup To: " 2367 (replace-regexp-in-string
2366 (if (boundp 'gnus-newsrc-alist) 2368 "\\`.*:" ""
2367 gnus-newsrc-alist) 2369 (completing-read "Followup To: "
2368 nil nil '("poster" . 0) 2370 (if (boundp 'gnus-newsrc-alist)
2369 (if (boundp 'gnus-group-history) 2371 gnus-newsrc-alist)
2370 'gnus-group-history)))) 2372 nil nil '("poster" . 0)
2373 (if (boundp 'gnus-group-history)
2374 'gnus-group-history)))))
2371 (when (fboundp 'gnus-group-real-name) 2375 (when (fboundp 'gnus-group-real-name)
2372 (setq target-group (gnus-group-real-name target-group))) 2376 (setq target-group (gnus-group-real-name target-group)))
2373 (cond ((not (or (null target-group) ; new subject not empty 2377 (cond ((not (or (null target-group) ; new subject not empty
@@ -3108,18 +3112,29 @@ M-RET `message-newline-and-reformat' (break the line and reformat)."
3108 (looking-at "[ \t]*\n")) 3112 (looking-at "[ \t]*\n"))
3109 (expand-abbrev)) 3113 (expand-abbrev))
3110 (push-mark) 3114 (push-mark)
3115 (message-goto-body-1))
3116
3117(defun message-goto-body-1 ()
3118 "Go to the body and return point."
3111 (goto-char (point-min)) 3119 (goto-char (point-min))
3112 (or (search-forward (concat "\n" mail-header-separator "\n") nil t) 3120 (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
3113 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))) 3121 ;; If the message is mangled, find the end of the headers the
3122 ;; hard way.
3123 (progn
3124 ;; Skip past all headers and continuation lines.
3125 (while (looking-at "[^:]+:\\|[\t ]+[^\t ]")
3126 (forward-line 1))
3127 ;; We're now at the first empty line, so perhaps move past it.
3128 (when (and (eolp)
3129 (not (eobp)))
3130 (forward-line 1))
3131 (point))))
3114 3132
3115(defun message-in-body-p () 3133(defun message-in-body-p ()
3116 "Return t if point is in the message body." 3134 "Return t if point is in the message body."
3117 (>= (point) 3135 (>= (point)
3118 (save-excursion 3136 (save-excursion
3119 (goto-char (point-min)) 3137 (message-goto-body-1))))
3120 (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
3121 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))
3122 (point))))
3123 3138
3124(defun message-goto-eoh () 3139(defun message-goto-eoh ()
3125 "Move point to the end of the headers." 3140 "Move point to the end of the headers."
@@ -3330,6 +3345,8 @@ of lines before the signature intact."
3330 "Insert four newlines, and then reformat if inside quoted text. 3345 "Insert four newlines, and then reformat if inside quoted text.
3331Prefix arg means justify as well." 3346Prefix arg means justify as well."
3332 (interactive (list (if current-prefix-arg 'full))) 3347 (interactive (list (if current-prefix-arg 'full)))
3348 (unless (message-in-body-p)
3349 (error "This command only works in the body of the message"))
3333 (let (quoted point beg end leading-space bolp fill-paragraph-function) 3350 (let (quoted point beg end leading-space bolp fill-paragraph-function)
3334 (setq point (point)) 3351 (setq point (point))
3335 (beginning-of-line) 3352 (beginning-of-line)
@@ -4102,8 +4119,8 @@ It should typically alter the sending method in some way or other."
4102 (let ((inhibit-read-only t)) 4119 (let ((inhibit-read-only t))
4103 (put-text-property (point-min) (point-max) 'read-only nil)) 4120 (put-text-property (point-min) (point-max) 'read-only nil))
4104 (message-fix-before-sending) 4121 (message-fix-before-sending)
4105 (mml-secure-bcc-is-safe)
4106 (run-hooks 'message-send-hook) 4122 (run-hooks 'message-send-hook)
4123 (mml-secure-bcc-is-safe)
4107 (when message-confirm-send 4124 (when message-confirm-send
4108 (or (y-or-n-p "Send message? ") 4125 (or (y-or-n-p "Send message? ")
4109 (keyboard-quit))) 4126 (keyboard-quit)))
@@ -4539,6 +4556,9 @@ This function could be useful in `message-setup-hook'."
4539 (forward-line 1) 4556 (forward-line 1)
4540 (unless (y-or-n-p "Send anyway? ") 4557 (unless (y-or-n-p "Send anyway? ")
4541 (error "Failed to send the message"))))) 4558 (error "Failed to send the message")))))
4559 ;; Fold too-long header lines. They should be no longer than
4560 ;; 998 octets long.
4561 (message--fold-long-headers)
4542 ;; Let the user do all of the above. 4562 ;; Let the user do all of the above.
4543 (run-hooks 'message-header-hook)) 4563 (run-hooks 'message-header-hook))
4544 (setq options message-options) 4564 (setq options message-options)
@@ -4635,6 +4655,14 @@ If you always want Gnus to send messages in one piece, set
4635 (setq message-options options) 4655 (setq message-options options)
4636 (push 'mail message-sent-message-via))) 4656 (push 'mail message-sent-message-via)))
4637 4657
4658(defun message--fold-long-headers ()
4659 (goto-char (point-min))
4660 (while (not (eobp))
4661 (when (and (looking-at "[^:]+:")
4662 (> (- (line-end-position) (point)) 998))
4663 (mail-header-fold-field))
4664 (forward-line 1)))
4665
4638(defvar sendmail-program) 4666(defvar sendmail-program)
4639(defvar smtpmail-smtp-server) 4667(defvar smtpmail-smtp-server)
4640(defvar smtpmail-smtp-service) 4668(defvar smtpmail-smtp-service)
@@ -5380,16 +5408,13 @@ Otherwise, generate and save a value for `canlock-password' first."
5380 "Process Fcc headers in the current buffer." 5408 "Process Fcc headers in the current buffer."
5381 (let ((case-fold-search t) 5409 (let ((case-fold-search t)
5382 (buf (current-buffer)) 5410 (buf (current-buffer))
5383 list file 5411 (mml-externalize-attachments message-fcc-externalize-attachments)
5384 (mml-externalize-attachments message-fcc-externalize-attachments)) 5412 (file (message-field-value "fcc" t))
5385 (save-excursion 5413 list)
5386 (save-restriction 5414 (when file
5387 (message-narrow-to-headers) 5415 (with-temp-buffer
5388 (setq file (message-fetch-field "fcc" t)))
5389 (when file
5390 (set-buffer (get-buffer-create " *message temp*"))
5391 (erase-buffer)
5392 (insert-buffer-substring buf) 5416 (insert-buffer-substring buf)
5417 (message-clone-locals buf)
5393 (message-encode-message-body) 5418 (message-encode-message-body)
5394 (save-restriction 5419 (save-restriction
5395 (message-narrow-to-headers) 5420 (message-narrow-to-headers)
@@ -5429,8 +5454,7 @@ Otherwise, generate and save a value for `canlock-password' first."
5429 (if (and (file-readable-p file) (mail-file-babyl-p file)) 5454 (if (and (file-readable-p file) (mail-file-babyl-p file))
5430 (rmail-output file 1 nil t) 5455 (rmail-output file 1 nil t)
5431 (let ((mail-use-rfc822 t)) 5456 (let ((mail-use-rfc822 t))
5432 (rmail-output file 1 t t)))))) 5457 (rmail-output file 1 t t))))))))))
5433 (kill-buffer (current-buffer))))))
5434 5458
5435(defun message-output (filename) 5459(defun message-output (filename)
5436 "Append this article to Unix/babyl mail file FILENAME." 5460 "Append this article to Unix/babyl mail file FILENAME."
@@ -5761,7 +5785,7 @@ give as trustworthy answer as possible."
5761 (not (string-match message-bogus-system-names message-user-fqdn))) 5785 (not (string-match message-bogus-system-names message-user-fqdn)))
5762 ;; `message-user-fqdn' seems to be valid 5786 ;; `message-user-fqdn' seems to be valid
5763 message-user-fqdn) 5787 message-user-fqdn)
5764 ((and (string-match message-bogus-system-names sysname)) 5788 ((not (string-match message-bogus-system-names sysname))
5765 ;; `system-name' returned the right result. 5789 ;; `system-name' returned the right result.
5766 sysname) 5790 sysname)
5767 ;; Try `mail-host-address'. 5791 ;; Try `mail-host-address'.
@@ -6644,29 +6668,27 @@ OTHER-HEADERS is an alist of header/value pairs. CONTINUE says whether
6644to continue editing a message already being composed. SWITCH-FUNCTION 6668to continue editing a message already being composed. SWITCH-FUNCTION
6645is a function used to switch to and display the mail buffer." 6669is a function used to switch to and display the mail buffer."
6646 (interactive) 6670 (interactive)
6647 (let ((message-this-is-mail t)) 6671 (let ((message-this-is-mail t)
6648 (unless (message-mail-user-agent) 6672 message-buffers)
6649 (message-pop-to-buffer 6673 ;; Search for the existing message buffer if `continue' is non-nil.
6650 ;; Search for the existing message buffer if `continue' is non-nil. 6674 (if (and continue
6651 (let ((message-generate-new-buffers 6675 (setq message-buffers (message-buffers)))
6652 (when (or (not continue) 6676 (pop-to-buffer (car message-buffers))
6653 (eq message-generate-new-buffers 'standard) 6677 ;; Start a new buffer.
6654 (functionp message-generate-new-buffers)) 6678 (unless (message-mail-user-agent)
6655 message-generate-new-buffers))) 6679 (message-pop-to-buffer (message-buffer-name "mail" to) switch-function))
6656 (message-buffer-name "mail" to)) 6680 (message-setup
6657 switch-function)) 6681 (nconc
6658 (message-setup 6682 `((To . ,(or to "")) (Subject . ,(or subject "")))
6659 (nconc 6683 ;; C-h f compose-mail says that headers should be specified as
6660 `((To . ,(or to "")) (Subject . ,(or subject ""))) 6684 ;; (string . value); however all the rest of message expects
6661 ;; C-h f compose-mail says that headers should be specified as 6685 ;; headers to be symbols, not strings (eg message-header-format-alist).
6662 ;; (string . value); however all the rest of message expects 6686 ;; http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html
6663 ;; headers to be symbols, not strings (eg message-header-format-alist). 6687 ;; We need to convert any string input, eg from rmail-start-mail.
6664 ;; http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html 6688 (dolist (h other-headers other-headers)
6665 ;; We need to convert any string input, eg from rmail-start-mail. 6689 (if (stringp (car h)) (setcar h (intern (capitalize (car h)))))))
6666 (dolist (h other-headers other-headers) 6690 yank-action send-actions continue switch-function
6667 (if (stringp (car h)) (setcar h (intern (capitalize (car h))))))) 6691 return-action))))
6668 yank-action send-actions continue switch-function
6669 return-action)))
6670 6692
6671;;;###autoload 6693;;;###autoload
6672(defun message-news (&optional newsgroups subject) 6694(defun message-news (&optional newsgroups subject)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 6d13d892b5a..3a31349d378 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -486,7 +486,8 @@ be \"related\" or \"alternate\"."
486 (equal (cdr (assq 'type (car cont))) "text/html")) 486 (equal (cdr (assq 'type (car cont))) "text/html"))
487 (setq cont (mml-expand-html-into-multipart-related (car cont)))) 487 (setq cont (mml-expand-html-into-multipart-related (car cont))))
488 (prog1 488 (prog1
489 (mm-with-multibyte-buffer 489 (with-temp-buffer
490 (set-buffer-multibyte nil)
490 (setq message-options options) 491 (setq message-options options)
491 (cond 492 (cond
492 ((and (consp (car cont)) 493 ((and (consp (car cont))
@@ -605,28 +606,38 @@ be \"related\" or \"alternate\"."
605 (intern (downcase charset)))))) 606 (intern (downcase charset))))))
606 (if (and (not raw) 607 (if (and (not raw)
607 (member (car (split-string type "/")) '("text" "message"))) 608 (member (car (split-string type "/")) '("text" "message")))
609 ;; We have a text-like MIME part, so we need to do
610 ;; charset encoding.
608 (progn 611 (progn
609 (with-temp-buffer 612 (with-temp-buffer
610 (cond 613 (set-buffer-multibyte nil)
611 ((cdr (assq 'buffer cont)) 614 ;; First insert the data into the buffer.
612 (insert-buffer-substring (cdr (assq 'buffer cont)))) 615 (if (and filename
613 ((and filename 616 (not (equal (cdr (assq 'nofile cont)) "yes")))
614 (not (equal (cdr (assq 'nofile cont)) "yes"))) 617 (mm-insert-file-contents filename)
615 (let ((coding-system-for-read coding)) 618 (insert
616 (mm-insert-file-contents filename))) 619 (with-temp-buffer
617 ((eq 'mml (car cont)) 620 (cond
618 (insert (cdr (assq 'contents cont)))) 621 ((cdr (assq 'buffer cont))
619 (t 622 (insert-buffer-substring (cdr (assq 'buffer cont))))
620 (save-restriction 623 ((eq 'mml (car cont))
621 (narrow-to-region (point) (point)) 624 (insert (cdr (assq 'contents cont))))
622 (insert (cdr (assq 'contents cont))) 625 (t
623 ;; Remove quotes from quoted tags. 626 (insert (cdr (assq 'contents cont)))
624 (goto-char (point-min)) 627 ;; Remove quotes from quoted tags.
625 (while (re-search-forward 628 (goto-char (point-min))
626 "<#!+/?\\(part\\|multipart\\|external\\|mml\\|secure\\)" 629 (while (re-search-forward
627 nil t) 630 "<#!+/?\\(part\\|multipart\\|external\\|mml\\|secure\\)"
628 (delete-region (+ (match-beginning 0) 2) 631 nil t)
629 (+ (match-beginning 0) 3)))))) 632 (delete-region (+ (match-beginning 0) 2)
633 (+ (match-beginning 0) 3)))))
634 (setq charset
635 (mm-coding-system-to-mime-charset
636 (detect-coding-region
637 (point-min) (point-max) t)))
638 (encode-coding-region (point-min) (point-max)
639 charset)
640 (buffer-string))))
630 (cond 641 (cond
631 ((eq (car cont) 'mml) 642 ((eq (car cont) 'mml)
632 (let ((mml-boundary (mml-compute-boundary cont)) 643 (let ((mml-boundary (mml-compute-boundary cont))
@@ -667,21 +678,22 @@ be \"related\" or \"alternate\"."
667 ;; insert a "; format=flowed" string unless the 678 ;; insert a "; format=flowed" string unless the
668 ;; user has already specified it. 679 ;; user has already specified it.
669 (setq flowed (null (assq 'format cont))))) 680 (setq flowed (null (assq 'format cont)))))
670 ;; Prefer `utf-8' for text/calendar parts. 681 (unless charset
671 (if (or charset 682 (setq charset
672 (not (string= type "text/calendar"))) 683 ;; Prefer `utf-8' for text/calendar parts.
673 (setq charset (mm-encode-body charset)) 684 (if (string= type "text/calendar")
674 (let ((mm-coding-system-priorities 685 'utf-8
675 (cons 'utf-8 mm-coding-system-priorities))) 686 (mm-coding-system-to-mime-charset
676 (setq charset (mm-encode-body)))) 687 (detect-coding-region
677 (mm-disable-multibyte) 688 (point-min) (point-max) t)))))
678 (setq encoding (mm-body-encoding 689 (setq encoding (mm-body-encoding
679 charset (cdr (assq 'encoding cont)))))) 690 charset (cdr (assq 'encoding cont))))))
680 (setq coded (buffer-string))) 691 (setq coded (buffer-string)))
681 (mml-insert-mime-headers cont type charset encoding flowed) 692 (mml-insert-mime-headers cont type charset encoding flowed)
682 (insert "\n") 693 (insert "\n")
683 (insert coded)) 694 (insert coded))
684 (mm-with-unibyte-buffer 695 (with-temp-buffer
696 (set-buffer-multibyte nil)
685 (cond 697 (cond
686 ((cdr (assq 'buffer cont)) 698 ((cdr (assq 'buffer cont))
687 (insert (string-as-unibyte 699 (insert (string-as-unibyte
@@ -690,11 +702,7 @@ be \"related\" or \"alternate\"."
690 ((and filename 702 ((and filename
691 (not (equal (cdr (assq 'nofile cont)) "yes"))) 703 (not (equal (cdr (assq 'nofile cont)) "yes")))
692 (let ((coding-system-for-read mm-binary-coding-system)) 704 (let ((coding-system-for-read mm-binary-coding-system))
693 (mm-insert-file-contents filename nil nil nil nil t)) 705 (mm-insert-file-contents filename nil nil nil nil t)))
694 (unless charset
695 (setq charset (mm-coding-system-to-mime-charset
696 (mm-find-buffer-file-coding-system
697 filename)))))
698 (t 706 (t
699 (let ((contents (cdr (assq 'contents cont)))) 707 (let ((contents (cdr (assq 'contents cont))))
700 (if (multibyte-string-p contents) 708 (if (multibyte-string-p contents)
@@ -1244,6 +1252,7 @@ If not set, `default-directory' will be used."
1244 1252
1245(defun mml-minibuffer-read-file (prompt) 1253(defun mml-minibuffer-read-file (prompt)
1246 (let* ((completion-ignored-extensions nil) 1254 (let* ((completion-ignored-extensions nil)
1255 (buffer-file-name nil)
1247 (file (read-file-name prompt 1256 (file (read-file-name prompt
1248 (or mml-default-directory default-directory) 1257 (or mml-default-directory default-directory)
1249 nil t))) 1258 nil t)))
@@ -1378,12 +1387,23 @@ content-type, a string of the form \"type/subtype\". DESCRIPTION
1378is a one-line description of the attachment. The DISPOSITION 1387is a one-line description of the attachment. The DISPOSITION
1379specifies how the attachment is intended to be displayed. It can 1388specifies how the attachment is intended to be displayed. It can
1380be either \"inline\" (displayed automatically within the message 1389be either \"inline\" (displayed automatically within the message
1381body) or \"attachment\" (separate from the body)." 1390body) or \"attachment\" (separate from the body).
1391
1392If given a prefix interactively, no prompting will be done for
1393the TYPE, DESCRIPTION or DISPOSITION values. Instead defaults
1394will be computed and used."
1382 (interactive 1395 (interactive
1383 (let* ((file (mml-minibuffer-read-file "Attach file: ")) 1396 (let* ((file (mml-minibuffer-read-file "Attach file: "))
1384 (type (mml-minibuffer-read-type file)) 1397 (type (if current-prefix-arg
1385 (description (mml-minibuffer-read-description)) 1398 (or (mm-default-file-encoding file)
1386 (disposition (mml-minibuffer-read-disposition type nil file))) 1399 "application/octet-stream")
1400 (mml-minibuffer-read-type file)))
1401 (description (if current-prefix-arg
1402 nil
1403 (mml-minibuffer-read-description)))
1404 (disposition (if current-prefix-arg
1405 (mml-content-disposition type file)
1406 (mml-minibuffer-read-disposition type nil file))))
1387 (list file type description disposition))) 1407 (list file type description disposition)))
1388 ;; If in the message header, attach at the end and leave point unchanged. 1408 ;; If in the message header, attach at the end and leave point unchanged.
1389 (let ((head (unless (message-in-body-p) (point)))) 1409 (let ((head (unless (message-in-body-p) (point))))
diff --git a/lisp/gnus/nndoc.el b/lisp/gnus/nndoc.el
index ede118d6eb6..7f7db8721db 100644
--- a/lisp/gnus/nndoc.el
+++ b/lisp/gnus/nndoc.el
@@ -356,14 +356,18 @@ from the document.")
356 (setq nndoc-dissection-alist nil) 356 (setq nndoc-dissection-alist nil)
357 (with-current-buffer nndoc-current-buffer 357 (with-current-buffer nndoc-current-buffer
358 (erase-buffer) 358 (erase-buffer)
359 (if (and (stringp nndoc-address) 359 (condition-case error
360 (string-match nndoc-binary-file-names nndoc-address)) 360 (if (and (stringp nndoc-address)
361 (let ((coding-system-for-read 'binary)) 361 (string-match nndoc-binary-file-names nndoc-address))
362 (mm-insert-file-contents nndoc-address)) 362 (let ((coding-system-for-read 'binary))
363 (if (stringp nndoc-address) 363 (mm-insert-file-contents nndoc-address))
364 (nnheader-insert-file-contents nndoc-address) 364 (if (stringp nndoc-address)
365 (insert-buffer-substring nndoc-address)) 365 (nnheader-insert-file-contents nndoc-address)
366 (run-hooks 'nndoc-open-document-hook))))) 366 (insert-buffer-substring nndoc-address))
367 (run-hooks 'nndoc-open-document-hook))
368 (file-error
369 (nnheader-report 'nndoc "Couldn't open %s: %s"
370 group error))))))
367 ;; Initialize the nndoc structures according to this new document. 371 ;; Initialize the nndoc structures according to this new document.
368 (when (and nndoc-current-buffer 372 (when (and nndoc-current-buffer
369 (not nndoc-dissection-alist)) 373 (not nndoc-dissection-alist))
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 700e86a0c57..2943c8dc7d2 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -67,7 +67,11 @@ back on `network'.")
67 (if (listp imap-shell-program) 67 (if (listp imap-shell-program)
68 (car imap-shell-program) 68 (car imap-shell-program)
69 imap-shell-program) 69 imap-shell-program)
70 "ssh %s imapd")) 70 "ssh %s imapd")
71 "What command to execute to connect to an IMAP server.
72This will only be used if the connection type is `shell'. See
73the `open-network-stream' documentation for an explanation of
74the format.")
71 75
72(defvoo nnimap-inbox nil 76(defvoo nnimap-inbox nil
73 "The mail box where incoming mail arrives and should be split out of. 77 "The mail box where incoming mail arrives and should be split out of.