Function: ediff-save-buffer

ediff-save-buffer is an interactive and byte-compiled function defined in ediff-util.el.gz.

Signature

(ediff-save-buffer ARG)

Documentation

Safe way of saving buffers A, B, C, and the diff output.

wa saves buffer A, wb saves buffer B, wc saves buffer C, and wd saves the diff output.

With prefix argument ARG, wd saves plain diff output. Without an argument, it saves customized diff argument, if available
(and plain output, if customized output was not generated).

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff-util.el.gz
(defun ediff-save-buffer (arg)
  "Safe way of saving buffers A, B, C, and the diff output.
`wa' saves buffer A, `wb' saves buffer B, `wc' saves buffer C,
and `wd' saves the diff output.

With prefix argument ARG, `wd' saves plain diff output.
Without an argument, it saves customized diff argument, if available
\(and plain output, if customized output was not generated)."
  (interactive "P")
  (ediff-barf-if-not-control-buffer)
  (ediff-compute-custom-diffs-maybe)
  (ediff-with-current-buffer
      (cond ((memq last-command-event '(?a ?b ?c))
	     (ediff-get-buffer
	      (ediff-char-to-buftype last-command-event)))
	    ((eq last-command-event ?d)
	     (message "Saving diff output ...")
	     (sit-for 1) ; let the user see the message
	     (cond ((and arg (ediff-buffer-live-p ediff-diff-buffer))
		    ediff-diff-buffer)
		   ((ediff-buffer-live-p ediff-custom-diff-buffer)
		    ediff-custom-diff-buffer)
		   ((ediff-buffer-live-p ediff-diff-buffer)
		    ediff-diff-buffer)
		   (t (user-error "Output from `diff' not found"))))
	    )
    (let ((window-min-height 2))
      (save-buffer))))