[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gnu-emacs] (no subject)
From: |
Sean McAfee |
Subject: |
[Help-gnu-emacs] (no subject) |
Date: |
Wed, 20 Sep 2000 18:48:47 -0400 (EDT) |
A while back I decided I wanted a command that would invoke replace-regexp
when called without an argument, and query-replace-regexp if called with
an argument. Here's what I came up with:
(defun general-replace-regexp (arg)
(interactive "P")
(call-interactively (if (null arg) 'replace-regexp 'query-replace-regexp)))
I bound this function to M-s. When I type M-s to invoke replace-regexp, it
works as I would expect. The problem is that when I type C-u M-s and enter
my pattern and replacement, the pattern never matches anything, even if
text which the pattern should definitely match is present.
I can only guess that the C-u I use to invoke query-replace-regexp is
getting propagated to it somehow and altering its behavior. Can someone
tell me 1) how this happens, and 2) how to avoid it?
Thanks in advance.
--
Sean McAfee | GCS d->-- s+++: a28 C++ US+++ P+++$ L++ E- W+ N++ |
| K w--- O? M- V-- PS+ PE Y+ PGP?>++ t+() 5++ X R+ | mcafee@
| tv+ b++ DI++ D+ G e++ h r---* y+>++ | umich.edu
- [Help-gnu-emacs] (no subject),
Sean McAfee <=