Commit graph

175 commits

Author SHA1 Message Date
Georg Faerber
c117306f2d Fix typos as found by codespell
Signed-off-by: Georg Faerber <georg@riseup.net>
2018-03-24 20:09:54 -03:00
Franz Fellner
ce9f559b86 VIM: Improve performance of folders_render
Simply use query.count_[messages,threads] instead of actually running
the query and using the count attribute of the result set.
2015-01-23 18:18:54 +01:00
Franz Fellner
9d4ff29ad8 VIM: Respect exclude_tags specified in .notmuch-config
Exclude mails tagged with any tag specified in 'notmuch config get
search.exclude_tags' in folders list and search list.
2015-01-22 20:34:31 +01:00
Ian Main
4a1ccfedd9 VIM: Make starting in 'insert' mode for compose optional
This adds a variable to make starting in insert mode optional when
composing and replying to emails.  I found it unusual to be started in
insert mode so I thought I'd make it optional as others may find this as
well.

    Ian
2014-10-21 10:24:52 +02:00
Ian Main
e0ce86119c VIM: Use notmuch CLI for config
This patch switches from reading .notmuch-config directly to using
the CLI the same way that emacs does it.  It actually uses less code
and is probably less error prone.

    Ian
2014-10-21 10:22:44 +02:00
Felipe Contreras
cc8c213bbc vim: improve the way messages are sent
We want the proper encoding and content-type to be set when sending the
mail, but human-readable plain-text for composing. So split the code in
two parts: the presentation and the transport conversion.

This fixes an issue while sending non-ascii mails to strict servers; the
mail needs to be encoded.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2014-05-03 06:00:22 +09:00
Paul Roberts
468deca60c vim: make the html handler configurable
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2014-05-03 05:59:58 +09:00
Felipe Contreras
2fee62fd1f vim: fix count_threads variable check
It never really worked; in Ruby only 'nil' and 'false' evaluate to
false, therefore the statement '0 : true ? false' returns true, so it
doesn't matter if notmuch_folders_count_threads = 0, count_threads would
be true.

We need to check specifically if the value is 1 or 0.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2014-05-03 05:59:38 +09:00
Felipe Contreras
42ff2d3a0d vim: add help file
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:30 -06:00
Felipe Contreras
3d15ed9290 vim: check compose is done on delete
Not on unload, which happens when we switch buffers.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:30 -06:00
Felipe Contreras
062a73b931 vim: remove unnecessary buffer queue
Vim handles the buffers just fine: when one is deleted, we go to the
previous one.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:30 -06:00
Felipe Contreras
2c3623703f vim: add wrapper for old variable names
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:30 -06:00
Felipe Contreras
8d3b4ffb56 vim: move default sets to set_defaults()
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
2dedd23943 vim: rename public notmuch_rb variables
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
77c2853d7d vim: rename internal notmuch_rb variables
Now we are the official one.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
24dc32aef7 vim: add option to compose new messages
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
de74431cfe vim: refactor open_reply()
In preparation for composing new messages.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
2ec69fd39e vim: trivial cleanup
Using $email_address is more straight forward.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
568a541262 vim: don't execute search if it's cancelled
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
ce5f3f3809 vim: generate custom message-id
Using Mail as a reference.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
6ff607d6a0 vim: split $email_address
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
a760e4ab47 vim: allow calling with arguments
For example:

  :NotMuch date:today

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
77c2c3143b vim: add option to save the patches of a patch series
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
2d583fb17a vim: use much clearer sort constant
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
01859bd7ce vim: show first message of the thread
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
85b3dc9f0f vim: refactor database handling
To minimize memory usage we need to destroy the queries and the
databases, so we should keep track of them.

Each buffer gets a database connection that is destroyed when the buffer
is destroyed, and all the queries along with it.

Ideally notmuch should destroy the queries when the database is
destroyed, but it's not doing that at the moment.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
47e1f39c56 vim: use notmuch fields
They are better encoded than Ruby's Mail.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Felipe Contreras
a0b0baaf2b vim: don't automatically refresh after tagging
This operation might take a while, and even if it only takes fractions
of a second, that's not what the user might want.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
Charlie Allom
6f8a1345eb vim: run mutt in default term
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-11-20 07:23:29 -06:00
David Bremner
0eb4213766 debian: build notmuch-vim again
Based on id:1370220299-14722-1-git-send-email-felipe.contreras@gmail.com

Hacked rather extensively by db. The most important changes:

       - bring back notmuch.yaml for the (debian specific?) vim-addons
         tool.
       - depend on vim-ruby, so we get a version of vim with ruby installed.
2013-07-28 13:48:02 -03:00
Felipe Contreras
bf8877fe45 vim: use the old vim plugin function name
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-06-02 19:49:49 -05:00
Felipe Contreras
138c6aa098 Add new notmuch vim plugin
The old one was not properly maintained and is now deprecated. The new
one has much better support.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2013-06-02 19:42:43 -05:00
David Bremner
6ee07a9c6d notmuch-vim: deprecate, move to contrib
As discussed in id:871udhcmks.fsf@zancas.localnet, notmuch-vim doesn't
really meet the standards of the CLI, emacs interface, or python
bindings in terms of being well maintained.
2013-02-16 08:03:09 -04:00
Felipe Contreras
85e991affc vim: simplify build
There should be no functional changes, except that you don't need to
make the directories before installing.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2012-04-21 05:19:30 +03:00
Jakob
ae525b7e5b vim: fix regex after "notmuch show" output change
The new field "excluded" was added to the output and made this regex fail.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2012-04-21 05:19:30 +03:00
Jason Woofenden
8b10e4d569 vim: fix citation/signature fold lengths
Before they'd often miss the last line

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Jason Woofenden
6c6c8a9c85 vim: fix (hack) cig/cit parsing within multipart/*
The vim front-end isn't written to handle nested parts.

This patch doesn't change that, it just changes the code to pretend that
multipart/* sections end immediately. This makes the parsing code think that
all sections are top-level, and are thus parsed well enough.

The lovely result of this is that citation folds and signature folds now work
in text/plain parts that are within multipart/* sections. Also, all mime
section starts are now shown correctly (before some were not parsed and showed
the ugly ^L and an ID and so on from notmuch.)

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Jason Woofenden
3de487d405 vim: fix on-screen instructions for show-signature
Also change a passed parameter to be consistent with the current binding. This
parameter appears to be unused.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Jason Woofenden
f5c20b8b08 vim: fix from list reformatting in search view
This patch rewrites the reformatting of the from list so it shows full
capitalized names when available (without truncating them as the old code did)
and removes the pipe characters that appear between some names.

The old code appears to assume from list (the list of senders in the thread)
coming from notmuch would be e-mail addresses, but in this version it is mostly
full names. Also in this version, the names are sometimes separated by pipe
instead of comma.

For consistency with old versions, names are still truncated at the first
period. Perhaps they shouldn't be though.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Jason Woofenden
2b79776eed vim: fix space key: now archives (did opposite)
In vim, in the message view, space is supposed to remove the "unread" and
"inbox" tags, but was sometimes adding them instead.

This patch assures that they are always removed by this binding.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Uwe Kleine-König
bab653ce39 vim: use the full path for sendmail
... as /usr/sbin isn't usually in user's PATH.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Uwe Kleine-König
bcb17491b5 vim: skip trailing slash for g:notmuch_compose_temp_file_dir
With the trailing slash I get

	Error detected while processing function <SNR>10_NM_new_mail..<SNR>10_NM_cmd_compose..<SNR>10_NM_newComposeBuffer..<SNR>10_NM_newFileBuffer:
	line    3:
	E739: Cannot create directory: /home/ukleinek/.notmuch/compose/

when hitting 'm' to compose a new mail. strace shows:

	stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314a10) = -1 ENOENT (No such file or directory)
	stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314e30) = -1 ENOENT (No such file or directory)
	stat("/home/ukleinek/.notmuch/compose", 0x7fffee315270) = -1 ENOENT (No such file or directory)
	stat("/home/ukleinek/.notmuch", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
	mkdir("/home/ukleinek/.notmuch/compose", 0755) = 0
	mkdir("/home/ukleinek/.notmuch/compose/", 0755) = -1 EEXIST (File exists)

so it seems vim's mkdir() isn't able to handle a trailing slash.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:49:12 +03:00
Uwe Kleine-König
9d0e2ebc07 vim: fix documentation that mailx isn't used anymore
Since
	e7899b0 (vim: use sendmail directly)
notmuch-vim uses sendmail directly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:49:09 +03:00
Pieter Praet
607a73010a fix sum moar typos [error messages]
Various typo fixes in error messages within the source code.

Signed-off-by: Pieter Praet <pieter@praet.org>

Edited-by: Carl Worth <cworth@cworth.org> Restricted to just error messages.
2011-06-23 15:59:03 -07:00
Pieter Praet
8bb6f7869c fix sum moar typos [comments in source code]
Various typo fixes in comments within the source code.

Signed-off-by: Pieter Praet <pieter@praet.org>

Edited-by: Carl Worth <cworth@cworth.org> Restricted to just
source-code comments, (and fixed fix of "descriptios" to "descriptors"
rather than "descriptions").
2011-06-23 15:58:39 -07:00
Pieter Praet
18bf91def9 fix sum moar typos [text files]
Various typo fixes in auxiliary text files included with the source,
(README, TODO, etc.).

Signed-off-by: Pieter Praet <pieter@praet.org>

Edited-by: Carl Worth <cworth@cworth.org> Restricted to just text files.
2011-06-23 15:40:50 -07:00
Felipe Contreras
e96741388a vim: add delete commands
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-05-31 17:52:23 -07:00
Felipe Contreras
8344c439bf vim: add support for delete in search view
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-05-31 17:52:23 -07:00
Felipe Contreras
06a292018d vim: add support to mark as read in search view
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-05-31 17:52:23 -07:00
Felipe Contreras
e236142f03 vim: add support to mark as read in show view
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-05-31 17:52:23 -07:00