Subject: [sup-talk] Gmail Labels Sidebar

From: [email-masked] (Andrei Thorp)
Date: Mon, 8 Jun 2009 17:37:53 -0700

Hello there,

As some of you probably remember, there is a handy sidebar in Gmail
which lists your tags and how many e-mails you have in each one.

What I do with this is have e-mail skip my inbox, get a mailing list
tag applied to it, and then get archived, at which point it shows up
in my labels sidebar. I have my "important" mail in my inbox, and the
mailing lists with updates are clearly marked.

Any suggestions as to what sup users do to have this kind of workflow?
It's preferable for me because it keeps things tidy, I can see the new
mails, and I get >50 e-mails per day. It'd be a shame to have them all
fall into my inbox and spam it up, which I prefer to keep clean for
"needs to be taken care of immediately" type e-mail.

Thanks,

-AT

---

From: [email-masked] (Ben Walton)
Date: Mon, 08 Jun 2009 21:05:06 -0400

> "needs to be taken care of immediately" type e-mail.

Use the Label view.  Hit L followed by enter.

HTH
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090608/563b1ece/attachment.bin>

---

From: [email-masked] (Edward Z. Yang)
Date: Mon, 08 Jun 2009 22:14:30 -0400

> Use the Label view.  Hit L followed by enter.

I think what he's looking for is the information about his labels
to always be present, as opposed to something he has to remind
himself to check.

Cheers,
Edward

---

From: [email-masked] (Ben Walton)
Date: Mon, 08 Jun 2009 22:24:42 -0400

> to always be present, as opposed to something he has to remind

So something similar to the folder view hack/patch for mutt?  That
doesn't exist in sup.  The closest you get is having the 'All Labels'
buffer open.  You can jump to a view of all messages with that label
by hitting enter on the selected label.  Moving back to it is simple
with the buffer rolling keys.  I believe that some people operate from
this buffer instead of the inbox one.  Not my cup of tea though.

HTH.
-Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090608/a9e55e8a/attachment.bin>

---

From: [email-masked] (Andrei Thorp)
Date: Tue, 9 Jun 2009 09:33:15 -0400

Yeah, I guess that makes sense. It is a rather nice interface
actually, I didn't really think about it for some reason.

And I guess there are probably some configuration options to skip
inbox and attach labels to stuff matching stuff automatically, with
procmail. I think I saw a page about that somewhere.

I guess there is probably a way to programatically access this kind of
information also, but are there any command line tools I can use to
query for this kind of stuff? If so, I can hack my window manager's
panels to display the mails in these labels, which would be pretty
rad. (My WM is "Awesome" btw -- that's the name.)

Any suggestions for quickly getting this labels-has-unread-messages
info outside of sup?

Thanks guys! :)

-AT

---

From: [email-masked] (Andrei Thorp)
Date: Tue, 9 Jun 2009 09:42:29 -0400

> actually, I didn't really think about it for some reason.

I just actually ran a quick test (with 0.8) and it looks like the
label-list-mode fails to update automatically D:

What I did was put on the label-list-mode, manually send myself an
e-mail, re-run fetchmail to grab it (I get a notification via procmail
saying it came in). Then I remember that sup polls at intervals, so I
wait.

Eventually, the status bar at the bottom says that there is a new
message in the inbox, but the Inbox label does not get updated in my
view. It still says 0/0.

I press x to go back to the inbox screen, it has the mail. I go back
to label-list-mode, and now it registers it.

So I guess I'd call that a bug actually, and it's unlikely that people
operate out of this mode habitually or else this would have probably
been found.

(Unless it already has?)

Cheers,

-AT

---

From: [email-masked] (Marcus Williams)
Date: Tue, 09 Jun 2009 15:11:08 +0100

> Any suggestions for quickly getting this labels-has-unread-messages

Attached is a labels mode outside of sup... Useful for conky etc. Just
pipe the output to a file (warnings errors etc wont go to the file)

William - if you want to add this to sup/bin feel free. Its basically
the regen_text method lifted and edited slightly from the
label-list-mode

It might need a few more tweaks - I'm not sure it needs to
load/save/unlock the index really. They're there because they came for
free with the copy and paste of bin/sup-tweak-labels :)

Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sup-list-labels
Type: application/octet-stream
Size: 1773 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090609/344b333b/attachment.obj>

---

From: [email-masked] (Marcus Williams)
Date: Tue, 09 Jun 2009 15:24:35 +0100

> pipe the output to a file (warnings errors etc wont go to the file)

Oh and I forgot - if you want to kick off sup from a click on one of
these labels (assuming you can do something like that in your WM) you
can call sup with --search "label:somelabel" to get that label
displayed.

Marcus

---

From: [email-masked] (Marcus Williams)
Date: Tue, 09 Jun 2009 15:29:55 +0100

> the regen_text method lifted and edited slightly from the

You might want to delete lines 24-26 as well to save the warning about
uninitialised variable. At some point I'll post my version with a
query which is a little less hurried, but doesnt work quite how I want
yet.

Marcus

---

From: [email-masked] (Andrei Thorp)
Date: Tue, 9 Jun 2009 10:37:54 -0400

> can call sup with --search "label:somelabel" to get that label

Damn, that's a great idea! I didn't even think about that.

/me checks up on what else sup has in its cli flags.

Cheers,

-AT

PS.

Well, while I'm here, I guess I'll also mention this fairly obvious
script line that just outputs the unread messages in a filtered list:
sup-list-labels 2> /dev/null | grep -E "Inbox|Sent" | sed -r "s/^
*([A-Za-z]*).* ([0-9]+) unread/\1: \2/"

So to go through this:
?- Pipe the stderr to /dev/null (we don't want to see the messages)
?- grep for either "Inbox" or "Sent" -- you can put lots more |blah|blah there
?- sed magic to extract and reformat the data

This might be useful for outputting somewhere like in a shell prompt or panel.

PPS. argh, still not using sup for this mailing list so I replied to
an individual. Forwarded D:

PPPS. Sorry that it wrapped my sed command there, but I'm sure you get the idea.

PPPPS. Sorry about the unfashionable amount of PSes ;)

---

From: [email-masked] (William Morgan)
Date: Fri, 12 Jun 2009 11:56:09 -0700

Reformatted excerpts from Ben Walton's message of 2009-06-08:
> by hitting enter on the selected label.

FWIW, there is some preliminary support for having multiple Sup buffers
sharing the screen. (There's a notion of focus, and x/y/w/h values for
each buffer.) If someone is very excited about having this behavior from
mutt, that's how I'd try and implement it.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Andrei Thorp)
Date: Fri, 12 Jun 2009 15:03:38 -0400

On Fri, Jun 12, 2009 at 2:56 PM, William Morgan<wmorgan-sup at masanjin.net> wrote:
>> So something similar to the folder view hack/patch for mutt? ?That
>> doesn't exist in sup. ?The closest you get is having the 'All Labels'
>> buffer open. ?You can jump to a view of all messages with that label

That is indeed very exciting. Mutt's sidebar is actually very poor and
limiting. If this could
handle it with arbitrary splitting, this would be amazingly amazing.

Thanks :)

-AT

---

From: [email-masked] (William Morgan)
Date: Fri, 12 Jun 2009 12:10:27 -0700

> the regen_text method lifted and edited slightly from the

Nice idea. I'd add such a thing, but I think you can make it
significantly simpler. (As you point out, locking the index is not
necessary.)

Something like:

  #!/usr/bin/env ruby

  require 'sup'
  i = Redwood::Index.new; i.load
  l = Redwood::LabelManager.new File.join(ENV["HOME"], ".sup", "labels.txt")

  l.all_labels.
    map { |label| [label, l.string_for(label)] }.
    sort_by { |label, name| name }.
    each do |label, name|
      total = i.num_results_for :label => label
      unread = (label == :unread)? total : i.num_results_for(:labels => [label, :unread])
      printf "%20s: %6d messages, %6d unread\n", name, total, unread
    end

  puts "yay"

---

From: [email-masked] (William Morgan)
Date: Fri, 12 Jun 2009 12:14:31 -0700

> saying it came in). Then I remember that sup polls at intervals, so I

You can press "P" to force a poll.

> message in the inbox, but the Inbox label does not get updated in my

Yep, currently label-list-mode only updates when one of three things
happens:
 - it gets created
 - it gets focus (you switch to it from another buffer)
 - you press '@'

Also, it only reflects the index state, so if you read a new message
something and don't press "$", it won't reflect that change.

I'd happily accept patches for any of those issues. :)
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Marcus Williams)
Date: Fri, 12 Jun 2009 21:18:10 +0100

> significantly simpler. (As you point out, locking the index is not

Simpler is good - it was a quick hack anyway :) You version works out
of the box so it would be a nice addition to sup/bin

Marcus