* can't mark articles reached with `^'
@ 1998-11-30 18:58 Dale Hagglund
1998-11-30 19:18 ` Matt Pharr
1998-11-30 20:02 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 7+ messages in thread
From: Dale Hagglund @ 1998-11-30 18:58 UTC (permalink / raw)
When I'm reading a group, I sometimes use `^' to move up the reference
chain. Often, I find a an article I wish to mark.
When I try to mark the article with `u', I get an error complaining
about a negative article number. The error doesn't occur in my nnml
groups, and the article is marked as desired.
I'm think this used to work (perhaps before I switched over to pgnus),
but I can't be sure.
Dale.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: can't mark articles reached with `^'
1998-11-30 18:58 can't mark articles reached with `^' Dale Hagglund
@ 1998-11-30 19:18 ` Matt Pharr
1998-11-30 19:32 ` Dale Hagglund
1998-11-30 20:02 ` Lars Magne Ingebrigtsen
1 sibling, 1 reply; 7+ messages in thread
From: Matt Pharr @ 1998-11-30 19:18 UTC (permalink / raw)
> When I'm reading a group, I sometimes use `^' to move up the reference
> chain. Often, I find a an article I wish to mark.
>
> When I try to mark the article with `u', I get an error complaining
> about a negative article number. The error doesn't occur in my nnml
> groups, and the article is marked as desired.
I've noticed this as well and reported it to gnus-bug. This is only a
problem for me in nnvirtual groups, however, I haven't seen it happen in
nnml groups, for example. Have you seen it in non-nnvirtual groups?
Assuming it's nnvirtual-only, I assume that it stems from the funky article
numbering stuff that goes on in nnvirtual.el.
-matt
--
Matt Pharr mmp@graphics.stanford.edu
<URL:http://graphics.stanford.edu/~mmp>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: can't mark articles reached with `^'
1998-11-30 19:18 ` Matt Pharr
@ 1998-11-30 19:32 ` Dale Hagglund
0 siblings, 0 replies; 7+ messages in thread
From: Dale Hagglund @ 1998-11-30 19:32 UTC (permalink / raw)
Matt Pharr <mmp@Graphics.Stanford.EDU> writes:
> I've noticed this as well and reported it to gnus-bug. This is only
> a problem for me in nnvirtual groups, however, I haven't seen it
> happen in nnml groups, for example. Have you seen it in
> non-nnvirtual groups?
It doesn't happen in nnml, but it does happen in regular old nntp
groups. I don't used nnvirtual.
Dale.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: can't mark articles reached with `^'
1998-11-30 18:58 can't mark articles reached with `^' Dale Hagglund
1998-11-30 19:18 ` Matt Pharr
@ 1998-11-30 20:02 ` Lars Magne Ingebrigtsen
1998-11-30 20:48 ` Dale Hagglund
1 sibling, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-30 20:02 UTC (permalink / raw)
Dale Hagglund <rdh@best.com> writes:
> When I try to mark the article with `u', I get an error complaining
> about a negative article number.
If Gnus doesn't know the article number, you can't mark it.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: can't mark articles reached with `^'
1998-11-30 20:02 ` Lars Magne Ingebrigtsen
@ 1998-11-30 20:48 ` Dale Hagglund
1998-11-30 23:36 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 7+ messages in thread
From: Dale Hagglund @ 1998-11-30 20:48 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Dale Hagglund <rdh@best.com> writes:
>
> > When I try to mark the article with `u', I get an error complaining
> > about a negative article number.
>
> If Gnus doesn't know the article number, you can't mark it.
I hadn't considered the implications of fetching by article-id.
But, isn't the article number in the Xref header information? Pick
the one that's given for the current group, or choose a negative
number if the parent article happens not to have been posted to the
current group.
Dale.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: can't mark articles reached with `^'
1998-11-30 20:48 ` Dale Hagglund
@ 1998-11-30 23:36 ` Lars Magne Ingebrigtsen
1998-12-01 0:45 ` Dale Hagglund
0 siblings, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-30 23:36 UTC (permalink / raw)
Dale Hagglund <rdh@best.com> writes:
> But, isn't the article number in the Xref header information? Pick
> the one that's given for the current group, or choose a negative
> number if the parent article happens not to have been posted to the
> current group.
This is what Gnus does.
(Well -- it's what Gnus is supposed to do, but bugs have been known to
exist here and there.)
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: can't mark articles reached with `^'
1998-11-30 23:36 ` Lars Magne Ingebrigtsen
@ 1998-12-01 0:45 ` Dale Hagglund
0 siblings, 0 replies; 7+ messages in thread
From: Dale Hagglund @ 1998-12-01 0:45 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 963 bytes --]
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Dale Hagglund <rdh@best.com> writes:
> > But, isn't the article number in the Xref header information?
> This is what Gnus does. (Well -- it's what Gnus is supposed to do,
> but bugs have been known to exist here and there.)
I've been poking around a bit in nntp.el, and I see what you're
talking about, in `nntp-find-group-and-number'. However, the code
only maps from article number to group name, not vice versa, which is
needed when you've fetched an article via message-id.
Here's a patch for 0.51 that fixes the problem, at least for me.
Basically, I pass a `prefgroups' parameter that's used to choose the
desired newsgroup when more than one is on the Newsgroups line. Then,
if either newsgroup name or article number is unknown, I look it up
from the Xref line using the known value.
There's rather more comments than usual, but I needed them to keep it
all straight in my head . . . .
Dale.
[-- Attachment #2: Type: text/plain, Size: 5779 bytes --]
*** /usr/home/rdh/emacs/pgnus-0.51/lisp/nntp.el.orig Mon Nov 30 13:32:24 1998
--- /usr/home/rdh/emacs/pgnus-0.51/lisp/nntp.el Mon Nov 30 16:16:58 1998
***************
*** 633,640 ****
(save-excursion
(set-buffer nntp-server-buffer)
(copy-to-buffer buffer (point-min) (point-max))
! (nntp-find-group-and-number))
! (nntp-find-group-and-number))))
(deffoo nntp-request-head (article &optional group server)
(nntp-possibly-change-group group server)
--- 633,640 ----
(save-excursion
(set-buffer nntp-server-buffer)
(copy-to-buffer buffer (point-min) (point-max))
! (nntp-find-group-and-number group))
! (nntp-find-group-and-number group))))
(deffoo nntp-request-head (article &optional group server)
(nntp-possibly-change-group group server)
***************
*** 642,648 ****
"\r?\n\\.\r?\n" "HEAD"
(if (numberp article) (int-to-string article) article))
(prog1
! (nntp-find-group-and-number)
(nntp-decode-text))))
(deffoo nntp-request-body (article &optional group server)
--- 642,648 ----
"\r?\n\\.\r?\n" "HEAD"
(if (numberp article) (int-to-string article) article))
(prog1
! (nntp-find-group-and-number group)
(nntp-decode-text))))
(deffoo nntp-request-body (article &optional group server)
***************
*** 1235,1277 ****
(delete-region (point-min) (point))
proc)))
! (defun nntp-find-group-and-number ()
(save-excursion
(save-restriction
(set-buffer nntp-server-buffer)
(narrow-to-region (goto-char (point-min))
(or (search-forward "\n\n" nil t) (point-max)))
(goto-char (point-min))
! ;; We first find the number by looking at the status line.
! (let ((number (and (looking-at "2[0-9][0-9] +\\([0-9]+\\) ")
! (string-to-int
! (buffer-substring (match-beginning 1)
! (match-end 1)))))
! group newsgroups xref)
(and number (zerop number) (setq number nil))
! ;; Then we find the group name.
! (setq group
! (cond
! ;; If there is only one group in the Newsgroups header,
! ;; then it seems quite likely that this article comes
! ;; from that group, I'd say.
! ((and (setq newsgroups (mail-fetch-field "newsgroups"))
! (not (string-match "," newsgroups)))
! newsgroups)
! ;; If there is more than one group in the Newsgroups
! ;; header, then the Xref header should be filled out.
! ;; We hazard a guess that the group that has this
! ;; article number in the Xref header is the one we are
! ;; looking for. This might very well be wrong if this
! ;; article happens to have the same number in several
! ;; groups, but that's life.
! ((and (setq xref (mail-fetch-field "xref"))
! number
! (string-match (format "\\([^ :]+\\):%d" number) xref))
! (substring xref (match-beginning 1) (match-end 1)))
! (t "")))
(when (string-match "\r" group)
(setq group (substring group 0 (match-beginning 0))))
(cons group number)))))
(provide 'nntp)
--- 1235,1297 ----
(delete-region (point-min) (point))
proc)))
! (defun nntp-find-group-and-number (prefgroup)
! ;; Fetch group name and number from article header. If PREFGROUP is
! ;; non-nil, choose PREFGROUP as the group, if it shows up in the
! ;; Newsgroups header.
(save-excursion
(save-restriction
(set-buffer nntp-server-buffer)
(narrow-to-region (goto-char (point-min))
(or (search-forward "\n\n" nil t) (point-max)))
(goto-char (point-min))
! (let ((number
! ;; Make a guess at article number by looking at the
! ;; status line.
! (and (looking-at "2[0-9][0-9] +\\([0-9]+\\) ")
! (string-to-int
! (buffer-substring (match-beginning 1)
! (match-end 1)))))
! (newsgroups (mail-fetch-field "newsgroups"))
! (xref (mail-fetch-field "xref"))
! group)
! ;; Reset number to nil of the server reported article `0'.
(and number (zerop number) (setq number nil))
! ;; Make first guess at right newsgroup.
! (cond
! ;; If there's no Newsgroup header, we don't know yet.
! ((not newsgroups))
! ;; If there's just a single newsgroup, use it.
! ((not (string-match "," newsgroups))
! (setq group newsgroups))
! ;; If `prefgroup' is found in the list of newsgroups, use it.
! ((and (stringp prefgroup)
! (string-match
! (concat "\\<" (regexp-quote prefgroup) "\\>")
! newsgroups))
! (setq group prefgroup)
! ;; Force article number to be looked up from the Xref header
! ;; later, so that group name and article number will be
! ;; consistent. If there's no Xref header, leave the article
! ;; number alone and hope for the best.
! (and xref (setq number nil))))
! ;; If we don't know the article number, look in the Xref
! ;; header for the article number associated with the known
! ;; group name.
! (when (and xref group (not number))
! (string-match (format "%s:\\([0-9]+\\)" (regexp-quote group)) xref)
! (setq number (substring xref (match-beginning 1) (match-end 1))))
! ;; If we don't know the group, look in the Xref header for the
! ;; group name associated with the known article number.
! (when (and xref number (not group))
! (string-match (format "\\([^ :]+\\):%d" number) xref)
! (setq group (substring xref (match-beginning 1) (match-end 1))))
! ;; If we haven't figured out the group yet, just use the empty
! ;; string. Clean up the group name, if necessary
! (setq group (or group ""))
(when (string-match "\r" group)
(setq group (substring group 0 (match-beginning 0))))
+ ;; Cons up the result.
(cons group number)))))
(provide 'nntp)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~1998-12-01 0:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-30 18:58 can't mark articles reached with `^' Dale Hagglund
1998-11-30 19:18 ` Matt Pharr
1998-11-30 19:32 ` Dale Hagglund
1998-11-30 20:02 ` Lars Magne Ingebrigtsen
1998-11-30 20:48 ` Dale Hagglund
1998-11-30 23:36 ` Lars Magne Ingebrigtsen
1998-12-01 0:45 ` Dale Hagglund
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).