(defconst edebug-trace-buffer "*edebug-trace*"
"Name of the buffer to put trace info in.")
+(defun edebug-focus-frame (frame)
+ "Switch focus to frame FRAME, if we're in a GUI.
+Otherwise, do nothing."
+ (unless (memq (framep frame) '(nil t pc))
+ (x-focus-frame frame)))
+
(defun edebug-pop-to-buffer (buffer &optional window)
;; Like pop-to-buffer, but select window where BUFFER was last shown.
;; Select WINDOW if it is provided and still exists. Otherwise,
(debugger edebug-debugger) ; only while edebug is active.
(edebug-outside-debug-on-error debug-on-error)
(edebug-outside-debug-on-quit debug-on-quit)
+ (outside-frame (selected-frame))
;; Binding these may not be the right thing to do.
;; We want to allow the global values to be changed.
(debug-on-error (or debug-on-error edebug-on-error))
edebug-initial-mode
edebug-execution-mode)
edebug-next-execution-mode nil)
- (edebug-default-enter function args body))))
+ (edebug-default-enter function args body))
+ (if (frame-live-p outside-frame)
+ (edebug-focus-frame outside-frame))))
(let* ((edebug-data (get function 'edebug))
(edebug-def-mark (car edebug-data)) ; mark at def start
(edebug-eval-display eval-result-list)
;; The evaluation list better not have deleted edebug-window-data.
(select-window (car edebug-window-data))
+ (edebug-focus-frame (window-frame (selected-window)))
(set-buffer edebug-buffer)
(setq edebug-buffer-outside-point (point))
;;(if edebug-inside-windows
;; (edebug-set-windows edebug-inside-windows))
(edebug-pop-to-buffer edebug-buffer)
+ (edebug-focus-frame (window-frame (selected-window)))
(goto-char edebug-point))
(defun edebug-view-outside ()
;; If the buffer's currently displayed, avoid set-window-configuration.
(save-window-excursion
(edebug-pop-to-buffer edebug-outside-buffer)
+ (edebug-focus-frame (window-frame (selected-window)))
(goto-char edebug-outside-point)
(message "Current buffer: %s Point: %s Mark: %s"
(current-buffer) (point)
(if (marker-buffer (edebug-mark-marker))
(marker-position (edebug-mark-marker)) "<not set>"))
(sit-for arg)
- (edebug-pop-to-buffer edebug-buffer (car edebug-window-data)))))
+ (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))
+ (edebug-focus-frame (window-frame (selected-window))))))
;; Joe Wells, here is a start at your idea of adding a buffer to the internal
"Switch to the evaluation list buffer \"*edebug*\"."
(interactive)
(edebug-eval-redisplay)
- (edebug-pop-to-buffer edebug-eval-buffer))
+ (edebug-pop-to-buffer edebug-eval-buffer)
+ (edebug-focus-frame (window-frame (selected-window))))
(defun edebug-update-eval-list ()
if (flags & READABLE_EVENTS_DO_TIMERS_NOW)
timer_check ();
- /* If the buffer contains only FOCUS_IN_EVENT events, and
+ /* If the buffer contains only FOCUS_IN/OUT_EVENT events, and
READABLE_EVENTS_FILTER_EVENTS is set, report it as empty. */
if (kbd_fetch_ptr != kbd_store_ptr)
{
#ifdef USE_TOOLKIT_SCROLL_BARS
(flags & READABLE_EVENTS_FILTER_EVENTS) &&
#endif
- event->kind == FOCUS_IN_EVENT)
+ (event->kind == FOCUS_IN_EVENT
+ || event->kind == FOCUS_OUT_EVENT))
#ifdef USE_TOOLKIT_SCROLL_BARS
&& !((flags & READABLE_EVENTS_IGNORE_SQUEEZABLES)
&& (event->kind == SCROLL_BAR_CLICK_EVENT