[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-contacts 9bd8101c56 059/154: contrib/lisp/org-conta
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-contacts 9bd8101c56 059/154: contrib/lisp/org-contacts: Introduce the constant `org-contacts-property-values-separators' |
Date: |
Fri, 9 Sep 2022 15:58:26 -0400 (EDT) |
branch: externals/org-contacts
commit 9bd8101c56e72ae32421cbd27a3abebee3718fb6
Author: Michael Strey <mstrey@strey.biz>
Commit: Grégoire Jadi <gregoire.jadi@gmail.com>
contrib/lisp/org-contacts: Introduce the constant
`org-contacts-property-values-separators'
* contrib/lisp/org-contacts.el (org-contacts-property-values-separators):
Definition of a new constant that will be used as default value of
separators for `org-contacts-split-property'.
* contrib/lisp/org-contacts.el (org-contacts-vcard-format): We are now
using the default separator in general.
* contrib/lisp/org-contacts.el (org-contacts-show-map): Line break
corrected.
* contrib/lisp/org-contacts.el (org-contacts-split-property): Correct
the comment describing the function. Application of the newly
defined constant `org-contacts-property-values-separators'.
---
org-contacts.el | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/org-contacts.el b/org-contacts.el
index eb3fc090e8..84ebc9dd3d 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -174,6 +174,11 @@ This overrides `org-email-link-description-format' if set."
(declare-function std11-narrow-to-header "ext:std11")
(declare-function std11-fetch-field "ext:std11")
+(defconst org-contacts-property-values-separators "[,; \f\t\n\r\v]+"
+ "The default value of separators for `org-contacts-split-property'.
+
+A regexp matching strings of whitespace, `,' and `;'.")
+
(defvar org-contacts-keymap
(let ((map (make-sparse-keymap)))
(define-key map "M" 'org-contacts-view-send-email)
@@ -850,7 +855,7 @@ to do our best."
(head (format "BEGIN:VCARD\nVERSION:3.0\nN:%s\nFN:%s\n" n name)))
(concat head
(when email (progn
- (setq emails-list (org-contacts-split-property email
"[,; ]+"))
+ (setq emails-list (org-contacts-split-property email))
(setq result "")
(while emails-list
(setq result (concat result "EMAIL:"
(org-contacts-strip-link (car emails-list)) "\n"))
@@ -859,7 +864,7 @@ to do our best."
(when addr
(format "ADR:;;%s\n" (replace-regexp-in-string "\\, ?" ";" addr)))
(when tel (progn
- (setq phones-list (org-contacts-split-property tel "[,;
]+"))
+ (setq phones-list (org-contacts-split-property tel))
(setq result "")
(while phones-list
(setq result (concat result "TEL:"
(org-contacts-strip-link (car phones-list)) "\n"))
@@ -912,7 +917,8 @@ Requires google-maps-el."
collect (cons (list addr) (list :label (string-to-char (car contact)))))))
(defun org-contacts-strip-link (link)
- "Remove brackets, description, link type and colon from an org link string
and return the pure link target."
+ "Remove brackets, description, link type and colon from an org
+link string and return the pure link target."
(let (startpos colonpos endpos)
(setq startpos (string-match (regexp-opt '("[[tel:" "[[mailto:")) link))
(if startpos
@@ -935,16 +941,16 @@ splitting points. The substrings matching SEPARATORS are
removed, and
the substrings between the splitting points are collected as a list,
which is returned.
-If SEPARATORS is non-nil, it should be a regular expression matching text
-which separates, but is not part of, the substrings. If nil it defaults to
-`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
-OMIT-NULLS is forced to t.
+If SEPARATORS is non-nil, it should be a regular expression
+matching text which separates, but is not part of, the
+substrings. If nil it defaults to `org-contacts-property-values-separators',
+normally \"[,; \f\t\n\r\v]+\", and OMIT-NULLS is forced to t.
If OMIT-NULLS is t, zero-length substrings are omitted from the list \(so
that for the default value of SEPARATORS leading and trailing whitespace
are effectively trimmed). If nil, all zero-length substrings are retained."
(let* ((keep-nulls (or nil omit-nulls))
- (rexp (or separators split-string-default-separators))
+ (rexp (or separators org-contacts-property-values-separators))
(inputlist (split-string string rexp keep-nulls))
(linkstring "")
(bufferstring "")
- [elpa] externals/org-contacts 9105e22251 066/154: contrib/lisp/org-contacts.el: Add a complex org-contacts template to the file header, (continued)
- [elpa] externals/org-contacts 9105e22251 066/154: contrib/lisp/org-contacts.el: Add a complex org-contacts template to the file header, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 4108493c9d 055/154: org-contacts.el , fix bugs about 'tel and 'note properties, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts d6824ec3c2 069/154: org-contacts: use `org-' prefixed variants of cl functions, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts fd0f42a1bc 075/154: Update copyright years again., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 5526110aac 018/154: Merge branch 'origin-maint', ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts d630e91dee 033/154: Add caching mecanism, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 680dc1f24d 039/154: org-contacts.el: Started to silent byte-compiler, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 3f1509bfa2 035/154: org-contacts: Fix Agenda format., ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts abbf3a9a25 041/154: org-contacts.el: Rename a function to follow emacs-lisp coding conventions, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 5d5faa5e6b 051/154: org-contacts.el, add note property, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 9bd8101c56 059/154: contrib/lisp/org-contacts: Introduce the constant `org-contacts-property-values-separators',
ELPA Syncer <=
- [elpa] externals/org-contacts beb76bf435 060/154: org-contacts: Use progress-reporter for cache update message, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 9d9246c0a5 072/154: Merge branch 'maint', ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 66e23e6403 008/154: org-contacts: added VCard 3.0 exporter and ADDRESS field, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 4d5b508f0f 007/154: org-contacts: check that completion-at-point-functions is bound, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 531d67a715 014/154: Fix Emacs 24 compatibility issue with Emacs 24, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 4f5c58197e 006/154: Fix wanderlust interface for org-contact.el, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts d0caf96afd 015/154: Replace org-mode-p with usual (eq major-mode 'org-mode) check, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts ad99d80ad3 001/154: org-contacts: import, ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts e585be0859 009/154: org-contacts: added org-contacts-show-map (requires google-maps-el), ELPA Syncer, 2022/09/09
- [elpa] externals/org-contacts 5f1806a8d0 012/154: org-contacts: fix errors when Gnus or ERC are not loaded, ELPA Syncer, 2022/09/09