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
ee6cff99
Commit
ee6cff99
authored
May 06, 2013
by
Stefan Monnier
Browse files
* lisp/emacs-lisp/trace.el (trace--display-buffer): New function.
(trace-make-advice): Use it.
parent
32985194
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/emacs-lisp/trace.el
lisp/emacs-lisp/trace.el
+14
-10
No files found.
lisp/ChangeLog
View file @
ee6cff99
2013-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/trace.el (trace--display-buffer): New function.
(trace-make-advice): Use it.
2013-05-06 Juri Linkov <juri@jurta.org>
* emacs-lisp/lisp-mode.el (eval-defun-2): Doc fix. (Bug#14344)
...
...
lisp/emacs-lisp/trace.el
View file @
ee6cff99
...
...
@@ -200,6 +200,18 @@ some global variables)."
(
defvar
trace--timer
nil
)
(
defun
trace--display-buffer
(
buf
)
(
unless
(
or
trace--timer
(
get-buffer-window
buf
'visible
))
(
setq
trace--timer
;; Postpone the display to some later time, in case we
;; can't actually do it now.
(
run-with-timer
0
nil
(
lambda
()
(
setq
trace--timer
nil
)
(
display-buffer
buf
nil
0
))))))
(
defun
trace-make-advice
(
function
buffer
background
context
)
"Build the piece of advice to be added to trace FUNCTION.
FUNCTION is the name of the traced function.
...
...
@@ -214,15 +226,7 @@ be printed along with the arguments in the trace."
(
unless
inhibit-trace
(
with-current-buffer
trace-buffer
(
set
(
make-local-variable
'window-point-insertion-type
)
t
)
(
unless
(
or
background
trace--timer
(
get-buffer-window
trace-buffer
'visible
))
(
setq
trace--timer
;; Postpone the display to some later time, in case we
;; can't actually do it now.
(
run-with-timer
0
nil
(
lambda
()
(
setq
trace--timer
nil
)
(
display-buffer
trace-buffer
)))))
(
unless
background
(
trace--display-buffer
trace-buffer
))
(
goto-char
(
point-max
))
;; Insert a separator from previous trace output:
(
if
(
=
trace-level
1
)
(
insert
trace-separator
))
...
...
@@ -235,7 +239,7 @@ be printed along with the arguments in the trace."
(
unless
inhibit-trace
(
let
((
ctx
(
funcall
context
)))
(
with-current-buffer
trace-buffer
(
unless
background
(
display-buffer
trace-buffer
))
(
unless
background
(
trace--
display-buffer
trace-buffer
))
(
goto-char
(
point-max
))
(
insert
(
trace-exit-message
...
...
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