emacs-orgmode
[Top][All Lists]
Advanced

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

[O] patch for org-contacts to ignore <<<radio_marks>>> when completing


From: Daniel Clemente
Subject: [O] patch for org-contacts to ignore <<<radio_marks>>> when completing
Date: Tue, 01 Jan 2013 04:06:35 +0100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/24.3.50 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi, I send a patch which allows org-complete to complete if you do „J o h n 
TAB“ even if your contact was written as <<<John>>> (now you would have to type 
< < < J TAB).
  It can be extended to remove emphasis, strongs, etc. if someone needs it.

Thanks


diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
index 7e3cbb7..0173f1d 100644
--- a/contrib/lisp/org-contacts.el
+++ b/contrib/lisp/org-contacts.el
@@ -388,12 +388,17 @@ This function should be called from 
`gnus-article-prepare-hook'."
   (org-completing-read
    prompt (org-contacts-filter) predicate t initial-input hist def 
inherit-input-method))
 
+(defun org-contacts-format-name (name)
+  "Format a person name to remove radio marks."
+  (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 ">")
     email))
 
 (defun org-contacts-check-mail-address (mail)



reply via email to

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