Created
July 25, 2016 19:39
-
-
Save offby1/15e4f9b9736ea402b06bf7db6c4aca7e to your computer and use it in GitHub Desktop.
Use magit? Have a lotta buffers? This is handy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Unrelated to the above, but handy anyway | |
(defun ibuffer-mark-most-readonly-buffers () | |
(interactive) | |
(ibuffer-mark-on-buffer | |
#'(lambda (buf) | |
(and | |
;; Yeah, yeah, I could (defvar | |
;; ibuffer-precious-read-only-yadda-yadda) but screw that. | |
(not (string-match (rx bos "*magit: ") (buffer-name buf))) | |
(buffer-local-value 'buffer-read-only buf))))) | |
(define-key | |
ibuffer-mode-map | |
[remap ibuffer-mark-read-only-buffers] 'ibuffer-mark-most-readonly-buffers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment