diff options
| author | tslil clingman <> | 2024-01-19 19:40:04 +0100 |
|---|---|---|
| committer | tslil clingman <> | 2024-01-19 19:40:04 +0100 |
| commit | f80b705ad62dd5e74c4ae287d8414ec319f96aed (patch) | |
| tree | 432d1b44c3c518e9f43a0f38c56bf26386697247 /emacs/inits/15-project-mgmt.el | |
| parent | 886266708b8787bfbb7f63106e246c60d9f6d458 (diff) | |
[emacs] add revert-all-file-buffers, misc changes
Diffstat (limited to 'emacs/inits/15-project-mgmt.el')
| -rw-r--r-- | emacs/inits/15-project-mgmt.el | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/emacs/inits/15-project-mgmt.el b/emacs/inits/15-project-mgmt.el index 421e1a3..6ea54e6 100644 --- a/emacs/inits/15-project-mgmt.el +++ b/emacs/inits/15-project-mgmt.el @@ -1,4 +1,17 @@ -;; Time-stamp: <2022-09-02 08h55 CEST (anchor)> +;; Time-stamp: <2024-01-16 15h12 CET (9a3d20a4)> + +(defun revert-all-file-buffers () + "Refresh all open file buffers without confirmation" + (interactive) + (dolist (buf (buffer-list)) + (let ((filename (buffer-file-name buf))) + (when (and filename (not (buffer-modified-p buf))) + (if (file-readable-p filename) + (with-current-buffer buf (revert-buffer :ignore-auto :noconfirm :preserve-modes)) + (let (kill-buffer-query-functions) + (kill-buffer buf) + (message "Killed non-existing/unreadable file bufffer: %s" filename)))))) + (message "Finished reverting buffers containing unmodified files.")) (use-package projectile :ensure t @@ -8,14 +21,10 @@ (projectile-mode 1) (setq projectile-indexing-method 'alien - projectile-sort-order 'recently-active - projectile-enable-caching t - projectile-require-root t - projectile-completion-system 'default - projectile-mode-line-prefix "" - projectile-mode-line-function '(lambda () - (format " ¶[%s]" (projectile-project-name))) - )) + projectile-sort-order 'recently-active + projectile-enable-caching t + projectile-mode-line-prefix "" + projectile-mode-line-function '(lambda () (format " ¶[%s]" (projectile-project-name))))) (use-package magit :ensure t |
