Created
August 9, 2010 00:13
-
-
Save rmcm/514716 to your computer and use it in GitHub Desktop.
externally visited files
This file contains 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
;; ----------------------------------------- | |
;; List of visited files - for reversion (V) | |
;; eg when external process visits files. | |
;; ----------------------------------------- | |
(require 'ibuffer) | |
(require 'ibuf-ext) | |
(define-ibuffer-filter my-revisited-buffers | |
"Filter buffers that have been revisited" | |
(:description "revisited buffers" | |
:reader (ido-read-directory-name "dname")) | |
(with-current-buffer buf | |
(not (verify-visited-file-modtime buf)))) | |
;; ---------------------------------------- | |
;; use ibuffer to list revisited buffers | |
;; (eg git checkouts) | |
;; ---------------------------------------- | |
(defun my-revert-files () | |
"Revert files which have been visited externally." | |
(interactive) | |
(ibuffer nil "*Buffers Visited Externally*" | |
(list (cons 'my-revisited-buffers "")))) | |
(global-set-key (kbd "C-c e z") 'my-revert-files) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment