Gnus development mailing list
 help / color / mirror / Atom feed
* problem with fancy-split's ! operator; bug?
@ 2000-02-02  0:10 Matt Swift
  2000-02-02 17:24 ` Colin Rafferty
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Swift @ 2000-02-02  0:10 UTC (permalink / raw)



The following doesn't work.  You get an error when you try to trace
the split.  The same thing works with the `:' operator as expected.
What am I missing, or is this a bug?

(defun test-split (dummy)
  '(& "one" "two"))
(setq nnmail-split-fancy '(! test-split "dummy"))



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: problem with fancy-split's ! operator; bug?
  2000-02-02  0:10 problem with fancy-split's ! operator; bug? Matt Swift
@ 2000-02-02 17:24 ` Colin Rafferty
  2000-02-03  4:07   ` Matt Swift
  0 siblings, 1 reply; 8+ messages in thread
From: Colin Rafferty @ 2000-02-02 17:24 UTC (permalink / raw)


Matt Swift writes:

> The following doesn't work.  You get an error when you try to trace
> the split.  The same thing works with the `:' operator as expected.
> What am I missing, or is this a bug?

> (defun test-split (dummy)
>   '(& "one" "two"))
> (setq nnmail-split-fancy '(! test-split "dummy"))

It looks good to me.  What is the error (traceback, please)?

-- 
Colin



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: problem with fancy-split's ! operator; bug?
  2000-02-02 17:24 ` Colin Rafferty
@ 2000-02-03  4:07   ` Matt Swift
  2000-02-03 15:15     ` Colin Rafferty
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Swift @ 2000-02-03  4:07 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

>> On Wed, 02 Feb 2000 17:25:48 GMT,
>>    ">" == Colin Rafferty <colin.rafferty@msdw.com> wrote:

    >> Matt Swift writes:
    >> The following doesn't work.  You get an error when you try to trace
    >> the split.  The same thing works with the `:' operator as expected.
    >> What am I missing, or is this a bug?

    >> (defun test-split (dummy)
    >> '(& "one" "two"))
    >> (setq nnmail-split-fancy '(! test-split "dummy"))

    >> It looks good to me.  What is the error (traceback, please)?

You mean it works for you?

It's a quoting problem:

Signaling: (wrong-type-argument sequencep &)
  mapconcat(car (("two" . "two") ("one" . "one") (& . &)) ", ")
  gnus-summary-respool-query()
  call-interactively(gnus-summary-respool-query)


[-- Attachment #2: User settings --]
[-- Type: application/x-emacs-lisp, Size: 10040 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: problem with fancy-split's ! operator; bug?
  2000-02-03  4:07   ` Matt Swift
@ 2000-02-03 15:15     ` Colin Rafferty
  2000-02-03 19:50       ` Toby Speight
  0 siblings, 1 reply; 8+ messages in thread
From: Colin Rafferty @ 2000-02-03 15:15 UTC (permalink / raw)


Matt Swift writes:
> Colin Rafferty wrote:
>> Matt Swift writes:

>>> The following doesn't work.  You get an error when you try to trace
>>> the split.  The same thing works with the `:' operator as expected.
>>> What am I missing, or is this a bug?

>>> (defun test-split (dummy)
>>> '(& "one" "two"))
>>> (setq nnmail-split-fancy '(! test-split "dummy"))

>> It looks good to me.  What is the error (traceback, please)?

> You mean it works for you?

Oops, no it doesn't.  It simply looked correct to me, given the
documentation.

The problem is that the documentation does not match the code.

Here is the doc for `!':

  (! FUNCTION SPLIT): Call FUNCTION with the result of SPLIT.  The
    return value FUNCTION should be a split, which is then recursively
    processed.

However, here is the code:

     ;; Builtin ! operation.
     ((eq (car split) '!)
      (funcall (cadr split) (nnmail-split-it (caddr split))))

It should be this (to match `:'):

     ;; Builtin ! operation.
     ((eq (car split) '!)
      (nnmail-split-it (save-excursion (funcall (cadr split) (nnmail-split-it (caddr split))))))

I'm not sure that Lars should change the code to match documentation,
since there may be many people out there who depend on this.  Although
the documented method is much more useful.

-- 
Colin



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: problem with fancy-split's ! operator; bug?
  2000-02-03 15:15     ` Colin Rafferty
@ 2000-02-03 19:50       ` Toby Speight
  2000-02-04 13:08         ` Colin Rafferty
  0 siblings, 1 reply; 8+ messages in thread
From: Toby Speight @ 2000-02-03 19:50 UTC (permalink / raw)


>> Colin Rafferty <URL:mailto:colin@xemacs.org>

0> In article <vgvsnzanwqi.fsf@ms.com>,
0> > wrote:

>> However, here is the code:
>>
>>      ;; Builtin ! operation.
>>      ((eq (car split) '!)
>>       (funcall (cadr split) (nnmail-split-it (caddr split))))
>>
>> It should be this (to match `:'):
>>
>>      ;; Builtin ! operation.
>>      ((eq (car split) '!)
>>       (nnmail-split-it (save-excursion (funcall (cadr split) (nnmail-split-it (caddr split))))))
>>
>> I'm not sure that Lars should change the code to match documentation,
>> since there may be many people out there who depend on this.

Can you give an example of something that works with the former code,
that behaves differently in the latter?




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: problem with fancy-split's ! operator; bug?
  2000-02-03 19:50       ` Toby Speight
@ 2000-02-04 13:08         ` Colin Rafferty
  2000-02-04 15:44           ` Toby Speight
  0 siblings, 1 reply; 8+ messages in thread
From: Colin Rafferty @ 2000-02-04 13:08 UTC (permalink / raw)


Toby Speight writes:

>>> Colin Rafferty <URL:mailto:colin@xemacs.org>
0> In article <vgvsnzanwqi.fsf@ms.com>,
0> > wrote:

>>> However, here is the code:
>>> 
>>> ;; Builtin ! operation.
>>> ((eq (car split) '!)
>>>  (funcall (cadr split) (nnmail-split-it (caddr split))))
>>> 
>>> It should be this (to match `:'):
>>> 
>>> ;; Builtin ! operation.
>>> ((eq (car split) '!)
>>>  (nnmail-split-it (save-excursion (funcall (cadr split) (nnmail-split-it (caddr split))))))
>>> 
>>> I'm not sure that Lars should change the code to match documentation,
>>> since there may be many people out there who depend on this.

> Can you give an example of something that works with the former code,
> that behaves differently in the latter?

Just about anything.  Since the former code expects a list of groups
in which to put the mail, and the latter code expects a split to
parse, pretty much anything will owrk differently.

For example, if I had a .gnus that looked like this:

(defun test-split (dummy)
  '("one "two"))

(setq nnmail-split-fancy '(! test-split "dummy"))

Then in the former, the resulting split would be ("one" "two"), but in
the latter, the resulting split would be ("one").

-- 
Colin




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: problem with fancy-split's ! operator; bug?
  2000-02-04 13:08         ` Colin Rafferty
@ 2000-02-04 15:44           ` Toby Speight
  2000-02-04 19:07             ` Colin Rafferty
  0 siblings, 1 reply; 8+ messages in thread
From: Toby Speight @ 2000-02-04 15:44 UTC (permalink / raw)


>> Colin Rafferty <URL:mailto:colin.rafferty@msdw.com>

0> In article <vgvn1phktct.fsf@ms.com>,
0> > wrote:

>> Toby Speight writes:
>>
>>>> Colin Rafferty <URL:mailto:colin@xemacs.org>
0> In article <vgvsnzanwqi.fsf@ms.com>,
0> > wrote:

>> Can you give an example of something that works with the former
>> code, that behaves differently in the latter?
>>
>> Just about anything.  Since the former code expects a list of
>> groups in which to put the mail, and the latter code expects a
>> split to parse, pretty much anything will owrk differently.

Did this used to work at one time?  I have old code which I don't use
any more, which looks like

dot-gnus> (defun tms-split-lists (list)
dot-gnus>   (goto-char (point-min))
dot-gnus>   (let (groups name)
dot-gnus>     (while (re-search-forward tms-list-regexp nil t)
dot-gnus>       (setq name (match-string 1))
dot-gnus>       (or (member name groups)
dot-gnus>           (setq groups (cons name groups))))
dot-gnus>     (cons '& groups)))

In particular, note that I put '& at the beginning of the list.  This
worked in 5.5 or 5.7, I think.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: problem with fancy-split's ! operator; bug?
  2000-02-04 15:44           ` Toby Speight
@ 2000-02-04 19:07             ` Colin Rafferty
  0 siblings, 0 replies; 8+ messages in thread
From: Colin Rafferty @ 2000-02-04 19:07 UTC (permalink / raw)


Toby Speight writes:
> Colin Rafferty writes:
>> Toby Speight writes:

>>> Can you give an example of something that works with the former
>>> code, that behaves differently in the latter?

>> Just about anything.  Since the former code expects a list of
>> groups in which to put the mail, and the latter code expects a
>> split to parse, pretty much anything will owrk differently.

> Did this used to work at one time?  I have old code which I don't use
> any more, which looks like

I guess if you used to use it, then the it must have worked as
advertised at one point, and now it doesn't.

I'll submit a patch.

-- 
Colin



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2000-02-04 19:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-02  0:10 problem with fancy-split's ! operator; bug? Matt Swift
2000-02-02 17:24 ` Colin Rafferty
2000-02-03  4:07   ` Matt Swift
2000-02-03 15:15     ` Colin Rafferty
2000-02-03 19:50       ` Toby Speight
2000-02-04 13:08         ` Colin Rafferty
2000-02-04 15:44           ` Toby Speight
2000-02-04 19:07             ` Colin Rafferty

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).