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

[no subject]



CC: (BUG EMACS) at MIT-AI, GLS at MIT-AI

In system 25.0, with microcode 612, on LISP Machine Two:

I suggest the following new feature:  C-M-% does the floowing hairy thing.
It is assumed that the cursor is somewhere before or in one variable-binding
clause of a LET.  It verifies this and decides which one by doing successive C-M-(
operations until it discovers that two of them have bounded the word LET plus
possible whitespace (you do it this way so that you don't count being in the
bodies of inner LETs).  Then you go to the right of the ( after the LET and do
C-M-N repeatedly until you pass the original cursor position, then back up
one; that's the binding clause in question.  Call the two parts of the clause
the variable and the value.  Then you enter Query Replace mode with the value
as first argument and the variable as second argument (but ^U exchanges these
roles), and with the range of the replace (enforced by temporary buffer bounds?)
reduced to the body of the LET (or the rest of the buffer if the body is incomplete).

This allows you to write a piece of code, notice that (CAR FOO) is used all over the
place, then install (LET ((BAZ (CAR FOO))) ... ) and easily make the appropriate changes.
^U lets you easily de-install such a LET if that's what you want.