emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0e355e7: Show Ibuffer and jump to line listing curr


From: Tino Calancha
Subject: [Emacs-diffs] master 0e355e7: Show Ibuffer and jump to line listing current buffer
Date: Mon, 27 Feb 2017 21:49:27 -0500 (EST)

branch: master
commit 0e355e781616936759cff8e6a46adb01760d4211
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>

    Show Ibuffer and jump to line listing current buffer
    
    * lisp/ibuffer.el (ibuffer-jump): New command (Bug#25577).
    ; * etc/NEWS: Add entry for it.
---
 etc/NEWS        | 3 +++
 lisp/ibuffer.el | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index 31b7e47..5b5baff 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -394,6 +394,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',
 'ibuffer-filter-by-starred-name', 'ibuffer-filter-by-modified'
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index eb821b2..66916b2 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]