From 5849cd830f00d67483c98f713ae42ba189cf039a Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sun, 19 Dec 2021 14:52:57 +0800 Subject: ibuffer: a custom column * ibuffer.el (protect): A custom column. (ibuffer-formats): Add the newly defined column to the list of formats. --- ibuffer.el | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'ibuffer.el') diff --git a/ibuffer.el b/ibuffer.el index 4944c3a..4b862c1 100644 --- a/ibuffer.el +++ b/ibuffer.el @@ -257,6 +257,34 @@ derived modes of `ibuffer-mode'."))) (advice-add #'ibuffer-do-unprotect :before #'durand-ibuffer-restore-mark-before-advice) +;;;; A custom column + +;;;###autoload +(define-ibuffer-column protect + (:name "P" :inline t) + (cond + ((durand-member buffer durand-clear-passlist #'durand-born-equal) + "P") + (" "))) + +(setq ibuffer-formats + '((mark + modified + read-only + locked + protect + " " + (name 18 18 :left :elide) + " " + (size 9 -1 :right) + " " + (mode 16 16 :left :elide) + " " + filename-and-process) + (mark " " (name 16 -1) " " filename))) + +(ibuffer-recompile-formats) + ;;; key-bindings (define-key global-map (vector 24 2) #'ibuffer) -- cgit v1.2.3-18-g5258