From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/40844 Path: main.gmane.org!not-for-mail From: Didier Verna Newsgroups: gmane.emacs.gnus.general Subject: [CHECK IN] posting functions hacking Date: Wed, 12 Dec 2001 17:19:08 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1035176332 3030 80.91.224.250 (21 Oct 2002 04:58:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:58:52 +0000 (UTC) Return-Path: Original-Received: (qmail 21616 invoked from network); 12 Dec 2001 16:24:45 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 12 Dec 2001 16:24:45 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16EC7I-0008Ph-00; Wed, 12 Dec 2001 10:20:20 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 12 Dec 2001 10:20:08 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id KAA09157 for ; Wed, 12 Dec 2001 10:19:46 -0600 (CST) Original-Received: (qmail 21565 invoked by alias); 12 Dec 2001 16:19:47 -0000 Original-Received: (qmail 21560 invoked from network); 12 Dec 2001 16:19:46 -0000 Original-Received: from hermes.epita.fr (163.5.255.10) by gnus.org with SMTP; 12 Dec 2001 16:19:46 -0000 Original-Received: from goa.lrde.epita.fr (mail@goa.lrde.epita.fr [10.223.13.2]) by hermes.epita.fr id fBCHJdx18053 for EPITA Paris France Wed, 12 Dec 2001 17:19:39 GMT Original-Received: from uzeb.lrde.epita.fr ([10.223.13.53] ident=mail) by goa.lrde.epita.fr with esmtp (Exim 3.32 #1 (Debian)) id 16EC67-0000l2-00 for ; Wed, 12 Dec 2001 17:19:07 +0100 Original-Received: from didier by uzeb.lrde.epita.fr with local (Exim 3.33 #1 (Debian)) id 16EC69-0000RF-00 for ; Wed, 12 Dec 2001 17:19:09 +0100 Original-To: Gnus Beta Testers X-Attribution: drv X-Url: http://www.lrde.epita.fr/~didier X-Web: http://www.lrde.epita.fr/~didier X-Home-Page: http://www.lrde.epita.fr/~didier X-Face: |j}\)O|k##MrRz#VK$Jy=0r=3Qc,,a/Tr6*JQbE73dy17]2YcmW$9Z&H21e}#~#pgc>dn(is5Bv1l!{1re+Q9suKIOUmOqZs2>QMxHlR;;}kaGYA@HR3D C6 X-Face: 6o|eiKqaHN.ANh8HXDzntcWUOCg\]RsOd.ctvm~*y}Y^R&*a+Co,\s#=HWsw3x$b_n2kJ#g (7u?J^@^xP)f,jUF|0Z'J:|G/bMA5O12*b,7`-Q`=pKsCRIpso07.Y>YB2H{7`?u&yh;C_ZtLHfj * gnus.texi (Misc Group Stuff): advertise `gnus-group-news'. * gnus.texi (Summary Mail Commands): advertise `gnus-summary-news-other-window'. lisp/ChangeLog addition: 2001-12-12 Didier Verna * gnus-msg.el (gnus-group-news): New function. * gnus-group.el (gnus-group-mode-map): bind it to `i'. * gnus-group.el (gnus-group-make-menu-bar): add a menu item for it. * gnus-salt.el (gnus-carpal-group-buffer-buttons): add a button for it. * gnus-msg.el (gnus-summary-news-other-window): New function. * gnus-msg.el ((gnus-summary-send-map "S" gnus-summary-mode-map)): bind it to `i'. * gnus-sum.el (gnus-summary-mode-map): bind it to `i'. * gnus-sum.el (gnus-summary-make-menu-bar): add a menu item for it. * gnus-salt.el (gnus-carpal-summary-buffer-buttons): add a button for it (called with a prefix). * gnus-msg.el (gnus-configure-posting-styles): add an optional group-name argument. * gnus-msg.el (gnus-setup-message): use it. Gnus Patch (runsocks cvs -q diff -u -t -b -B -w lisp/gnus-msg.el lisp/gnus-= group.el lisp/gnus-sum.el lisp/gnus-salt.el lisp/gnus.el texi/gnus.texi): Index: lisp/gnus-msg.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-msg.el,v retrieving revision 6.60 diff -u -u -t -b -B -w -r6.60 gnus-msg.el --- lisp/gnus-msg.el 2001/11/27 19:15:09 6.60 +++ lisp/gnus-msg.el 2001/12/12 16:21:26 @@ -217,6 +217,7 @@ =20 (gnus-define-keys (gnus-summary-send-map "S" gnus-summary-mode-map) "p" gnus-summary-post-news + "i" gnus-summary-news-other-window "f" gnus-summary-followup "F" gnus-summary-followup-with-original "c" gnus-summary-cancel-article @@ -264,7 +265,16 @@ (setq mml-buffer-list nil) (add-hook 'message-header-setup-hook 'gnus-inews-insert-gcc) (add-hook 'message-header-setup-hook 'gnus-inews-insert-archive-gcc) - (add-hook 'message-mode-hook 'gnus-configure-posting-styles) + ;; #### FIXME: for a reason that I did not manage to identify yet, + ;; the variable `gnus-newsgroup-name' does not honor a dynamically + ;; scoped or setq'ed value from a caller like `C-u gnus-summary-mai= l'. + ;; After evaluation of @forms below, it gets the value we actually = want + ;; to override, and the posting styles are used. For that reason, I= 've + ;; added an optional argument to `gnus-configure-posting-styles' to + ;; make sure that the correct value for the group name is used. -- = drv + (add-hook 'message-mode-hook + (lambda () + (gnus-configure-posting-styles ,group))) (unwind-protect (progn ,@forms) @@ -413,15 +423,47 @@ (gnus-read-active-file-p)) (gnus-group-group-name)) "")) + ;; #### see comment in gnus-setup-message -- drv (gnus-setup-message 'message (message-mail))) (save-excursion (set-buffer buffer) (setq gnus-newsgroup-name group))))) =20 +(defun gnus-group-news (&optional arg) + "Start composing a news. +If ARG, post to group under point. +If ARG is 1, prompt for group name to post to. + +This function prepares a news even when using mail groups. This is useful +for posting messages to mail groups without actually sending them over the +network. The corresponding backend must have a 'request-post method." + (interactive "P") + ;; We can't `let' gnus-newsgroup-name here, since that leads + ;; to local variables leaking. + (let ((group gnus-newsgroup-name) + (buffer (current-buffer))) + (unwind-protect + (progn + (setq gnus-newsgroup-name + (if arg + (if (=3D 1 (prefix-numeric-value arg)) + (completing-read "Use group: " + gnus-active-hashtb nil + (gnus-read-active-file-p)) + (gnus-group-group-name)) + "")) + ;; #### see comment in gnus-setup-message -- drv + (gnus-setup-message 'message + (message-news (gnus-group-real-name gnus-newsgroup-name)))) + (save-excursion + (set-buffer buffer) + (setq gnus-newsgroup-name group))))) + (defun gnus-group-post-news (&optional arg) - "Start composing a news message. -If ARG, post to the group under point. -If ARG is 1, prompt for a group name." + "Start composing a message (a news by default). +If ARG, post to group under point. If ARG is 1, prompt for group name. +Depending on the selected group, the message might be either a mail or +a news." (interactive "P") ;; Bind this variable here to make message mode hooks work ok. (let ((gnus-newsgroup-name @@ -433,11 +475,79 @@ ""))) (gnus-post-news 'post gnus-newsgroup-name))) =20 -(defun gnus-summary-post-news () - "Start composing a news message." - (interactive) - (gnus-post-news 'post gnus-newsgroup-name)) +(defun gnus-summary-mail-other-window (&optional arg) + "Start composing a mail in another window. +Use the posting of the current group by default. +If ARG, don't do that. If ARG is 1, prompt for group name to find the +posting style." + (interactive "P") + ;; We can't `let' gnus-newsgroup-name here, since that leads + ;; to local variables leaking. + (let ((group gnus-newsgroup-name) + (buffer (current-buffer))) + (unwind-protect + (progn + (setq gnus-newsgroup-name + (if arg + (if (=3D 1 (prefix-numeric-value arg)) + (completing-read "Use group: " + gnus-active-hashtb nil + (gnus-read-active-file-p)) + "") + gnus-newsgroup-name)) + ;; #### see comment in gnus-setup-message -- drv + (gnus-setup-message 'message (message-mail))) + (save-excursion + (set-buffer buffer) + (setq gnus-newsgroup-name group))))) + +(defun gnus-summary-news-other-window (&optional arg) + "Start composing a news in another window. +Post to the current group by default. +If ARG, don't do that. If ARG is 1, prompt for group name to post to. + +This function prepares a news even when using mail groups. This is useful +for posting messages to mail groups without actually sending them over the +network. The corresponding backend must have a 'request-post method." + (interactive "P") + ;; We can't `let' gnus-newsgroup-name here, since that leads + ;; to local variables leaking. + (let ((group gnus-newsgroup-name) + (buffer (current-buffer))) + (unwind-protect + (progn + (setq gnus-newsgroup-name + (if arg + (if (=3D 1 (prefix-numeric-value arg)) + (completing-read "Use group: " + gnus-active-hashtb nil + (gnus-read-active-file-p)) + "") + gnus-newsgroup-name)) + ;; #### see comment in gnus-setup-message -- drv + (gnus-setup-message 'message + (message-news (gnus-group-real-name gnus-newsgroup-name)))) + (save-excursion + (set-buffer buffer) + (setq gnus-newsgroup-name group))))) =20 +(defun gnus-summary-post-news (&optional arg) + "Start composing a message. Post to the current group by default. +If ARG, don't do that. If ARG is 1, prompt for a group name to post to. +Depending on the selected group, the message might be either a mail or +a news." + (interactive "P") + ;; Bind this variable here to make message mode hooks work ok. + (let ((gnus-newsgroup-name + (if arg + (if (=3D 1 (prefix-numeric-value arg)) + (completing-read "Newsgroup: " gnus-active-hashtb nil + (gnus-read-active-file-p)) + "") + gnus-newsgroup-name))) + (gnus-post-news 'post gnus-newsgroup-name))) + + (defun gnus-summary-followup (yank &optional force-news) "Compose a followup to an article. If prefix argument YANK is non-nil, original article is yanked automatical= ly." @@ -977,12 +1087,6 @@ (when (gnus-y-or-n-p "Send this complaint? ") (message-send-and-exit))))))) =20 -(defun gnus-summary-mail-other-window () - "Compose mail in other window." - (interactive) - (gnus-setup-message 'message - (message-mail))) - (defun gnus-mail-parse-comma-list () (let (accumulated beg) @@ -1382,10 +1486,10 @@ =20 ;;; Posting styles. =20 -(defun gnus-configure-posting-styles () +(defun gnus-configure-posting-styles (&optional group-name) "Configure posting styles according to `gnus-posting-styles'." (unless gnus-inhibit-posting-styles - (let ((group (or gnus-newsgroup-name "")) + (let ((group (or group-name gnus-newsgroup-name "")) (styles gnus-posting-styles) style match variable attribute value v results filep name address element) Index: lisp/gnus-group.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-group.el,v retrieving revision 6.50 diff -u -u -t -b -B -w -r6.50 gnus-group.el --- lisp/gnus-group.el 2001/12/09 14:09:36 6.50 +++ lisp/gnus-group.el 2001/12/12 16:21:26 @@ -543,6 +543,7 @@ "l" gnus-group-list-groups "L" gnus-group-list-all-groups "m" gnus-group-mail + "i" gnus-group-news "g" gnus-group-get-new-news "\M-g" gnus-group-get-new-news-this-group "R" gnus-group-restart @@ -867,7 +868,8 @@ ["Save areas" gnus-soup-save-areas (fboundp 'gnus-soup-pack-packet= )] ["Brew SOUP" gnus-group-brew-soup (fboundp 'gnus-soup-pack-packet)= ]) ["Send a mail" gnus-group-mail t] - ["Post an article..." gnus-group-post-news t] + ["Send a message (mail or news)" gnus-group-post-news t] + ["Create a local message" gnus-group-news t] ["Check for new news" gnus-group-get-new-news ,@(if (featurep 'xemacs) '(t) '(:help "Get newly arrived articles")) Index: lisp/gnus-sum.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v retrieving revision 6.129 diff -u -u -t -b -B -w -r6.129 gnus-sum.el --- lisp/gnus-sum.el 2001/12/12 05:51:27 6.129 +++ lisp/gnus-sum.el 2001/12/12 16:21:29 @@ -1542,6 +1542,7 @@ gnus-mouse-2 gnus-mouse-pick-article "m" gnus-summary-mail-other-window "a" gnus-summary-post-news + "i" gnus-summary-news-other-window "x" gnus-summary-limit-to-unread "s" gnus-summary-isearch-article "t" gnus-summary-toggle-header @@ -2012,7 +2013,7 @@ (easy-menu-define gnus-summary-post-menu gnus-summary-mode-map "" `("Post" - ["Post an article" gnus-summary-post-news + ["Send a message (mail or news)" gnus-summary-post-news ,@(if (featurep 'xemacs) '(t) '(:help "Post an article"))] ["Followup" gnus-summary-followup @@ -2038,6 +2039,7 @@ ["Resend message" gnus-summary-resend-message t] ["Send bounced mail" gnus-summary-resend-bounced-mail t] ["Send a mail" gnus-summary-mail-other-window t] + ["Create a local message" gnus-summary-news-other-window t] ["Uuencode and post" gnus-uu-post-news ,@(if (featurep 'xemacs) '(t) '(:help "Post a uuencoded article"))] Index: lisp/gnus-salt.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus-salt.el,v retrieving revision 6.6 diff -u -u -t -b -B -w -r6.6 gnus-salt.el --- lisp/gnus-salt.el 2001/11/06 15:06:21 6.6 +++ lisp/gnus-salt.el 2001/12/12 16:21:29 @@ -899,6 +899,7 @@ ("matching" . gnus-group-list-matching) ("post" . gnus-group-post-news) ("mail" . gnus-group-mail) + ("local" . (lambda () (interactive) (gnus-group-news 0))) ("rescan" . gnus-group-get-new-news) ("browse-foreign" . gnus-group-browse-foreign) ("exit" . gnus-group-exit))) @@ -929,7 +930,8 @@ ("kill" . gnus-summary-kill-thread) "post" ("post" . gnus-summary-post-news) - ("mail" . gnus-summary-mail) + ("local" . gnus-summary-news-other-window) + ("mail" . gnus-summary-mail-other-window) ("followup" . gnus-summary-followup-with-original) ("reply" . gnus-summary-reply-with-original) ("cancel" . gnus-summary-cancel-article) Index: lisp/gnus.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v retrieving revision 6.65 diff -u -u -t -b -B -w -r6.65 gnus.el --- lisp/gnus.el 2001/11/09 21:58:45 6.65 +++ lisp/gnus.el 2001/12/12 16:21:29 @@ -2008,7 +2008,8 @@ ("gnus-msg" (gnus-summary-send-map keymap) gnus-article-mail gnus-copy-article-buffer gnus-extended-version) ("gnus-msg" :interactive t - gnus-group-post-news gnus-group-mail gnus-summary-post-news + gnus-group-post-news gnus-group-mail gnus-group-news + gnus-summary-post-news gnus-summary-news-other-window gnus-summary-followup gnus-summary-followup-with-original gnus-summary-cancel-article gnus-summary-supersede-article gnus-post-news gnus-summary-reply gnus-summary-reply-with-original Index: texi/gnus.texi =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v retrieving revision 6.191 diff -u -u -t -b -B -w -r6.191 gnus.texi --- texi/gnus.texi 2001/12/10 12:32:01 6.191 +++ texi/gnus.texi 2001/12/12 16:21:32 @@ -3843,14 +3843,33 @@ @item a @kindex a (Group) @findex gnus-group-post-news -Post an article to a group (@code{gnus-group-post-news}). If given a -prefix, the current group name will be used as the default. -@xref{Composing Messages}. +Start composing a message (a news by default) +(@code{gnus-group-post-news}). If given a prefix, post to the group +under the point. If the prefix is 1, prompt for a group to post to. +Contrary to what the name of this function suggests, the prepared +article might be a mail instead of a news, if a mail group is specified +with the prefix argument. @xref{Composing Messages}. =20 @item m @kindex m (Group) @findex gnus-group-mail -Mail a message somewhere (@code{gnus-group-mail}). @xref{Composing Messag= es}. +Mail a message somewhere (@code{gnus-group-mail}). If given a prefix, +use the posting style of the group under the point. If the prefix is 1, +prompt for a group name to find the posting style. +@xref{Composing Messages}. + +@item i +@kindex i (Group) +@findex gnus-group-news +Start composing a news (@code{gnus-group-news}). If given a prefix, +post to the group under the point. If the prefix is 1, prompt +for group to post to. @xref{Composing Messages}. + +This function actually prepares a news even when using mail groups. +This is useful for "posting" messages to mail groups without actually +sending them over the network: they're just saved directly to the group +in question. The corresponding backend must have a request-post method +for this to work though. =20 @end table =20 @@ -4960,8 +4979,24 @@ @kindex S m (Summary) @findex gnus-summary-mail-other-window @c @icon{gnus-summary-mail-originate} -Send a mail to some other person -(@code{gnus-summary-mail-other-window}). +Prepare a mail (@code{gnus-summary-mail-other-window}). By default, use +the posting style of the current group. If given a prefix, disable that. +If the prefix is 1, prompt for a group name to find the posting style. + +@item S i +@itemx i +@kindex i (Summary) +@kindex S i (Summary) +@findex gnus-summary-news-other-window +Prepare a news (@code{gnus-summary-news-other-window}). By default, +post to the current group. If given a prefix, disable that. If the +prefix is 1, prompt for a group to post to. + +This function actually prepares a news even when using mail groups. +This is useful for "posting" messages to mail groups without actually +sending them over the network: they're just saved directly to the group +in question. The corresponding backend must have a request-post method +for this to work though. =20 @item S D b @kindex S D b (Summary) @@ -5039,8 +5074,9 @@ @kindex S p (Summary) @findex gnus-summary-post-news @c @icon{gnus-summary-post-news} -Post an article to the current group -(@code{gnus-summary-post-news}). +Prepare for posting an article (@code{gnus-summary-post-news}). By +default, post to the current group. If given a prefix, disable that. +If the prefix is 1, prompt for another group instead. =20 @item S f @itemx f --=20 Didier Verna, didier@lrde.epita.fr, http://www.lrde.epita.fr/~didier EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (1) 53 14 59 47 94276 Le Kremlin-Bic=EAtre, France Fax.+33 (1) 53 14 59 22 didier@xemac= s.org