Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
d5a539cd
Commit
d5a539cd
authored
Jan 19, 1995
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(subst_char_in_region_unwind): New function.
(Fsubst_char_in_region): Use it to make undo_list t temporarily.
parent
efcce2d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
src/editfns.c
src/editfns.c
+19
-0
No files found.
src/editfns.c
View file @
d5a539cd
...
...
@@ -1266,6 +1266,13 @@ determines whether case is significant or ignored.")
return
make_number
(
0
);
}
static
Lisp_Object
subst_char_in_region_unwind
(
arg
)
Lisp_Object
arg
;
{
return
current_buffer
->
undo_list
=
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
\
...
...
@@ -1276,6 +1283,7 @@ and don't mark the buffer as really changed.")
{
register
int
pos
,
stop
,
look
;
int
changed
=
0
;
int
count
=
specpdl_ptr
-
specpdl
;
validate_region
(
&
start
,
&
end
);
CHECK_NUMBER
(
fromchar
,
2
);
...
...
@@ -1285,6 +1293,16 @@ and don't mark the buffer as really changed.")
stop
=
XINT
(
end
);
look
=
XINT
(
fromchar
);
/* 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. */
if
(
!
NILP
(
noundo
))
{
record_unwind_protect
(
subst_char_in_region_unwind
,
current_buffer
->
undo_list
);
current_buffer
->
undo_list
=
Qt
;
}
while
(
pos
<
stop
)
{
if
(
FETCH_CHAR
(
pos
)
==
look
)
...
...
@@ -1315,6 +1333,7 @@ and don't mark the buffer as really changed.")
signal_after_change
(
XINT
(
start
),
stop
-
XINT
(
start
),
stop
-
XINT
(
start
));
unbind_to
(
count
,
Qnil
);
return
Qnil
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment