emacs-devel
[Top][All Lists]
Advanced

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

Re: Bug: Unable to request replace-string of " \t"


From: Bob Rogers
Subject: Re: Bug: Unable to request replace-string of " \t"
Date: Sun, 16 Jul 2006 12:33:34 -0400

   From: Andreas Schwab <address@hidden>
   Date: Sun, 16 Jul 2006 10:34:41 +0200

   Bob Rogers <address@hidden> writes:

   >    2.  "M-x replace-string RET SPC TAB RET x RET".  It won't matter that
   > it doesn't replace anything.  Notice that the SPC and TAB are inserted
   > into the minibuffer normally,

   TAB runs the command indent-for-tab-command
      which is an interactive compiled Lisp function in `indent.el'.
   It is bound to TAB.
   (indent-for-tab-command &optional ARG)

OK, so it's nice that TAB canonicalizes preceding whitespace generally,
but why here?  Why should replace-string assume that I didn't really
mean what I literally typed?

   Furthermore, typing TAB also canonicalizes spaces in the *second*
argument to replace-string, which strikes me as clearly wrong:  " \t" is
not equivalent to "\t" in the replacement, which could start at any
column position.

   From: Andreas Roehler <address@hidden>
   Date: Sun, 16 Jul 2006 09:23:11 +0200

   . . .

   BTW is this in the docu? At a first glance searching at
   `string-replace' I couldn't see it.

It does amount to a change in behavior from 21.3.  But I think it would
reduce the "surprise factor" (not to mention buggy behavior) by making
TAB insert itself for both replace-string arguments.  Is anyone actually
expecting TAB to have side effects here?

                                        -- Bob




reply via email to

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