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
Open sidebar
emacs
emacs
Commits
c7ca41e6
Commit
c7ca41e6
authored
Aug 28, 1996
by
Richard M. Stallman
Browse files
(save-match-data): Use save-match-data-internal
as the local variable, instead of an uninterned symbol.
parent
b26e6764
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
lisp/subr.el
lisp/subr.el
+10
-5
No files found.
lisp/subr.el
View file @
c7ca41e6
...
...
@@ -740,13 +740,18 @@ Wildcards and redirection are handled as usual in the shell."
(
start-process
name
buffer
shell-file-name
shell-command-switch
(
mapconcat
'identity
args
" "
)))))
(
defvar
save-match-data-internal
)
;; We use save-match-data-internal as the local variable because
;; that works ok in practice (people should not use that variable elsewhere).
;; We used to use an uninterned symbol; the compiler handles that properly
;; now, but it generates slower code.
(
defmacro
save-match-data
(
&rest
body
)
"Execute the BODY forms, restoring the global value of the match data."
(
let
((
original
(
make-symbol
"match-data"
)))
(
list
'let
(
list
(
list
original
'
(
match-data
)))
(
list
'unwind-protect
(
cons
'progn
body
)
(
list
'store-match-data
original
)))))
`
(
let
((
save-match-data-variable
'
(
match-data
)))
(
unwind-protect
(
progn
,@
body
)
(
store-match-data
save-match-data-variable
))))
)
(
defun
match-string
(
num
&optional
string
)
"Return string of text matched by last search.
...
...
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