[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-contacts 74edb70b13 078/154: contrib/lisp/org-conta
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-contacts 74edb70b13 078/154: contrib/lisp/org-contacts.el: Factorize the construction of the database |
Date: |
Fri, 9 Sep 2022 15:58:30 -0400 (EDT) |
branch: externals/org-contacts
commit 74edb70b1350358d4338a67d7b82277ad264f508
Author: Grégoire Jadi <gregoire.jadi@gmail.com>
Commit: Grégoire Jadi <gregoire.jadi@gmail.com>
contrib/lisp/org-contacts.el: Factorize the construction of the database
* contrib/lisp/org-contacts.el (org-contacts-at-point): New function
used to return the contact at point.
(org-contacts-db): Factorize the construction of the database using
`org-contacts-at-point' and fix a small typo.
---
org-contacts.el | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/org-contacts.el b/org-contacts.el
index ac43f9d93b..a7559f75b9 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -250,7 +250,7 @@ to dead or no buffer."
(let* (todo-only
(contacts-matcher
(cdr (org-make-tags-matcher org-contacts-matcher)))
- markers result)
+ result)
(when (org-contacts-db-need-update-p)
(let ((progress-reporter
(make-progress-reporter "Updating Org Contacts Database..." 0
(length org-contacts-files)))
@@ -259,21 +259,26 @@ to dead or no buffer."
(org-check-agenda-file file)
(with-current-buffer (org-get-agenda-file-buffer file)
(unless (eq major-mode 'org-mode)
- (error "File %s is no in `org-mode'" file))
- (org-scan-tags
- '(add-to-list 'markers (set-marker (make-marker) (point)))
- contacts-matcher
- todo-only))
+ (error "File %s is not in `org-mode'" file))
+ (setf result
+ (append result
+ (org-scan-tags
+ 'org-contacts-at-point
+ contacts-matcher
+ todo-only))))
(progress-reporter-update progress-reporter (setq i (1+ i))))
- (dolist (marker markers result)
- (org-with-point-at marker
- (add-to-list 'result
- (list (org-get-heading t) marker (org-entry-properties
marker 'all)))))
(setf org-contacts-db result
org-contacts-last-update (current-time))
- (progress-reporter-done progress-reporter)))
+ (progress-reporter-done progress-reporter)))
org-contacts-db))
+(defun org-contacts-at-point (&optional pom)
+ "Return the contacts at point-or-marker POM or current position
+if nil."
+ (setq pom (or pom (point)))
+ (org-with-point-at pom
+ (list (org-get-heading t) (set-marker (make-marker) pom)
(org-entry-properties pom 'all))))
+
(defun org-contacts-filter (&optional name-match tags-match prop-match)
"Search for a contact matching any of NAME-MATCH, TAGS-MATCH, PROP-MATCH.
If all match values are nil, return all contacts.
- [elpa] externals/org-contacts 0a91557ef9 115/154: Tidy up whitespace, (continued)
- [elpa] externals/org-contacts 0a91557ef9 115/154: Tidy up whitespace, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 00560d5f4f 117/154: Try to support different type of AVATAR property., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 81d9ed977d 138/154: Ensure font-lock after org-mode in company-mode doc-buffer, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 8f008e1b70 131/154: Fix company-mode doc-buffer support with reverse query contact element in all contacts list., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts c8408cf44e 118/154: replace gnus-rescale-image with create-image property :height, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 5d0ecac118 143/154: Update package description., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 8078958995 082/154: contrib: Fix error messages., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 60339bd55f 087/154: Make `org-make-tags-matcher' lexical binding friendly, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 74019274c0 110/154: Update copyright years, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 0af8ca84b4 107/154: org-contacts.el: Display contacts buffer result., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 74edb70b13 078/154: contrib/lisp/org-contacts.el: Factorize the construction of the database,
ELPA Syncer <=
- [elpa] externals/org-contacts 46726d2637 112/154: Don't use deprecated functions, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts f3fa9fc0b8 125/154: use less magic symbol extract code, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 8a074f2a41 133/154: company-mode doc-buffer return customized buffer which support customization, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts aaf9ce8bd0 128/154: Add capf completion properties, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 02ac3ed9d0 150/154: Fix Warning: ‘org-show-context’ is an obsolete function (as of 9.6); use ‘org-fold-show-context’ instead., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 3ea7298670 130/154: Enable company-mode support, ELPA Syncer, 2022/09/09