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
c834b52c
Commit
c834b52c
authored
Mar 21, 2000
by
Stefan Monnier
Browse files
(combine-run-hooks): New function.
parent
6c4bfdc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
lisp/subr.el
lisp/subr.el
+29
-0
No files found.
lisp/subr.el
View file @
c834b52c
...
...
@@ -1089,6 +1089,35 @@ in BODY."
.
,
body
)
(
combine-after-change-execute
)))
(
defvar
combine-run-hooks
t
"List of hooks delayed. Or t if we're not delaying hooks."
)
(
defmacro
combine-run-hooks
(
&rest
body
)
"Execute BODY, but delay any `run-hooks' until the end."
(
let
((
saved-combine-run-hooks
(
make-symbol
"saved-combine-run-hooks"
))
(
saved-run-hooks
(
make-symbol
"saved-run-hooks"
)))
`
(
let
((
,
saved-combine-run-hooks
combine-run-hooks
)
(
,
saved-run-hooks
(
symbol-function
'run-hooks
)))
(
unwind-protect
(
progn
;; If we're not delaying hooks yet, setup the delaying mode
(
unless
(
listp
combine-run-hooks
)
(
setq
combine-run-hooks
nil
)
(
fset
'run-hooks
,
(
lambda
(
&rest
hooks
)
(
setq
combine-run-hooks
(
append
combine-run-hooks
hooks
)))))
,@
body
)
;; If we were not already delaying, then it's now time to set things
;; back to normal and to execute the delayed hooks.
(
unless
(
listp
,
saved-combine-run-hooks
)
(
setq
,
saved-combine-run-hooks
combine-run-hooks
)
(
fset
'run-hooks
,
saved-run-hooks
)
(
setq
combine-run-hooks
t
)
(
apply
'run-hooks
,
saved-combine-run-hooks
))))))
(
defmacro
with-syntax-table
(
table
&rest
body
)
"Evaluate BODY with syntax table of current buffer set to a copy of TABLE.
The syntax table of the current buffer is saved, BODY is evaluated, and the
...
...
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