[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with splitting and imap

From: Ted Zlatanov
Subject: Re: problems with splitting and imap
Date: Mon, 27 Jul 2009 13:42:08 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux)

On Fri, 24 Jul 2009 09:38:50 -0500 Ted Zlatanov <address@hidden> wrote: 

TZ> On Thu, 23 Jul 2009 19:01:46 +0200 Richard Riley <address@hidden> wrote: 
RR> Ted Zlatanov <address@hidden> writes:

>>> You can catch the offender by redefining rfc822.el functions.  This is
>>> rfc822-addresses:
TZ> ... function omitted...
>>> Note the single debug statement I inserted.  Hit `C-x C-e' after the
>>> last parenthesis to use this function; copy it into the *scratch* buffer
>>> to keep playing with it.

RR> Unfortunately I get the following when I evaluate it:

RR> ,----
RR> | Debugger entered--Lisp error: (void-variable header-text)
RR> |   (string-match "\\`[     ]*\\([^][

TZ> You're evaluating the function's contents instead of the function
TZ> definition.  Your cursor should be after the last parenthesis, at the
TZ> position indicated as * in this example:

TZ>  (and buf (kill-buffer buf))))))*

Sorry, I made an error when copying and then when checking my answer.
The code needs one more parenthesis in closing, see at end.

The real problem, though, is that the BBDB splitting function is not
working properly.  That needs to be fixed, and until it's done your
splitting won't work properly any time an invalid address shows up.  My
messages to the BBDB list got blocked by the moderation, so I suggest
you send a direct e-mail to that list (make sure you join first) asking
for help with your original stack trace.  The fix should be fairly
trivial.  I'll follow the BBDB list and add any explanations needed.

For now I would disable the BBDB split function to get yourself back to
normal Gnus usability, until they fix it.


(defun rfc822-addresses (header-text)
  (if (string-match "\\`[ \t]*\\([^][\000-\037 ()<>@,;:\\\".]+\\)[ \t]*\\'"
      ;; Make very simple case moderately fast.
      (list (substring header-text (match-beginning 1) (match-end 1)))
    (let ((buf (generate-new-buffer " rfc822")))
          (set-buffer buf)
          (make-local-variable 'case-fold-search)
          (setq case-fold-search nil)   ;For speed(?)
          (insert header-text)
          ;; unfold continuation lines
          (goto-char (point-min))

          (while (re-search-forward "\\([^\\]\\(\\\\\\\\\\)*\\)\n[ \t]" nil t)
            (replace-match "\\1 " t))

          (goto-char (point-min))
          (let ((list ())
                ;; This is for rfc822-bad-address.  Give it a non-nil
                ;; initial value to prevent rfc822-bad-address from
                ;; raising a wrong-type-argument error
                (rfc822-address-start (point)))
            (catch 'address ; this is for rfc822-bad-address
              (while (not (eobp))
                (setq rfc822-address-start (point))
                (setq tem
                      (cond ((rfc822-looking-at ?\,)
                            ((looking-at "[][\000-\037@;:\\.>)]")
                             (debug "list so far %s, remaining text %s" list 
(buffer-substring (point) (point-max)) ; *** debug ***
                               (format "Strange character \\%c found"
                             (rfc822-addresses-1 t))))
                (cond ((null tem))
                      ((stringp tem)
                       (setq list (cons tem list)))
                       (setq list (nconc (nreverse tem) list)))))
              (nreverse list))))
        (and buf (kill-buffer buf))))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]