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

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

[elpa] externals/ebdb 4fb5fc9 6/6: Allow ignoring mail from whole domain


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 4fb5fc9 6/6: Allow ignoring mail from whole domains
Date: Thu, 7 Nov 2019 18:12:42 -0500 (EST)

branch: externals/ebdb
commit 4fb5fc99c8ebcbc17d17e8e42ae9e9f93dcd1c3b
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Allow ignoring mail from whole domains
    
    * ebdb-mua.el (ebdb-query-create): New key "I" for ignoring domains.
      (ebdb-update-records): Catch this key and set 'ignore-domain flag.
      (ebdb-get-address-components): Additionally check for domains to
      ignore.
    * ebdb.org: Document.
---
 ebdb-mua.el | 20 +++++++++++++-
 ebdb.info   | 89 +++++++++++++++++++++++++++++++------------------------------
 ebdb.org    | 18 +++++++------
 ebdb.texi   | 18 +++++++------
 4 files changed, 84 insertions(+), 61 deletions(-)

diff --git a/ebdb-mua.el b/ebdb-mua.el
index 2ec5ca3..c732ab3 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -734,6 +734,11 @@ are discarded as appropriate."
                ;; Ignore addresses that should be ignored.
                (when (and mail
                           (not (member (downcase mail) mail-list))
+                          (not (member (downcase
+                                        (concat
+                                         "@"
+                                         (nth 1 (split-string mail "@"))))
+                                       mail-list))
                           (ebdb-mua-test-headers (car headers) address 
ignore-address))
                  ;; Add each address only once. (Use MAIL-LIST for book 
keeping.)
                  ;; Thus if we care about whether an address gets associated 
with
@@ -822,6 +827,16 @@ Usually this function is called by the wrapper 
`ebdb-mua-auto-update'."
                 (unless ebdb-permanent-ignores-file
                   (message "Mail will be ignored for this session only")
                   (sit-for 2)))
+               ((eq task 'ignore-domain)
+                (when (cadr address)
+                  (cl-pushnew (downcase
+                               (concat "@"
+                                       (split-string
+                                        (cadr address) "@" t)))
+                              ebdb-permanently-ignored-mails :test #'equal)
+                  (unless ebdb-permanent-ignores-file
+                    (message "Mail will be ignored for this session only")
+                    (sit-for 2))))
                ((not (eq task 'next))
                 (dolist (hit (delq nil (nreverse hits)))
                   (cl-pushnew hit records :test #'equal)
@@ -848,7 +863,7 @@ Honor previous answers such as `!'."
     ;; `ebdb-offer-to-create' holds a character, i.e., a number.
     ;; -- Right now, we only remember "!".
     (when (not (integerp task))
-      (let ((prompt (format "%s is not in EBDB; add? (y,!,n,i,s,q,?) "
+      (let ((prompt (format "%s is not in EBDB; add? (y,!,n,i,I,s,q,?) "
                             (or (nth 0 ebdb-update-records-address)
                                 (nth 1 ebdb-update-records-address))))
             event)
@@ -871,6 +886,8 @@ Honor previous answers such as `!'."
            (throw 'done 'quit))
          ((eq task ?i)
           (throw 'done 'ignore))
+         ((eq task ?I)
+          (throw 'done 'ignore-domain))
           ((eq task ?s)
            (setq ebdb-update-records-p 'existing)
            (throw 'done 'next))
@@ -891,6 +908,7 @@ Type y  to add the current record.
 Type !  to add all remaining records.
 Type n  to skip the current record. (You can also type space)
 Type i  to permanently ignore this mail address
+Type I  to permanently ignore this mail domain
 Type s  to switch from annotate to search mode.
 Type q  to quit updating records.  No more search or annotation is done.")
                    (set-buffer-modified-p nil)
diff --git a/ebdb.info b/ebdb.info
index bf3e05c..8cdb0a6 100644
--- a/ebdb.info
+++ b/ebdb.info
@@ -1,4 +1,4 @@
-This is ebdb.info, produced by makeinfo version 6.6 from ebdb.texi.
+This is ebdb.info, produced by makeinfo version 6.7 from ebdb.texi.
 
 Copyright © 2016 Free Software Foundation, Inc.
 
@@ -772,14 +772,15 @@ by saving it to disk.
      disable saving of the ignored list altogether.
 
    When EBDB queries to create or update a record, the ‘i’ key will
-ignore the mail permanently.  If the above option is nil, the mail will
-be ignored for this session only, otherwise it will be saved to disk the
-next time EBDB is saved.
+ignore the mail permanently; the ‘I’ key will ignore the entire domain.
+If the above option is nil, the mail will be ignored for this session
+only, otherwise it will be saved to disk the next time EBDB is saved.
 
    It’s also possible to add addresses manually, while EBDB is shut
 down.  The format is one address per line, with no attached name or
-angle brackets.  The addresses are matched literally (though
-case-insensitively); it’s not possible to use regexps.
+angle brackets.  Domains to be ignored should start with the “@” symbol.
+The addresses are matched literally (though case-insensitively); it’s
+not possible to use regexps.
 
 
 File: ebdb.info,  Node: Noticing and Automatic Rules,  Next: Interactive 
Commands,  Prev: Auto-Updating Records,  Up: Display and Updating
@@ -2658,44 +2659,44 @@ Node: Loading MUA Code20835
 Node: Display and Updating21548
 Node: Pop-up Buffers22314
 Node: Auto-Updating Records24234
-Node: Noticing and Automatic Rules28534
-Node: Interactive Commands29867
-Node: EBDB and MUA summary buffers32341
-Node: Sender name display32859
-Node: Summary buffer marks34086
-Node: Mail Address Completion35265
-Node: A Note on Completion37774
-Node: Specific MUAs38397
-Node: Gnus38545
-Node: Posting Styles38767
-Node: EBDB Buffers40342
-Node: Searching41553
-Node: Changing Search Behavior43267
-Node: The Basics of ebdb-mode44514
-Node: Customizing Record Display48823
-Node: Marking53143
-Node: Exporting/Formatting53570
-Node: Completion54505
-Node: Snarfing55301
-Node: Internationalization57318
-Node: Diary Integration60019
-Node: Mail Aliases60884
-Node: vCard Support61598
-Node: Org Integration62097
-Node: Citing Records63995
-Node: Hacking EBDB64753
-Node: Field Classes67344
-Node: Init and Delete Methods70480
-Node: The Labeled Field Class71987
-Node: The Singleton Field Class72841
-Node: Actions73279
-Node: Custom Field Searching73951
-Node: Fast Lookups76818
-Node: Formatting in the EBDB Buffer78628
-Node: Writing Internationalization Libraries80704
-Node: Writing Integration For New MUAs85118
-Node: Article snarfing88566
-Node: Index89284
+Node: Noticing and Automatic Rules28640
+Node: Interactive Commands29973
+Node: EBDB and MUA summary buffers32447
+Node: Sender name display32965
+Node: Summary buffer marks34192
+Node: Mail Address Completion35371
+Node: A Note on Completion37880
+Node: Specific MUAs38503
+Node: Gnus38651
+Node: Posting Styles38873
+Node: EBDB Buffers40448
+Node: Searching41659
+Node: Changing Search Behavior43373
+Node: The Basics of ebdb-mode44620
+Node: Customizing Record Display48929
+Node: Marking53249
+Node: Exporting/Formatting53676
+Node: Completion54611
+Node: Snarfing55407
+Node: Internationalization57424
+Node: Diary Integration60125
+Node: Mail Aliases60990
+Node: vCard Support61704
+Node: Org Integration62203
+Node: Citing Records64101
+Node: Hacking EBDB64859
+Node: Field Classes67450
+Node: Init and Delete Methods70586
+Node: The Labeled Field Class72093
+Node: The Singleton Field Class72947
+Node: Actions73385
+Node: Custom Field Searching74057
+Node: Fast Lookups76924
+Node: Formatting in the EBDB Buffer78734
+Node: Writing Internationalization Libraries80810
+Node: Writing Integration For New MUAs85224
+Node: Article snarfing88672
+Node: Index89390
 
 End Tag Table
 
diff --git a/ebdb.org b/ebdb.org
index d216d4a..56a5226 100644
--- a/ebdb.org
+++ b/ebdb.org
@@ -609,14 +609,16 @@ the ignored list altogether.
 #+end_defopt
 
 When EBDB queries to create or update a record, the {{{kbd(i)}}} key
-will ignore the mail permanently.  If the above option is nil, the
-mail will be ignored for this session only, otherwise it will be saved
-to disk the next time EBDB is saved.
-
-It's also possible to add addresses manually, while EBDB is shut
-down.  The format is one address per line, with no attached name or
-angle brackets.  The addresses are matched literally (though
-case-insensitively); it's not possible to use regexps.
+will ignore the mail permanently; the {{{kbd(I)}}} key will ignore the
+entire domain.  If the above option is nil, the mail will be ignored
+for this session only, otherwise it will be saved to disk the next
+time EBDB is saved.
+
+It's also possible to add addresses manually, while EBDB is shut down.
+The format is one address per line, with no attached name or angle
+brackets.  Domains to be ignored should start with the "@" symbol.
+The addresses are matched literally (though case-insensitively); it's
+not possible to use regexps.
 *** Noticing and Automatic Rules
 
 #+CINDEX: Automatic Rules
diff --git a/ebdb.texi b/ebdb.texi
index f44b918..e1baf19 100644
--- a/ebdb.texi
+++ b/ebdb.texi
@@ -818,14 +818,16 @@ the ignored list altogether.
 @end defopt
 
 When EBDB queries to create or update a record, the @kbd{i} key
-will ignore the mail permanently.  If the above option is nil, the
-mail will be ignored for this session only, otherwise it will be saved
-to disk the next time EBDB is saved.
-
-It's also possible to add addresses manually, while EBDB is shut
-down.  The format is one address per line, with no attached name or
-angle brackets.  The addresses are matched literally (though
-case-insensitively); it's not possible to use regexps.
+will ignore the mail permanently; the @kbd{I} key will ignore the
+entire domain.  If the above option is nil, the mail will be ignored
+for this session only, otherwise it will be saved to disk the next
+time EBDB is saved.
+
+It's also possible to add addresses manually, while EBDB is shut down.
+The format is one address per line, with no attached name or angle
+brackets.  Domains to be ignored should start with the ``@@'' symbol.
+The addresses are matched literally (though case-insensitively); it's
+not possible to use regexps.
 
 @node Noticing and Automatic Rules
 @subsection Noticing and Automatic Rules



reply via email to

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