From c8286c2ca4712ba47ef802394fa776bb1c34e3c5 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 13 Apr 2007 06:05:15 +0000 Subject: [PATCH] (edebug-pop-to-buffer): Don't select window marked as dedicated. --- lisp/ChangeLog | 10 +++++++++ lisp/emacs-lisp/edebug.el | 46 +++++++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index faee838050e..91aadbd0640 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2007-04-13 Martin Rudalics + + * 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 * tmm.el (tmm-get-keybind): Use car-safe to avoid errors with diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 151bbd2bd9e..9ae33599f09 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -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) -- 2.39.5