unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: torys.anderson@gmail.com (Tory S. Anderson)
To: Emacs Help List <help-gnu-emacs@gnu.org>
Subject: Help writing a helm email-address-at-point fn
Date: Sat, 09 Mar 2019 22:06:52 -0700	[thread overview]
Message-ID: <87bm2jco7n.fsf@byu.edu> (raw)

I use helm and bbdb to complete addresses in my to/from/cc fields. It sort-of works, but I'm leveraging word-at-point. This means that if I type "Joe" and type "<TAB>", I see the completions I expect, but if I type "Joe Somebod" I get completions (and replace) just the "Somebod", both not taking into account the "Joe" and also leaving it there after I make my selection. It seems like I need to define a new "thing-at-point" function, but I'm having trouble figuring out how.

Looking at how bbdb-company isolates the right match, I gleaned the following regexp:

--8<---------------cut here---------------start------------->8---
(looking-back "^\\(To\\|Cc\\|Bcc\\): *.*? *\\([^,;]*\\)" (line-beginning-position))
--8<---------------cut here---------------end--------------->8---

But I can't quite figure out how to use that to make a thing-at-point I could drop in to replace my use of `word-at-point`. Any help would be much appreciated.

- Tory



                 reply	other threads:[~2019-03-10  5:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87bm2jco7n.fsf@byu.edu \
    --to=torys.anderson@gmail.com \
    --cc=help-gnu-emacs@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.
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).