Source of Nothingness - popup-list

* Menu

[[About:self:AboutPage.txt]] | [[Profile:file/southly/]] | [[まとめ:self:1163859357.txt]] | [[オリジナル:http://ninjinix.x0.com/rn/]] | [[xyzzy:lisp/]] | [[あんてな:listall]] | [[■:lisp]] | [[buzz:files/southly#buzz]]

* 2009-02-20 :

* そこそこまとまっていて役に立つかもしれないもの

* 2007-02-23

* editorパッケージのbuiltin関数

以下で調べて652個
(let ((count 0))
  (do-symbols (sym (find-package "editor") (format t "~%count: ~d~%" count))
    (when (and (not (find-symbol (symbol-name sym) "lisp"))
               (fboundp sym)
               (si:*builtin-function-p (symbol-function sym)))
      (format t "~a~%" sym)
      (incf count))))
[[(ReadMore...) index.rb?1164371462.txt]]

* xyzzy lisp : 候補の絞込みをするpopup-list

http://xyzzy.s53.xrea.com/wiki/index.php?%BC%C1%CC%E4%C8%A2%2F173
上のページにいくつかありますが元のpopup-listと引数が異なっていて置き換えにくいので書き直し。正規表現を使っていなかった佐野さんのがベース。

(defun popup-list-loop (list callback &optional point with-insert)
  (let ((str "") (matched list) matched1 selected input)
    (loop
      (if with-insert (insert str))
      (popup-list matched (lambda (x) (setq selected x)) point) ; #\ESC
      (refresh-screen)
      (while (not (or selected (setq input (read-char-no-hang *keyboard*))))
        (do-events))
      (if with-insert (delete-region (- (point) (length str)) (point)))
      (cond (selected
             (funcall callback selected)
             (if (eql input #\SPC) (unread-char input))
             (return t))
;           ((eql input #\ESC) (return nil))
            ((eql input #\C-h) (unless (zerop (length str)) (setq str (substring str 0 -1))))
            ((graphic-char-p input) (setq str (format nil "~A~C" str input)))
            (t (unread-char input) (return nil)))
      (setq matched1 (remove-if (lambda (x)
                                  (or (< (length x) (length str))
                                      (string/= x str :end1 (length str))))
                                list))
      (if (endp matched1) (if with-insert
                              (progn (funcall callback str) (return t))
                            (setq str (substring str 0 -1)))
        (setq matched matched1)))))
できるだけ元のpopup-listと同じ操作感になるようにしたつもりですが、ウィンドウをESCで閉じたときの動作だけは感知する手段が無くて無理でした。


ちなみに実際に使うときは[[これ:self:1155828305.txt]]みたいに引数にbase(すでに一致している部分)をとらないといけないような気がしてる。

* xyzzy lisp : へなちょこ補完その3

絞込み
[[(ReadMore...) index.rb?1155828305.txt]]

* xyzzy lisp : global-markpopup の続き