;;; ido.el --- interactively do things with buffers and files
-;; Copyright (C) 1996-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2015 Free Software Foundation, Inc.
;; Author: Kim F. Storm <storm@cua.dk>
;; Based on: iswitchb by Stephen Eglen <stephen@cns.ed.ac.uk>
(defun ido-time-stamp (&optional time)
;; Time is a floating point number (fractions of 1 hour)
- (setq time (or time (current-time)))
- (/ (+ (* (car time) 65536.0) (car (cdr time))) 3600.0))
+ (/ (float-time time) 3600))
(defun ido-cache-ftp-valid (&optional time)
(and (numberp ido-cache-ftp-work-directory-time)
(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)))
(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'.