]> code.delx.au - gnu-emacs/commitdiff
* lisp/ibuffer.el: Add mark for locked buffers
authorTino Calancha <tino.calancha@gmail.com>
Thu, 7 Jul 2016 16:13:55 +0000 (01:13 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Thu, 7 Jul 2016 16:13:55 +0000 (01:13 +0900)
lisp/ibuffer.el

index ae22bd76f2b73a05edc3ae656107e014ea6f0f4d..a8eba8da893aa01756452535d5c1d86377b8bf8b 100644 (file)
@@ -71,7 +71,8 @@ and filter displayed buffers by various criteria."
   :version "22.1"
   :group 'convenience)
 
-(defcustom ibuffer-formats '((mark modified read-only " " (name 18 18 :left :elide)
+(defcustom ibuffer-formats '((mark modified read-only locked
+                                   " " (name 18 18 :left :elide)
                                   " " (size 9 -1 :right)
                                   " " (mode 16 16 :left :elide) " " filename-and-process)
                             (mark " " (name 16 -1) " " filename))
@@ -137,6 +138,7 @@ value for this variable would be
 
 Using \\[ibuffer-switch-format], you can rotate the display between
 the specified formats in the list."
+  :version "25.2"
   :type '(repeat sexp)
   :group 'ibuffer)
 
@@ -280,6 +282,12 @@ Note that this specialized filtering occurs before real filtering."
   :type 'character
   :group 'ibuffer)
 
+(defcustom ibuffer-locked-char ?L
+  "The character to display for locked buffers."
+  :version "25.2"
+  :type 'character
+  :group 'ibuffer)
+
 (defcustom ibuffer-deletion-char ?D
   "The character to display for buffers marked for deletion."
   :type 'character
@@ -1733,6 +1741,11 @@ If point is on a group name, this function operates on that group."
       (string ibuffer-read-only-char)
     " "))
 
+(define-ibuffer-column locked (:name "L" :inline t)
+  (if (and (boundp 'emacs-lock-mode) emacs-lock-mode)
+      (string ibuffer-locked-char)
+    " "))
+
 (define-ibuffer-column modified (:name "M" :inline t)
   (if (buffer-modified-p)
       (string ibuffer-modified-char)