Function: emerge-query-and-call

emerge-query-and-call is a byte-compiled function defined in emerge.el.gz.

Signature

(emerge-query-and-call COMMAND)

Documentation

Ask the user whether to save or write out the incomplete merge.

If answer is yes, call COMMAND interactively. During the call, the flags around the current difference are removed.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/emerge.el.gz
(defun emerge-query-and-call (command)
  "Ask the user whether to save or write out the incomplete merge.
If answer is yes, call COMMAND interactively.  During the call, the flags
around the current difference are removed."
  (if (yes-or-no-p "Do you really write to write out this unfinished merge? ")
      ;; He really wants to do it -- unselect the difference for the duration
      (progn
	(if (and (>= emerge-current-difference 0)
		 (< emerge-current-difference emerge-number-of-differences))
	    (emerge-unselect-difference emerge-current-difference))
	;; call-interactively takes the value of current-prefix-arg as the
	;; prefix argument value to be passed to the command.  Thus, we have
	;; to do nothing special to make sure the prefix argument is
	;; transmitted to the command.
	(call-interactively command)
	(if (and (>= emerge-current-difference 0)
		 (< emerge-current-difference emerge-number-of-differences))
	    (progn
	      (emerge-select-difference emerge-current-difference)
	      (emerge-recenter))))
    ;; He's being smart and not doing it
    (message "Not written")))