hns - 日記自動生成システム - Version 2.19.9

先月 2005年08月 来月
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2005年08月03日(水) 旧暦 [n年日記] [更新:"2005/08/04 09:37:15"]

#1 [Emacs][Wanderlust][Namazu] 検索結果が 500 以上だった時に最新を表示しない

で、最古の方から 500 表示する。のが気になっていて、 少なくとも Too many messages .. と言っているのは wl/elmo.el の次の辺り
1439 (defun elmo-folder-confirm-appends (appends) 
1440   (let ((len (length appends))
1441         in)
1442     (if (and elmo-folder-update-threshold
1443              (> len elmo-folder-update-threshold)
1444              elmo-folder-update-confirm)
1445         (if (y-or-n-p (format "Too many messages(%d).  Update all? " len))
1446             appends
1447           (setq in elmo-folder-update-threshold)
1448           (catch 'end
1449             (while t
1450               (setq in (read-from-minibuffer "Update number: "
1451                                              (int-to-string in))
1452                     in (string-to-int in))
1453               (if (< len in)
1454                   (throw 'end len))            ; in より len が短ければ、len を採用
1455               (if (y-or-n-p (format
1456                              "%d messages are killed (not appeared). OK? "
1457                              (max (- len in) 0)))
1458                   (throw 'end in))))           ;  入力された数字があれば、それを採用
1459           (nthcdr (max (- len in) 0) appends)) ;  len - in か 0 の大きい方だけ捨てる
                                                    ;  次の三条件が満足されれば、つまり
1460       (if (and elmo-folder-update-threshold    ;     
1461                (> len elmo-folder-update-threshold)
1462                (not elmo-folder-update-confirm))
                                                    ;   の時には、
1463           (nthcdr (max (- len elmo-folder-update-threshold) 0) appends)
1464         appends))))
普通は、最後の方から 500 を表示すればいいが、Namazu の結果の場合は最初の 500 を表示する。 500 と言っているのは、上の変数で言えば、elmo-folder-update-threshold。

nthcdr は リストに cdr を指定された回数だけ評価する。この場合 appends から指定数だけ取除く、 という動作になる。その反対は ?

butlast を使えばいい:

らしい。最後から指定された数だけ除く
(butlast (list 1 2 3 4) 3 )
(1)

(butlast (list 1 2 3 4) 1 )
(1 2 3)



最近の日記
2024年03月10日
停電 (瞬電)
2024年03月03日
the second try on bare-metal
useradd
2024年02月29日
opendkim and senmail
2024年01月24日
chat/iam 0.0.8
2024年01月21日
uselocale vs setlocale (textproc/R-readxl)
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)