emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 525bc083155 2/4: Remove mishandled erc-control-default-{fg, bg} f


From: F. Jason Park
Subject: master 525bc083155 2/4: Remove mishandled erc-control-default-{fg, bg} faces
Date: Sat, 23 Mar 2024 18:38:31 -0400 (EDT)

branch: master
commit 525bc083155030b58de08c8716fec9db1496aa9d
Author: F. Moukayed <smfadi+emacs@gmail.com>
Commit: F. Jason Park <jp@neverwas.me>

    Remove mishandled erc-control-default-{fg,bg} faces
    
    Partially revert those portions of 7b4ca9e609e "Leverage inverse-video
    for erc-inverse-face" that introduced and managed explicit faces for
    the "default" 99 color code.
    
    * lisp/erc/erc-goodies.el (erc-control-default-fg)
    (erc-control-default-bg): Remove unused faces originally meant to be
    new in ERC 5.6.
    (erc-get-fg-color-face, erc-get-bg-color-face): Return nil for n=99.
    (erc-controls-interpret, erc-controls-highlight): Preserve an
    interval's existing background so "if only the foreground color is
    set, the background color stays the same," as explained by
    https://modern.ircdocs.horse/formatting#color.  (Bug#69860)
    
    Copyright-paperwork-exempt: yes
---
 lisp/erc/erc-goodies.el | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index da14f5bd728..883f64d3109 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -673,14 +673,6 @@ The value `erc-interpret-controls-p' must also be t for 
this to work."
   "ERC underline face."
   :group 'erc-faces)
 
-(defface erc-control-default-fg '((t :inherit default))
-  "ERC foreground face for the \"default\" color code."
-  :group 'erc-faces)
-
-(defface erc-control-default-bg '((t :inherit default))
-  "ERC background face for the \"default\" color code."
-  :group 'erc-faces)
-
 ;; FIXME rename these to something like `erc-control-color-N-fg',
 ;; and deprecate the old names via `define-obsolete-face-alias'.
 (defface fg:erc-color-face0 '((t :foreground "White"))
@@ -812,7 +804,7 @@ The value `erc-interpret-controls-p' must also be t for 
this to work."
       (intern (concat "bg:erc-color-face" (number-to-string n))))
      ((< 15 n 99)
       (list :background (aref erc--controls-additional-colors (- n 16))))
-     (t (erc-log (format "   Wrong color: %s" n)) 'erc-control-default-fg))))
+     (t (erc-log (format "   Wrong color: %s" n)) nil))))
 
 (defun erc-get-fg-color-face (n)
   "Fetches the right face for foreground color N (0-15)."
@@ -828,7 +820,7 @@ The value `erc-interpret-controls-p' must also be t for 
this to work."
       (intern (concat "fg:erc-color-face" (number-to-string n))))
      ((< 15 n 99)
       (list :foreground (aref erc--controls-additional-colors (- n 16))))
-     (t (erc-log (format "   Wrong color: %s" n)) 'erc-control-default-bg))))
+     (t (erc-log (format "   Wrong color: %s" n)) nil))))
 
 ;;;###autoload(autoload 'erc-irccontrols-mode "erc-goodies" nil t)
 (define-erc-module irccontrols nil
@@ -883,7 +875,7 @@ See `erc-interpret-controls-p' and 
`erc-interpret-mirc-color' for options."
                     (setq s (replace-match "" nil nil s 1))
                     (cond ((and erc-interpret-mirc-color (or fg-color 
bg-color))
                            (setq fg fg-color)
-                           (setq bg bg-color))
+                           (when bg-color (setq bg bg-color)))
                           ((string= control "\C-b")
                            (setq boldp (not boldp)))
                           ((string= control "\C-]")
@@ -944,7 +936,7 @@ Also see `erc-interpret-controls-p' and 
`erc-interpret-mirc-color'."
                (replace-match "" nil nil nil 1)
                (cond ((and erc-interpret-mirc-color (or fg-color bg-color))
                       (setq fg fg-color)
-                      (setq bg bg-color))
+                      (when bg-color (setq bg bg-color)))
                      ((string= control "\C-b")
                       (setq boldp (not boldp)))
                      ((string= control "\C-]")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]