* [PATCH 00/13] vim: a bunch of updates from upstream
@ 2021-04-18 22:48 Felipe Contreras
2021-04-18 22:48 ` [PATCH 01/13] vim: fix Mail 2.8.0 warning Felipe Contreras
` (13 more replies)
0 siblings, 14 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
I finally took some time to update notmuch-vim and include some fixes,
as well as pull requests.
Here are the transplanted patches.
Aaron Borden (3):
vim: option to add email address to reply quote
vim: option to add reply quote datetime
vim: syntax: fix message description highlighting
Felipe Contreras (9):
vim: fix Mail 2.8.0 warning
vim: doc: small fixes
vim: fix for missing parts
vim: show first part if no text part is detected
vim: trivial cleanup
vim: use notmuch config command
vim: trivial cleanup
vim: remove backwards compatibility wrappers
vim: README: sync with upstream
John Gliksberg (1):
vim: doc: minor spelling fix
vim/README | 27 +++++---
vim/notmuch.txt | 19 +++++-
vim/notmuch.vim | 120 +++++++++++++++---------------------
vim/syntax/notmuch-show.vim | 4 +-
4 files changed, 86 insertions(+), 84 deletions(-)
--
2.31.0
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 01/13] vim: fix Mail 2.8.0 warning
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-26 23:10 ` David Bremner
2021-04-18 22:48 ` [PATCH 02/13] vim: doc: small fixes Felipe Contreras
` (12 subsequent siblings)
13 siblings, 1 reply; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
Passing an unparsed header field to Mail::Field.new is deprecated and will be removed in Mail 2.8.0. Use Mail::Field.parse instead.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index ad8b7c80..541698cd 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -666,7 +666,7 @@ ruby << EOF
date = Time.at(e.newest_date).strftime(date_fmt)
subject = e.messages.first['subject']
if $mail_installed
- subject = Mail::Field.new("Subject: " + subject).to_s
+ subject = Mail::Field.parse("Subject: " + subject).to_s
else
subject = subject.force_encoding('utf-8')
end
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 02/13] vim: doc: small fixes
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
2021-04-18 22:48 ` [PATCH 01/13] vim: fix Mail 2.8.0 warning Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 03/13] vim: doc: minor spelling fix Felipe Contreras
` (11 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vim/notmuch.txt b/vim/notmuch.txt
index 43741022..4a038102 100644
--- a/vim/notmuch.txt
+++ b/vim/notmuch.txt
@@ -89,7 +89,7 @@ s Send
CONFIGURATION *notmuch-config*
You can add the following configurations to your `.vimrc`, or
-`~/.vim/plugin/notmuch.vim`.
+`~/.vim/after/plugin/notmuch.vim`.
*g:notmuch_folders*
@@ -138,7 +138,7 @@ You can do the same for the thread view:
If you want to count the threads instead of the messages in the folder view:
>
- let g:notmuch_folders_count_threads = 0
+ let g:notmuch_folders_count_threads = 1
<
*g:notmuch_reader*
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 03/13] vim: doc: minor spelling fix
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
2021-04-18 22:48 ` [PATCH 01/13] vim: fix Mail 2.8.0 warning Felipe Contreras
2021-04-18 22:48 ` [PATCH 02/13] vim: doc: small fixes Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 04/13] vim: fix for missing parts Felipe Contreras
` (10 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: John Gliksberg
From: John Gliksberg <jg.trosh@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vim/notmuch.txt b/vim/notmuch.txt
index 4a038102..c98f2b53 100644
--- a/vim/notmuch.txt
+++ b/vim/notmuch.txt
@@ -144,7 +144,7 @@ If you want to count the threads instead of the messages in the folder view:
*g:notmuch_reader*
*g:notmuch_sendmail*
-You can also configure your externail mail reader and sendemail program:
+You can also configure your external mail reader and sendmail program:
>
let g:notmuch_reader = 'mutt -f %s'
let g:notmuch_sendmail = 'sendmail'
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 04/13] vim: fix for missing parts
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (2 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 03/13] vim: doc: minor spelling fix Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 05/13] vim: show first part if no text part is detected Felipe Contreras
` (9 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
Sometimes Mail incorrectly parses multipart messages.
See: https://github.com/mikel/mail/issues/1438
Check for empty parts instead of crashing.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.vim | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 541698cd..e2362a2d 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -332,9 +332,13 @@ ruby << EOF
b << "Cc: %s" % msg['cc']
b << "Date: %s" % msg['date']
nm_m.body_start = b.count
- b << "--- %s ---" % part.mime_type
- part.convert.each_line do |l|
- b << l.chomp
+ if part
+ b << "--- %s ---" % part.mime_type
+ part.convert.each_line do |l|
+ b << l.chomp
+ end
+ else
+ b << "--- %s ---" % 'missing'
end
b << ""
nm_m.end = b.count
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 05/13] vim: show first part if no text part is detected
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (3 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 04/13] vim: fix for missing parts Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 06/13] vim: trivial cleanup Felipe Contreras
` (8 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
Better something than nothing.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.vim | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index e2362a2d..dd715828 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -333,7 +333,7 @@ ruby << EOF
b << "Date: %s" % msg['date']
nm_m.body_start = b.count
if part
- b << "--- %s ---" % part.mime_type
+ b << "--- %s ---" % [part.mime_type || 'none']
part.convert.each_line do |l|
b << l.chomp
end
@@ -925,7 +925,7 @@ ruby << EOF
def find_first_text
return self if not multipart?
- return text_part || html_part
+ return text_part || html_part || parts.first
end
def convert
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 06/13] vim: trivial cleanup
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (4 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 05/13] vim: show first part if no text part is detected Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 07/13] vim: use notmuch config command Felipe Contreras
` (7 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.vim | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index dd715828..97167461 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -471,9 +471,8 @@ function! s:NotMuch(...)
ruby << EOF
require 'notmuch'
- require 'rubygems'
- require 'tempfile'
require 'socket'
+ require 'tempfile'
begin
require 'mail'
rescue LoadError
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 07/13] vim: use notmuch config command
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (5 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 06/13] vim: trivial cleanup Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 08/13] vim: trivial cleanup Felipe Contreras
` (6 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
This simplifies the configuration parsing, is more efficient, and also
reverts back to previous logic.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.vim | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 97167461..8777d412 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -484,24 +484,22 @@ ruby << EOF
$searches = []
$threads = []
$messages = []
+ $config = {}
$mail_installed = defined?(Mail)
- def get_config_item(item)
- result = ''
- IO.popen(['notmuch', 'config', 'get', item]) { |out|
- result = out.read
- }
- return result.rstrip
- end
-
def get_config
- $db_name = get_config_item('database.path')
- $email_name = get_config_item('user.name')
- $email_address = get_config_item('user.primary_email')
- $email_name = get_config_item('user.name')
+ IO.popen(%w[notmuch config list]) do |io|
+ io.each(chomp: true) do |e|
+ key, value = e.split('=')
+ $config[key] = value
+ end
+ end
+
+ $db_name = $config['database.path']
+ $email_name = $config['user.name']
+ $email_address = $config['user.primary_email']
+ $exclude_tags = $config['search.exclude_tags']&.split(';') || []
$email = "%s <%s>" % [$email_name, $email_address]
- ignore_tags = get_config_item('search.exclude_tags')
- $exclude_tags = ignore_tags.split("\n")
end
def vim_puts(s)
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 08/13] vim: trivial cleanup
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (6 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 07/13] vim: use notmuch config command Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 09/13] vim: option to add email address to reply quote Felipe Contreras
` (5 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.vim | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 8777d412..7a448467 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -641,9 +641,7 @@ ruby << EOF
$searches.clear
folders.each do |name, search|
q = $curbuf.query(search)
- $exclude_tags.each { |t|
- q.add_tag_exclude(t)
- }
+ $exclude_tags.each { |e| q.add_tag_exclude(e) }
$searches << search
count = count_threads ? q.count_threads : q.count_messages
b << "%9d %-20s (%s)" % [count, name, search]
@@ -655,9 +653,7 @@ ruby << EOF
date_fmt = VIM::evaluate('g:notmuch_date_format')
q = $curbuf.query(search)
q.sort = Notmuch::SORT_NEWEST_FIRST
- $exclude_tags.each { |t|
- q.add_tag_exclude(t)
- }
+ $exclude_tags.each { |e| q.add_tag_exclude(e) }
$threads.clear
t = q.search_threads
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 09/13] vim: option to add email address to reply quote
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (7 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 08/13] vim: trivial cleanup Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 10/13] vim: option to add reply quote datetime Felipe Contreras
` (4 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Aaron Borden
From: Aaron Borden <adborden@live.com>
Cleanup-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.txt | 6 ++++++
vim/notmuch.vim | 7 +++++++
2 files changed, 13 insertions(+)
diff --git a/vim/notmuch.txt b/vim/notmuch.txt
index c98f2b53..b658020d 100644
--- a/vim/notmuch.txt
+++ b/vim/notmuch.txt
@@ -133,6 +133,12 @@ You can do the same for the thread view:
>
let g:notmuch_datetime_format = '%d.%m.%y %H:%M:%S'
<
+ *g:notmuch_reply_quote_format*
+
+If you want to change the reply quote format to show the email address:
+>
+ let g:notmuch_reply_quote_format = '%s <%s>'
+<
*g:notmuch_folders_count_threads*
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 7a448467..59914a76 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -56,6 +56,7 @@ let s:notmuch_folders_default = [
let s:notmuch_date_format_default = '%d.%m.%y'
let s:notmuch_datetime_format_default = '%d.%m.%y %H:%M:%S'
+let s:notmuch_reply_quote_format_default = '%s'
let s:notmuch_reader_default = 'mutt -f %s'
let s:notmuch_sendmail_default = 'sendmail'
let s:notmuch_folders_count_threads_default = 0
@@ -413,6 +414,10 @@ function! s:set_defaults()
endif
endif
+ if !exists('g:notmuch_reply_quote_format')
+ let g:notmuch_reply_quote_format = s:notmuch_reply_quote_format_default
+ endif
+
if !exists('g:notmuch_reader')
if exists('g:notmuch_rb_reader')
let g:notmuch_reader = g:notmuch_rb_reader
@@ -593,6 +598,8 @@ ruby << EOF
addr = Mail::Address.new(orig[:from].value)
name = addr.name
name = addr.local + "@" if name.nil? && !addr.local.nil?
+ name_format = VIM::evaluate('g:notmuch_reply_quote_format')
+ name = name_format % [name, addr.address] if !addr.address.nil?
else
name = orig[:from]
end
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 10/13] vim: option to add reply quote datetime
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (8 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 09/13] vim: option to add email address to reply quote Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 11/13] vim: syntax: fix message description highlighting Felipe Contreras
` (3 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Aaron Borden
From: Aaron Borden <adborden@live.com>
By default it's empty so the format doesn't change.
Cleanup-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.txt | 7 +++++++
vim/notmuch.vim | 12 +++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/vim/notmuch.txt b/vim/notmuch.txt
index b658020d..a8a75fed 100644
--- a/vim/notmuch.txt
+++ b/vim/notmuch.txt
@@ -140,6 +140,13 @@ If you want to change the reply quote format to show the email address:
let g:notmuch_reply_quote_format = '%s <%s>'
<
+ *g:notmuch_reply_quote_datetime_format*
+
+There's also a way to specy the reply quote datetime format:
+>
+ let g:notmuch_reply_quote_datetime_format = '%a %b %e'
+<
+
*g:notmuch_folders_count_threads*
If you want to count the threads instead of the messages in the folder view:
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index 59914a76..e717fb5a 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -57,6 +57,7 @@ let s:notmuch_folders_default = [
let s:notmuch_date_format_default = '%d.%m.%y'
let s:notmuch_datetime_format_default = '%d.%m.%y %H:%M:%S'
let s:notmuch_reply_quote_format_default = '%s'
+let s:notmuch_reply_quote_datetime_format_default = ''
let s:notmuch_reader_default = 'mutt -f %s'
let s:notmuch_sendmail_default = 'sendmail'
let s:notmuch_folders_count_threads_default = 0
@@ -418,6 +419,10 @@ function! s:set_defaults()
let g:notmuch_reply_quote_format = s:notmuch_reply_quote_format_default
endif
+ if !exists('g:notmuch_reply_quote_datetime_format')
+ let g:notmuch_reply_quote_datetime_format = s:notmuch_reply_quote_datetime_format_default
+ endif
+
if !exists('g:notmuch_reader')
if exists('g:notmuch_rb_reader')
let g:notmuch_reader = g:notmuch_rb_reader
@@ -600,12 +605,17 @@ ruby << EOF
name = addr.local + "@" if name.nil? && !addr.local.nil?
name_format = VIM::evaluate('g:notmuch_reply_quote_format')
name = name_format % [name, addr.address] if !addr.address.nil?
+ date_format = VIM::evaluate('g:notmuch_reply_quote_datetime_format')
+ quote_datetime = orig.date.strftime(date_format) if !date_format.empty? and orig.date
else
name = orig[:from]
end
name = "somebody" if name.nil?
- body_lines << "%s wrote:" % name
+ quote = []
+ quote << "On %s" % quote_datetime if quote_datetime
+ quote << "%s wrote:" % name
+ body_lines << quote.join(', ')
part = orig.find_first_text
part.convert.each_line do |l|
body_lines << "> %s" % l.chomp
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 11/13] vim: syntax: fix message description highlighting
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (9 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 10/13] vim: option to add reply quote datetime Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 12/13] vim: remove backwards compatibility wrappers Felipe Contreras
` (2 subsequent siblings)
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Aaron Borden
From: Aaron Borden <adborden@live.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/syntax/notmuch-show.vim | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vim/syntax/notmuch-show.vim b/vim/syntax/notmuch-show.vim
index c3a98b77..de0c43a1 100644
--- a/vim/syntax/notmuch-show.vim
+++ b/vim/syntax/notmuch-show.vim
@@ -1,8 +1,8 @@
" notmuch show mode syntax file
syntax cluster nmShowMsgDesc contains=nmShowMsgDescWho,nmShowMsgDescDate,nmShowMsgDescTags
-syntax match nmShowMsgDescWho /[^)]\+)/ contained
-syntax match nmShowMsgDescDate / ([^)]\+[0-9]) / contained
+syntax match nmShowMsgDescWho /[^)]\+>/ contained
+syntax match nmShowMsgDescDate / [^(]\+ / contained
syntax match nmShowMsgDescTags /([^)]\+)$/ contained
syntax cluster nmShowMsgHead contains=nmShowMsgHeadKey,nmShowMsgHeadVal
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 12/13] vim: remove backwards compatibility wrappers
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (10 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 11/13] vim: syntax: fix message description highlighting Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-18 22:48 ` [PATCH 13/13] vim: README: sync with upstream Felipe Contreras
2021-04-19 10:16 ` [PATCH 00/13] vim: a bunch of updates from upstream David Bremner
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
Seven years is more than enough.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/notmuch.vim | 50 +++++++++----------------------------------------
1 file changed, 9 insertions(+), 41 deletions(-)
diff --git a/vim/notmuch.vim b/vim/notmuch.vim
index e717fb5a..717633c7 100644
--- a/vim/notmuch.vim
+++ b/vim/notmuch.vim
@@ -399,20 +399,16 @@ endfunction
"" root
function! s:set_defaults()
+ if !exists('g:notmuch_folders')
+ let g:notmuch_folders = s:notmuch_folders_default
+ endif
+
if !exists('g:notmuch_date_format')
- if exists('g:notmuch_rb_date_format')
- let g:notmuch_date_format = g:notmuch_rb_date_format
- else
- let g:notmuch_date_format = s:notmuch_date_format_default
- endif
+ let g:notmuch_date_format = s:notmuch_date_format_default
endif
if !exists('g:notmuch_datetime_format')
- if exists('g:notmuch_rb_datetime_format')
- let g:notmuch_datetime_format = g:notmuch_rb_datetime_format
- else
- let g:notmuch_datetime_format = s:notmuch_datetime_format_default
- endif
+ let g:notmuch_datetime_format = s:notmuch_datetime_format_default
endif
if !exists('g:notmuch_reply_quote_format')
@@ -424,41 +420,21 @@ function! s:set_defaults()
endif
if !exists('g:notmuch_reader')
- if exists('g:notmuch_rb_reader')
- let g:notmuch_reader = g:notmuch_rb_reader
- else
- let g:notmuch_reader = s:notmuch_reader_default
- endif
+ let g:notmuch_reader = s:notmuch_reader_default
endif
if !exists('g:notmuch_sendmail')
- if exists('g:notmuch_rb_sendmail')
- let g:notmuch_sendmail = g:notmuch_rb_sendmail
- else
- let g:notmuch_sendmail = s:notmuch_sendmail_default
- endif
+ let g:notmuch_sendmail = s:notmuch_sendmail_default
endif
if !exists('g:notmuch_folders_count_threads')
- if exists('g:notmuch_rb_count_threads')
- let g:notmuch_count_threads = g:notmuch_rb_count_threads
- else
- let g:notmuch_folders_count_threads = s:notmuch_folders_count_threads_default
- endif
+ let g:notmuch_folders_count_threads = s:notmuch_folders_count_threads_default
endif
if !exists('g:notmuch_compose_start_insert')
let g:notmuch_compose_start_insert = s:notmuch_compose_start_insert_default
endif
- if !exists('g:notmuch_custom_search_maps') && exists('g:notmuch_rb_custom_search_maps')
- let g:notmuch_custom_search_maps = g:notmuch_rb_custom_search_maps
- endif
-
- if !exists('g:notmuch_custom_show_maps') && exists('g:notmuch_rb_custom_show_maps')
- let g:notmuch_custom_show_maps = g:notmuch_rb_custom_show_maps
- endif
-
if exists('g:notmuch_custom_search_maps')
call extend(g:notmuch_search_maps, g:notmuch_custom_search_maps)
endif
@@ -466,14 +442,6 @@ function! s:set_defaults()
if exists('g:notmuch_custom_show_maps')
call extend(g:notmuch_show_maps, g:notmuch_custom_show_maps)
endif
-
- if !exists('g:notmuch_folders')
- if exists('g:notmuch_rb_folders')
- let g:notmuch_folders = g:notmuch_rb_folders
- else
- let g:notmuch_folders = s:notmuch_folders_default
- endif
- endif
endfunction
function! s:NotMuch(...)
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 13/13] vim: README: sync with upstream
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (11 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 12/13] vim: remove backwards compatibility wrappers Felipe Contreras
@ 2021-04-18 22:48 ` Felipe Contreras
2021-04-19 10:16 ` [PATCH 00/13] vim: a bunch of updates from upstream David Bremner
13 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-18 22:48 UTC (permalink / raw)
To: notmuch; +Cc: Felipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
vim/README | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/vim/README b/vim/README
index c137bacd..d9a635a2 100644
--- a/vim/README
+++ b/vim/README
@@ -3,7 +3,7 @@
This is a vim plug-in that provides a fully usable mail client interface,
utilizing the notmuch framework, through it's ruby bindings.
-== install ==
+== Install ==
Simply run 'make install'. However, check that you have the dependencies below.
@@ -12,6 +12,8 @@ Simply run 'make install'. However, check that you have the dependencies below.
Make sure your vim version has ruby support: check for +ruby in 'vim --version'
features.
+ % vim --version | grep +ruby
+
=== ruby bindings ===
Check if you are able to run the following command cleanly:
@@ -28,16 +30,10 @@ directory in the notmuch source tree.
Since libnotmuch library concentrates on things other than handling mail, we
need a library to do that, and for Ruby the best library for that is called
-'mail'. The easiest way to install it is with ruby's gem. In most distro's the
-package is called 'rubygems'.
-
-Once you have gem, run:
+'mail':
% gem install mail
-In some systems gems are installed on a per-user basis by default, so make sure
-you are running as the same user as the one that installed them.
-
This gem is not mandatory, but it's extremely recommended.
== Running ==
@@ -46,6 +42,15 @@ Simple:
% gvim -c ':NotMuch'
+You might want to write a wrapper script (e.g. `vnm`)
+
+ #!/bin/sh
+ gvim -c ":NotMuch $*"
+
+So you can run:
+
+ vnm is:inbox date:yesterday..
+
Enjoy ;)
== More stuff ==
@@ -53,10 +58,12 @@ Enjoy ;)
As an example to configure a key mapping to add the tag 'to-do' and archive,
this is what I use:
-let g:notmuch_rb_custom_search_maps = {
+----
+let g:notmuch_custom_search_maps = {
\ 't': 'search_tag("+to-do -inbox")',
\ }
-let g:notmuch_rb_custom_show_maps = {
+let g:notmuch_custom_show_maps = {
\ 't': 'show_tag("+to-do -inbox")',
\ }
+----
--
2.31.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 00/13] vim: a bunch of updates from upstream
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
` (12 preceding siblings ...)
2021-04-18 22:48 ` [PATCH 13/13] vim: README: sync with upstream Felipe Contreras
@ 2021-04-19 10:16 ` David Bremner
2021-04-19 20:44 ` Felipe Contreras
13 siblings, 1 reply; 19+ messages in thread
From: David Bremner @ 2021-04-19 10:16 UTC (permalink / raw)
To: Felipe Contreras, notmuch
Felipe Contreras <felipe.contreras@gmail.com> writes:
> I finally took some time to update notmuch-vim and include some fixes,
> as well as pull requests.
>
> Here are the transplanted patches.
>
So, big picture question. If notmuch is not upstream for this code,
should we be distributing it?
d
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/13] vim: a bunch of updates from upstream
2021-04-19 10:16 ` [PATCH 00/13] vim: a bunch of updates from upstream David Bremner
@ 2021-04-19 20:44 ` Felipe Contreras
2021-04-19 22:14 ` David Bremner
0 siblings, 1 reply; 19+ messages in thread
From: Felipe Contreras @ 2021-04-19 20:44 UTC (permalink / raw)
To: David Bremner; +Cc: notmuch@notmuchmail.org
On Mon, Apr 19, 2021 at 5:16 AM David Bremner <david@tethera.net> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > I finally took some time to update notmuch-vim and include some fixes,
> > as well as pull requests.
> >
> > Here are the transplanted patches.
> >
>
> So, big picture question. If notmuch is not upstream for this code,
> should we be distributing it?
I'm not sure which should be considered "upstream" at this point.
Apparently there's also a fork by Ian Main that a lot of people are
using.
From my point of view the code in notmuch is the one that has been
maintained the best. It also has the advantage that there's debian
packaging.
However, it doesn't have all the improvements of my code-base, nor the
features from Ian's code-base.
If I manage to:
1. Provide debian packaging
2. Merge the important features from Ian's code (cleanly)
3. Remain active merging future patches
Then I think we could consider removing the vim stuff from notmuch. In
the meantime I think the three code-bases serve a purpose.
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/13] vim: a bunch of updates from upstream
2021-04-19 20:44 ` Felipe Contreras
@ 2021-04-19 22:14 ` David Bremner
2021-04-20 3:21 ` Felipe Contreras
0 siblings, 1 reply; 19+ messages in thread
From: David Bremner @ 2021-04-19 22:14 UTC (permalink / raw)
To: Felipe Contreras; +Cc: notmuch@notmuchmail.org
Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> Then I think we could consider removing the vim stuff from notmuch. In
> the meantime I think the three code-bases serve a purpose.
>
Thanks for the detailed explanation. Your reasoning makes sense to
me. Now if only we could get more than one person at a time interested
in the notmuch version of the code.
d
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 00/13] vim: a bunch of updates from upstream
2021-04-19 22:14 ` David Bremner
@ 2021-04-20 3:21 ` Felipe Contreras
0 siblings, 0 replies; 19+ messages in thread
From: Felipe Contreras @ 2021-04-20 3:21 UTC (permalink / raw)
To: David Bremner; +Cc: notmuch@notmuchmail.org
On Mon, Apr 19, 2021 at 5:14 PM David Bremner <david@tethera.net> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > Then I think we could consider removing the vim stuff from notmuch. In
> > the meantime I think the three code-bases serve a purpose.
>
> Thanks for the detailed explanation. Your reasoning makes sense to
> me. Now if only we could get more than one person at a time interested
> in the notmuch version of the code.
Indeed, but this is open source; nobody is paying me (or others) to do
this, so not much can be demanded. I guess we'll have to wait and see.
Cheers.
--
Felipe Contreras
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 01/13] vim: fix Mail 2.8.0 warning
2021-04-18 22:48 ` [PATCH 01/13] vim: fix Mail 2.8.0 warning Felipe Contreras
@ 2021-04-26 23:10 ` David Bremner
0 siblings, 0 replies; 19+ messages in thread
From: David Bremner @ 2021-04-26 23:10 UTC (permalink / raw)
To: Felipe Contreras, notmuch
Felipe Contreras <felipe.contreras@gmail.com> writes:
> Passing an unparsed header field to Mail::Field.new is deprecated and will be removed in Mail 2.8.0. Use Mail::Field.parse instead.
applied.
d
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2021-04-26 23:11 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-18 22:48 [PATCH 00/13] vim: a bunch of updates from upstream Felipe Contreras
2021-04-18 22:48 ` [PATCH 01/13] vim: fix Mail 2.8.0 warning Felipe Contreras
2021-04-26 23:10 ` David Bremner
2021-04-18 22:48 ` [PATCH 02/13] vim: doc: small fixes Felipe Contreras
2021-04-18 22:48 ` [PATCH 03/13] vim: doc: minor spelling fix Felipe Contreras
2021-04-18 22:48 ` [PATCH 04/13] vim: fix for missing parts Felipe Contreras
2021-04-18 22:48 ` [PATCH 05/13] vim: show first part if no text part is detected Felipe Contreras
2021-04-18 22:48 ` [PATCH 06/13] vim: trivial cleanup Felipe Contreras
2021-04-18 22:48 ` [PATCH 07/13] vim: use notmuch config command Felipe Contreras
2021-04-18 22:48 ` [PATCH 08/13] vim: trivial cleanup Felipe Contreras
2021-04-18 22:48 ` [PATCH 09/13] vim: option to add email address to reply quote Felipe Contreras
2021-04-18 22:48 ` [PATCH 10/13] vim: option to add reply quote datetime Felipe Contreras
2021-04-18 22:48 ` [PATCH 11/13] vim: syntax: fix message description highlighting Felipe Contreras
2021-04-18 22:48 ` [PATCH 12/13] vim: remove backwards compatibility wrappers Felipe Contreras
2021-04-18 22:48 ` [PATCH 13/13] vim: README: sync with upstream Felipe Contreras
2021-04-19 10:16 ` [PATCH 00/13] vim: a bunch of updates from upstream David Bremner
2021-04-19 20:44 ` Felipe Contreras
2021-04-19 22:14 ` David Bremner
2021-04-20 3:21 ` Felipe Contreras
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).