From fb2c91be8ee7de88d5d852d67a1738dc407d076b Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Mon, 23 Feb 2004 00:44:04 +0000 Subject: [PATCH] (gud-watch): Load tooltip, if necessary. (gdb-var-create-handler): Force speedbar-update-flag to be non-nil. (gdb-var-delete): Make interactive (really). (gdb-edit-value): Make non-interactive. --- lisp/gdb-ui.el | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el index 60ac57dd10f..32cce04c239 100644 --- a/lisp/gdb-ui.el +++ b/lisp/gdb-ui.el @@ -188,6 +188,7 @@ speedbar." (defun gud-watch () "Watch expression at point." (interactive) + (require 'tooltip) (let ((expr (tooltip-identifier-from-point (point)))) (if (and (string-equal gdb-current-language "c") gdb-use-colon-colon-notation) @@ -214,6 +215,7 @@ speedbar." (match-string 3) nil nil))) (push var gdb-var-list) + (setq speedbar-update-flag t) (speedbar 1) (if (equal (nth 2 var) "0") (gdb-enqueue-input @@ -304,26 +306,28 @@ speedbar." (gdb-set-pending-triggers (delq 'gdb-var-update (gdb-get-pending-triggers)))) -(defun gdb-var-delete (text token indent) - "Delete watched expression." +(defun gdb-var-delete () + "Delete watched expression from the speedbar." (interactive) - (when (eq indent 0) - (string-match "\\(\\S-+\\)" text) - (let* ((expr (match-string 1 text)) - (var (assoc expr gdb-var-list)) - (varnum (cadr var))) - (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-delete " varnum "\"\n") - 'ignore)) - (setq gdb-var-list (delq var gdb-var-list)) - (dolist (varchild gdb-var-list) - (if (string-match (concat (nth 1 var) "\\.") (nth 1 varchild)) - (setq gdb-var-list (delq varchild gdb-var-list))))) - (setq gdb-var-changed t))) + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + (let ((text (speedbar-line-text))) + (string-match "\\(\\S-+\\)" text) + (let* ((expr (match-string 1 text)) + (var (assoc expr gdb-var-list)) + (varnum (cadr var))) + (unless (string-match "\\." varnum) + (gdb-enqueue-input + (list (concat "server interpreter mi \"-var-delete " + varnum "\"\n") + 'ignore)) + (setq gdb-var-list (delq var gdb-var-list)) + (dolist (varchild gdb-var-list) + (if (string-match (concat (nth 1 var) "\\.") (nth 1 varchild)) + (setq gdb-var-list (delq varchild gdb-var-list)))) + (setq gdb-var-changed t)))))) (defun gdb-edit-value (text token indent) "Assign a value to a variable displayed in the speedbar" - (interactive) (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) (varnum (cadr var)) (value)) (setq value (read-string "New value: "))