我正在尝试创建一个修改框架缓冲区列表的函数,方法是将其替换为同一帧上显示的Tabbar组中的选项卡的缓冲区列表。
这是从所选框架上显示的Tabbar组返回标签列表的代码段:
(mapcar (lambda (tab)
(buffer-name (tabbar-tab-value tab)))
(tabbar-tabs (tabbar-current-tabset t)))
以下函数返回nil
而不是所需的修改缓冲区列表。任何想法都将不胜感激。
(defun new-buffer-list ()
(interactive)
(message "Original Buffer List: %s" (frame-parameter (selected-frame) 'buffer-list))
(setq new-list
(mapcar (lambda (tab)
(buffer-name (tabbar-tab-value tab)))
(tabbar-tabs (tabbar-current-tabset t))))
(modify-frame-parameters (selected-frame) (list (cons 'buffer-list new-list)))
(message "The variable \"new-list\": %s" new-list)
(message "Modified Buffer List: %s" (frame-parameter (selected-frame) 'buffer-list)))
答案 0 :(得分:2)
(frame-parameter 'nil 'buffer-list)
返回缓冲区列表,而不是名称;因此你可能想要替换
(lambda (tab) (buffer-name (tabbar-tab-value tab)))
'tabbar-tab-value