是否可以获取列表并将其保存在变量中?我跑步
(ido-completing-read "prompt: " '("one" "two" "three" "four" "five") nil nil "t")ido生成候选列表{two | three}。我想要这样的东西
(setq my-desired-list (ido-completing-read-silent '("one" "two" "three" "four" "five") nil nil "t"))执行后my-desired-list的值为("two" "three")。我对ido使用了复杂的设置,它为choices准备了非常特殊的过滤器,我想直接使用结果。
发布于 2013-10-19 14:53:26
变量‘ido-matches’将包含上次调用ido-completing read时的匹配项。所以这就是你想要的:
(defun ido-completing-read-silent (prompt choices initial-input)
(ido-completing-read prompt choices nil nil initial-input)
ido-matches)
(ido-completing-read-silent "prompt: " '("one" "two" "three" "four" "five") "t")
;; ("two" "three")发布于 2013-10-20 20:23:14
(defun ido-completing-read-silent (prompt choices initial-input)
(run-with-timer 0.0001 nil 'exit-minibuffer)
(ido-completing-read prompt choices nil nil initial-input)
(mapcar (lambda (x) (flx-propertize x nil)) ido-matches))
(equal (ido-completing-read-silent "prompt: " '("one" "two" "three" "four" "five") "t")
'("three" "two"))该解决方案可以用于其他情况,用于不同的交互功能,如ido-completing-read。
https://stackoverflow.com/questions/19461171
复制相似问题