mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Simplify algorithm for popping up windows.
This commit is contained in:
parent
d70e061933
commit
1264d33105
3 changed files with 179 additions and 98 deletions
|
@ -1,3 +1,30 @@
|
||||||
|
2004-01-26 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* gds.el (gds-request-focus, gds-quit): Simplify. Old algorithm
|
||||||
|
left in as a big comment.
|
||||||
|
(gds-focus-in-function, gds-focus-in, gds-focus-out-function,
|
||||||
|
gds-focus-out): New.
|
||||||
|
|
||||||
|
* gds-client.scm (ui-read-thread-proc): Fix `with-mutex' syntax
|
||||||
|
error.
|
||||||
|
|
||||||
|
2004-01-25 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
|
* gds.el (gds-handle-client-input, gds-async-break,
|
||||||
|
gds-select-stack-frame, gds-query-modules, gds-go, gds-next,
|
||||||
|
gds-evaluate, gds-step-in, gds-step-out, gds-trace-finish,
|
||||||
|
gds-frame-info, gds-frame-args, gds-set-module-breakpoint,
|
||||||
|
gds-read-client, gds-choose-client): Change gds-focus-client to
|
||||||
|
gds-client.
|
||||||
|
(gds-choose-client): Set local value of gds-client to determined
|
||||||
|
client.
|
||||||
|
(gds-menu): Use gds-client rather than gds-focus-client.
|
||||||
|
(gds-client-ref): New.
|
||||||
|
(gds-client-blocked): Rewrite using gds-client-ref.
|
||||||
|
(gds-display-buffers): Take `client' arg instead of global
|
||||||
|
`gds-focus-client'.
|
||||||
|
(gds-request-focus): Call gds-display-buffers with explicit arg.
|
||||||
|
|
||||||
2004-01-20 Neil Jerram <neil@ossau.uklinux.net>
|
2004-01-20 Neil Jerram <neil@ossau.uklinux.net>
|
||||||
|
|
||||||
* gds.el: Changes throughout because of (i) change of gds-send
|
* gds.el: Changes throughout because of (i) change of gds-send
|
||||||
|
|
|
@ -198,7 +198,7 @@ decimal IP address where the UI server is running; default is
|
||||||
(or (gds-connected?)
|
(or (gds-connected?)
|
||||||
(error "Not connected to UI server."))
|
(error "Not connected to UI server."))
|
||||||
;; Take over server/UI interaction from the normal UI read thread.
|
;; Take over server/UI interaction from the normal UI read thread.
|
||||||
(with-mutex ui-read-mutex)
|
(with-mutex ui-read-mutex
|
||||||
(write-char #\x (cdr ui-read-switch-pipe))
|
(write-char #\x (cdr ui-read-switch-pipe))
|
||||||
(force-output (cdr ui-read-switch-pipe))
|
(force-output (cdr ui-read-switch-pipe))
|
||||||
(write-note 'char-written)
|
(write-note 'char-written)
|
||||||
|
@ -220,7 +220,7 @@ decimal IP address where the UI server is running; default is
|
||||||
(lambda args *unspecified*))
|
(lambda args *unspecified*))
|
||||||
(write-note 'cond-signal)
|
(write-note 'cond-signal)
|
||||||
;; Tell the UI read thread that it can take control again.
|
;; Tell the UI read thread that it can take control again.
|
||||||
(signal-condition-variable ui-read-switch))
|
(signal-condition-variable ui-read-switch)))
|
||||||
|
|
||||||
|
|
||||||
;;;; {General Output to Server/UI}
|
;;;; {General Output to Server/UI}
|
||||||
|
|
246
emacs/gds.el
246
emacs/gds.el
|
@ -68,9 +68,7 @@
|
||||||
"Shut down the GDS subprocess."
|
"Shut down the GDS subprocess."
|
||||||
(interactive)
|
(interactive)
|
||||||
;; Reset variables.
|
;; Reset variables.
|
||||||
(setq gds-buffers nil
|
(setq gds-buffers nil)
|
||||||
gds-focus-client nil
|
|
||||||
gds-waiting nil)
|
|
||||||
;; Kill the subprocess.
|
;; Kill the subprocess.
|
||||||
(process-kill-without-query gds-process)
|
(process-kill-without-query gds-process)
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
|
@ -109,11 +107,55 @@
|
||||||
(process-send-string gds-process (format "(%S %s)\n" client string)))
|
(process-send-string gds-process (format "(%S %s)\n" client string)))
|
||||||
|
|
||||||
|
|
||||||
;;;; Multiple application scheduling.
|
;;;; Focussing in and out on interaction with a particular client.
|
||||||
|
|
||||||
|
;;;; The slight possible problems here are that popping up a client's
|
||||||
|
;;;; interaction windows when that client wants attention might
|
||||||
|
;;;; interrupt something else that the Emacs user was working on at
|
||||||
|
;;;; the time, and that if multiple clients are being debugged at the
|
||||||
|
;;;; same time, their popping up of interaction windows might become
|
||||||
|
;;;; confusing. For this reason, we allow GDS's behavior to be
|
||||||
|
;;;; customized via the variables `gds-focus-in-function' and
|
||||||
|
;;;; `gds-focus-out-function'.
|
||||||
|
;;;;
|
||||||
|
;;;; That said, the default policy, which is probably OK for most
|
||||||
|
;;;; users most of the time, is very simple: when a client wants
|
||||||
|
;;;; attention, its interaction windows are popped up immediately.
|
||||||
|
|
||||||
|
(defun gds-request-focus (client)
|
||||||
|
(funcall gds-focus-in-function client))
|
||||||
|
|
||||||
|
(defcustom gds-focus-in-function (function gds-focus-in)
|
||||||
|
"Function to call when a GDS client program wants user attention.
|
||||||
|
The function is called with one argument, the CLIENT in question."
|
||||||
|
:type 'function
|
||||||
|
:group 'gds)
|
||||||
|
|
||||||
|
(defun gds-focus-in (client)
|
||||||
|
(gds-display-buffers client))
|
||||||
|
|
||||||
|
(defun gds-quit ()
|
||||||
|
(interactive)
|
||||||
|
(funcall gds-focus-out-function))
|
||||||
|
|
||||||
|
(defcustom gds-focus-out-function (function gds-focus-out)
|
||||||
|
"Function to call when user quits interacting with a GDS client."
|
||||||
|
:type 'function
|
||||||
|
:group 'gds)
|
||||||
|
|
||||||
|
(defun gds-focus-out ()
|
||||||
|
(if (if (gds-client-blocked)
|
||||||
|
(y-or-n-p "Client is waiting for input. Quit anyway? ")
|
||||||
|
t)
|
||||||
|
(bury-buffer (current-buffer))))
|
||||||
|
|
||||||
|
|
||||||
|
;;;; Multiple client focus -- an alternative implementation.
|
||||||
|
|
||||||
|
;;;; The following code is provided as an alternative example of how a
|
||||||
|
;;;; customized GDS could schedule the display of multiple clients
|
||||||
|
;;;; that are competing for user attention.
|
||||||
|
|
||||||
;; Here is how we schedule the display of multiple clients that are
|
|
||||||
;; competing for user attention.
|
|
||||||
;;
|
|
||||||
;; - `gds-waiting' holds a list of clients that want attention but
|
;; - `gds-waiting' holds a list of clients that want attention but
|
||||||
;; haven't yet got it. A client is added to this list for two
|
;; haven't yet got it. A client is added to this list for two
|
||||||
;; reasons. (1) When it is blocked waiting for user input.
|
;; reasons. (1) When it is blocked waiting for user input.
|
||||||
|
@ -127,40 +169,39 @@
|
||||||
;; says that it is no longer blocked, and a small time passes without
|
;; says that it is no longer blocked, and a small time passes without
|
||||||
;; it becoming blocked again. (2) If the user explicitly `quits'
|
;; it becoming blocked again. (2) If the user explicitly `quits'
|
||||||
;; that client.
|
;; that client.
|
||||||
(defvar gds-focus-client nil)
|
;;
|
||||||
(defvar gds-waiting nil)
|
;; (defvar gds-focus-client nil)
|
||||||
|
;; (defvar gds-waiting nil)
|
||||||
(defun gds-request-focus (client)
|
;;
|
||||||
(cond ((eq client gds-focus-client)
|
;; (defun gds-focus-in-alternative (client)
|
||||||
;; CLIENT already has the focus. Display its buffer.
|
;; (cond ((eq client gds-focus-client)
|
||||||
(gds-display-buffers))
|
;; ;; CLIENT already has the focus. Display its buffer.
|
||||||
(gds-focus-client
|
;; (gds-display-buffers client))
|
||||||
;; Another client has the focus. Add CLIENT to `gds-waiting'.
|
;; (gds-focus-client
|
||||||
(or (memq client gds-waiting)
|
;; ;; Another client has the focus. Add CLIENT to `gds-waiting'.
|
||||||
(setq gds-waiting (append gds-waiting (list client)))))
|
;; (or (memq client gds-waiting)
|
||||||
(t
|
;; (setq gds-waiting (append gds-waiting (list client)))))
|
||||||
;; Give focus to CLIENT and display its buffer.
|
;; (t
|
||||||
(setq gds-focus-client client)
|
;; ;; Give focus to CLIENT and display its buffer.
|
||||||
(gds-display-buffers))))
|
;; (setq gds-focus-client client)
|
||||||
|
;; (gds-display-buffers client))))
|
||||||
;; Explicitly give up focus.
|
;;
|
||||||
(defun gds-quit ()
|
;; (defun gds-focus-out-alternative ()
|
||||||
(interactive)
|
;; (if (or (car gds-waiting)
|
||||||
(if (or (car gds-waiting)
|
;; (not (gds-client-blocked))
|
||||||
(not (gds-client-blocked))
|
;; (y-or-n-p
|
||||||
(y-or-n-p
|
;; "Client is blocked and no others are waiting. Still quit? "))
|
||||||
"Client is blocked and no others are waiting. Still quit? "))
|
;; (progn
|
||||||
(progn
|
;; (bury-buffer (current-buffer))
|
||||||
(bury-buffer (current-buffer))
|
;; ;; Pass on the focus.
|
||||||
;; Pass on the focus.
|
;; (setq gds-focus-client (car gds-waiting)
|
||||||
(setq gds-focus-client (car gds-waiting)
|
;; gds-waiting (cdr gds-waiting))
|
||||||
gds-waiting (cdr gds-waiting))
|
;; ;; If this client is blocked, add it back into the waiting list.
|
||||||
;; If this client is blocked, add it back into the waiting list.
|
;; (if (gds-client-blocked)
|
||||||
(if (gds-client-blocked)
|
;; (gds-request-focus gds-client))
|
||||||
(gds-request-focus gds-client))
|
;; ;; If there is a new focus client, request display for it.
|
||||||
;; If there is a new focus client, request display for it.
|
;; (if gds-focus-client
|
||||||
(if gds-focus-client
|
;; (gds-request-focus gds-focus-client)))))
|
||||||
(gds-request-focus gds-focus-client)))))
|
|
||||||
|
|
||||||
|
|
||||||
;;;; GDS protocol dispatch.
|
;;;; GDS protocol dispatch.
|
||||||
|
@ -180,6 +221,7 @@
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
(insert (format "rx %S" (cons client (cons proc args))) "\n")))
|
(insert (format "rx %S" (cons client (cons proc args))) "\n")))
|
||||||
|
|
||||||
(cond (;; (name ...) - Client name.
|
(cond (;; (name ...) - Client name.
|
||||||
(eq proc 'name)
|
(eq proc 'name)
|
||||||
(setq gds-pid (cadr args))
|
(setq gds-pid (cadr args))
|
||||||
|
@ -233,15 +275,14 @@
|
||||||
(setq gds-status 'closed)
|
(setq gds-status 'closed)
|
||||||
(gds-update-buffers)
|
(gds-update-buffers)
|
||||||
(setq gds-buffers
|
(setq gds-buffers
|
||||||
(delq (assq client gds-buffers) gds-buffers))
|
(delq (assq client gds-buffers) gds-buffers)))
|
||||||
(if (eq client gds-focus-client)
|
|
||||||
(gds-quit)))
|
|
||||||
|
|
||||||
(;; (eval-results ...) - Results of evaluation.
|
(;; (eval-results ...) - Results of evaluation.
|
||||||
(eq proc 'eval-results)
|
(eq proc 'eval-results)
|
||||||
(gds-display-results client (car args) (cdr args)))
|
(gds-display-results client (car args) (cdr args)))
|
||||||
|
|
||||||
((eq proc 'completion-result)
|
(;; (completion-result ...) - Available completions.
|
||||||
|
(eq proc 'completion-result)
|
||||||
(setq gds-completion-results (or (car args) t)))
|
(setq gds-completion-results (or (car args) t)))
|
||||||
|
|
||||||
(;; (breakpoint-set FILE LINE COLUMN INFO) - Breakpoint set.
|
(;; (breakpoint-set FILE LINE COLUMN INFO) - Breakpoint set.
|
||||||
|
@ -331,8 +372,18 @@
|
||||||
(setq gds-buffers (delq existing gds-buffers))
|
(setq gds-buffers (delq existing gds-buffers))
|
||||||
(gds-client-buffer client 'name '("(GDS buffer killed)"))))))
|
(gds-client-buffer client 'name '("(GDS buffer killed)"))))))
|
||||||
|
|
||||||
|
;; Get the current buffer's associated client's value of SYM.
|
||||||
|
(defun gds-client-ref (sym)
|
||||||
|
(and gds-client
|
||||||
|
(let ((buf (assq gds-client gds-buffers)))
|
||||||
|
(and buf
|
||||||
|
(cdr buf)
|
||||||
|
(buffer-live-p (cdr buf))
|
||||||
|
(with-current-buffer buf
|
||||||
|
(symbol-value sym))))))
|
||||||
|
|
||||||
(defun gds-client-blocked ()
|
(defun gds-client-blocked ()
|
||||||
(eq gds-status 'waiting-for-input))
|
(eq (gds-client-ref 'gds-status) 'waiting-for-input))
|
||||||
|
|
||||||
(defvar gds-delayed-update-timer nil)
|
(defvar gds-delayed-update-timer nil)
|
||||||
|
|
||||||
|
@ -374,26 +425,25 @@
|
||||||
(setq gds-delayed-update-timer
|
(setq gds-delayed-update-timer
|
||||||
(run-at-time 0.5 nil (function gds-update-delayed-update-buffers)))))
|
(run-at-time 0.5 nil (function gds-update-delayed-update-buffers)))))
|
||||||
|
|
||||||
(defun gds-display-buffers ()
|
(defun gds-display-buffers (client)
|
||||||
(if gds-focus-client
|
(let ((buf (cdr (assq client gds-buffers))))
|
||||||
(let ((gds-focus-buffer (cdr (assq gds-focus-client gds-buffers))))
|
;; If there's already a window showing the buffer, use it.
|
||||||
;; If there's already a window showing the buffer, use it.
|
(let ((window (get-buffer-window buf t)))
|
||||||
(let ((window (get-buffer-window gds-focus-buffer t)))
|
(if window
|
||||||
(if window
|
(progn
|
||||||
(progn
|
(make-frame-visible (window-frame window))
|
||||||
(make-frame-visible (window-frame window))
|
(select-frame (window-frame window))
|
||||||
(select-frame (window-frame window))
|
(select-window window))
|
||||||
(select-window window))
|
;;(select-window (display-buffer buf))
|
||||||
;(select-window (display-buffer gds-focus-buffer))
|
(display-buffer buf)))
|
||||||
(display-buffer gds-focus-buffer)))
|
;; If there is an associated source buffer, display it as well.
|
||||||
;; If there is an associated source buffer, display it as well.
|
(if (and (eq (car gds-views) 'stack)
|
||||||
(if (and (eq (car gds-views) 'stack)
|
gds-frame-source-overlay
|
||||||
gds-frame-source-overlay
|
(> (overlay-end gds-frame-source-overlay) 0))
|
||||||
(> (overlay-end gds-frame-source-overlay) 0))
|
(let ((window (display-buffer
|
||||||
(let ((window (display-buffer
|
(overlay-buffer gds-frame-source-overlay))))
|
||||||
(overlay-buffer gds-frame-source-overlay))))
|
(set-window-point window
|
||||||
(set-window-point window
|
(overlay-start gds-frame-source-overlay))))))
|
||||||
(overlay-start gds-frame-source-overlay)))))))
|
|
||||||
|
|
||||||
|
|
||||||
;;;; Management of `views'.
|
;;;; Management of `views'.
|
||||||
|
@ -492,7 +542,7 @@ the following symbols.
|
||||||
|
|
||||||
(defun gds-async-break (w &rest ignore)
|
(defun gds-async-break (w &rest ignore)
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "async-break" gds-focus-client))
|
(gds-send "async-break" gds-client))
|
||||||
|
|
||||||
(defun gds-toggle-debug-exceptions (w &rest ignore)
|
(defun gds-toggle-debug-exceptions (w &rest ignore)
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -560,7 +610,7 @@ the following symbols.
|
||||||
(let* ((s (widget-value widget))
|
(let* ((s (widget-value widget))
|
||||||
(ind (memq 'index (text-properties-at 0 s))))
|
(ind (memq 'index (text-properties-at 0 s))))
|
||||||
(gds-send (format "debugger-command frame %d" (cadr ind))
|
(gds-send (format "debugger-command frame %d" (cadr ind))
|
||||||
gds-focus-client)))
|
gds-client)))
|
||||||
|
|
||||||
;; Overlay used to highlight the source expression corresponding to
|
;; Overlay used to highlight the source expression corresponding to
|
||||||
;; the selected frame.
|
;; the selected frame.
|
||||||
|
@ -700,7 +750,7 @@ are not readable by Emacs.")
|
||||||
|
|
||||||
(defun gds-query-modules ()
|
(defun gds-query-modules ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "query-modules" gds-focus-client))
|
(gds-send "query-modules" gds-client))
|
||||||
|
|
||||||
(defun gds-view-browser ()
|
(defun gds-view-browser ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -734,36 +784,36 @@ are not readable by Emacs.")
|
||||||
|
|
||||||
(defun gds-go ()
|
(defun gds-go ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "debugger-command continue" gds-focus-client))
|
(gds-send "debugger-command continue" gds-client))
|
||||||
|
|
||||||
(defun gds-next ()
|
(defun gds-next ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "debugger-command next 1" gds-focus-client))
|
(gds-send "debugger-command next 1" gds-client))
|
||||||
|
|
||||||
(defun gds-evaluate (expr)
|
(defun gds-evaluate (expr)
|
||||||
(interactive "sEvaluate (in this stack frame): ")
|
(interactive "sEvaluate (in this stack frame): ")
|
||||||
(gds-send (format "debugger-command evaluate %s" (prin1-to-string expr))
|
(gds-send (format "debugger-command evaluate %s" (prin1-to-string expr))
|
||||||
gds-focus-client))
|
gds-client))
|
||||||
|
|
||||||
(defun gds-step-in ()
|
(defun gds-step-in ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "debugger-command step 1" gds-focus-client))
|
(gds-send "debugger-command step 1" gds-client))
|
||||||
|
|
||||||
(defun gds-step-out ()
|
(defun gds-step-out ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "debugger-command finish" gds-focus-client))
|
(gds-send "debugger-command finish" gds-client))
|
||||||
|
|
||||||
(defun gds-trace-finish ()
|
(defun gds-trace-finish ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "debugger-command trace-finish" gds-focus-client))
|
(gds-send "debugger-command trace-finish" gds-client))
|
||||||
|
|
||||||
(defun gds-frame-info ()
|
(defun gds-frame-info ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "debugger-command info-frame" gds-focus-client))
|
(gds-send "debugger-command info-frame" gds-client))
|
||||||
|
|
||||||
(defun gds-frame-args ()
|
(defun gds-frame-args ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gds-send "debugger-command info-args" gds-focus-client))
|
(gds-send "debugger-command info-args" gds-client))
|
||||||
|
|
||||||
|
|
||||||
;;;; Setting breakpoints.
|
;;;; Setting breakpoints.
|
||||||
|
@ -822,7 +872,7 @@ are not readable by Emacs.")
|
||||||
module
|
module
|
||||||
sym
|
sym
|
||||||
behaviour)
|
behaviour)
|
||||||
gds-focus-client))))
|
gds-client))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Scheme source breakpoints.
|
;;;; Scheme source breakpoints.
|
||||||
|
@ -961,15 +1011,17 @@ isn't yet known to Guile."
|
||||||
;; connection, receive the result and any output generated through the
|
;; connection, receive the result and any output generated through the
|
||||||
;; same connection, and display the result and output to the user.
|
;; same connection, and display the result and output to the user.
|
||||||
;;
|
;;
|
||||||
;; Where there are multiple Guile applications known to GDS, GDS by
|
;; For each buffer where evaluations can be requested, GDS uses the
|
||||||
;; default sends code to the one that holds the debugging focus,
|
;; buffer-local variable `gds-client' to track which GDS client
|
||||||
;; i.e. `gds-focus-client'. Where no application has the focus,
|
;; program should receive and handle that buffer's evaluations. In
|
||||||
;; or the command is invoked with `C-u', GDS asks the user which
|
;; the common case where GDS is only managing one client program, a
|
||||||
;; application is intended.
|
;; buffer's value of `gds-client' is set automatically to point to
|
||||||
|
;; that program the first time that an evaluation (or help or
|
||||||
|
;; completion) is requested. If there are multiple GDS clients
|
||||||
|
;; running at that time, GDS asks the user which one is intended.
|
||||||
|
|
||||||
(defun gds-read-client ()
|
(defun gds-read-client ()
|
||||||
(let* ((def (if gds-focus-client
|
(let* ((def (and gds-client (cdr (assq gds-client gds-names))))
|
||||||
(cdr (assq gds-focus-client gds-names))))
|
|
||||||
(prompt (if def
|
(prompt (if def
|
||||||
(concat "Application for eval (default "
|
(concat "Application for eval (default "
|
||||||
def
|
def
|
||||||
|
@ -991,16 +1043,18 @@ isn't yet known to Guile."
|
||||||
(defun gds-choose-client (client)
|
(defun gds-choose-client (client)
|
||||||
(or ;; If client is an integer, it is the port number of the
|
(or ;; If client is an integer, it is the port number of the
|
||||||
;; intended client.
|
;; intended client.
|
||||||
(if (integerp client) client)
|
(if (integerp client)
|
||||||
|
client)
|
||||||
;; Any other non-nil value indicates invocation with a prefix
|
;; Any other non-nil value indicates invocation with a prefix
|
||||||
;; arg, which forces asking the user which application is
|
;; arg, which forces asking the user which application is
|
||||||
;; intended.
|
;; intended.
|
||||||
(if client (gds-read-client))
|
(if client
|
||||||
;; If ask not forced, and there is a client with the focus,
|
(setq gds-client (gds-read-client)))
|
||||||
;; default to that one.
|
;; If ask not forced, and current buffer is associated with a
|
||||||
gds-focus-client
|
;; client, use that client.
|
||||||
;; If there are no clients at this point, and we are allowed to
|
gds-client
|
||||||
;; autostart a captive Guile, do so.
|
;; If there are no clients at this point, and we are
|
||||||
|
;; allowed to autostart a captive Guile, do so.
|
||||||
(and (null gds-buffers)
|
(and (null gds-buffers)
|
||||||
gds-autostart-captive
|
gds-autostart-captive
|
||||||
(progn
|
(progn
|
||||||
|
@ -1008,13 +1062,13 @@ isn't yet known to Guile."
|
||||||
(while (null gds-buffers)
|
(while (null gds-buffers)
|
||||||
(accept-process-output (get-buffer-process gds-captive)
|
(accept-process-output (get-buffer-process gds-captive)
|
||||||
0 100000))
|
0 100000))
|
||||||
(caar gds-buffers)))
|
(setq gds-client (caar gds-buffers))))
|
||||||
;; If there is only one known client, use that one.
|
;; If there is only one known client, use that one.
|
||||||
(if (and (car gds-buffers)
|
(if (and (car gds-buffers)
|
||||||
(null (cdr gds-buffers)))
|
(null (cdr gds-buffers)))
|
||||||
(caar gds-buffers))
|
(setq gds-client (caar gds-buffers)))
|
||||||
;; Last resort - ask the user.
|
;; Last resort - ask the user.
|
||||||
(gds-read-client)
|
(setq gds-client (gds-read-client))
|
||||||
;; Signal an error.
|
;; Signal an error.
|
||||||
(error "No application chosen.")))
|
(error "No application chosen.")))
|
||||||
|
|
||||||
|
@ -1358,7 +1412,7 @@ Used for determining the default for the next `gds-load-file'.")
|
||||||
(define-key gds-menu [view]
|
(define-key gds-menu [view]
|
||||||
`(menu-item "View" ,gds-view-menu :enable gds-views))
|
`(menu-item "View" ,gds-view-menu :enable gds-views))
|
||||||
(define-key gds-menu [debug]
|
(define-key gds-menu [debug]
|
||||||
`(menu-item "Debug" ,gds-debug-menu :enable (and gds-focus-client
|
`(menu-item "Debug" ,gds-debug-menu :enable (and gds-client
|
||||||
(gds-client-blocked))))
|
(gds-client-blocked))))
|
||||||
(define-key gds-menu [breakpoint]
|
(define-key gds-menu [breakpoint]
|
||||||
`(menu-item "Breakpoints" ,gds-breakpoint-menu :enable t))
|
`(menu-item "Breakpoints" ,gds-breakpoint-menu :enable t))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue