diff options
| author | Stefan Monnier | 2002-12-03 21:40:47 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-12-03 21:40:47 +0000 |
| commit | 65d7dd2e57b1f7b55d470d906ae2e70bdd2f4edf (patch) | |
| tree | 5a95f62d6c94dbc0fa04e27d0d7c8510d5c6b720 | |
| parent | f5016b6f0a29eafef300a25e143092bfee6c95d9 (diff) | |
| download | emacs-65d7dd2e57b1f7b55d470d906ae2e70bdd2f4edf.tar.gz emacs-65d7dd2e57b1f7b55d470d906ae2e70bdd2f4edf.zip | |
(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.
| -rw-r--r-- | lisp/gdb-ui.el | 39 |
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 : | |||
| 96 | 96 | ||
| 97 | (interactive (list (gud-query-cmdline 'gdba))) | 97 | (interactive (list (gud-query-cmdline 'gdba))) |
| 98 | 98 | ||
| 99 | (gdba-common-init command-line nil | 99 | (gdba-common-init command-line nil 'gdba-marker-filter) |
| 100 | 'gdba-marker-filter 'gud-gdb-find-file) | ||
| 101 | 100 | ||
| 102 | (set (make-local-variable 'gud-minor-mode) 'gdba) | 101 | (set (make-local-variable 'gud-minor-mode) 'gdba) |
| 103 | 102 | ||
| @@ -293,32 +292,24 @@ with a gdb instance.") | |||
| 293 | ;;; DEF-GDB-VARIABLE | 292 | ;;; DEF-GDB-VARIABLE |
| 294 | ;;; | 293 | ;;; |
| 295 | 294 | ||
| 296 | (defmacro def-gdb-variable (name accessor setter &optional default doc) | ||
| 297 | `(progn | ||
| 298 | (defvar ,name ,default ,doc) | ||
| 299 | (if (not (memq ',name gdb-instance-variables)) | ||
| 300 | (push ',name gdb-instance-variables)) | ||
| 301 | ,(and accessor | ||
| 302 | `(defun ,accessor () | ||
| 303 | (let ((buffer (gdb-get-instance-buffer 'gdba))) | ||
| 304 | (and buffer (save-excursion | ||
| 305 | (set-buffer buffer) | ||
| 306 | ,name))))) | ||
| 307 | ,(and setter | ||
| 308 | `(defun ,setter (val) | ||
| 309 | (let ((buffer (gdb-get-instance-buffer 'gdba))) | ||
| 310 | (and buffer (save-excursion | ||
| 311 | (set-buffer buffer) | ||
| 312 | (setq ,name val)))))))) | ||
| 313 | |||
| 314 | (defmacro def-gdb-var (root-symbol &optional default doc) | 295 | (defmacro def-gdb-var (root-symbol &optional default doc) |
| 315 | (let* ((root (symbol-name root-symbol)) | 296 | (let* ((root (symbol-name root-symbol)) |
| 316 | (accessor (intern (concat "gdb-instance-" root))) | 297 | (accessor (intern (concat "gdb-instance-" root))) |
| 317 | (setter (intern (concat "set-gdb-instance-" root))) | 298 | (setter (intern (concat "set-gdb-instance-" root))) |
| 318 | (var-name (intern (concat "gdb-" root)))) | 299 | (name (intern (concat "gdb-" root)))) |
| 319 | `(def-gdb-variable | 300 | `(progn |
| 320 | ,var-name ,accessor ,setter | 301 | (defvar ,name ,default ,doc) |
| 321 | ,default ,doc))) | 302 | (if (not (memq ',name gdb-instance-variables)) |
| 303 | (push ',name gdb-instance-variables)) | ||
| 304 | ,(and accessor | ||
| 305 | `(defun ,accessor () | ||
| 306 | (let ((buffer (gdb-get-instance-buffer 'gdba))) | ||
| 307 | (and buffer (buffer-local-value ',name buffer))))) | ||
| 308 | ,(and setter | ||
| 309 | `(defun ,setter (val) | ||
| 310 | (let ((buffer (gdb-get-instance-buffer 'gdba))) | ||
| 311 | (and buffer (with-current-buffer buffer | ||
| 312 | (setq ,name val))))))))) | ||
| 322 | 313 | ||
| 323 | (def-gdb-var buffer-type nil | 314 | (def-gdb-var buffer-type nil |
| 324 | "One of the symbols bound in gdb-instance-buffer-rules") | 315 | "One of the symbols bound in gdb-instance-buffer-rules") |