emacs-devel
[Top][All Lists]
Advanced

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

Re: transpose-sexps


From: Stuart D. Herring
Subject: Re: transpose-sexps
Date: Thu, 4 Jan 2007 14:49:14 -0800 (PST)
User-agent: SquirrelMail/1.4.8-2.el3.7lanl

> It's not just confusing, it's a bug.  If it doesn't work and this is not
> (easily) fixable, make it do nothing or report an error.  Producing
> confusing
> results is worse than doing nothing.
>
> Paul

In the list case, it's not a bug, because it's impossible to guess the
user's intentions.  In
  (-!-foo bar) (baz spam)
with point as always at -!-, is the "current sexp" (to be transposed with
the following one) the symbol foo, or the list (foo bar)?

For the string case, it would be possible to "fix" this, but to do nothing
or report an error requires detecting the case just as much as doing the
right thing.  It is the detection which is hard -- just ask the CC mode
people trying to sort out defun detection.  Even in Lisp it's equivalent
to asking how many unescaped " characters precede point, not counting
those in comments (whose identification itself requires counting " in the
same manner).  Perhaps some clever caching or hints from the user could
make that reasonable to implement, but there is no useful change at all
that is easily made.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




reply via email to

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