Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
Subject: nnimap-generate-folder-list-from-bbdb, almost.
Date: Wed, 23 Feb 2005 20:37:03 -0500	[thread overview]
Message-ID: <874qg2n3gg.fsf@mat.ucm.es> (raw)

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

Hello

Some weeks ago I asked for a function which would allow to generate a
entry in the nnimap-split-fancy list, based on a relevant bbdb entry.

I am almost there, that is I obtained  a function
(my:nnimap-folder-list-from-bbdb) --which I have added below--

Evaluation the function, that 
(eval-expression '(my:nnimap-folder-list-from-bbdb) nil)
returns
(
("From" "bill@upct\\.es" "testbill") 
                            ^this is the relevant bbdb entry.
("From" "oub@mat\\.ucm\\.es" "testimap"))
                                ^this is the relevant bbdb entry.
                              

Now the problem is I don't know who to add this to the
nnimap-split-entry

That variable is as follows:

   (setq
 nnimap-split-rule  'nnimap-split-fancy
 nnimap-split-inbox "INBOX"
 nnimap-split-fancy
 '(|
   ("Subject" "POSIBLE SPAM" "SPAM.POSS")
   ("Subject"  ".*\\[labest05\\].*" "Labest05")	
   ("To" "xemacs-patches@xemacs.org" "Xemacs-patches") ;
   ("Sender" "xemacs-patches-bounces@xemacs.org" "Xemacs-patches") ;
   ("To" " users@dba.openoffice.org" "OO-dba") ;
   ("Sender" "preview-latex-devel-admin@lists.sourceforge.net" "Preview-latex") ;
   ("Sender" "linux-thinkpad-admin@linux-thinkpad.org" "Linux-thinkpad") ;
   ("From" "MA_Quimicas@mat.ucm.es" "Secrequi")
   ("From" "Matematica_Aplicada@mat.ucm.es" "Secremat")
   (: setq spam-use-BBDB-exclusive nil)
   (: spam-split 'spam-use-BBDB 'spam-use-stat "SPAM.REAL")
   (: spam-split 'spam-use-regex-headers "SPAM.POSS") ;Version:1.10
   (: setq spam-use-BBDB-exclusive t fake-variable nil)
   (: spam-split 'spam-use-BBDB "SPAM.HAM")
   (: setq spam-use-BBDB-exclusive nil)
   "MAILBOX"))



So I thought of either doing

(defun my:nnimap-generate-folder-list-from-bbdb ()
   "Sets 'nnimap-folder-list to the result of
 my:nnimap-folder-list-from-bbdb."
   (interactive)
    (add-to-list 'nnimap-split-fancy
          (my:nnimap-folder-list-from-bbdb) )) 


Which resulted in 



`nnimap-split-fancy' is a variable declared in Lisp.
  -- loaded from "nnimap"

Value: ((("From" "oub@mat\\.ucm\\.es" "testimap")) | ("Subject"
"POSIBLE SPAM" "SPAM.POSS") ("Subject" ".*\\[labest05\\].*"
"Labest05") ("To" "xemacs-patches@xemacs.org" "Xemacs-patches")
("Sender" "xemacs-patches-bounces@xemacs.org" "Xemacs-patches") ("To"
" users@dba.openoffice.org" "OO-dba") ("Sender"
"preview-latex-devel-admin@lists.sourceforge.net" "Preview-latex")
("Sender" "linux-thinkpad-admin@linux-thinkpad.org" "Linux-thinkpad")
("From" "MA_Quimicas@mat.ucm.es" "Secrequi") ("From"
"Matematica_Aplicada@mat.ucm.es" "Secremat") (: setq
spam-use-BBDB-exclusive nil) (: spam-split (quote spam-use-BBDB)
(quote spam-use-stat) "SPAM.REAL") (: spam-split (quote
spam-use-regex-headers) "SPAM.POSS") (: setq spam-use-BBDB-exclusive t
fake-variable nil) (: spam-split (quote spam-use-BBDB) "SPAM.HAM") (:
setq spam-use-BBDB-exclusive nil) "MAILBOX")

which is wrong the new entry has to appear
after the | symbol

Or

(defun my:nnimap-generate-folder-list-from-bbdb ()
   "Sets 'nnimap-folder-list to the result of
 my:nnimap-folder-list-from-bbdb."
   (interactive)
   (add-to-list 'nnimap-split-fancy
         (my:nnimap-folder-list-from-bbdb) 'append))

Which results in 
`nnimap-split-fancy' is a variable declared in Lisp.
  -- loaded from "nnimap"

Value: (| ("Subject" "POSIBLE SPAM" "SPAM.POSS") ("Subject"
".*\\[labest05\\].*" "Labest05") ("To" "xemacs-patches@xemacs.org"
"Xemacs-patches") ("Sender" "xemacs-patches-bounces@xemacs.org"
"Xemacs-patches") ("To" " users@dba.openoffice.org" "OO-dba")
("Sender" "preview-latex-devel-admin@lists.sourceforge.net"
"Preview-latex") ("Sender" "linux-thinkpad-admin@linux-thinkpad.org"
"Linux-thinkpad") ("From" "MA_Quimicas@mat.ucm.es" "Secrequi") ("From"
"Matematica_Aplicada@mat.ucm.es" "Secremat") (: setq
spam-use-BBDB-exclusive nil) (: spam-split (quote spam-use-BBDB)
(quote spam-use-stat) "SPAM.REAL") (: spam-split (quote
spam-use-regex-headers) "SPAM.POSS") (: setq spam-use-BBDB-exclusive t
fake-variable nil) (: spam-split (quote spam-use-BBDB) "SPAM.HAM") (:
setq spam-use-BBDB-exclusive nil) "MAILBOX" (("From"
"oub@mat\\.ucm\\.es" "testimap")))

Which is also bad, since it is the last entry.





or
(setq
 nnimap-split-rule  'nnimap-split-fancy
 nnimap-split-inbox "INBOX"
 nnimap-split-fancy
 '(|
  (: my:nnimap-folder-list-from-bbdb)
   ("Subject" "POSIBLE SPAM" "SPAM.POSS")
   ("Subject"  ".*\\[labest05\\].*" "Labest05")	;DAS IST ES!!!! Jan 27, 2005 13:34
   ("To" "xemacs-patches@xemacs.org" "Xemacs-patches") ;
   ("Sender" "xemacs-patches-bounces@xemacs.org" "Xemacs-patches") ;
   ("To" " users@dba.openoffice.org" "OO-dba") ;
   ("Sender" "preview-latex-devel-admin@lists.sourceforge.net" "Preview-latex") ;
   ("Sender" "linux-thinkpad-admin@linux-thinkpad.org" "Linux-thinkpad") ;
   ("From" "MA_Quimicas@mat.ucm.es" "Secrequi")
   ("From" "Matematica_Aplicada@mat.ucm.es" "Secremat")
   (: setq spam-use-BBDB-exclusive nil)
   (: spam-split 'spam-use-BBDB 'spam-use-stat "SPAM.REAL")
   (: spam-split 'spam-use-regex-headers "SPAM.POSS") ;Version:1.10
   (: setq spam-use-BBDB-exclusive t fake-variable nil)
   (: spam-split 'spam-use-BBDB "SPAM.HAM")
   (: setq spam-use-BBDB-exclusive nil)
   "MAILBOX"))

That however gave an error I have attached below. (As I understand
there are to may parenthesis generated.)

I would appreciate any help on this subject. I think that function can
be really convenient.


Thanks

Uwe Brauer 



[-- Attachment #2: imap-split-bbdb-bug --]
[-- Type: application/octet-stream, Size: 1959 bytes --]

Debugger entered--Lisp error: (invalid-function (my:nnimap-folder-list-from-bbdb))
  ((my:nnimap-folder-list-from-bbdb))
  eval(((my:nnimap-folder-list-from-bbdb)))
  nnmail-split-it((: (my:nnimap-folder-list-from-bbdb)))
  nnmail-split-it((| (: (my:nnimap-folder-list-from-bbdb)) ("Subject" ".*\\[POSSILBLE SPAM\\].*" "SPAM.POSS") ("Subject" ".*\\<\\[POSSIBLE.SPAM\\]\\>.*" "SPAM.POSS") ("Subject" "POSIBLE SPAM" "SPAM.POSS") ("Subject" ".*\\[labest05\\].*" "Labest05") ("To" "xemacs-patches@xemacs.org" "Xemacs-patches") ("Sender" "xemacs-patches-bounces@xemacs.org" "Xemacs-patches") ("To" " users@dba.openoffice.org" "OO-dba") ("Sender" "preview-latex-devel-admin@lists.sourceforge.net" "Preview-latex") ("Sender" "linux-thinkpad-admin@linux-thinkpad.org" "Linux-thinkpad") ("From" "MA_Quimicas@mat.ucm.es" "Secrequi") ("From" "Matematica_Aplicada@mat.ucm.es" "Secremat") (: setq spam-use-BBDB-exclusive nil) (: spam-split (quote spam-use-BBDB) (quote spam-use-stat) "SPAM.REAL") (: spam-split (quote spam-use-regex-headers) "SPAM.POSS") (: setq spam-use-BBDB-exclusive t fake-variable nil) (: spam-split (quote spam-use-BBDB) "SPAM.HAM") (: setq spam-use-BBDB-exclusive nil) "MAILBOX"))
  nnmail-split-fancy()
  nnimap-split-fancy()
  nnimap-split-to-groups(nnimap-split-fancy)
  nnimap-split-articles(nil "ucmail.ucm.es")
  nnimap-request-scan(nil "ucmail.ucm.es")
  gnus-request-scan(nil (nnimap "ucmail.ucm.es"))
  gnus-read-active-file-1((nnimap "ucmail.ucm.es") nil)
  gnus-read-active-file()
  gnus-group-get-new-news(nil)
  call-interactively(gnus-group-get-new-news)
  recursive-edit()
  byte-code("..." [buffer-read-only noninteractive debugger-buffer middlestart debugger-args debugger-batch-max-lines pop-to-buffer debugger-mode debugger-setup-buffer count-lines 2 "...\n" message buffer-string kill-emacs debug backtrace-debug 3 t debugger-reenable "" nil recursive-edit standard-output] 3)
  debug(error (void-function folding-fold-region))

                 reply	other threads:[~2005-02-24  1:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=874qg2n3gg.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    /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).