RE: dogfood feedback -- Smart Quotes


Subject: RE: dogfood feedback -- Smart Quotes
From: Paul Rohr (paul@abisource.com)
Date: Tue Mar 27 2001 - 16:45:18 CST


At 05:13 PM 3/26/01 -0800, WJCarpenter wrote:
><http://www.abisource.com/mailinglists/abiword-dev/01/February/1308.html>
>
>wjc> We can collapse all of those cases and just say that when smart
>wjc> quote stuff creates the aggregated UNDO blob, it not only does
>wjc> the delete/insert of the old and new quote, but it also does a
>wjc> delete/insert of the character following the replaced quote (and
>wjc> does all that in an order such that the UNDO machinery does the
>wjc> insertion point stuff that we've been talking about).
>
>I wailed away on this for a bit last night before concluding that this
>simple and elegant solution doesn't quite work out. The problem is
>that I did too good a job when I implemented it. Smart quote
>promotion doesn't just happen when you're typing. It happens any time
>you're inserting text. UNDO is one such time. So, UNDO/REDO of two
>characters instead of a single character gets the insertion point
>where we want it, but it also causes re-promotion of the smart quote
>character.
>
>So, this bit of simple elegance is out. It will probably be some time
>before the appropriate bit of simple elegance smacks me in the head.

Bummer. Is it possible that you're just invoking the smart quotes algorithm
at too low a level? Of the following four equivalence classes:

  1. typing
  2. paste from clipboard
  3. replace
  4. undo/redo

it's by no means clear to me that all should trigger this logic. In fact,
an argument could be made that it should *only* happen for #1, no? (I admit
to not having thought through the clipboard cases, but it's not at all
obvious that they should trigger quote promotion, either.)

If you only need to fire the algorithm when typing, then could you just move
the triggering logic so it only gets invoked from that edit method?

>In other words, I don't expect to work on this again before the tree
>closes this week. It doesn't seem like an important enough thing to
>stick some ugly code on until the right solution arises.

I'd still love to have a fix for Vlad's apostrophe-munching problem, but
this can definitely wait for the right fix.

Paul

PS: I still haven't read your code for this feature, so if I'm all wet,
just ignore me.



This archive was generated by hypermail 2b25 : Tue Mar 27 2001 - 16:38:02 CST