Function: msb-item-handler
msb-item-handler is a byte-compiled function defined in msb.el.gz.
Signature
(msb-item-handler BUFFER &optional MAXBUF)
Documentation
Create one string item, concerning BUFFER, for the buffer menu.
The item looks like:
*% <buffer-name>
The * appears only if the buffer is marked as modified.
The % appears only if the buffer is read-only.
Optional second argument MAXBUF is completely ignored.
Source Code
;; Defined in /usr/src/emacs/lisp/msb.el.gz
;;;
;;; Some example function to be used for `msb-item-handling-function'.
;;;
(defun msb-item-handler (_buffer &optional _maxbuf)
"Create one string item, concerning BUFFER, for the buffer menu.
The item looks like:
*% <buffer-name>
The `*' appears only if the buffer is marked as modified.
The `%' appears only if the buffer is read-only.
Optional second argument MAXBUF is completely ignored."
(let ((name (buffer-name))
(modified (if (buffer-modified-p) "*" " "))
(read-only (if buffer-read-only "%" " ")))
(format "%s%s %s" modified read-only name)))