Re: Header and other questions

2011-05-15 Thread Daniel Kahn Gillmor
On 05/15/2011 01:23 AM, mu...@nawaz.org wrote:
 1. How do I see *all* the headers using the emacs interface? It shows me
 only 4 headers.

shift-v from within a notmuch-show buffer will show the entire source
of the message, including all headers.

i don't know the answers to your other questions, sorry!

regards,

--dkg



signature.asc
Description: OpenPGP digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Header and other questions

2011-05-15 Thread mueen
Daniel Kahn Gillmor
d...@fifthhorseman.net writes:

 On 05/15/2011 01:23 AM, mu...@nawaz.org wrote:
 1. How do I see *all* the headers using the emacs interface? It shows me
 only 4 headers.

 shift-v from within a notmuch-show buffer will show the entire source
 of the message, including all headers.

That did the trick - thanks!

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Header and other questions

2011-05-15 Thread Jesse Rosenthal
On Sun, 15 May 2011 23:56:11 +0200, Xavier Maillard xav...@maillard.im wrote:
 On Sat, 14 May 2011 22:23:16 -0700, mu...@nawaz.org wrote:
 
  3. Can I mark a bunch of messages for tagging in the Emacs interface? I
  know I can tag all messages in a query, but sometimes I'd just like to
  select a few manually and tag them (or apply some other command to
  them).
 
 I do not think that's possible at the moment but that could be quite
 useful.

It's possible, and works the way you'd think it would -- just select a
bunch of threads in the search list, and then tag them. It will apply
the tag to the messages in the region. (In fact, tagging a single thread
is just a special case of this, with a one-line region.)

--Jesse
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


storing From and Subject in xapian

2011-05-15 Thread servilio
On 12 May 2011 04:39, Istvan Marko  wrote:
> Stewart Smith  writes:
>
>> Would it be possible to progressively fill the DB with the new data?
>>
>> i.e.
>>
>> if Subject/From not in db for message
>> ? ?add Subject/From for this message to DB.
>
> I started looking into this but then realized that notmuch search opens
> the database in read-only mode so it cannot make updates. It might be
> desirable to keep it that way for safety and locking reasons.

What about the following:

- increase NOTMUCH_DATABASE_VERSION[1]
- update notmuch_database_upgrade[2] to fill in the new data for the
documents missing it
- include an upgradedb command that wraps notmuch_database_upgrade[2]
- have notmuch search prints a warning about running a DB version less
than the runtime and suggests running upgradedb

Regards,

Servilio

[1] http://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/database.cc#l39
[2] http://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/database.cc#l765


Header and other questions

2011-05-15 Thread Daniel Kahn Gillmor
On 05/15/2011 01:23 AM, mueen at nawaz.org wrote:
> 1. How do I see *all* the headers using the emacs interface? It shows me
> only 4 headers.

shift-v from within a "notmuch-show" buffer will show the entire source
of the message, including all headers.

i don't know the answers to your other questions, sorry!

regards,

--dkg

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1030 bytes
Desc: OpenPGP digital signature
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110515/89bedaaf/attachment.pgp>


Header and other questions

2011-05-15 Thread mu...@nawaz.org
Daniel Kahn Gillmor
 writes:

> On 05/15/2011 01:23 AM, mueen at nawaz.org wrote:
>> 1. How do I see *all* the headers using the emacs interface? It shows me
>> only 4 headers.
>
> shift-v from within a "notmuch-show" buffer will show the entire source
> of the message, including all headers.

That did the trick - thanks!



[RFC/PATCH] Vim client rewrite

2011-05-15 Thread an...@khirnov.net
))
endfunction

" --- process and set the defaults {{{1

function! NM_set_defaults(force)
setlocal bufhidden=hide
for [key, dflt] in items(s:notmuch_defaults)
let cmd = ''
if !a:force && exists(key) && type(dflt) == type(eval(key))
continue
elseif type(dflt) == type(0)
let cmd = printf('let %s = %d', key, dflt)
elseif type(dflt) == type('')
let cmd = printf('let %s = ''%s''', key, dflt)
" FIXME: not sure why this didn't work when dflt is an array
"elseif type(dflt) == type([])
"let cmd = printf('let %s = %s', key, string(dflt))
else
echoe printf('E: Unknown type in NM_set_defaults(%d) using [%s,%s]',
\ a:force, key, string(dflt))
continue
endif
exec cmd
endfor
endfunction
call NM_set_defaults(0)

" for some reason NM_set_defaults() didn't work for arrays...
if !exists('g:notmuch_folders')
let g:notmuch_folders = s:notmuch_folders_defaults
endif

if !exists('g:notmuch_show_headers')
let g:notmuch_show_headers = s:notmuch_show_headers_defaults
endif

if !exists('g:notmuch_signature')
if filereadable(glob('~/.signature'))
let g:notmuch_signature = readfile(glob('~/.signature'))
endif
endif
if !exists('g:notmuch_compose_headers')
let g:notmuch_compose_headers = s:notmuch_compose_headers_defaults
endif

" --- assign keymaps {{{1

function! s:NM_set_map(type, maps)
for [key, code] in items(a:maps)
exec printf('%snoremap  %s %s', a:type, key, code)
endfor
endfunction

" --- command handler {{{1

function! NotMuch()
if !exists('s:notmuch_inited')
" init the python layer
python import sys
exec "python sys.path += [r'" . s:python_path . "']"
python import vim, nm_vim

let s:notmuch_inited = 1
endif

call NM_cmd_folders(g:notmuch_folders)
endfunction

"Custom foldtext() for show buffers, which indents folds to
"represent thread structure
function! NM_show_foldtext()
if v:foldlevel != 1
return foldtext()
endif
let numlines = v:foldend - v:foldstart + 1
let indentlevel = matchstr(getline(v:foldstart), '^[0-9]\+')
return repeat('  ', indentlevel) . getline(v:foldstart + 1)
endfunction

"Completion of search prompt
"TODO properly deal with complex queries
function! Search_type_completion(arg_lead, cmd_line, cursor_pos)
let idx = stridx(a:arg_lead, ':')
if idx < 0
return 'from:' .   "\n" .
 \ 'to:' . "\n" .
 \ 'subject:' ."\n" .
 \ 'attachment:' . "\n" .
 \ 'tag:' ."\n" .
 \ 'id:' . "\n" .
 \ 'thread:' . "\n" .
 \ 'folder:'
endif
if stridx(a:arg_lead, 'tag:') >= 0
python nm_vim.vim_get_tags()
return 'tag:' . substitute(taglist, "\n", "\ntag:", "g")
endif
return ''
endfunction

" --- glue {{{1

command! NotMuch call NotMuch()
let s:python_path = expand(':p:h')
-- next part --
A non-text attachment was scrubbed...
Name: nm_vim.py
Type: text/x-python
Size: 19445 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20110515/6e9c6542/attachment-0001.py>
-- next part --
" notmuch folders mode syntax file

syntax region nmFolfers start=/^/ end=/$/ oneline 
contains=nmFoldersMessageCount
syntax match  nmFoldersMessageCount /^ *[0-9]\+ */contained 
nextgroup=nmFoldersUnreadCount
syntax match  nmFoldersUnreadCount  /(.\{-}) */   contained 
nextgroup=nmFoldersName
syntax match  nmFoldersName /.*\ze(/  contained 
nextgroup=nmFoldersSearch
syntax match  nmFoldersSearch   /([^()]\+)$/

highlight link nmFoldersMessageCount Statement
highlight link nmFoldersUnreadCount  Underlined
highlight link nmFoldersName Type
highlight link nmFoldersSearch   String

highlight CursorLine term=reverse cterm=reverse gui=reverse

-- next part --
syntax region nmSearch  start=/^/ end=/$/   oneline 
contains=nmSearchDate keepend
syntax match nmSearchDate   /^.\{-13}/  contained 
nextgroup=nmSearchNum skipwhite
syntax match nmSearchNum"[0-9]\+\/" contained 
nextgroup=nmSearchTotal skipwhite
syntax match nmSearchTotal  /[0-9]\+/   contained 
nextgroup=nmSearchFrom skipwhite
syntax match nmSearchFrom   /.\{-}\ze|/ contained 
nextgroup=nmSearchSubject skipwhite
"XXX this fails on some messages with multiple authors
syntax match nmSearchSubject/.*\ze(/co

Header and other questions

2011-05-15 Thread Jesse Rosenthal
On Sun, 15 May 2011 23:56:11 +0200, Xavier Maillard  
wrote:
> On Sat, 14 May 2011 22:23:16 -0700, mueen at nawaz.org wrote:
> 
> > 3. Can I mark a bunch of messages for tagging in the Emacs interface? I
> > know I can tag all messages in a query, but sometimes I'd just like to
> > select a few manually and tag them (or apply some other command to
> > them).
> 
> I do not think that's possible at the moment but that could be quite
> useful.

It's possible, and works the way you'd think it would -- just select a
bunch of threads in the search list, and then tag them. It will apply
the tag to the messages in the region. (In fact, tagging a single thread
is just a special case of this, with a one-line region.)

--Jesse