[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

shift-select harmony

From: Thomas Lord
Subject: shift-select harmony
Date: Sat, 15 Mar 2008 15:01:02 -0700
User-agent: Thunderbird (X11/20060808)

I was thinking about a test-case of the shift-select
design I proposed.   Consider a hypothetical
"yank-as-s-exp" command.   It:

    inserts '(' at the point
    inserts ')' at the point

Such a command could be created as a keyboard
macro, for example.

With my design, and a naively coded yank-as-s-exp
what happens?

The insert of '(' deletes a transient region, if one
is present.   The yank yanks but also sets a variable
preserved-transient-mark.   The ')' redundantly
deletes the (now empty) transient region.  Upon
return, consulting the variable preserved-..., the
command loop restores the transient mark so, in
the end, the new s-exp is left selected as the transient

Such an example doesn't absolutely prove that my
design is the right one.   Perhaps there are natural,
hard to locate-and-fix counter-examples of
how the new variables would break existing code.
Kudos for anyone can think of such exceptions ahead
of running into them in practice.

But, such an example does strengthen the hypothesis
that my design is a good one:  that I've succeeded at
marrying the traditional model of Emacs' "dynamic
state" to an extension of that model that provides selection
behavior more like popular GUI apps.
There is a "harmony" between my proposed design
and the traditional Emacs model.  It "DTRT" by
default in what seems to be the default case.  It leaves
a pretty small number of cases to be dealt with by hand.

The original mistake (of transient-....) was, again,
in trying to use the current mark rather than creating
the concept of a transient mark.   It's a very old mistake.
I can understand the confusion that results.  But... I
think what I'm suggesting fixes that confusion and if
it doesn't I'd really appreciate a concise, lucid explanation
of why.   The current effort seems to still suffer under
that original mistake.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]