]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/ediff-util.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / vc / ediff-util.el
index bf5bb5cd5da03f030eee3d6ab25f5341e08aa733..eb5c2490a7e87f3ecabd4086fdd29bf2d46b4716 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ediff-util.el --- the core commands and utilities of ediff
 
 ;;; ediff-util.el --- the core commands and utilities of ediff
 
-;; Copyright (C) 1994-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2016 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -1293,7 +1293,8 @@ which see."
 
   (cond ((eq ediff-window-setup-function 'ediff-setup-windows-multiframe)
         (setq ediff-multiframe nil)
 
   (cond ((eq ediff-window-setup-function 'ediff-setup-windows-multiframe)
         (setq ediff-multiframe nil)
-        (setq window-setup-func 'ediff-setup-windows-plain))
+        (setq window-setup-func 'ediff-setup-windows-plain)
+         (message "ediff is now in 'plain' mode"))
        ((eq ediff-window-setup-function 'ediff-setup-windows-plain)
         (if (ediff-in-control-buffer-p)
             (ediff-kill-bottom-toolbar))
        ((eq ediff-window-setup-function 'ediff-setup-windows-plain)
         (if (ediff-in-control-buffer-p)
             (ediff-kill-bottom-toolbar))
@@ -1301,14 +1302,15 @@ which see."
                  (window-live-p ediff-control-window))
             (set-window-dedicated-p ediff-control-window nil))
         (setq ediff-multiframe t)
                  (window-live-p ediff-control-window))
             (set-window-dedicated-p ediff-control-window nil))
         (setq ediff-multiframe t)
-        (setq window-setup-func 'ediff-setup-windows-multiframe))
+        (setq window-setup-func 'ediff-setup-windows-multiframe)
+         (message "ediff is now in 'multiframe' mode"))
        (t
         (if (and (ediff-buffer-live-p ediff-control-buffer)
                  (window-live-p ediff-control-window))
             (set-window-dedicated-p ediff-control-window nil))
         (setq ediff-multiframe t)
         (setq window-setup-func 'ediff-setup-windows-multiframe))
        (t
         (if (and (ediff-buffer-live-p ediff-control-buffer)
                  (window-live-p ediff-control-window))
             (set-window-dedicated-p ediff-control-window nil))
         (setq ediff-multiframe t)
         (setq window-setup-func 'ediff-setup-windows-multiframe))
-       )
+         (message "ediff is now in 'multiframe' mode"))
 
   ;; change default
   (setq-default ediff-window-setup-function window-setup-func)
 
   ;; change default
   (setq-default ediff-window-setup-function window-setup-func)
@@ -1500,7 +1502,7 @@ Used in ediff-windows/regions only."
     (select-window wind)))
 
 (defun ediff-scroll-vertically (&optional arg)
     (select-window wind)))
 
 (defun ediff-scroll-vertically (&optional arg)
-  "Vertically scroll buffers A, B \(and C if appropriate\).
+  "Vertically scroll buffers A, B (and C if appropriate).
 With optional argument ARG, scroll ARG lines; otherwise scroll by nearly
 the one half of the height of window-A."
   (interactive "P")
 With optional argument ARG, scroll ARG lines; otherwise scroll by nearly
 the one half of the height of window-A."
   (interactive "P")
@@ -1544,7 +1546,7 @@ the one half of the height of window-A."
 
 
 (defun ediff-scroll-horizontally (&optional arg)
 
 
 (defun ediff-scroll-horizontally (&optional arg)
-  "Horizontally scroll buffers A, B \(and C if appropriate\).
+  "Horizontally scroll buffers A, B (and C if appropriate).
 If an argument is given, that is how many columns are scrolled, else nearly
 the width of the A/B/C windows."
   (interactive "P")
 If an argument is given, that is how many columns are scrolled, else nearly
 the width of the A/B/C windows."
   (interactive "P")
@@ -1822,7 +1824,7 @@ If the prefix is negative, count differences from the end."
 
 (defun ediff-jump-to-difference-at-point (arg)
   "Go to difference closest to the point in buffer A, B, or C.
 
 (defun ediff-jump-to-difference-at-point (arg)
   "Go to difference closest to the point in buffer A, B, or C.
-The buffer depends on last command character \(a, b, or c\) that invoked this
+The buffer depends on last command character \(a, b, or c) that invoked this
 command.  For instance, if the command was `ga' then the point value in buffer
 A is used.
 With a prefix argument, synchronize all files around the current point position
 command.  For instance, if the command was `ga' then the point value in buffer
 A is used.
 With a prefix argument, synchronize all files around the current point position
@@ -1921,7 +1923,7 @@ in the specified buffer."
 ;;; Copying diffs.
 
 (defun ediff-diff-to-diff (arg &optional keys)
 ;;; Copying diffs.
 
 (defun ediff-diff-to-diff (arg &optional keys)
-  "Copy buffer-X'th difference region to buffer Y \(X,Y are A, B, or C\).
+  "Copy buffer-X'th difference region to buffer Y (X,Y are A, B, or C).
 If numerical prefix argument, copy the difference specified in the arg.
 Otherwise, copy the difference given by `ediff-current-difference'.
 This command assumes it is bound to a 2-character key sequence, `ab', `ba',
 If numerical prefix argument, copy the difference specified in the arg.
 Otherwise, copy the difference given by `ediff-current-difference'.
 This command assumes it is bound to a 2-character key sequence, `ab', `ba',
@@ -1986,7 +1988,7 @@ ARG is a prefix argument.  If nil, copy the current difference region."
 
 
 
 
 
 
-;; Copy diff N from FROM-BUF-TYPE \(given as A, B or C\) to TO-BUF-TYPE.
+;; Copy diff N from FROM-BUF-TYPE (given as A, B or C) to TO-BUF-TYPE.
 ;; If optional DO-NOT-SAVE is non-nil, do not save the old value of the
 ;; target diff.  This is used in merging, when constructing the merged
 ;; version.
 ;; If optional DO-NOT-SAVE is non-nil, do not save the old value of the
 ;; target diff.  This is used in merging, when constructing the merged
 ;; version.
@@ -2065,7 +2067,7 @@ ARG is a prefix argument.  If nil, copy the current difference region."
       (message "%s" messg))
     ))
 
       (message "%s" messg))
     ))
 
-;; Save Nth diff of buffer BUF-TYPE \(A, B, or C\).
+;; Save Nth diff of buffer BUF-TYPE (A, B, or C).
 ;; That is to say, the Nth diff on the `ediff-killed-diffs-alist'.  REG
 ;; is the region to save.  It is redundant here, but is passed anyway, for
 ;; convenience.
 ;; That is to say, the Nth diff on the `ediff-killed-diffs-alist'.  REG
 ;; is the region to save.  It is redundant here, but is passed anyway, for
 ;; convenience.
@@ -2385,10 +2387,10 @@ the number seen by the user."
   "Finish an Ediff session and exit Ediff.
 Unselects the selected difference, if any, restores the read-only and modified
 flags of the compared file buffers, kills Ediff buffers for this session
   "Finish an Ediff session and exit Ediff.
 Unselects the selected difference, if any, restores the read-only and modified
 flags of the compared file buffers, kills Ediff buffers for this session
-\(but not buffers A, B, C\).
+\(but not buffers A, B, C).
 
 If `ediff-keep-variants' is nil, the user will be asked whether the buffers
 
 If `ediff-keep-variants' is nil, the user will be asked whether the buffers
-containing the variants should be removed \(if they haven't been modified\).
+containing the variants should be removed \(if they haven't been modified).
 If it is t, they will be preserved unconditionally.  A prefix argument,
 temporarily reverses the meaning of this variable."
   (interactive "P")
 If it is t, they will be preserved unconditionally.  A prefix argument,
 temporarily reverses the meaning of this variable."
   (interactive "P")
@@ -3312,7 +3314,7 @@ and `wd' saves the diff output.
 
 With prefix argument, `wd' saves plain diff output.
 Without an argument, it saves customized diff argument, if available
 
 With prefix argument, `wd' saves plain diff output.
 Without an argument, it saves customized diff argument, if available
-\(and plain output, if customized output was not generated\)."
+\(and plain output, if customized output was not generated)."
   (interactive "P")
   (ediff-barf-if-not-control-buffer)
   (ediff-compute-custom-diffs-maybe)
   (interactive "P")
   (ediff-barf-if-not-control-buffer)
   (ediff-compute-custom-diffs-maybe)
@@ -3348,6 +3350,7 @@ Without an argument, it saves customized diff argument, if available
     (setq wind (ediff-get-visible-buffer-window cloned-buff))
     (select-window wind)
     (delete-other-windows)
     (setq wind (ediff-get-visible-buffer-window cloned-buff))
     (select-window wind)
     (delete-other-windows)
+    (or (mark) (push-mark))
     (ediff-activate-mark)
     (split-window-vertically)
     (ediff-select-lowest-window)
     (ediff-activate-mark)
     (split-window-vertically)
     (ediff-select-lowest-window)