0
例如,我們有由emacs widget example提供的緩衝區。所以我想獲得這將返回關聯「的列表功能如何獲取emacs中當前widget-minor-mode緩衝區中所有小部件的值?
有些東西一樣((部件名稱窗口小部件值)...。):
(widget-create 'push-button
:notify 'get-widgets-alist
"Get Widgets")
例如,我們有由emacs widget example提供的緩衝區。所以我想獲得這將返回關聯「的列表功能如何獲取emacs中當前widget-minor-mode緩衝區中所有小部件的值?
有些東西一樣((部件名稱窗口小部件值)...。):
(widget-create 'push-button
:notify 'get-widgets-alist
"Get Widgets")
我不完全知道你「問。在你的第一段中,你似乎要求一個函數,它將把緩衝區中的所有小部件返回。但是你的例子表明你想要一個小部件通知函數。那麼,你真的想要什麼?
(require 'cl)
(defun get-widgets()
"Return a list of widgets in the current buffer."
(save-excursion
(goto-char (point-min))
(loop while (not (eobp))
for new = (widget-at)
and old = nil then new
when (and new (not (eq new old))) collect new
do (goto-char (next-overlay-change (point))))))
你好。你的方法非常有趣。在我的例子中,我定義了緩衝區中所有可寫小部件的列表,然後將'mapcar'小部件值應用於它。感謝您回答我的模糊問題。 – proofit404