pimutils / mates.rs

A very simple commandline addressbook
MIT License
63 stars 9 forks source link

mates search should have option to indicate email address type when doing mutt search #11

Open divansantana opened 9 years ago

divansantana commented 9 years ago

When using mutt search would be nice to display additional detail to indicate which email address this is, work or home or other.

Perhaps it doesn't have to be the default and be configurable...... As some contacts have multiple email addresses it's nice to see which email address for a particular contact this is.

Khard does this by default:

bob@home.com        Bob Nobody     home
bob@workdomain1.com        Bob Nobody     work
bob@example1.com        Bob Nobody     other

I like that mates search is so blazing fast :)

untitaker commented 9 years ago

Mates is quite fast but I fear I'll have to rewrite it because it's become very hard to implement a trivial feature like this one.

I don't know if I ever will have time for this, but a new interface would be closely modelled after ppl.

GSI commented 8 years ago

Any status update on this?

(Just tried ppl 2.4.0. It silently dropped most VCF fields when I ran ppl mv. Disappointing.)

untitaker commented 8 years ago

Not really. I suggest investing effort into making ppl usable (there is a PR open for the problem you describe @GSI).

GSI commented 8 years ago

Hmm too bad. After evaluating ppl yesterday in more detail, I came to the conclusion that it's apparently not developed towards interoperability (with other VCF tools).

Apart from that, it's slow. mutt command for example:

Even if it was just for that one command I'd use mates :)

The only other fast tool I found is pycarddav, but it seems to be slowly dying (and uses sqlite and such).

For completeness, here's my use case on the email type is: If there is an email set as pref, then I have mutt select that one directly without asking. Otherwise it will let me choose between home, work, ...

untitaker commented 8 years ago

I do think that a ppl-clone in a compiled low-level language (Rust! Rust! Rust!) would be useful, but I'm unlikely to attempt it anytime soon. mates just works for my trivial usecases. I manage contacts using my phone.

On Tue, Mar 08, 2016 at 11:49:21AM -0800, GSI wrote:

Hmm too bad. After evaluating ppl yesterday in more detail, I came to the conclusion that it's apparently not developed towards interoperability (with other VCF tools).

Apart from that, it's slow. mutt command for example:

  • ppl 2.15 seconds
  • khard 1.64 seconds
  • mates 0.00 seconds

Even if it was just for that one command I'd use mates :)

The only other fast tool I found is pycarddav, but it seems to be slowly dying (and uses sqlite and such).

For completeness, here's my use case on the email type is: If there is an email set as pref, then I have mutt select that one directly without asking. Otherwise it will let me choose between home, work, ...


Reply to this email directly or view it on GitHub: https://github.com/untitaker/mates.rs/issues/11#issuecomment-193939977

GSI commented 8 years ago

Ok. Maybe I can hardcode the info I require into the output or the index.

GSI commented 8 years ago

I dove into the source today and tracked the issue back into your vobject implementation (https://github.com/untitaker/rust-vobject).

Lacking Rust experience, I finally decided to generate the index using khard: khard email | grep -v '^searching' > ~/.mutt/address_index_from_vcards

The according query_command in mutt is a simple use of grep. With preference for pref addresses, this would be:

set query_command = "echo 'Searching ...' ; grep -i %s'.*pref' ~/.mutt/address_index_from_vcards || grep -i %s ~/.mutt/address_index_from_vcards"

(will cause false-positives on rare occasions where there's a "pref" string in email or name)

I'm documenting this here for any other users who require a solution for fast contact lookup.