Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

(message-pop-to-buffer): Add switch-function argument.

(message-mail): Pass switch-function argument to it.
  • Loading branch information...
commit 2122ac251f79f25053ef019f28d5baca63560a69 1 parent ab11aa3
yamaoka authored May 28, 2007
5  lisp/ChangeLog
... ...
@@ -1,3 +1,8 @@
  1
+2007-05-28  Katsumi Yamaoka  <yamaoka@jpl.org>
  2
+
  3
+	* message.el (message-pop-to-buffer): Add switch-function argument.
  4
+	(message-mail): Pass switch-function argument to it.
  5
+
1 6
 2007-05-25  Reiner Steib  <Reiner.Steib@gmx.de>
2 7
 
3 8
 	* mm-decode.el (mm-file-name-rewrite-functions): Make it customizable.
14  lisp/message.el
@@ -5921,7 +5921,7 @@ between beginning of field and beginning of line."
5921 5921
 	     'car-less-than-car)))
5922 5922
 	  new)))))
5923 5923
 
5924  
-(defun message-pop-to-buffer (name)
  5924
+(defun message-pop-to-buffer (name &optional switch-function)
5925 5925
   "Pop to buffer NAME, and warn if it already exists and is modified."
5926 5926
   (let ((buffer (get-buffer name)))
5927 5927
     (if (and buffer
@@ -5932,14 +5932,16 @@ between beginning of field and beginning of line."
5932 5932
 	      (progn
5933 5933
 		(gnus-select-frame-set-input-focus (window-frame window))
5934 5934
 		(select-window window))
5935  
-	    (set-buffer (pop-to-buffer buffer)))
  5935
+	    (funcall (or switch-function 'pop-to-buffer) buffer)
  5936
+	    (set-buffer buffer))
5936 5937
 	  (when (and (buffer-modified-p)
5937 5938
 		     (not (prog1
5938 5939
 			      (y-or-n-p
5939 5940
 			       "Message already being composed; erase? ")
5940 5941
 			    (message nil))))
5941 5942
 	    (error "Message being composed")))
5942  
-      (set-buffer (pop-to-buffer name)))
  5943
+      (funcall (or switch-function 'pop-to-buffer) name)
  5944
+      (set-buffer name))
5943 5945
     (erase-buffer)
5944 5946
     (message-mode)))
5945 5947
 
@@ -6174,15 +6176,15 @@ is a function used to switch to and display the mail buffer."
6174 6176
   (interactive)
6175 6177
   (let ((message-this-is-mail t) replybuffer)
6176 6178
     (unless (message-mail-user-agent)
6177  
-      (funcall
6178  
-       (or switch-function 'message-pop-to-buffer)
  6179
+      (message-pop-to-buffer
6179 6180
        ;; Search for the existing message buffer if `continue' is non-nil.
6180 6181
        (let ((message-generate-new-buffers
6181 6182
 	      (when (or (not continue)
6182 6183
 			(eq message-generate-new-buffers 'standard)
6183 6184
 			(functionp message-generate-new-buffers))
6184 6185
 		message-generate-new-buffers)))
6185  
-	 (message-buffer-name "mail" to))))
  6186
+	 (message-buffer-name "mail" to))
  6187
+       switch-function))
6186 6188
     ;; FIXME: message-mail should do something if YANK-ACTION is not
6187 6189
     ;; insert-buffer.
6188 6190
     (and (consp yank-action) (eq (car yank-action) 'insert-buffer)

0 notes on commit 2122ac2

Please sign in to comment.
Something went wrong with that request. Please try again.