[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 06b0e09 351/449: Update to match new version of B
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 06b0e09 351/449: Update to match new version of BBDB |
Date: |
Fri, 27 Nov 2020 23:16:09 -0500 (EST) |
branch: externals/gnorb
commit 06b0e09a48f009253352a0027e870632388987d6
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Update to match new version of BBDB
Fixes #25
* gnorb-bbdb.el (gnorb-bbdb-display-org-tags,
gnorb-bbdb-display-messages): As part of BBDB's move to lexical
binding, the indent variable, previously dynamically bound, now
comes in as a parameter. Catch that parameter in our
dynamically-composed display functions, and pass it to these two
functions, which do the actual work. There used to be a fmt
variable as well, but that's trivial to recreate.
---
gnorb-bbdb.el | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/gnorb-bbdb.el b/gnorb-bbdb.el
index c7e18d6..b607fec 100644
--- a/gnorb-bbdb.el
+++ b/gnorb-bbdb.el
@@ -20,11 +20,14 @@
;;; Commentary:
-;;
+;; The Gnorb package has no hard dependency on BBDB, so you'll have to
+;; install it manually. Gnorb is compatible with whichever version of
+;; BBDB is current in the Emacs package manager. I believe it comes
+;; from Melpa.
;;; Code:
-(require 'bbdb nil t)
+(require 'bbdb)
(require 'gnorb-utils)
(require 'cl-lib)
@@ -158,8 +161,8 @@ An example value might look like:"
(fset (intern (format "bbdb-display-%s-multi-line"
gnorb-bbdb-org-tag-field))
- (lambda (record)
- (gnorb-bbdb-display-org-tags record))))
+ (lambda (record indent)
+ (gnorb-bbdb-display-org-tags record indent))))
(defun gnorb-bbdb-read-org-tags (&optional init)
"Read Org mode tags, with `completing-read-multiple'."
@@ -184,7 +187,7 @@ An example value might look like:"
(bbdb-split gnorb-bbdb-org-tag-field
(bbdb-read-string "Tags: " init))))
-(defun gnorb-bbdb-display-org-tags (record)
+(defun gnorb-bbdb-display-org-tags (record indent)
"Display the Org tags associated with the record.
Org tags are stored in the `gnorb-bbdb-org-tags-field'."
@@ -194,16 +197,14 @@ Org tags are stored in the `gnorb-bbdb-org-tags-field'."
record
gnorb-bbdb-org-tag-field)))
(when val
- ;; We already know that `fmt' and `indent' are dynamically
- ;; bound, shut up about it.
- (with-no-warnings
- (bbdb-display-text (format fmt gnorb-bbdb-org-tag-field)
- `(xfields ,full-field field-label)
- 'bbdb-field-name)
- (if (consp val)
- (bbdb-display-list val gnorb-bbdb-org-tag-field "\n")
- (insert
- (bbdb-indent-string (concat val "\n") indent)))))))
+ (bbdb-display-text (format (format " %%%ds: " (- indent 3))
+ gnorb-bbdb-org-tag-field)
+ `(xfields ,full-field field-label)
+ 'bbdb-field-name)
+ (if (consp val)
+ (bbdb-display-list val gnorb-bbdb-org-tag-field "\n")
+ (insert
+ (bbdb-indent-string (concat val "\n") indent))))))
(defvar message-mode-hook)
@@ -452,7 +453,7 @@ a prefix arg and \"*\", the prefix arg must come first."
(when (boundp 'bbdb-xfield-label-list)
(add-to-list 'bbdb-xfield-label-list gnorb-bbdb-messages-field nil 'eq))
-(defun gnorb-bbdb-display-messages (record format)
+(defun gnorb-bbdb-display-messages (record format &optional indent)
"Show links to the messages collected in the
`gnorb-bbdb-messages-field' field of a BBDB record. Each link
will be formatted using the format string in
@@ -468,14 +469,13 @@ layout type."
(define-key map (kbd "<RET>") 'gnorb-bbdb-RET-open-link)
(when val
(when (eq format 'multi)
- (with-no-warnings ; For `fmt'
- (bbdb-display-text (format fmt gnorb-bbdb-messages-field)
- `(xfields ,full-field field-label)
- 'bbdb-field-name)))
+ (bbdb-display-text (format (format " %%%ds: " (- indent 3))
+ gnorb-bbdb-messages-field)
+ `(xfields ,full-field field-label)
+ 'bbdb-field-name))
(insert (cond ((and (stringp val)
(eq format 'multi))
- (with-no-warnings ; For `indent'
- (bbdb-indent-string (concat val "\n") indent)))
+ (bbdb-indent-string (concat val "\n") indent))
((listp val)
;; Why aren't I using `bbdb-display-list' with a
;; preformatted list of messages?
@@ -510,8 +510,8 @@ layout type."
(fset (intern (format "bbdb-display-%s-multi-line"
gnorb-bbdb-messages-field))
- (lambda (record)
- (gnorb-bbdb-display-messages record 'multi)))
+ (lambda (record indent)
+ (gnorb-bbdb-display-messages record 'multi indent)))
(fset (intern (format "bbdb-display-%s-one-line"
gnorb-bbdb-messages-field))
- [elpa] externals/gnorb 2783829 322/449: Save return config for quick reply, (continued)
- [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, 2020/11/27
- [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 <=
- [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
- [elpa] externals/gnorb 67edd80 239/449: Use mail-header-references, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb dfa0043 300/449: Safer usage of cl-subseq, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 2d30b0c 310/449: Reset window conf after nnir-run-gnorb, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a59dac2 317/449: Use hook for determining Gnorb summary minor mode, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7fcde77 328/449: Handle renaming of Org variable, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d754d2f 336/449: Fixing `gnorb-bbdb-postings-styles', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 984d5e6 338/449: gnorb-org.el: Don't use nreverse, Stefan Monnier, 2020/11/27