Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Robert Girault <r@dev.null>
To: info-gnus-english@gnu.org
Subject: on automatic gnus-summary-insert-new-articles after posting
Date: Sat, 28 Jul 2018 12:35:02 -0300	[thread overview]
Message-ID: <86d0v7jrvd.fsf@dev.null> (raw)

How can I 
   
  gnus-summary-insert-new-articles

automatically after posting?  I'd like to see my articles right away in
the thread without having to ``/ N'' every time I post.

I tried 

  (add-hook 'message-sent-hook 'gnus-summary-insert-new-articles)

but that blows a void-variable perm.  Investigating further, I see the
problem happens deep into gnus-thread-loop-p.  I cloned 

  gnus-summary-insert-new-articles

to take an argument, the group name.  Here's the attempt:

--8<---------------cut here---------------start------------->8---
(defun gnus-summary-insert-new-articles-arg (g)
  "Insert all new articles in this group."
  (interactive)
  (let ((old (sort (mapcar 'car gnus-newsgroup-data) '<))
	(old-high gnus-newsgroup-highest)
	(nnmail-fetched-sources (list t))
	(new-active (gnus-activate-group g 'scan))
	i new)
    (unless new-active
      (error "Couldn't fetch new data"))
    (setq gnus-newsgroup-active (gnus-copy-sequence new-active))
    (setq i (cdr gnus-newsgroup-active)
	  gnus-newsgroup-highest i)
    (while (> i old-high)
      (push i new)
      (decf i))
    (if (not new)
	(message "No gnus is bad news")
      (gnus-summary-insert-articles new)
      (setq gnus-newsgroup-unreads
	    (gnus-sorted-nunion gnus-newsgroup-unreads new))
      (gnus-summary-limit (gnus-sorted-nunion old new))))
  (gnus-summary-position-point))
--8<---------------cut here---------------end--------------->8---

Now, executing 

  (gnus-summary-insert-new-articles-arg "alt.test") 

also blows the (void-variable perm) problem.

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (void-variable perm)
  #[(refs) "\bJ@\203.

             reply	other threads:[~2018-07-28 15:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-28 15:35 Robert Girault [this message]
2018-07-28 16:13 ` Eric Abrahamsen
     [not found] ` <mailman.4364.1532794430.1292.info-gnus-english@gnu.org>
2018-07-28 19:54   ` Robert Girault
2018-07-28 20:42 ` Winston
2018-07-28 20:59   ` Eric Abrahamsen
     [not found]   ` <mailman.4365.1532811610.1292.info-gnus-english@gnu.org>
2018-07-29  0:19     ` Robert Girault
2018-07-29  6:52       ` Eric Abrahamsen
2018-07-29  8:07         ` Adam Sjøgren
2018-07-29 16:42           ` Eric Abrahamsen
2018-07-29 18:04             ` Adam Sjøgren
2018-07-29  8:03       ` Adam Sjøgren
2018-07-29 14:37       ` Winston
     [not found]       ` <mailman.4370.1532847194.1292.info-gnus-english@gnu.org>
2018-07-29 16:00         ` Robert Girault
2018-07-29 16:15           ` on continuing from where left off (Was: Re: on automatic gnus-summary-insert-new-articles after posting) Robert Girault
2018-07-29 17:17           ` on automatic gnus-summary-insert-new-articles after posting Eric Abrahamsen
2018-07-30  1:26           ` Robert Girault
     [not found]       ` <mailman.4372.1532851440.1292.info-gnus-english@gnu.org>
2018-07-29 16:04         ` Robert Girault
2018-07-29 18:03           ` Adam Sjøgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86d0v7jrvd.fsf@dev.null \
    --to=r@dev.null \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).