Show Ibuffer and jump to line listing current buffer

* lisp/ibuffer.el (ibuffer-jump): New command (Bug#25577).
; * etc/NEWS: Add entry for it.
This commit is contained in:
Tino Calancha 2017-02-28 11:47:45 +09:00
parent 499b43d4cc
commit 0e355e7816
2 changed files with 12 additions and 0 deletions

View file

@ -393,6 +393,9 @@ added: 'C-c C-s C-m C-m'.
** Ibuffer
---
*** New command 'ibuffer-jump'.
---
*** New filter commands 'ibuffer-filter-by-basename',
'ibuffer-filter-by-file-extension', 'ibuffer-filter-by-directory',

View file

@ -2491,6 +2491,15 @@ FORMATS is the value to use for `ibuffer-formats'.
(unless ibuffer-expert
(message "Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help"))))))
;;;###autoload
(defun ibuffer-jump (&optional other-window)
"Call Ibuffer and set point at the line listing the current buffer.
If optional arg OTHER-WINDOW is non-nil, then use another window."
(interactive "P")
(let ((name (buffer-name)))
(ibuffer other-window)
(ignore-errors (ibuffer-jump-to-buffer name))))
(put 'ibuffer-mode 'mode-class 'special)
(define-derived-mode ibuffer-mode special-mode "IBuffer"
"A major mode for viewing a list of buffers.