emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110584: Fix how gdb-mi calls display


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110584: Fix how gdb-mi calls display-buffer to avoid switching frames.
Date: Fri, 19 Oct 2012 03:46:18 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110584
fixes bug: http://debbugs.gnu.org/12648
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Fri 2012-10-19 03:46:18 +0800
message:
  Fix how gdb-mi calls display-buffer to avoid switching frames.
  
  * lisp/progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action):
  Convert to defcustom.
  (gdb-get-source-file): Don't bind pop-up-windows.
  
  * lisp/progmodes/gud.el (gud-display-line): Don't specially re-use
  other frames for the gdb-mi case.
modified:
  lisp/ChangeLog
  lisp/progmodes/gdb-mi.el
  lisp/progmodes/gud.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-10-18 15:37:57 +0000
+++ b/lisp/ChangeLog    2012-10-18 19:46:18 +0000
@@ -1,3 +1,12 @@
+2012-10-18  Chong Yidong  <address@hidden>
+
+       * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action):
+       Convert to defcustom.
+       (gdb-get-source-file): Don't bind pop-up-windows.
+
+       * progmodes/gud.el (gud-display-line): Don't specially re-use
+       other frames for the gdb-mi case (Bug#12648).
+
 2012-10-18  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/advice.el: Clean up commentary a bit.

=== modified file 'lisp/progmodes/gdb-mi.el'
--- a/lisp/progmodes/gdb-mi.el  2012-08-26 09:16:48 +0000
+++ b/lisp/progmodes/gdb-mi.el  2012-10-18 19:46:18 +0000
@@ -1516,9 +1516,9 @@
        (comint-exec io-buffer "gdb-inferior" nil nil nil)
        (gdb-inferior-io--init-proc (get-buffer-process io-buffer))))))
 
-(defvar gdb-display-buffer-other-frame-action
-  `((display-buffer-reuse-window display-buffer-pop-up-frame)
-    (reusable-frames . 0)
+(defcustom gdb-display-buffer-other-frame-action
+  '((display-buffer-reuse-window display-buffer-pop-up-frame)
+    (reusable-frames . visible)
     (inhibit-same-window . t)
     (pop-up-frame-parameters (height . 14)
                             (width . 80)
@@ -1526,8 +1526,11 @@
                             (tool-bar-lines . nil)
                             (menu-bar-lines . nil)
                             (minibuffer . nil)))
-  "A `display-buffer' action for displaying GDB utility frames.")
-(put 'gdb-display-buffer-other-frame-action 'risky-local-variable t)
+  "`display-buffer' action for displaying GDB utility frames."
+  :group 'gdb
+  :type display-buffer--action-custom-type
+  :risky t
+  :version "24.3")
 
 (defun gdb-frame-io-buffer ()
   "Display IO of debugged program in another frame."
@@ -4175,9 +4178,9 @@
   (if gdb-many-windows
       (gdb-setup-windows)
     (gdb-get-buffer-create 'gdb-breakpoints-buffer)
-    (if (and gdb-show-main gdb-main-file)
-        (let ((pop-up-windows t))
-          (display-buffer (gud-find-file gdb-main-file)))))
+    (and gdb-show-main
+        gdb-main-file
+        (display-buffer (gud-find-file gdb-main-file))))
   (gdb-force-mode-line-update
    (propertize "ready" 'face font-lock-variable-name-face)))
 

=== modified file 'lisp/progmodes/gud.el'
--- a/lisp/progmodes/gud.el     2012-08-26 09:16:48 +0000
+++ b/lisp/progmodes/gud.el     2012-10-18 19:46:18 +0000
@@ -2700,42 +2700,39 @@
            (gud-find-file true-file)))
         (window (and buffer
                      (or (get-buffer-window buffer)
-                         (if (eq gud-minor-mode 'gdbmi)
-                             (display-buffer buffer nil 'visible))
                          (display-buffer buffer))))
         (pos))
-    (if buffer
-       (progn
-         (with-current-buffer buffer
-           (unless (or (verify-visited-file-modtime buffer) gud-keep-buffer)
-                 (if (yes-or-no-p
-                      (format "File %s changed on disk.  Reread from disk? "
-                              (buffer-name)))
-                     (revert-buffer t t)
-                   (setq gud-keep-buffer t)))
-           (save-restriction
-             (widen)
-             (goto-char (point-min))
-             (forward-line (1- line))
-             (setq pos (point))
-             (or gud-overlay-arrow-position
-                 (setq gud-overlay-arrow-position (make-marker)))
-             (set-marker gud-overlay-arrow-position (point) (current-buffer))
-             ;; If they turned on hl-line, move the hl-line highlight to
-             ;; the arrow's line.
-             (when (featurep 'hl-line)
-               (cond
-                (global-hl-line-mode
-                 (global-hl-line-highlight))
-                ((and hl-line-mode hl-line-sticky-flag)
-                 (hl-line-highlight)))))
-           (cond ((or (< pos (point-min)) (> pos (point-max)))
-                  (widen)
-                  (goto-char pos))))
-         (when window
-           (set-window-point window gud-overlay-arrow-position)
-           (if (eq gud-minor-mode 'gdbmi)
-               (setq gdb-source-window window)))))))
+    (when buffer
+      (with-current-buffer buffer
+       (unless (or (verify-visited-file-modtime buffer) gud-keep-buffer)
+         (if (yes-or-no-p
+              (format "File %s changed on disk.  Reread from disk? "
+                      (buffer-name)))
+             (revert-buffer t t)
+           (setq gud-keep-buffer t)))
+       (save-restriction
+         (widen)
+         (goto-char (point-min))
+         (forward-line (1- line))
+         (setq pos (point))
+         (or gud-overlay-arrow-position
+             (setq gud-overlay-arrow-position (make-marker)))
+         (set-marker gud-overlay-arrow-position (point) (current-buffer))
+         ;; If they turned on hl-line, move the hl-line highlight to
+         ;; the arrow's line.
+         (when (featurep 'hl-line)
+           (cond
+            (global-hl-line-mode
+             (global-hl-line-highlight))
+            ((and hl-line-mode hl-line-sticky-flag)
+             (hl-line-highlight)))))
+       (cond ((or (< pos (point-min)) (> pos (point-max)))
+              (widen)
+              (goto-char pos))))
+      (when window
+       (set-window-point window gud-overlay-arrow-position)
+       (if (eq gud-minor-mode 'gdbmi)
+           (setq gdb-source-window window))))))
 
 ;; The gud-call function must do the right thing whether its invoking
 ;; keystroke is from the GUD buffer itself (via major-mode binding)


reply via email to

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