aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)
1378 return current_buffer->undo_list = arg; 1378 return current_buffer->undo_list = arg;
1379} 1379}
1380 1380
1381static Lisp_Object
1382subst_char_in_region_unwind_1 (arg)
1383 Lisp_Object arg;
1384{
1385 return current_buffer->filename = arg;
1386}
1387
1381DEFUN ("subst-char-in-region", Fsubst_char_in_region, 1388DEFUN ("subst-char-in-region", Fsubst_char_in_region,
1382 Ssubst_char_in_region, 4, 5, 0, 1389 Ssubst_char_in_region, 4, 5, 0,
1383 "From START to END, replace FROMCHAR with TOCHAR each time it occurs.\n\ 1390 "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.")
1400 1407
1401 /* If we don't want undo, turn off putting stuff on the list. 1408 /* If we don't want undo, turn off putting stuff on the list.
1402 That's faster than getting rid of things, 1409 That's faster than getting rid of things,
1403 and it prevents even the entry for a first change. */ 1410 and it prevents even the entry for a first change.
1411 Also inhibit locking the file. */
1404 if (!NILP (noundo)) 1412 if (!NILP (noundo))
1405 { 1413 {
1406 record_unwind_protect (subst_char_in_region_unwind, 1414 record_unwind_protect (subst_char_in_region_unwind,
1407 current_buffer->undo_list); 1415 current_buffer->undo_list);
1408 current_buffer->undo_list = Qt; 1416 current_buffer->undo_list = Qt;
1417 /* Don't do file-locking. */
1418 record_unwind_protect (subst_char_in_region_unwind_1,
1419 current_buffer->filename);
1420 current_buffer->filename = Qnil;
1409 } 1421 }
1410 1422
1411 while (pos < stop) 1423 while (pos < stop)