]> git.eshelyaron.com Git - emacs.git/commitdiff
; Add face customization to ERC's sample config
authorF. Jason Park <jp@neverwas.me>
Wed, 2 Oct 2024 23:41:39 +0000 (16:41 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:38:28 +0000 (19:38 +0200)
* doc/misc/erc.texi (Sample Configuration): Move `erc-modules' twiddling
from a `use-package' :config section to a :custom section.  In the past,
this would sometimes provoke module-loading issues, but it seems to work
fine on Emacs 30, even with repeated eval'ing of the `use-package' form.
This sample config is meant for users running the latest release anyhow.
Also add a new `use-package' block for `erc-match' showing how to
customize a face using inheritance.  Add a corresponding section further
down showing the same via Customize.

(cherry picked from commit 3f1ce47fe7eb4809bfa9ef035caae748c3c5d729)

doc/misc/erc.texi

index 9cfb12c92313a83ece0ad374f2a85e3f3f4c7483..9368c9ce070ea72e5cf3b1798976120d67878689 100644 (file)
@@ -1324,14 +1324,11 @@ settings (@pxref{Sample configuration via Customize}).
 ;;; My ERC configuration -*- lexical-binding: t -*-
 
 (use-package erc
-  :config
-  ;; Prefer SASL to NickServ, colorize nicknames, and show side panels
-  ;; with joined channels and members
-  (setopt erc-modules
-          (seq-union '(sasl nicks bufbar nickbar scrolltobottom)
-                     erc-modules))
-
   :custom
+  ;; Prefer SASL to NickServ, colorize nicknames, and show side panels
+  ;; with joined channels and members.
+  (erc-modules (append '(sasl nicks bufbar nickbar scrolltobottom)
+                       erc-modules))
   ;; Protect me from accidentally sending excess lines.
   (erc-inhibit-multiline-input t)
   (erc-send-whitespace-lines t)
@@ -1372,6 +1369,13 @@ settings (@pxref{Sample configuration via Customize}).
 
   :bind (:map erc-fill-wrap-mode-map ("C-c =" . #'erc-fill-wrap-nudge)))
 
+(use-package erc-match
+  ;; Use the same face for my own nick wherever it appears.
+  :custom-face
+  (erc-current-nick-face ((t ( :weight unspecified
+                               :foreground unspecified
+                               :inherit erc-my-nick-face)))))
+
 (use-package erc-track
   ;; Prevent JOINs and PARTs from lighting up the mode-line.
   :config (setopt erc-track-faces-priority-list
@@ -1552,6 +1556,18 @@ function @code{erc-fill-wrap-nudge} in the minor-mode keymap
 @code{erc-fill-wrap-mode-hook}, and it's not a member of any
 customization group).
 
+Try customizing another face, this time with inheritance.  ERC's match
+module highlights your nick whenever someone mentions you in
+conversation.  However, some users don't like that this face differs
+from the one in your own messages.  Let's change that.  Type @kbd{M-x
+customize-group @key{RET} erc-faces @key{RET}}.  Either search for the
+word ``Current'' or type @kbd{M-x customize-face @key{RET}
+erc-current-nick-face @key{RET}}.  Untick @samp{Weight} and
+@samp{Foreground}, then click the ``Show All Attributes'' button below
+them.  Navigate down to the @samp{Inherit} box, tick it, hit
+@samp{[INS]}, and type @code{erc-my-nick-face} in the @samp{Face} field.
+Hit @kbd{C-x C-s} to save.
+
 ERC users tend to be picky about the mode line.  If you find that
 you'd rather not see changes when people join and leave channels,
 customize the option @code{erc-track-faces-priority-list}.  When