]> git.eshelyaron.com Git - emacs.git/commitdiff
Make the ediff control panel mode line prettier
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 Jun 2022 13:49:56 +0000 (15:49 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 Jun 2022 13:50:53 +0000 (15:50 +0200)
* lisp/vc/ediff-wind.el (ediff-refresh-mode-lines): Don't include
"Quick Help" in the mode line in the plain version (bug#12840).
(ediff-make-wide-control-buffer-id): Make the informative part of
the mode line bold.  (Code from Michael Heerdegen.)

lisp/vc/ediff-wind.el

index 1e702edb41908c37dc1ea5d9026ae04a6f4f4fdd..4549b910b13bc575babb9fa5a45167aba6ba71e9 100644 (file)
@@ -1135,7 +1135,10 @@ It assumes that it is called from within the control buffer."
     (setq mode-line-format
          (if (ediff-narrow-control-frame-p)
              (list "   " mode-line-buffer-identification)
-           (list "-- " mode-line-buffer-identification "        Quick Help")))
+           (list "-- " mode-line-buffer-identification
+                  (and (not (eq ediff-window-setup-function
+                                'ediff-setup-windows-plain))
+                       "        Quick Help"))))
     ;; control buffer id
     (setq mode-line-buffer-identification
          (if (ediff-narrow-control-frame-p)
@@ -1213,18 +1216,20 @@ It assumes that it is called from within the control buffer."
    ediff-control-buffer-suffix))
 
 (defun ediff-make-wide-control-buffer-id ()
-  (cond ((< ediff-current-difference 0)
-        (list (format "%%b   At start of %d diffs"
-                      ediff-number-of-differences)))
-       ((>= ediff-current-difference ediff-number-of-differences)
-        (list (format "%%b   At end of %d diffs"
-                      ediff-number-of-differences)))
-       (t
-        (list (format "%%b   diff %d of %d"
-                      (1+ ediff-current-difference)
-                      ediff-number-of-differences)))))
-
-
+  (list
+   (concat "%b   "
+           (propertize
+            (cond ((< ediff-current-difference 0)
+                   (format "At start of %d diffs"
+                           ediff-number-of-differences))
+                  ((>= ediff-current-difference ediff-number-of-differences)
+                   (format "At end of %d diffs"
+                           ediff-number-of-differences))
+                  (t
+                   (format "diff %d of %d"
+                           (1+ ediff-current-difference)
+                           ediff-number-of-differences)))
+            'face 'mode-line-buffer-id))))
 
 ;; If buff is not live, return nil
 (defun ediff-get-visible-buffer-window (buff)