[elpa] branch externals/wisitoken-grammar-mode created (now e5d353c)

2019-08-13 Thread Stephen Leake
stephen_leake pushed a change to branch externals/wisitoken-grammar-mode.

at  e5d353c   * run_wisitoken_grammar_parse.ads: New file.

This branch includes the following new commits:

   new  950a513   initial
   new  e5d353c   * run_wisitoken_grammar_parse.ads: New file.




[elpa] externals/wisitoken-grammar-mode 950a513 1/2: initial

2019-08-13 Thread Stephen Leake
branch: externals/wisitoken-grammar-mode
commit 950a5138254dae5787b16da007c70fd67446f376
Author: Stephen Leake 
Commit: Stephen Leake 

initial
---
 build.sh | 9 +
 1 file changed, 9 insertions(+)

diff --git a/build.sh b/build.sh
new file mode 100755
index 000..cc44216
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Build and install executables for WisiToken grammar mode.
+
+export GPR_PROJECT_PATH="../wisi-2.0.1"
+
+gprbuild -p -P wisitoken_grammar.gpr
+gprinstall -f -p -P wisitoken_grammar.gpr --install-name=wisitoken_grammar
+
+# end of file



[elpa] master ab6a47b 1/2: * externals-list: add wisitoken-grammar-mode

2019-08-13 Thread Stephen Leake
branch: master
commit ab6a47bdb1bfc7b5f8563187b7f81191787bcdcc
Author: Stephen Leake 
Commit: Stephen Leake 

* externals-list: add wisitoken-grammar-mode
---
 externals-list | 1 +
 1 file changed, 1 insertion(+)

diff --git a/externals-list b/externals-list
index c2061f9..638e2e5 100644
--- a/externals-list
+++ b/externals-list
@@ -150,6 +150,7 @@
  ("web-server" :subtree 
"https://github.com/eschulte/emacs-web-server.git";)
  ("webfeeder"  :external 
"https://gitlab.com/ambrevar/emacs-webfeeder.git";)
  ("websocket"  :subtree 
"https://github.com/ahyatt/emacs-websocket.git";)
+ ("wisitoken-grammar-mode" :external nil)
  ("which-key"   :subtree "https://github.com/justbur/emacs-which-key";)
  ("xelb"   :external "https://github.com/ch11ng/xelb.git";)
  ("xr" :external "https://github.com/mattiase/xr";)



[elpa] master updated (653afd9 -> b8e3ab9)

2019-08-13 Thread Stephen Leake
stephen_leake pushed a change to branch master.

  from  653afd9   * gited.el: Bump version to 0.5.4
   new  ab6a47b   * externals-list: add wisitoken-grammar-mode
   new  b8e3ab9   In ada-mode, wisi: release Ada mode 6.2.0, wisi 1.2.0.


Summary of changes:
 externals-list |1 +
 packages/ada-mode/NEWS |   28 +-
 packages/ada-mode/README   |2 +-
 packages/ada-mode/ada-build.el |6 +-
 packages/ada-mode/ada-fix-error.el |3 +-
 packages/ada-mode/ada-gnat-compile.el  |   76 +-
 packages/ada-mode/ada-lalr-elisp.el| 4373 -
 packages/ada-mode/ada-mode.el  | 5977 ++--
 packages/ada-mode/ada-mode.info|  259 +-
 packages/ada-mode/ada-mode.texi|  141 +-
 packages/ada-mode/ada-process.el   |  227 +-
 packages/ada-mode/ada-skel.el  |   34 +-
 packages/ada-mode/ada-wisi-elisp-parse.el  |  337 -
 packages/ada-mode/ada-wisi-opentoken.el|   99 -
 packages/ada-mode/ada-wisi.el  | 1762 ++--
 packages/ada-mode/ada.wy   |  304 +-
 packages/ada-mode/ada_lr1_parse_table.txt.gz   |  Bin 2955113 -> 3170831 
bytes
 packages/ada-mode/ada_process_actions.adb  |  417 +-
 packages/ada-mode/ada_process_actions.ads  |   40 +-
 packages/ada-mode/ada_process_lalr_main.adb| 9791 +++-
 packages/ada-mode/ada_process_lr1_main.adb |   18 +-
 packages/ada-mode/ada_re2c.c   |4 +-
 packages/ada-mode/build.sh |2 +-
 packages/ada-mode/dir  |6 +
 packages/ada-mode/gnat-core.el |1 +
 packages/ada-mode/gpr-lalr-elisp.el|  542 --
 packages/ada-mode/gpr-mode.info|   38 +-
 packages/ada-mode/gpr-mode.texi|9 +-
 packages/ada-mode/gpr-process.el   |   86 +-
 packages/ada-mode/gpr-wisi.el  |  283 +-
 packages/ada-mode/gpr.wy   |  742 +-
 packages/ada-mode/gpr_mode_wisi_parse.ads  |4 +-
 packages/ada-mode/gpr_process_actions.adb  |   12 +-
 ...r_process_lr1_main.adb => gpr_process_main.adb} |  586 +-
 ...r_process_lr1_main.ads => gpr_process_main.ads} |4 +-
 packages/ada-mode/run_ada_lalr_parse.ads   |   32 -
 packages/ada-mode/run_ada_libadalang_parse.ads |   25 -
 packages/ada-mode/run_ada_lr1_parse.ads|   33 -
 packages/ada-mode/run_gpr_parse.ads|   31 -
 packages/ada-mode/run_wisi_common_parse.adb|  293 -
 packages/ada-mode/wisi-ada.adb |  394 +-
 packages/ada-mode/wisi-ada.ads |   12 +-
 packages/ada-mode/wisi-gpr.adb |5 +-
 packages/ada-mode/wisi-gpr.ads |3 +-
 .../wisitoken-parse-lr-mckenzie_recover-ada.adb|   39 +-
 packages/wisi/NEWS |   45 +-
 packages/wisi/README   |2 +-
 .../{ada-mode => wisi}/emacs_wisi_common_parse.adb |  126 +-
 .../{ada-mode => wisi}/emacs_wisi_common_parse.ads |  275 +-
 .../{ada-mode => wisi}/gen_emacs_wisi_lr_parse.adb |2 +-
 .../{ada-mode => wisi}/gen_emacs_wisi_lr_parse.ads |0
 .../gen_emacs_wisi_lr_text_rep_parse.adb   |2 +-
 .../gen_emacs_wisi_lr_text_rep_parse.ads   |0
 .../gen_emacs_wisi_packrat_parse.adb   |0
 .../gen_emacs_wisi_packrat_parse.ads   |0
 .../gen_run_wisi_libadalang_parse.adb  |0
 .../gen_run_wisi_libadalang_parse.ads  |0
 .../{ada-mode => wisi}/gen_run_wisi_lr_parse.adb   |0
 .../{ada-mode => wisi}/gen_run_wisi_lr_parse.ads   |0
 .../gen_run_wisi_lr_text_rep_parse.adb |0
 .../gen_run_wisi_lr_text_rep_parse.ads |0
 .../gen_run_wisi_packrat_parse.adb |0
 .../gen_run_wisi_packrat_parse.ads |0
 packages/wisi/run_wisi_common_parse.adb|  343 +
 .../{ada-mode => wisi}/run_wisi_common_parse.ads   |  128 +-
 packages/wisi/sal-gen_bounded_definite_queues.adb  |  119 +-
 packages/wisi/sal-gen_bounded_definite_queues.ads  |  106 +-
 ...-gen_bounded_definite_stacks-gen_image_aux.adb} |6 +-
 ...-gen_bounded_definite_stacks-gen_image_aux.ads} |   54 +-
 packages/wisi/sal-gen_bounded_definite_stacks.adb  |   82 +
 packages/wisi/sal-gen_bounded_definite_stacks.ads  |  103 +
 .../sal-gen_bounded_definite_vectors-gen_image.adb |   79 +-
 ... sal-gen_bounded_definite_vectors-gen_refs.adb} |   69 +-
 .../sal-gen_bounded_definite_vectors-gen_refs.ads  |   54 +
 ...sal-gen_bounded_definite_vectors-gen_sorted.ads |   52 -
 packages/wisi/sal-gen_bounded_definite_vectors.adb |  344 +-
 packag

[elpa] externals/ebdb 4a78f58 2/9: Fix redisplay in ebdb-with-record-edits

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit 4a78f5826b5e0f257f978980e9ac0d9e73d35588
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Fix redisplay in ebdb-with-record-edits

* ebdb-com.el (ebdb-with-record-edits): Redisplay in all EBDB buffers
  if the current buffer isn't in ebdb-mode. Mostly this affects using
  the customize interface to edit field data, because this macro is
  then called outside of the EBDB buffer.
---
 ebdb-com.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ebdb-com.el b/ebdb-com.el
index d428d22..73e8ceb 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -1668,7 +1668,10 @@ runs `ebdb-after-change-hook', and redisplays the 
record."
   (with-current-buffer b
 (when (derived-mode-p 'ebdb-mode)
   (set-buffer-modified-p t
-(ebdb-redisplay-records ,record 'reformat))
+(ebdb-redisplay-records ,record 'reformat
+;; If we're not in ebdb-mode,
+;; redisplay in all EBDB buffers.
+(null (derived-mode-p 'ebdb-mode
  (ebdb-unsynced-db
   (let ((db (cadr err)))
(ebdb-reload-database db)



[elpa] externals/ebdb 31fb567 5/9: Merge remote-tracking branch 'github/VM-mua'

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit 31fb567ed0eaeef8027da78853926c910c9cef33
Merge: b9ebce9 bb0340e
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Merge remote-tracking branch 'github/VM-mua'
---
 ebdb-vm.el | 414 +
 1 file changed, 414 insertions(+)

diff --git a/ebdb-vm.el b/ebdb-vm.el
new file mode 100644
index 000..1ca0aeb
--- /dev/null
+++ b/ebdb-vm.el
@@ -0,0 +1,414 @@
+;;; ebdb-vm.el --- EBDB interface to VM  -*- lexical-binding: t; 
-*-
+
+;; Copyright (C) 2016-2017  Free Software Foundation, Inc.
+
+;; Author: Eric Abrahamsen 
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; EBDB's interface to VM.
+
+;;; Code:
+
+(require 'ebdb-mua)
+
+(when t
+  (require 'vm-autoloads)
+  (require 'vm))
+
+(declare-function vm-check-for-killed-summary "ext:vm-misc")
+(declare-function vm-error-if-folder-empty "ext:vm-misc")
+(declare-function vm-get-header-contents "ext:vm-summary")
+(declare-function vm-su-to-names "ext:vm-summary")
+(declare-function vm-su-from "ext:vm-summary")
+(declare-function vm-su-to "ext:vm-summary")
+(declare-function vm-su-full-name "ext:vm-summary")
+(declare-function vm-su-interesting-full-name "ext:vm-summary")
+(declare-function vm-decode-mime-encoded-words-in-string "ext:vm-mime")
+(declare-function vm-follow-summary-cursor "ext:vm-motion")
+(declare-function vm-add-message-labels "ext:vm-undo")
+
+(defvar vm-summary-function-B)
+(defvar vm-summary-uninteresting-senders)
+(defvar vm-summary-uninteresting-senders-arrow)
+(defvar vm-message-pointer)
+(defvar vm-auto-folder-alist)
+(defvar vm-virtual-folder-alist)
+(defvar vm-folder-directory)
+(defvar vm-primary-inbox)
+(defvar vm-mode-map)
+
+(defgroup ebdb-mua-vm nil
+  "VM-specific EBDB customizations"
+  :group 'ebdb-mua)
+(put 'ebdb-mua-vm 'custom-loads '(ebdb-vm))
+
+(defcustom ebdb-vm-auto-update-p ebdb-mua-reader-update-p
+  "VM-specific value of `ebdb-mua-auto-update-p'."
+  :type '(choice (const :tag "do nothing" nil)
+ (const :tag "search for existing records" search)
+ (const :tag "update existing records" update)
+ (const :tag "query annotation of all messages" query)
+ (const :tag "annotate all messages" create)
+ (function :tag "User-defined function")))
+
+(defun ebdb/vm-header (header)
+  (save-current-buffer
+(with-no-warnings
+  ;; This is a defsubst, and will cause compiler warnings if the
+  ;; user doesn't actually have vm installed.
+ (vm-select-folder-buffer))
+(vm-check-for-killed-summary)
+(vm-error-if-folder-empty)
+(let ((enable-local-variables t))
+  (vm-get-header-contents (car vm-message-pointer)
+ (concat header ":")
+
+
+;; By Alastair Burt 
+;; vm 5.40 and newer support a new summary format, %U, to call
+;; a user-provided function.  Use "%-17.17UB" instead of "%-17.17F" to
+;; have your VM summary buffers display EBDB's idea of the sender's full
+;; name instead of the name (or lack thereof) in the message itself.
+
+;; RW: this is a VM-specific version of `ebdb-mua-summary-unify'
+;; which respects `vm-summary-uninteresting-senders'.
+
+(defun vm-summary-function-B (m)
+  "For VM message M return the EBDB name of the sender.
+Respect `vm-summary-uninteresting-senders'."
+  (if vm-summary-uninteresting-senders
+(if (let ((case-fold-search t))
+  (string-match vm-summary-uninteresting-senders (vm-su-from m)))
+(concat vm-summary-uninteresting-senders-arrow
+(or (ebdb/vm-alternate-full-name (vm-su-to m))
+(vm-decode-mime-encoded-words-in-string
+ (vm-su-to-names m
+  (or (ebdb/vm-alternate-full-name (vm-su-from m))
+  (vm-su-full-name m)))
+(or (ebdb/vm-alternate-full-name (vm-su-from m))
+(vm-decode-mime-encoded-words-in-string (vm-su-full-name m)
+
+(defun ebdb/vm-alternate-full-name (address)
+  (if address
+  (let* ((data (ebdb-extract-address-components address))
+ (record (car (ebdb-message-search (car data) (cadr data)
+(if record
+(or (ebdb-record-xfield record 'mail-name)
+(ebdb-record-name record))
+
+
+
+(defcustom ebdb-vm-window-size ebdb-default-windo

[elpa] externals/ebdb 365b9fb 7/9: Fix mua-auto-update customization values

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit 365b9fb2978141de9ef3ad343ce9e9261a8563c4
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Fix mua-auto-update customization values

* ebdb-mua.el (ebdb-mua-auto-update-p): One of the options had the
wrong symbol: 'search instead of 'existing. The code looks for
'existing. Also, clarify wording of option tags.
(ebdb-mua-sender-update-p):
(ebdb-mua-reader-update-p):
* ebdb-vm.el (ebdb-vm-auto-update-p):
* ebdb-rmail.el (ebdb-rmail-auto-update-p):
* ebdb-mu4e.el (ebdb-mu4e-auto-update-p):
* ebdb-mhe.el (ebdb-mhe-auto-update-p):
* ebdb-message.el (ebdb-message-auto-update-p):
* ebdb-gnus.el (ebdb-gnus-auto-update-p): Make change in all these
places.
* ebdb.org (Auto-Updating Records): Note the 'existing option in
manual (previously neither this nor 'search were mentioned).
---
 ebdb-gnus.el|   6 +--
 ebdb-message.el |   6 +--
 ebdb-mhe.el |   6 +--
 ebdb-mu4e.el|   6 +--
 ebdb-mua.el |  22 +--
 ebdb-rmail.el   |   6 +--
 ebdb-vm.el  |   6 +--
 ebdb-wl.el  |   6 +--
 ebdb.info   | 121 
 ebdb.org|  13 +++---
 ebdb.texi   |  13 +++---
 11 files changed, 107 insertions(+), 104 deletions(-)

diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index ea059d8..77fa78e 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -38,10 +38,10 @@
 (defcustom ebdb-gnus-auto-update-p ebdb-mua-reader-update-p
   "Gnus-specific value of `ebdb-mua-auto-update-p'."
   :type '(choice (const :tag "do nothing" nil)
- (const :tag "search for existing records" search)
+ (const :tag "search for existing records" existing)
  (const :tag "update existing records" update)
- (const :tag "query annotation of all messages" query)
- (const :tag "annotate all messages" create)
+ (const :tag "query for update or record creation" query)
+ (const :tag "update or create automatically" create)
  (function :tag "User-defined function")))
 
 (defcustom ebdb-gnus-window-size ebdb-default-window-size
diff --git a/ebdb-message.el b/ebdb-message.el
index 4701a82..808e163 100644
--- a/ebdb-message.el
+++ b/ebdb-message.el
@@ -39,10 +39,10 @@
 (defcustom ebdb-message-auto-update-p ebdb-mua-sender-update-p
   "Message-specific value of `ebdb-mua-auto-update-p'."
   :type '(choice (const :tag "do nothing" nil)
- (const :tag "search for existing records" search)
+ (const :tag "search for existing records" existing)
  (const :tag "update existing records" update)
- (const :tag "query annotation of all messages" query)
- (const :tag "annotate all messages" create)
+ (const :tag "query for update or record creation" query)
+ (const :tag "update or create automatically" create)
  (function :tag "User-defined function")))
 
 (defcustom ebdb-message-window-size ebdb-default-window-size
diff --git a/ebdb-mhe.el b/ebdb-mhe.el
index 9a6146f..fdf147e 100644
--- a/ebdb-mhe.el
+++ b/ebdb-mhe.el
@@ -37,10 +37,10 @@
 (defcustom ebdb-mhe-auto-update-p ebdb-mua-reader-update-p
   "Mh-e-specific value of `ebdb-mua-auto-update-p'."
   :type '(choice (const :tag "do nothing" nil)
- (const :tag "search for existing records" search)
+ (const :tag "search for existing records" existing)
  (const :tag "update existing records" update)
- (const :tag "query annotation of all messages" query)
- (const :tag "annotate all messages" create)
+ (const :tag "query for update or record creation" query)
+ (const :tag "update or create automatically" create)
  (function :tag "User-defined function")))
 
 (defcustom ebdb-mhe-window-size ebdb-default-window-size
diff --git a/ebdb-mu4e.el b/ebdb-mu4e.el
index 94024c5..5ede6d8 100644
--- a/ebdb-mu4e.el
+++ b/ebdb-mu4e.el
@@ -39,10 +39,10 @@
 (defcustom ebdb-mu4e-auto-update-p ebdb-mua-reader-update-p
   "Mu4e-specific value of `ebdb-mua-auto-update-p'."
   :type '(choice (const :tag "do nothing" nil)
- (const :tag "search for existing records" search)
+ (const :tag "search for existing records" existing)
  (const :tag "update existing records" update)
- (const :tag "query annotation of all messages" query)
- (const :tag "annotate all messages" create)
+ (const :tag "query for update or record creation" query)
+ (const :tag "update or create automatically" create)
  (function :tag "User-defined function")))
 
 (defcustom ebdb-mu4e-window-size ebdb-default-window-size
diff --git a/ebdb-mua.el b/ebdb-mua.el
index 346e6a8..5fb859c 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el

[elpa] externals/ebdb 2a87f5e 3/9: Fix one-primary-mail-per-record constraint

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit 2a87f5ed2a53e3a4e91e8c88ba5afc49f5e945df
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Fix one-primary-mail-per-record constraint

Previously the constraint that each record have one and only one
'primary mail was enforced at the database level, but buggily. Move
that constraint to ebdb-com: people can do what they like when
interacting with the database.

* ebdb-com.el (eieio-done-customizing): Move the mail-specific method
  from :after to :around, so it's nested inside the more general one.
  Now we don't have to redisplay. Match the edited mail by string:
  `equal' won't work because it's been edited.
  (ebdb-com-delete-field): New method specializing on mail fields. If
  we deleted the primary mail, make some other mail primary.
* ebdb.el (ebdb-record-insert-field, ebdb-record-delete-field): Remove
  specializations for the mail field. This was buggy anyway, because
  `change-field' calls one and then the other, and you ended up with a
  mess.
---
 ebdb-com.el | 38 ++
 ebdb.el | 22 --
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/ebdb-com.el b/ebdb-com.el
index 73e8ceb..538d530 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -1890,21 +1890,25 @@ commands, called from an *EBDB* buffer, and the 
lower-level
 
 (cl-defmethod eieio-done-customizing :around ((_field ebdb-field))
   "Check that the record owning FIELD can be edited.
-Also redisplays it after customization."
+Also redisplay the record after customization."
   (let ((rec ebdb-customization-record))
 (when rec
   (ebdb-with-record-edits rec
(cl-call-next-method)
 
-(cl-defmethod eieio-done-customizing :after ((mail ebdb-field-mail))
+(cl-defmethod eieio-done-customizing :around ((mail ebdb-field-mail))
   "Handle mail priority after customizing.
 Check that some mail is marked as primary after MAIL is edited."
   (let* ((rec ebdb-customization-record)
-(all-mails (remove mail (ebdb-record-mail rec t)))
+(other-mails (seq-remove
+  (lambda (m)
+(string-equal (ebdb-string mail)
+  (ebdb-string m)))
+  (ebdb-record-mail rec t)))
 (primaries (when rec (seq-filter
   (lambda (m)
 (eq (slot-value m 'priority) 'primary))
-  all-mails)))
+  other-mails)))
 (prim (eq (slot-value mail 'priority) 'primary)))
 (cond ((and prim primaries)
   ;; MAIL is primary, so set all other primary mails to
@@ -1912,13 +1916,13 @@ Check that some mail is marked as primary after MAIL is 
edited."
   (dolist (p primaries)
 (ebdb-record-change-field rec p (clone p :priority 'normal
  ((and (null (or prim primaries))
-   (car-safe all-mails))
+   (car-safe other-mails))
   ;; Nothing is primary, so try to set some other mail to
   ;; primary.
   (ebdb-record-change-field
-   rec (car all-mails)
-   (clone (car all-mails) :priority 'primary
-(ebdb-redisplay-records rec 'reformat)))
+   rec (car other-mails)
+   (clone (car other-mails) :priority 'primary
+(cl-call-next-method)))
 
 ;;;###autoload
 (defun ebdb-edit-foo (record field)
@@ -2015,6 +2019,24 @@ confirm before deleting the field."
   (let ((person (ebdb-gethash (slot-value field 'record-uuid) 'uuid)))
 (ebdb-com-delete-field person field noprompt)))
 
+(cl-defmethod ebdb-com-delete-field :after ((record ebdb-record-entity)
+   (mail ebdb-field-mail)
+   _noprompt)
+  "Possibly alter the priority of RECORD's remaining mails.
+If there aren't any other primary mails, make the first of the
+remaining mails primary."
+  (let* ((mails (seq-remove
+(lambda (m)
+  (string-equal
+   (ebdb-string m)
+   (ebdb-string mail)))
+(ebdb-record-mail record t)))
+(clone (unless (object-assoc 'primary 'priority mails)
+ (when (car mails)
+   (clone (car mails) :priority 'primary)
+(when clone
+  (ebdb-record-change-field record (car mails) clone
+
 ;;;###autoload
 (defun ebdb-delete-records (records &optional noprompt)
   "Delete RECORDS.
diff --git a/ebdb.el b/ebdb.el
index 3f8872f..ac63a12 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -3067,28 +3067,6 @@ If FIELD doesn't specify a year, use the current year."
 (cl-defmethod ebdb-record-organizations ((_record ebdb-record-entity))
   nil)
 
-(cl-defmethod ebdb-record-insert-field :before ((record ebdb-record-entity)
-   (mail ebdb-field-mail)
-

[elpa] externals/ebdb b9ebce9 4/9: Provide MUA-specific versions of ebdb-mua-auto-update-p

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit b9ebce9bd8fdf3cbfc5067f318b8316d6293c4aa
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Provide MUA-specific versions of ebdb-mua-auto-update-p

* ebdb-mua.el (ebdb-mua-reader-update-p, ebdb-mua-sender-update-p):
  New options specifying reader/sender MUA versions of
  ebdb-mua-auto-update-p.
  (ebdb-mua-auto-update): Swap order of arguments, UPDATE-P is more
  important.
* ebdb-wl.el (ebdb-wl-auto-update-p):
* ebdb-gnus.el (ebdb-gnus-auto-update-p):
* ebdb-message.el (ebdb-message-auto-update-p):
* ebdb-mhe.el (ebdb-mhe-auto-update-p):
* ebdb-mu4e.el (ebdb-mu4e-auto-update-p):
* ebdb-rmail.el (ebdb-rmail-auto-update-p): New MUA-specific versions
  of this option.
* ebdb.org (Auto-Updating Records): Document.
---
 ebdb-gnus.el|  14 +-
 ebdb-message.el |  18 +--
 ebdb-mhe.el |  14 +-
 ebdb-mu4e.el|   9 
 ebdb-mua.el |  44 +---
 ebdb-rmail.el   |  14 +-
 ebdb-wl.el  |  14 +-
 ebdb.info   | 153 +++-
 ebdb.org|  46 ++---
 ebdb.texi   |  45 ++---
 10 files changed, 286 insertions(+), 85 deletions(-)

diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index 198cd2c..ea059d8 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -35,6 +35,15 @@
   :group 'ebdb-mua)
 (put 'ebdb-mua-gnus 'custom-loads '(ebdb-gnus))
 
+(defcustom ebdb-gnus-auto-update-p ebdb-mua-reader-update-p
+  "Gnus-specific value of `ebdb-mua-auto-update-p'."
+  :type '(choice (const :tag "do nothing" nil)
+ (const :tag "search for existing records" search)
+ (const :tag "update existing records" update)
+ (const :tag "query annotation of all messages" query)
+ (const :tag "annotate all messages" create)
+ (function :tag "User-defined function")))
+
 (defcustom ebdb-gnus-window-size ebdb-default-window-size
   "Size of the EBDB buffer when popping up in Gnus.
 Size should be specified as a float between 0 and 1.  Defaults to
@@ -229,7 +238,10 @@ Note that `\( is the backquote, NOT the quote '\(."
 ;; Insinuation
 ;;
 
-(add-hook 'gnus-article-prepare-hook #'ebdb-mua-auto-update)
+(defun ebdb-gnus-auto-update ()
+  (ebdb-mua-auto-update ebdb-gnus-auto-update-p))
+
+(add-hook 'gnus-article-prepare-hook #'ebdb-gnus-auto-update)
 
 (add-hook 'gnus-startup-hook #'ebdb-insinuate-gnus)
 
diff --git a/ebdb-message.el b/ebdb-message.el
index 03b68fb..4701a82 100644
--- a/ebdb-message.el
+++ b/ebdb-message.el
@@ -36,6 +36,15 @@
   :group 'ebdb-mua)
 (put 'ebdb-mua-message 'custom-loads '(ebdb-message))
 
+(defcustom ebdb-message-auto-update-p ebdb-mua-sender-update-p
+  "Message-specific value of `ebdb-mua-auto-update-p'."
+  :type '(choice (const :tag "do nothing" nil)
+ (const :tag "search for existing records" search)
+ (const :tag "update existing records" update)
+ (const :tag "query annotation of all messages" query)
+ (const :tag "annotate all messages" create)
+ (function :tag "User-defined function")))
+
 (defcustom ebdb-message-window-size ebdb-default-window-size
   "Size of the EBDB buffer when popping up in message-mode.
 Size should be specified as a float between 0 and 1.  Defaults to
@@ -150,10 +159,13 @@ Also fires when postponing a draft."
 (_ (define-key mail-mode-map "\M-\t" 'ebdb-complete-mail)))
   (ebdb-undisplay-records))
 
+(defun ebdb-message-auto-update ()
+  (ebdb-mua-auto-update ebdb-message-auto-update-p))
+
 (add-hook 'message-mode-hook 'ebdb-insinuate-message)
 (add-hook 'mail-setup-hook 'ebdb-insinuate-mail)
-(add-hook 'message-send-hook 'ebdb-mua-auto-update)
-(add-hook 'mail-send-hook 'ebdb-mua-auto-update)
+(add-hook 'message-send-hook 'ebdb-message-auto-update)
+(add-hook 'mail-send-hook 'ebdb-message-auto-update)
 
 ;; Slightly convoluted, but does it the "right way".  The
 ;; `message-header-setup-hook' creates and populates the
@@ -163,7 +175,7 @@ Also fires when postponing a draft."
 (add-hook 'ebdb-after-load-hook
  (lambda ()
(with-eval-after-load "gnus-win"
- (add-hook 'message-header-setup-hook 'ebdb-mua-auto-update)
+ (add-hook 'message-header-setup-hook 'ebdb-message-auto-update)
 
  (when ebdb-mua-pop-up
(add-to-list 'gnus-window-to-buffer
diff --git a/ebdb-mhe.el b/ebdb-mhe.el
index c8ebe79..9a6146f 100644
--- a/ebdb-mhe.el
+++ b/ebdb-mhe.el
@@ -34,6 +34,15 @@
   "EBDB customizations for mhe."
   :group 'ebdb-mua)
 
+(defcustom ebdb-mhe-auto-update-p ebdb-mua-reader-update-p
+  "Mh-e-specific value of `ebdb-mua-auto-update-p'."
+  :type '(choice (const :tag "do nothing" nil)
+ (const :tag "search for existing records" search)
+ (const :tag "update existing records" update)
+ (const :tag "query annotation of

[elpa] externals/ebdb updated (3bf66d6 -> 03fcfae)

2019-08-13 Thread Eric Abrahamsen
girzel pushed a change to branch externals/ebdb.

  from  3bf66d6   Don't automatically migrate from BBDB, bump to 0.6.10
   new  4a78f58   Fix redisplay in ebdb-with-record-edits
   new  2a87f5e   Fix one-primary-mail-per-record constraint
   new  b9ebce9   Provide MUA-specific versions of ebdb-mua-auto-update-p
   new  bb0340e   Stick ebdb-vm.el in its own branch until it's usable
   new  31fb567   Merge remote-tracking branch 'github/VM-mua'
   new  5d9c9b0   Add a method for parsing US phone numbers, fix phone 
parsing
   new  365b9fb   Fix mua-auto-update customization values
   new  e1efb02   Add before-save-hook and after-save-hook
   new  03fcfae   Allow permanent ignoring of mail addresses


Summary of changes:
 ebdb-com.el|  43 --
 ebdb-gnus.el   |  14 +-
 ebdb-i18n-basic.el |  25 
 ebdb-message.el|  18 ++-
 ebdb-mhe.el|  14 +-
 ebdb-mu4e.el   |   9 ++
 ebdb-mua.el| 158 +++-
 ebdb-rmail.el  |  14 +-
 ebdb-vm.el | 414 +
 ebdb-wl.el |  14 +-
 ebdb.el|  62 
 ebdb.info  | 192 +
 ebdb.org   |  83 +--
 ebdb.texi  |  82 +--
 14 files changed, 965 insertions(+), 177 deletions(-)
 create mode 100644 ebdb-vm.el



[elpa] externals/ebdb 03fcfae 9/9: Allow permanent ignoring of mail addresses

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit 03fcfaedf5745ef45c0d33df62d1305c0c9df5c8
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Allow permanent ignoring of mail addresses

* ebdb-mua.el (ebdb-permanent-ignores-file): New option specifying
where ignored mail addresses should be saved.
(ebdb-permanently-ignored-mails): Variable holding ignored addresses.
(ebdb-mua-load-permanent-ignores): Load addresses on
`ebdb-after-load-hook'.
(ebdb-mua-save-permanent-ignores): Save them on
`ebdb-after-save-hook'.
(ebdb-get-address-components): Ignore them here.
(ebdb-query-create): Give the user a new "i" option to ignore.
(ebdb-annotate-message): Add ignored messages to the list.
* ebdb.texi (Auto-Updating Records): Document.
---
 ebdb-mua.el | 108 +---
 ebdb.info   | 102 +++-
 ebdb.org|  24 ++
 ebdb.texi   |  24 ++
 4 files changed, 193 insertions(+), 65 deletions(-)

diff --git a/ebdb-mua.el b/ebdb-mua.el
index 5fb859c..a5b38cf 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -245,6 +245,50 @@ will not operate on your own record.  See also
 (const :tag "Use the value of `message-alternative-emails'" 
message)
 (regexp :tag "Regexp matching your mail addresses")))
 
+(defcustom ebdb-permanent-ignores-file
+  (locate-user-emacs-file ".ebdb-permanent-ignores")
+  "File in which to save a list of permanently-ignored mails.
+EBDB can offer to permanently ignore a mail address, so that it
+will never again be considered for record creation or update.
+This option specifies the file in which to save those mails, or
+nil not to permanently ignore any mail addresses.
+
+Ignored mails are written one per line, with no name or other
+leading/trailing characters."
+  :type '(choice (const :tag "do not save ignored mails" nil)
+(file :tag "file in which to save ignored mails")))
+
+;; Maybe more efficient to make this a buffer instead of a list
+;; variable, and use `search-forward' to find mails instead of
+;; `member'?
+(defvar ebdb-permanently-ignored-mails nil
+  "Variable holding a list of permanently-ignored mails.")
+
+(defun ebdb-mua-load-permanent-ignores ()
+  "Load permanent ignores.
+Reads mail addresses to permanently ignore from the option
+`ebdb-permanent-ignores-file', and stores them in the variable
+`ebdb-permanently-ignored-mails'."
+  (when (and ebdb-permanent-ignores-file
+(file-exists-p ebdb-permanent-ignores-file))
+(with-temp-buffer
+  (insert-file-contents ebdb-permanent-ignores-file)
+  (when (null (zerop (buffer-size)))
+   (setq ebdb-permanently-ignored-mails
+ (split-string (buffer-string) "\n" t "[[:blank:]]"))
+
+(add-hook 'ebdb-after-load-hook #'ebdb-mua-load-permanent-ignores)
+
+(defun ebdb-mua-save-permanent-ignores ()
+  "Write the list of permanently-ignored mails to disk."
+  (when (and ebdb-permanent-ignores-file
+ebdb-permanently-ignored-mails)
+(with-temp-file ebdb-permanent-ignores-file
+  (dolist (m ebdb-permanently-ignored-mails)
+   (insert m "\n")
+
+(add-hook 'ebdb-after-save-hook #'ebdb-mua-save-permanent-ignores)
+
 ;; This is currently only called in `ebdb-mua-test-headers'.
 (defun ebdb-get-user-mail-address-re ()
   "Get or set the value of variable `ebdb-user-mail-address-re'.
@@ -678,7 +722,8 @@ are discarded as appropriate."
   (let ((message-headers (if header-class
  (list (assoc header-class ebdb-message-headers))
ebdb-message-headers))
-address-list mail mail-list content)
+   (mail-list (copy-sequence ebdb-permanently-ignored-mails))
+address-list mail content)
 (condition-case nil
(dolist (headers message-headers)
  (dolist (header (cdr headers))
@@ -688,14 +733,14 @@ are discarded as appropriate."
(setq mail (cadr address))
;; Ignore addresses that should be ignored.
(when (and mail
-  (not (member-ignore-case mail mail-list))
+  (not (member (downcase 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
  ;; one or another header, the order of elements in
  ;; `ebdb-message-headers' is relevant.  The "most important"
  ;; headers should be first in `ebdb-message-headers'.
- (push mail mail-list)
+ (push (downcase mail) mail-list)
  (push (list (car address) (cadr address) header (car headers) 
major-mode) address-list))
   (cl-no-applicable-method
;; Potentia

[elpa] externals/ebdb e1efb02 8/9: Add before-save-hook and after-save-hook

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit e1efb0200ac4cde39de22b8a0694696e9ff58794
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Add before-save-hook and after-save-hook

* ebdb.el (ebdb-before-save-hook, ebdb-after-save-hook): New hooks, as
options.
(ebdb-save): Run them.
---
 ebdb.el | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ebdb.el b/ebdb.el
index f7d03e7..9280474 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -359,6 +359,14 @@ anniversary date, and the sexp (as a string):
   :group 'ebdb
   :type 'hook)
 
+(defcustom ebdb-before-save-hook nil
+  "Hook run before saving all databases."
+  :type 'hook)
+
+(defcustom ebdb-after-save-hook nil
+  "Hook run after saving all databases."
+  :type 'hook)
+
 (defvar ebdb-create-hook nil
   "*Hook run each time a new EBDB record is created.
 Run with one argument, the new record.  This is called before the record is
@@ -5179,9 +5187,11 @@ additionally prompt to save each database individually."
   ;; TODO: Reimplement ebdb-remote-file, or otherwise do something
   ;; about that.
   (when interactive
-   (message "Saving the EBDB..."))
+(message "Saving the EBDB..."))
+  (run-hooks 'ebdb-before-save-hook)
   (dolist (s ebdb-db-list)
 (ebdb-db-save s (eq interactive 4)))
+  (run-hooks 'ebdb-after-save-hook)
   (when interactive
(message "Saving the EBDB... done")))
 



[elpa] externals/ebdb 5d9c9b0 6/9: Add a method for parsing US phone numbers, fix phone parsing

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit 5d9c9b0b0201648d76791e8efa1b3e6e7cda2b00
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Add a method for parsing US phone numbers, fix phone parsing

Fixes #81

* ebdb-i18n-basic.el (ebdb-parse-i18n): New method for pasing US phone
numbers.
* ebdb.el (ebdb-parse): Turn any object creation error into an
ebdb-unparseable error.
(ebdb-parse): Base method for phones should do nothing if the slots
are completely filled out, same as other parsing methods.
---
 ebdb-i18n-basic.el | 25 +
 ebdb.el| 28 
 2 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/ebdb-i18n-basic.el b/ebdb-i18n-basic.el
index 351d11b..24a3856 100644
--- a/ebdb-i18n-basic.el
+++ b/ebdb-i18n-basic.el
@@ -89,6 +89,31 @@
 ("Wyoming" . "WY"))
   "All the states in the US, for use with completion.")
 
+(cl-defmethod ebdb-parse-i18n ((_class (subclass ebdb-field-phone))
+  (str string)
+  (_cc (eql 1))
+  &optional slots)
+  "Parse a US phone number.
+Uses first three digits as the area code, next seven as the
+number, and any remaining as an extension."
+  (let ((numstr (replace-regexp-in-string "[^[:digit:]]+" "" str))
+   ext)
+(setq slots
+ (plist-put
+  (plist-put
+   slots :area-code
+   (string-to-number (substring numstr 0 3)))
+  :number (substring numstr 3 10)))
+(condition-case nil
+   (setq slots (plist-put
+slots
+:extension
+(when (and (setq ext (substring numstr 10))
+   (null (string-empty-p ext)))
+  (string-to-number ext
+  (args-out-of-range nil))
+slots))
+
 (cl-defmethod ebdb-string-i18n ((phone ebdb-field-phone)
(_cc (eql 1)))
   (with-slots (area-code number extension) phone
diff --git a/ebdb.el b/ebdb.el
index ac63a12..f7d03e7 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -870,9 +870,11 @@ Then call `cl-call-next-method' with the new values.")
   (save-match-data
 (cl-call-next-method)))
 
-(cl-defmethod ebdb-parse ((field-class (subclass ebdb-field)) _str &optional 
slots)
+(cl-defmethod ebdb-parse ((field-class (subclass ebdb-field)) str &optional 
slots)
   "Create the actual field instance."
-  (apply 'make-instance field-class slots))
+  (condition-case nil
+  (apply 'make-instance field-class slots)
+(error (signal 'ebdb-unparseable (list str)
 
 (cl-defmethod ebdb-parse :before ((_field-class (subclass ebdb-field)) str 
&optional _slots)
   (when (string-empty-p str)
@@ -1828,17 +1830,19 @@ The result looks like this:
   ;; "number" is saved as a string, partially for ease in
   ;; formatting, partially because if it's too long Emacs turns it
   ;; into a float, which is a pain in the ass.
-  (while (and (< (point) (point-max))
- (null (looking-at-p ext-regexp))
- (looking-at "[ \t]?\\([0-9]+\\)[- .]?"))
-   (setq acc (concat acc (match-string-no-properties 1)))
-   (goto-char (match-end 0)))
-  (when (looking-at ext-regexp)
+  (unless (plist-member slots :number)
+   (while (and (< (point) (point-max))
+   (null (looking-at-p ext-regexp))
+   (looking-at "[ \t]?\\([0-9]+\\)[- .]?"))
+ (setq acc (concat acc (match-string-no-properties 1)))
+ (goto-char (match-end 0)))
(setq slots
- (plist-put slots :extension (string-to-number
-  (match-string 1))
-(setq slots
- (plist-put slots :number acc))
+ (plist-put slots :number acc)))
+  (unless (plist-member slots :number)
+   (when (looking-at ext-regexp)
+ (setq slots
+   (plist-put slots :extension (string-to-number
+(match-string 1)))
 (cl-call-next-method class string slots)))
 
 (cl-defmethod cl-print-object ((phone ebdb-field-phone) stream)



[elpa] externals/ebdb bb0340e 1/9: Stick ebdb-vm.el in its own branch until it's usable

2019-08-13 Thread Eric Abrahamsen
branch: externals/ebdb
commit bb0340ed822283a42c00307eb5e51fc23bdfd4f8
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

Stick ebdb-vm.el in its own branch until it's usable

* ebdb-vm.el: It lives here now.
---
 ebdb-vm.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ebdb-vm.el b/ebdb-vm.el
index 58fc1f1..7ed257c 100644
--- a/ebdb-vm.el
+++ b/ebdb-vm.el
@@ -247,7 +247,7 @@ to search for and LABEL is the label to apply."
   :group 'ebdb-mua-vm
   :type 'list)
 
-(defcustom ebdb/vm-auto-add-label-field ebdb-mail-alias-field
+(defcustom ebdb/vm-auto-add-label-field 'ebdb-mail-alias-field
   "Xfields used by `ebdb/vm-auto-add-label' to automatically label messages.
 This is either a single EBDB xfield or a list of xfields that
 `ebdb/vm-auto-add-label' uses to check for labels to apply to a message.