[elpa] master d995d75: Fix "Make amount of context around occur matches adjustable"
branch: master commit d995d755edad10b21a36e31bca1c58d2855c74fc Author: Michael Heerdegen Commit: Michael Heerdegen Fix "Make amount of context around occur matches adjustable" Add missing defun `el-search--bounds-of-defun'. --- packages/el-search/el-search.el | 36 1 file changed, 36 insertions(+) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index f1dd8b4..1298e32 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -503,6 +503,42 @@ The non-nil value should be one of the symbols `forward' and "Ignore the arguments and return t." t) +(defun el-search--bounds-of-defun (&optional pos) + "Return (BEG . END) of the top level s-exp covering POS. +POS defaults to point. If no sexp is covering POS, return +nil." + (cl-callf or pos (point)) + (save-restriction +(widen) +(let (defun-beg defun-end) + (cl-flet ((top-level-paren-start + (pos) + (save-excursion + (let ((syntax-at-pos (syntax-ppss pos))) + (and (not (zerop (nth 0 syntax-at-pos))) + (syntax-ppss-toplevel-pos syntax-at-pos)) +(if (setq defun-beg + (or + ;; Iff inside a top-level paren group, this returns the defun beginning + (top-level-paren-start pos) + ;; Iff at the beginning top-level paren group, this succeeds and returns point + (and (not (eobp)) (top-level-paren-start (1+ pos) +(cons defun-beg (scan-sexps defun-beg 1)) + ;; This corner case (not inside any s-exp or current top level s-exp + ;; not a list) is a bit hairy to do with syntax stuff, so let's just + ;; use el-search: + (save-excursion +(goto-char (point-min)) +(setq defun-beg (point-min)) +(setq defun-end (point-min)) +(while (and (<= defun-end pos) +(el-search-forward '_ nil t)) + (setq defun-beg (point)) + (goto-char (setq defun-end (el-search--end-of-sexp +(if (<= defun-beg pos defun-end) +(cons defun-beg defun-end) + nil))) + (defun el-search-with-short-term-memory (function) "Wrap FUNCTION to cache the last arguments/result pair." (let ((cached nil))
[elpa] master 28028d8: Fix replacing matches with nil
branch: master commit 28028d80db3bed25625eb89cbc6749c9171d6556 Author: Michael Heerdegen Commit: Michael Heerdegen Fix replacing matches with nil Replacing PATTERN -> nil replaced with t instead. This commit fixes this. --- packages/el-search/el-search.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index 1298e32..ffe8eda 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -811,7 +811,7 @@ N times." "Like `pcase--macroexpand' but also expanding \"el-search\" patterns." (eval `(el-search--with-additional-pcase-macros (pcase--macroexpand ',pattern -(defun el-search--matcher (pattern &optional result) +(cl-defun el-search--matcher (pattern &optional (result nil result-specified)) (eval ;use `eval' to allow for user defined pattern types at run time (let ((expression (make-symbol "expression"))) `(el-search--with-additional-pcase-macros @@ -820,7 +820,7 @@ N times." (pcase--dontwarn-upats (cons '_ pcase--dontwarn-upats))) (byte-compile (lambda (,expression) (pcase ,expression - (,pattern ,(or result t)) + (,pattern ,(if result-specified result t)) (_nil) (defun el-search--match-p (matcher expression)
[elpa] master 561fc58: Require the new rmc.el lib when available
branch: master commit 561fc58f6eebbc0a29dc8df6856650ca6d9b231d Author: Michael Heerdegen Commit: Michael Heerdegen Require the new rmc.el lib when available --- packages/el-search/el-search.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index ffe8eda..9d10aa4 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -361,7 +361,9 @@ Requirements -(require 'subr-x) ;read-multiple-choice +(eval-when-compile (require 'subr-x)) +(unless (require 'rmc nil t) ;read-multiple-choice + (require 'subr-x)) (require 'cl-lib) (require 'pcase);we want to bind `pcase--dontwarn-upats' before pcase is autoloaded
[elpa] externals/ebdb updated (aac31a3 -> db53550)
girzel pushed a change to branch externals/ebdb. from aac31a3 Add browse-url action for domain fields new 121281d Part one of migration from org-contacts new c56d9e2 Get ebdb-ispell working again new eee0868 Downcase all-completions string when searching new c9acc38 Add ebdb-org-field-tags to ebdb-hash-extra-predicates new fd66ed0 Add optional "shortcut" arg to ebdb-prompt-for-db new 90ff5d1 New MUA command for toggling record layout new d4dbf34 New ebdb-record-change-name methods for strings new d806d7d Compiler-inspired fixes, vol 335534 new 2661406 Use cached record name string in cl-print-object new 59449b9 New defsubst ebdb-record-self new db53550 Protect against bug with timestamp/creation-dates Summary of changes: ebdb-com.el | 7 +--- ebdb-format.el | 7 +++- ebdb-ispell.el | 124 +--- ebdb-migrate.el | 92 + ebdb-mu4e.el| 1 + ebdb-mua.el | 26 +++- ebdb-org.el | 6 +++ ebdb-pgp.el | 2 + ebdb.el | 70 ++-- ebdb.info | 96 +++ ebdb.org| 17 +--- ebdb.texi | 16 +--- 12 files changed, 296 insertions(+), 168 deletions(-)
[elpa] externals/ebdb 59449b9 10/11: New defsubst ebdb-record-self
branch: externals/ebdb commit 59449b9d161e5dd2ee368cb8aeff5a24c3c65b02 Author: Eric Abrahamsen Commit: Eric Abrahamsen New defsubst ebdb-record-self * ebdb.el (ebdb-record-self): Convenience subst for returning the self record. (ebdb-field-phone-signal-text): Use it. * ebdb-mua.el (ebdb-get-user-mail-address-re): Use it. * ebdb-com.el (ebdb-signal-text): Use it. --- ebdb-com.el | 2 +- ebdb-mua.el | 2 +- ebdb.el | 6 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ebdb-com.el b/ebdb-com.el index 449049a..a2aeb36 100644 --- a/ebdb-com.el +++ b/ebdb-com.el @@ -2638,7 +2638,7 @@ message." (interactive (list (or (and ebdb-record-self (ebdb-signal-get-number - (ebdb-gethash ebdb-record-self 'uuid) + (ebdb-record-self) t)) (ebdb-read-string "Number to send from (or set `ebdb-record-self'): ")) diff --git a/ebdb-mua.el b/ebdb-mua.el index d2cc931..a33eb4e 100644 --- a/ebdb-mua.el +++ b/ebdb-mua.el @@ -223,7 +223,7 @@ accordingly." (cond ((stringp ebdb-user-mail-address-re) ebdb-user-mail-address-re) ((eq ebdb-user-mail-address-re 'self) -(let ((self-rec (ebdb-gethash ebdb-record-self 'uuid))) +(let ((self-rec (ebdb-record-self))) (unless self-rec (user-error "`ebdb-user-mail-address-re' set to 'self, but `ebdb-record-self' is not set.")) (setq ebdb-user-mail-address-re diff --git a/ebdb.el b/ebdb.el index bc91c72..3fc86bb 100644 --- a/ebdb.el +++ b/ebdb.el @@ -500,6 +500,10 @@ It takes one argument, the name as extracted by :group 'ebdb-utilities :type 'function) +(defsubst ebdb-record-self () + "Return the \"self\" record" + (ebdb-gethash ebdb-record-self 'uuid)) + ;;; Record editing (defcustom ebdb-default-separator '("[,;]" ", ") @@ -4320,7 +4324,7 @@ command's docstring for more details." (let ((sender (or (and ebdb-record-self (ebdb-signal-get-number - (ebdb-gethash ebdb-record-self 'uuid) + (ebdb-record-self) t)) (ebdb-read-string "Number to send from (or set `ebdb-record-self'): ")))
[elpa] externals/ebdb c56d9e2 02/11: Get ebdb-ispell working again
branch: externals/ebdb commit c56d9e26ae58b479088b0d70a22f71ae6afc9f41 Author: Eric Abrahamsen Commit: Eric Abrahamsen Get ebdb-ispell working again * ebdb-ispell.el (ebdb-ispell-dictionary-list): Remove variable. Maybe I'm misunderstanding how this worked, but why were we looping over _other_ dictionaries? The previous version as written also errored out, unable to find the personal dictionary. Simplify the whole thing: just check the word, and add it if it's "misspelled". (ebdb-ispell-field-list): Remove variable. Just loop all the names. (ebdb-ispell-word-list): Remove variable. Have the function return the word list instead of setting this variable. (ebdb-ispell-export): Simplify function. --- ebdb-ispell.el | 124 ++--- 1 file changed, 56 insertions(+), 68 deletions(-) diff --git a/ebdb-ispell.el b/ebdb-ispell.el index a42b3c0..ff79d6a 100644 --- a/ebdb-ispell.el +++ b/ebdb-ispell.el @@ -26,22 +26,7 @@ (require 'ispell) (require 'ebdb) -(defcustom ebdb-ispell-dictionary-list '("default") - "List of ispell personal dictionaries. -Allowed elements are as in the return value of `ispell-valid-dictionary-list'." - :group 'ebdb-utilities-ispell - :type (cons 'set (mapcar (lambda (dict) `(string ,dict)) - (ispell-valid-dictionary-list - -(defcustom ebdb-ispell-field-list '(name organization aka) - "List of fields of each EBDB record considered for the personal dictionary." - :group 'ebdb-utilities-ispell - :type (list 'repeat - (append '(choice) (mapcar (lambda (field) `(const ,field)) -'(name organization affix aka address)) - '((symbol :tag "xfield") - -(defcustom ebdb-ispell-min-word-length 3 +(defcustom ebdb-ispell-min-word-length 2 "Words with fewer characters are ignored." :group 'ebdb-utilities-ispell :type 'number) @@ -51,62 +36,65 @@ Allowed elements are as in the return value of `ispell-valid-dictionary-list'." :group 'ebdb-utilities-ispell :type 'regexp) -;; Internal variable -(defvar ebdb-ispell-word-list nil - "List of words extracted from the EBDB records.") - ;;;###autoload (defun ebdb-ispell-export () "Export EBDB records to ispell personal dictionaries." (interactive) - (message "Exporting to personal dictionary...") - (let (ebdb-ispell-word-list) -;; Collect words from EBDB records. -(dolist (record (ebdb-records)) - (dolist (field ebdb-ispell-field-list) -(ebdb-ispell-collect-words (ebdb-record-field record field - -;; Update personal dictionaries -(dolist (dict (or ebdb-ispell-dictionary-list '("default"))) - (ispell-change-dictionary dict) - ;; Initialize variables and dicts alists - (ispell-set-spellchecker-params) - (ispell-init-process) - ;; put in verbose mode - (ispell-send-string "%\n") - (let (new) -(dolist (word (delete-dups ebdb-ispell-word-list)) - (ispell-send-string (concat "^" word "\n")) - (while (progn - (ispell-accept-output) - (not (string= "" (car ispell-filter) - ;; remove extra \n - (setq ispell-filter (cdr ispell-filter)) - (when (and ispell-filter - (listp ispell-filter) - (not (eq (ispell-parse-output (car ispell-filter)) t))) -;; ok the word doesn't exist, add it -(ispell-send-string (concat "*" word "\n")) -(setq new t))) -(when new - ;; Save dictionary: - ;; aspell doesn't tell us when it completed the saving. - ;; So we send it another word for spellchecking. - (ispell-send-string "#\n^hello\n") - (while (progn - (ispell-accept-output) - (not (string= "" (car ispell-filter) - (message "Exporting to personal dictionary...done")) - -(defun ebdb-ispell-collect-words (field) - "Parse EBDB FIELD and collect words in `ebdb-ispell-word-list'." - ;; Ignore everything in FIELD that is not a string or a sequence. - (cond ((stringp field) - (dolist (word (split-string field)) - (if (and (>= (length word) ebdb-ispell-min-word-length) -(not (string-match ebdb-ispell-ignore-re word))) - (push word ebdb-ispell-word-list -((sequencep field) (mapc 'ebdb-ispell-collect-words field + (message "Exporting 0 words to personal dictionary...") + ;; Collect words from EBDB records. + (let ((word-list +(seq-mapcat + (lambda (r) + (ebdb-ispell-collect-words +(cons (ebdb-record-name r) + (ebdb-record-alt-names r + (ebdb-records))) + (count 0)) + +;; Initialize variables and dicts alists +(ispell-set-spellchecker-params) +(ispell-init-process) +
[elpa] externals/ebdb 121281d 01/11: Part one of migration from org-contacts
branch: externals/ebdb commit 121281df91a8a37a66afd72d03f395879d774f81 Author: Eric Abrahamsen Commit: Eric Abrahamsen Part one of migration from org-contacts * ebdb-migrate.el (ebdb-migrate-org-simple-correspondences): Variable holding correspondences between org-contacts property names and EBDB field types. (ebdb-migrate-from-org-contacts): Do the migration. Fails to migrate addresses at present; this needs to be addressed. * ebdb-migrate.el (ebdb-migrate-from-bbdb): Change messages to specify BBDB. --- ebdb-migrate.el | 84 ++--- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/ebdb-migrate.el b/ebdb-migrate.el index 5c30636..f1d1a0b 100644 --- a/ebdb-migrate.el +++ b/ebdb-migrate.el @@ -26,10 +26,24 @@ (require 'ebdb) (autoload 'calendar-absolute-from-gregorian "calendar") +(autoload 'calendar-gregorian-from-absolute "calendar") +(autoload 'org-time-string-to-absolute "org") (declare-function make-gnorb-ebdb-link "ext:gnorb-ebdb") +(declare-function org-contacts-db "ext:org-contacts") (defvar url-handler-regexp) ;;; Migrating the EBDB +;; For org-contacts + +(defvar org-contacts-email-property) +(defvar org-contacts-alias-property) +(defvar org-contacts-tel-property) +(defvar org-contacts-address-property) +(defvar org-contacts-birthday-property) +(defvar org-contacts-note-property) +(defvar org-contacts-icon-property) +(defvar org-contacts-nickname-property) + ;; Unused (defconst ebdb-migration-features '((3 . "* Date format for `creation-date' and `timestamp' has changed, @@ -395,7 +409,7 @@ BBDB sets the default of that option." (ebdb-prompt-for-db))) (total 0) c-records duds) - (message "Migrating records...") + (message "Migrating records from BBDB...") (dolist (r v-records) (condition-case-unless-debug err (let ((orgs (ebdb-vrecord-organization r)) @@ -427,7 +441,7 @@ BBDB sets the default of that option." (unless (member org c-records) (push org c-records) (push c-rec c-records) - (message "Migrating records... %d" (cl-incf total))) + (message "Migrating records from BBDB... %d" (cl-incf total))) (error (push (list r err) duds (when duds @@ -445,7 +459,7 @@ BBDB sets the default of that option." (dolist (r c-records) (ebdb-init-record r)) (eieio-oset target-db 'dirty t) - (message "Migrating records... %d records migrated" + (message "Migrating records from BBDB... %d records migrated" (length c-records)) (defun ebdb-migrate-vector-to-class (v) @@ -658,5 +672,69 @@ BBDB sets the default of that option." records +(defvar ebdb-migrate-org-simple-correspondences + '((org-contacts-email-property . ebdb-default-mail-class) +(org-contacts-tel-property . ebdb-default-phone-class) +(org-contacts-note-property . ebdb-default-notes-class) +(org-contacts-nickname-property . ebdb-field-name-simple) +(org-contacts-alias-property . ebdb-default-name-class)) + "The simplest property-to-field correspondences. +This variable only holds correspondences for fields that require +no processing beyond calling `ebdb-parse' on the string values.") + +;;;###autoload +(defun ebdb-migrate-from-org-contacts () + "Migrate contacts from the org-contacts format." + (interactive) + (require 'org-contacts) + (unless ebdb-sources +(error "First set `ebdb-sources' to the location of your EBDB database.")) + (let ((db (ebdb-prompt-for-db)) + ;; Postpone evaluation of the symbols until run time. + (prop-fields +(mapcar + (pcase-lambda (`(,prop . ,class)) + (cons (symbol-value prop) + (if (class-p class) class (symbol-value class + ebdb-migrate-org-simple-correspondences)) + (count 0) + (address-buffer (get-buffer-create "*EBDB Migration Addresses*")) + record records f) +(with-current-buffer address-buffer + (erase-buffer)) +(message "Migrating records from org-contacts... %d records" count) +(pcase-dolist (`(,name ,_ ,fields) (org-contacts-db)) + (setq record (make-instance ebdb-default-record-class)) + (ebdb-record-change-name record name) + (dolist (field fields) + (setq f + (if (assoc-string (car field) prop-fields) + (ebdb-parse (cdr (assoc-string (car field) prop-fields)) + (cdr field)) + (pcase (car field) + ((pred (equal org-contacts-address-property)) + (with-current-buffer address-buffer +(insert (format "%s: %s\n" name (cdr field) + ((pred (equal org-contacts-birthday-property)) + (make-instan
[elpa] externals/ebdb d4dbf34 07/11: New ebdb-record-change-name methods for strings
branch: externals/ebdb commit d4dbf340137b04d4c8354e3a4f82e2c41e06d2c1 Author: Eric Abrahamsen Commit: Eric Abrahamsen New ebdb-record-change-name methods for strings * ebdb.el (ebdb-record-change-name): One for people and organizations. I think I was failing this before because I was trying to call cl-call-next-method, when I should have been restarting the method call altogether. * ebdb-mua.el (ebdb-annotate-message): Now we don't need to know the record class. --- ebdb-mua.el | 12 +++- ebdb.el | 10 ++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ebdb-mua.el b/ebdb-mua.el index 3746d37..33130d6 100644 --- a/ebdb-mua.el +++ b/ebdb-mua.el @@ -815,9 +815,6 @@ Return the records matching ADDRESS or nil." (record-class (if (eql (nth 3 address) 'organization) 'ebdb-record-organization ebdb-default-record-class)) -(name-class (if (eql record-class 'ebdb-record-organization) -'ebdb-field-name-simple - ebdb-default-name-class)) (records (ebdb-message-search name mail)) created-p new-records) (if (and (not records) (functionp update-p)) @@ -855,8 +852,7 @@ Return the records matching ADDRESS or nil." ;; Analyze the name part of the record. (cond (created-p ; new record - (ebdb-record-change-name - record (ebdb-parse name-class name))) + (ebdb-record-change-name record name)) ((or (not name) ;; The following tests can differ for more complicated names @@ -887,8 +883,7 @@ Return the records matching ADDRESS or nil." (format "Keep name \"%s\" as an AKA? " old-name)) (ebdb-record-insert-field record (slot-value record 'name) 'aka))) - (ebdb-record-change-name - record (ebdb-parse name-class name)) + (ebdb-record-change-name record name) (setq change-p 'name)) ;; make new name an AKA? @@ -953,8 +948,7 @@ Return the records matching ADDRESS or nil." (progn (setq record (make-instance ebdb-default-record-class)) (ebdb-db-add-record (car ebdb-db-list) record) - (ebdb-record-change-name - record (ebdb-parse name-class name)) + (ebdb-record-change-name record name) (setq created-p t (let ((mails (ebdb-record-mail record))) diff --git a/ebdb.el b/ebdb.el index f9a12a8..1c9249a 100644 --- a/ebdb.el +++ b/ebdb.el @@ -3147,6 +3147,11 @@ priority." (push `(organizations . ,o) f-list))) (cl-call-next-method record f-list all)) +(cl-defmethod ebdb-record-change-name ((record ebdb-record-person) + (name-string string)) + (let ((name (ebdb-parse ebdb-default-name-class name-string))) +(ebdb-record-change-name record name))) + (cl-defmethod ebdb-record-related ((_record ebdb-record-person) (field ebdb-field-relation)) (or @@ -3316,6 +3321,11 @@ priority." '((domain . ebdb-field-domain)) alist))) +(cl-defmethod ebdb-record-change-name ((record ebdb-record-organization) + (name-string string)) + (let ((name (ebdb-parse ebdb-field-name-simple name-string))) +(ebdb-record-change-name record name))) + (cl-defmethod ebdb-record-current-fields ((record ebdb-record-organization) &optional f-list all) (with-slots (name domain) record
[elpa] externals/ebdb 2661406 09/11: Use cached record name string in cl-print-object
branch: externals/ebdb commit 2661406dfdd4e7ed9aa17c1e7191c882f80ad7b2 Author: Eric Abrahamsen Commit: Eric Abrahamsen Use cached record name string in cl-print-object * ebdb.el (cl-print-object): Don't recalculate. --- ebdb.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebdb.el b/ebdb.el index c029918..bc91c72 100644 --- a/ebdb.el +++ b/ebdb.el @@ -2780,7 +2780,7 @@ only return fields that are suitable for user editing.") (cl-defmethod cl-print-object ((record ebdb-record) stream) (princ (format "#<%S %s>" (eieio-object-class-name record) -(ebdb-string record)) +(ebdb-record-name record)) stream)) (cl-defgeneric ebdb-record-related (record field)
[elpa] externals/ebdb 90ff5d1 06/11: New MUA command for toggling record layout
branch: externals/ebdb commit 90ff5d184a5127fa4778761b285c10cd844c809e Author: Eric Abrahamsen Commit: Eric Abrahamsen New MUA command for toggling record layout * ebdb-mua.el (ebdb-mua-toggle-records-format): New command to toggle layout from MUA windows. (ebdb-mua-keymap): Bind to "; t". * ebdb.org: Document. --- ebdb-mua.el | 10 +++ ebdb.info | 96 + ebdb.org| 17 +++ ebdb.texi | 16 +++ 4 files changed, 85 insertions(+), 54 deletions(-) diff --git a/ebdb-mua.el b/ebdb-mua.el index f84c3ee..3746d37 100644 --- a/ebdb-mua.el +++ b/ebdb-mua.el @@ -1139,6 +1139,15 @@ where it was in the MUA, rather than quitting the EBDB buffer." [?q])) ;;;###autoload +(defun ebdb-mua-toggle-records-format () + "Toggle format of all records without leaving MUA." + (interactive) + (let ((buf (get-buffer (ebdb-make-buffer-name +(when buf + (with-current-buffer buf + (ebdb-toggle-records-format ebdb-records) + +;;;###autoload (defun ebdb-mua-edit-sender-notes () "Edit the notes field of the EBDB record of the message sender." (interactive) @@ -1278,6 +1287,7 @@ along with the MUA window(s), displaying the matching records." (define-key km (kbd "'") #'ebdb-mua-edit-sender-notes) (define-key km (kbd "\"") #'ebdb-mua-in-ebdb-buffer) (define-key km (kbd "s") #'ebdb-mua-snarf-article) +(define-key km (kbd "t") #'ebdb-mua-toggle-records-format) km) "Common keymap for calling EBDB commands in an MUA. diff --git a/ebdb.info b/ebdb.info index dbfa57d..dfc75a6 100644 --- a/ebdb.info +++ b/ebdb.info @@ -721,6 +721,10 @@ binding, and only specifies the further binding. Ie, press “;:” to call before edits are made. This functionality is highly unreliable, and probably won’t work as advertised. +‘t’ + This command toggles the displayed records between the multiline + and oneline display formats. + Other command are not bound by default: -- Command: ebdb-mua-yank-cc @@ -1881,17 +1885,21 @@ Index * Menu: * !: Searching. (line 49) -* ": Interactive Commands. +* / /: Searching. (line 6) +* ;: The Basics of ebdb-mode. + (line 41) +* ; ": Interactive Commands. (line 26) -* ': Interactive Commands. +* ; ': Interactive Commands. (line 22) -* / /: Searching. (line 6) -* :: Interactive Commands. +* ; :: Interactive Commands. (line 13) -* ;: Interactive Commands. +* ; ;: Interactive Commands. (line 18) -* ; <1>: The Basics of ebdb-mode. - (line 41) +* ; s: Interactive Commands. + (line 33) +* ; t: Interactive Commands. + (line 42) * ?: The Basics of ebdb-mode. (line 102) * ^: Searching. (line 55) @@ -2030,13 +2038,13 @@ Index * ebdb-mua-auto-update-p:Auto-Updating Records. (line 10) * ebdb-mua-display-all-recipients: Interactive Commands. - (line 55) + (line 59) * ebdb-mua-display-all-records: Interactive Commands. (line 18) * ebdb-mua-display-recipients: Interactive Commands. - (line 52) + (line 56) * ebdb-mua-display-sender: Interactive Commands. - (line 49) + (line 53) * ebdb-mua-edit-sender-notes:Interactive Commands.
[elpa] externals/ebdb db53550 11/11: Protect against bug with timestamp/creation-dates
branch: externals/ebdb commit db53550d813b205146b2a104a6ca4c5b90c97c43 Author: Eric Abrahamsen Commit: Eric Abrahamsen Protect against bug with timestamp/creation-dates The real solution will involve fixing initialize-instance for records so that the timestamp/creation-date are installed no matter what. * ebdb-format.el (ebdb-fmt-collect-fields): Stop-gap protection against missing creation-date and timestamp fields. * ebdb.el: Bump to 0.3.5 --- ebdb-format.el | 7 ++- ebdb.el| 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ebdb-format.el b/ebdb-format.el index 0ef16cf..e17fa29 100644 --- a/ebdb-format.el +++ b/ebdb-format.el @@ -250,7 +250,12 @@ FIELD-STRING1 FIELD-STRING2 ..)." field-list (mapcar #'cdr (seq-remove - (lambda (elt) (eql (car elt) 'name)) + ;; The or (null (cdr elt)) is there to + ;; protect against an earlier bug with + ;; timestamps and creation-dates, it could + ;; be removed at some point. + (lambda (elt) (or (eql (car elt) 'name) + (null (cdr elt (ebdb-record-current-fields record nil t) f-class) (with-slots (exclude include) fmt diff --git a/ebdb.el b/ebdb.el index 3fc86bb..26c3b67 100644 --- a/ebdb.el +++ b/ebdb.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2016-2017 Free Software Foundation, Inc. -;; Version: 0.3.4 +;; Version: 0.3.5 ;; Package-Requires: ((emacs "25.1") (cl-lib "0.5") (seq "2.15")) ;; Maintainer: Eric Abrahamsen
[elpa] externals/ebdb c9acc38 04/11: Add ebdb-org-field-tags to ebdb-hash-extra-predicates
branch: externals/ebdb commit c9acc38259880e08c355cc5aed8ff18cc27fd366 Author: Eric Abrahamsen Commit: Eric Abrahamsen Add ebdb-org-field-tags to ebdb-hash-extra-predicates * ebdb-org.el: Use the fast lookups for this field, too. --- ebdb-org.el | 6 ++ 1 file changed, 6 insertions(+) diff --git a/ebdb-org.el b/ebdb-org.el index 4cbfeae..6a76b8b 100644 --- a/ebdb-org.el +++ b/ebdb-org.el @@ -122,6 +122,12 @@ italicized, in all other cases it is left unchanged." nil :human-readable "org tags") +;; Use fast lookups on org-tags, too. +(cl-pushnew (cons 'ebdb-org-field-tags + (lambda (str rec) + (ebdb-record-search rec 'ebdb-org-field-tags str))) + ebdb-hash-extra-predicates) + (cl-defmethod ebdb-read ((field (subclass ebdb-org-field-tags)) &optional slots obj) (let* ((crm-separator (cadr (assq 'ebdb-field-tags ebdb-separator-alist))) (val (completing-read-multiple
[elpa] externals/ebdb d806d7d 08/11: Compiler-inspired fixes, vol 335534
branch: externals/ebdb commit d806d7da0d5dfc5618c1db4a5f64e7f90b3f3e72 Author: Eric Abrahamsen Commit: Eric Abrahamsen Compiler-inspired fixes, vol 335534 Where "compiler" is understood to mean "Stefan" * ebdb-migrate.el (ebdb-migrate-from-bbdb, ebdb-migrate-vector-to-class): Get rid of remaining usages of oset. * ebdb-mu4e.el: Declare functions from message.el * ebdb-mua.el (ebdb-delete-field): Note unused argument. * ebdb-pgp.el: Declare function from ebdb-mua. * ebdb.el (ebdb-sources): Change default and type of ebdb-sources. --- ebdb-migrate.el | 4 ++-- ebdb-mu4e.el| 1 + ebdb-mua.el | 2 +- ebdb-pgp.el | 2 ++ ebdb.el | 18 -- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ebdb-migrate.el b/ebdb-migrate.el index 0375757..fa48d7a 100644 --- a/ebdb-migrate.el +++ b/ebdb-migrate.el @@ -456,7 +456,7 @@ BBDB sets the default of that option." (goto-char (point-min))) (dolist (r c-records) (ebdb-init-record r)) - (eieio-oset target-db 'dirty t) + (setf (slot-value target-db 'dirty) t) (message "Migrating records from BBDB... %d records migrated" (length c-records)) @@ -530,7 +530,7 @@ BBDB sets the default of that option." :mail (cadr bits)) mails (when mails - (oset (car (last mails)) priority 'primary))) + (setf (slot-value (car (last mails)) 'priority) 'primary))) (when xfields (dolist (x xfields) (setq lab (car x) diff --git a/ebdb-mu4e.el b/ebdb-mu4e.el index 04fd715..dc87fef 100644 --- a/ebdb-mu4e.el +++ b/ebdb-mu4e.el @@ -29,6 +29,7 @@ (defvar mu4e~view-buffer-name) (defvar mu4e-view-mode-map) +(declare-function message-field-value "message") ;; Tackle `mu4e-headers-mode' later diff --git a/ebdb-mua.el b/ebdb-mua.el index 33130d6..d2cc931 100644 --- a/ebdb-mua.el +++ b/ebdb-mua.el @@ -543,7 +543,7 @@ variable should be set before EBDB is loaded.") (cl-call-next-method)) (cl-defmethod ebdb-delete-field ((f ebdb-field-mail-folder) -&optional record unload) +&optional record _unload) (when record (let* ((folder (slot-value f 'folder)) (mails (mapcar #'regexp-quote (ebdb-record-mail-canon record))) diff --git a/ebdb-pgp.el b/ebdb-pgp.el index 0dc7fa3..cad93a0 100644 --- a/ebdb-pgp.el +++ b/ebdb-pgp.el @@ -28,6 +28,8 @@ (require 'message) (require 'ebdb-com) +(declare-function ebdb-mua-message-header "ebdb-mua") + (defcustom ebdb-pgp-default-action nil "Default action when sending a message and the recipients are not in EBDB. This should be one of the following symbols: diff --git a/ebdb.el b/ebdb.el index 1c9249a..c029918 100644 --- a/ebdb.el +++ b/ebdb.el @@ -109,18 +109,24 @@ See also `ebdb-silent'.") "Options for an EIEIO version of EBDB." :group 'ebdb) -(defcustom ebdb-sources "~/.emacs.d/ebdb" - "User option specifying where EBDB contacts should be loaded -from. It can be a single element, or a list of multiple -elements. If an element is a string, it is treated as a -filename, and used to create an instance of `ebdb-db-file'. +(defcustom ebdb-sources (locate-user-emacs-file "ebdb") + "User option specifying EBDB database sources. +It can be a single element, or a list of elements. If an element +is a string, it is treated as a filename, and used to create an +instance of `ebdb-db-file'. Elements can also be instances of subclasses of `ebdb-db'. Currently, the only subclass is `ebdb-db-file', though you can create your own. When EBDB is loaded, the `ebdb-db-load' method will be called on each of class instances." :group 'ebdb-eieio - :type 'string) + ;; Apparently we can't specify EBDB objects here. + :type '(choice (file :tag "File") + ; (ebdb-db :tag "EBDB database instance") +(repeat (file :tag "File") + ;; (choice (file :tag "File") + ;; (ebdb-db :tag "EBDB database instance")) + ))) (defcustom ebdb-auto-merge-records nil "If t, EBDB will automatically merge multiple records with the
[elpa] externals/ebdb eee0868 03/11: Downcase all-completions string when searching
branch: externals/ebdb commit eee0868f2e528fdf9871f921a0ec1f0915154512 Author: Eric Abrahamsen Commit: Eric Abrahamsen Downcase all-completions string when searching * ebdb.el (ebdb-search): ebdb-puthash downcases its strings, so downcase the strings when doing all-completions, too. Actually, maybe we shouldn't be downcasing strings on hash -- is that leftover from when the hashtable was actually an obarray? --- ebdb.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ebdb.el b/ebdb.el index ff948db..65fc15f 100644 --- a/ebdb.el +++ b/ebdb.el @@ -5189,7 +5189,8 @@ string must be a prefix of the sought string." (stringp crit) (string-prefix-p "^" crit) (setq completed-strings - (all-completions (substring crit 1) ebdb-hashtable) + (all-completions (downcase (substring crit 1)) +ebdb-hashtable) recs (delq nil (apply
[elpa] externals/ebdb fd66ed0 05/11: Add optional "shortcut" arg to ebdb-prompt-for-db
branch: externals/ebdb commit fd66ed012e6dd85469e37a33bbadb46b867fdfe1 Author: Eric Abrahamsen Commit: Eric Abrahamsen Add optional "shortcut" arg to ebdb-prompt-for-db * ebdb.el (ebdb-prompt-for-db): If non-nil and there's only one database, just return it without prompting. * ebdb-migrate.el (ebdb-migrate-from-bbdb): Adjust call. * ebdb-com.el (ebdb-create-record-extended): Adjust call. --- ebdb-com.el | 5 + ebdb-migrate.el | 4 +--- ebdb.el | 29 ++--- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/ebdb-com.el b/ebdb-com.el index 4e31108..449049a 100644 --- a/ebdb-com.el +++ b/ebdb-com.el @@ -1573,10 +1573,7 @@ in `ebdb-db-list', using its default record class. Use ;;;###autoload (defun ebdb-create-record-extended () (interactive) - (let ((db -(if (= 1 (length ebdb-db-list)) -(car ebdb-db-list) - (ebdb-prompt-for-db))) + (let ((db (ebdb-prompt-for-db nil t)) (record-class (eieio-read-subclass "Use which record class? " 'ebdb-record nil t))) (ebdb-create-record db record-class))) diff --git a/ebdb-migrate.el b/ebdb-migrate.el index f1d1a0b..0375757 100644 --- a/ebdb-migrate.el +++ b/ebdb-migrate.el @@ -404,9 +404,7 @@ BBDB sets the default of that option." (when (and (/= (point-min) (point-max)) (yes-or-no-p "Upgrade from previous version of BBDB? ")) (let ((v-records (ebdb-migrate-parse-records)) - (target-db (if (= (length ebdb-db-list) 1) - (car ebdb-db-list) -(ebdb-prompt-for-db))) + (target-db (ebdb-prompt-for-db nil t)) (total 0) c-records duds) (message "Migrating records from BBDB...") diff --git a/ebdb.el b/ebdb.el index 65fc15f..f9a12a8 100644 --- a/ebdb.el +++ b/ebdb.el @@ -4118,19 +4118,26 @@ Returns a list of (\"label\" slot . field-class)." (or (assoc choice field-list) (list choice (cons 'fields 'ebdb-field-user-simple) -(defun ebdb-prompt-for-db (&optional db-list) +(defun ebdb-prompt-for-db (&optional db-list shortcut) + "Prompt the user to choose a database. +Possible choices come from `ebdb-db-list', or from DB-LIST, if +that argument is given. If SHORTCUT is non-nil, don't bother +prompting if there's only one database." (unless (or db-list ebdb-db-list) (ebdb-load)) - (let* ((collection (or db-list ebdb-db-list)) -(db-string - (ebdb-read-string "Choose a database: " - nil - (mapcar -(lambda (d) - (slot-value d 'object-name)) -collection) - t))) -(object-assoc db-string 'object-name collection))) + (let ((collection (or db-list ebdb-db-list)) + db-string) +(if (and shortcut (= 1 (length collection))) + (car collection) + (setq db-string + (ebdb-read-string "Choose a database: " + nil + (mapcar + (lambda (d) +(slot-value d 'object-name)) + collection) + t)) + (object-assoc db-string 'object-name collection (defun ebdb-prompt-for-mail (record) (let ((mail-alist (mapcar