]> git.eshelyaron.com Git - emacs.git/commitdiff
Show Ibuffer and jump to line listing current buffer
authorTino Calancha <tino.calancha@gmail.com>
Tue, 28 Feb 2017 02:47:45 +0000 (11:47 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Tue, 28 Feb 2017 02:47:45 +0000 (11:47 +0900)
* lisp/ibuffer.el (ibuffer-jump): New command (Bug#25577).
; * etc/NEWS: Add entry for it.

etc/NEWS
lisp/ibuffer.el

index 31b7e4789e10df190764af76e01fc3899177a0a3..5b5baff44e10e037f3f0fd2b4f3da5872f01fe74 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -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',
index eb821b257b3bd7e575fc0d815c924176075a3345..66916b2bca1586c0755dd617ef56c0dfef8b1aa2 100644 (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.