Function: bs-mode

bs-mode is an interactive and byte-compiled function defined in bs.el.gz.

Signature

(bs-mode)

Documentation

Major mode for editing a subset of Emacs's buffers.

Aside from two header lines each line describes one buffer. Move to a line representing the buffer you want to edit and select buffer by RET (bs-select) or SPC. Abort buffer list with q (bs-kill). There are many key commands similar to Buffer-menu-mode for manipulating the buffer list and buffers. For faster navigation each digit key is a digit argument.

RET (bs-select) or SPACE -- select current line's buffer and other marked buffers.
! (bs-select-in-one-window) -- select current's line buffer in one window, and delete other
     windows in the same frame.
o (bs-select-other-window) -- select current line's buffer in other window. C-o (bs-tmp-select-other-window) -- display current line's buffer in other window, and remain in
     Buffer Selection Menu.
F (bs-select-other-frame) -- select current's line buffer in a new frame. v (bs-view) -- view current's line buffer in View mode. t (bs-visit-tags-table) -- call visit-tags-table on current line's buffer.
<mouse-2> (bs-mouse-select) -- select current line's buffer and other marked buffers.
<mouse-3> (bs-mouse-select-other-frame) -- select current's line buffer in a new frame.

m (bs-mark-current) -- mark current line's buffer to be displayed. u (bs-unmark-current) -- unmark current line's buffer to be displayed. DEL (bs-unmark-previous) -- unmark previous line's buffer to be displayed. U (bs-unmark-all) -- unmark all buffer lines.

b (bs-bury-buffer) -- bury current's line buffer. s (bs-save) -- save current line's buffer immediately. k (bs-delete) -- kill current line's buffer immediately. C-d (bs-delete-backward) -- like k (bs-delete), but then move to previous line.
~ (bs-clear-modified) -- clear modified-flag on that buffer.
% (bs-toggle-readonly) -- toggle read-only status of current line's buffer.
+ (bs-set-current-buffer-to-show-always) -- mark current line's buffer to show always.
M (bs-toggle-current-to-show) -- toggle status of appearance.

a (bs-toggle-show-all) -- toggle between all buffers and a special subset. c (bs-select-next-configuration) -- select and apply next available configuration. C (bs-set-configuration-and-refresh) -- ask user for a configuration and apply it. S (bs-show-sorted) -- display buffer list sorted by next sort aspect.

q (bs-kill) -- leave Buffer Selection Menu without a selection. g (bs-refresh) -- refresh Buffer Selection Menu.
? (bs-help) -- display this help text.

This mode runs the hook bs-mode-hook, as the final or penultimate step during initialization.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/bs.el.gz
(define-derived-mode bs-mode nil "Buffer-Selection-Menu"
  "Major mode for editing a subset of Emacs's buffers.
\\<bs-mode-map>
Aside from two header lines each line describes one buffer.
Move to a line representing the buffer you want to edit and select
buffer by \\[bs-select] or SPC.  Abort buffer list with \\[bs-kill].
There are many key commands similar to `Buffer-menu-mode' for
manipulating the buffer list and buffers.
For faster navigation each digit key is a digit argument.

\\[bs-select] or SPACE -- select current line's buffer and other marked buffers.
\\[bs-select-in-one-window] -- select current's line buffer in one \
window, and delete other
     windows in the same frame.
\\[bs-select-other-window] -- select current line's buffer in other window.
\\[bs-tmp-select-other-window] -- display current line's buffer in \
other window, and remain in
     Buffer Selection Menu.
\\[bs-select-other-frame] -- select current's line buffer in a new frame.
\\[bs-view] -- view current's line buffer in View mode.
\\[bs-visit-tags-table] -- call `visit-tags-table' on current line's buffer.
\\[bs-mouse-select] -- select current line's buffer and other marked buffers.
\\[bs-mouse-select-other-frame] -- select current's line buffer in a new frame.

\\[bs-mark-current] -- mark current line's buffer to be displayed.
\\[bs-unmark-current] -- unmark current line's buffer to be displayed.
\\[bs-unmark-previous] -- unmark previous line's buffer to be displayed.
\\[bs-unmark-all] -- unmark all buffer lines.

\\[bs-bury-buffer] -- bury current's line buffer.
\\[bs-save] -- save current line's buffer immediately.
\\[bs-delete] -- kill current line's buffer immediately.
\\[bs-delete-backward] -- like \\[bs-delete], but then move to previous line.
\\[bs-clear-modified] -- clear modified-flag on that buffer.
\\[bs-toggle-readonly] -- toggle read-only status of current line's buffer.
\\[bs-set-current-buffer-to-show-always] -- mark current line's buffer \
to show always.
\\[bs-toggle-current-to-show] -- toggle status of appearance.

\\[bs-toggle-show-all] -- toggle between all buffers and a special subset.
\\[bs-select-next-configuration] -- select and apply next available \
configuration.
\\[bs-set-configuration-and-refresh] -- ask user for a configuration and \
apply it.
\\[bs-show-sorted] -- display buffer list sorted by next sort aspect.

\\[bs-kill] -- leave Buffer Selection Menu without a selection.
\\[bs-refresh] -- refresh Buffer Selection Menu.
\\[bs-help] -- display this help text."
  (buffer-disable-undo)
  (setq buffer-read-only t
	truncate-lines t
	show-trailing-whitespace nil)
  (setq-local font-lock-defaults '(bs-mode-font-lock-keywords t))
  (setq-local font-lock-verbose nil)
  (setq-local font-lock-global-modes '(not bs-mode))
  (setq-local revert-buffer-function 'bs-refresh)
  (add-hook 'window-size-change-functions 'bs--track-window-changes)
  (add-hook 'kill-buffer-hook 'bs--remove-hooks nil t)
  (add-hook 'change-major-mode-hook 'bs--remove-hooks nil t))