Emacs中的隐藏缓冲区列表帧参数的作用是什么
时间:2020-03-05 18:45:11 来源:igfitidea点击:
在emacs中,我已经在simple.el
中阅读了以下代码片段:
(frame-parameter frame 'buried-buffer-list)
" buried-buffer-list"参数的确切含义是什么?
它的作用是什么?
解决方案
回答
M-x描述函数RET frame-parameter的结果是:
frame-parameter is a built-in function. (frame-parameter FRAME PARAMETER) Return FRAME's value for parameter PARAMETER. If FRAME is nil, describe the currently selected frame.
另外,请在Elisp信息手册中查看名为"框架/框架参数"的节点。我找不到对" buried-buffer-list"的具体引用。
我们可以通过评估以下内容来获得其价值:
(cdr (frame-parameter FRAME 'buffer-list))
因为"埋入缓冲区"只是被推到特定帧的缓冲区列表后面的缓冲区。请参阅bury-buffer
的文档:
bury-buffer is an interactive compiled Lisp function in `window.el'. (bury-buffer &optional BUFFER-OR-NAME) Put BUFFER-OR-NAME at the end of the list of all buffers. There it is the least likely candidate for `other-buffer' to return; thus, the least likely buffer for C-x b to select by default. You can specify a buffer name as BUFFER-OR-NAME, or an actual buffer object. If BUFFER-OR-NAME is nil or omitted, bury the current buffer. Also, if BUFFER-OR-NAME is nil or omitted, remove the current buffer from the selected window if it is displayed there.
回答
快速浏览http://www.update.uu.se/~ams/slask/emacs/src/frame.h返回:
List of buffers that were viewed, then buried in this frame. The most recently buried buffer is first.
因此,从理论上讲,我们可以使用cdr来获取与Ben Collins所说的列表相同的列表。