diff options
author | Case Duckworth <acdw@acdw.net> | 2022-04-25 20:48:08 -0500 |
---|---|---|
committer | Case Duckworth <acdw@acdw.net> | 2022-04-25 20:48:08 -0500 |
commit | 8e917f55368c3afc214443994134203353cfa9bf (patch) | |
tree | b8ad5f0371df78ebd19a950107fd387abad7374f /jabber.org | |
parent | 162ef430af8b981e8640ac84f3c1ce229bb7714b (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.org | 37 |
1 files changed, 18 insertions, 19 deletions
@@ -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." |