]> git.eshelyaron.com Git - emacs.git/commitdiff
Sanitize buffer display handling in simple.el.
authorMartin Rudalics <rudalics@gmx.at>
Tue, 11 Jan 2011 17:02:28 +0000 (18:02 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Tue, 11 Jan 2011 17:02:28 +0000 (18:02 +0100)
* simple.el (goto-line, compose-mail-other-window): Replace
switch-to-buffer-other-window by pop-to-buffer-other-window.
(pop-global-mark): Use pop-to-buffer-same-window instead of
switch-to-buffer.
(compose-mail-other-frame): Use pop-to-buffer-other-frame
instead of switch-to-buffer-other-frame.
(special-mode-map): Bind "q" to quit-restore-window instead of
quit-window.

lisp/ChangeLog
lisp/simple.el

index 9ba851ae0fbbbe21526d049f1bf94c8f078ab2ec..faa0d9ba7d01969f6ca1d328c12e3f16d96d67c0 100644 (file)
@@ -1,5 +1,14 @@
 2011-01-11  Martin Rudalics  <rudalics@gmx.at>
 
+       * simple.el (goto-line, compose-mail-other-window): Replace
+       switch-to-buffer-other-window by pop-to-buffer-other-window.
+       (pop-global-mark): Use pop-to-buffer-same-window instead of
+       switch-to-buffer.
+       (compose-mail-other-frame): Use pop-to-buffer-other-frame
+       instead of switch-to-buffer-other-frame.
+       (special-mode-map): Bind "q" to quit-restore-window instead of
+       quit-window.
+
        * buff-menu.el (Buffer-menu-mode-map): Bind "q" to
        quit-restore-window.
        (buffer-menu): Call pop-to-buffer-same-window.
index 2a1d948fa29a67b6b19a0fcc9d1ace83d08ddb9a..615a965653ae7ddc6afb85e94f6702dc500bc592 100644 (file)
@@ -355,7 +355,7 @@ Other major modes are defined by comparison with this one."
 (defvar special-mode-map
   (let ((map (make-sparse-keymap)))
     (suppress-keymap map)
-    (define-key map "q" 'quit-window)
+    (define-key map "q" 'quit-restore-window)
     (define-key map " " 'scroll-up)
     (define-key map "\C-?" 'scroll-down)
     (define-key map "?" 'describe-mode)
@@ -913,8 +913,9 @@ rather than line counts."
   ;; Switch to the desired buffer, one way or another.
   (if buffer
       (let ((window (get-buffer-window buffer)))
-       (if window (select-window window)
-         (switch-to-buffer-other-window buffer))))
+       (if window
+           (select-window window)
+         (pop-to-buffer-other-window buffer))))
   ;; Leave mark at previous position
   (or (region-active-p) (push-mark))
   ;; Move to the specified line number in that buffer.
@@ -4046,7 +4047,7 @@ for it.")
            (widen)
          (error "Global mark position is outside accessible part of buffer")))
     (goto-char position)
-    (switch-to-buffer buffer)))
+    (pop-to-buffer-same-window buffer)))
 \f
 (defcustom next-line-add-newlines nil
   "If non-nil, `next-line' inserts newline to avoid `end of buffer' error."
@@ -5759,7 +5760,7 @@ To disable this warning, set `compose-mail-user-agent-warnings' to nil."
   (interactive
    (list nil nil nil current-prefix-arg))
   (compose-mail to subject other-headers continue
-               'switch-to-buffer-other-window yank-action send-actions))
+               'pop-to-buffer-other-window yank-action send-actions))
 
 
 (defun compose-mail-other-frame (&optional to subject other-headers continue
@@ -5768,7 +5769,7 @@ To disable this warning, set `compose-mail-user-agent-warnings' to nil."
   (interactive
    (list nil nil nil current-prefix-arg))
   (compose-mail to subject other-headers continue
-               'switch-to-buffer-other-frame yank-action send-actions))
+               'pop-to-buffer-other-frame yank-action send-actions))
 \f
 (defvar set-variable-value-history nil
   "History of values entered with `set-variable'.