emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el,v
Date: Wed, 23 Apr 2008 05:55:47 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     08/04/23 05:55:42

Index: lisp/progmodes/gdb-ui.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/gdb-ui.el,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -b -r1.236 -r1.237
--- lisp/progmodes/gdb-ui.el    23 Apr 2008 02:50:24 -0000      1.236
+++ lisp/progmodes/gdb-ui.el    23 Apr 2008 05:55:36 -0000      1.237
@@ -481,6 +481,15 @@
 
 (defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)")
 
+(defun gdb-init-buffer ()
+  (set (make-local-variable 'gud-minor-mode)
+       (buffer-local-value 'gud-minor-mode gud-comint-buffer))
+  (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+  (when gud-tooltip-mode
+    (make-local-variable 'gdb-define-alist)
+    (gdb-create-define-alist)
+    (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))
+
 (defun gdb-set-gud-minor-mode-existing-buffers ()
   "Create list of source files for current GDB session."
   (goto-char (point-min))
@@ -493,12 +502,7 @@
        (when (and buffer-file-name
                   (member (file-name-nondirectory buffer-file-name)
                           gdb-source-file-list))
-         (set (make-local-variable 'gud-minor-mode) 'gdba)
-         (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
-         (when gud-tooltip-mode
-           (make-local-variable 'gdb-define-alist)
-           (gdb-create-define-alist)
-           (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))))
+         (gdb-init-buffer)))))
   (gdb-force-mode-line-update
    (propertize "ready" 'face font-lock-variable-name-face)))
 
@@ -1953,10 +1957,7 @@
                                   (not (string-equal file "File not found")))
                              (with-current-buffer
                                  (find-file-noselect file 'nowarn)
-                               (set (make-local-variable 'gud-minor-mode)
-                                    'gdba)
-                               (set (make-local-variable 'tool-bar-map)
-                                    gud-tool-bar-map)
+                               (gdb-init-buffer)
                                ;; Only want one breakpoint icon at each
                                ;; location.
                                (save-excursion
@@ -3269,9 +3270,7 @@
       (throw 'file-not-found nil))
     (with-current-buffer
        (find-file-noselect (match-string 0))
-      (save-current-buffer
-       (set (make-local-variable 'gud-minor-mode) 'gdba)
-       (set (make-local-variable 'tool-bar-map) gud-tool-bar-map))
+      (gdb-init-buffer)
       ;; only want one breakpoint icon at each location
       (save-excursion
        (goto-line (string-to-number line))
@@ -3293,9 +3292,7 @@
                    buffer-file-name)
                  gdb-source-file-list)
          (with-current-buffer (find-buffer-visiting buffer-file-name)
-           (set (make-local-variable 'gud-minor-mode)
-                (buffer-local-value 'gud-minor-mode gud-comint-buffer))
-           (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)))))
+           (gdb-init-buffer)))))
 
 ;;from put-image
 (defun gdb-put-string (putstring pos &optional dprop &rest sprops)
@@ -3625,13 +3622,7 @@
   (dolist (buffer (buffer-list))
     (with-current-buffer buffer
       (when (member buffer-file-name gdb-source-file-list)
-       (set (make-local-variable 'gud-minor-mode)
-            (buffer-local-value 'gud-minor-mode gud-comint-buffer))
-       (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
-       (when gud-tooltip-mode
-         (make-local-variable 'gdb-define-alist)
-         (gdb-create-define-alist)
-         (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))
+       (gdb-init-buffer))))
   (gdb-force-mode-line-update
    (propertize "ready" 'face font-lock-variable-name-face)))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]