Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the role of the buried-buffer-list frame parameter in Emacs

Tags:

emacs

elisp

In emacs, I've read the following code snippet in simple.el:

(frame-parameter frame 'buried-buffer-list)

What is the exact meaning of the 'buried-buffer-list parameter? What it is used for?

like image 637
Jérôme Radix Avatar asked Nov 06 '22 23:11

Jérôme Radix


2 Answers

The result of M-x describe function RET frame-parameter is:

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.

Also, have a look in the Elisp info manual for the node called "Frame/Frame Parameters". There isn't a specific reference to 'buried-buffer-list that I could find.

You might be able to get the value of it by evaluating:

(cdr (frame-parameter FRAME 'buffer-list))

since a "buried buffer" is just a buffer that's been pushed to the back of the list of buffers for a particular frame. See the documentation for 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.

like image 122
Ben Collins Avatar answered Nov 14 '22 21:11

Ben Collins


A quick look at http://www.update.uu.se/~ams/slask/emacs/src/frame.h returns:

List of buffers that were viewed, then buried in this frame.  The
most recently buried buffer is first.  

So in theory you can use cdr to obtain the same list as Ben Collins said.

like image 21
Federico Builes Avatar answered Nov 14 '22 23:11

Federico Builes