commit d62381f11fd8670ecb2ad69a0bd4c37b9e70e4ef
parent 89b1342cf56cc8238a59761dfc2976b9a10fb6c6
Author: Yuval Langer <yuval.langer@gmail.com>
Date: Tue, 10 Sep 2024 17:49:24 +0300
Update Emacs configuration and functionality.
Diffstat:
2 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/config/emacs/init.el b/config/emacs/init.el
@@ -21,6 +21,12 @@
(setq package-archives '())
(require 'use-package)
+(use-package browse-url
+ :demand t
+ :custom
+ (browse-url-browser-function 'eww-browse-url)
+ )
+
(use-package casual-calc
:ensure nil
:bind (:map calc-mode-map ("C-o" . casual-calc-tmenu)))
@@ -38,6 +44,15 @@
:init
(add-hook 'after-init-hook 'global-company-mode))
+(use-package compilation
+ :demand t
+ :requires (ansi-color)
+ )
+
+;; FIXME: Why can't I use it in the (use-package compilation :hook or :init)?
+(add-hook 'compilation-filter-hook #'kakafarm/colorize-compilation)
+
+
(use-package corfu
:defer t
:config
@@ -233,9 +248,9 @@
)
'(use-package mode-line
- :custom
- (mode-line-percent-position '(6 "%q"))
- )
+ :custom
+ (mode-line-percent-position '(6 "%q"))
+ )
(use-package modus-themes
:defer t
@@ -294,9 +309,9 @@
:mode ("\\.epub\\'" . nov-mode))
'(use-package opml-to-elfeed-feeds
- :custom
- (opml-to-elfeed-feeds-elfeed-feeds nil t)
- )
+ :custom
+ (opml-to-elfeed-feeds-elfeed-feeds nil t)
+ )
(use-package orderless
:defer t
@@ -400,6 +415,9 @@
(use-package shr
:custom
(shr-width 75)
+ (shr-use-fonts nil)
+ (shr-use-colors nil)
+ (shr-indentation 2)
)
(use-package simple
diff --git a/config/emacs/local-packages/emacs-kakafarm/kakafarm.el b/config/emacs/local-packages/emacs-kakafarm/kakafarm.el
@@ -74,6 +74,19 @@
;; "echo echo echo"))
;;;###autoload
+(defun kakafarm/colorize-compilation ()
+ "Colorize from `compilation-filter-start' to `point'.
+
+Used to convert raw ANSI color codes into visually (sometimes dis-)pleasing colors.
+
+From:
+
+https://endlessparentheses.com/ansi-colors-in-the-compilation-buffer-output.html"
+ (let ((inhibit-read-only t))
+ (ansi-color-apply-on-region compilation-filter-start
+ (point))))
+
+;;;###autoload
(defun kakafarm/copy-elfeed-links ()
(interactive)