diff --git a/core/defuns/defuns-buffers.el b/core/defuns/defuns-buffers.el index df3f24fa1..7b01b0e13 100644 --- a/core/defuns/defuns-buffers.el +++ b/core/defuns/defuns-buffers.el @@ -204,7 +204,7 @@ left, create a scratch buffer." (narf/cycle-real-buffers -1)) (defun narf--kill-buffers (buffers &optional filter-func) - (let ((buffers (if filter-func (funcall filter-func buffers) buffers)) + (let ((buffers (if filter-func (-filter filter-func buffers) buffers)) (affected 0)) (mapc (lambda (b) (when (kill-buffer b) (incf affected))) buffers) (unless (narf/real-buffer-p) @@ -219,6 +219,15 @@ left, create a scratch buffer." (when bang (delete-other-windows))) +;;;###autoload (autoload 'narf:kill-other-buffers "defuns-buffers" nil t) +(evil-define-command narf:kill-other-buffers (&optional bang) + "Kill all other project buffers. If BANG, kill *all* other buffers (in workgroup)." + (interactive "") + (narf--kill-buffers (narf/get-buffers (not bang)) + (lambda (b) (not (eq b (current-buffer))))) + (when bang + (delete-other-windows))) + ;;;###autoload (autoload 'narf:kill-buried-buffers "defuns-buffers" nil t) (evil-define-command narf:kill-buried-buffers (&optional bang) "Kill buried project buffers (in workgroup) and report how many it found. BANG = get all diff --git a/private/my-commands.el b/private/my-commands.el index b8bbdf0b2..3977ddc36 100644 --- a/private/my-commands.el +++ b/private/my-commands.el @@ -35,7 +35,8 @@ (exmap "k[ill]" 'narf/kill-real-buffer) ; Kill current buffer (exmap "k[ill]all" 'narf:kill-all-buffers) ; Kill all buffers (bang = in project) (exmap "k[ill]buried" 'narf:kill-buried-buffers) ; Kill all buried buffers (bang = in project) -(exmap "k[ill]o" 'narf:kill-unreal-buffers) ; kill unreal buffers +(exmap "k[ill]o" 'narf:kill-other-buffers) ; kill all other buffers +(exmap "k[ill]unreal" 'narf/kill-unreal-buffers) ; kill unreal buffers (exmap "k[ill]match" 'narf:kill-matching-buffers) ; kill buffers that match regexp (exmap "l[ast]" 'narf/popup-last-buffer) ; pop up last popup (exmap "m[sg]" 'narf/popup-messages) ; open *messages* in popup