[Fix of infloop in bbdb-snarf-region on bare address] Re: Problem loc

Adrian Aichner adrian at xemacs.org
Sun May 28 09:29:12 EDT 2006


Uwe Brauer <oub at mat.ucm.es> writes:

>>>>>> "Robert" == Robert Widhopf-Fenk <bbdb at robf.de> writes:
>    >> > 
>    >> > But only the simple email address causes the problems I described.
>    >> > 
>    >> > John_Doe at mail.com
>    >> > 
>    >> > 
>    >> > Can please somebody confirm this?
>    >> 
>    >> Please try the attached patch which fixes this for me.
>    >> 
>    >> Snarfing was done in the buffer " *BBDB snarf*" which was
>    >> actually empty when entering the while loop you identified
>    >> and thus the was noch char at point ...
>    >> 
>    >> If it gets a +1 from Waider I try commit ;-)
>
>    Robert> It is in CVS now.
>
>    Robert> Robert
> there is a problem with the patch, it works well in a mail buffer, but

Uwe, that's not a problem with the patch, that's another bug.

I missed updates to this mail thread and just arrived at the same
solution as Robert.

I have also noticed that `forward-line' has this fairly confusing bit
in its docstring:

  Returns the count of lines left to move.  If moving forward,
  that is COUNT - number of lines moved; if backward, COUNT + number moved.
  With positive COUNT, a non-empty line at the end counts as one line
    successfully moved (for the return value).

So, relying on forward-word return value would make the code harder to
read.

Best regards!

Adrian

> take say a lisp buffer and mark the email address of the author
>  again John_Doe at mail.com
> and I obtain an error, which I attach:
>
> Another point bbdb-snarf for emails at point still do not work?
>
> Uwe Brauer
>
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   string-match("\\W+\\([Xx]\\|[Ee]xt\\.?\\)\\W*[-0-9]+\\'" nil)
>   bbdb-divide-name(nil)
>   bbdb-merge-interactively(nil nil ("oub at mat.ucm.es") nil nil nil)
>   bbdb-snarf-region(79 93)
>   call-interactively(bbdb-snarf-region)
>   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 (wrong-type-argument stringp nil))
>   string-match("\\W+\\([Xx]\\|[Ee]xt\\.?\\)\\W*[-0-9]+\\'" nil)
>   bbdb-divide-name(nil)
>   bbdb-merge-interactively(nil nil ("oub at mat.ucm.es") nil nil nil)
>   bbdb-snarf-region(1 15)
>   eval((bbdb-snarf-region (region-beginning) (region-end)))
>   edit-and-eval-command("Redo: " (switch-to-buffer "*scratch*") (command-history . 1))
>   repeat-complex-command(1)
>   call-interactively(repeat-complex-command)

-- 
Adrian Aichner
 mailto:adrian at xemacs.org
 http://www.xemacs.org/




More information about the XEmacs-Beta mailing list