Subject: [sup-talk] backspace and delete keys

From: [email-masked] (Giorgio Lando)
Date: Mon, 07 Jan 2008 23:59:01 +0100

Hi, I am busy in the ancient Unix practice of fixing the behaviour of
Backspace and Delete in sup choosing the right escape sequence in the
configuration of the different terminal emulators. Now, after some tweakings, Backspace works for me fine in the minibuffer
in the console and in every terminal emulator,
but Delete does not work. Since it does not work in any terminal, may be
that simply the sup minibuffer editor is supposed to support  only Backspace and not Delete?
In this case, I am loosing my time :)
Can someone confirm this?
Giorgio Lando

---

From: [email-masked] (William Morgan)
Date: Mon, 07 Jan 2008 16:12:08 -0800

Excerpts from Giorgio Lando's message of Mon Jan 07 14:59:01 -0800 2008:
> configuration of the different terminal emulators.

I feel your pain.

> Now, after some tweakings, Backspace works for me fine in the
> minibuffer in the console and in every terminal emulator, but Delete
> does not work. Since it does not work in any terminal, may be that
> simply the sup minibuffer editor is supposed to support  only
> Backspace and not Delete?

Sorry about that. I've just added it now. Git pull and you should be
able to hit delete.

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Giorgio Lando)
Date: Tue, 08 Jan 2008 01:22:00 +0100

> Sorry about that. I've just added it now. Git pull and you should be

Thanks a lot! Yes it works!
Giorgio

---

From: [email-masked] (Nicolas Pouillard)
Date: Tue, 08 Jan 2008 02:34:02 +0100

> Sorry about that. I've just added it now. Git pull and you should be

Thanks!

-- 
Nicolas Pouillard aka Ertai

---

From: [email-masked] (Giorgio Lando)
Date: Tue, 08 Jan 2008 04:24:50 +0100

However the git version now gets
an exception and quits when some keys are pressed ( \, /, ? and some
others).

The following is the sup-exception-log.txt:

--- NameError from thread: main
uninitialized constant Redwood::InputSequenceAborted
aur/sources/sup/bin/sup:209

Regards
Giorgio

---

From: [email-masked] (William Morgan)
Date: Mon, 07 Jan 2008 22:39:41 -0800

Excerpts from Giorgio Lando's message of Mon Jan 07 19:24:50 -0800 2008:
> However the git version now gets an exception and quits when some keys
> are pressed ( \, /, ? and some others).

I can't reproduce this. The backtrace also doesn't make sense, unless
buffer.rb (loaded by sup.rb) somehow isn't being loaded. That's where
InterruptedSequenceException is defined... have you made any changes
locally that may have caused this?

---

From: [email-masked] (Giorgio Lando)
Date: Tue, 08 Jan 2008 12:31:56 +0100

> locally that may have caused this?

I have tried to git clone from scratch but it still happens:
with all non-alphabetic keys, except 0, 1, @, &, $ and well... perhaps I
have not tried all of them, but surely with \, the numbers from 2 to 9,
quotes.
I do not know if something goes wrong in my environment, but 0.3
still works fine.
I have also tried to remove my two hooks, but with no impact
Giorgio

---

From: [email-masked] (William Morgan)
Date: Tue, 08 Jan 2008 07:34:28 -0800

> I have also tried to remove my two hooks, but with no impact

I'm willing to bet that this is because it's still loading 0.3
libraries. Try removing the 0.3 gem entirely before running from git.

---

From: [email-masked] (Giorgio Lando)
Date: Tue, 08 Jan 2008 17:21:23 +0100

> libraries. Try removing the 0.3 gem entirely before running from git.

Yes, now it works. Sorry, I wasn't aware that I needed to do that. I had
tried to adjust the -I option of ruby, but with no luck. Is there in
general a way to have the release and the git version coexisting?

Giorgio

---

From: [email-masked] (William Morgan)
Date: Tue, 08 Jan 2008 08:40:49 -0800

Excerpts from Giorgio Lando's message of Tue Jan 08 08:21:23 -0800 2008:
> Yes, now it works. Sorry, I wasn't aware that I needed to do that. I
> had tried to adjust the -I option of ruby, but with no luck. Is there
> in general a way to have the release and the git version coexisting?

This issue has bitten several people before, including me. Let me see if
I can come up with a way around it.

---

From: [email-masked] (William Morgan)
Date: Tue, 08 Jan 2008 09:23:03 -0800

Excerpts from William Morgan's message of Tue Jan 08 08:40:49 -0800 2008:
> This issue has bitten several people before, including me. Let me see
> if I can come up with a way around it.

Weird. I could've sworn I'd seen it before, but after reinstalling the
0.3 gem, ruby -Ilib bin/sup still works fine.

What's your gem version? I'm at 0.9.0.

---

From: [email-masked] (Giorgio Lando)
Date: Tue, 08 Jan 2008 18:32:54 +0100

> What's your gem version? I'm at 0.9.0.

The version of gem is 0.9.4. May be I should clarify the scenario where
the exception happened. I had sup-0.3 in the standard gems system
directory ans sup-git in a folder in my home directory. I cd to the
sup-git folder and did ruby -Ilib -w sup.
Now I have simply moved the sup-git directory in the standard gems
system directory.
 
Giorgio Lando

---

From: [email-masked] (William Morgan)
Date: Wed, 09 Jan 2008 11:02:47 -0800

Excerpts from Giorgio Lando's message of Tue Jan 08 09:32:54 -0800 2008:
> The version of gem is 0.9.4. May be I should clarify the scenario
> where the exception happened. I had sup-0.3 in the standard gems
> system directory ans sup-git in a folder in my home directory. I cd to
> the sup-git folder and did ruby -Ilib -w sup.

That was my setup too. Weird that I no longer seem to have this problem.

I've committed the following patch to next, which explicitly versions
bin/sup and lib/sup.rb and compares the two upon startup. Hopefully this
should detect this type of situation. For those of you who like to play
with sup via "rake gem", gems built from your checkout will have version
999.  (This was a suggestion Ian Taylor made a long time ago.)

diff --git a/Rakefile b/Rakefile
index 1932f62..33e9883 100644
--- a/Rakefile
+++ b/Rakefile
@@ -7,7 +7,12 @@ class Hoe
   def extra_deps; @extra_deps.reject { |x| Array(x).first == "hoe" } end
 end # thanks to "Mike H"
 
-Hoe.new('sup', Redwood::VERSION) do |p|
+## 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
+
+Hoe.new('sup', version) do |p|
   p.rubyforge_name = 'sup'
   p.author = "William Morgan"
   p.summary = 'A console-based email client with the best features of GMail, mutt, and emacs. Features full text search, labels, tagged operations, multiple buffers, recent contacts, and more.'
diff --git a/bin/sup b/bin/sup
index 0f48ab4..7314227 100644
--- a/bin/sup
+++ b/bin/sup
@@ -7,6 +7,20 @@ require 'fileutils'
 require 'trollop'
 require "sup"
 
+BIN_VERSION = "git"
+
+unless Redwood::VERSION == BIN_VERSION
+  $stderr.puts <<EOS
+
+Error: version mismatch!
+The sup executable is at version #{BIN_VERSION.inspect}.
+The sup libraries are at version #{Redwood::VERSION.inspect}.
+
+Is your development environment conflicting with rubygems?
+EOS
+  exit(-1)
+end
+
 $exceptions = []
 $opts = Trollop::options do
   version "sup v#{Redwood::VERSION}"
diff --git a/lib/sup.rb b/lib/sup.rb
index 5bb27ba..d34dec3 100644
--- a/lib/sup.rb
+++ b/lib/sup.rb
@@ -32,7 +32,7 @@ class Module
 end
 
 module Redwood
-  VERSION = "0.3"
+  VERSION = "git"
 
   BASE_DIR   = ENV["SUP_BASE"] || File.join(ENV["HOME"], ".sup")
   CONFIG_FN  = File.join(BASE_DIR, "config.yaml")

---

From: [email-masked] (Ingmar Vanhassel)
Date: Thu, 10 Jan 2008 08:05:40 +0100

> 999.  (This was a suggestion Ian Taylor made a long time ago.)

Hi,
That is a good idea imho, I have been doing something similar here.
Currently `rake gem` fails here though with the following error:
(using ruby-1.8.6_p111 & rake-0.7.3.)

ingmar at indigo /var/temp/portage/net-mail/sup-9999/work $ rake gem
(in /home/temp/portage/net-mail/sup-9999/work)
[Thu Jan 10 07:48:47 +0100 2008] using character set encoding "UTF-8"
rake aborted!
can't convert Fixnum into String
/home/temp/portage/net-mail/sup-9999/work/Rakefile:15:in `new'

Thank you

---

From: [email-masked] (William Morgan)
Date: Thu, 10 Jan 2008 08:22:03 -0800

> /home/temp/portage/net-mail/sup-9999/work/Rakefile:15:in `new'

Well Rake helpfully omits the backtrace, and I can think of a very easy
way to convert a fixnum into a string, but I'm guessing this is a
problem with an earlier version of RubyGems than I have. Does this patch
help?

diff --git a/Rakefile b/Rakefile
index 33e9883..69f0b68 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 = Redwood::VERSION == "git" ? "999" : Redwood::VERSION
 
 Hoe.new('sup', version) do |p|
   p.rubyforge_name = 'sup'

---

From: [email-masked] (Ingmar Vanhassel)
Date: Thu, 10 Jan 2008 18:23:35 +0100

Excerpts from William Morgan's message of Thu Jan 10 17:22:03 +0100 2008:
> problem with an earlier version of RubyGems than I have.

I have rubygems-0.9.4-r2.

> Does this patch help?

It does, thanks!

---

From: [email-masked] (William Morgan)
Date: Thu, 10 Jan 2008 09:45:50 -0800

> I have rubygems-0.9.4-r2.

Ok, 1.0.1 here, so that's probably the difference.

> It does, thanks!

Applied to next.