From manish at gslab.com Fri Feb 1 03:49:52 2008 From: manish at gslab.com (Manish Sapariya) Date: Fri, 01 Feb 2008 14:19:52 +0530 Subject: [sup-talk] wup In-Reply-To: <1194487545-sup-8478@south> References: <1194487545-sup-8478@south> Message-ID: <47A2DD30.6040502@gslab.com> Hi, Did anyone tried this. When I run merb it says [manish at alioth app]$ merb You are not in the root of a merb application... I tried running it from various directories but did not help. Thanks and Regards, Manish William Morgan wrote: > Hi Suppers, > > My friend Leslie has hacked together "wup", a web interface on top of > Sup: http://jinsync.com/?q=node/16. > > 75 lines of code gets you quite a lot! > > From manish at gslab.com Fri Feb 1 04:08:37 2008 From: manish at gslab.com (Manish Sapariya) Date: Fri, 01 Feb 2008 14:38:37 +0530 Subject: [sup-talk] not all labels are shown in the list of labels first time Message-ID: <47A2E195.1060704@gslab.com> Hi All, I reindexed my mail box after writing all the filter rules that I had to. I was expecting label list to show all the labels that I had applied using filter hook. However I dont see all of them. They are shown in the list once I search for that lable and view the label list again it shows in the list. Regards, Manish From wmorgan-sup at masanjin.net Sat Feb 2 19:58:26 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 16:58:26 -0800 Subject: [sup-talk] [PATCH] return sources in id-order, with non-archived sources first In-Reply-To: <1201272768-sup-3795@spooky.local> References: <1200675726-sup-4860@spooky.local> <1201238649-sup-7598@south> <1201272768-sup-3795@spooky.local> Message-ID: <1202000192-sup-2543@south> Reformatted excerpts from Grant Hollingworth's message of 2008-01-25: > How about changing @sources to an array? The id is important (it's stored directly in the index), so I don't want removing a source to change the id of all following sources. I've merged this into next. -- William From wmorgan-sup at masanjin.net Sat Feb 2 20:06:59 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 17:06:59 -0800 Subject: [sup-talk] [PATCH] Add ability to interrupt current thread operation (search) In-Reply-To: <1201119167-sup-8440@tomsk> References: <1200768101-sup-3312@tomsk> <1200768474-sup-7396@tomsk> <1200769080-sup-4420@tomsk> <1201114113-sup-1607@south> <1201119167-sup-8440@tomsk> Message-ID: <1202000591-sup-8570@south> Reformatted excerpts from Marcus Williams's message of 2008-01-23: > My feeling was it wasnt obvious that you could cancel the operation > without it. If there was some way of making that more obvious > somewhere then the message could be removed. I didnt even realise I > could use ^G elsewhere until fairly recently! After trying it, I do like it better without the extra messages, so next currently has them removed. I could make ^G more promiment in the new user's guide... -- William From wmorgan-sup at masanjin.net Sat Feb 2 20:28:41 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 17:28:41 -0800 Subject: [sup-talk] crash on attachments with ~ In-Reply-To: <1201326444-sup-243@buckwheat> References: <1201326444-sup-243@buckwheat> Message-ID: <1202002106-sup-2745@south> Reformatted excerpts from Daniel Wagner's message of 2008-01-25: > If I type in a filename that starts with ~ at the attachment prompt, > sup crashes. Fixed in next. Thanks. -- William From wmorgan-sup at masanjin.net Sat Feb 2 21:20:50 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 18:20:50 -0800 Subject: [sup-talk] [PATCH] expand file paths and rescue enoent exceptions when adding attachments In-Reply-To: <21aa9f0801261935i12a36782o85030b24078e7dd7@mail.gmail.com> References: <21aa9f0801261918j2890aee2yeb52484a95b786c3@mail.gmail.com> <21aa9f0801261935i12a36782o85030b24078e7dd7@mail.gmail.com> Message-ID: <1202005201-sup-3249@south> I had already come up with a patch for this. Sorry! git diff master..019854 if you're curious. -- William From wmorgan-sup at masanjin.net Sat Feb 2 21:34:02 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 18:34:02 -0800 Subject: [sup-talk] [PATCH] fixed crasher when refining search and updated keybinding In-Reply-To: <1201325529-812-1-git-send-email-chrisw@rice.edu> References: <1201325529-812-1-git-send-email-chrisw@rice.edu> Message-ID: <1202005927-sup-5664@south> Reformatted excerpts from Christopher Warrington's message of 2008-01-25: > Refine search no longer crashes. This seems fine. At first I thought it was a little weird that the extra_opts are being discarded on refinement, but now I think that's actually the right thing to do. One minor tweak request: can you split this into two patches, one for the keybinding change and one for the bugfix? Thanks! -- William From wmorgan-sup at masanjin.net Sat Feb 2 21:35:28 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 18:35:28 -0800 Subject: [sup-talk] [PATCH] fixed crasher when refining search and updated keybinding In-Reply-To: <1201453197-sup-1113@tangerine.lanl.gov> References: <1201325529-812-1-git-send-email-chrisw@rice.edu> <1201453197-sup-1113@tangerine.lanl.gov> Message-ID: <1202006046-sup-3057@south> Reformatted excerpts from John Bent's message of 2008-01-27: > Refine search is very nice. Something else which might be nice would > be a persistent search history which could be scrolled through with > the up and down arrow keys. That feature would then include refine > search. There is a non-persistent (but contextually-aware!) search history accessible via up and down keys now. Persisting that to disk wouldn't be very hard at all. -- William From wmorgan-sup at masanjin.net Sat Feb 2 21:56:40 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 18:56:40 -0800 Subject: [sup-talk] [PATCH] first pass at a simple interface to extract URIs from a message In-Reply-To: <21aa9f0801291923w2df946dbga7832a7345c09a95@mail.gmail.com> References: <21aa9f0801291923w2df946dbga7832a7345c09a95@mail.gmail.com> Message-ID: <1202007092-sup-19@south> Reformatted excerpts from brabuhr's message of 2008-01-29: > This adds a new key binding to the thread-view mode (L) to assist with > loading URIs from the body of the message. This first pass will pull > the URIs from the message text and loop through them while asking if > that URI should be loaded. Currently, there is no code to actually > perform the load. Looks good. I have a slight preference for a "if uris.size == 0" block that flashes a message and returns, so that the meat of the method doesn't have to be too indented. My limited research indicates that there isn't a standard way (like mailcap) of viewing a URL. So probably a "view-url" hook is the best way to approach the actual viewing code. -- William From wmorgan-sup at masanjin.net Sat Feb 2 22:01:25 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 19:01:25 -0800 Subject: [sup-talk] missing run-mailcap In-Reply-To: <1201718069-sup-9900@tangerine.lanl.gov> References: <1201019996-sup-8960@tangerine.lanl.gov> <1201041081-sup-6034@tangerine.lanl.gov> <1201210323-sup-6116@tangerine.lanl.gov> <1201216741-sup-4105@south> <1201218489-sup-3542@tangerine.lanl.gov> <1201220092-sup-8263@south> <1201222453-sup-1190@spooky.local> <1201235901-sup-7426@tangerine.lanl.gov> <1201307667-sup-2659@tangerine.lanl.gov> <1201714011-sup-6178@south> <1201715536-sup-6254@tangerine.lanl.gov> <1201717294-sup-1892@south> <1201718069-sup-9900@tangerine.lanl.gov> Message-ID: <1202007682-sup-2115@south> Reformatted excerpts from John Bent's message of 2008-01-30: > Ah. But > system "open '#{filename}'" > false > > works perfectly! (not sure that's expected but I'm happy!) The only explanation is that you are living in a bizarro world where true is false and false is true. Seriously. That makes no sense. -- William From chrisw at rice.edu Sat Feb 2 22:49:04 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Sat, 2 Feb 2008 21:49:04 -0600 Subject: [sup-talk] [PATCH] fixed crasher when refining search In-Reply-To: <1202005927-sup-5664@south> References: <1202005927-sup-5664@south> Message-ID: <1202010544-816-1-git-send-email-chrisw@rice.edu> Refine Search no longer crashes. --- lib/sup/modes/search-results-mode.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) mode change 100644 => 100755 lib/sup/modes/search-results-mode.rb diff --git a/lib/sup/modes/search-results-mode.rb b/lib/sup/modes/search-results-mode.rb old mode 100644 new mode 100755 index f64a227..a03f0a2 --- a/lib/sup/modes/search-results-mode.rb +++ b/lib/sup/modes/search-results-mode.rb @@ -15,7 +15,7 @@ class SearchResultsMode < ThreadIndexMode def refine_search query = BufferManager.ask :search, "query: ", (@qobj.to_s + " ") return unless query && query !~ /^\s*$/ - SearchResultsMode.spawn_from_query query, @qopts + SearchResultsMode.spawn_from_query query end ## a proper is_relevant? method requires some way of asking ferret -- 1.5.3.8 From chrisw at rice.edu Sat Feb 2 22:49:19 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Sat, 2 Feb 2008 21:49:19 -0600 Subject: [sup-talk] [PATCH] tweaked Refine Search keybinding In-Reply-To: <1202005927-sup-5664@south> References: <1202005927-sup-5664@south> Message-ID: <1202010559-3708-1-git-send-email-chrisw@rice.edu> Refine Search is now bound to |. On most standard 104-key keyboards, this appears to be shifted \, which fits in nicely since \ is global search now. --- lib/sup/modes/search-results-mode.rb | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sup/modes/search-results-mode.rb b/lib/sup/modes/search-results-mode.rb index a03f0a2..6fdc58a 100755 --- a/lib/sup/modes/search-results-mode.rb +++ b/lib/sup/modes/search-results-mode.rb @@ -9,11 +9,11 @@ class SearchResultsMode < ThreadIndexMode end register_keymap do |k| - k.add :refine_search, "Refine search", '.' + k.add :refine_search, "Refine search", '|' end def refine_search - query = BufferManager.ask :search, "query: ", (@qobj.to_s + " ") + query = BufferManager.ask :search, "refine query: ", (@qobj.to_s + " ") return unless query && query !~ /^\s*$/ SearchResultsMode.spawn_from_query query end -- 1.5.3.8 From wmorgan-sup at masanjin.net Sat Feb 2 23:24:51 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 20:24:51 -0800 Subject: [sup-talk] Is sup slow on cygwin In-Reply-To: <479C0534.30602@gslab.com> References: <479AF45A.6060007@gslab.com> <1201376227-sup-7884@chris-tablet> <479C0534.30602@gslab.com> Message-ID: <1202012673-sup-6840@south> Manish, Did you ever resolve this? -- William From wmorgan-sup at masanjin.net Sat Feb 2 23:26:36 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 20:26:36 -0800 Subject: [sup-talk] [BUG] When marking a spam, the mail don't disappear In-Reply-To: <1201596013-sup-3324@port-ext5.ensta.fr> References: <1201596013-sup-3324@port-ext5.ensta.fr> Message-ID: <1202012696-sup-7790@south> Reformatted excerpts from nicolas.pouillard's message of 2008-01-29: > I've hit a bug when marking a spam in thread-view-mode (using ",s") > and then going to inbox (using "x"), the spam seems still there, > but in fact it was already deleted, just not remove from the list > (hitting "$@" is my current workaroud). I believe I've fixed this in next. I've also just made the dispatch-and-something changes (,whatever and .whatever) NOT automatically write to the index. So now they're consistent with the rest of Sup---changes are only saved once you close the corresponding thread-index-mode, or hit $. -- William From wmorgan-sup at masanjin.net Sat Feb 2 23:31:00 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 20:31:00 -0800 Subject: [sup-talk] [PATCH] don't try to open the next thread if there isn't one available In-Reply-To: <1201681010-sup-3463@archie> References: <1201681010-sup-3463@archie> Message-ID: <1202012826-sup-1965@south> Reformatted excerpts from its.jeff.balogh's message of 2008-01-30: > When you're on the last thread of a ThreadSet and press ',', > nothing happens, but you can't '.' since @dying == true. This > patch changes :next to :kill if there is no next thread. I made a parallel change to do this: e47f9dabca0349a1fff046232961b38d900d4445. It's all withing ThreadIndexMode#launch_next_thread_after, which I think is a little cleaner. As I mentioned in the previous email, I also just changed these operations so that they don't automatically save state to disk, so as to be consistent with the rest of Sup. -- William From wmorgan-sup at masanjin.net Sat Feb 2 23:35:33 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 20:35:33 -0800 Subject: [sup-talk] [PATCH] don't try to open the next thread if there isn't one available In-Reply-To: <1201732604-sup-4815@archie> References: <1201681010-sup-3463@archie> <1201732604-sup-4815@archie> Message-ID: <1202013064-sup-8151@south> Reformatted excerpts from its.jeff.balogh's message of 2008-01-30: > The :next case guards against this exception with 'if block_given? && > yield'. If I put that in the :kill case, those two lines will be > exact duplicates of the lines above. > > Is there a clean way to handle this? I'm learning Ruby as I go along, > so please forgive me if the answer is obvious. To answer your question, depends what you mean by clean. We can capture the shared lines in a closure with lambda { ... }, or we can move them to a function and call the function, but that's basically the extent of the control flow power we have here. (Well, unless we want to start using continuations!) In the latest version of the code, the shared lines are now exactly the same, and are simply duplicated. Maybe once a :prev branch is added a refactor will be necessary. -- William From wmorgan-sup at masanjin.net Sat Feb 2 23:44:41 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 20:44:41 -0800 Subject: [sup-talk] can't remove draft label In-Reply-To: <1201759596-sup-4274@tangerine.lanl.gov> References: <1201716067-sup-3586@tangerine.lanl.gov> <1201754138-sup-7276@chris-tablet> <1201759596-sup-4274@tangerine.lanl.gov> Message-ID: <1202013739-sup-550@south> Reformatted excerpts from John Bent's message of 2008-01-30: > But that was just the message I'd previously deleted from the drafts > dir. The false draft is still there... I'm not sure why that label would be there, but you can perform some index surgery to remove it. $ sh devel/console.sh irb(main):001:0> r=Index.ferret.search("message_id:1201759596-sup-4274 at tangerine.lanl.gov") => #], max_score=10.82630443573, searcher=#> irb(main):002:0> id=r.hits.first.doc => 92571 irb(main):003:0> m = Index.build_message id [...] irb(main):004:0> m.remove_label :draft => true irb(main):005:0> m.save Index => false irb(main):006:0> exit Something like that. Plug in the correct message-id above. -- William From wmorgan-sup at masanjin.net Sat Feb 2 23:54:04 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 20:54:04 -0800 Subject: [sup-talk] [PATCH] spelling error In-Reply-To: <1201803937-sup-5871@red> References: <1201803937-sup-5871@red> Message-ID: <1202014434-sup-5831@south> Applied, thanks! -- William From wmorgan-sup at masanjin.net Sun Feb 3 00:09:17 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Sat, 02 Feb 2008 21:09:17 -0800 Subject: [sup-talk] [PATCH] tweaked Refine Search keybinding In-Reply-To: <1202010559-3708-1-git-send-email-chrisw@rice.edu> References: <1202005927-sup-5664@south> <1202010559-3708-1-git-send-email-chrisw@rice.edu> Message-ID: <1202015348-sup-9371@south> Both in next. Thanks! -- William From chrisw at rice.edu Sun Feb 3 03:11:11 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Sun, 3 Feb 2008 02:11:11 -0600 Subject: [sup-talk] Possible fix for ferret "Permission denied" errors Message-ID: <1202026272-3432-1-git-send-email-chrisw@rice.edu> In the forthcoming patch, I have proposed a possible fix for the ferret "Permission denied" error some have been getting. I run sup under Cygwin. Before, when I was composing an e-mail and sup did a background poll and found new messages, sup would crash with the ferret error "Permission denied". I think that this has to do with Windows different file sharing semantics. I've been running with this patch for a while now and not had another "Permission denied" error. However, I have not been able to test it on a non-Cygwin setup. I also don't know if this is the proper way to address this issue. To me, it seems mery much like a hack. Is there a clean way to either close all open files, get a list of FDs in use, or get the maximum FD allowed? Comments welcome and encouraged! From chrisw at rice.edu Sun Feb 3 03:11:12 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Sun, 3 Feb 2008 02:11:12 -0600 Subject: [sup-talk] [PATCH] shell commands are now run in a child process Message-ID: <1202026272-3432-2-git-send-email-chrisw@rice.edu> When shelling out, the external command is now run in a child process. Before the external command is run, all (I hope) of sup's open files are closed first. This should fix the ferret "Permission denied" errors on Windows. --- lib/sup/buffer.rb | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index 4374fa8..7768011 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -696,11 +696,36 @@ EOS draw_screen :refresh => true end + ## There is no good way that I can find the get the maximum fd allowed. + ## On the POSIX systems I have played with, 500 seems to be the maximum. On Windows, + ## 2048 is the documented maximum (for the C Runtime Library). + MAX_FD = 2048 + def shell_out command @shelled = true Ncurses.sync do Ncurses.endwin - system command + + child_pid = fork + if child_pid == nil + ## child process + + start_fd = 1 + [STDIN.fileno, STDOUT.fileno, STDERR.fileno].max # don't close these + start_fd.upto(MAX_FD) do |fd| + begin + IO.for_fd(fd).close + rescue Errno::EBADF + ## fd is not open: ignore and move on + end + end + + exec(command) + ## never gets here + else + ## sup process + Process.waitpid(child_pid, Process::WUNTRACED) # catch an already dead child + end + Ncurses.refresh Ncurses.curs_set 0 end -- 1.5.3.8 From nicolas.pouillard at gmail.com Sun Feb 3 06:15:53 2008 From: nicolas.pouillard at gmail.com (Nicolas Pouillard) Date: Sun, 03 Feb 2008 12:15:53 +0100 Subject: [sup-talk] [BUG] When marking a spam, the mail don't disappear In-Reply-To: <1202012696-sup-7790@south> References: <1201596013-sup-3324@port-ext5.ensta.fr> <1202012696-sup-7790@south> Message-ID: <1202037178-sup-2704@ausone.local> Excerpts from William Morgan's message of Sun Feb 03 05:26:36 +0100 2008: > Reformatted excerpts from nicolas.pouillard's message of 2008-01-29: > > I've hit a bug when marking a spam in thread-view-mode (using ",s") > > and then going to inbox (using "x"), the spam seems still there, > > but in fact it was already deleted, just not remove from the list > > (hitting "$@" is my current workaroud). > > I believe I've fixed this in next. Thanks! > I've also just made the dispatch-and-something changes (,whatever and > .whatever) NOT automatically write to the index. So now they're > consistent with the rest of Sup---changes are only saved once you close > the corresponding thread-index-mode, or hit $. That's not completely convenient since '$' is not available in thread-view-mode. Moreover it's bound to "moving to the last line", which is not that useful since there is already two other bindings for that. -- Nicolas Pouillard aka Ertai -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080203/99274f2d/attachment.bin From manish at gslab.com Mon Feb 4 00:12:34 2008 From: manish at gslab.com (Manish Sapariya) Date: Mon, 04 Feb 2008 10:42:34 +0530 Subject: [sup-talk] Is sup slow on cygwin In-Reply-To: <1202012673-sup-6840@south> References: <479AF45A.6060007@gslab.com> <1201376227-sup-7884@chris-tablet> <479C0534.30602@gslab.com> <1202012673-sup-6840@south> Message-ID: <47A69EC2.8060707@gslab.com> Hi William, I could not resolve it when working with Thunderbird mbox files. However then I moved to fetchmail and procmail, with maildir mail box and things are working fine. Just to add more context, I had nightmare getting sup working with thunderbird mbox files (even on linux) and eventually I decided to go for fetchmail to fetch my mails and things are working perfectly fine. However if you are curious to know what goes wrong when working with Thunderbird mbox file, I may try out again and post the results. Thanks and Regards, Manish William Morgan wrote: > Manish, > > Did you ever resolve this? > > From manish at gslab.com Mon Feb 4 04:34:51 2008 From: manish at gslab.com (Manish Sapariya) Date: Mon, 04 Feb 2008 15:04:51 +0530 Subject: [sup-talk] Need help to use/customize sup Message-ID: <47A6DC3B.4090808@gslab.com> Hi all, Essentially I want to know: - How can I mark all marked/tagged mails/threads as read. - Can I tell sup, to not show any mail/thread in inbox, if mail has no inbox label. This is the way I operate Thunderbird and I wanted to keep my workflow same for both. Thanks and Regards, Manish From manish at gslab.com Mon Feb 4 04:51:27 2008 From: manish at gslab.com (Manish Sapariya) Date: Mon, 04 Feb 2008 15:21:27 +0530 Subject: [sup-talk] Need help to use/customize sup In-Reply-To: <47A6DC3B.4090808@gslab.com> References: <47A6DC3B.4090808@gslab.com> Message-ID: <47A6E01F.3020506@gslab.com> One more things is that when I press @ to refresh the inbox view, I see many other threads which do not have inbox label in it. Do I have to take any extra action on all those messages? I believe they are all unread messages? Is this the case? Thanks, Manish Manish Sapariya wrote: > Hi all, > Essentially I want to know: > - How can I mark all marked/tagged mails/threads as read. > - Can I tell sup, to not show any mail/thread in inbox, if mail has no inbox > label. > > This is the way I operate Thunderbird and I wanted to keep my workflow > same for both. > > Thanks and Regards, > Manish > > _______________________________________________ > sup-talk mailing list > sup-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/sup-talk > > From chrisw at rice.edu Mon Feb 4 06:04:42 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Mon, 04 Feb 2008 05:04:42 -0600 Subject: [sup-talk] Need help to use/customize sup In-Reply-To: <47A6DC3B.4090808@gslab.com> References: <47A6DC3B.4090808@gslab.com> Message-ID: <1202122974-sup-1896@chris-tablet> Excerpts from Manish Sapariya's message of Mon Feb 04 03:34:51 -0600 2008: > - How can I mark all marked/tagged mails/threads as read. Tag threads with 't', press ';' for apply, press 'N' to toggle from unread to read. If you have a search that includes both read and unread threads, you can select only the unread threads by including "is:unread" in your query. You can use tag and apply with other commands too, like delete and label. > - Can I tell sup, to not show any mail/thread in inbox, if mail has no inbox > label. That's what it does already. However, in the inbox view, the "inbox" label is not shown. It IS shown in other views, like the search results view. If you don't want a thread to reappear in the inbox when a new message arrives, kill it with '&' instead of archiving it with 'a'. -- Christopher Warrington Jones College From chrisw at rice.edu Mon Feb 4 06:07:35 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Mon, 04 Feb 2008 05:07:35 -0600 Subject: [sup-talk] Need help to use/customize sup In-Reply-To: <47A6E01F.3020506@gslab.com> References: <47A6DC3B.4090808@gslab.com> <47A6E01F.3020506@gslab.com> Message-ID: <1202123094-sup-752@chris-tablet> Excerpts from Manish Sapariya's message of Mon Feb 04 03:51:27 -0600 2008: > One more things is that when I press @ to refresh the inbox view, I > see many other threads which do not have inbox label in it. Do I have > to take any extra action on all those messages? I believe they are all > unread messages? Is this the case? This is a bug (I think) in recent version. Initially, these threads are not displayed because of sup's 20 message result limit. Re-running the query with @ pulls in all threads. I could be wrong about the above: I'm not looking at the code right now. All the messages have the inbox label. As I said in my other message, you just don't see it in the inbox view. Open the thread and you will see inbox in the list of labels. -- Christopher Warrington Jones College From manish at gslab.com Mon Feb 4 07:53:35 2008 From: manish at gslab.com (Manish Sapariya) Date: Mon, 04 Feb 2008 18:23:35 +0530 Subject: [sup-talk] Need help to use/customize sup In-Reply-To: <1202122974-sup-1896@chris-tablet> References: <47A6DC3B.4090808@gslab.com> <1202122974-sup-1896@chris-tablet> Message-ID: <47A70ACF.4090005@gslab.com> Hi Chris, I have some comments inline. Christopher Warrington wrote: > Tag threads with 't', press ';' for apply, press 'N' to toggle from > unread to read. > > If you have a search that includes both read and unread threads, you can > select only the unread threads by including "is:unread" in your query. > is:unread is very good trick. Thanks. > You can use tag and apply with other commands too, like delete and label. > I am not sure if I am missing something here, but I could not delete labels from all tagged threads. I could remove label from single though. > If you don't want a thread to reappear in the inbox when a new message > arrives, kill it with '&' instead of archiving it with 'a'. > > Just so that I understand it, kill will remove the thread from appearing from inbox, but in my search results it will show up? Thanks and Regards, Manish From manish at gslab.com Mon Feb 4 08:13:25 2008 From: manish at gslab.com (Manish Sapariya) Date: Mon, 04 Feb 2008 18:43:25 +0530 Subject: [sup-talk] Need help to use/customize sup In-Reply-To: <1202122974-sup-1896@chris-tablet> References: <47A6DC3B.4090808@gslab.com> <1202122974-sup-1896@chris-tablet> Message-ID: <47A70F75.4020006@gslab.com> Also, Is there anything using which I can load all messages? I have to do M to load all messages until it says no messages found. Thanks, Manish From gsf at fruct.us Mon Feb 4 10:12:21 2008 From: gsf at fruct.us (Gabriel Sean Farrell) Date: Mon, 4 Feb 2008 10:12:21 -0500 Subject: [sup-talk] Persistence between IMAP clients Message-ID: <20080204151221.GA29477@manheim.library.drexel.edu> Is there a way to persist the labels applied from an instance of sup IMAPing from one machine to another instance on another machine? I check my mail from four different computers on a regular basis, and I haven't figured out, for example, how to delete emails when checking with one machine and see them as deleted (that is, *not* see them in my inbox) when checking with another. Gabriel From marcus-sup at bar-coded.net Mon Feb 4 12:12:55 2008 From: marcus-sup at bar-coded.net (Marcus Williams) Date: Mon, 04 Feb 2008 17:12:55 +0000 Subject: [sup-talk] Need help to use/customize sup In-Reply-To: <47A70F75.4020006@gslab.com> References: <47A6DC3B.4090808@gslab.com> <1202122974-sup-1896@chris-tablet> <47A70F75.4020006@gslab.com> Message-ID: <1202145050-sup-9087@tomsk> On 4.2.2008, Manish Sapariya wrote: > Also, > Is there anything using which I can load all messages? I have to do > M to load all messages until it says no messages found. depending on the version of sup you are running, "!!" should do it. Hit ctrl-g to stop the operation (as getting all threads in some circumstances is going to hurt if you've got a large mailbox) Marcus From johnbent at lanl.gov Mon Feb 4 13:46:16 2008 From: johnbent at lanl.gov (John Bent) Date: Mon, 04 Feb 2008 11:46:16 -0700 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <20080204151221.GA29477@manheim.library.drexel.edu> References: <20080204151221.GA29477@manheim.library.drexel.edu> Message-ID: <1202149761-sup-2303@tangerine.lanl.gov> Excerpts from Gabriel Sean Farrell's message of Mon Feb 04 08:12:21 -0700 2008: > Is there a way to persist the labels applied from an instance of sup > IMAPing from one machine to another instance on another machine? I > check my mail from four different computers on a regular basis, and I > haven't figured out, for example, how to delete emails when checking > with one machine and see them as deleted (that is, *not* see them in my > inbox) when checking with another. > This isn't really answering your question but ... the reason I use sup is because I can then use multiple computers to check email but have a persistent view (exactly like what you want). However, the way I do this is not by figuring out how to maintain consistent labeling state across the multiple instances but rather by only actually running sup from one machine. I then can check email from multiple computers by always ssh'ing to that machine. That's why I like sup: it's console based and lends itself perfectly to this approach. Even though this probably wasn't the answer you were looking for, I fear it might be the best one you get. sup isn't designed to actually modify any of your existing mail folders. It only reads them and then maintains its own external state. So, for example, you can't configure sup to delete emails from an IMAP server. What you can do is configure an external program like fetchmail to pull the emails (and delete them from the IMAP server) and put them into a local mbox on your machine which sup can then read. That might work for you; however, you'll splinter your emails. Emails which are read on one machine won't appear on your other three. What you want is for sup to just read from the IMAP server and leave them there and then for the four multiple instances of sup to share their state with each other. But they have no mechanism for doing so - they'd need some server somewhere to help them and they'd also need a bunch of code to implement that functionality. You could try to get that functionality transparently by using a distributed file system shared across the four machines in which you keep your .sup folder. That should work (unless maybe there is binary data kept in the .sup files and you have endian incompatibility across the four machines). You could try to approximate the shared file system thing by using something like cvs or git, but that would be a big silly hassle. Unless anyone else thinks of something better, I think the ssh approach is your best bet. My only remaining limitation with the ssh scheme is that my primary machine is my desktop so I am not able to slurp down a bunch of new emails onto my laptop and work on them from the plane... (the answer of course is to make the laptop be the primary machine but that doesn't work for a couple of other various reasons). John From manish at gslab.com Tue Feb 5 04:30:01 2008 From: manish at gslab.com (Manish Sapariya) Date: Tue, 05 Feb 2008 15:00:01 +0530 Subject: [sup-talk] Need help to use/customize sup In-Reply-To: <1202122974-sup-1896@chris-tablet> References: <47A6DC3B.4090808@gslab.com> <1202122974-sup-1896@chris-tablet> Message-ID: <1202203637-sup-4581@alioth.gs-lab.com> > If you don't want a thread to reappear in the inbox when a new message > arrives, kill it with '&' instead of archiving it with 'a'. > I hope I not missing something obvious, but I am seeing messages killed again in my inbox. It does have killed label. By the way, thanks for all the help. I am now using sup for all my mail communication. It does crash once in a while, mostly when I do some quick operation of loading messages and opening them and most of the issues seems to be while accessing the index. Thanks and Regards, -Manish From patroclo7 at gmail.com Tue Feb 5 04:56:33 2008 From: patroclo7 at gmail.com (Giorgio Lando) Date: Tue, 05 Feb 2008 10:56:33 +0100 Subject: [sup-talk] upgrade to gettext 1.90.0 breaks encodings Message-ID: <1202205301-sup-5725@clarabella.clarabella> After upgrading with gem to the recent gettext 1.90.0, my encoding was not anymore identified and it defaulted to UTF8. Downgrading again to gettext 1.10.0 fixes the issue -- Giorgio Lando From wmorgan-sup at masanjin.net Tue Feb 5 11:42:03 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Tue, 05 Feb 2008 08:42:03 -0800 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <20080204151221.GA29477@manheim.library.drexel.edu> References: <20080204151221.GA29477@manheim.library.drexel.edu> Message-ID: <1202229600-sup-4858@south> Reformatted excerpts from Gabriel Sean Farrell's message of 2008-02-04: > Is there a way to persist the labels applied from an instance of sup > IMAPing from one machine to another instance on another machine? I > check my mail from four different computers on a regular basis, and I > haven't figured out, for example, how to delete emails when checking > with one machine and see them as deleted (that is, *not* see them in my > inbox) when checking with another. There is no good way to do this. There are bad ways (you can dump all your labels with sup-dump, send them over, and apply them with sup-sync). Sup will probably never work well in this kind of setup. -- William From wmorgan-sup at masanjin.net Tue Feb 5 12:27:26 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Tue, 05 Feb 2008 09:27:26 -0800 Subject: [sup-talk] [PATCH] don't try to open the next thread if there isn't one available In-Reply-To: <1201707688-sup-6637@tangerine.lanl.gov> References: <1201681010-sup-3463@archie> <1201707688-sup-6637@tangerine.lanl.gov> Message-ID: <1202232384-sup-1186@south> Reformatted excerpts from John Bent's message of 2008-01-30: > Perhaps I should just change my habits but I like to traverse my inbox in > chronological order (i.e. bottom up instead of top down). If anyone could > make a patch that does ,a or ,n but moves it up instead of down, I'd very > much appreciate it. I do this too, often. Try ']' in next. I really need a better keybinding. Wonder if I just should bite the bullet and do < and > for previous and next instead of , and ]. -- William From patroclo7 at gmail.com Tue Feb 5 12:31:14 2008 From: patroclo7 at gmail.com (Giorgio Lando) Date: Tue, 5 Feb 2008 18:31:14 +0100 Subject: [sup-talk] [PATCH] allow user to make a gem with a specific version number Message-ID: <1202232674-20414-1-git-send-email-patroclo7@gmail.com> If one want to make a gem from a git version of sup, he can also want to define a version number (e.g. in the form .1, so that when a new version is released the gem will be updated nonetheless). With this patch the version can be defined with the REL environment variable (as in ferret Rakefile) --- Rakefile | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index f99246f..289da64 100644 --- a/Rakefile +++ b/Rakefile @@ -9,9 +9,13 @@ end # thanks to "Mike H" ## allow people who use development versions by running "rake gem" ## and installing the resulting gem it to be able to do this. (gem -## versions must be in dotted-digit notation only). -version = Redwood::VERSION == "git" ? "999" : Redwood::VERSION - +## versions must be in dotted-digit notation only and can be passed +## with the REL environment variable to "rake gem"). +if ENV['REL'] + version = ENV['REL'] +else + version = Redwood::VERSION == "git" ? "999" : Redwood::VERSION +end Hoe.new('sup', version) do |p| p.rubyforge_name = 'sup' p.author = "William Morgan" -- 1.5.4 From wmorgan-sup at masanjin.net Tue Feb 5 12:34:12 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Tue, 05 Feb 2008 09:34:12 -0800 Subject: [sup-talk] [PATCH] shell commands are now run in a child process In-Reply-To: <1202026272-3432-2-git-send-email-chrisw@rice.edu> References: <1202026272-3432-2-git-send-email-chrisw@rice.edu> Message-ID: <1202232814-sup-1005@south> Reformatted excerpts from Christopher Warrington's message of 2008-02-03: > When shelling out, the external command is now run in a child process. > Before the external command is run, all (I hope) of sup's open files > are closed first. This seems crazy. Do mbox sources even continue to function properly once this has happened? It seems like they'd crash with their file handles closed from under them. If the issue is that Windows has bad behavior when Sup polls while you're editing a message, another option might be to turn off polling when Sup is shelled out. Something like (although this doesn't prevent you from starting an editor while a background poll is in progress): diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index d40a626..96f676b 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -137,6 +137,7 @@ class BufferManager include Singleton attr_reader :focus_buf + bool_reader :shelled ## we have to define the key used to continue in-buffer search here, because ## it has special semantics that BufferManager deals with---current searches diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb index 2dd9150..a67e801 100644 --- a/lib/sup/poll.rb +++ b/lib/sup/poll.rb @@ -45,7 +45,8 @@ EOS end def poll - return if @polling + return if @polling || BufferManager.shelled? + @polling = true HookManager.run "before-poll" -- William From wmorgan-sup at masanjin.net Tue Feb 5 12:50:33 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Tue, 05 Feb 2008 09:50:33 -0800 Subject: [sup-talk] [PATCH] allow user to make a gem with a specific version number In-Reply-To: <1202232674-20414-1-git-send-email-patroclo7@gmail.com> References: <1202232674-20414-1-git-send-email-patroclo7@gmail.com> Message-ID: <1202233803-sup-1311@south> Reformatted excerpts from Giorgio Lando's message of 2008-02-05: > If one want to make a gem from a git version of sup, he can also want > to define a version number (e.g. in the form release>.1, so that when a new version is released the gem will be > updated nonetheless). With this patch the version can be defined with > the REL environment variable (as in ferret Rakefile) Applied, thanks! -- William From magnus at therning.org Tue Feb 5 14:12:10 2008 From: magnus at therning.org (Magnus Therning) Date: Tue, 05 Feb 2008 19:12:10 +0000 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202229600-sup-4858@south> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> Message-ID: <47A8B50A.3030302@therning.org> William Morgan wrote: > Reformatted excerpts from Gabriel Sean Farrell's message of 2008-02-04: >> Is there a way to persist the labels applied from an instance of sup >> IMAPing from one machine to another instance on another machine? I >> check my mail from four different computers on a regular basis, and I >> haven't figured out, for example, how to delete emails when checking >> with one machine and see them as deleted (that is, *not* see them in my >> inbox) when checking with another. > > There is no good way to do this. There are bad ways (you can dump all > your labels with sup-dump, send them over, and apply them with > sup-sync). > > Sup will probably never work well in this kind of setup. Would it be possible to simply use unison to synchronise the machines? As long as you can make sure to avoid conflicts and you can make sure system-specific settings (such as file locations and server settings) are the same it /could/ work. Please note that I've never tried it with sup, but other MUAs have worked fine this way. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus?therning?org Jabber: magnus?therning?gmail?com http://therning.org/magnus What if I don't want to obey the laws? Do they throw me in jail with the other bad monads? -- Daveman -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080205/27dda927/attachment.bin From chrisw at rice.edu Tue Feb 5 14:29:19 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Tue, 05 Feb 2008 13:29:19 -0600 Subject: [sup-talk] [PATCH] shell commands are now run in a child process In-Reply-To: <1202232814-sup-1005@south> References: <1202026272-3432-2-git-send-email-chrisw@rice.edu> <1202232814-sup-1005@south> Message-ID: <1202239755-sup-3523@chris-tablet> Excerpts from William Morgan's message of Tue Feb 05 11:34:12 -0600 2008: >> When shelling out, the external command is now run in a child >> process. Before the external command is run, all (I hope) of sup's >> open files are closed first. > This seems crazy. Do mbox sources even continue to function properly > once this has happened? It seems like they'd crash with their file > handles closed from under them. No, it's not elegant at all. mbox sources do still work, though. I only close the files in the child process. They remain open in sup's main process. Setting the file descriptors to FD_CLOEXEC would be a cleaner solution, but I don't think that this works on Cygwin (or is accessible via Ruby). > If the issue is that Windows has bad behavior when Sup polls while > you're editing a message, another option might be to turn off polling > when Sup is shelled out. That's a thought. If I get some time, I may be able to dig into this. -- Christopher Warrington From wmorgan-sup at masanjin.net Tue Feb 5 14:51:08 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Tue, 05 Feb 2008 11:51:08 -0800 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <47A8B50A.3030302@therning.org> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> <47A8B50A.3030302@therning.org> Message-ID: <1202240647-sup-2072@south> Reformatted excerpts from Magnus Therning's message of 2008-02-05: > Would it be possible to simply use unison to synchronise the machines? If ~/.sup/sources.yaml and ~/.sup/ferret are both synchronized, that should basically work. Of course, unless Unison does sub-file synchronization, synchronizing the ferret index could be slow. And conflicts won't really be mergeable; you'll have to pick one version or the other. -- William From wmorgan-sup at masanjin.net Tue Feb 5 15:12:23 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Tue, 05 Feb 2008 12:12:23 -0800 Subject: [sup-talk] [PATCH] shell commands are now run in a child process In-Reply-To: <1202239755-sup-3523@chris-tablet> References: <1202026272-3432-2-git-send-email-chrisw@rice.edu> <1202232814-sup-1005@south> <1202239755-sup-3523@chris-tablet> Message-ID: <1202241831-sup-1777@south> Reformatted excerpts from Christopher Warrington's message of 2008-02-05: > No, it's not elegant at all. mbox sources do still work, though. I > only close the files in the child process. They remain open in sup's > main process. Oh, I see. Sorry, I misread the patch. It would be good to understand this a bit more. Why are the Ferret errors caused by open filehandles? And Windows supports fork now? I thought that didn't work. -- William From gsf at fruct.us Tue Feb 5 16:03:42 2008 From: gsf at fruct.us (Gabriel Sean Farrell) Date: Tue, 5 Feb 2008 16:03:42 -0500 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202149761-sup-2303@tangerine.lanl.gov> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202149761-sup-2303@tangerine.lanl.gov> Message-ID: <20080205210342.GA4870@manheim.library.drexel.edu> On Mon, Feb 04, 2008 at 11:46:16AM -0700, John Bent wrote: > Excerpts from Gabriel Sean Farrell's message of Mon Feb 04 08:12:21 -0700 2008: > > Is there a way to persist the labels applied from an instance of sup > > IMAPing from one machine to another instance on another machine? I > > check my mail from four different computers on a regular basis, and I > > haven't figured out, for example, how to delete emails when checking > > with one machine and see them as deleted (that is, *not* see them in my > > inbox) when checking with another. > > > This isn't really answering your question but ... the reason I use sup is > because I can then use multiple computers to check email but have a > persistent view (exactly like what you want). However, the way I do this > is not by figuring out how to maintain consistent labeling state across > the multiple instances but rather by only actually running sup from one > machine. I then can check email from multiple computers by always ssh'ing > to that machine. That's why I like sup: it's console based and lends itself > perfectly to this approach. > > Even though this probably wasn't the answer you were looking for, I fear it > might be the best one you get. sup isn't designed to actually modify any of > your existing mail folders. It only reads them and then maintains its own > external state. So, for example, you can't configure sup to delete emails from > an IMAP server. What you can do is configure an external program like > fetchmail to pull the emails (and delete them from the IMAP server) and put > them into a local mbox on your machine which sup can then read. That might > work for you; however, you'll splinter your emails. Emails which are read on > one machine won't appear on your other three. What you want is for sup to just > read from the IMAP server and leave them there and then for the four multiple > instances of sup to share their state with each other. But they have no > mechanism for doing so - they'd need some server somewhere to help them and > they'd also need a bunch of code to implement that functionality. You could > try to get that functionality transparently by using a distributed file system > shared across the four machines in which you keep your .sup folder. That > should work (unless maybe there is binary data kept in the .sup files and you > have endian incompatibility across the four machines). You could try to > approximate the shared file system thing by using something like cvs or git, > but that would be a big silly hassle. Unless anyone else thinks of something > better, I think the ssh approach is your best bet. > > My only remaining limitation with the ssh scheme is that my primary machine is > my desktop so I am not able to slurp down a bunch of new emails onto my laptop > and work on them from the plane... (the answer of course is to make the laptop > be the primary machine but that doesn't work for a couple of other various > reasons). Thanks for the thoughtful response. I have checked my mail over ssh for a long time (with mutt), but within the last year I've come to really appreciate IMAP. I use a combination of ssh and screen to work on all of my servers, but it's nice to be able to avoid it when checking email on a spotty connection (no more network stuttering while I edit a response!). Also, attachments are easier to deal with. An IMAP setup allows me to check in with the client on my phone occasionally as well. In short, I like to have one place that handles the storage (which is why I don't use POP3) *and* the status of my email. It occurs to me now that Sup, when used with IMAP, follows a paradigm wherein the status (maybe "metadata" would be a better word) for each email is shared between the server and client. Maybe my preference is due to assumptions from my years of mutt use. After all, the difference doesn't matter if you only use one client. It is the reason Sup doesn't play well with others, however, or with other instances of itself. Gabriel From gsf at fruct.us Tue Feb 5 16:11:41 2008 From: gsf at fruct.us (Gabriel Sean Farrell) Date: Tue, 5 Feb 2008 16:11:41 -0500 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202229600-sup-4858@south> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> Message-ID: <20080205211141.GB4870@manheim.library.drexel.edu> On Tue, Feb 05, 2008 at 08:42:03AM -0800, William Morgan wrote: > Sup will probably never work well in this kind of setup. Agreed. Thanks for the honest assessment. From wmorgan-sup at masanjin.net Tue Feb 5 17:02:37 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Tue, 05 Feb 2008 14:02:37 -0800 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202229600-sup-4858@south> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> Message-ID: <1202248916-sup-1460@south> Reformatted excerpts from William Morgan's message of 2008-02-05: > Sup will probably never work well in this kind of setup. Until we make SupServer! -- William From johnbent at lanl.gov Wed Feb 6 11:21:37 2008 From: johnbent at lanl.gov (John Bent) Date: Wed, 06 Feb 2008 09:21:37 -0700 Subject: [sup-talk] [PATCH] don't try to open the next thread if there isn't one available In-Reply-To: <1202232384-sup-1186@south> References: <1201681010-sup-3463@archie> <1201707688-sup-6637@tangerine.lanl.gov> <1202232384-sup-1186@south> Message-ID: <1202314746-sup-2532@tangerine.lanl.gov> Excerpts from William Morgan's message of Tue Feb 05 10:27:26 -0700 2008: > Reformatted excerpts from John Bent's message of 2008-01-30: > > Perhaps I should just change my habits but I like to traverse my inbox in > > chronological order (i.e. bottom up instead of top down). If anyone could > > make a patch that does ,a or ,n but moves it up instead of down, I'd very > > much appreciate it. > > I do this too, often. Try ']' in next. > That's great! Thanks. > I really need a better keybinding. Wonder if I just should bite the > bullet and do < and > for previous and next instead of , and ]. > That'd be nice too (and probably more intuitive). Or maybe it's really hard but user-defined macros or shortcuts. So people could map < to ,n and > to ]n. Or did I get the order wrong? Also, if we had macros, I'd map something to |muttprint. From gsf at fruct.us Wed Feb 6 17:37:33 2008 From: gsf at fruct.us (Gabriel Sean Farrell) Date: Wed, 6 Feb 2008 17:37:33 -0500 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202248916-sup-1460@south> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> <1202248916-sup-1460@south> Message-ID: <20080206223733.GA13929@manheim.library.drexel.edu> On Tue, Feb 05, 2008 at 02:02:37PM -0800, William Morgan wrote: > Reformatted excerpts from William Morgan's message of 2008-02-05: > > Sup will probably never work well in this kind of setup. > > Until we make SupServer! > Something like SupServer could be exciting. Along with its shortcomings in the display department, mutt also suffers in a multiple-client-IMAP setup. For example, I see no reason why I should keep aliases and list subscriptions for each client. From marcus-sup at bar-coded.net Thu Feb 7 03:45:33 2008 From: marcus-sup at bar-coded.net (Marcus Williams) Date: Thu, 07 Feb 2008 08:45:33 +0000 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202248916-sup-1460@south> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> <1202248916-sup-1460@south> Message-ID: <1202373660-sup-5293@tomsk> On 5.2.2008, William Morgan wrote: > Reformatted excerpts from William Morgan's message of 2008-02-05: > > Sup will probably never work well in this kind of setup. > > Until we make SupServer! I never know if you're joking when you say stuff like this :) Joking aside though, if you treat sup as a frontend for a database (which is basically what it is forgetting the email client side) all you actually need is to get ferret to run as a server.... and if thats all you need perhaps we can use the work on the DRb server for the RoR act_as_ferret plugin and have a remote index that sup can then be a client of. This then leads me to a wishlist item - perhaps the contacts stuff should be moved into a ferret db. That way sup can be a searchable contacts db as well (and it can be remote so shared across clients). Any thoughts? Marcus From wmorgan-sup at masanjin.net Thu Feb 7 13:12:43 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Thu, 07 Feb 2008 10:12:43 -0800 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202373660-sup-5293@tomsk> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> <1202248916-sup-1460@south> <1202373660-sup-5293@tomsk> Message-ID: <1202407800-sup-6982@south> Reformatted excerpts from Marcus Williams's message of 2008-02-07: > Any thoughts? Why is it that people are so excited about having an email clients with this crazy client/server architecture? We don't demand that of any other console program we use. If you can run a sup server somewhere, surely you can run sshd there instead. The only difference would be UI lag on slow connections. Is that the big win? -- William From wmorgan-sup at masanjin.net Thu Feb 7 13:40:17 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Thu, 07 Feb 2008 10:40:17 -0800 Subject: [sup-talk] new in git next: maildir speedups Message-ID: <1202409514-sup-9247@south> I believe I've fixed the issue of maildir directory rescanning in next. Now the directory is only scanned rescanned when polling. Try it out! -- William From gsf at fruct.us Thu Feb 7 15:12:34 2008 From: gsf at fruct.us (Gabriel Sean Farrell) Date: Thu, 7 Feb 2008 15:12:34 -0500 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202407800-sup-6982@south> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> <1202248916-sup-1460@south> <1202373660-sup-5293@tomsk> <1202407800-sup-6982@south> Message-ID: <20080207201234.GB18001@manheim.library.drexel.edu> On Thu, Feb 07, 2008 at 10:12:43AM -0800, William Morgan wrote: > Why is it that people are so excited about having an email clients with > this crazy client/server architecture? We don't demand that of any other > console program we use. Let's see, what console programs do I have open right now? Mutt, irssi, lynx, tintin++, and btlaunchmanycurses. We've already discussed Mutt. irssi is a great example of a console program that acts as a client to a server. lynx is an example of the most commonly understood client/server relationship today. tintin++ is a mud client, and the improvements it has over simple telnet clients in the specific domain of muds could serve as a model for others that rely on ssh/sftp/etc for other domains. btlaunchmanycurses is a curses bittorrent client and, being bittorrent, connects to other clients instead of a server. Nonetheless, it demonstrates another protocol that I choose a console UI for. Even Vim provides the option of editing via sftp and scp, essentially creating a client connection to files on a server. It's a pretty fantastic feature that I recommend you try out if you haven't done so already. > If you can run a sup server somewhere, surely you can run sshd there > instead. The only difference would be UI lag on slow connections. Is > that the big win? The ability to access these programs over ssh is part of the reason I use them, but I prefer running them on the local box because UI lag and dropped connections have frustrated me enough that I'd rather not deal with them when I don't have to. From patroclo7 at gmail.com Thu Feb 7 13:47:56 2008 From: patroclo7 at gmail.com (Giorgio Lando) Date: Thu, 07 Feb 2008 19:47:56 +0100 Subject: [sup-talk] new in git next: maildir speedups In-Reply-To: <1202409514-sup-9247@south> References: <1202409514-sup-9247@south> Message-ID: <1202410054-sup-9855@clarabella.clarabella> Excerpts from William Morgan's message of Thu Feb 07 19:40:17 +0100 2008: > I believe I've fixed the issue of maildir directory rescanning in next. > Now the directory is only scanned rescanned when polling. Try it out! Yes, the speedup is noticeable! -- Giorgio Lando From marcus-sup at bar-coded.net Thu Feb 7 16:09:05 2008 From: marcus-sup at bar-coded.net (Marcus Williams) Date: Thu, 07 Feb 2008 21:09:05 +0000 Subject: [sup-talk] Persistence between IMAP clients In-Reply-To: <1202407800-sup-6982@south> References: <20080204151221.GA29477@manheim.library.drexel.edu> <1202229600-sup-4858@south> <1202248916-sup-1460@south> <1202373660-sup-5293@tomsk> <1202407800-sup-6982@south> Message-ID: <1202417630-sup-9601@tomsk> On 7.2.2008, William Morgan wrote: > If you can run a sup server somewhere, surely you can run sshd there > instead. The only difference would be UI lag on slow connections. Is > that the big win? Man, your throw away suggestions should come with "warning, bear trap ahead" notices :) For me, the biggest draw of having it as a service is multi-app usage. I treat sup as a view upon my email but I use my email for a whole lot of things and sup doesnt (yet) give me views of this data if you see what I mean. For instance - I might mark emails as todos via the message hooks so I can email myself todos. I dont need to see who these are from or the date of these email, just the snippet. Also I dont really want to go into sup to get these I'd rather have them available via http. I can do this read only now, but if I want to do any interactions with this "view" I need to go via sup really. Also I cant do this when sup is open on my machine as its got the index open and I'm not sure ferret lets you do multi-user access to the index. Console access is great when you've got it, but its not so good on a phone/pda (I am determined to get it running locally on my n800 though!) - so accessing the index through other ways would be useful here. Also, sup *is already* a client/server console tool - you're accessing imap or maildir-over-ssh as a client. The beauty of IMAP (_not_ the protocol which I have to agree sucks) is the fact I can use any client I want *locally* and have the same view upon my email anywhere. I dont have to save an attachment to a disk on my imap server, open winscp to go to that server pick up the attachment and save locally to view it on my machine at work or battle with x11 auth and install x11/gnome packages on my server so I can view it over X11 over ssh. Dont get me wrong, for my biggest usage sup doesnt need to use the index over a networked service, I could write most stuff as ruby cgis or RoR that access the ferret index because most of the time sup wont be running so wont care. Its just I wouldnt have to worry about it if it was networked :) and I think it would open up more possibilities of the use of the index (again, I'm thinking "views" upon my data not necessarily sup's usage). Marcus From wmorgan-sup at masanjin.net Thu Feb 7 20:09:37 2008 From: wmorgan-sup at masanjin.net (William Morgan) Date: Thu, 07 Feb 2008 17:09:37 -0800 Subject: [sup-talk] 0.5 thoughts In-Reply-To: <1201785683-sup-4356@clarabella.clarabella> References: <1201240480-sup-1977@south> <288A3057-1B27-4BDF-9B96-F860CA73C305@gmail.com> <1201260309-sup-8211@ausone.local> <1201785683-sup-4356@clarabella.clarabella> Message-ID: <1202432955-sup-4239@south> Reformatted excerpts from Giorgio Lando's message of 2008-01-31: > I would like to add a further feature request: sup could accept an > email address as a command line argument, going directly to prompt for > a subject or a CC and then passing to the editor. This would be nice > for interaction with browsers, when clicking on a certain address open > a program designated to treat the mailto protocol. This is in. Use -c. -- William From sup-talk at gurski.org Thu Feb 7 12:27:26 2008 From: sup-talk at gurski.org (Michael Gurski) Date: Thu, 7 Feb 2008 12:27:26 -0500 Subject: [sup-talk] Crash on startup, "wrong id called on nil" Message-ID: <20080207172725.GA9157@gurski.org> It's been a while since I launched sup, and updating today from master, I get a crash on startup: --- RuntimeError from thread: load threads for thread-index-mode wrong id called on nil IIRC, this was also happening maybe a month or so ago, and I just didn't have the time to deal with it then. Dumping the index, rebuilding, etc, seem to not affect this at all. The full exception log is: $ cat sup-exception-log.txt --- RuntimeError from thread: load threads for thread-index-mode wrong id called on nil ./lib/sup.rb:13:in `id' ./lib/sup/modes/thread-index-mode.rb:183:in `update' ./lib/sup/hook.rb:123:in `sort_by' ./lib/sup/modes/thread-index-mode.rb:183:in `each' ./lib/sup/modes/thread-index-mode.rb:183:in `sort_by' ./lib/sup/modes/thread-index-mode.rb:183:in `update' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize' ./lib/sup/modes/thread-index-mode.rb:181:in `update' ./lib/sup/modes/thread-index-mode.rb:466:in `__unprotected_load_n_threads' ./lib/sup/thread.rb:332:in `load_n_threads' ./lib/sup/index.rb:224:in `each_id_by_date' ./lib/sup/index.rb:224:in `each' ./lib/sup/index.rb:224:in `each_id_by_date' ./lib/sup/thread.rb:326:in `load_n_threads' ./lib/sup/modes/thread-index-mode.rb:463:in `__unprotected_load_n_threads' (eval):12:in `load_n_threads' ./lib/sup/modes/thread-index-mode.rb:452:in `load_n_threads_background' ./lib/sup.rb:60:in `reporting_thread' ./lib/sup.rb:58:in `initialize' ./lib/sup.rb:58:in `new' ./lib/sup.rb:58:in `reporting_thread' ./lib/sup/modes/thread-index-mode.rb:451:in `load_n_threads_background' ./lib/sup/modes/thread-index-mode.rb:502:in `__unprotected_load_threads' (eval):12:in `load_threads' bin/sup:199 --- SystemExit from thread: main wrong id called on nil ./lib/sup.rb:64:in `select' ./lib/sup/buffer.rb:31:in `nonblocking_getch' bin/sup:212 -- Michael A. Gurski (opt. [first].)[last]@pobox.com http://www.pobox.com/~[last] 1024R/39B5BADD PGP: 34 93 A9 94 B1 59 48 B7 17 57 1E 4E 62 56 45 70 1024D/1166213E GPG: 628F 37A4 62AF 1475 45DB AD81 ADC9 E606 1166 213E 4096R/C0B4F04B GPG: 5B3E 75D7 43CF CF34 4042 7788 1DCE B5EE C0B4 F04B Views expressed by the host do not reflect the staff, management or sponsors. From patroclo7 at gmail.com Fri Feb 8 03:42:33 2008 From: patroclo7 at gmail.com (Giorgio Lando) Date: Fri, 08 Feb 2008 09:42:33 +0100 Subject: [sup-talk] 0.5 thoughts In-Reply-To: <1202432955-sup-4239@south> References: <1201240480-sup-1977@south> <288A3057-1B27-4BDF-9B96-F860CA73C305@gmail.com> <1201260309-sup-8211@ausone.local> <1201785683-sup-4356@clarabella.clarabella> <1202432955-sup-4239@south> Message-ID: <1202460092-sup-5021@clarabella.clarabella> Excerpts from William Morgan's message of Fri Feb 08 02:09:37 +0100 2008: > Reformatted excerpts from Giorgio Lando's message of 2008-01-31: > > I would like to add a further feature request: sup could accept an > > email address as a command line argument, going directly to prompt for > > a subject or a CC and then passing to the editor. This would be nice > > for interaction with browsers, when clicking on a certain address open > > a program designated to treat the mailto protocol. > > This is in. Use -c. > Thank you a lot! -- Giorgio Lando From chrisw at rice.edu Fri Feb 8 04:40:55 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Fri, 08 Feb 2008 03:40:55 -0600 Subject: [sup-talk] [PATCH] shell commands are now run in a child process In-Reply-To: <1202241831-sup-1777@south> References: <1202026272-3432-2-git-send-email-chrisw@rice.edu> <1202232814-sup-1005@south> <1202239755-sup-3523@chris-tablet> <1202241831-sup-1777@south> Message-ID: <1202462044-sup-3129@chris-tablet> Excerpts from William Morgan's message of Tue Feb 05 14:12:23 -0600 2008: > It would be good to understand this a bit more. Why are the Ferret > errors caused by open filehandles? It is an odd interplay between Cygwin and Windows. Sometimes, when ferret updates the index, it needs to delete (or rename, I'm not sure) one of its files. So, ferret deletes the file and then checks that it has been deleted (in fs_exists() from ferret-.../ext/fs_store.c:70). To do the delete, unlink() is called. Cygwin maps this to a series of Windows kernel calls that 1) open the file, 2) set the delete-on-close flag, and 3) close the file. (See unline_nt() in http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/syscalls.cc?rev=1.469&content-type=text/x-cvsweb-markup&cvsroot=src) If only sup is running, the file is closed and deleted. The file no longer exists, so the open() in fs_exists fails with ENOENT. This is to be expected. If the editor is also running, things happen a little differently. The editor has inherited all of sup's file handles. When the unlink() is called this time, the same three kernel calls are made: 1) open, 2) set delete-on-close flag, 3) close file. However, there are still an open handle for the file (the editor has it), so the file enters the DELETE_PENDING state. This causes the open() call in fs_exists to fail with EACCES, triggering the exception. I have a Process Monitor log of what's going on and the exception log if you think that that would be helpful. > And Windows supports fork now? I thought that didn't work. No. But Cygwin does. This still causes the file handle duplication, so I close all the open files except STDIN, STDOUT, and STDERR. That way, the ferret file never enters the DELETE_PENDING state. I don't think that this would be an issue if I were running sup natively on Windows. The editor would NOT inherit sup's file handlers. However, I have not been able to get ncurses (or the Ruby gem, I can't remember) to compile for Windows. So, I'm stuck in Cygwin bizzaro-land. -- Christopher Warrington From patroclo7 at gmail.com Fri Feb 8 17:10:07 2008 From: patroclo7 at gmail.com (Giorgio Lando) Date: Fri, 08 Feb 2008 23:10:07 +0100 Subject: [sup-talk] the num_inbox_unread variable Message-ID: <1202508462-sup-2051@clarabella.clarabella> Hi, I have a small problem with the num_inbox_unread variable, which is used for example in the status-bar-text.rb: in the number of unread messages the messages belonging to killed threads are included, but, from the name of the variable, I do not think that this is the expected behaviour (they are unread, but they are not the inbox. -- Giorgio Lando From brabuhr at gmail.com Fri Feb 8 21:01:31 2008 From: brabuhr at gmail.com (brabuhr at gmail.com) Date: Fri, 8 Feb 2008 21:01:31 -0500 Subject: [sup-talk] [PATCH] first pass at a simple interface to extract URIs from a message In-Reply-To: <1202007092-sup-19@south> References: <21aa9f0801291923w2df946dbga7832a7345c09a95@mail.gmail.com> <1202007092-sup-19@south> Message-ID: <55fa96700802081801mfc27b6axd68a3d640175dddd@mail.gmail.com> On Feb 2, 2008 9:56 PM, William Morgan wrote: > Reformatted excerpts from brabuhr's message of 2008-01-29: > > This adds a new key binding to the thread-view mode (L) to assist with > > loading URIs from the body of the message. This first pass will pull > > the URIs from the message text and loop through them while asking if > > that URI should be loaded. Currently, there is no code to actually > > perform the load. > > Looks good. I have a slight preference for a "if uris.size == 0" block > that flashes a message and returns, so that the meat of the method > doesn't have to be too indented. I was also thinking that it would be better to display the discovered URIs in a list instead of the prompting, but I wasn't sure how to implement that. Another problem I see is that the extractor is too-greedy and will pull in the punctuation following the URL; so, perhaps the list should allow line editing before calling the view-url hook? From manish at gslab.com Fri Feb 8 23:39:42 2008 From: manish at gslab.com (Manish Sapariya) Date: Sat, 09 Feb 2008 10:09:42 +0530 Subject: [sup-talk] Exception while composing message from lable list buffer Message-ID: <1202531797-sup-97@alioth.gs-lab.com> Hi, I ran into this once, next time I tried it did not happen. in inbox window, I pressed L to check mails against each lable, from that window I pressed c to compose new mail and it blasted. --- NoMethodError from thread: main undefined method `<=>' for nil:NilClass /usr/lib/ruby/gems/1.8/gems/sup-0.4/lib/sup/buffer.rb:494:in `sort' /usr/lib/ruby/gems/1.8/gems/sup-0.4/lib/sup/buffer.rb:494:in `ask_for_contacts' /usr/lib/ruby/gems/1.8/gems/sup-0.4/lib/sup/util.rb:497:in `send' /usr/lib/ruby/gems/1.8/gems/sup-0.4/lib/sup/util.rb:497:in `method_missing' /usr/lib/ruby/gems/1.8/gems/sup-0.4/lib/sup/modes/compose-mode.rb:23:in `spawn_nicely' /usr/lib/ruby/gems/1.8/gems/sup-0.4/bin/sup:259 /usr/bin/sup:16:in `load' /usr/bin/sup:16 Regards, Manish From nicolas.pouillard at gmail.com Sat Feb 9 07:05:29 2008 From: nicolas.pouillard at gmail.com (Nicolas Pouillard) Date: Sat, 9 Feb 2008 13:05:29 +0100 Subject: [sup-talk] [PATCH] Show drafts in red, in thread-index-mode. In-Reply-To: <1201112451-sup-5510@south> References: <1201112451-sup-5510@south> Message-ID: <12025587293812-git-send-email-nicolas.pouillard@gmail.com> This patch would help to think about finishing drafts. --- bin/sup | 2 ++ lib/sup/modes/inbox-mode.rb | 2 +- lib/sup/modes/thread-index-mode.rb | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/sup b/bin/sup index 84fd77c..f536da6 100644 --- a/bin/sup +++ b/bin/sup @@ -138,6 +138,8 @@ begin Ncurses::A_BOLD c.add :index_starred_color, Ncurses::COLOR_YELLOW, Ncurses::COLOR_BLACK, Ncurses::A_BOLD + c.add :index_draft_color, Ncurses::COLOR_RED, Ncurses::COLOR_BLACK, + Ncurses::A_BOLD c.add :labellist_old_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK c.add :labellist_new_color, Ncurses::COLOR_WHITE, Ncurses::COLOR_BLACK, Ncurses::A_BOLD diff --git a/lib/sup/modes/inbox-mode.rb b/lib/sup/modes/inbox-mode.rb index a2de13f..f156b69 100644 --- a/lib/sup/modes/inbox-mode.rb +++ b/lib/sup/modes/inbox-mode.rb @@ -9,7 +9,7 @@ class InboxMode < ThreadIndexMode end def initialize - super [:inbox, :sent], { :label => :inbox, :skip_killed => true } + super [:inbox, :sent, :draft], { :label => :inbox, :skip_killed => true } raise "can't have more than one!" if defined? @@instance @@instance = self end diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index e24d7e0..7a0b815 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -655,7 +655,6 @@ protected date = t.date.to_nice_s - new = t.has_label?(:unread) starred = t.has_label?(:starred) ## format the from column @@ -692,7 +691,9 @@ protected p = dp || t.participants.any? { |p| AccountManager.is_account? p } subj_color = - if new + if t.has_label?(:draft) + :index_draft_color + elsif t.has_label?(:unread) :index_new_color elsif starred :index_starred_color -- 1.5.3.1.109.gacd69 From mdk at mdk.am Mon Feb 11 18:57:37 2008 From: mdk at mdk.am (Michael Dominic K.) Date: Tue, 12 Feb 2008 00:57:37 +0100 Subject: [sup-talk] Backspace key? Message-ID: <1202774257.8173.4.camel@localhost.localdomain> Hello, I just gave a test-drive to sup. So far it looks absolutely great -- two thumbs up to the authors! I'm having one trivial problem though -- my backspace key doesn't work in all entry fields (del works). It's been a while since I fixed del/backspace issues in linux... any help/hints/config switch? I'm running: [Tue Feb 12 00:56:17 +0100 2008] using character set encoding "utf8" sup v0.4 ...installed via gems. My terminal standard gnome-terminal. Thanks in advance, -- Michael From patroclo7 at gmail.com Tue Feb 12 03:25:43 2008 From: patroclo7 at gmail.com (Giorgio Lando) Date: Tue, 12 Feb 2008 09:25:43 +0100 Subject: [sup-talk] Backspace key? In-Reply-To: <1202774257.8173.4.camel@localhost.localdomain> References: <1202774257.8173.4.camel@localhost.localdomain> Message-ID: <1202804371-sup-2434@clarabella.clarabella> Excerpts from Michael Dominic K.'s message of Tue Feb 12 00:57:37 +0100 2008: > I'm having one trivial problem though -- my backspace key doesn't work > in all entry fields (del works). It's been a while since I fixed > del/backspace issues in linux... any help/hints/config switch? I do not use the gnome-terminal, but in my case the working string for backspace in sup is ^h, while my terminals (all rxvt derivatives) sent ^? by default. From the large literature about the topic, I think that other terminal settings could adjust the behaviour also with ^?, but setting ^h has no negative side effect for me. So look in the configuration of gnome-terminal for something like backspaceKey or string... -- Giorgio Lando From nicolas.pouillard at gmail.com Tue Feb 12 04:48:49 2008 From: nicolas.pouillard at gmail.com (Nicolas Pouillard) Date: Tue, 12 Feb 2008 10:48:49 +0100 Subject: [sup-talk] Backspace key? In-Reply-To: <1202774257.8173.4.camel@localhost.localdomain> References: <1202774257.8173.4.camel@localhost.localdomain> Message-ID: <1202809606-sup-7188@port-ext6.ensta.fr> Excerpts from Michael Dominic K.'s message of Tue Feb 12 00:57:37 +0100 2008: > Hello, Hello, [...] > I'm having one trivial problem though -- my backspace key doesn't work > in all entry fields (del works). It's been a while since I fixed > del/backspace issues in linux... any help/hints/config switch? I had the same issue, as a workaround hitting CTRL-BACKSPACE worked for me. However I've made up an ugly change to handle this, perhaps it can help you. -- Nicolas Pouillard aka Ertai -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Handle-the-keycode-127-like-KEY_BACKSPACE.patch Type: application/octet-stream Size: 822 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080212/46e95e95/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080212/46e95e95/attachment.bin From marko.myllymaki at iki.fi Tue Feb 12 14:30:42 2008 From: marko.myllymaki at iki.fi (marko.myllymaki at iki.fi) Date: Tue, 12 Feb 2008 21:30:42 +0200 Subject: [sup-talk] how to browse archived? Message-ID: <1202844150-sup-5784@sieni> Sup 0.4 works fine! Only one wish at the moment: It would be nice to be able to browse archived messages (there is no such label in L list). Sometimes you just forget what actual words to search in some previous emails (which have no labels). So they are difficult to search but by browsing them you would find them. Funny... at the moment Delete seems to do the right thing for me (because "Deleted" appears in the label list for browsing :) From johannes at antiklimax.com Tue Feb 12 14:36:44 2008 From: johannes at antiklimax.com (Johannes Martinsson) Date: Tue, 12 Feb 2008 20:36:44 +0100 Subject: [sup-talk] how to browse archived? In-Reply-To: <1202844150-sup-5784@sieni> References: <1202844150-sup-5784@sieni> Message-ID: <1202844988-sup-7181@banana> > It would be nice to be able to browse archived messages (there is no > such label in L list). Sometimes you just forget what actual words to > search in some previous emails (which have no labels). So they are > difficult to search but by browsing them you would find them. Have you tried searching (\) for '*', that seems to show all archived messages. -- Johannes Martinsson johannes at antiklimax.se 0736 - 345 661 From chrisw at rice.edu Tue Feb 12 15:10:32 2008 From: chrisw at rice.edu (Christopher Warrington) Date: Tue, 12 Feb 2008 14:10:32 -0600 Subject: [sup-talk] how to browse archived? In-Reply-To: <1202844150-sup-5784@sieni> References: <1202844150-sup-5784@sieni> Message-ID: <1202846964-sup-7866@chris-tablet> Excerpts from Marko MyllymXXki's message of Tue Feb 12 13:30:42 -0600 2008: > It would be nice to be able to browse archived messages (there is no > such label in L list). Sometimes you just forget what actual words > to search in some previous emails (which have no labels). So they > are difficult to search but by browsing them you would find them. Search for "-label:inbox" -- Christopher Warrington From marko.myllymaki at iki.fi Wed Feb 13 02:16:18 2008 From: marko.myllymaki at iki.fi (marko.myllymaki at iki.fi) Date: Wed, 13 Feb 2008 09:16:18 +0200 Subject: [sup-talk] how to browse archived? In-Reply-To: <1202844988-sup-7181@banana> References: <1202844150-sup-5784@sieni> <1202844988-sup-7181@banana> Message-ID: <1202886942-sup-6585@sieni> Excerpts from Johannes Martinsson's message of Tue Feb 12 21:36:44 +0200 2008: > Have you tried searching (\) for '*', that seems to show all archived > messages. Thanks -this does the trick! From mdk at mdk.am Wed Feb 13 18:08:57 2008 From: mdk at mdk.am (Michael Dominic K.) Date: Thu, 14 Feb 2008 00:08:57 +0100 Subject: [sup-talk] Backspace key? In-Reply-To: <1202804371-sup-2434@clarabella.clarabella> References: <1202774257.8173.4.camel@localhost.localdomain> <1202804371-sup-2434@clarabella.clarabella> Message-ID: <67ed228e0802131508y19d94e55h2ba3b41bd748e758@mail.gmail.com> On Feb 12, 2008 9:25 AM, Giorgio Lando wrote: > Excerpts from Michael Dominic K.'s message of Tue Feb 12 00:57:37 +0100 2008: > > I'm having one trivial problem though -- my backspace key doesn't work > > in all entry fields (del works). It's been a while since I fixed > > del/backspace issues in linux... any help/hints/config switch? > > I do not use the gnome-terminal, but in my case the working string for > backspace in sup is ^h, while my terminals (all rxvt derivatives) sent > ^? by default. From the large literature about the topic, I think that > other terminal settings could adjust the behaviour also with ^?, but > setting ^h has no negative side effect for me. So look in the > configuration of gnome-terminal for something like backspaceKey or > string... Thanks, that worked for me (^h). Actually gnome terminal has a special configuration in the "compatibility section" that allows you to choose what is sent for backspace. However, I belive this is a bit of a workaround. I haven't noticed anything breaking with ^h except... sup-config. Where, again, backspace doesn't work with ^h on. -- Michael. From johannes at antiklimax.com Tue Feb 12 13:10:27 2008 From: johannes at antiklimax.com (Johannes Martinsson) Date: Tue, 12 Feb 2008 19:10:27 +0100 Subject: [sup-talk] [PATCH] Changed all (but one) occurrences of redwood to sup. Message-ID: <1202839827-11975-1-git-send-email-johannes@antiklimax.com> * Changed all occurrences of redwood to sup, but left out the one in the FAQ (What are all these "Red...). --- Rakefile | 2 +- bin/sup | 34 ++++++++-------- bin/sup-add | 16 ++++---- bin/sup-config | 18 ++++---- bin/sup-dump | 4 +- bin/sup-recover-sources | 10 ++-- bin/sup-sync | 12 +++--- bin/sup-sync-back | 14 +++--- bin/sup-tweak-labels | 8 ++-- devel/load-index.rb | 2 +- devel/profile.rb | 4 +- devel/start-console.rb | 2 +- doc/FAQ.txt | 2 +- lib/sup.rb | 54 +++++++++++++------------- lib/sup/account.rb | 2 +- lib/sup/buffer.rb | 4 +- lib/sup/colormap.rb | 6 +- lib/sup/contact.rb | 2 +- lib/sup/crypto.rb | 20 +++++----- lib/sup/draft.rb | 4 +- lib/sup/hook.rb | 6 +- lib/sup/horizontal-selector.rb | 2 +- lib/sup/imap.rb | 16 ++++---- lib/sup/index.rb | 54 +++++++++++++------------- lib/sup/keymap.rb | 2 +- lib/sup/label.rb | 2 +- lib/sup/logger.rb | 2 +- lib/sup/maildir.rb | 2 +- lib/sup/mbox.rb | 4 +- lib/sup/mbox/loader.rb | 2 +- lib/sup/mbox/ssh-file.rb | 6 +- lib/sup/mbox/ssh-loader.rb | 2 +- lib/sup/message-chunks.rb | 4 +- lib/sup/message.rb | 34 ++++++++-------- lib/sup/mode.rb | 6 +- lib/sup/modes/buffer-list-mode.rb | 2 +- lib/sup/modes/completion-mode.rb | 2 +- lib/sup/modes/compose-mode.rb | 2 +- lib/sup/modes/contact-list-mode.rb | 4 +- lib/sup/modes/edit-message-mode.rb | 8 ++-- lib/sup/modes/file-browser-mode.rb | 2 +- lib/sup/modes/forward-mode.rb | 2 +- lib/sup/modes/help-mode.rb | 2 +- lib/sup/modes/inbox-mode.rb | 2 +- lib/sup/modes/label-list-mode.rb | 4 +- lib/sup/modes/label-search-results-mode.rb | 2 +- lib/sup/modes/line-cursor-mode.rb | 2 +- lib/sup/modes/log-mode.rb | 2 +- lib/sup/modes/person-search-results-mode.rb | 2 +- lib/sup/modes/poll-mode.rb | 2 +- lib/sup/modes/reply-mode.rb | 2 +- lib/sup/modes/resume-mode.rb | 2 +- lib/sup/modes/scroll-mode.rb | 2 +- lib/sup/modes/search-results-mode.rb | 2 +- lib/sup/modes/text-mode.rb | 2 +- lib/sup/modes/thread-index-mode.rb | 6 +- lib/sup/modes/thread-view-mode.rb | 2 +- lib/sup/person.rb | 2 +- lib/sup/poll.rb | 16 ++++---- lib/sup/sent.rb | 4 +- lib/sup/source.rb | 2 +- lib/sup/suicide.rb | 4 +- lib/sup/tagger.rb | 2 +- lib/sup/textfield.rb | 6 +- lib/sup/thread.rb | 2 +- lib/sup/update.rb | 2 +- test/dummy_source.rb | 2 +- test/test_message.rb | 10 ++-- 68 files changed, 237 insertions(+), 237 deletions(-) diff --git a/Rakefile b/Rakefile index f99246f..3940e4d 100644 --- a/Rakefile +++ b/Rakefile @@ -10,7 +10,7 @@ end # thanks to "Mike H" ## allow people who use development versions by running "rake gem" ## and installing the resulting gem it to be able to do this. (gem ## versions must be in dotted-digit notation only). -version = Redwood::VERSION == "git" ? "999" : Redwood::VERSION +version = Sup::VERSION == "git" ? "999" : Sup::VERSION Hoe.new('sup', version) do |p| p.rubyforge_name = 'sup' diff --git a/bin/sup b/bin/sup index 95b0af7..d0e3472 100644 --- a/bin/sup +++ b/bin/sup @@ -9,12 +9,12 @@ require "sup" BIN_VERSION = "git" -unless Redwood::VERSION == BIN_VERSION +unless Sup::VERSION == BIN_VERSION $stderr.puts < e case h.ask("Should I ask that process to kill itself? ") when /^\s*y\s*$/i h.say "Ok, suggesting seppuku..." - FileUtils.touch Redwood::SUICIDE_FN + FileUtils.touch Sup::SUICIDE_FN sleep SuicideManager::DELAY * 2 - FileUtils.rm_f Redwood::SUICIDE_FN + FileUtils.rm_f Sup::SUICIDE_FN h.say "Let's try that again." retry else @@ -110,20 +110,20 @@ EOS end begin - Redwood::start + Sup::start Index.load if(s = Index.source_for DraftManager.source_name) DraftManager.source = s else - Redwood::log "no draft source, auto-adding..." + Sup::log "no draft source, auto-adding..." Index.add_source DraftManager.new_source end if(s = Index.source_for SentManager.source_name) SentManager.source = s else - Redwood::log "no sent mail source, auto-adding..." + Sup::log "no sent mail source, auto-adding..." Index.add_source SentManager.new_source end @@ -191,7 +191,7 @@ begin begin s.connect rescue SourceError => e - Redwood::log "fatal error loading from #{s}: #{e.message}" + Sup::log "fatal error loading from #{s}: #{e.message}" end end end unless $opts[:no_initial_poll] @@ -293,19 +293,19 @@ ensure Index.stop_lock_update_thread end - Redwood::finish + Sup::finish stop_cursing - Redwood::log "stopped cursing" + Sup::log "stopped cursing" if SuicideManager.instantiated? && SuicideManager.die? - Redwood::log "I've been ordered to commit seppuku. I obey!" + Sup::log "I've been ordered to commit seppuku. I obey!" end if $exceptions.empty? - Redwood::log "no fatal errors. good job, william." + Sup::log "no fatal errors. good job, william." Index.save else - Redwood::log "oh crap, an exception" + Sup::log "oh crap, an exception" end Index.unlock diff --git a/bin/sup-add b/bin/sup-add index 50bbb29..b78963f 100644 --- a/bin/sup-add +++ b/bin/sup-add @@ -7,7 +7,7 @@ require 'trollop' require "sup" $opts = Trollop::options do - version "sup-add (sup #{Redwood::VERSION})" + version "sup-add (sup #{Sup::VERSION})" banner < "mbox", :path => fn }] when :maildir $last_fn ||= ENV["MAIL"] @@ -70,7 +70,7 @@ def add_source return if fn.nil? || fn.empty? $last_fn = fn - [Redwood::Maildir.suggest_labels_for(fn), + [Sup::Maildir.suggest_labels_for(fn), { :scheme => "maildir", :path => fn }] when :mboxssh $last_server ||= "localhost" @@ -82,7 +82,7 @@ def add_source return if fn.nil? || fn.empty? $last_fn = fn fn = "/#{fn}" # lame - [Redwood::MBox::SSHLoader.suggest_labels_for(fn), + [Sup::MBox::SSHLoader.suggest_labels_for(fn), { :scheme => "mbox+ssh", :host => srv, :path => fn }] when :imap, :imaps $last_server ||= "localhost" @@ -101,7 +101,7 @@ def add_source else host, port = srv, nil end - [Redwood::IMAP.suggest_labels_for(fn), + [Sup::IMAP.suggest_labels_for(fn), { :scheme => type.to_s, :host => host, :port => port, :path => fn }] end @@ -150,8 +150,8 @@ def add_source end $terminal.wrap_at = :auto -Redwood::start -index = Redwood::Index.new +Sup::start +index = Sup::Index.new index.load_sources say < to recover the index. @@ -21,7 +21,7 @@ No options. EOS end -index = Redwood::Index.new +index = Sup::Index.new index.load (1 ... index.index.reader.max_doc).each do |i| diff --git a/bin/sup-recover-sources b/bin/sup-recover-sources index af39b7d..33b1a65 100644 --- a/bin/sup-recover-sources +++ b/bin/sup-recover-sources @@ -49,7 +49,7 @@ end.parse(ARGV) require "sup" puts "loading index..." -index = Redwood::Index.new +index = Sup::Index.new index.load puts "loaded index of #{index.size} messages" @@ -64,16 +64,16 @@ ARGV.each do |fn| username = $stdin.gets.chomp print "Password for #{fn} (warning: cleartext): " password = $stdin.gets.chomp - Redwood::IMAP.new(fn, username, password, nil, !$opts[:unusual], $opts[:archive]) + Sup::IMAP.new(fn, username, password, nil, !$opts[:unusual], $opts[:archive]) else - Redwood::MBox::Loader.new(fn, nil, !$opts[:unusual], $opts[:archive]) + Sup::MBox::Loader.new(fn, nil, !$opts[:unusual], $opts[:archive]) end source_ids = {} count = 0 source.each do |offset, labels| begin - m = Redwood::Message.new :source => source, :source_info => offset + m = Sup::Message.new :source => source, :source_info => offset docid, entry = index.load_entry_for_id m.id next unless entry #puts "# #{source} #{offset} #{entry[:source_id]}" @@ -81,7 +81,7 @@ ARGV.each do |fn| source_ids[entry[:source_id]] = (source_ids[entry[:source_id]] || 0) + 1 count += 1 break if count == $opts[:scan_num] - rescue Redwood::MessageFormatError => e + rescue Sup::MessageFormatError => e puts "# #{e.message}" end end diff --git a/bin/sup-sync b/bin/sup-sync index 4a05257..9cb44c4 100644 --- a/bin/sup-sync +++ b/bin/sup-sync @@ -26,7 +26,7 @@ def time end opts = Trollop::options do - version "sup-sync (sup #{Redwood::VERSION})" + version "sup-sync (sup #{Sup::VERSION})" banner < e +rescue Sup::FatalSourceError => e $stderr.puts "Sorry, I couldn't communicate with a source: #{e.message}" rescue Exception => e File.open("sup-exception-log.txt", "w") { |f| f.puts e.backtrace } raise ensure - Redwood::finish + Sup::finish index.unlock end diff --git a/bin/sup-sync-back b/bin/sup-sync-back index 57bebbe..8beb614 100644 --- a/bin/sup-sync-back +++ b/bin/sup-sync-back @@ -16,7 +16,7 @@ def die msg end opts = Trollop::options do - version "sup-sync-back (sup #{Redwood::VERSION})" + version "sup-sync-back (sup #{Sup::VERSION})" banner < e File.open("sup-exception-log.txt", "w") { |f| f.puts e.backtrace } raise ensure - Redwood::finish + Sup::finish index.unlock end diff --git a/bin/sup-tweak-labels b/bin/sup-tweak-labels index 21e766c..eba76f7 100644 --- a/bin/sup-tweak-labels +++ b/bin/sup-tweak-labels @@ -25,7 +25,7 @@ def time end opts = Trollop::options do - version "sup-tweak-labels (sup #{Redwood::VERSION})" + version "sup-tweak-labels (sup #{Sup::VERSION})" banner < e raise ensure index.save - Redwood::finish + Sup::finish index.unlock end diff --git a/devel/load-index.rb b/devel/load-index.rb index 858c8b5..8fa5861 100644 --- a/devel/load-index.rb +++ b/devel/load-index.rb @@ -1,7 +1,7 @@ require 'sup' puts "loading index..." - at index = Redwood::Index.new + at index = Sup::Index.new @index.load @i = @index.index puts "loaded index of #{@i.size} messages" diff --git a/devel/profile.rb b/devel/profile.rb index 67b6b08..e2d6b25 100644 --- a/devel/profile.rb +++ b/devel/profile.rb @@ -1,9 +1,9 @@ require 'rubygems' require 'ruby-prof' -require "redwood" +require "sup" result = RubyProf.profile do - Redwood::ThreadSet.new(ARGV.map { |fn| Redwood::MBox::Scanner.new fn }).load_n_threads 100 + Sup::ThreadSet.new(ARGV.map { |fn| Sup::MBox::Scanner.new fn }).load_n_threads 100 end printer = RubyProf::GraphHtmlPrinter.new(result) diff --git a/devel/start-console.rb b/devel/start-console.rb index 2d7de10..ab7224f 100644 --- a/devel/start-console.rb +++ b/devel/start-console.rb @@ -1,5 +1,5 @@ require 'sup' -include Redwood +include Sup start Index.new Index.load diff --git a/doc/FAQ.txt b/doc/FAQ.txt index 3b65330..1ca093e 100644 --- a/doc/FAQ.txt +++ b/doc/FAQ.txt @@ -88,7 +88,7 @@ A: Move the messages from the source to the target using whatever tool states will be lost when you sync the other source. So do them both in one go. -Q: What are all these "Redwood" references I see in the code? +Q: What are all these "sup" references I see in the code? A: That was Sup's original name. (Think pine, elm. Although I was a Mutt user, I couldn't think of a good progression there.) But it was taken by another project on RubyForge, and wasn't that diff --git a/lib/sup.rb b/lib/sup.rb index cec36b6..05ba6c4 100644 --- a/lib/sup.rb +++ b/lib/sup.rb @@ -23,16 +23,16 @@ class Module klass.instance_eval do define_method(:to_yaml_properties) { vars } - define_method(:to_yaml_type) { "!#{Redwood::YAML_DOMAIN},#{Redwood::YAML_DATE}/#{path}" } + define_method(:to_yaml_type) { "!#{Sup::YAML_DOMAIN},#{Sup::YAML_DATE}/#{path}" } end - YAML.add_domain_type("#{Redwood::YAML_DOMAIN},#{Redwood::YAML_DATE}", path) do |type, val| + YAML.add_domain_type("#{Sup::YAML_DOMAIN},#{Sup::YAML_DATE}", path) do |type, val| klass.new(*props.map { |p| val[p] }) end end end -module Redwood +module Sup VERSION = "git" BASE_DIR = ENV["SUP_BASE"] || File.join(ENV["HOME"], ".sup") @@ -91,23 +91,23 @@ module Redwood end def start - Redwood::PersonManager.new Redwood::PERSON_FN - Redwood::SentManager.new Redwood::SENT_FN - Redwood::ContactManager.new Redwood::CONTACT_FN - Redwood::LabelManager.new Redwood::LABEL_FN - Redwood::AccountManager.new $config[:accounts] - Redwood::DraftManager.new Redwood::DRAFT_DIR - Redwood::UpdateManager.new - Redwood::PollManager.new - Redwood::SuicideManager.new Redwood::SUICIDE_FN - Redwood::CryptoManager.new + Sup::PersonManager.new Sup::PERSON_FN + Sup::SentManager.new Sup::SENT_FN + Sup::ContactManager.new Sup::CONTACT_FN + Sup::LabelManager.new Sup::LABEL_FN + Sup::AccountManager.new $config[:accounts] + Sup::DraftManager.new Sup::DRAFT_DIR + Sup::UpdateManager.new + Sup::PollManager.new + Sup::SuicideManager.new Sup::SUICIDE_FN + Sup::CryptoManager.new end def finish - Redwood::LabelManager.save if Redwood::LabelManager.instantiated? - Redwood::ContactManager.save if Redwood::ContactManager.instantiated? - Redwood::PersonManager.save if Redwood::PersonManager.instantiated? - Redwood::BufferManager.deinstantiate! if Redwood::BufferManager.instantiated? + Sup::LabelManager.save if Sup::LabelManager.instantiated? + Sup::ContactManager.save if Sup::ContactManager.instantiated? + Sup::PersonManager.save if Sup::PersonManager.instantiated? + Sup::BufferManager.deinstantiate! if Sup::BufferManager.instantiated? end ## not really a good place for this, so I'll just dump it here. @@ -164,8 +164,8 @@ EOM end ## set up default configuration file -if File.exists? Redwood::CONFIG_FN - $config = Redwood::load_yaml_obj Redwood::CONFIG_FN +if File.exists? Sup::CONFIG_FN + $config = Sup::load_yaml_obj Sup::CONFIG_FN else require 'etc' require 'socket' @@ -198,8 +198,8 @@ else :discard_snippets_from_encrypted_messages => false, } begin - FileUtils.mkdir_p Redwood::BASE_DIR - Redwood::save_yaml_obj $config, Redwood::CONFIG_FN + FileUtils.mkdir_p Sup::BASE_DIR + Sup::save_yaml_obj $config, Sup::CONFIG_FN rescue StandardError => e $stderr.puts "warning: #{e.message}" end @@ -211,7 +211,7 @@ require "sup/hook" ## we have to initialize this guy first, because other classes must ## reference it in order to register hooks, and they do that at parse ## time. -Redwood::HookManager.new Redwood::HOOK_DIR +Sup::HookManager.new Sup::HOOK_DIR ## everything we need to get logging working require "sup/buffer" @@ -221,7 +221,7 @@ require "sup/modes/scroll-mode" require "sup/modes/text-mode" require "sup/modes/log-mode" require "sup/logger" -module Redwood +module Sup def log s; Logger.log s; end module_function :log end @@ -229,13 +229,13 @@ end ## determine encoding and character set $encoding = Locale.current.charset if $encoding - Redwood::log "using character set encoding #{$encoding.inspect}" + Sup::log "using character set encoding #{$encoding.inspect}" else - Redwood::log "warning: can't find character set by using locale, defaulting to utf-8" + Sup::log "warning: can't find character set by using locale, defaulting to utf-8" $encoding = "utf-8" end -## now everything else (which can feel free to call Redwood::log at load time) +## now everything else (which can feel free to call Sup::log at load time) require "sup/update" require "sup/suicide" require "sup/message-chunks" @@ -280,5 +280,5 @@ require "sup/sent" $:.each do |base| d = File.join base, "sup/share/modes/" - Redwood::Mode.load_all_modes d if File.directory? d + Sup::Mode.load_all_modes d if File.directory? d end diff --git a/lib/sup/account.rb b/lib/sup/account.rb index f8ac0fc..30a8a31 100644 --- a/lib/sup/account.rb +++ b/lib/sup/account.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class Account < Person attr_accessor :sendmail, :signature diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index 4374fa8..6fa659f 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -46,7 +46,7 @@ module Ncurses end end -module Redwood +module Sup class InputSequenceAborted < StandardError; end @@ -713,7 +713,7 @@ private end def default_terminal_title buf - "Sup #{Redwood::VERSION} :: #{buf.title}" + "Sup #{Sup::VERSION} :: #{buf.title}" end def get_status_and_title buf diff --git a/lib/sup/colormap.rb b/lib/sup/colormap.rb index 9c6869a..941de40 100644 --- a/lib/sup/colormap.rb +++ b/lib/sup/colormap.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class Colormap @@instance = nil @@ -86,7 +86,7 @@ class Colormap @next_id = (@next_id + 1) % NUM_COLORS @next_id += 1 if @next_id == 0 # 0 is always white on black id = @next_id - Redwood::log "colormap: for color #{sym}, using id #{id} -> #{fg}, #{bg}" + Sup::log "colormap: for color #{sym}, using id #{id} -> #{fg}, #{bg}" Curses.init_pair id, fg, bg or raise ArgumentError, "couldn't initialize curses color pair #{fg}, #{bg} (key #{id})" @@ -94,7 +94,7 @@ class Colormap ## delete the old mapping, if it exists if @users[cp] @users[cp].each do |usym| - Redwood::log "dropping color #{usym} (#{id})" + Sup::log "dropping color #{usym} (#{id})" @entries[usym][3] = nil end @users[cp] = [] diff --git a/lib/sup/contact.rb b/lib/sup/contact.rb index 8050c06..8bea99d 100644 --- a/lib/sup/contact.rb +++ b/lib/sup/contact.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class ContactManager include Singleton diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb index 9e16132..82174bd 100644 --- a/lib/sup/crypto.rb +++ b/lib/sup/crypto.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class CryptoManager include Singleton @@ -20,10 +20,10 @@ class CryptoManager @cmd = case bin when /\S/ - Redwood::log "crypto: detected gpg binary in #{bin}" + Sup::log "crypto: detected gpg binary in #{bin}" "#{bin} --quiet --batch --no-verbose --logger-fd 1 --use-agent" else - Redwood::log "crypto: no gpg binary detected" + Sup::log "crypto: no gpg binary detected" nil end end @@ -31,7 +31,7 @@ class CryptoManager def have_crypto?; !@cmd.nil? end def sign from, to, payload - payload_fn = Tempfile.new "redwood.payload" + payload_fn = Tempfile.new "sup.payload" payload_fn.write format_payload(payload) payload_fn.close @@ -49,7 +49,7 @@ class CryptoManager end def encrypt from, to, payload, sign=false - payload_fn = Tempfile.new "redwood.payload" + payload_fn = Tempfile.new "sup.payload" payload_fn.write format_payload(payload) payload_fn.close @@ -83,11 +83,11 @@ class CryptoManager def verify payload, signature # both RubyMail::Message objects return unknown_status(cant_find_binary) unless @cmd - payload_fn = Tempfile.new "redwood.payload" + payload_fn = Tempfile.new "sup.payload" payload_fn.write format_payload(payload) payload_fn.close - signature_fn = Tempfile.new "redwood.signature" + signature_fn = Tempfile.new "sup.signature" signature_fn.write signature.decode signature_fn.close @@ -109,7 +109,7 @@ class CryptoManager def decrypt payload # a RubyMail::Message object return unknown_status(cant_find_binary) unless @cmd - payload_fn = Tempfile.new "redwood.payload" + payload_fn = Tempfile.new "sup.payload" payload_fn.write payload.to_s payload_fn.close @@ -156,9 +156,9 @@ private def run_gpg args cmd = "#{@cmd} #{args} 2> /dev/null" - #Redwood::log "crypto: running: #{cmd}" + #Sup::log "crypto: running: #{cmd}" output = `#{cmd}` - #Redwood::log "crypto: output: #{output.inspect}" unless $?.success? + #Sup::log "crypto: output: #{output.inspect}" unless $?.success? output end end diff --git a/lib/sup/draft.rb b/lib/sup/draft.rb index 81c0044..87af878 100644 --- a/lib/sup/draft.rb +++ b/lib/sup/draft.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class DraftManager include Singleton @@ -45,7 +45,7 @@ class DraftLoader < Source yaml_properties :cur_offset def initialize cur_offset=0 - dir = Redwood::DRAFT_DIR + dir = Sup::DRAFT_DIR Dir.mkdir dir unless File.exists? dir super DraftManager.source_name, cur_offset, true, false @dir = dir diff --git a/lib/sup/hook.rb b/lib/sup/hook.rb index 98fcf57..c3f018e 100644 --- a/lib/sup/hook.rb +++ b/lib/sup/hook.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class HookManager ## there's probably a better way to do this, but to evaluate a hook @@ -40,7 +40,7 @@ class HookManager end def log s - Redwood::log "hook[#@__name]: #{s}" + Sup::log "hook[#@__name]: #{s}" end def ask_yes_or_no q @@ -137,7 +137,7 @@ private end def log m - Redwood::log("hook: " + m) + Sup::log("hook: " + m) end end diff --git a/lib/sup/horizontal-selector.rb b/lib/sup/horizontal-selector.rb index aef16d4..5d09321 100644 --- a/lib/sup/horizontal-selector.rb +++ b/lib/sup/horizontal-selector.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class HorizontalSelector attr_accessor :label diff --git a/lib/sup/imap.rb b/lib/sup/imap.rb index e785597..b21cebc 100644 --- a/lib/sup/imap.rb +++ b/lib/sup/imap.rb @@ -41,7 +41,7 @@ require 'cgi' ## ## fuck you, imap committee. you managed to design something nearly as ## shitty as mbox but goddamn THIRTY YEARS LATER. -module Redwood +module Sup class IMAP < Source SCAN_INTERVAL = 60 # seconds @@ -131,13 +131,13 @@ class IMAP < Source return if last_id == @ids.length range = (@ids.length + 1) .. last_id - Redwood::log "fetching IMAP headers #{range}" + Sup::log "fetching IMAP headers #{range}" fetch(range, ['RFC822.SIZE', 'INTERNALDATE', 'FLAGS']).each do |v| id = make_id v @ids << id @imap_state[id] = { :id => v.seqno, :flags => v.attr["FLAGS"] } end - Redwood::log "done fetching IMAP headers" + Sup::log "done fetching IMAP headers" end synchronized :scan_mailbox @@ -196,7 +196,7 @@ private if good_results.empty? raise FatalSourceError, "no IMAP response for #{ids} containing all fields #{fields.join(', ')} (got #{results.size} results)" elsif good_results.size < results.size - Redwood::log "Your IMAP server sucks. It sent #{results.size} results for a request for #{good_results.size} messages. What are you using, Binc?" + Sup::log "Your IMAP server sucks. It sent #{results.size} results for a request for #{good_results.size} messages. What are you using, Binc?" end good_results @@ -224,12 +224,12 @@ private raise Net::IMAP::NoResponseError unless @imap.capability().member? "AUTH=CRAM-MD5" @imap.authenticate 'CRAM-MD5', @username, @password rescue Net::IMAP::BadResponseError, Net::IMAP::NoResponseError => e - Redwood::log "CRAM-MD5 authentication failed: #{e.class}. Trying LOGIN auth..." + Sup::log "CRAM-MD5 authentication failed: #{e.class}. Trying LOGIN auth..." begin raise Net::IMAP::NoResponseError unless @imap.capability().member? "AUTH=LOGIN" @imap.authenticate 'LOGIN', @username, @password rescue Net::IMAP::BadResponseError, Net::IMAP::NoResponseError => e - Redwood::log "LOGIN authentication failed: #{e.class}. Trying plain-text LOGIN..." + Sup::log "LOGIN authentication failed: #{e.class}. Trying plain-text LOGIN..." @imap.login @username, @password end end @@ -246,7 +246,7 @@ private def say s @say_id = BufferManager.say s, @say_id if BufferManager.instantiated? - Redwood::log s + Sup::log s end def shutup @@ -303,7 +303,7 @@ private rescue *RECOVERABLE_ERRORS => e if (retries += 1) <= 3 @imap = nil - Redwood::log "got #{e.class.name}: #{e.message.inspect}" + Sup::log "got #{e.class.name}: #{e.message.inspect}" sleep 2 retry end diff --git a/lib/sup/index.rb b/lib/sup/index.rb index cf2ac6d..b634b63 100644 --- a/lib/sup/index.rb +++ b/lib/sup/index.rb @@ -1,4 +1,4 @@ -## the index structure for redwood. interacts with ferret. +## the index structure for sup. interacts with ferret. require 'fileutils' require 'ferret' @@ -6,11 +6,11 @@ begin require 'chronic' $have_chronic = true rescue LoadError => e - Redwood::log "optional 'chronic' library not found (run 'gem install chronic' to install)" + Sup::log "optional 'chronic' library not found (run 'gem install chronic' to install)" $have_chronic = false end -module Redwood +module Sup class Index class LockError < StandardError @@ -44,7 +44,7 @@ class Index def lockfile; File.join @dir, "lock" end def lock - Redwood::log "locking #{lockfile}..." + Sup::log "locking #{lockfile}..." begin @lock.lock rescue Lockfile::MaxTriesLockError @@ -53,7 +53,7 @@ class Index end def start_lock_update_thread - @lock_update_thread = Redwood::reporting_thread("lock update") do + @lock_update_thread = Sup::reporting_thread("lock update") do while true sleep 30 @lock.touch_yourself @@ -99,7 +99,7 @@ EOS def unlock if @lock && @lock.locked? - Redwood::log "unlocking #{lockfile}..." + Sup::log "unlocking #{lockfile}..." @lock.unlock end end @@ -110,7 +110,7 @@ EOS end def save - Redwood::log "saving index and sources..." + Sup::log "saving index and sources..." FileUtils.mkdir_p @dir unless File.exists? @dir save_sources save_index @@ -131,11 +131,11 @@ EOS def load_index dir=File.join(@dir, "ferret") if File.exists? dir - Redwood::log "loading index..." + Sup::log "loading index..." @index = Ferret::Index::Index.new(:path => dir, :analyzer => @analyzer) - Redwood::log "loaded index of #{@index.size} messages" + Sup::log "loaded index of #{@index.size} messages" else - Redwood::log "creating index..." + Sup::log "creating index..." field_infos = Ferret::Index::FieldInfos.new :store => :yes field_infos.add_field :message_id field_infos.add_field :source_id @@ -220,7 +220,7 @@ EOS offset = 0 while true results = @index.search(query, :sort => "date DESC", :limit => EACH_BY_DATE_NUM, :offset => offset) - Redwood::log "got #{results.total_hits} results for query (offset #{offset}) #{query.inspect}" + Sup::log "got #{results.total_hits} results for query (offset #{offset}) #{query.inspect}" results.hits.each { |hit| yield @index[hit.doc][:message_id], lambda { build_message hit.doc } } break if offset >= results.total_hits - EACH_BY_DATE_NUM offset += EACH_BY_DATE_NUM @@ -245,7 +245,7 @@ EOS SAME_SUBJECT_DATE_LIMIT = 7 MAX_CLAUSES = 1000 def each_message_in_thread_for m, opts={} - #Redwood::log "Building thread for #{m.id}: #{m.subj}" + #Sup::log "Building thread for #{m.id}: #{m.subj}" messages = {} searched = {} num_queries = 0 @@ -265,7 +265,7 @@ EOS q = build_query :qobj => q pending = @index.search(q).hits.map { |hit| @index[hit.doc][:message_id] } - Redwood::log "found #{pending.size} results for subject query #{q}" + Sup::log "found #{pending.size} results for subject query #{q}" else pending = [m.id] end @@ -295,7 +295,7 @@ EOS end mid = @index[docid][:message_id] unless messages.member?(mid) - #Redwood::log "got #{mid} as a child of #{id}" + #Sup::log "got #{mid} as a child of #{id}" messages[mid] ||= lambda { build_message docid } refs = @index[docid][:refs].split(" ") pending += refs.select { |id| !searched[id] } @@ -304,10 +304,10 @@ EOS end if killed - Redwood::log "thread for #{m.id} is killed, ignoring" + Sup::log "thread for #{m.id} is killed, ignoring" false else - Redwood::log "ran #{num_queries} queries to build thread of #{messages.size + 1} messages for #{m.id}: #{m.subj}" if num_queries > 0 + Sup::log "ran #{num_queries} queries to build thread of #{messages.size + 1} messages for #{m.id}: #{m.subj}" if num_queries > 0 messages.each { |mid, builder| yield mid, builder } true end @@ -357,12 +357,12 @@ EOS end q.add_query Ferret::Search::TermQuery.new(:label, "spam"), :must_not - Redwood::log "contact search: #{q}" + Sup::log "contact search: #{q}" contacts = {} num = h[:num] || 20 @index.search_each(q, :sort => "date DESC", :limit => :all) do |docid, score| break if contacts.size >= num - #Redwood::log "got message #{docid} to: #{@index[docid][:to].inspect} and from: #{@index[docid][:from].inspect}" + #Sup::log "got message #{docid} to: #{@index[docid][:to].inspect} and from: #{@index[docid][:from].inspect}" f = @index[docid][:from] t = @index[docid][:to] @@ -376,8 +376,8 @@ EOS contacts.keys.compact end - def load_sources fn=Redwood::SOURCE_FN - source_array = (Redwood::load_yaml_obj(fn) || []).map { |o| Recoverable.new o } + def load_sources fn=Sup::SOURCE_FN + source_array = (Sup::load_yaml_obj(fn) || []).map { |o| Recoverable.new o } @sources = Hash[*(source_array).map { |s| [s.id, s] }.flatten] @sources_dirty = false end @@ -405,7 +405,7 @@ protected ## the string with Ferret, and return the resulting query object. norms = @qparser.parse(s).to_s - Redwood::log "normalized #{s.inspect} to #{norms.inspect}" unless s == norms + Sup::log "normalized #{s.inspect} to #{norms.inspect}" unless s == norms subs = norms.gsub(/\b(to|from):(\S+)\b/) do field, name = $1, $2 @@ -460,13 +460,13 @@ protected if realdate case field when "after" - Redwood::log "chronic: translated #{field}:#{datestr} to #{realdate.end}" + Sup::log "chronic: translated #{field}:#{datestr} to #{realdate.end}" "date:(>= #{sprintf "%012d", realdate.end.to_i})" when "before" - Redwood::log "chronic: translated #{field}:#{datestr} to #{realdate.begin}" + Sup::log "chronic: translated #{field}:#{datestr} to #{realdate.begin}" "date:(<= #{sprintf "%012d", realdate.begin.to_i})" else - Redwood::log "chronic: translated #{field}:#{datestr} to #{realdate}" + Sup::log "chronic: translated #{field}:#{datestr} to #{realdate}" "date:(<= #{sprintf "%012d", realdate.end.to_i}) date:(>= #{sprintf "%012d", realdate.begin.to_i})" end else @@ -477,7 +477,7 @@ protected subs = nil if chronic_failure end - Redwood::log "translated #{norms.inspect} to #{subs.inspect}" unless subs == norms + Sup::log "translated #{norms.inspect} to #{subs.inspect}" unless subs == norms if subs [@qparser.parse(subs), extraopts] else @@ -505,14 +505,14 @@ protected query end - def save_sources fn=Redwood::SOURCE_FN + def save_sources fn=Sup::SOURCE_FN if @sources_dirty || @sources.any? { |id, s| s.dirty? } bakfn = fn + ".bak" if File.exists? fn File.chmod 0600, fn FileUtils.mv fn, bakfn, :force => true unless File.exists?(bakfn) && File.size(fn) == 0 end - Redwood::save_yaml_obj @sources.values.sort_by { |s| s.id.to_i }, fn, true + Sup::save_yaml_obj @sources.values.sort_by { |s| s.id.to_i }, fn, true File.chmod 0600, fn end @sources_dirty = false diff --git a/lib/sup/keymap.rb b/lib/sup/keymap.rb index 3176415..d05be92 100644 --- a/lib/sup/keymap.rb +++ b/lib/sup/keymap.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class Keymap def initialize diff --git a/lib/sup/label.rb b/lib/sup/label.rb index 4afc0f9..8d689fe 100644 --- a/lib/sup/label.rb +++ b/lib/sup/label.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class LabelManager include Singleton diff --git a/lib/sup/logger.rb b/lib/sup/logger.rb index ebdeebe..6fc60ba 100644 --- a/lib/sup/logger.rb +++ b/lib/sup/logger.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class Logger @@instance = nil diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb index 7b85383..c03f1d5 100644 --- a/lib/sup/maildir.rb +++ b/lib/sup/maildir.rb @@ -1,7 +1,7 @@ require 'rmail' require 'uri' -module Redwood +module Sup ## Maildir doesn't provide an ordered unique id, which is what Sup ## requires to be really useful. So we must maintain, in memory, a diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb index 0ce52fe..19302be 100644 --- a/lib/sup/mbox.rb +++ b/lib/sup/mbox.rb @@ -3,7 +3,7 @@ require "sup/mbox/ssh-file" require "sup/mbox/ssh-loader" require "sup/rfc2047" -module Redwood +module Sup ## some utility functions. actually these are not mbox-specific at all ## and should be moved somewhere else. @@ -58,7 +58,7 @@ module MBox begin Rfc2047.decode_to $encoding, v rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence => e - Redwood::log "warning: error decoding RFC 2047 header (#{e.class.name}): #{e.message}" + Sup::log "warning: error decoding RFC 2047 header (#{e.class.name}): #{e.message}" v end end diff --git a/lib/sup/mbox/loader.rb b/lib/sup/mbox/loader.rb index a66d7b9..92220c2 100644 --- a/lib/sup/mbox/loader.rb +++ b/lib/sup/mbox/loader.rb @@ -1,7 +1,7 @@ require 'rmail' require 'uri' -module Redwood +module Sup module MBox class Loader < Source diff --git a/lib/sup/mbox/ssh-file.rb b/lib/sup/mbox/ssh-file.rb index d474636..ca87d63 100644 --- a/lib/sup/mbox/ssh-file.rb +++ b/lib/sup/mbox/ssh-file.rb @@ -1,6 +1,6 @@ require 'net/ssh' -module Redwood +module Sup module MBox class SSHFileError < StandardError; end @@ -18,7 +18,7 @@ class SSHFileError < StandardError; end ## debugging TODO: remove me def debug s - Redwood::log s + Sup::log s end module_function :debug @@ -154,7 +154,7 @@ private ## TODO: share this code with imap def say s @say_id = BufferManager.say s, @say_id if BufferManager.instantiated? - Redwood::log s + Sup::log s end def shutup diff --git a/lib/sup/mbox/ssh-loader.rb b/lib/sup/mbox/ssh-loader.rb index e422a48..f4c163c 100644 --- a/lib/sup/mbox/ssh-loader.rb +++ b/lib/sup/mbox/ssh-loader.rb @@ -1,6 +1,6 @@ require 'net/ssh' -module Redwood +module Sup module MBox class SSHLoader < Source diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb index 0606395..9bbad7d 100644 --- a/lib/sup/message-chunks.rb +++ b/lib/sup/message-chunks.rb @@ -39,7 +39,7 @@ class Tempfile end -module Redwood +module Sup module Chunk class Attachment HookManager.register "mime-decode", < e - Redwood::log "problem getting messages from #{@source}: #{e.message}" + Sup::log "problem getting messages from #{@source}: #{e.message}" ## we need force_to_top here otherwise this window will cover ## up the error message one @source.error ||= e - Redwood::report_broken_sources :force_to_top => true + Sup::report_broken_sources :force_to_top => true [Chunk::Text.new(error_message(e.message).split("\n"))] end end @@ -234,9 +234,9 @@ EOS begin yield rescue SourceError => e - Redwood::log "problem getting messages from #{@source}: #{e.message}" + Sup::log "problem getting messages from #{@source}: #{e.message}" @source.error ||= e - Redwood::report_broken_sources :force_to_top => true + Sup::report_broken_sources :force_to_top => true error_message e.message end end @@ -307,25 +307,25 @@ private def multipart_signed_to_chunks m if m.body.size != 2 - Redwood::log "warning: multipart/signed with #{m.body.size} parts (expecting 2)" + Sup::log "warning: multipart/signed with #{m.body.size} parts (expecting 2)" return end payload, signature = m.body if signature.multipart? - Redwood::log "warning: multipart/signed with payload multipart #{payload.multipart?} and signature multipart #{signature.multipart?}" + Sup::log "warning: multipart/signed with payload multipart #{payload.multipart?} and signature multipart #{signature.multipart?}" return end ## this probably will never happen if payload.header.content_type == "application/pgp-signature" - Redwood::log "warning: multipart/signed with payload content type #{payload.header.content_type}" + Sup::log "warning: multipart/signed with payload content type #{payload.header.content_type}" return end if signature.header.content_type != "application/pgp-signature" ## unknown signature type; just ignore. - #Redwood::log "warning: multipart/signed with signature content type #{signature.header.content_type}" + #Sup::log "warning: multipart/signed with signature content type #{signature.header.content_type}" return end @@ -334,23 +334,23 @@ private def multipart_encrypted_to_chunks m if m.body.size != 2 - Redwood::log "warning: multipart/encrypted with #{m.body.size} parts (expecting 2)" + Sup::log "warning: multipart/encrypted with #{m.body.size} parts (expecting 2)" return end control, payload = m.body if control.multipart? - Redwood::log "warning: multipart/encrypted with control multipart #{control.multipart?} and payload multipart #{payload.multipart?}" + Sup::log "warning: multipart/encrypted with control multipart #{control.multipart?} and payload multipart #{payload.multipart?}" return end if payload.header.content_type != "application/octet-stream" - Redwood::log "warning: multipart/encrypted with payload content type #{payload.header.content_type}" + Sup::log "warning: multipart/encrypted with payload content type #{payload.header.content_type}" return end if control.header.content_type != "application/pgp-encrypted" - Redwood::log "warning: multipart/encrypted with control content type #{signature.header.content_type}" + Sup::log "warning: multipart/encrypted with control content type #{signature.header.content_type}" return end @@ -421,7 +421,7 @@ private return body unless charset Iconv.iconv($encoding + "//IGNORE", charset, body + " ").join[0 .. -2] rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence, MessageFormatError => e - Redwood::log "warning: error (#{e.class.name}) decoding message body from #{charset}: #{e.message}" + Sup::log "warning: error (#{e.class.name}) decoding message body from #{charset}: #{e.message}" File.open("sup-unable-to-decode.txt", "w") { |f| f.write body } body end diff --git a/lib/sup/mode.rb b/lib/sup/mode.rb index 9900dc3..0808c6b 100644 --- a/lib/sup/mode.rb +++ b/lib/sup/mode.rb @@ -1,4 +1,4 @@ -module Redwood +module Sup class Mode attr_accessor :buffer @@ -91,10 +91,10 @@ EOS unless err.empty? message = err.first.read if message =~ /^\s*$/ - Redwood::log "error running #{command} (but no error message)" + Sup::log "error running #{command} (but no error message)" BufferManager.flash "Error running #{command}!" else - Redwood::log "error running #{command}: #{message}" + Sup::log "error running #{command}: #{message}" BufferManager.flash "Error: #{message}" end return diff --git a/lib/sup/modes/buffer-list-mode.rb b/lib/sup/modes/buffer-list-mode.rb index 91b2fac..e193af7 100644 ---