[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-contacts 00560d5f4f 117/154: Try to support differe
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-contacts 00560d5f4f 117/154: Try to support different type of AVATAR property. |
Date: |
Fri, 9 Sep 2022 15:58:53 -0400 (EDT) |
branch: externals/org-contacts
commit 00560d5f4fbc78098565339039f9cac1b3608a69
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
Try to support different type of AVATAR property.
- Support [[file:dir/filename.png]] link
- Support empty value
- Support default value
---
org-contacts.el | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/org-contacts.el b/org-contacts.el
index 551e1e7aa4..a167ad2e79 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -898,13 +898,24 @@ address."
(setq pom (or pom (point)))
(catch 'icon
;; Use `org-contacts-icon-property'
- (let ((image-data (org-entry-get pom org-contacts-icon-property)))
- (when image-data
+ (let ((image-path (let ((avatar (org-entry-get pom
org-contacts-icon-property))
+ (link-matcher-regexp
"\\[\\[\\([^]]*\\)\\]\\(\\[\\(.*\\)\\]\\)?\\]"))
+ (cond
+ ;; [[file:dir/filename.png]]
+ ((string-match-p "\\[\\[.*\\]\\]" avatar)
+ (when (string-match link-matcher-regexp avatar)
+ (expand-file-name (substring
(match-string-no-properties 1 avatar) 5 nil)
+ (file-name-directory (first
org-contacts-files)))))
+ ;; "" (empty string)
+ ((string-empty-p avatar) nil)
+ (t (expand-file-name avatar (file-name-directory
(first org-contacts-files))))))))
+ (when image-path
(throw 'icon
(if (fboundp 'gnus-rescale-image)
- (gnus-rescale-image (create-image image-data)
+ ;; FIXME `gnus-rescale-image' does not support rescale
`create-image' spec.
+ (gnus-rescale-image (create-image image-path)
(cons org-contacts-icon-size
org-contacts-icon-size))
- (create-image image-data)))))
+ (create-image image-path)))))
;; Next, try Gravatar
(when org-contacts-icon-use-gravatar
(let* ((gravatar-size org-contacts-icon-size)
- [elpa] externals/org-contacts 2de057e423 145/154: Make org-link-set-parameters <- org-add-link-type API compatible., (continued)
- [elpa] externals/org-contacts 2de057e423 145/154: Make org-link-set-parameters <- org-add-link-type API compatible., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 21d4ae5367 141/154: Improve the alternative org-contacts headline goto., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts c1c4cadf3f 151/154: Fix Warning: Unused lexical argument, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts a50ced61ef 093/154: Update tel link definition, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts f02da8b4de 088/154: org-contacts: Register "tel" link, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 80ab4708b7 114/154: Change how completion is done, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 1b028de47c 124/154: Fix contacts complete not working problem, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts b1032119a3 152/154: Fix package-lint warnings., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts d1298f4599 083/154: org-contacts.el: Catch `nextfile' in `org-contacts-db', ELPA Syncer, 2022/09/09
- [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 <=
- [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, 2022/09/09
- [elpa] externals/org-contacts 46726d2637 112/154: Don't use deprecated functions, ELPA Syncer, 2022/09/09