[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 86f288a 331/449: Fix matching of posting styles,
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 86f288a 331/449: Fix matching of posting styles, pt 2 |
Date: |
Fri, 27 Nov 2020 23:16:05 -0500 (EST) |
branch: externals/gnorb
commit 86f288a01327b64c02c7ee10d7e8960c710850f8
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Fix matching of posting styles, pt 2
* gnorb-bbdb.el (gnorb-bbdb-configure-posting-styles): Previous
"solution" was broken.
---
gnorb-bbdb.el | 48 +++++++++++++++++++++++++++---------------------
1 file changed, 27 insertions(+), 21 deletions(-)
diff --git a/gnorb-bbdb.el b/gnorb-bbdb.el
index 35b2ff3..8a52440 100644
--- a/gnorb-bbdb.el
+++ b/gnorb-bbdb.el
@@ -244,7 +244,7 @@ is non-nil (as in interactive calls) be verbose."
(defun gnorb-bbdb-configure-posting-styles (recs)
;; My most magnificent work of copy pasta!
(dolist (r recs)
- (let (field val label rec-val element filep matchp
+ (let (field val label rec-val element filep
element v value results name address)
(dolist (style gnorb-bbdb-posting-styles)
(setq field (pop style)
@@ -255,28 +255,34 @@ is non-nil (as in interactive calls) be verbose."
(unless (fboundp field)
;; what's the record's existing value for this field?
(setq rec-val (bbdb-record-field r field)))
- (when (cond
- ((eq field 'address)
- (dolist (a rec-val matchp)
- (unless (and label
- (not (string-match label (car a))))
- (setq matchp
+ (when (catch 'match
+ (cond
+ ((eq field 'address)
+ (dolist (a rec-val matchp)
+ (unless (and label
+ (not (string-match label (car a))))
+ (when
(string-match-p
val
- (bbdb-format-address-default a))))))
- ((eq field 'phone)
- (dolist (p rec-val matchp)
- (unless (and label
- (not (string-match label (car p))))
- (setq matchp
- (string-match-p val (bbdb-phone-string p))))))
- ((consp rec-val)
- (dolist (f rec-val matchp)
- (setq matchp (string-match-p val f))))
- ((fboundp field)
- (setq matchp (funcall field r)))
- ((stringp rec-val)
- (setq matchp (string-match-p val rec-val))))
+ (bbdb-format-address-default a))
+ (throw 'match)))))
+ ((eq field 'phone)
+ (dolist (p rec-val matchp)
+ (unless (and label
+ (not (string-match label (car p))))
+ (when
+ (string-match-p val (bbdb-phone-string p))
+ (throw 'match)))))
+ ((consp rec-val)
+ (dolist (f rec-val matchp)
+ (when (string-match-p val f)
+ (throw 'catch))))
+ ((fboundp field)
+ (when (matchp (funcall field r))
+ (throw 'catch)))
+ ((stringp rec-val)
+ (when (string-match-p val rec-val)
+ (throw 'match)))))
;; there are matches, run through the field setters in last
;; element of the sexp
(dolist (attribute style)
- [elpa] externals/gnorb 9efae5a 308/449: Fix call to cl-subseq, (continued)
- [elpa] externals/gnorb 9efae5a 308/449: Fix call to cl-subseq, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 160f43a 309/449: New function for returning all tracked messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 3f9c534 312/449: Report Gnorb email tracking usage, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d9a1d89 313/449: Remove unused let variable, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 6fd368d 314/449: Provide more format marks in summary buffers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4e7039a 320/449: Various compiler-inspired improvements, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a387d85 321/449: Bump version to 1.1.0, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2783829 322/449: Save return config for quick reply, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 538b5bd 325/449: Bump version to 1.1.1, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d72fee7 326/449: Redundant setting of window configuration, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 86f288a 331/449: Fix matching of posting styles, pt 2,
Stefan Monnier <=
- [elpa] externals/gnorb b632038 332/449: gnorb-registry.el: Check for old version of registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 894b96c 334/449: Additional guard for non-existent headings, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 73af267 340/449: Remove cruft in gnorb-registry-transition-from-props, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb bd4246d 344/449: Check for live Gnus before following a link, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 0889540 348/449: Refine matching of user email address, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb aa8d041 350/449: Mention 'all option in gnorb-org-mail-scan-scope, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 06b0e09 351/449: Update to match new version of BBDB, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 16931d7 352/449: New utility function gnorb-select-from-list, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c8521d4 156/449: gnorb-org-mail-todos should be nil by default, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb aedf0f2 169/449: Show status of relevant todo when hinting messages, Stefan Monnier, 2020/11/27