]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix ediff-toggle-multiframe cond clauses
authorBasil L. Contovounesios <contovob@tcd.ie>
Tue, 26 Sep 2023 08:12:28 +0000 (10:12 +0200)
committerBasil L. Contovounesios <contovob@tcd.ie>
Tue, 26 Sep 2023 08:13:31 +0000 (10:13 +0200)
* lisp/vc/ediff-util.el (ediff-toggle-multiframe): Remove duplicate
cond clause.  Fix parentheses so that trailing 'message' is
contained in fallback clause.  Fix indentation.

lisp/vc/ediff-util.el

index 00200f1d1dac5e7f47af7f3505eb53439b57342a..be698370b979158c3732430a6b45895bae8073dc 100644 (file)
@@ -1269,36 +1269,28 @@ which see."
     (or (display-graphic-p)
        (user-error "Emacs is not running as a window application"))
 
-  (cond ((eq ediff-window-setup-function #'ediff-setup-windows-multiframe)
-        (setq ediff-multiframe nil)
-        (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 (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"))
-       (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 in all active ediff sessions
-  (mapc (lambda(buf) (ediff-with-current-buffer buf
-                      (setq ediff-window-setup-function window-setup-func
-                            ediff-window-B nil)))
-       ediff-session-registry)
-  (if (ediff-in-control-buffer-p)
-      (progn
-       (set-window-dedicated-p (selected-window) nil)
-       (ediff-recenter 'no-rehighlight)))))
+    (cond ((eq ediff-window-setup-function #'ediff-setup-windows-multiframe)
+           (setq ediff-multiframe nil)
+           (setq window-setup-func #'ediff-setup-windows-plain)
+           (message "ediff is now in `plain' mode"))
+          (t ; (eq ediff-window-setup-function #'ediff-setup-windows-plain)
+           (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 in all active ediff sessions
+    (mapc (lambda (buf) (ediff-with-current-buffer buf
+                          (setq ediff-window-setup-function window-setup-func
+                                ediff-window-B nil)))
+          ediff-session-registry)
+    (when (ediff-in-control-buffer-p)
+      (set-window-dedicated-p (selected-window) nil)
+      (ediff-recenter 'no-rehighlight))))
 
 
 ;;;###autoload