message.el (message-pop-to-buffer): Partially revert 2011-11-30 change (Bug#10200...
[gnus] / lisp / message.el
index 3a2e1b9..ecb6dbd 100644 (file)
@@ -934,7 +934,7 @@ The function `message-setup' runs this hook."
   :type 'hook)
 
 (defcustom message-cancel-hook nil
-  "Hook run when cancelling articles."
+  "Hook run when canceling articles."
   :group 'message-various
   :link '(custom-manual "(message)Various Message Variables")
   :type 'hook)
@@ -4884,7 +4884,7 @@ Otherwise, generate and save a value for `canlock-password' first."
                           (message-fetch-field "Followup-To")))
         ;; BUG: We really need to get the charset for each name in the
         ;; Newsgroups and Followup-To lines to allow crossposting
-        ;; between group namess with incompatible character sets.
+        ;; between group names with incompatible character sets.
         ;; -- Per Abrahamsen <abraham@dina.kvl.dk> 2001-10-08.
         (group-field-charset
          (gnus-group-name-charset method newsgroups-field))
@@ -6371,7 +6371,6 @@ between beginning of field and beginning of line."
 
 (defun message-pop-to-buffer (name &optional switch-function)
   "Pop to buffer NAME, and warn if it already exists and is modified."
-  (unless switch-function (setq switch-function #'pop-to-buffer))
   (let ((buffer (get-buffer name)))
     (if (and buffer
             (buffer-name buffer))
@@ -6381,7 +6380,7 @@ between beginning of field and beginning of line."
              (progn
                (gnus-select-frame-set-input-focus (window-frame window))
                (select-window window))
-           (funcall switch-function buffer)
+           (funcall (or switch-function #'pop-to-buffer) buffer)
            (set-buffer buffer))
          (when (and (buffer-modified-p)
                     (not (prog1
@@ -6389,7 +6388,7 @@ between beginning of field and beginning of line."
                               "Message already being composed; erase? ")
                            (message nil))))
            (error "Message being composed")))
-      (funcall switch-function name)
+      (funcall (or switch-function #'pop-to-buffer-same-window) name)
       (set-buffer name))
     (erase-buffer)
     (message-mode)))