aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2006-03-16 22:56:18 +0000
committerNick Roberts2006-03-16 22:56:18 +0000
commitafe28525db0039af85e1b7aebbc73496737f75f2 (patch)
tree4d20abbc903168f2b0164f900ef53bd2aa86f88d
parent2a166e260cb65431e25da13f1a46e99f96d84121 (diff)
downloademacs-afe28525db0039af85e1b7aebbc73496737f75f2.tar.gz
emacs-afe28525db0039af85e1b7aebbc73496737f75f2.zip
(gud-gdb-complete-command, gud-gdb-run-command-fetch-lines): Adapt for use
with watch expressions. (gud-tooltip-mode): Use buffer-local value.
-rw-r--r--lisp/progmodes/gud.el39
1 files changed, 22 insertions, 17 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index f98ee3540d8..7fa5a0b6dcc 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -740,14 +740,18 @@ To run GDB in text command mode, set `gud-gdb-command-name' to
740 740
741(defvar gud-comint-buffer nil) 741(defvar gud-comint-buffer nil)
742 742
743(defun gud-gdb-complete-command () 743(defun gud-gdb-complete-command (&optional command a b)
744 "Perform completion on the GDB command preceding point. 744 "Perform completion on the GDB command preceding point.
745This is implemented using the GDB `complete' command which isn't 745This is implemented using the GDB `complete' command which isn't
746available with older versions of GDB." 746available with older versions of GDB."
747 (interactive) 747 (interactive)
748 (let* ((end (point)) 748 (if command
749 (command (buffer-substring (comint-line-beginning-position) end)) 749 ;; Used by gud-watch in mini-buffer.
750 (command-word 750 (setq command (concat "p " command))
751 ;; Used in GUD buffer.
752 (let ((end (point)))
753 (setq command (buffer-substring (comint-line-beginning-position) end))))
754 (let* ((command-word
751 ;; Find the word break. This match will always succeed. 755 ;; Find the word break. This match will always succeed.
752 (and (string-match "\\(\\`\\| \\)\\([^ ]*\\)\\'" command) 756 (and (string-match "\\(\\`\\| \\)\\([^ ]*\\)\\'" command)
753 (substring command (match-beginning 2)))) 757 (substring command (match-beginning 2))))
@@ -866,13 +870,14 @@ It is passed through FILTER before we look at it."
866 870
867(defun gud-gdb-run-command-fetch-lines (command buffer &optional skip) 871(defun gud-gdb-run-command-fetch-lines (command buffer &optional skip)
868 "Run COMMAND, and return the list of lines it outputs. 872 "Run COMMAND, and return the list of lines it outputs.
869BUFFER is the GUD buffer in which to run the command. 873BUFFER is the current buffer which may be the GUD buffer in which to run.
870SKIP is the number of chars to skip on each lines, it defaults to 0." 874SKIP is the number of chars to skip on each lines, it defaults to 0."
871 (with-current-buffer buffer 875 (with-current-buffer gud-comint-buffer
872 (if (save-excursion 876 (if (and (eq gud-comint-buffer buffer)
873 (goto-char (point-max)) 877 (save-excursion
874 (forward-line 0) 878 (goto-char (point-max))
875 (not (looking-at comint-prompt-regexp))) 879 (forward-line 0)
880 (not (looking-at comint-prompt-regexp))))
876 nil 881 nil
877 ;; Much of this copied from GDB complete, but I'm grabbing the stack 882 ;; Much of this copied from GDB complete, but I'm grabbing the stack
878 ;; frame instead. 883 ;; frame instead.
@@ -881,12 +886,13 @@ SKIP is the number of chars to skip on each lines, it defaults to 0."
881 (gud-gdb-fetch-lines-string nil) 886 (gud-gdb-fetch-lines-string nil)
882 (gud-gdb-fetch-lines-break (or skip 0)) 887 (gud-gdb-fetch-lines-break (or skip 0))
883 (gud-marker-filter 888 (gud-marker-filter
884 `(lambda (string) (gud-gdb-fetch-lines-filter string ',gud-marker-filter)))) 889 `(lambda (string)
890 (gud-gdb-fetch-lines-filter string ',gud-marker-filter))))
885 ;; Issue the command to GDB. 891 ;; Issue the command to GDB.
886 (gud-basic-call command) 892 (gud-basic-call command)
887 ;; Slurp the output. 893 ;; Slurp the output.
888 (while gud-gdb-fetch-lines-in-progress 894 (while gud-gdb-fetch-lines-in-progress
889 (accept-process-output (get-buffer-process buffer))) 895 (accept-process-output (get-buffer-process gud-comint-buffer)))
890 (nreverse gud-gdb-fetched-lines))))) 896 (nreverse gud-gdb-fetched-lines)))))
891 897
892 898
@@ -3270,11 +3276,10 @@ Treats actions as defuns."
3270 (remove-hook 'tooltip-hook 'gud-tooltip-tips) 3276 (remove-hook 'tooltip-hook 'gud-tooltip-tips)
3271 (define-key global-map [mouse-movement] 'ignore))) 3277 (define-key global-map [mouse-movement] 'ignore)))
3272 (gud-tooltip-activate-mouse-motions-if-enabled) 3278 (gud-tooltip-activate-mouse-motions-if-enabled)
3273 (if (and 3279 (if (and gud-comint-buffer
3274 gud-comint-buffer 3280 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
3275 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed 3281 (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
3276 (with-current-buffer gud-comint-buffer 3282 '(gdbmi gdba)))
3277 (memq gud-minor-mode '(gdbmi gdba))))
3278 (if gud-tooltip-mode 3283 (if gud-tooltip-mode
3279 (progn 3284 (progn
3280 (dolist (buffer (buffer-list)) 3285 (dolist (buffer (buffer-list))