[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] scratch/org-contacts-rebased 010b2ec 029/118: org-contacts.el (or

From: Stefan Monnier
Subject: [elpa] scratch/org-contacts-rebased 010b2ec 029/118: org-contacts.el (org-contacts-format-name): New function
Date: Fri, 12 Nov 2021 15:36:58 -0500 (EST)

branch: scratch/org-contacts-rebased
commit 010b2ec38aedcca8b527baca890461c6cc1c3aff
Author: Daniel Clemente <n142857@gmail.com>
Commit: Bastien Guerry <bzg@altern.org>

    org-contacts.el (org-contacts-format-name): New function
    * org-contacts.el (org-contacts-format-name): New function.
    (org-contacts-format-email): Use the new function.
 org-contacts.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/org-contacts.el b/org-contacts.el
index a567a9b..8a8140c 100644
--- a/org-contacts.el
+++ b/org-contacts.el
@@ -388,12 +388,17 @@ This function should be called from 
    prompt (org-contacts-filter) predicate t initial-input hist def 
+(defun org-contacts-format-name (name)
+  "Trim any local formatting to get a bare name."
+  ;; Remove radio targets characters
+  (replace-regexp-in-string org-radio-target-regexp "\\1" name))
 (defun org-contacts-format-email (name email)
   "Format a mail address."
   (unless email
     (error "`email' cannot be nul"))
   (if name
-      (concat name " <" email ">")
+      (concat (org-contacts-format-name name) " <" email ">")
 (defun org-contacts-check-mail-address (mail)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]