emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 01/01: lisp/ido.el: New command `ido-bury-buffer-at


From: Artur Malabarba
Subject: [Emacs-diffs] master 01/01: lisp/ido.el: New command `ido-bury-buffer-at-head'
Date: Wed, 19 Nov 2014 00:48:06 +0000

branch: master
commit 6316435de740af0dce794740ba05382664c806f2
Author: Artur Malabarba <address@hidden>
Date:   Wed Nov 19 00:47:36 2014 +0000

    lisp/ido.el: New command `ido-bury-buffer-at-head'
    
    Bound to C-S-b
    Bury the buffer at the head of `ido-matches', analogous to how C-k
    kills the buffer at head.
---
 etc/NEWS    |    4 ++++
 lisp/ido.el |   15 +++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 41b9324..c319a09 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -132,6 +132,10 @@ Unicode standards.
 
 
 * Changes in Specialized Modes and Packages in Emacs 25.1
+** ido
+*** New command `ido-bury-buffer-at-head' bound to C-S-b
+Bury the buffer at the head of `ido-matches', analogous to how C-k
+kills the buffer at head.
 
 ** Minibuffer
 
diff --git a/lisp/ido.el b/lisp/ido.el
index bda2525..5f7637c 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1672,6 +1672,7 @@ This function also adds a hook to the minibuffer."
     (define-key map "\C-x\C-f" 'ido-enter-find-file)
     (define-key map "\C-x\C-b" 'ido-fallback-command)
     (define-key map "\C-k" 'ido-kill-buffer-at-head)
+    (define-key map [?\C-\S-b] 'ido-bury-buffer-at-head)
     (define-key map "\C-o" 'ido-toggle-virtual-buffers)
     (set-keymap-parent map ido-common-completion-map)
     (setq ido-buffer-completion-map map)))
@@ -4026,6 +4027,20 @@ If cursor is not at the end of the user input, delete to 
end of input."
        (setq ido-cur-list (delete buf ido-cur-list))
        (setq ido-rescan t))))))
 
+;;; BURY CURRENT BUFFER
+(defun ido-bury-buffer-at-head ()
+  "Bury the buffer at the head of `ido-matches'."
+  (interactive)
+  (let ((enable-recursive-minibuffers t)
+        (buf (ido-name (car ido-matches)))
+        (nextbuf (cadr ido-matches)))
+    (when (get-buffer buf)
+      (bury-buffer buf)
+      (setq ido-default-item nextbuf
+            ido-text-init ido-text
+            ido-exit 'refresh)
+      (exit-minibuffer))))
+
 ;;; DELETE CURRENT FILE
 (defun ido-delete-file-at-head ()
   "Delete the file at the head of `ido-matches'.



reply via email to

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