emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Clemente <n142857@gmail.com>
To: org-mode Mailinglist <emacs-orgmode@gnu.org>
Subject: patch for org-contacts to ignore <<<radio_marks>>> when completing
Date: Tue, 01 Jan 2013 04:06:35 +0100	[thread overview]
Message-ID: <87vcbh1u10.wl%n142857@gmail.com> (raw)


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	other threads:[~2013-01-01  3:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-01  3:06 Daniel Clemente [this message]
2013-01-01 22:57 ` patch for org-contacts to ignore <<<radio_marks>>> when completing Bastien
2013-01-02  0:44   ` Daniel Clemente
2013-01-02  9:23     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vcbh1u10.wl%n142857@gmail.com \
    --to=n142857@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).