Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
Add variable peep-dired-cleanup-eagerly
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
asok committed May 18, 2015
1 parent 38f6076 commit 433463a
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions peep-dired.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
:group 'peep-dired
:type 'boolean)

(defcustom peep-dired-cleanup-eagerly nil
"Cleanup opened buffers upon `peep-dired-next-file' & `peep-dired-prev-file'"
:group 'peep-dired
:type 'boolean)

(defcustom peep-dired-enable-on-directories t
"When t it will enable the mode when visiting directories"
:group 'peep-dired
Expand All @@ -59,12 +64,16 @@
(defun peep-dired-next-file ()
(interactive)
(dired-next-line 1)
(peep-dired-display-file-other-window))
(peep-dired-display-file-other-window)
(when peep-dired-cleanup-eagerly
(peep-dired-cleanup)))

(defun peep-dired-prev-file ()
(interactive)
(dired-previous-line 1)
(peep-dired-display-file-other-window))
(peep-dired-display-file-other-window)
(when peep-dired-cleanup-eagerly
(peep-dired-cleanup)))

(defun peep-dired-kill-buffers-without-window ()
"Will kill all peep buffers that are not displayed in any window"
Expand Down Expand Up @@ -102,6 +111,10 @@
(interactive)
(scroll-other-window '-))

(defun peep-dired-cleanup ()
(mapc 'kill-buffer-if-not-modified peep-dired-peeped-buffers)
(setq peep-dired-peeped-buffers ()))

(defun peep-dired-disable ()
(let ((current-point (point)))
(jump-to-register :peep_dired_before)
Expand Down

0 comments on commit 433463a

Please sign in to comment.