[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/icons c829fd9964 06/11: Support icons in compilation mode
From: |
Stefan Kangas |
Subject: |
scratch/icons c829fd9964 06/11: Support icons in compilation mode |
Date: |
Wed, 24 Aug 2022 02:40:44 -0400 (EDT) |
branch: scratch/icons
commit c829fd9964468f3c86d28ef10a4d19200b7643d6
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefankangas@gmail.com>
Support icons in compilation mode
* lisp/progmodes/compile.el (compilation-mode-line-icons): New
user option.
(compile--get-compilation-mode-line-errors): New function.
(compilation-mode-line-errors): Turn into defvar.
---
lisp/progmodes/compile.el | 39 ++++++++++++++++++++++++++++-----------
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 5ce80e0657..d5dbecbfbe 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -165,6 +165,11 @@ and a string describing how the process finished.")
(t
(error "No ongoing compilations"))))
+(defcustom compilation-mode-line-icons (display-graphic-p)
+ "Non-nil means to use icons in the mode-line."
+ :type 'boolean
+ :version "29.1")
+
(defvar compilation-error "error"
"Stem of message to print when no matches are found.")
@@ -175,17 +180,29 @@ and a string describing how the process finished.")
(defvar compilation-num-warnings-found 0)
(defvar compilation-num-infos-found 0)
-(defconst compilation-mode-line-errors
- '(" [" (:propertize (:eval (int-to-string compilation-num-errors-found))
- face compilation-error
- help-echo "Number of errors so far")
- " " (:propertize (:eval (int-to-string compilation-num-warnings-found))
- face compilation-warning
- help-echo "Number of warnings so far")
- " " (:propertize (:eval (int-to-string compilation-num-infos-found))
- face compilation-info
- help-echo "Number of informational messages so far")
- "]"))
+(defun compile--get-compilation-mode-line-errors ()
+ `(,(if compilation-mode-line-icons " " " [")
+ ;; Errors
+ (:propertize (,@(if compilation-mode-line-icons `(,(icons-get-for-modeline
"alert/error_outline") " "))
+ (:eval (int-to-string compilation-num-errors-found)))
+ face compilation-error
+ help-echo "Number of errors so far")
+ " "
+ ;; Warnings
+ (:propertize (,@(if compilation-mode-line-icons `(,(icons-get-for-modeline
"alert/warning_amber") " "))
+ (:eval (int-to-string compilation-num-warnings-found)))
+ face compilation-warning
+ help-echo "Number of warnings so far")
+ " "
+ ;; Infos
+ (:propertize (,@(if compilation-mode-line-icons `(,(icons-get-for-modeline
"action/info_outline") " "))
+ (:eval (int-to-string compilation-num-infos-found)))
+ face compilation-info
+ help-echo "Number of informational messages so far")
+ ,(if compilation-mode-line-icons " " " ]")))
+
+(defvar compilation-mode-line-errors
+ (compile--get-compilation-mode-line-errors))
;; If you make any changes to `compilation-error-regexp-alist-alist',
;; be sure to run the ERT test in test/lisp/progmodes/compile-tests.el.
- branch scratch/icons created (now 8d103e622c), Stefan Kangas, 2022/08/24
- scratch/icons 4b7062e405 03/11: Factor out new function admin--read-root-directory, Stefan Kangas, 2022/08/24
- scratch/icons 09509f4fa1 05/11: Import Material design icons, Stefan Kangas, 2022/08/24
- scratch/icons 8d103e622c 11/11: Merge skicons.el with icons.el, Stefan Kangas, 2022/08/24
- scratch/icons 67251e79f7 09/11: Use material icons in mpc toolbar, Stefan Kangas, 2022/08/24
- scratch/icons 388745e6f7 04/11: New function to import the material icon set, Stefan Kangas, 2022/08/24
- scratch/icons c829fd9964 06/11: Support icons in compilation mode,
Stefan Kangas <=
- scratch/icons 59c1097041 07/11: Require octicons and material, Stefan Kangas, 2022/08/24
- scratch/icons 4de626ea22 08/11: Support using icons.el in toolbar, Stefan Kangas, 2022/08/24
- scratch/icons 6ad07cd620 01/11: New library icons.el adds support for icon sets, Stefan Kangas, 2022/08/24
- scratch/icons 3ba24c7103 02/11: Add new icon set "octicons", Stefan Kangas, 2022/08/24
- scratch/icons 647e04e6ca 10/11: Use material icons in main toolbar, Stefan Kangas, 2022/08/24