branch: externals/ebdb
commit 925e0ea3d005ce7ba16577029ffd051308d36f54
Author: Eric Abrahamsen <e...@ericabrahamsen.net>
Commit: Eric Abrahamsen <e...@ericabrahamsen.net>

    Remove mail-citation-prefix-regexp from strings to snarf
    
    * ebdb-snarf.el (ebdb-snarf-collect): Work with common case of
      snarfing mail messages.
---
 ebdb-snarf.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ebdb-snarf.el b/ebdb-snarf.el
index 6f85a0e..77c6984 100644
--- a/ebdb-snarf.el
+++ b/ebdb-snarf.el
@@ -176,7 +176,11 @@ list of other field instances.  Any element can be nil."
                  "\\)[-\n ,:]*")))
 
     (with-temp-buffer
-      (insert str)
+      ;; Snarfing mail buffers is very common, try deleting citation
+      ;; prefixes from the buffer first.
+      (insert (replace-regexp-in-string
+              (concat "^" mail-citation-prefix-regexp "[:blank:]+")
+              "" str))
       (goto-char (point-min))
       (while (re-search-forward big-re nil t)
        (let* ((start (goto-char (match-beginning 0)))

Reply via email to