summaryrefslogtreecommitdiff
path: root/emacs/inits/15-project-mgmt.el
blob: f61d75d08915cf31a3ae14e324545664e34ad412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;; Time-stamp: <2025-02-19 10h42 GMT (anker)>

(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."))

(require 'project)

(setq project-vc-extra-root-markers '("Cargo.toml"))