unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* fix notmuch.vim NM_compuse_get_user_email() (Patch)
@ 2011-01-26  5:01 Peter John Hartman
  2011-01-26  7:01 ` Carl Worth
  0 siblings, 1 reply; 2+ messages in thread
From: Peter John Hartman @ 2011-01-26  5:01 UTC (permalink / raw)
  To: notmuch

Here's a bitty patch to the vim plugin; it now calculates the primary email
of the user based on a call to notmuch config.  There's still a lot of work
that needs to get done on notmuch.vim, e.g., the ability to have multiple
emails/accounts.

Best, Peter

--- notmuch.vim	2010-11-18 17:26:14.000000000 -0500
+++ notmuch.vim.mine	2011-01-25 23:57:50.000000000 -0500
@@ -18,7 +18,8 @@
 " along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.
 "
 " Authors: Bart Trojanowski <bart@jukie.net>
-
+" Contributors: Peter Hartman <peterjohnhartman@gmail.com>
+"
 " --- configuration defaults {{{1
 
 let s:notmuch_defaults = {
@@ -1024,11 +1025,9 @@
 " --- --- compose screen helper functions {{{2
 
 function! s:NM_compose_get_user_email()
-        let name = substitute(system('id -u -n'), '\v(^\s*|\s*$|\n)', '', 'g')
-        let fqdn = substitute(system('hostname -f'), '\v(^\s*|\s*$|\n)', '', 'g')
-
-        " TODO: do this properly
-        return name . '@' . fqdn
+        " TODO: do this properly (still), i.e., allow for multiple email accounts
+        let email = substitute(system('notmuch config get user.primary_email'), '\v(^\s*|\s*$|\n)', '', 'g')
+	return email
 endfunction
 
 function! s:NM_compose_find_line_match(start, pattern, failure)

-- 
sic dicit magister P
PhD Candidate
Collaborative Programme in Ancient and Medieval Philosophy
University of Toronto
http://individual.utoronto.ca/peterjh

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: fix notmuch.vim NM_compuse_get_user_email() (Patch)
  2011-01-26  5:01 fix notmuch.vim NM_compuse_get_user_email() (Patch) Peter John Hartman
@ 2011-01-26  7:01 ` Carl Worth
  0 siblings, 0 replies; 2+ messages in thread
From: Carl Worth @ 2011-01-26  7:01 UTC (permalink / raw)
  To: Peter John Hartman, notmuch

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

On Wed, 26 Jan 2011 00:01:19 -0500, Peter John Hartman <peterjohnhartman@gmail.com> wrote:
> Here's a bitty patch to the vim plugin; it now calculates the primary email
> of the user based on a call to notmuch config.  There's still a lot of work
> that needs to get done on notmuch.vim, e.g., the ability to have multiple
> emails/accounts.

Thanks, Peter.

I've applied this now. And will push it out as soon as I get back on the
network, (which is the same time this email will go out---so hopefully
its out by the time you're reading this).

-Carl

PS. For future patches, if you can run "git commit -a" and then "git
format-patch HEAD~" and send the resulting file, then that will be more
convenient. That will give you a chance to describe the commit with a
commit message, and it will make it easier for me to apply it.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-26 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-26  5:01 fix notmuch.vim NM_compuse_get_user_email() (Patch) Peter John Hartman
2011-01-26  7:01 ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.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).