summaryrefslogtreecommitdiff
path: root/jabber.org
diff options
context:
space:
mode:
authorCase Duckworth <acdw@acdw.net>2022-04-25 20:48:08 -0500
committerCase Duckworth <acdw@acdw.net>2022-04-25 20:48:08 -0500
commit8e917f55368c3afc214443994134203353cfa9bf (patch)
treeb8ad5f0371df78ebd19a950107fd387abad7374f /jabber.org
parent162ef430af8b981e8640ac84f3c1ce229bb7714b (diff)
Fix jabber-sort-nicks on Emacs 28
I converted the old `flet' call to `cl-letf*' with `symbol-function'.
Diffstat (limited to 'jabber.org')
-rw-r--r--jabber.org37
1 files changed, 18 insertions, 19 deletions
diff --git a/jabber.org b/jabber.org
index 60117bf..f4d8a7a 100644
--- a/jabber.org
+++ b/jabber.org
@@ -11314,25 +11314,24 @@ Optional argument GROUP to look."
time)))))
#+END_SRC
-*** jabber-sort-nicks :function:
-#+BEGIN_SRC emacs-lisp
-(defun jabber-sort-nicks (nicks group)
- "Return list of NICKS in GROUP, sorted."
- (let ((times (cdr (assoc group *jabber-muc-participant-last-speaking*))))
- (flet ((fetch-time (nick) (or (assoc nick times) (cons nick 0)))
- (cmp (nt1 nt2)
- (let ((t1 (cdr nt1))
- (t2 (cdr nt2)))
- (if (and (zerop t1) (zerop t2))
- (string<
- (car nt1)
- (car nt2))
- (> t1 t2)))))
- (mapcar 'car (sort (mapcar #'fetch-time nicks)
- 'cmp)))))
-#+END_SRC
-
-*** jabber-muc-beginning-of-line :function:
+*** jabber-sort-nicks :function:
+#+BEGIN_SRC emacs-lisp
+ (defun jabber-sort-nicks (nicks group)
+ "Return list of NICKS in GROUP, sorted."
+ (cl-letf* ((times (cdr (assoc group *jabber-muc-participant-last-speaking*)))
+ ((symbol-function 'fetch-time) (lambda (nick) (or (assoc nick times)
+ (cons nick 0))))
+ ((symbol-function 'cmp) (lambda (nt1 nt2)
+ (let ((t1 (cdr nt1))
+ (t2 (cdr nt2)))
+ (if (and (zerop t1) (zerop t2))
+ (string< (car nt1)
+ (car nt2))
+ (> t1 t2))))))
+ (mapcar #'car (sort (mapcar #'fetch-time nicks) #'cmp))))
+#+END_SRC
+
+*** jabber-muc-beginning-of-line :function:
#+BEGIN_SRC emacs-lisp
(defun jabber-muc-beginning-of-line ()
"Return position of line begining."