Subject: [sup-talk] How to make emacs position my cursor for me

From: [email-masked] (Steve Goldman)
Date: Tue, 04 Nov 2008 10:55:32 -0500

I understand your religious fanaticism about top posting, etc.  I'll buy into it if you can tell me how to make sup make emacs position my cursor in the correct place when I hit compose or reply.  I want to hit 'c' or 'r' and immediately begin typing, instead of navigate around the buffer and dodge quoted text and a hundred signatures.

Thanks.
-- 

Steve Goldman
sgoldman at tower-research.com

T: 212.219.6014
F: 212.219.6007

Tower Research Capital, LLC
377 Broadway, 11th Fl.
New York, NY 10013

---

From: [email-masked] (Stephen Patterson)
Date: Tue, 4 Nov 2008 16:25:42 +0000

> I understand your religious fanaticism about top posting, etc.  I'll buy into it if you can tell me how to make sup make emacs position my cursor in the correct place when I hit compose or reply.…

Not sure how you set the editor for sup, but "emacs +8" will start the
cursor on line 8. Mail clients (mutt) normally put the cursor at the top
though.

---

From: [email-masked] (John Bent)
Date: Tue, 04 Nov 2008 10:18:52 -0700

> cursor on line 8. Mail clients (mutt) normally put the cursor at the top
To set the editor for sup, just edit the :editor: line in
.sup/config.yaml.

vim has the same +N option but for email editing in sup I prefer 
'+/^\s*\n'  which sets the initial cursor position to the first blank
line (i.e. following the email headers).  

John

---

From: [email-masked] (Nicolas Pouillard)
Date: Tue, 04 Nov 2008 20:06:11 +0100

> line (i.e. following the email headers).  

Cool, thanks for the tip!

-- 
Nicolas Pouillard aka Ertai

---

From: [email-masked] (Tomas Pospisek ML)
Date: Tue, 04 Nov 2008 21:28:35 +0000

>Cool, thanks for the tip!

Sounds like a reasonable default to me. (Sorry for not putting this into
a Git repo William. In case I get around hacking larger pieces of Sup
I'll do that I promise):

--- sup.rb.orig	2008-11-04 22:19:35.000000000 +0100
+++ sup.rb	2008-11-04 22:23:45.000000000 +0100
@@ -212,7 +212,8 @@
         :signature => File.join(ENV["HOME"], ".signature")
       }
     },
-    :editor => ENV["EDITOR"] || "/usr/bin/vim -f -c 'setlocal spell
spelllang=en_us' -c 'set filetype=mail'",
+    :editor => ENV["EDITOR"] ||
+               '/usr/bin/vim -f -c "setlocal spell spelllang=en_us"
-c "set filetype=mail" -c \'+/^\s*\n\'',
     :thread_by_subject => false,
     :edit_signature => false,
     :ask_for_cc => true,

---

From: [email-masked] (John Bent)
Date: Tue, 04 Nov 2008 15:11:09 -0700

> a Git repo William. In case I get around hacking larger pieces of Sup
You don't want the preceding -c.  The tics (') are to protect the
slashes and wildcards from the shell.  This is what you want:

'/usr/bin/vim -f +/^\s*\n-c "setlocal spell spelllang=en_us" -c "set filetype=mail" '

I also like passing -X to make it go a little faster in a terminal....

John

---

From: [email-masked] (William Morgan)
Date: Sun, 09 Nov 2008 19:51:55 -0800

> '/usr/bin/vim -f +/^\s*\n-c "setlocal spell spelllang=en_us" -c "set

I'll accept a patch to this effect if someone wants to whip one up!
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Marc Hartstein)
Date: Wed, 26 Nov 2008 16:16:28 -0500

> I'll accept a patch to this effect if someone wants to whip one up!

To discourage top-posting, would it not be preferable to begin with the
cursor on the last line rather than the first line of the body?

:editor: '/usr/bin/vim -f +$ -c "setlocal spell spelllang=en_us" -c "set
filetype=mail"'

(Of course, that might encourage an increased cascade, but there's only
so much the tool author can do to encourage the user to comply with
conventions)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20081126/70488389/attachment.bin>