unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [ANN] New awesome vim plug-in using Ruby bindings
@ 2012-04-23  1:12 Felipe Contreras
  2012-04-23  3:41 ` Adam Wolfe Gordon
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Felipe Contreras @ 2012-04-23  1:12 UTC (permalink / raw)
  To: notmuch; +Cc: Ali Polatel, Bart Trojanowski, Ryan Harper, Adrian Perez

Hi,

I've never been particularly happy with the code of the vim plug-in,
but it sort of did the job, after some fixes, and has been working
great so far for most of my needs even though it's clearly very rough
on the edges.

However, I'm recently in need of been able to read HTML mails, and
just trying to add that code was a nightmare, so I decided to look for
alternatives, including Anton's Python vim plug-in (which is nice, but
doesn't have support for that), and even learning emacs, to use what
most people here use (but it turns out the HTML messages don't work
correctly there either). I also tried the various mutt+notmuch
options, and none fit the bill.

So, since I'm a big fan of Ruby, I decided to try my luck writing a
plug-in from scratch. It took me one weekend, but I'm pretty happy
with the result. This plug-in has already essentially all the
functionality of the current one, but it's much, *much* simpler (only
600) lines of code.

And in addition has many more features:

 * Gradual searches; you don't have to wait for the whole search to finish,
   sort of like the 'less' command
 * Proper multi-part handling; finds out if there's text/plain, or if
   text/html, converts it using elinks
 * Extract all attachments
 * Open message with mutt (or any external application that can open an mbox)
 * More proper UTF-8 handling
 * Configurable key mappings
 * Much simpler, cleaner, beautiful, and extensible code (only 600 lines!)

I just added support to reply mails today, and after trying a bit I
got complaints from the vger.kernel.org server, but people using mutt
have had the same complaint, so I don't know, I wouldn't reply totally
on that. *But* you can open the mail with mutt, or any other client
that you want, as a fall-back option (the command to run is
configurable).

Sure, it depends on the Ruby bindings from notmuch (but those are easy
to compile), and on the 'mail' library from Ruby (easy to install),
but it makes things much, *much* easier. There might be ways to make
certain dependencies optional, and make this, and the current plug-in
converge somehow (maybe even the python one too), but for now I don't
see any reason to look back.

I can't wait to start using it for real :)

Enjoy ;)

https://github.com/felipec/notmuch-vim-ruby

P.S. I CC'ed a bunch of people that have showed interest in the vim
interface, I hope you don't mind

-- 
Felipe Contreras

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-23  1:12 [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
@ 2012-04-23  3:41 ` Adam Wolfe Gordon
  2012-04-23 11:53   ` Felipe Contreras
  2012-04-23  9:39 ` ruby bindings on OS X are broken? (was Re: [ANN] New awesome vim plug-in using Ruby bindings) Charlie Allom
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Adam Wolfe Gordon @ 2012-04-23  3:41 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: Notmuch Mail

Hi Felipe,

This work sounds nice - it's good to have lots of interface choices.
One question below:

On Sun, Apr 22, 2012 at 19:12, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> doesn't have support for that), and even learning emacs, to use what
> most people here use (but it turns out the HTML messages don't work
> correctly there either). I also tried the various mutt+notmuch

HTML emails should work properly in emacs, and work even better if you
have w3.el installed. Replying to HTML emails isn't in git yet, but
there are patches for it in progress [1]. If there's a bug in the HTML
support, we should probably fix it, so could you explain what doesn't
work for you?

Thanks,

-- Adam

[1] id:"1335056093-17621-1-git-send-email-awg+notmuch@xvx.ca"

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

* ruby bindings on OS X are broken? (was Re: [ANN] New awesome vim plug-in using Ruby bindings)
  2012-04-23  1:12 [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
  2012-04-23  3:41 ` Adam Wolfe Gordon
@ 2012-04-23  9:39 ` Charlie Allom
  2012-04-23 12:48   ` Felipe Contreras
  2012-04-23 12:05 ` [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Charlie Allom @ 2012-04-23  9:39 UTC (permalink / raw)
  To: notmuch; +Cc: Ali Polatel

Hello, Has anyone seen this on OS X?

I can't see what the linker must be doing.

10:36 capslock:notmuch/bindings/ruby% ruby extconf.rb
checking for notmuch.h in ../../lib... yes
checking for notmuch_database_create() in -lnotmuch... yes
creating Makefile
10:36 capslock:notmuch/bindings/ruby% make
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c database.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c directory.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c filenames.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c init.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c message.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c messages.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c query.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c status.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c tags.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c thread.c
/opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c threads.c
/opt/local/bin/gcc-apple-4.2 -dynamic -bundle -undefined suppress -flat_namespace -o notmuch.bundle database.o directory.o filenames.o init.o message.o messages.o query.o status.o tags.o thread.o threads.o -L. -L/opt/local/lib -L/opt/local/lib -L. -L/opt/local/lib -arch x86_64  -arch x86_64  -lruby -lnotmuch  -lpthread -ldl -lobjc
ld: duplicate symbol _notmuch_rb_cDatabase in directory.o and database.o for architecture x86_64
collect2: ld returned 1 exit status
make: *** [notmuch.bundle] Error 1
10:37 capslock:notmuch/bindings/ruby%

--
 +442077294797
 http://mediasp.com/

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-23  3:41 ` Adam Wolfe Gordon
@ 2012-04-23 11:53   ` Felipe Contreras
  2012-04-23 13:28     ` Adam Wolfe Gordon
  0 siblings, 1 reply; 18+ messages in thread
From: Felipe Contreras @ 2012-04-23 11:53 UTC (permalink / raw)
  To: Adam Wolfe Gordon; +Cc: Notmuch Mail

On Mon, Apr 23, 2012 at 6:41 AM, Adam Wolfe Gordon <awg+notmuch@xvx.ca> wrote:
> Hi Felipe,
>
> This work sounds nice - it's good to have lots of interface choices.
> One question below:
>
> On Sun, Apr 22, 2012 at 19:12, Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
>> doesn't have support for that), and even learning emacs, to use what
>> most people here use (but it turns out the HTML messages don't work
>> correctly there either). I also tried the various mutt+notmuch
>
> HTML emails should work properly in emacs, and work even better if you
> have w3.el installed. Replying to HTML emails isn't in git yet, but
> there are patches for it in progress [1]. If there's a bug in the HTML
> support, we should probably fix it, so could you explain what doesn't
> work for you?

I do have w3.el installed. I can read the HTML, but when scrolling and
selecting there are glitches, and when replying nothing gets quoted.

Cheers.

-- 
Felipe Contreras

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-23  1:12 [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
  2012-04-23  3:41 ` Adam Wolfe Gordon
  2012-04-23  9:39 ` ruby bindings on OS X are broken? (was Re: [ANN] New awesome vim plug-in using Ruby bindings) Charlie Allom
@ 2012-04-23 12:05 ` Felipe Contreras
  2012-04-25 22:29 ` Felipe Contreras
  2012-05-02 20:41 ` Anton Khirnov
  4 siblings, 0 replies; 18+ messages in thread
From: Felipe Contreras @ 2012-04-23 12:05 UTC (permalink / raw)
  To: notmuch; +Cc: Ali Polatel, Bart Trojanowski, Adrian Perez

Hi,

If you reply to all, remove Ryan Harper, as the address doesn't work.
Or just reply here.

Cheers.

2012/4/23 Felipe Contreras <felipe.contreras@gmail.com>:
> I've never been particularly happy with the code of the vim plug-in,
> but it sort of did the job, after some fixes, and has been working
> great so far for most of my needs even though it's clearly very rough
> on the edges.
>
> However, I'm recently in need of been able to read HTML mails, and
> just trying to add that code was a nightmare, so I decided to look for
> alternatives, including Anton's Python vim plug-in (which is nice, but
> doesn't have support for that), and even learning emacs, to use what
> most people here use (but it turns out the HTML messages don't work
> correctly there either). I also tried the various mutt+notmuch
> options, and none fit the bill.
>
> So, since I'm a big fan of Ruby, I decided to try my luck writing a
> plug-in from scratch. It took me one weekend, but I'm pretty happy
> with the result. This plug-in has already essentially all the
> functionality of the current one, but it's much, *much* simpler (only
> 600) lines of code.
>
> And in addition has many more features:
>
>  * Gradual searches; you don't have to wait for the whole search to finish,
>   sort of like the 'less' command
>  * Proper multi-part handling; finds out if there's text/plain, or if
>   text/html, converts it using elinks
>  * Extract all attachments
>  * Open message with mutt (or any external application that can open an mbox)
>  * More proper UTF-8 handling
>  * Configurable key mappings
>  * Much simpler, cleaner, beautiful, and extensible code (only 600 lines!)
>
> I just added support to reply mails today, and after trying a bit I
> got complaints from the vger.kernel.org server, but people using mutt
> have had the same complaint, so I don't know, I wouldn't reply totally
> on that. *But* you can open the mail with mutt, or any other client
> that you want, as a fall-back option (the command to run is
> configurable).
>
> Sure, it depends on the Ruby bindings from notmuch (but those are easy
> to compile), and on the 'mail' library from Ruby (easy to install),
> but it makes things much, *much* easier. There might be ways to make
> certain dependencies optional, and make this, and the current plug-in
> converge somehow (maybe even the python one too), but for now I don't
> see any reason to look back.
>
> I can't wait to start using it for real :)
>
> Enjoy ;)
>
> https://github.com/felipec/notmuch-vim-ruby
>
> P.S. I CC'ed a bunch of people that have showed interest in the vim
> interface, I hope you don't mind

-- 
Felipe Contreras

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

* Re: ruby bindings on OS X are broken? (was Re: [ANN] New awesome vim plug-in using Ruby bindings)
  2012-04-23  9:39 ` ruby bindings on OS X are broken? (was Re: [ANN] New awesome vim plug-in using Ruby bindings) Charlie Allom
@ 2012-04-23 12:48   ` Felipe Contreras
  2012-04-23 13:11     ` Charlie Allom
  0 siblings, 1 reply; 18+ messages in thread
From: Felipe Contreras @ 2012-04-23 12:48 UTC (permalink / raw)
  To: Charlie Allom; +Cc: Ali Polatel, notmuch

On Mon, Apr 23, 2012 at 12:39 PM, Charlie Allom <charlie@mediasp.com> wrote:

> /opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c database.c

Where is the output file defined? There should be a -o database.o there. Weird.

This is what I have in my machine:
gcc -I. -I/usr/include/ruby-1.9.1/x86_64-linux
-I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.
-I../../lib   -fPIC -march=x86-64 -mtune=generic -O2 -pipe
-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC
-o messages.o -c messages.c

-- 
Felipe Contreras

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

* Re: ruby bindings on OS X are broken? (was Re: [ANN] New awesome vim plug-in using Ruby bindings)
  2012-04-23 12:48   ` Felipe Contreras
@ 2012-04-23 13:11     ` Charlie Allom
  0 siblings, 0 replies; 18+ messages in thread
From: Charlie Allom @ 2012-04-23 13:11 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: Ali Polatel, notmuch

On Mon, Apr 23, 2012 at 03:48:40PM +0300, Felipe Contreras <felipe.contreras@gmail.com> wrote:
> On Mon, Apr 23, 2012 at 12:39 PM, Charlie Allom <charlie@mediasp.com> wrote:
>
> > /opt/local/bin/gcc-apple-4.2 -I. -I. -I/opt/local/lib/ruby/1.8/i686-darwin11 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -fno-common -pipe -O2 -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c database.c
>
> Where is the output file defined? There should be a -o database.o there. Weird.

it seems to be implicit:

14:03 capslock:notmuch/bindings/ruby% file database.o
database.o: Mach-O 64-bit object x86_64

the -o is only needed when linking notmuch.bundle

  C.
--
 +442077294797
 http://mediasp.com/

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-23 11:53   ` Felipe Contreras
@ 2012-04-23 13:28     ` Adam Wolfe Gordon
  0 siblings, 0 replies; 18+ messages in thread
From: Adam Wolfe Gordon @ 2012-04-23 13:28 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: Notmuch Mail

On Mon, Apr 23, 2012 at 05:53, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> I do have w3.el installed. I can read the HTML, but when scrolling and
> selecting there are glitches, and when replying nothing gets quoted.

Ah, I see. As I said before, reply will work soon. The other issues
sound like emacs/w3 problems, out of our control. Thanks for
explaining.

-- Adam

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-23  1:12 [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
                   ` (2 preceding siblings ...)
  2012-04-23 12:05 ` [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
@ 2012-04-25 22:29 ` Felipe Contreras
  2012-04-28 10:40   ` Alex Ghitza
  2012-05-02 20:41 ` Anton Khirnov
  4 siblings, 1 reply; 18+ messages in thread
From: Felipe Contreras @ 2012-04-25 22:29 UTC (permalink / raw)
  To: notmuch; +Cc: Ali Polatel, Bart Trojanowski, Adrian Perez

2012/4/23 Felipe Contreras <felipe.contreras@gmail.com>:
> So, since I'm a big fan of Ruby, I decided to try my luck writing a
> plug-in from scratch. It took me one weekend, but I'm pretty happy
> with the result. This plug-in has already essentially all the
> functionality of the current one, but it's much, *much* simpler (only
> 600) lines of code.
>
> And in addition has many more features:
>
>  * Gradual searches; you don't have to wait for the whole search to finish,
>   sort of like the 'less' command
>  * Proper multi-part handling; finds out if there's text/plain, or if
>   text/html, converts it using elinks
>  * Extract all attachments
>  * Open message with mutt (or any external application that can open an mbox)
>  * More proper UTF-8 handling
>  * Configurable key mappings
>  * Much simpler, cleaner, beautiful, and extensible code (only 600 lines!)

In case anybody is interested, here's a screencast showing some of the
features :)
http://youtu.be/JGD7IbZmnIs

Cheers.

-- 
Felipe Contreras

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-25 22:29 ` Felipe Contreras
@ 2012-04-28 10:40   ` Alex Ghitza
  2012-04-28 12:44     ` Felipe Contreras
  0 siblings, 1 reply; 18+ messages in thread
From: Alex Ghitza @ 2012-04-28 10:40 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: notmuch

Hi Felipe,

On Thu, Apr 26, 2012 at 8:29 AM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> In case anybody is interested, here's a screencast showing some of the
> features :)
> http://youtu.be/JGD7IbZmnIs

This looks great, but I can't seem to be able to get it to work on my
machine.  I have put notmuch-ruby.vim alongside notmuch.vim inside
.vim/plugin, and the .vim/syntax/notmuch-* files are there as well.
If I do

vim -c ':NotMuch'

I can get into the normal vim frontend for notmuch, but if I try

vim -c ':NotMuchR'

all I get is an error message:

Error detected while processing command line:
E492: Not an editor command: :NotMuchR

Sorry about the completely noob question, but I've been unsuccessfully
trying to get this to work for a while now and I have run out of
ideas.  I'm of course happy to provide whatever information would help
get to the bottom of this.

-- 
Best,
Alex

--
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne
http://aghitza.org

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-28 10:40   ` Alex Ghitza
@ 2012-04-28 12:44     ` Felipe Contreras
  2012-04-28 22:52       ` Alex Ghitza
  0 siblings, 1 reply; 18+ messages in thread
From: Felipe Contreras @ 2012-04-28 12:44 UTC (permalink / raw)
  To: Alex Ghitza; +Cc: notmuch

On Sat, Apr 28, 2012 at 1:40 PM, Alex Ghitza <aghitza@gmail.com> wrote:

> vim -c ':NotMuchR'
>
> all I get is an error message:
>
> Error detected while processing command line:
> E492: Not an editor command: :NotMuchR

I don't know if you did anything special to get the normal plug-in to
work. Maybe you are doing 'source ~/.vim/plugin/notmuch.vim' directly
in your .vimrc, if so, you can try to do the same with notmuch vim
ruby. What I have is 'filetype plugin on'.

Cheers.

-- 
Felipe Contreras

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-28 12:44     ` Felipe Contreras
@ 2012-04-28 22:52       ` Alex Ghitza
  2012-05-14 18:24         ` Felipe Contreras
  0 siblings, 1 reply; 18+ messages in thread
From: Alex Ghitza @ 2012-04-28 22:52 UTC (permalink / raw)
  To: Felipe Contreras, Alex Ghitza; +Cc: notmuch

Felipe Contreras wrote:
> > vim -c ':NotMuchR'
> >
> > all I get is an error message:
> >
> > Error detected while processing command line:
> > E492: Not an editor command: :NotMuchR
> 
> I don't know if you did anything special to get the normal plug-in to
> work. Maybe you are doing 'source ~/.vim/plugin/notmuch.vim' directly
> in your .vimrc, if so, you can try to do the same with notmuch vim
> ruby. What I have is 'filetype plugin on'.

After banging my head against the wall a bit more, I realised what
should have been obvious from the beginning: I need to have vim built
with ruby support.  So after grabbing the vim source and

    ./configure --enable-rubyinterp

I am now happily writing this from notmuch-ruby.  As obvious as this
should have been, do you think it deserves a short sentence at the top
of the == install == section of your README?


-- 
Best,
Alex

Alex Ghitza -- http://aghitza.org/
Lecturer in Mathematics -- The University of Melbourne -- Australia

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-23  1:12 [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
                   ` (3 preceding siblings ...)
  2012-04-25 22:29 ` Felipe Contreras
@ 2012-05-02 20:41 ` Anton Khirnov
  2012-05-04 11:55   ` Felipe Contreras
  4 siblings, 1 reply; 18+ messages in thread
From: Anton Khirnov @ 2012-05-02 20:41 UTC (permalink / raw)
  To: Felipe Contreras, notmuch


On Mon, 23 Apr 2012 04:12:32 +0300, Felipe Contreras <felipe.contreras@gmail.com> wrote:
> Hi,
> 
> I've never been particularly happy with the code of the vim plug-in,
> but it sort of did the job, after some fixes, and has been working
> great so far for most of my needs even though it's clearly very rough
> on the edges.
> 
> However, I'm recently in need of been able to read HTML mails, and
> just trying to add that code was a nightmare, so I decided to look for
> alternatives, including Anton's Python vim plug-in (which is nice, but
> doesn't have support for that), and even learning emacs, to use what
> most people here use (but it turns out the HTML messages don't work
> correctly there either). I also tried the various mutt+notmuch
> options, and none fit the bill.
> 
> So, since I'm a big fan of Ruby, I decided to try my luck writing a
> plug-in from scratch. It took me one weekend, but I'm pretty happy
> with the result. This plug-in has already essentially all the
> functionality of the current one, but it's much, *much* simpler (only
> 600) lines of code.
> 
> And in addition has many more features:
> 
>  * Gradual searches; you don't have to wait for the whole search to finish,
>    sort of like the 'less' command

How did you do that? When I tried to do this in my version, I got hit by
vim not being threadsafe.

-- 
Anton Khirnov

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-05-02 20:41 ` Anton Khirnov
@ 2012-05-04 11:55   ` Felipe Contreras
  0 siblings, 0 replies; 18+ messages in thread
From: Felipe Contreras @ 2012-05-04 11:55 UTC (permalink / raw)
  To: Anton Khirnov; +Cc: notmuch

On Wed, May 2, 2012 at 10:41 PM, Anton Khirnov <anton@khirnov.net> wrote:
>
> On Mon, 23 Apr 2012 04:12:32 +0300, Felipe Contreras <felipe.contreras@gmail.com> wrote:

>>  * Gradual searches; you don't have to wait for the whole search to finish,
>>    sort of like the 'less' command
>
> How did you do that? When I tried to do this in my version, I got hit by
> vim not being threadsafe.

I first started with Ruby fibers, but stumbled upon a bug, and then I
realized I didn't actually need them; in Ruby there is an Enumerable
class, which the Notmuch::Threads class includes, and one of the
methods allows to get only a certain number of items, so regardless of
what happens in the back, I only get a certain number of items at a
time. This is particularly easy thanks to Ruby blocks, but I guess you
can achieve the same in Python somehow.

Each time the cursor changes I check if a certain threshold of items
has been passed, and if so, get one more chunk.

Cheers.

-- 
Felipe Contreras

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-04-28 22:52       ` Alex Ghitza
@ 2012-05-14 18:24         ` Felipe Contreras
  2012-05-15  3:15           ` Karl Harris
  0 siblings, 1 reply; 18+ messages in thread
From: Felipe Contreras @ 2012-05-14 18:24 UTC (permalink / raw)
  To: Alex Ghitza; +Cc: notmuch

On Sun, Apr 29, 2012 at 12:52 AM, Alex Ghitza <aghitza@gmail.com> wrote:
> Felipe Contreras wrote:
>> > vim -c ':NotMuchR'
>> >
>> > all I get is an error message:
>> >
>> > Error detected while processing command line:
>> > E492: Not an editor command: :NotMuchR
>>
>> I don't know if you did anything special to get the normal plug-in to
>> work. Maybe you are doing 'source ~/.vim/plugin/notmuch.vim' directly
>> in your .vimrc, if so, you can try to do the same with notmuch vim
>> ruby. What I have is 'filetype plugin on'.
>
> After banging my head against the wall a bit more, I realised what
> should have been obvious from the beginning: I need to have vim built
> with ruby support.  So after grabbing the vim source and
>
>    ./configure --enable-rubyinterp
>
> I am now happily writing this from notmuch-ruby.  As obvious as this
> should have been, do you think it deserves a short sentence at the top
> of the == install == section of your README?

All right, done :)

-- 
Felipe Contreras

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-05-14 18:24         ` Felipe Contreras
@ 2012-05-15  3:15           ` Karl Harris
  2012-05-15  9:04             ` Felipe Contreras
  2012-05-23 22:03             ` Felipe Contreras
  0 siblings, 2 replies; 18+ messages in thread
From: Karl Harris @ 2012-05-15  3:15 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: notmuch

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

I am trying the notmuch-vim-ruby plugin for the first time.  Previously, I
had been using the vim plugin that comes with notmuch.

If I type :NotMuchR in vim, I get the following error messages:
------------------
Error detected while processing function <SNR>19_NotMuchR:
line  304:
LoadError: /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/notmuch.so: undefined
symbol: _ZTVN10__cxxabiv117__class_type_infoE -
/usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/no
tmuch.so
Error detected while processing function
<SNR>19_NotMuchR..<SNR>19_folders..<SNR>19_new_buffer:
line    6:
NoMethodError: undefined method `push' for nil:NilClass
Error detected while processing function <SNR>19_NotMuchR..<SNR>19_folders:
line    2:
NoMethodError: undefined method `folders_render' for main:Object
-------------

Can anyone point me in the direction of where to start troubleshooting
this?  In the past, I have had issues in other ruby applications that dealt
with ruby versions.  Could this be an issue?

TIA

On Mon, May 14, 2012 at 2:24 PM, Felipe Contreras <
felipe.contreras@gmail.com> wrote:

> On Sun, Apr 29, 2012 at 12:52 AM, Alex Ghitza <aghitza@gmail.com> wrote:
> > Felipe Contreras wrote:
> >> > vim -c ':NotMuchR'
> >> >
> >> > all I get is an error message:
> >> >
> >> > Error detected while processing command line:
> >> > E492: Not an editor command: :NotMuchR
> >>
> >> I don't know if you did anything special to get the normal plug-in to
> >> work. Maybe you are doing 'source ~/.vim/plugin/notmuch.vim' directly
> >> in your .vimrc, if so, you can try to do the same with notmuch vim
> >> ruby. What I have is 'filetype plugin on'.
> >
> > After banging my head against the wall a bit more, I realised what
> > should have been obvious from the beginning: I need to have vim built
> > with ruby support.  So after grabbing the vim source and
> >
> >    ./configure --enable-rubyinterp
> >
> > I am now happily writing this from notmuch-ruby.  As obvious as this
> > should have been, do you think it deserves a short sentence at the top
> > of the == install == section of your README?
>
> All right, done :)
>
> --
> Felipe Contreras
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
>



-- 
Karl Harris

[-- Attachment #2: Type: text/html, Size: 3225 bytes --]

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-05-15  3:15           ` Karl Harris
@ 2012-05-15  9:04             ` Felipe Contreras
  2012-05-23 22:03             ` Felipe Contreras
  1 sibling, 0 replies; 18+ messages in thread
From: Felipe Contreras @ 2012-05-15  9:04 UTC (permalink / raw)
  To: Karl Harris; +Cc: notmuch

On Tue, May 15, 2012 at 5:15 AM, Karl Harris <karlh626@gmail.com> wrote:
> I am trying the notmuch-vim-ruby plugin for the first time.  Previously, I
> had been using the vim plugin that comes with notmuch.
>
> If I type :NotMuchR in vim, I get the following error messages:
> ------------------
> Error detected while processing function <SNR>19_NotMuchR:
> line  304:
> LoadError: /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/notmuch.so: undefined
> symbol: _ZTVN10__cxxabiv117__class_type_infoE -
> /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/no
> tmuch.so
> Error detected while processing function
> <SNR>19_NotMuchR..<SNR>19_folders..<SNR>19_new_buffer:
> line    6:
> NoMethodError: undefined method `push' for nil:NilClass
> Error detected while processing function <SNR>19_NotMuchR..<SNR>19_folders:
> line    2:
> NoMethodError: undefined method `folders_render' for main:Object
> -------------
>
> Can anyone point me in the direction of where to start troubleshooting
> this?  In the past, I have had issues in other ruby applications that dealt
> with ruby versions.  Could this be an issue?

I'm not sure, what does 'ldd
/usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/notmuch.so' shows? Looks
like some C++ stuff is missing somehow.

-- 
Felipe Contreras

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

* Re: [ANN] New awesome vim plug-in using Ruby bindings
  2012-05-15  3:15           ` Karl Harris
  2012-05-15  9:04             ` Felipe Contreras
@ 2012-05-23 22:03             ` Felipe Contreras
  1 sibling, 0 replies; 18+ messages in thread
From: Felipe Contreras @ 2012-05-23 22:03 UTC (permalink / raw)
  To: Karl Harris; +Cc: notmuch

On Tue, May 15, 2012 at 5:15 AM, Karl Harris <karlh626@gmail.com> wrote:
> I am trying the notmuch-vim-ruby plugin for the first time.  Previously, I
> had been using the vim plugin that comes with notmuch.
>
> If I type :NotMuchR in vim, I get the following error messages:
> ------------------
> Error detected while processing function <SNR>19_NotMuchR:
> line  304:
> LoadError: /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/notmuch.so: undefined
> symbol: _ZTVN10__cxxabiv117__class_type_infoE -
> /usr/lib/ruby/site_ruby/1.9.1/x86_64-linux/no
> tmuch.so
> Error detected while processing function
> <SNR>19_NotMuchR..<SNR>19_folders..<SNR>19_new_buffer:
> line    6:
> NoMethodError: undefined method `push' for nil:NilClass
> Error detected while processing function <SNR>19_NotMuchR..<SNR>19_folders:
> line    2:
> NoMethodError: undefined method `folders_render' for main:Object
> -------------
>
> Can anyone point me in the direction of where to start troubleshooting
> this?  In the past, I have had issues in other ruby applications that dealt
> with ruby versions.  Could this be an issue?

Looks like the Ruby bindings are completely broken thanks to (82b73ff
ruby: Add workarounds to use in-tree build not the installed one).
Please use v0.12.

Cheers.

-- 
Felipe Contreras

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

end of thread, other threads:[~2012-05-23 22:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-23  1:12 [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
2012-04-23  3:41 ` Adam Wolfe Gordon
2012-04-23 11:53   ` Felipe Contreras
2012-04-23 13:28     ` Adam Wolfe Gordon
2012-04-23  9:39 ` ruby bindings on OS X are broken? (was Re: [ANN] New awesome vim plug-in using Ruby bindings) Charlie Allom
2012-04-23 12:48   ` Felipe Contreras
2012-04-23 13:11     ` Charlie Allom
2012-04-23 12:05 ` [ANN] New awesome vim plug-in using Ruby bindings Felipe Contreras
2012-04-25 22:29 ` Felipe Contreras
2012-04-28 10:40   ` Alex Ghitza
2012-04-28 12:44     ` Felipe Contreras
2012-04-28 22:52       ` Alex Ghitza
2012-05-14 18:24         ` Felipe Contreras
2012-05-15  3:15           ` Karl Harris
2012-05-15  9:04             ` Felipe Contreras
2012-05-23 22:03             ` Felipe Contreras
2012-05-02 20:41 ` Anton Khirnov
2012-05-04 11:55   ` 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).