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


From: Nick Roberts
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el
Date: Wed, 24 Nov 2004 05:48:55 -0500

Index: emacs/lisp/progmodes/gdb-ui.el
diff -c emacs/lisp/progmodes/gdb-ui.el:1.32 emacs/lisp/progmodes/gdb-ui.el:1.33
*** emacs/lisp/progmodes/gdb-ui.el:1.32 Mon Nov 22 20:08:26 2004
--- emacs/lisp/progmodes/gdb-ui.el      Wed Nov 24 10:31:15 2004
***************
*** 249,254 ****
--- 249,256 ----
    (gdb-enqueue-input (list "server list MAIN__\n" 'ignore))   ; Fortran 
program
    (gdb-enqueue-input (list "server info source\n" 'gdb-source-info))
    ;;
+   (set-window-dedicated-p (get-buffer-window gud-comint-buffer) t)
+   ;;
    (run-hooks 'gdba-mode-hook))
  
  (defcustom gdb-use-colon-colon-notation nil
***************
*** 1584,1622 ****
  
  
  ;;;; Window management
- 
- ;;; The way we abuse the dedicated-p flag is pretty gross, but seems
- ;;; to do the right thing.  Seeing as there is no way for Lisp code to
- ;;; get at the use_time field of a window, I'm not sure there exists a
- ;;; more elegant solution without writing C code.
- 
  (defun gdb-display-buffer (buf &optional size)
    (let ((must-split nil)
        (answer nil))
!     (unwind-protect
!       (progn
!         (walk-windows
!          #'(lambda (win)
!             (if (eq gud-comint-buffer (window-buffer win))
!                 (set-window-dedicated-p win t))))
!         (setq answer (get-buffer-window buf 'visible))
!         (if (not answer)
!             (let ((window (get-lru-window 'visible)))
!               (if window
!                   (progn
!                     (set-window-buffer window buf)
!                     (setq answer window))
!                 (setq must-split t)))))
!       (walk-windows
!        #'(lambda (win)
!         (if (eq gud-comint-buffer (window-buffer win))
!             (set-window-dedicated-p win nil)))))
      (if must-split
!       (let* ((largest (get-largest-window 'visible))
               (cur-size (window-height largest))
               (new-size (and size (< size cur-size) (- cur-size size))))
          (setq answer (split-window largest new-size))
          (set-window-buffer answer buf)))
      answer))
  
  (defun gdb-display-source-buffer (buffer)
--- 1586,1609 ----
  
  
  ;;;; Window management
  (defun gdb-display-buffer (buf &optional size)
    (let ((must-split nil)
        (answer nil))
!     (setq answer (get-buffer-window buf 'visible))
!     (if (not answer)
!       (let ((window (get-lru-window)))
!         (if window
!             (progn
!               (set-window-buffer window buf)
!               (setq answer window))
!           (setq must-split t))))
      (if must-split
!       (let* ((largest (get-largest-window))
               (cur-size (window-height largest))
               (new-size (and size (< size cur-size) (- cur-size size))))
          (setq answer (split-window largest new-size))
          (set-window-buffer answer buf)))
+     (set-window-dedicated-p answer t)
      answer))
  
  (defun gdb-display-source-buffer (buffer)
***************
*** 1715,1720 ****
--- 1702,1712 ----
    :group 'gud
    :version "21.4")
  
+ (defun dedicated-switch-to-buffer (name)
+   (set-window-dedicated-p 
+    (get-buffer-window
+     (switch-to-buffer name)) t))
+ 
  (defun gdb-setup-windows ()
    "Layout the window pattern for gdb-many-windows."
    (gdb-display-locals-buffer)
***************
*** 1722,1735 ****
    (delete-other-windows)
    (gdb-display-breakpoints-buffer)
    (delete-other-windows)
!   (switch-to-buffer gud-comint-buffer)
    (split-window nil ( / ( * (window-height) 3) 4))
    (split-window nil ( / (window-height) 3))
    (split-window-horizontally)
    (other-window 1)
!   (switch-to-buffer (gdb-locals-buffer-name))
    (other-window 1)
!   (switch-to-buffer
     (if (and gdb-view-source
            (eq gdb-selected-view 'source))
         (if gud-last-last-frame
--- 1714,1727 ----
    (delete-other-windows)
    (gdb-display-breakpoints-buffer)
    (delete-other-windows)
!   (dedicated-switch-to-buffer gud-comint-buffer)
    (split-window nil ( / ( * (window-height) 3) 4))
    (split-window nil ( / (window-height) 3))
    (split-window-horizontally)
    (other-window 1)
!   (dedicated-switch-to-buffer (gdb-locals-buffer-name))
    (other-window 1)
!   (dedicated-switch-to-buffer
     (if (and gdb-view-source
            (eq gdb-selected-view 'source))
         (if gud-last-last-frame
***************
*** 1739,1750 ****
    (when gdb-use-inferior-io-buffer
      (split-window-horizontally)
      (other-window 1)
!     (switch-to-buffer (gdb-inferior-io-name)))
    (other-window 1)
!   (switch-to-buffer (gdb-stack-buffer-name))
    (split-window-horizontally)
    (other-window 1)
!   (switch-to-buffer (gdb-breakpoints-buffer-name))
    (other-window 1))
  
  (defcustom gdb-many-windows nil
--- 1731,1742 ----
    (when gdb-use-inferior-io-buffer
      (split-window-horizontally)
      (other-window 1)
!     (dedicated-switch-to-buffer (gdb-inferior-io-name)))
    (other-window 1)
!   (dedicated-switch-to-buffer (gdb-stack-buffer-name))
    (split-window-horizontally)
    (other-window 1)
!   (dedicated-switch-to-buffer (gdb-breakpoints-buffer-name))
    (other-window 1))
  
  (defcustom gdb-many-windows nil
***************
*** 1781,1787 ****
      (delete-other-windows)
      (split-window)
      (other-window 1)
!     (switch-to-buffer
       (if (and gdb-view-source
              (eq gdb-selected-view 'source))
         (if gud-last-last-frame
--- 1773,1779 ----
      (delete-other-windows)
      (split-window)
      (other-window 1)
!     (dedicated-switch-to-buffer
       (if (and gdb-view-source
              (eq gdb-selected-view 'source))
         (if gud-last-last-frame
***************
*** 1801,1806 ****
--- 1793,1799 ----
                (kill-buffer nil)
              (gdb-remove-breakpoint-icons (point-min) (point-max) t)
              (setq gud-minor-mode nil)
+             (set-window-dedicated-p (get-buffer-window buffer) nil)
              (kill-local-variable 'tool-bar-map)
              (setq gud-running nil))))))
    (when (markerp gdb-overlay-arrow-position)




reply via email to

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