Function: iswitchb-kill-buffer

iswitchb-kill-buffer is an interactive and byte-compiled function defined in iswitchb.el.gz.

Signature

(iswitchb-kill-buffer)

Documentation

Kill the buffer at the head of iswitchb-matches.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/iswitchb.el.gz
;;; KILL CURRENT BUFFER

(defun iswitchb-kill-buffer ()
  "Kill the buffer at the head of `iswitchb-matches'."
  (interactive)
  (let ((enable-recursive-minibuffers t)
        buf)

    (setq buf (car iswitchb-matches))
    ;; check to see if buf is non-nil.
    (if buf
	(let ((bufobjs (mapcar (lambda (name)
				 (or (get-buffer name) name))
			       iswitchb-buflist)))
	  (kill-buffer buf)

	  ;; Check if buffer exists.  XEmacs gnuserv.el makes alias
	  ;; for kill-buffer which does not return t if buffer is
	  ;; killed, so we can't rely on kill-buffer return value.
	  (if (get-buffer buf)
	      ;; buffer couldn't be killed.
	      (setq iswitchb-rescan t)
	    ;; Else `kill-buffer' succeeds so re-make the buffer list
	    ;; taking into account packages like uniquify may rename
	    ;; buffers, and try to preserve the ordering of buffers.
	    (setq iswitchb-buflist
		  (delq nil (mapcar (lambda (b)
				      (if (bufferp b)
					  (buffer-name b)
					b))
				    bufobjs))))))))