summaryrefslogtreecommitdiff
path: root/lisp/gdb-ui.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-12-03 21:40:47 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-12-03 21:40:47 +0000
commit65d7dd2e57b1f7b55d470d906ae2e70bdd2f4edf (patch)
tree5a95f62d6c94dbc0fa04e27d0d7c8510d5c6b720 /lisp/gdb-ui.el
parentf5016b6f0a29eafef300a25e143092bfee6c95d9 (diff)
downloademacs-65d7dd2e57b1f7b55d470d906ae2e70bdd2f4edf.tar.gz
(gdba): Use the default for gud-find-file.
(def-gdb-variable): Remove: fold into def-gdb-var. (def-gdb-var): Use buffer-local-value and with-current-buffer.
Diffstat (limited to 'lisp/gdb-ui.el')
-rw-r--r--lisp/gdb-ui.el39
1 files changed, 15 insertions, 24 deletions
diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el
index 28ceda51052..e7d5b55a3bc 100644
--- a/lisp/gdb-ui.el
+++ b/lisp/gdb-ui.el
@@ -96,8 +96,7 @@ The following interactive lisp functions help control operation :
(interactive (list (gud-query-cmdline 'gdba)))
- (gdba-common-init command-line nil
- 'gdba-marker-filter 'gud-gdb-find-file)
+ (gdba-common-init command-line nil 'gdba-marker-filter)
(set (make-local-variable 'gud-minor-mode) 'gdba)
@@ -293,32 +292,24 @@ with a gdb instance.")
;;; DEF-GDB-VARIABLE
;;;
-(defmacro def-gdb-variable (name accessor setter &optional default doc)
- `(progn
- (defvar ,name ,default ,doc)
- (if (not (memq ',name gdb-instance-variables))
- (push ',name gdb-instance-variables))
- ,(and accessor
- `(defun ,accessor ()
- (let ((buffer (gdb-get-instance-buffer 'gdba)))
- (and buffer (save-excursion
- (set-buffer buffer)
- ,name)))))
- ,(and setter
- `(defun ,setter (val)
- (let ((buffer (gdb-get-instance-buffer 'gdba)))
- (and buffer (save-excursion
- (set-buffer buffer)
- (setq ,name val))))))))
-
(defmacro def-gdb-var (root-symbol &optional default doc)
(let* ((root (symbol-name root-symbol))
(accessor (intern (concat "gdb-instance-" root)))
(setter (intern (concat "set-gdb-instance-" root)))
- (var-name (intern (concat "gdb-" root))))
- `(def-gdb-variable
- ,var-name ,accessor ,setter
- ,default ,doc)))
+ (name (intern (concat "gdb-" root))))
+ `(progn
+ (defvar ,name ,default ,doc)
+ (if (not (memq ',name gdb-instance-variables))
+ (push ',name gdb-instance-variables))
+ ,(and accessor
+ `(defun ,accessor ()
+ (let ((buffer (gdb-get-instance-buffer 'gdba)))
+ (and buffer (buffer-local-value ',name buffer)))))
+ ,(and setter
+ `(defun ,setter (val)
+ (let ((buffer (gdb-get-instance-buffer 'gdba)))
+ (and buffer (with-current-buffer buffer
+ (setq ,name val)))))))))
(def-gdb-var buffer-type nil
"One of the symbols bound in gdb-instance-buffer-rules")