Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] redo ideas
Date: Wed, 29 Apr 2009 11:22:41 -0700	[thread overview]
Message-ID: <1241028879-sup-6375@entry> (raw)
In-Reply-To: <200904271244.n3RCi1VO027803@smtp6.server.rpi.edu>

Reformatted excerpts from Mike S's message of 2009-04-27:
> I'm graduating in a few weeks, so I'll have some free time I can
> dedicate to sup again.

Congrats! Great!

> I'd like to register Ctrl-R to keep with the vim bindings.

Sure.

> Ugly method 2: write code in duplicate, register a redo and call redo
> This saves duplication of code, but it seems unnecessarily complex.
> 
> * create undo lambda
> * create redo lambda
> * register undo and redo, but 'queue up' redo
> * UndoManager.redo

Redo is actually a slightly different operation from do. Do has to ask
for user input (what label do you want to apply?), redo just reuses it.
Maybe that's not such a big deal though; do/redo can just check to see
if it already has the value from the user, and ask if not.

> Slightly clever method: have primitives return their own undo/redo.
> This can be seen in toggle_starred where actually_toggle_starred
> returns its inverse. This shifts the complexity down and keeps higher
> level code clean.

That sounds eminently reasonable to me.
-- 
William <wmorgan-sup at masanjin.net>


      parent reply	other threads:[~2009-04-29 18:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200904271244.n3RCi1VO027803@smtp6.server.rpi.edu>
2009-04-27 19:47 ` Nicolas Pouillard
2009-04-29 18:22 ` William Morgan [this message]

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=1241028879-sup-6375@entry \
    --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