From: Artur Malabarba <bruce.connor.am@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: [PATCH] lisp/ido.el: Define ido-bury-buffer-at-head
Date: Thu, 13 Nov 2014 11:36:30 +0000 [thread overview]
Message-ID: <CAAdUY-Jdv6JZtcoS3Uhhyip1S5OnomiO+OVDWVxAJ17ZZZX-Ng@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 239 bytes --]
Hi all,
I'd like to add the following command to ido, which buries a buffer
with C-S-b analogously to how C-k kills a buffer in ido.
I find burying buffers to be at least as useful as killing them, so it
seems a relevant addition.
Best,
[-- Attachment #2: ido-bury-buffer.patch --]
[-- Type: application/octet-stream, Size: 1587 bytes --]
From 9e15868083f1c45f5274ba3aac698435c6b50c65 Mon Sep 17 00:00:00 2001
From: Artur Malabarba <bruce.connor.am@gmail.com>
Date: Thu, 13 Nov 2014 11:24:07 +0000
Subject: [PATCH] lisp/ido.el: Define ido-bury-buffer-at-head
---
lisp/ido.el | 15 +++++++++++++++
1 file changed, 15 insertions(+)
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'.
--
1.7.12.4
next reply other threads:[~2014-11-13 11:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 11:36 Artur Malabarba [this message]
2014-11-14 5:09 ` [PATCH] lisp/ido.el: Define ido-bury-buffer-at-head Leo Liu
2014-11-14 5:27 ` Leo Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAdUY-Jdv6JZtcoS3Uhhyip1S5OnomiO+OVDWVxAJ17ZZZX-Ng@mail.gmail.com \
--to=bruce.connor.am@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.