From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] sup crash on tab completion
Date: Mon, 21 Jan 2008 23:41:43 -0800 [thread overview]
Message-ID: <1200987490-sup-7392@south> (raw)
In-Reply-To: <ad5e29c50801182121k7299b14anf352653d648d4342@mail.gmail.com>
Hi John,
Reformatted excerpts from John Bent's message of 2008-01-18:
> I'm just trying out sup and I'm really excited about it so far.
Great!
> My deal is that I really like gmail but my work doesn't allow us to
> use any external web servers so I can't forward my work email to
> gmail. My work's webmail absolutely sucks so I want to run some
> client on my own computer but I also want to use it when I'm on a
> different computer. So I need something that works over X-windows or
> in the console. I was using pine but I got completely frustrated by
> the lack of search.
Sounds like Sup is perfect for you.
> I'm only just starting to mess with it and some things do seem a
> little strange. For example, can I remove a label?
You can remove labels by editing the labels for a thread. If you press
'l' while in a thread-index-mode, you can then backspace over any labels
you don't want.
> premature end of regular expression: /^John Bent (/
> /opt/local/lib/ruby/gems/1.8/gems/sup-0.3/lib/sup/buffer.rb:426:in
> `ask_many_emails_with_completions'
I have a fix for this that I've just applied to master. I've attached
the patch below if you just want to update your local copy, or you can
wait for the next release (any day now), or you can get the latest
version form git.
> Also, I can't figure out how to search on the from field. I'm doing
> from:Username and getting an empty thing.
Searcing on from: currently requires a full email address or a contact
nickname. Hm, I should improve this.
> Also, can I automatically archive sent-messages that aren't part of a
> thread that includes received messages?
I'm not sure I entirely understand. Currently, sent messages appear in
your inbox. Do you want sent messages to instead be archived
automatically, unless they're part of a thread that already appears in
your inbox?
If so, this would be a pretty easy change, and possibly worthy of a
config option.
Here's the patch that fixes tab completion:
---
lib/sup/buffer.rb | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index 2a78787..4374fa8 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -398,7 +398,7 @@ EOS
def ask_with_completions domain, question, completions, default=nil
ask domain, question, default do |s|
- completions.select { |x| x =~ /^#{s}/i }.map { |x| [x, x] }
+ completions.select { |x| x =~ /^#{Regexp::escape s}/i }.map { |x| [x, x] }
end
end
@@ -414,7 +414,7 @@ EOS
raise "william screwed up completion: #{partial.inspect}"
end
- completions.select { |x| x =~ /^#{target}/i }.map { |x| [prefix + x, x] }
+ completions.select { |x| x =~ /^#{Regexp::escape target}/i }.map { |x| [prefix + x, x] }
end
end
@@ -423,7 +423,7 @@ EOS
prefix, target = partial.split_on_commas_with_remainder
target ||= prefix.pop || ""
prefix = prefix.join(", ") + (prefix.empty? ? "" : ", ")
- completions.select { |x| x =~ /^#{target}/i }.map { |x| [prefix + x, x] }
+ completions.select { |x| x =~ /^#{Regexp::escape target}/i }.map { |x| [prefix + x, x] }
end
end
@@ -436,7 +436,7 @@ EOS
if dir
[[s.sub(full, dir), "~#{name}"]]
else
- users.select { |u| u =~ /^#{name}/ }.map do |u|
+ users.select { |u| u =~ /^#{Regexp::escape name}/ }.map do |u|
[s.sub("~#{name}", "~#{u}"), "~#{u}"]
end
end
--
1.5.4.rc2.69.g10f0
--
William <wmorgan-sup at masanjin.net>
next prev parent reply other threads:[~2008-01-22 7:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-19 5:21 John Bent
2008-01-22 7:41 ` William Morgan [this message]
2008-01-22 9:40 ` Marcus Williams
2008-01-23 7:09 ` William Morgan
2008-01-23 12:41 ` Grant Hollingworth
2008-01-23 19:25 ` Gabriel Sean Farrell
2008-01-25 5:04 ` William Morgan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1200987490-sup-7392@south \
--to=wmorgan-sup@masanjin.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox