emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/ebdb 5e25f5b 344/350: Remove Brian Edmonds' code until


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 5e25f5b 344/350: Remove Brian Edmonds' code until copyright resolved
Date: Mon, 14 Aug 2017 11:47:07 -0400 (EDT)

branch: externals/ebdb
commit 5e25f5b792ecd440cbbba2c2388eaecfd883314d
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Remove Brian Edmonds' code until copyright resolved
    
    * ebdb-gnus.el: The Gnus split stuff. Hopefully a temporary removal.
---
 ebdb-gnus.el | 177 +----------------------------------------------------------
 1 file changed, 3 insertions(+), 174 deletions(-)

diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index f4d3e56..c89422c 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -68,6 +68,9 @@
 (cl-defmethod ebdb-string ((field ebdb-gnus-score-field))
   (slot-value field 'score))
 
+;; Brian Edmonds' code has been removed (hopefully temporarily), so
+;; this field class won't actually do anything.  It's here mostly for
+;; the migration process, and in hopes we'll get that code back.
 (defclass ebdb-gnus-private-field (ebdb-field-user)
   ((group
     :type string
@@ -153,180 +156,6 @@ addresses better than the traditionally static global 
scorefile."
                        "))"))))
   ebdb/gnus-score-alist)
 
-;;; from Brian Edmonds' gnus-ebdb.el
-;;;
-;;; Splitting / filing with gnus-folder
-;;;
-;;; To use this feature, you need to put this file somewhere in your
-;;; load-path and add the following lines of code to your .gnus file:
-;;;
-;;; (setq nnmail-split-methods 'ebdb/gnus-split-method)
-;;;
-;;; You should also examine the variables defvar'd below and customize
-;;; them to your taste.  They're listed roughly in descending likelihood
-;;; of your wanting to change them.  Once that is done, you need to add
-;;; filing information to your EBDB.  There are two fields of interest:
-;;;
-;;; 1. gnus-private.  This field contains the name of the group in which
-;;;    mail to you from any of the addresses associated with this record
-;;;    will be filed.  Also, any self-copies of mail you send any of the
-;;;    same addresses will be filed here.
-;;; 2. gnus-public.  This field is used to keep mail from mailing lists
-;;;    out of the private mailboxes.  It should be added to a record for
-;;;    the list submission address, and is formatted as follows:
-;;;      "group regexp"
-;;;    where group is where mail from the list should be filed, and
-;;;    regexp is a regular expression which is checked against the
-;;;    envelope sender (from the From_ header) to verify that this is
-;;;    the copy which came from the list.  For example, the entry for
-;;;    the ding mailing list might be:
-;;;      "mail.emacs.ding address@hidden"
-;;;    Yes, the second part *is* a regexp, so those dots may match
-;;;    something other than dots.  Sue me.
-;;;
-;;; Note that you can also specify a gnus-private field for mailing list
-;;; addresses, in which case self-copies of mail you send to the list
-;;; will be filed there.  Also, the field names can be changed below if
-;;; the defaults are not hip enough for you.  Lastly, if you specify a
-;;; gnus-private field for your *own* EBDB record, then all self-copies
-;;; of mail you send will be filed to that group.
-;;;
-;;; This documentation should probably be expanded and moved to a
-;;; separate file, but it's late, and *I* know what I'm trying to
-;;; say. :)
-
-(defcustom ebdb/gnus-split-default-group "mail.misc"
-  "If the EBDB does not indicate any group to spool a message to, it will
-be spooled to this group.  If `ebdb/gnus-split-crosspost-default' is not
-nil, and if the EBDB did not indicate a specific group for one or more
-addresses, messages will be crossposted to this group in addition to any
-group(s) which the EBDB indicated."
-  :group 'ebdb-mua-gnus-splitting
-  :type  'string)
-
-(defcustom ebdb/gnus-split-nomatch-function nil
-  "This function will be called after searching the EBDB if no place to
-file the message could be found.  It should return a group name (or list
-of group names) -- `nnmail-split-fancy' as provided with Gnus is an
-excellent choice."
-  :group 'ebdb-mua-gnus-splitting
-  :type  'function)
-
-(defcustom ebdb/gnus-split-myaddr-regexp
-  (concat "^" (user-login-name) "$\\|^"
-          (user-login-name) "@\\([-a-z0-9]+\\.\\)*"
-          (or (message-make-domain) (system-name) "") "$")
-  "This regular expression should match your address as found in the
-From header of your mail."
-  :group 'ebdb-mua-gnus-splitting
-  :type  'regexp)
-
-(defcustom ebdb/gnus-split-crosspost-default nil
-  "If this variable is not nil, then if the EBDB could not identify a
-group for every mail address, messages will be filed in
-`ebdb/gnus-split-default-group' in addition to any group(s) which the EBDB
-identified."
-  :group 'ebdb-mua-gnus-splitting
-  :type  'boolean)
-
-;; The split function works by assigning one of four spooling priorities
-;; to each group that is associated with an address in the message.  The
-;; priorities are assigned as follows:
-;;
-;; 0. This priority is assigned when crosspost-default is nil to To/Cc
-;;    addresses which have no private group defined in the EBDB.  If the
-;;    user's own address has no private group defined, then it will
-;;    always be given this priority.
-;; 1. This priority is assigned to To/Cc addresses which have a private
-;;    group defined in the EBDB.  If crosspost-default is not nil, then
-;;    To/Cc addresses which have no private group will also be assigned
-;;    this priority.  This is also assigned to the user's own address in
-;;    the From position if a private group is defined for it.
-;; 2. This priority is assigned to From addresses which have a private
-;;    group defined in the EBDB, except for the user's own address as
-;;    described under priorities 0 and 1.
-;; 3. This priority is assigned to To/Cc addresses which have a public
-;;    group defined in the EBDB, and whose associated regular expression
-;;    matches the envelope sender (found in the header From_).
-;;
-;; The split function evaluates the spool priority for each address in
-;; the headers of the message, and returns as a list all the groups
-;; associated with the addresses which share the highest calculated
-;; priority.
-
-;;;###autoload
-(defun ebdb/gnus-split-method ()
-  "This function expects to be called in a buffer which contains a mail
-message to be spooled, and the buffer should be narrowed to the message
-headers.  It returns a list of groups to which the message should be
-spooled, using the addresses in the headers and information from EBDB."
-  (let ((prq (list (list 0) (list 1) (list 2) (list 3))))
-    ;; the From: header is special
-    (let* ((hdr (or (mail-fetch-field "resent-from")
-                    (mail-fetch-field "from")
-                    (user-login-name)))
-           (rv (ebdb/gnus-split-to-group hdr t)))
-      (setcdr (nth (cdr rv) prq) (list (car rv))))
-    ;; do the rest of the headers
-    (let ((hdr (or (concat (or (mail-fetch-field "resent-to" nil t)
-                               (mail-fetch-field "to" nil t))
-                           ", "
-                           (mail-fetch-field "cc" nil t)
-                           ", "
-                           (mail-fetch-field "apparently-to" nil t))
-                   "")))
-      (dolist (address (ebdb-extract-address-components hdr t))
-        (let* ((rv (ebdb/gnus-split-to-group address))
-               (pr (nth (cdr rv) prq)))
-          (unless (member-ignore-case (car rv) pr)
-            (setcdr pr (cons (car rv) (cdr pr)))))))
-    ;; find the highest non-empty queue
-    (setq prq (reverse prq))
-    (while (and prq (not (cdr (car prq)))) (setq prq (cdr prq)))
-    ;; and return...
-    (if (not (or (not (cdr (car prq)))
-                 (and (equal (cdr (car prq)) (list 
ebdb/gnus-split-default-group))
-                      (symbolp ebdb/gnus-split-nomatch-function)
-                      (fboundp ebdb/gnus-split-nomatch-function))))
-        (cdr (car prq))
-      (goto-char (point-min))
-      (funcall ebdb/gnus-split-nomatch-function))))
-
-(defun ebdb/gnus-split-to-group (address &optional source)
-  "This function is called from `ebdb/gnus-split-method' in order to
-determine the group and spooling priority for a single address."
-  (condition-case nil
-      (let* ((tmp (ebdb-extract-address-components address))
-             (mail (cadr tmp))
-             (record (car (ebdb-message-search (car tmp) mail)))
-             public private rgx)
-        (when record
-          (setq private (ebdb-record-user-field record  
'ebdb-gnus-private-field)
-               ;; TODO: Fix this, there's no longer a public field.
-                public (ebdb-record-user-field record 
'ebdb/gnus-split-public-field))
-          (if (and public (not source) (string-match "^\\([^ ]+\\) \\(.*\\)$" 
public))
-              (setq rgx (substring public (match-beginning 2) (match-end 2))
-                    public (substring public (match-beginning 1) (match-end 
1)))
-            (setq public nil)))
-        (cond
-         ((and rgx public
-               (goto-char (point-min))
-               (re-search-forward "^From: \\([^ \n]+\\)[ \n]" nil t)
-               (string-match rgx (buffer-substring (match-beginning 1)
-                                                   (match-end 1))))
-          (cons public 3))
-         (private
-          (cons private
-                (- 1 (if source -1 0)
-                   (if (string-match ebdb/gnus-split-myaddr-regexp mail) 1 
0))))
-         (t
-          (cons ebdb/gnus-split-default-group
-                (cond ((string-match ebdb/gnus-split-myaddr-regexp mail) 0)
-                      (source 2)
-                      (ebdb/gnus-split-crosspost-default 1)
-                      (t 0))))))
-    (error (cons ebdb/gnus-split-default-group 0))))
-
 ;;
 ;; Imap support (Uwe Brauer)
 ;;



reply via email to

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