From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86302 Path: news.gmane.org!not-for-mail From: Didier Verna Newsgroups: gmane.emacs.gnus.general Subject: [Q] Programmatically remembering the backend to post with ? Date: Thu, 19 Nov 2015 11:49:14 +0100 Organization: The Gnus Project Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1447930199 18944 80.91.229.3 (19 Nov 2015 10:49:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2015 10:49:59 +0000 (UTC) To: Gnus Beta Testers Original-X-From: ding-owner+M34534@lists.math.uh.edu Thu Nov 19 11:49:48 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZzMmh-0002iu-2P for ding-account@gmane.org; Thu, 19 Nov 2015 11:49:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1ZzMmK-0002uV-My; Thu, 19 Nov 2015 04:49:24 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZzMmH-0002u2-J3 for ding@lists.math.uh.edu; Thu, 19 Nov 2015 04:49:21 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1ZzMmF-0001Mo-VB for ding@lists.math.uh.edu; Thu, 19 Nov 2015 04:49:21 -0600 Original-Received: from smtp6-g21.free.fr ([212.27.42.6]) by quimby.gnus.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ZzMmC-0007He-QR for ding@gnus.org; Thu, 19 Nov 2015 11:49:16 +0100 Original-Received: from Metheny.local.free.fr (unknown [IPv6:2a01:e35:1383:6490:a87b:735f:c073:530c]) by smtp6-g21.free.fr (Postfix) with ESMTPS id 8A8028224B for ; Thu, 19 Nov 2015 11:49:06 +0100 (CET) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin) Face: X-Attribution: dvl X-Web: http://www.gnus.org X-Url: http://www.gnus.org X-Home-Page: http://www.gnus.org Mail-Copies-To: never X-Spam-Score: 0.2 (/) X-Spam-Report: SpamAssassin (3.4.1 2015-04-28) analysis follows Bayesian score: 0.0235 Ham tokens: 0.000-105--4654h-0s--0d--buffer, 0.000-58--2529h-0s--0d--backend, 0.000-22--963h-0s--0d--H*M:fsf, 0.000-22--956h-0s--0d--H*UA:Emacs, 0.000-22--947h-0s--0d--H*u:Emacs Spam tokens: 0.995-12561--325h-8769s--0d--H*r:quimby.gnus.org, 0.994-11469--394h-8073s--0d--H*Ad:D*gnus.org, 0.994-13560--493h-9563s--0d--H*RU:quimby.gnus.org, 0.994-13560--493h-9563s--0d--Hx-spam-relays-external:quimby.gnus.org, 0.993-12799--487h-9041s--0d--HTo:D*gnus.org Autolearn status: ham autolearn_force=no -1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.27.42.6 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.27.42.6 listed in wl.mailspike.net] 0.1 URIBL_SBL_A Contains URL's A record listed in the SBL blocklist [URIs: didierverna.com] 1.6 URIBL_SBL Contains an URL's NS IP listed in the SBL blocklist [URIs: didierverna.com] -0.5 BAYES_05 BODY: Bayes spam probability is 1 to 5% [score: 0.0235] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86302 Archived-At: Hi, when I C-u a on a group, Gnus somehow remembers which backend to post with when I have several (secondary) select methods. When I programmatically post, however, it doesn't so I must be missing something. Here's a skeleton of a posting function that I use. (defmacro* post-message ((group subject message &optional (to-group group)) &body body) ;; Post a Gnus MESSAGE about SUBJECT, from GROUP. ;; Destination group will be the same unless TO-GROUP is provided. ;; Execute BODY in the message buffer. ;; #### WARNING: SAVE-EXCURSION is important to avoid local-variable value ;; leaking. See some similar tricks in gnus-group-mail and such. I can't ;; remember the exact problem though. `(save-excursion (let ((gnus-newsgroup-name ,group) gnus-article-copy) (gnus-post-news 'post ,to-group) (gmm-fill ,subject ,message) ,@body))) Any help appreciated, thanks ! --=20 My new Jazz CD entitled "Roots and Leaves" is out! Check it out: http://didierverna.com/records/roots-and-leaves.php Lisp, Jazz, A=C3=AFkido: http://www.didierverna.info