Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* nnimap-generate-folder-list-from-bbdb, almost.
@ 2005-02-24  1:37 Uwe Brauer
  0 siblings, 0 replies; only message in thread
From: Uwe Brauer @ 2005-02-24  1:37 UTC (permalink / 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))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-24  1:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-24  1:37 nnimap-generate-folder-list-from-bbdb, almost Uwe Brauer

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