2012-11-27 57 views

回答

1

我不完全知道你「問。在你的第一段中,你似乎要求一個函數,它將把緩衝區中的所有小部件返回。但是你的例子表明你想要一個小部件通知函數。那麼,你真的想要什麼?

(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)))))) 
+0

你好。你的方法非常有趣。在我的例子中,我定義了緩衝區中所有可寫小部件的列表,然後將'mapcar'小部件值應用於它。感謝您回答我的模糊問題。 – proofit404

相關問題