平衡点


2023/08/04

_ Wanderlust の返信順ソート関数

元ネタは Re: wanderlust で GMail 風、新着レス順にソート.

flet の挙動が変わった際には sigma/el-x: Emacs lisp extensions にある dflet を使っていたのだけれど, cl-letf を使う様に書き換えてみたり.

(defun wl-summary-overview-entity-compare-by-reply-date (a b)
  "Compare message A and B by latest date of replies including thread."
  (cl-letf (((symbol-function 'string-max2)
             (lambda (x y) (cond ((string< x y) y) ;;>
                                 ('t x))))
            ((symbol-function 'elmo-entity-to-number)
             (lambda (x) (elt (cddr x) 0)))

            ((symbol-function 'thread-number-get-date)
             (lambda (x) (timezone-make-date-sortable
                          (elmo-msgdb-overview-entity-get-date
                           (elmo-message-entity
                            wl-summary-buffer-elmo-folder
                            x)))))
            ((symbol-function 'thread-get-family)
             (lambda (x)
               (cons x (wl-thread-entity-get-descendant
                        (wl-thread-get-entity x)))))
            ((symbol-function 'max-reply-date)
             (lambda (x) (cond ((eq 'nil x)
                                'nil)
                               ((eq 'nil (cdr x))
                                (thread-number-get-date (car x)))
                               ('t
                                (string-max2 (thread-number-get-date (car x))
                                             (max-reply-date (cdr x)))))))
            )
    (string<  ;;>
     (max-reply-date (thread-get-family (elmo-entity-to-number a)))
     (max-reply-date (thread-get-family (elmo-entity-to-number b))))))
(add-to-list 'wl-summary-sort-specs 'reply-date)
(setq wl-summary-default-sort-spec 'reply-date)

とっても場当たり的なんですが, まあ, 動くからヨシ, ということで.


連絡先など
最近の日記
  • 2024/04/28
    • 1. CF-SR3 での生活環境構築 (できてない)
  • 2024/03/29
    • 1. Debian GNU/Linux on CF-SR3
  • 2024/03/25
    • 1. org-mode → beamer でのリスト記号の一時変更
  • 2024/03/22
    • 1. 静的htmlによるGit Repository Browser
  • 2024/02/15
    • 1. org-mode → bemaer での番号付きリスト
一覧
2006|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|02|03|04|08|09|10|11|12|
2013|01|02|03|04|05|06|08|09|10|11|12|
2014|01|02|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|09|10|
2016|02|03|
2017|01|02|03|05|06|07|09|11|12|
2018|03|06|07|10|11|12|
2019|01|02|03|04|05|07|10|12|
2020|01|02|03|04|05|08|09|10|11|12|
2021|01|02|03|05|06|07|08|09|11|12|
2022|01|02|03|04|05|06|08|10|11|12|
2023|02|03|04|06|08|09|11|12|
2024|01|02|03|04|
Back to Top ▲