summaryrefslogtreecommitdiff
path: root/src/editfns.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-07-20 20:47:40 +0000
committerRichard M. Stallman <rms@gnu.org>1995-07-20 20:47:40 +0000
commit73175bfa80409a4f727524a535de12de8abfbe0f (patch)
tree7c886f41b7fb23734dea77a73874ac4f2277e93a /src/editfns.c
parentb2ecb9b6f790db245a0b13748429afe870b1473c (diff)
downloademacs-73175bfa80409a4f727524a535de12de8abfbe0f.tar.gz
(Fsubst_char_in_region): Bind buffer-file-name to nil if NOUNDO is true.
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 4a92eb8b6f2..ba9e922eb6e 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1378,6 +1378,13 @@ subst_char_in_region_unwind (arg)
return current_buffer->undo_list = arg;
}
+static Lisp_Object
+subst_char_in_region_unwind_1 (arg)
+ Lisp_Object arg;
+{
+ return current_buffer->filename = arg;
+}
+
DEFUN ("subst-char-in-region", Fsubst_char_in_region,
Ssubst_char_in_region, 4, 5, 0,
"From START to END, replace FROMCHAR with TOCHAR each time it occurs.\n\
@@ -1400,12 +1407,17 @@ and don't mark the buffer as really changed.")
/* If we don't want undo, turn off putting stuff on the list.
That's faster than getting rid of things,
- and it prevents even the entry for a first change. */
+ and it prevents even the entry for a first change.
+ Also inhibit locking the file. */
if (!NILP (noundo))
{
record_unwind_protect (subst_char_in_region_unwind,
current_buffer->undo_list);
current_buffer->undo_list = Qt;
+ /* Don't do file-locking. */
+ record_unwind_protect (subst_char_in_region_unwind_1,
+ current_buffer->filename);
+ current_buffer->filename = Qnil;
}
while (pos < stop)