Show
Ignore:
Timestamp:
10/31/04 15:41:47 (4 years ago)
Author:
miyoshi
Message:

* fringe.c: Sync up with Emacs CVS HEAD.

* xdisp.c (handle_single_display_prop): Merge codes related with
the changes in fringe.c.

* xfaces.c: Update declarations.

* w32console.c: Partially sync up with Emacs CVS HEAD.

* mw32term.c (note_mouse_highlight): Update arguments for
window_from_coordinates().
(glyph_rect): Ditto.
(mw32_message_loop): Ditto.
Merge codes related with the changes in fringe.c.

* lisp.h: Update declarations.

* keymap.c: Update declarations.
(describe_command): Add a dummy argument.
(describe_translation): Ditto.

* keyboard.c (make_lispy_event): Update arguments for
window_from_coordinates().
(make_lispy_movement): Ditto.

* dispextern.h: Update declarations.

* eval.c: Ditto.

* alloc.c (make_string): Sync up with Emacs CVS HEAD.
(make_unibyte_string): Ditto.
(make_multibyte_string): Ditto.

* lisp/cus-load.el: Update.

* lisp/loaddefs.el: Ditto.

* lisp/calc/calc-embed.el: Sync up with Emacs CVS HEAD.

* lisp/calc/calc-graph.el: Ditto.

* lisp/calc/calc-help.el: Ditto.

* lisp/calc/calc-misc.el: Ditto.

* lisp/calc/calc-units.el: Ditto.

* lisp/calc/calc.el: Ditto.

* lisp/calendar/cal-iso.el: Ditto.

* lisp/calendar/cal-menu.el: Ditto.

* lisp/calendar/calendar.el: Ditto.

* lisp/calendar/diary-lib.el: Ditto.

* lisp/calendar/holidays.el: Ditto.

* lisp/calendar/time-date.el: Ditto.

* lisp/emacs-lisp/cl-macs.el: Ditto.

* lisp/emacs-lisp/helper.el: Ditto.

* lisp/emulation/cua-base.el: Ditto.

* lisp/emulation/cua-rect.el: Ditto.

* lisp/eshell/em-pred.el: Ditto.

* lisp/eshell/esh-ext.el: Ditto.

* lisp/gnus/ChangeLog: Ditto.

* lisp/gnus/binhex.el: Ditto.

* lisp/gnus/catchup.xpm: Ditto.

* lisp/gnus/cu-exit.xpm: Ditto.

* lisp/gnus/describe-group.xpm: Ditto.

* lisp/gnus/earcon.el: Ditto.

* lisp/gnus/exit-gnus.xpm: Ditto.

* lisp/gnus/exit-summ.xpm: Ditto.

* lisp/gnus/flow-fill.el: Ditto.

* lisp/gnus/followup.xpm: Ditto.

* lisp/gnus/fuwo.xpm: Ditto.

* lisp/gnus/get-news.xpm: Ditto.

* lisp/gnus/gnntg.xpm: Ditto.

* lisp/gnus/gnus-agent.el: Ditto.

* lisp/gnus/gnus-art.el: Ditto.

* lisp/gnus/gnus-async.el: Ditto.

* lisp/gnus/gnus-audio.el: Ditto.

* lisp/gnus/gnus-bcklg.el: Ditto.

* lisp/gnus/gnus-cache.el: Ditto.

* lisp/gnus/gnus-cite.el: Ditto.

* lisp/gnus/gnus-cus.el: Ditto.

* lisp/gnus/gnus-demon.el: Ditto.

* lisp/gnus/gnus-draft.el: Ditto.

* lisp/gnus/gnus-dup.el: Ditto.

* lisp/gnus/gnus-eform.el: Ditto.

* lisp/gnus/gnus-ems.el: Ditto.

* lisp/gnus/gnus-gl.el: Ditto.

* lisp/gnus/gnus-group.el: Ditto.

* lisp/gnus/gnus-int.el: Ditto.

* lisp/gnus/gnus-kill.el: Ditto.

* lisp/gnus/gnus-logic.el: Ditto.

* lisp/gnus/gnus-mh.el: Ditto.

* lisp/gnus/gnus-ml.el: Ditto.

* lisp/gnus/gnus-mlspl.el: Ditto.

* lisp/gnus/gnus-msg.el: Ditto.

* lisp/gnus/gnus-nocem.el: Ditto.

* lisp/gnus/gnus-range.el: Ditto.

* lisp/gnus/gnus-salt.el: Ditto.

* lisp/gnus/gnus-score.el: Ditto.

* lisp/gnus/gnus-setup.el: Ditto.

* lisp/gnus/gnus-soup.el: Ditto.

* lisp/gnus/gnus-spec.el: Ditto.

* lisp/gnus/gnus-srvr.el: Ditto.

* lisp/gnus/gnus-start.el: Ditto.

* lisp/gnus/gnus-sum.el: Ditto.

* lisp/gnus/gnus-topic.el: Ditto.

* lisp/gnus/gnus-undo.el: Ditto.

* lisp/gnus/gnus-util.el: Ditto.

* lisp/gnus/gnus-uu.el: Ditto.

* lisp/gnus/gnus-vm.el: Ditto.

* lisp/gnus/gnus-win.el: Ditto.

* lisp/gnus/gnus.el: Ditto.

* lisp/gnus/ietf-drums.el: Ditto.

* lisp/gnus/imap.el: Ditto.

* lisp/gnus/kill-group.xpm: Ditto.

* lisp/gnus/mail-parse.el: Ditto.

* lisp/gnus/mail-prsvr.el: Ditto.

* lisp/gnus/mail-reply.xpm: Ditto.

* lisp/gnus/mail-source.el: Ditto.

* lisp/gnus/mailcap.el: Ditto.

* lisp/gnus/message.el: Ditto.

* lisp/gnus/messcompat.el: Ditto.

* lisp/gnus/mm-bodies.el: Ditto.

* lisp/gnus/mm-decode.el: Ditto.

* lisp/gnus/mm-encode.el: Ditto.

* lisp/gnus/mm-partial.el: Ditto.

* lisp/gnus/mm-util.el: Ditto.

* lisp/gnus/mm-uu.el: Ditto.

* lisp/gnus/mm-view.el: Ditto.

* lisp/gnus/mml.el: Ditto.

* lisp/gnus/next-ur.xpm: Ditto.

* lisp/gnus/nnagent.el: Ditto.

* lisp/gnus/nnbabyl.el: Ditto.

* lisp/gnus/nndoc.el: Ditto.

* lisp/gnus/nndraft.el: Ditto.

* lisp/gnus/nneething.el: Ditto.

* lisp/gnus/nnfolder.el: Ditto.

* lisp/gnus/nngateway.el: Ditto.

* lisp/gnus/nnheader.el: Ditto.

* lisp/gnus/nnimap.el: Ditto.

* lisp/gnus/nnkiboze.el: Ditto.

* lisp/gnus/nnlistserv.el: Ditto.

* lisp/gnus/nnmail.el: Ditto.

* lisp/gnus/nnmbox.el: Ditto.

* lisp/gnus/nnmh.el: Ditto.

* lisp/gnus/nnml.el: Ditto.

* lisp/gnus/nnoo.el: Ditto.

* lisp/gnus/nnslashdot.el: Ditto.

* lisp/gnus/nnsoup.el: Ditto.

* lisp/gnus/nnspool.el: Ditto.

* lisp/gnus/nntp.el: Ditto.

* lisp/gnus/nnultimate.el: Ditto.

* lisp/gnus/nnvirtual.el: Ditto.

* lisp/gnus/nnwarchive.el: Ditto.

* lisp/gnus/nnweb.el: Ditto.

* lisp/gnus/pop3.el: Ditto.

* lisp/gnus/post.xpm: Ditto.

* lisp/gnus/prev-ur.xpm: Ditto.

* lisp/gnus/qp.el: Ditto.

* lisp/gnus/reply-wo.xpm: Ditto.

* lisp/gnus/reply.xpm: Ditto.

* lisp/gnus/rfc1843.el: Ditto.

* lisp/gnus/rfc2045.el: Ditto.

* lisp/gnus/rfc2047.el: Ditto.

* lisp/gnus/rfc2231.el: Ditto.

* lisp/gnus/rot13.xpm: Ditto.

* lisp/gnus/save-aif.xpm: Ditto.

* lisp/gnus/save-art.xpm: Ditto.

* lisp/gnus/score-mode.el: Ditto.

* lisp/gnus/subscribe.xpm: Ditto.

* lisp/gnus/unsubscribe.xpm: Ditto.

* lisp/gnus/utf7.el: Ditto.

* lisp/gnus/uu-decode.xpm: Ditto.

* lisp/gnus/uu-post.xpm: Ditto.

* lisp/gnus/uudecode.el: Ditto.

* lisp/gnus/webmail.el: Ditto.

* lisp/international/characters.el: Ditto.

* lisp/language/cyrillic.el: Ditto.

* lisp/language/indian.el: Ditto.

* lisp/mail/mail-extr.el: Ditto.

* lisp/mail/smtpmail.el: Ditto.

* lisp/mail/supercite.el: Ditto.

* lisp/menu-bar.el: Ditto.

* lisp/mh-e/ChangeLog: Ditto.

* lisp/mh-e/mh-alias.el: Ditto.

* lisp/mh-e/mh-comp.el: Ditto.

* lisp/mh-e/mh-customize.el: Ditto.

* lisp/mh-e/mh-e.el: Ditto.

* lisp/mh-e/mh-funcs.el: Ditto.

* lisp/mh-e/mh-gnus.el: Ditto.

* lisp/mh-e/mh-identity.el: Ditto.

* lisp/mh-e/mh-inc.el: Ditto.

* lisp/mh-e/mh-index.el: Ditto.

* lisp/mh-e/mh-junk.el: Ditto.

* lisp/mh-e/mh-loaddefs.el: Ditto.

* lisp/mh-e/mh-mime.el: Ditto.

* lisp/mh-e/mh-pick.el: Ditto.

* lisp/mh-e/mh-seq.el: Ditto.

* lisp/mh-e/mh-speed.el: Ditto.

* lisp/mh-e/mh-utils.el: Ditto.

* lisp/mouse-sel.el: Ditto.

* lisp/mouse.el: Ditto.

* lisp/msb.el: Ditto.

* lisp/mwheel.el: Ditto.

* lisp/newcomment.el: Ditto.

* lisp/novice.el: Ditto.

* lisp/outline.el: Ditto.

* lisp/paren.el: Ditto.

* lisp/paths.el: Ditto.

* lisp/play/animate.el: Ditto.

* lisp/play/blackbox.el: Ditto.

* lisp/play/gamegrid.el: Ditto.

* lisp/play/landmark.el: Ditto.

* lisp/play/morse.el: Ditto.

* lisp/play/zone.el: Ditto.

* lisp/printing.el: Ditto.

* lisp/simple.el: Ditto.

* lisp/term/mac-win.el: Ditto.

* lisp/term/x-win.el: Ditto.

* lisp/term/xterm.el: Ditto.

* lisp/textmodes/bibtex.el: Ditto.

* lisp/textmodes/enriched.el: Ditto.

* lisp/textmodes/flyspell.el: Ditto.

* lisp/textmodes/ispell.el: Ditto.

* lisp/textmodes/paragraphs.el: Ditto.

* lisp/textmodes/reftex-auc.el: Ditto.

* lisp/textmodes/tex-mode.el: Ditto.

* lisp/url/ChangeLog: Ditto.

* lisp/url/url-auth.el: Ditto.

* lisp/url/url-cache.el: Ditto.

* lisp/url/url-cookie.el: Ditto.

* lisp/url/url-dired.el: Ditto.

* lisp/url/url-file.el: Ditto.

* lisp/url/url-ftp.el: Ditto.

* lisp/url/url-gw.el: Ditto.

* lisp/url/url-handlers.el: Ditto.

* lisp/url/url-history.el: Ditto.

* lisp/url/url-https.el: Ditto.

* lisp/url/url-irc.el: Ditto.

* lisp/url/url-ldap.el: Ditto.

* lisp/url/url-mailto.el: Ditto.

* lisp/url/url-methods.el: Ditto.

* lisp/url/url-misc.el: Ditto.

* lisp/url/url-news.el: Ditto.

* lisp/url/url-nfs.el: Ditto.

* lisp/url/url-parse.el: Ditto.

* lisp/url/url-privacy.el: Ditto.

* lisp/url/url-util.el: Ditto.

* lisp/url/url-vars.el: Ditto.

* lisp/url/url.el: Ditto.

* lisp/calendar/icalendar.el: New file.

* lisp/gnus/ChangeLog.2: Ditto.

* lisp/gnus/TODO: Ditto.

* lisp/gnus/bar.xbm: Ditto.

* lisp/gnus/bar.xpm: Ditto.

* lisp/gnus/blink.pbm: Ditto.

* lisp/gnus/blink.xpm: Ditto.

* lisp/gnus/braindamaged.xpm: Ditto.

* lisp/gnus/canlock.el: Ditto.

* lisp/gnus/compface.el: Ditto.

* lisp/gnus/cry.xpm: Ditto.

* lisp/gnus/dead.xpm: Ditto.

* lisp/gnus/deuglify.el: Ditto.

* lisp/gnus/dig.el: Ditto.

* lisp/gnus/dns.el: Ditto.

* lisp/gnus/evil.xpm: Ditto.

* lisp/gnus/forced.xpm: Ditto.

* lisp/gnus/frown.xpm: Ditto.

* lisp/gnus/gnus-delay.el: Ditto.

* lisp/gnus/gnus-diary.el: Ditto.

* lisp/gnus/gnus-dired.el: Ditto.

* lisp/gnus/gnus-fun.el: Ditto.

* lisp/gnus/gnus-picon.el: Ditto.

* lisp/gnus/gnus-pointer.xbm: Ditto.

* lisp/gnus/gnus-pointer.xpm: Ditto.

* lisp/gnus/gnus-registry.el: Ditto.

* lisp/gnus/gnus-sieve.el: Ditto.

* lisp/gnus/important.xpm: Ditto.

* lisp/gnus/indifferent.xpm: Ditto.

* lisp/gnus/mm-extern.el: Ditto.

* lisp/gnus/mm-url.el: Ditto.

* lisp/gnus/mml-sec.el: Ditto.

* lisp/gnus/mml-smime.el: Ditto.

* lisp/gnus/mml1991.el: Ditto.

* lisp/gnus/mml2015.el: Ditto.

* lisp/gnus/nndb.el: Ditto.

* lisp/gnus/nndiary.el: Ditto.

* lisp/gnus/gnus.xbm: Ditto.

* lisp/gnus/gnus.xpm: Ditto.

* lisp/gnus/grin.xpm: Ditto.

* lisp/gnus/hex-util.el: Ditto.

* lisp/gnus/html2text.el: Ditto.

* lisp/gnus/nnmaildir.el: Ditto.

* lisp/gnus/nnnil.el: Ditto.

* lisp/gnus/nnrss.el: Ditto.

* lisp/gnus/nnwfm.el: Ditto.

* lisp/gnus/pgg-def.el: Ditto.

* lisp/gnus/pgg-gpg.el: Ditto.

* lisp/gnus/pgg-parse.el: Ditto.

* lisp/gnus/pgg-pgp.el: Ditto.

* lisp/gnus/pgg-pgp5.el: Ditto.

* lisp/gnus/pgg.el: Ditto.

* lisp/gnus/preview.xbm: Ditto.

* lisp/gnus/preview.xpm: Ditto.

* lisp/gnus/receipt.xpm: Ditto.

* lisp/gnus/reverse-smile.xpm: Ditto.

* lisp/gnus/sad.pbm: Ditto.

* lisp/gnus/sad.xpm: Ditto.

* lisp/gnus/sha1.el: Ditto.

* lisp/gnus/sieve-manage.el: Ditto.

* lisp/gnus/sieve-mode.el: Ditto.

* lisp/gnus/sieve.el: Ditto.

* lisp/gnus/smile.xpm: Ditto.

* lisp/gnus/smiley.el: Ditto.

* lisp/gnus/smime.el: Ditto.

* lisp/gnus/spam-report.el: Ditto.

* lisp/gnus/spam-stat.el: Ditto.

* lisp/gnus/spam.el: Ditto.

* lisp/gnus/unimportant.xpm: Ditto.

* lisp/gnus/wry.xpm: Ditto.

* lisp/gnus/yenc.el: Ditto.

* lisp/mh-e/mh-acros.el: Ditto.

* lisp/mh-e/mh-init.el: Ditto.

* lisp/mh-e/mh-print.el: Ditto.

* lisp/net/password.el: Ditto.

* lisp/textmodes/dns-mode.el: Ditto.

* lisp/gnus/gnus-mule.el: Removed.

* lisp/gnus/smiley-ems.el: Ditto.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/lisp/gnus/gnus-msg.el

    r3505 r3526  
    11;;; gnus-msg.el --- mail and post interface for Gnus 
    2 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 
     2;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 
    33;;        Free Software Foundation, Inc. 
    44 
     
    3434(require 'message) 
    3535(require 'gnus-art) 
     36(require 'gnus-util) 
    3637 
    3738(defcustom gnus-post-method 'current 
     
    5556                 (sexp :tag "Methods" ,gnus-select-method))) 
    5657 
    57 (defvar gnus-outgoing-message-group nil 
     58(defcustom gnus-outgoing-message-group nil 
    5859  "*All outgoing messages will be put in this group. 
    5960If you want to store all your outgoing mail and articles in the group 
     
    6465message in, you can set this variable to a function that checks the 
    6566current newsgroup name and then returns a suitable group name (or list 
    66 of names).") 
    67  
    68 (defvar gnus-mailing-list-groups nil 
    69   "*Regexp matching groups that are really mailing lists. 
     67of names)." 
     68  :group 'gnus-message 
     69  :type '(choice (string :tag "Group") 
     70                 (function))) 
     71 
     72(defcustom gnus-mailing-list-groups nil 
     73  "*If non-nil a regexp matching groups that are really mailing lists. 
    7074This is useful when you're reading a mailing list that has been 
    7175gatewayed to a newsgroup, and you want to followup to an article in 
    72 the group.") 
    73  
    74 (defvar gnus-add-to-list nil 
    75   "*If non-nil, add a `to-list' parameter automatically.") 
    76  
    77 (defvar gnus-crosspost-complaint 
     76the group." 
     77  :group 'gnus-message 
     78  :type '(choice (regexp) 
     79                 (const nil))) 
     80 
     81(defcustom gnus-add-to-list nil 
     82  "*If non-nil, add a `to-list' parameter automatically." 
     83  :group 'gnus-message 
     84  :type 'boolean) 
     85 
     86(defcustom gnus-crosspost-complaint 
    7887  "Hi, 
    7988 
     
    91100  "Format string to be inserted when complaining about crossposts. 
    92101The first %s will be replaced by the Newsgroups header; 
    93 the second with the current group name.") 
    94  
    95 (defvar gnus-message-setup-hook nil 
    96   "Hook run after setting up a message buffer.") 
    97  
    98 (defvar gnus-bug-create-help-buffer t 
    99   "*Should we create the *Gnus Help Bug* buffer?") 
    100  
    101 (defvar gnus-posting-styles nil 
    102   "*Alist of styles to use when posting.") 
    103  
    104 (defcustom gnus-group-posting-charset-alist 
     102the second with the current group name." 
     103  :group 'gnus-message 
     104  :type 'string) 
     105 
     106(defcustom gnus-message-setup-hook nil 
     107  "Hook run after setting up a message buffer." 
     108  :group 'gnus-message 
     109  :type 'hook) 
     110 
     111(defcustom gnus-bug-create-help-buffer t 
     112  "*Should we create the *Gnus Help Bug* buffer?" 
     113  :group 'gnus-message 
     114  :type 'boolean) 
     115 
     116(defcustom gnus-posting-styles nil 
     117  "*Alist of styles to use when posting. 
     118See Info node `(gnus)Posting Styles'." 
     119  :group 'gnus-message 
     120  :link '(custom-manual "(gnus)Posting Styles") 
     121  :type '(repeat (cons (choice (regexp) 
     122                               (variable) 
     123                               (list (const header) 
     124                                     (string :tag "Header") 
     125                                     (regexp :tag "Regexp")) 
     126                               (function) 
     127                               (sexp)) 
     128                       (repeat (list 
     129                                (choice (const signature) 
     130                                        (const signature-file) 
     131                                        (const organization) 
     132                                        (const address) 
     133                                        (const x-face-file) 
     134                                        (const name) 
     135                                        (const body) 
     136                                        (symbol) 
     137                                        (string :tag "Header")) 
     138                                (choice (string) 
     139                                        (function) 
     140                                        (variable) 
     141                                        (sexp))))))) 
     142 
     143(defcustom gnus-gcc-mark-as-read nil 
     144  "If non-nil, automatically mark Gcc articles as read." 
     145  :version "21.4" 
     146  :group 'gnus-message 
     147  :type 'boolean) 
     148 
     149(make-obsolete-variable 'gnus-inews-mark-gcc-as-read 
     150                        'gnus-gcc-mark-as-read) 
     151 
     152(defcustom gnus-gcc-externalize-attachments nil 
     153  "Should local-file attachments be included as external parts in Gcc copies? 
     154If it is `all', attach files as external parts; 
     155if a regexp and matches the Gcc group name, attach files as external parts; 
     156if nil, attach files as normal parts." 
     157  :version "21.4" 
     158  :group 'gnus-message 
     159  :type '(choice (const nil :tag "None") 
     160                 (const all :tag "Any") 
     161                 (string :tag "Regexp"))) 
     162 
     163(gnus-define-group-parameter 
     164 posting-charset-alist 
     165 :type list 
     166 :function-document 
     167 "Return the permitted unencoded charsets for posting of GROUP." 
     168 :variable gnus-group-posting-charset-alist 
     169 :variable-default 
    105170  '(("^\\(no\\|fr\\)\\.[^,]*\\(,[ \t\n]*\\(no\\|fr\\)\\.[^,]*\\)*$" iso-8859-1 (iso-8859-1)) 
    106171    ("^\\(fido7\\|relcom\\)\\.[^,]*\\(,[ \t\n]*\\(fido7\\|relcom\\)\\.[^,]*\\)*$" koi8-r (koi8-r)) 
    107172    (message-this-is-mail nil nil) 
    108173    (message-this-is-news nil t)) 
     174 :variable-document 
    109175  "Alist of regexps and permitted unencoded charsets for posting. 
    110176Each element of the alist has the form (TEST HEADER BODY-LIST), where 
     
    119185Note that any value other than nil for HEADER infringes some RFCs, so 
    120186use this option with care." 
    121   :type '(repeat (list :tag "Permitted unencoded charsets" 
    122                   (choice :tag "Where" 
    123                    (regexp :tag "Group") 
    124                    (const :tag "Mail message" :value message-this-is-mail) 
    125                    (const :tag "News article" :value message-this-is-news)) 
    126                   (choice :tag "Header" 
    127                    (const :tag "None" nil) 
    128                    (symbol :tag "Charset")) 
    129                   (choice :tag "Body" 
    130                           (const :tag "Any" :value t) 
    131                           (const :tag "None" :value nil) 
    132                           (repeat :tag "Charsets" 
    133                                   (symbol :tag "Charset"))))) 
    134   :group 'gnus-charset) 
     187 :variable-group gnus-charset 
     188 :variable-type 
     189 '(repeat (list :tag "Permitted unencoded charsets" 
     190                (choice :tag "Where" 
     191                        (regexp :tag "Group") 
     192                        (const :tag "Mail message" :value message-this-is-mail) 
     193                        (const :tag "News article" :value message-this-is-news)) 
     194                (choice :tag "Header" 
     195                        (const :tag "None" nil) 
     196                        (symbol :tag "Charset")) 
     197                (choice :tag "Body" 
     198                        (const :tag "Any" :value t) 
     199                        (const :tag "None" :value nil) 
     200                        (repeat :tag "Charsets" 
     201                                (symbol :tag "Charset"))))) 
     202 :parameter-type '(choice :tag "Permitted unencoded charsets" 
     203                          :value nil 
     204                          (repeat (symbol))) 
     205 :parameter-document       "\ 
     206List of charsets that are permitted to be unencoded.") 
     207 
     208(defcustom gnus-debug-files 
     209  '("gnus.el" "gnus-sum.el" "gnus-group.el" 
     210    "gnus-art.el" "gnus-start.el" "gnus-async.el" 
     211    "gnus-msg.el" "gnus-score.el" "gnus-win.el" "gnus-topic.el" 
     212    "gnus-agent.el" "gnus-cache.el" "gnus-srvr.el" 
     213    "mm-util.el" "mm-decode.el" "nnmail.el" "message.el") 
     214  "Files whose variables will be reported in `gnus-bug'." 
     215  :version "21.4" 
     216  :group 'gnus-message 
     217  :type '(repeat (string :tag "File"))) 
     218 
     219(defcustom gnus-debug-exclude-variables 
     220  '(mm-mime-mule-charset-alist 
     221    nnmail-split-fancy message-minibuffer-local-map) 
     222  "Variables that should not be reported in `gnus-bug'." 
     223  :version "21.4" 
     224  :group 'gnus-message 
     225  :type '(repeat (symbol :tag "Variable"))) 
     226 
     227(defcustom gnus-discouraged-post-methods 
     228  '(nndraft nnml nnimap nnmaildir nnmh nnfolder nndir) 
     229  "A list of back ends that are not used in \"real\" newsgroups. 
     230This variable is used only when `gnus-post-method' is `current'." 
     231  :version "21.4" 
     232  :group 'gnus-group-foreign 
     233  :type '(repeat (symbol :tag "Back end"))) 
     234 
     235(defcustom gnus-message-replysign 
     236  nil 
     237  "Automatically sign replies to signed messages. 
     238See also the `mml-default-sign-method' variable." 
     239  :group 'gnus-message 
     240  :type 'boolean) 
     241 
     242(defcustom gnus-message-replyencrypt 
     243  nil 
     244  "Automatically encrypt replies to encrypted messages. 
     245See also the `mml-default-encrypt-method' variable." 
     246  :group 'gnus-message 
     247  :type 'boolean) 
     248 
     249(defcustom gnus-message-replysignencrypted 
     250  t 
     251  "Setting this causes automatically encrypted messages to also be signed." 
     252  :group 'gnus-message 
     253  :type 'boolean) 
     254 
     255(defcustom gnus-confirm-mail-reply-to-news nil 
     256  "If non-nil, Gnus requests confirmation when replying to news. 
     257This is done because new users often reply by mistake when reading 
     258news. 
     259This can also be a function receiving the group name as the only 
     260parameter which should return non-nil iff a confirmation is needed, or 
     261a regexp, in which case a confirmation is asked for iff the group name 
     262matches the regexp." 
     263  :version "21.4" 
     264  :group 'gnus-message 
     265  :type '(choice (const :tag "No" nil) 
     266                 (const :tag "Yes" t) 
     267                 (regexp :tag "Iff group matches regexp") 
     268                 (function :tag "Iff function evaluates to non-nil"))) 
     269 
     270(defcustom gnus-confirm-treat-mail-like-news 
     271  nil 
     272  "If non-nil, Gnus will treat mail like news with regard to confirmation 
     273when replying by mail.  See the `gnus-confirm-mail-reply-to-news' variable 
     274for fine-tuning this. 
     275If nil, Gnus will never ask for confirmation if replying to mail." 
     276  :version "21.4" 
     277  :group 'gnus-message 
     278  :type 'boolean) 
     279 
     280(defcustom gnus-summary-resend-default-address t 
     281  "If non-nil, Gnus tries to suggest a default address to resend to. 
     282If nil, the address field will always be empty after invoking 
     283`gnus-summary-resend-message'." 
     284  :group 'gnus-message 
     285  :type 'boolean) 
    135286 
    136287;;; Internal variables. 
     
    139290  "Inhibit the use of posting styles.") 
    140291 
     292(defvar gnus-article-yanked-articles nil) 
    141293(defvar gnus-message-buffer "*Mail Gnus*") 
    142294(defvar gnus-article-copy nil) 
     295(defvar gnus-check-before-posting nil) 
    143296(defvar gnus-last-posting-server nil) 
    144297(defvar gnus-message-group-art nil) 
     298 
     299(defvar gnus-msg-force-broken-reply-to nil) 
    145300 
    146301(defconst gnus-bug-message 
     
    167322(eval-and-compile 
    168323  (autoload 'gnus-uu-post-news "gnus-uu" nil t) 
     324  (autoload 'news-setup "rnewspost") 
     325  (autoload 'news-reply-mode "rnewspost") 
    169326  (autoload 'rmail-dont-reply-to "mail-utils") 
    170327  (autoload 'rmail-output "rmailout")) 
     
    177334(gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map) 
    178335  "p" gnus-summary-post-news 
     336  "i" gnus-summary-news-other-window 
    179337  "f" gnus-summary-followup 
    180338  "F" gnus-summary-followup-with-original 
     
    186344  "w" gnus-summary-wide-reply 
    187345  "W" gnus-summary-wide-reply-with-original 
     346  "v" gnus-summary-very-wide-reply 
     347  "V" gnus-summary-very-wide-reply-with-original 
    188348  "n" gnus-summary-followup-to-mail 
    189349  "N" gnus-summary-followup-to-mail-with-original 
     
    191351  "u" gnus-uu-post-news 
    192352  "\M-c" gnus-summary-mail-crosspost-complaint 
     353  "Br" gnus-summary-reply-broken-reply-to 
     354  "BR" gnus-summary-reply-broken-reply-to-with-original 
    193355  "om" gnus-summary-mail-forward 
    194356  "op" gnus-summary-post-forward 
     
    199361  "b" gnus-summary-resend-bounced-mail 
    200362  ;; "c" gnus-summary-send-draft 
    201   "r" gnus-summary-resend-message) 
     363  "r" gnus-summary-resend-message 
     364  "e" gnus-summary-resend-message-edit) 
    202365 
    203366;;; Internal functions. 
     367 
     368(defun gnus-inews-make-draft () 
     369  `(lambda () 
     370     (gnus-inews-make-draft-meta-information 
     371      ,gnus-newsgroup-name ',gnus-article-reply))) 
    204372 
    205373(defvar gnus-article-reply nil) 
     
    208376        (buffer (make-symbol "gnus-setup-message-buffer")) 
    209377        (article (make-symbol "gnus-setup-message-article")) 
     378        (yanked (make-symbol "gnus-setup-yanked-articles")) 
    210379        (group (make-symbol "gnus-setup-message-group"))) 
    211380    `(let ((,winconf (current-window-configuration)) 
    212381           (,buffer (buffer-name (current-buffer))) 
    213            (,article (and gnus-article-reply (gnus-summary-article-number))) 
     382           (,article gnus-article-reply) 
     383           (,yanked gnus-article-yanked-articles) 
    214384           (,group gnus-newsgroup-name) 
    215385           (message-header-setup-hook 
     
    220390       (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc) 
    221391       (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc) 
    222        (add-hook 'message-mode-hook 'gnus-configure-posting-styles) 
     392       ;; #### FIXME: for a reason that I did not manage to identify yet, 
     393       ;; the variable `gnus-newsgroup-name' does not honor a dynamically 
     394       ;; scoped or setq'ed value from a caller like `C-u gnus-summary-mail'. 
     395       ;; After evaluation of @forms below, it gets the value we actually want 
     396       ;; to override, and the posting styles are used. For that reason, I've 
     397       ;; added an optional argument to `gnus-configure-posting-styles' to 
     398       ;; make sure that the correct value for the group name is used. -- drv 
     399       (add-hook 'message-mode-hook 
     400                 (if (memq ,config '(reply-yank reply)) 
     401                     (lambda () 
     402                       (gnus-configure-posting-styles ,group)) 
     403                   (lambda () 
     404                     ;; There may be an old " *gnus article copy*" buffer. 
     405                     (let (gnus-article-copy) 
     406                       (gnus-configure-posting-styles ,group))))) 
     407       (gnus-pull ',(intern gnus-draft-meta-information-header) 
     408                  message-required-headers) 
     409       (when (and ,group 
     410                  (not (string= ,group ""))) 
     411         (push (cons 
     412                (intern gnus-draft-meta-information-header) 
     413                (gnus-inews-make-draft)) 
     414               message-required-headers)) 
    223415       (unwind-protect 
    224416           (progn 
    225417             ,@forms) 
    226          (gnus-inews-add-send-actions ,winconf ,buffer ,article) 
     418         (gnus-inews-add-send-actions ,winconf ,buffer ,article ,config 
     419                                      ,yanked) 
    227420         (setq gnus-message-buffer (current-buffer)) 
    228421         (set (make-local-variable 'gnus-message-group-art) 
     
    234427               (setq mml-buffer-list mbl)  ;; Global value 
    235428               (set (make-local-variable 'mml-buffer-list) mbl1);; Local value 
     429               (gnus-make-local-hook 'kill-buffer-hook) 
     430               (gnus-make-local-hook 'change-major-mode-hook) 
    236431               (add-hook 'change-major-mode-hook 'mml-destroy-buffers nil t) 
    237432               (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)) 
    238433           (mml-destroy-buffers) 
    239434           (setq mml-buffer-list mbl))) 
     435       (message-hide-headers) 
    240436       (gnus-add-buffer) 
    241437       (gnus-configure-windows ,config t) 
     438       (run-hooks 'post-command-hook) 
    242439       (set-buffer-modified-p nil)))) 
    243440 
     441(defun gnus-inews-make-draft-meta-information (group article) 
     442  (concat "(\"" group "\" " 
     443          (if article (number-to-string 
     444                       (if (listp article) 
     445                           (car article) 
     446                         article)) "\"\"") 
     447          ")")) 
     448 
    244449;;;###autoload 
    245 (defun gnus-msg-mail (&rest args) 
     450(defun gnus-msg-mail (&optional to subject other-headers continue 
     451                                switch-action yank-action send-actions) 
    246452  "Start editing a mail message to be sent. 
    247453Like `message-mail', but with Gnus paraphernalia, particularly the 
    248454Gcc: header for archiving purposes." 
    249455  (interactive) 
    250   (gnus-setup-message 'message 
    251     (apply 'message-mail args)) 
     456  (let ((buf (current-buffer)) 
     457        mail-buf) 
     458    (gnus-setup-message 'message 
     459      (message-mail to subject other-headers continue 
     460                    nil yank-action send-actions)) 
     461    (when switch-action 
     462      (setq mail-buf (current-buffer)) 
     463      (switch-to-buffer buf) 
     464      (apply switch-action mail-buf nil))) 
    252465  ;; COMPOSEFUNC should return t if succeed.  Undocumented ??? 
    253466  t) 
    254467 
     468(defvar save-selected-window-window) 
     469 
     470;;;###autoload 
     471(defun gnus-button-mailto (address) 
     472  "Mail to ADDRESS." 
     473  (set-buffer (gnus-copy-article-buffer)) 
     474  (gnus-setup-message 'message 
     475    (message-reply address)) 
     476  (and (boundp 'save-selected-window-window) 
     477       (not (window-live-p save-selected-window-window)) 
     478       (setq save-selected-window-window (selected-window)))) 
     479 
     480;;;###autoload 
     481(defun gnus-button-reply (&optional to-address wide) 
     482  "Like `message-reply'." 
     483  (interactive) 
     484  (gnus-setup-message 'message 
     485    (message-reply to-address wide)) 
     486  (and (boundp 'save-selected-window-window) 
     487       (not (window-live-p save-selected-window-window)) 
     488       (setq save-selected-window-window (selected-window)))) 
     489 
    255490;;;###autoload 
    256491(define-mail-user-agent 'gnus-user-agent 
    257       'gnus-msg-mail 'message-send-and-exit 
    258       'message-kill-buffer 'message-send-hook) 
     492  'gnus-msg-mail 'message-send-and-exit 
     493  'message-kill-buffer 'message-send-hook) 
    259494 
    260495(defun gnus-setup-posting-charset (group) 
     
    267502          (when (or (and (stringp (car elem)) 
    268503                         (string-match (car elem) group)) 
    269                     (and (gnus-functionp (car elem)) 
     504                    (and (functionp (car elem)) 
    270505                         (funcall (car elem) group)) 
    271506                    (and (symbolp (car elem)) 
     
    273508            (throw 'found (cons (cadr elem) (caddr elem))))))))) 
    274509 
    275 (defun gnus-inews-add-send-actions (winconf buffer article) 
    276   (make-local-hook 'message-sent-hook) 
     510(defun gnus-inews-add-send-actions (winconf buffer article 
     511                                            &optional config yanked) 
     512  (gnus-make-local-hook 'message-sent-hook) 
    277513  (add-hook 'message-sent-hook (if gnus-agent 'gnus-agent-possibly-do-gcc 
    278514                                 'gnus-inews-do-gcc) nil t) 
    279515  (when gnus-agent 
    280     (make-local-hook 'message-header-hook) 
     516    (gnus-make-local-hook 'message-header-hook) 
    281517    (add-hook 'message-header-hook 'gnus-agent-possibly-save-gcc nil t)) 
    282518  (setq message-post-method 
     
    285521  (setq message-newsreader (setq message-mailer (gnus-extended-version))) 
    286522  (message-add-action 
    287    `(set-window-configuration ,winconf) 'exit 'postpone 'kill) 
    288   (message-add-action 
    289523   `(when (gnus-buffer-exists-p ,buffer) 
    290       (save-excursion 
    291         (set-buffer ,buffer) 
    292         ,(when article 
    293            `(gnus-summary-mark-article-as-replied ,article)))) 
    294    'send)) 
     524      (set-window-configuration ,winconf)) 
     525   'exit 'postpone 'kill) 
     526  (let ((to-be-marked (cond 
     527                       (yanked 
     528                        (mapcar 
     529                         (lambda (x) (if (listp x) (car x) x)) yanked)) 
     530                       (article (if (listp article) article (list article))) 
     531                       (t nil)))) 
     532    (message-add-action 
     533     `(when (gnus-buffer-exists-p ,buffer) 
     534        (save-excursion 
     535          (set-buffer ,buffer) 
     536          ,(when to-be-marked 
     537             (if (eq config 'forward) 
     538                 `(gnus-summary-mark-article-as-forwarded ',to-be-marked) 
     539               `(gnus-summary-mark-article-as-replied ',to-be-marked))))) 
     540     'send))) 
    295541 
    296542(put 'gnus-setup-message 'lisp-indent-function 1) 
     
    307553  ;; to local variables leaking. 
    308554  (let ((group gnus-newsgroup-name) 
     555        ;; make sure last viewed article doesn't affect posting styles: 
     556        (gnus-article-copy) 
    309557        (buffer (current-buffer))) 
    310558    (unwind-protect 
     
    318566                      (gnus-group-group-name)) 
    319567                  "")) 
     568          ;; #### see comment in gnus-setup-message -- drv 
    320569          (gnus-setup-message 'message (message-mail))) 
    321570      (save-excursion 
     
    323572        (setq gnus-newsgroup-name group))))) 
    324573 
     574(defun gnus-group-news (&optional arg) 
     575  "Start composing a news. 
     576If ARG, post to group under point. 
     577If ARG is 1, prompt for group name to post to. 
     578 
     579This function prepares a news even when using mail groups.  This is useful 
     580for posting messages to mail groups without actually sending them over the 
     581network.  The corresponding back end must have a 'request-post method." 
     582  (interactive "P") 
     583  ;; We can't `let' gnus-newsgroup-name here, since that leads 
     584  ;; to local variables leaking. 
     585  (let ((group gnus-newsgroup-name) 
     586        ;; make sure last viewed article doesn't affect posting styles: 
     587        (gnus-article-copy) 
     588        (buffer (current-buffer))) 
     589    (unwind-protect 
     590        (progn 
     591          (setq gnus-newsgroup-name 
     592                (if arg 
     593                    (if (= 1 (prefix-numeric-value arg)) 
     594                        (completing-read "Use group: " 
     595                                         gnus-active-hashtb nil 
     596                                         (gnus-read-active-file-p)) 
     597                      (gnus-group-group-name)) 
     598                  "")) 
     599          ;; #### see comment in gnus-setup-message -- drv 
     600          (gnus-setup-message 'message 
     601            (message-news (gnus-group-real-name gnus-newsgroup-name)))) 
     602      (save-excursion 
     603        (set-buffer buffer) 
     604        (setq gnus-newsgroup-name group))))) 
     605 
    325606(defun gnus-group-post-news (&optional arg) 
    326   "Start composing a news message. 
    327 If ARG, post to the group under point. 
    328 If ARG is 1, prompt for a group name." 
     607  "Start composing a message (a news by default). 
     608If ARG, post to group under point.  If ARG is 1, prompt for group name. 
     609Depending on the selected group, the message might be either a mail or 
     610a news." 
    329611  (interactive "P") 
    330612  ;; Bind this variable here to make message mode hooks work ok. 
     
    335617                                  (gnus-read-active-file-p)) 
    336618               (gnus-group-group-name)) 
    337            ""))) 
     619           "")) 
     620        ;; make sure last viewed article doesn't affect posting styles: 
     621        (gnus-article-copy)) 
     622    (gnus-post-news 'post gnus-newsgroup-name nil nil nil nil 
     623                    (string= gnus-newsgroup-name "")))) 
     624 
     625(defun gnus-summary-mail-other-window (&optional arg) 
     626  "Start composing a mail in another window. 
     627Use the posting of the current group by default. 
     628If ARG, don't do that.  If ARG is 1, prompt for group name to find the 
     629posting style." 
     630  (interactive "P") 
     631  ;; We can't `let' gnus-newsgroup-name here, since that leads 
     632  ;; to local variables leaking. 
     633  (let ((group gnus-newsgroup-name) 
     634        ;; make sure last viewed article doesn't affect posting styles: 
     635        (gnus-article-copy) 
     636        (buffer (current-buffer))) 
     637    (unwind-protect 
     638        (progn 
     639          (setq gnus-newsgroup-name 
     640                (if arg 
     641                    (if (= 1 (prefix-numeric-value arg)) 
     642                        (completing-read "Use group: " 
     643                                         gnus-active-hashtb nil 
     644                                         (gnus-read-active-file-p)) 
     645                      "") 
     646                  gnus-newsgroup-name)) 
     647          ;; #### see comment in gnus-setup-message -- drv 
     648          (gnus-setup-message 'message (message-mail))) 
     649      (save-excursion 
     650        (set-buffer buffer) 
     651        (setq gnus-newsgroup-name group))))) 
     652 
     653(defun gnus-summary-news-other-window (&optional arg) 
     654  "Start composing a news in another window. 
     655Post to the current group by default. 
     656If ARG, don't do that.  If ARG is 1, prompt for group name to post to. 
     657 
     658This function prepares a news even when using mail groups.  This is useful 
     659for posting messages to mail groups without actually sending them over the 
     660network.  The corresponding back end must have a 'request-post method." 
     661  (interactive "P") 
     662  ;; We can't `let' gnus-newsgroup-name here, since that leads 
     663  ;; to local variables leaking. 
     664  (let ((group gnus-newsgroup-name) 
     665        ;; make sure last viewed article doesn't affect posting styles: 
     666        (gnus-article-copy) 
     667        (buffer (current-buffer))) 
     668    (unwind-protect 
     669        (progn 
     670          (setq gnus-newsgroup-name 
     671                (if arg 
     672                    (if (= 1 (prefix-numeric-value arg)) 
     673                        (completing-read "Use group: " 
     674                                         gnus-active-hashtb nil 
     675                                         (gnus-read-active-file-p)) 
     676                      "") 
     677                  gnus-newsgroup-name)) 
     678          ;; #### see comment in gnus-setup-message -- drv 
     679          (gnus-setup-message 'message 
     680            (progn 
     681              (message-news (gnus-group-real-name gnus-newsgroup-name)) 
     682              (set (make-local-variable 'gnus-discouraged-post-methods) 
     683                   (delq 
     684                    (car (gnus-find-method-for-group gnus-newsgroup-name)) 
     685                    (copy-sequence gnus-discouraged-post-methods)))))) 
     686      (save-excursion 
     687        (set-buffer buffer) 
     688        (setq gnus-newsgroup-name group))))) 
     689 
     690(defun gnus-summary-post-news (&optional arg) 
     691  "Start composing a message.  Post to the current group by default. 
     692If ARG, don't do that.  If ARG is 1, prompt for a group name to post to. 
     693Depending on the selected group, the message might be either a mail or 
     694a news." 
     695  (interactive "P") 
     696  ;; Bind this variable here to make message mode hooks work ok. 
     697  (let ((gnus-newsgroup-name 
     698         (if arg 
     699             (if (= 1 (prefix-numeric-value arg)) 
     700                 (completing-read "Newsgroup: " gnus-active-hashtb nil 
     701                                  (gnus-read-active-file-p)) 
     702               "") 
     703           gnus-newsgroup-name)) 
     704        ;; make sure last viewed article doesn't affect posting styles: 
     705        (gnus-article-copy)) 
    338706    (gnus-post-news 'post gnus-newsgroup-name))) 
    339707 
    340 (defun gnus-summary-post-news () 
    341   "Start composing a news message." 
    342   (interactive) 
    343   (gnus-post-news 'post gnus-newsgroup-name)) 
    344708 
    345709(defun gnus-summary-followup (yank &optional force-news) 
    346710  "Compose a followup to an article. 
    347 If prefix argument YANK is non-nil, original article is yanked automatically." 
     711If prefix argument YANK is non-nil, the original article is yanked 
     712automatically. 
     713YANK is a list of elements, where the car of each element is the 
     714article number, and the cdr is the string to be yanked." 
    348715  (interactive 
    349716   (list (and current-prefix-arg 
    350717              (gnus-summary-work-articles 1)))) 
    351718  (when yank 
    352     (gnus-summary-goto-subject (car yank))) 
     719    (gnus-summary-goto-subject 
     720     (if (listp (car yank)) 
     721         (caar yank) 
     722       (car yank)))) 
    353723  (save-window-excursion 
    354724    (gnus-summary-select-article)) 
     
    358728    (gnus-post-news nil gnus-newsgroup-name 
    359729                    headers gnus-article-buffer 
    360                     yank nil force-news))) 
     730                    yank nil force-news) 
     731    (gnus-summary-handle-replysign))) 
    361732 
    362733(defun gnus-summary-followup-with-original (n &optional force-news) 
    363   "Compose a followup to an article and include the original article." 
     734  "Compose a followup to an article and include the original article. 
     735The text in the region will be yanked.  If the region isn't 
     736active, the entire article will be yanked." 
    364737  (interactive "P") 
    365738  (gnus-summary-followup (gnus-summary-work-articles n) force-news)) 
     
    378751 
    379752(defun gnus-inews-yank-articles (articles) 
    380   (let (beg article
     753  (let (beg article yank-string
    381754    (message-goto-body) 
    382755    (while (setq article (pop articles)) 
     756      (when (listp article) 
     757        (setq yank-string (nth 1 article) 
     758              article (nth 0 article))) 
    383759      (save-window-excursion 
    384760        (set-buffer gnus-summary-buffer) 
    385761        (gnus-summary-select-article nil nil nil article) 
    386762        (gnus-summary-remove-process-mark article)) 
    387       (gnus-copy-article-buffer
     763      (gnus-copy-article-buffer nil yank-string
    388764      (let ((message-reply-buffer gnus-article-copy) 
    389             (message-reply-headers gnus-current-headers)) 
     765            (message-reply-headers 
     766             ;; The headers are decoded. 
     767             (with-current-buffer gnus-article-copy 
     768               (save-restriction 
     769                 (nnheader-narrow-to-headers) 
     770                 (nnheader-parse-naked-head))))) 
    390771        (message-yank-original) 
    391772        (setq beg (or beg (mark t)))) 
     
    404785        (message-post-method 
    405786         `(lambda (arg) 
    406             (gnus-post-method (not (eq symp 'a)) ,gnus-newsgroup-name))) 
     787            (gnus-post-method (eq ',symp 'a) ,gnus-newsgroup-name))) 
    407788        article) 
    408789    (while (setq article (pop articles)) 
     
    436817  
    437818 
    438 (defun gnus-copy-article-buffer (&optional article-buffer
     819(defun gnus-copy-article-buffer (&optional article-buffer yank-string
    439820  ;; make a copy of the article buffer with all text properties removed 
    440821  ;; this copy is in the buffer gnus-article-copy. 
     
    452833      (save-excursion 
    453834        (set-buffer article-buffer) 
    454         (save-restriction 
    455           ;; Copy over the (displayed) article buffer, delete 
    456           ;; hidden text and remove text properties. 
    457           (widen) 
    458           (copy-to-buffer gnus-article-copy (point-min) (point-max)) 
    459           (set-buffer gnus-article-copy) 
    460           (gnus-article-delete-text-of-type 'annotation) 
    461           (gnus-remove-text-with-property 'gnus-prev) 
    462           (gnus-remove-text-with-property 'gnus-next) 
    463           (insert 
    464            (prog1 
    465                (buffer-substring-no-properties (point-min) (point-max)) 
    466              (erase-buffer))) 
    467           ;; Find the original headers. 
    468           (set-buffer gnus-original-article-buffer) 
    469           (goto-char (point-min)) 
    470           (while (looking-at message-unix-mail-delimiter) 
    471             (forward-line 1)) 
    472           (setq beg (point)) 
    473           (setq end (or (search-forward "\n\n" nil t) (point))) 
    474           ;; Delete the headers from the displayed articles. 
    475           (set-buffer gnus-article-copy) 
    476           (delete-region (goto-char (point-min)) 
    477                          (or (search-forward "\n\n" nil t) (point-max))) 
    478           ;; Insert the original article headers. 
    479           (insert-buffer-substring gnus-original-article-buffer beg end) 
    480           (article-decode-encoded-words))) 
     835        (let ((gnus-newsgroup-charset (or gnus-article-charset 
     836                                          gnus-newsgroup-charset)) 
     837              (gnus-newsgroup-ignored-charsets 
     838               (or gnus-article-ignored-charsets 
     839                   gnus-newsgroup-ignored-charsets))) 
     840          (save-restriction 
     841            ;; Copy over the (displayed) article buffer, delete 
     842            ;; hidden text and remove text properties. 
     843            (widen) 
     844            (copy-to-buffer gnus-article-copy (point-min) (point-max)) 
     845            (set-buffer gnus-article-copy) 
     846            (when yank-string 
     847              (message-goto-body) 
     848              (delete-region (point) (point-max)) 
     849              (insert yank-string)) 
     850            (gnus-article-delete-text-of-type 'annotation) 
     851            (gnus-remove-text-with-property 'gnus-prev) 
     852            (gnus-remove-text-with-property 'gnus-next) 
     853            (gnus-remove-text-with-property 'gnus-decoration) 
     854            (insert 
     855             (prog1 
     856                 (buffer-substring-no-properties (point-min) (point-max)) 
     857               (erase-buffer))) 
     858            ;; Find the original headers. 
     859            (set-buffer gnus-original-article-buffer) 
     860            (goto-char (point-min)) 
     861            (while (looking-at message-unix-mail-delimiter) 
     862              (forward-line 1)) 
     863            (let ((mail-header-separator "")) 
     864              (setq beg (point) 
     865                    end (or (message-goto-body) 
     866                            ;; There may be just a header. 
     867                            (point-max)))) 
     868            ;; Delete the headers from the displayed articles. 
     869            (set-buffer gnus-article-copy) 
     870            (let ((mail-header-separator "")) 
     871              (delete-region (goto-char (point-min)) 
     872                             (or (message-goto-body) (point-max)))) 
     873            ;; Insert the original article headers. 
     874            (insert-buffer-substring gnus-original-article-buffer beg end) 
     875            ;; Decode charsets. 
     876            (let ((gnus-article-decode-hook 
     877                   (delq 'article-decode-charset 
     878                         (copy-sequence gnus-article-decode-hook)))) 
     879              (run-hooks 'gnus-article-decode-hook))))) 
    481880      gnus-article-copy))) 
    482881 
     
    485884  (when article-buffer 
    486885    (gnus-copy-article-buffer)) 
    487   (let ((gnus-article-reply article-buffer) 
     886  (let ((gnus-article-reply (and article-buffer (gnus-summary-article-number))) 
     887        (gnus-article-yanked-articles yank) 
    488888        (add-to-list gnus-add-to-list)) 
    489889    (gnus-setup-message (cond (yank 'reply-yank) 
     
    496896             newsgroup-p) 
    497897        (when group 
    498           (setq to-address (gnus-group-find-parameter group 'to-address
     898          (setq to-address (gnus-parameter-to-address group
    499899                to-group (gnus-group-find-parameter group 'to-group) 
    500                 to-list (gnus-group-find-parameter group 'to-list
     900                to-list (gnus-parameter-to-list group
    501901                newsgroup-p (gnus-group-find-parameter group 'newsgroup) 
    502902                mailing-list (when gnus-mailing-list-groups 
     
    510910                (and (gnus-news-group-p 
    511911                      (or pgroup gnus-newsgroup-name) 
    512                       (if header (mail-header-number header) 
    513                         gnus-current-article)) 
     912                      (or header gnus-current-article)) 
    514913                     (not mailing-list) 
    515914                     (not to-list) 
     
    517916