emacs-diffs
[Top][All Lists]
Advanced

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

master aa56253407e: Compare case-folded nicks with erc-fill-wrap-merge


From: F. Jason Park
Subject: master aa56253407e: Compare case-folded nicks with erc-fill-wrap-merge
Date: Sun, 30 Apr 2023 21:36:24 -0400 (EDT)

branch: master
commit aa56253407eaa62fdfbc037d5b5a6b3c41e6796e
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>

    Compare case-folded nicks with erc-fill-wrap-merge
    
    * lisp/erc/erc-fill.el (erc-fill--wrap-continued-message-p): Downcase
    both current and previous speaker when comparing nicks.
    * test/lisp/erc/erc-fill-tests.el (erc-fill-wrap--merge): Add
    title-case nick to test.
    * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update
    snapshot.
    * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update
    snapshot.  (Bug#60936)
---
 lisp/erc/erc-fill.el                                      |  3 ++-
 test/lisp/erc/erc-fill-tests.el                           | 11 ++++++++---
 test/lisp/erc/resources/fill/snapshots/merge-01-start.eld |  2 +-
 test/lisp/erc/resources/fill/snapshots/merge-02-right.eld |  2 +-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index c29d292abce..7b6495f9f3f 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -363,7 +363,8 @@ parties.")
                             erc-fill--wrap-max-lull))
               (nick  (buffer-substring-no-properties
                       (1+ (point-min)) (- (point) 2)))
-              ((equal (car props) (erc-downcase nick)))))
+              (props)
+              ((erc-nick-equal-p (car props) nick))))
     (set-marker erc-fill--wrap-last-msg (point-min))))
 
 (defun erc-fill--wrap-stamp-insert-prefixed-date (args)
diff --git a/test/lisp/erc/erc-fill-tests.el b/test/lisp/erc/erc-fill-tests.el
index f249be8fb86..e8dd25e8ea1 100644
--- a/test/lisp/erc/erc-fill-tests.el
+++ b/test/lisp/erc/erc-fill-tests.el
@@ -203,18 +203,23 @@
   (erc-fill-tests--wrap-populate
 
    (lambda ()
+     (erc-update-channel-member
+      "#chan" "Dummy" "Dummy" t nil nil nil nil nil "fake" "~u" nil nil t)
+
      ;; Set this here so that the first few messages are from 1970
      (let ((erc-fill-tests--time-vals (lambda () 1680332400)))
        (erc-fill-tests--insert-privmsg "bob" "zero.")
        (erc-fill-tests--insert-privmsg "alice" "one.")
        (erc-fill-tests--insert-privmsg "alice" "two.")
        (erc-fill-tests--insert-privmsg "bob" "three.")
-       (erc-fill-tests--insert-privmsg "bob" "four."))
+       (erc-fill-tests--insert-privmsg "bob" "four.")
+       (erc-fill-tests--insert-privmsg "Dummy" "five.")
+       (erc-fill-tests--insert-privmsg "Dummy" "six."))
 
      (should (= erc-fill--wrap-value 27))
      (erc-fill-tests--wrap-check-prefixes
       "*** " "<alice> " "<bob> "
-      "<bob> " "<alice> " "<alice> " "<bob> " "<bob> ")
+      "<bob> " "<alice> " "<alice> " "<bob> " "<bob> " "<Dummy> " "<Dummy> ")
      (erc-fill-tests--compare "merge-01-start")
 
      (ert-info ("Shift right by one (plus)")
@@ -222,7 +227,7 @@
        (should (= erc-fill--wrap-value 29))
        (erc-fill-tests--wrap-check-prefixes
         "*** " "<alice> " "<bob> "
-        "<bob> " "<alice> " "<alice> " "<bob> " "<bob> ")
+        "<bob> " "<alice> " "<alice> " "<bob> " "<bob> " "<Dummy> " "<Dummy> ")
        (erc-fill-tests--compare "merge-02-right")))))
 
 (ert-deftest erc-fill-wrap-visual-keys--body ()
diff --git a/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld 
b/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld
index db3136a9d9e..88defb6c09e 100644
--- a/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld
+++ b/test/lisp/erc/resources/fill/snapshots/merge-01-start.eld
@@ -1 +1 @@
-#("\n\n\n[Thu Jan  1 1970]\n*** This server is in debug mode and is logging 
all user I/O. If you do not wish for everything you send to be readable by the 
server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a 
tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause 
to complain of? Come me to what was done to her.\n<bob> alice: Either your 
unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr  1 
2023]\n<bob> zero.[07:00]\n<alic [...]
\ No newline at end of file
+#("\n\n\n[Thu Jan  1 1970]\n*** This server is in debug mode and is logging 
all user I/O. If you do not wish for everything you send to be readable by the 
server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a 
tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause 
to complain of? Come me to what was done to her.\n<bob> alice: Either your 
unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr  1 
2023]\n<bob> zero.[07:00]\n<alic [...]
\ No newline at end of file
diff --git a/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld 
b/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld
index fcb9e59b757..c5a9cbfc05d 100644
--- a/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld
+++ b/test/lisp/erc/resources/fill/snapshots/merge-02-right.eld
@@ -1 +1 @@
-#("\n\n\n[Thu Jan  1 1970]\n*** This server is in debug mode and is logging 
all user I/O. If you do not wish for everything you send to be readable by the 
server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a 
tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause 
to complain of? Come me to what was done to her.\n<bob> alice: Either your 
unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr  1 
2023]\n<bob> zero.[07:00]\n<alic [...]
\ No newline at end of file
+#("\n\n\n[Thu Jan  1 1970]\n*** This server is in debug mode and is logging 
all user I/O. If you do not wish for everything you send to be readable by the 
server owner(s), please disconnect.[00:00]\n<alice> bob: come, you are a 
tedious fool: to the purpose. What was done to Elbow's wife, that he hath cause 
to complain of? Come me to what was done to her.\n<bob> alice: Either your 
unparagoned mistress is dead, or she's outprized by a trifle.\n\n[Sat Apr  1 
2023]\n<bob> zero.[07:00]\n<alic [...]
\ No newline at end of file



reply via email to

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