1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-17 17:58:46 +00:00

(edebug-pop-to-buffer): Don't select window marked as dedicated.

This commit is contained in:
Martin Rudalics 2007-04-13 06:05:15 +00:00
parent dedecfd696
commit c8286c2ca4
2 changed files with 37 additions and 19 deletions

View File

@ -1,3 +1,13 @@
2007-04-13 Martin Rudalics <rudalics@gmx.at>
* emacs-lisp/edebug.el (edebug-pop-to-buffer): Don't select
window marked as dedicated.
* mail/footnote.el (footnote-latin-string): New variable.
(footnote-latin-regexp): Redefined as regexp alternative.
(Footnote-latin): Use footnote-latin-string instead of
footnote-latin-regexp.
2007-04-13 Glenn Morris <rgm@gnu.org>
* tmm.el (tmm-get-keybind): Use car-safe to avoid errors with

View File

@ -364,31 +364,39 @@ Return the result of the last expression in BODY."
(defun edebug-pop-to-buffer (buffer &optional window)
;; Like pop-to-buffer, but select window where BUFFER was last shown.
;; Select WINDOW if it provided and it still exists. Otherwise,
;; Select WINDOW if it is provided and still exists. Otherwise,
;; if buffer is currently shown in several windows, choose one.
;; Otherwise, find a new window, possibly splitting one.
(setq window (if (and (windowp window) (edebug-window-live-p window)
(eq (window-buffer window) buffer))
window
(if (eq (window-buffer (selected-window)) buffer)
(selected-window)
(edebug-get-buffer-window buffer))))
(if window
(select-window window)
(if (one-window-p)
(split-window))
;; (message "next window: %s" (next-window)) (sit-for 1)
(if (eq (get-buffer-window edebug-trace-buffer) (next-window))
;; Don't select trace window
nil
(select-window (next-window))))
(set-window-buffer (selected-window) buffer)
(set-window-hscroll (selected-window) 0);; should this be??
(setq window
(cond
((and (windowp window) (edebug-window-live-p window)
(eq (window-buffer window) buffer))
window)
((eq (window-buffer (selected-window)) buffer)
;; Selected window already displays BUFFER.
(selected-window))
((edebug-get-buffer-window buffer))
((one-window-p 'nomini)
;; When there's one window only, split it.
(split-window))
((let ((trace-window (get-buffer-window edebug-trace-buffer)))
(catch 'found
(dolist (elt (window-list nil 'nomini))
(unless (or (eq elt (selected-window)) (eq elt trace-window)
(window-dedicated-p elt))
;; Found a non-dedicated window not showing
;; `edebug-trace-buffer', use it.
(throw 'found elt))))))
;; All windows are dedicated or show `edebug-trace-buffer', split
;; selected one.
(t (split-window))))
(select-window window)
(set-window-buffer window buffer)
(set-window-hscroll window 0);; should this be??
;; Selecting the window does not set the buffer until command loop.
;;(set-buffer buffer)
)
(defun edebug-get-displayed-buffer-points ()
;; Return a list of buffer point pairs, for all displayed buffers.
(let (list)