aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorChong Yidong2011-09-10 17:15:28 -0400
committerChong Yidong2011-09-10 17:15:28 -0400
commit3199b96fc585576ffb2ced6542a2bc2d6172f510 (patch)
tree6f74f43a90022b2a0973688356159f9452f38e7d /lisp/progmodes
parent919a69aa0814937507f12851bdd277cb279faf6f (diff)
downloademacs-3199b96fc585576ffb2ced6542a2bc2d6172f510.tar.gz
emacs-3199b96fc585576ffb2ced6542a2bc2d6172f510.zip
Fix various uses of display-buffer and pop-to-buffer
to avoid using special-display-* and same-window-* variables. * lisp/buff-menu.el (Buffer-menu-switch-other-window): Use second arg of display-buffer. (Buffer-menu-2-window): Use switch-to-buffer-other-window. * lisp/replace.el (occur-mode-goto-occurrence) (occur-mode-display-occurrence) Use second arg of pop-to-buffer and display-buffer. * lisp/window.el (display-buffer-alist): Add *Python*. * lisp/mail/reporter.el (reporter-submit-bug-report): Use second arg of display-buffer. * lisp/mail/sendmail.el (sendmail-user-agent-compose): Don't bind the special-display and same-window variables. (mail-other-window): Use switch-to-buffer-other-window. (mail-other-frame): USe switch-to-buffer-other-frame. * lisp/progmodes/gdb-mi.el (gdb-frame-gdb-buffer): Use display-buffer-other-frame. (gdb-display-gdb-buffer): Use pop-to-buffer. * lisp/progmodes/gud.el (gud-goto-info): Use info-other-window. * lisp/progmodes/python.el: Don't set same-window-buffer-names. * lisp/textmodes/bibtex.el (bibtex-search-entry): Use switch-to-buffer.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/compile.el5
-rw-r--r--lisp/progmodes/gdb-mi.el10
-rw-r--r--lisp/progmodes/gud.el17
-rw-r--r--lisp/progmodes/python.el1
4 files changed, 7 insertions, 26 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index cd891a8df60..619c423902c 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2408,9 +2408,8 @@ and overlay is highlighted between MK and END-MK."
2408 ;; also do this while we change buffer 2408 ;; also do this while we change buffer
2409 (compilation-set-window w msg) 2409 (compilation-set-window w msg)
2410 compilation-highlight-regexp))) 2410 compilation-highlight-regexp)))
2411 ;; Ideally, the window-size should be passed to `display-buffer' (via 2411 ;; Ideally, the window-size should be passed to `display-buffer'
2412 ;; something like special-display-buffer) so it's only used when 2412 ;; so it's only used when creating a new window.
2413 ;; creating a new window.
2414 (unless pre-existing (compilation-set-window-height w)) 2413 (unless pre-existing (compilation-set-window-height w))
2415 2414
2416 (if from-compilation-buffer 2415 (if from-compilation-buffer
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 87209a78ffb..d55a9eed3f0 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -3980,18 +3980,12 @@ SPLIT-HORIZONTAL and show BUF in the new window."
3980(defun gdb-frame-gdb-buffer () 3980(defun gdb-frame-gdb-buffer ()
3981 "Display GUD buffer in a new frame." 3981 "Display GUD buffer in a new frame."
3982 (interactive) 3982 (interactive)
3983 (let ((special-display-regexps (append special-display-regexps '(".*"))) 3983 (display-buffer-other-frame gud-comint-buffer))
3984 (special-display-frame-alist
3985 (remove '(menu-bar-lines) (remove '(tool-bar-lines)
3986 gdb-frame-parameters)))
3987 (same-window-regexps nil))
3988 (display-buffer gud-comint-buffer)))
3989 3984
3990(defun gdb-display-gdb-buffer () 3985(defun gdb-display-gdb-buffer ()
3991 "Display GUD buffer." 3986 "Display GUD buffer."
3992 (interactive) 3987 (interactive)
3993 (let ((same-window-regexps nil)) 3988 (pop-to-buffer gud-comint-buffer nil 0))
3994 (select-window (display-buffer gud-comint-buffer nil 0))))
3995 3989
3996(defun gdb-set-window-buffer (name &optional ignore-dedicated window) 3990(defun gdb-set-window-buffer (name &optional ignore-dedicated window)
3997 "Set buffer of selected window to NAME and dedicate window. 3991 "Set buffer of selected window to NAME and dedicate window.
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 3c7addee3b8..534082544b6 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -112,20 +112,9 @@ Used to grey out relevant toolbar icons.")
112(defun gud-goto-info () 112(defun gud-goto-info ()
113 "Go to relevant Emacs info node." 113 "Go to relevant Emacs info node."
114 (interactive) 114 (interactive)
115 (let ((same-window-regexps same-window-regexps) 115 (if (eq gud-minor-mode 'gdbmi)
116 (display-buffer-reuse-frames t)) 116 (info-other-window "(emacs)GDB Graphical Interface")
117 (catch 'info-found 117 (info-other-window "(emacs)Debuggers")))
118 (walk-windows
119 (lambda (window)
120 (if (eq (window-buffer window) (get-buffer "*info*"))
121 (progn
122 (setq same-window-regexps nil)
123 (throw 'info-found nil))))
124 nil 0)
125 (select-frame (make-frame)))
126 (if (eq gud-minor-mode 'gdbmi)
127 (info "(emacs)GDB Graphical Interface")
128 (info "(emacs)Debuggers"))))
129 118
130(defun gud-tool-bar-item-visible-no-fringe () 119(defun gud-tool-bar-item-visible-no-fringe ()
131 (not (or (eq (buffer-local-value 'major-mode (window-buffer)) 'speedbar-mode) 120 (not (or (eq (buffer-local-value 'major-mode (window-buffer)) 'speedbar-mode)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 3f923f496b9..38bf9552b2a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -86,7 +86,6 @@
86(add-to-list 'interpreter-mode-alist (cons (purecopy "python") 'python-mode)) 86(add-to-list 'interpreter-mode-alist (cons (purecopy "python") 'python-mode))
87;;;###autoload 87;;;###autoload
88(add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode)) 88(add-to-list 'auto-mode-alist (cons (purecopy "\\.py\\'") 'python-mode))
89(add-to-list 'same-window-buffer-names (purecopy "*Python*"))
90 89
91;;;; Font lock 90;;;; Font lock
92 91