Function: message-send-and-exit

message-send-and-exit is an autoloaded, interactive and byte-compiled function defined in message.el.gz.

Signature

(message-send-and-exit &optional ARG)

Documentation

Send message like message-send, then, if no errors, exit from mail buffer.

The usage of ARG is defined by the instance that called Message. It should typically alter the sending method in some way or other.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
;;;
;;; Sending messages
;;;

(defun message-send-and-exit (&optional arg)
  "Send message like `message-send', then, if no errors, exit from mail buffer.
The usage of ARG is defined by the instance that called Message.
It should typically alter the sending method in some way or other."
  (interactive "P" message-mode)
  (let ((buf (current-buffer))
	(position (point-marker))
	(actions message-exit-actions))
    (when (and (message-send arg)
               (buffer-live-p buf))
      (if message-kill-buffer-on-exit
	  (kill-buffer buf)
	;; Restore the point in the message buffer.
	(save-window-excursion
	  (switch-to-buffer buf)
	  (set-window-point nil position)
	  (set-marker position nil))
	(message-bury buf))
      (message-do-actions actions)
      t)))