Package: notmuch-vim
Version: 0.6
Severity: normal

The code for generating the from list on search pages (where it
lists people's names) was mangling them oddly. It seemed to assume
that the string from notmuch would be e-mail addresses, but in my
experience they were mostly full names. Also it assumed that they'd
be delimited by commas, but in my experience some were instead
delimited by vertical bars.

The code does no error checking, so if a name does not contain both
a comma and an at-symbol, the last character of the name is
removed.

Attached is a patch which rewrites the from list munging such that:

1) names are not truncated

2) vertical bars are parsed as delimiters (so output has just
commas)

3) email addresses are still supported in the same way (everything
up to the first . or @ is output)

Seems odd to me to truncate at the first period. That can be more
easily changed now.

Take care,   - Jason



-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.39-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages notmuch-vim depends on:
ii  notmuch                       0.6        thread-based email index, search a
ii  vim-addon-manager             0.4.3      manager of addons for the Vim edit

notmuch-vim recommends no packages.

notmuch-vim suggests no packages.

-- no debconf information
diff --git a/notmuch.vim b/notmuch.vim
index c731c47..c119bc7 100644
--- a/notmuch.vim
+++ b/notmuch.vim
@@ -262,12 +262,12 @@ function! s:NM_cmd_search_fmtline(line)
                 return 'ERROR PARSING: ' . a:line
         endif
         let max = g:notmuch_search_from_column_width
-        let flist = []
-        for at in split(m[4], ", ")
-                let p = min([stridx(at, "."), stridx(at, "@")])
-                call insert(flist, tolower(at[0:p - 1]))
+        let flist = {}
+        for at in split(m[4], '[|,] ')
+                let p = split(at, '[@.]')
+                let flist[p[0]] = 1
         endfor
-        let from = join(flist, ", ")
+        let from = join(keys(flist), ", ")
         return printf("%-12s %3s %-20.20s | %s (%s)", m[2], m[3], from, m[5], m[6])
 endfunction
 
@@ -596,7 +596,7 @@ function! s:NM_show_advance_marking_read_and_archiving()
                 let filter = <SID>NM_combine_tags('tag:', advance_tags, 'OR', '()')
                          \ + ['AND']
                          \ + <SID>NM_combine_tags('', ids, 'OR', '()')
-                call map(advance_tags, '"+" . v:val')
+                call map(advance_tags, '"-" . v:val')
                 call <SID>NM_tag(filter, advance_tags)
                 call <SID>NM_show_next(1, 1)
                 return

Reply via email to