comparison lisp/iswitchb.el @ 89909:68c22ea6027c

Sync to HEAD
author Kenichi Handa <handa@m17n.org>
date Fri, 16 Apr 2004 12:51:06 +0000
parents 375f2633d815
children 4c90ffeb71c5
comparison
equal deleted inserted replaced
89908:ee1402f7b568 89909:68c22ea6027c
27 ;;; Commentary: 27 ;;; Commentary:
28 28
29 ;; Installation: 29 ;; Installation:
30 ;; To get the functions in this package bound to keys, use 30 ;; To get the functions in this package bound to keys, use
31 ;; M-x iswitchb-mode or customize the option `iswitchb-mode'. 31 ;; M-x iswitchb-mode or customize the option `iswitchb-mode'.
32 ;; Alternatively, add the following line to your .emacs:
33 ;; (iswitchb-mode 1)
32 34
33 ;; As you type in a substring, the list of buffers currently matching 35 ;; As you type in a substring, the list of buffers currently matching
34 ;; the substring is displayed as you type. The list is ordered so 36 ;; the substring is displayed as you type. The list is ordered so
35 ;; that the most recent buffers visited come at the start of the list. 37 ;; that the most recent buffers visited come at the start of the list.
36 ;; The buffer at the start of the list will be the one visited when 38 ;; The buffer at the start of the list will be the one visited when
373 375
374 (defcustom iswitchb-minibuffer-setup-hook nil 376 (defcustom iswitchb-minibuffer-setup-hook nil
375 "Iswitchb-specific customization of minibuffer setup. 377 "Iswitchb-specific customization of minibuffer setup.
376 378
377 This hook is run during minibuffer setup iff `iswitchb' will be active. 379 This hook is run during minibuffer setup iff `iswitchb' will be active.
378 It is intended for use in customizing iswitchb for interoperation 380 For instance:
379 with other packages." 381 \(add-hook 'iswitchb-minibuffer-setup-hook
380 ;;; For instance: 382 '\(lambda () (set (make-local-variable 'max-mini-window-height) 3)))
381 383 will constrain the minibuffer to a maximum height of 3 lines when
382 ;;; \(add-hook 'iswitchb-minibuffer-setup-hook 384 iswitchb is running."
383 ;;; \(function
384 ;;; \(lambda ()
385 ;;; \(make-local-variable 'resize-minibuffer-window-max-height)
386 ;;; \(setq resize-minibuffer-window-max-height 3))))
387
388 ;;; will constrain rsz-mini to a maximum minibuffer height of 3 lines when
389 ;;; iswitchb is running. Copied from `icomplete-minibuffer-setup-hook'."
390 :type 'hook 385 :type 'hook
391 :group 'iswitchb) 386 :group 'iswitchb)
392 387
393 ;; Do we need the variable iswitchb-use-mycompletion? 388 ;; Do we need the variable iswitchb-use-mycompletion?
394 389
606 '(("dummy" . 1)) ;table 601 '(("dummy" . 1)) ;table
607 nil ;predicate 602 nil ;predicate
608 nil ;require-match [handled elsewhere] 603 nil ;require-match [handled elsewhere]
609 nil ;initial-contents 604 nil ;initial-contents
610 'iswitchb-history))) 605 'iswitchb-history)))
611 (if (get-buffer iswitchb-final-text) 606 (if (and (not (eq iswitchb-exit 'usefirst))
607 (get-buffer iswitchb-final-text))
612 ;; This happens for example if the buffer was chosen with the mouse. 608 ;; This happens for example if the buffer was chosen with the mouse.
613 (setq iswitchb-matches (list iswitchb-final-text))) 609 (setq iswitchb-matches (list iswitchb-final-text)))
614 610
615 ;; Handling the require-match must be done in a better way. 611 ;; Handling the require-match must be done in a better way.
616 (if (and require-match (not (iswitchb-existing-buffer-p))) 612 (if (and require-match (not (iswitchb-existing-buffer-p)))
708 (defun iswitchb-exit-minibuffer () 704 (defun iswitchb-exit-minibuffer ()
709 "Exit minibuffer, but make sure we have a match if one is needed." 705 "Exit minibuffer, but make sure we have a match if one is needed."
710 (interactive) 706 (interactive)
711 (if (or (not iswitchb-require-match) 707 (if (or (not iswitchb-require-match)
712 (iswitchb-existing-buffer-p)) 708 (iswitchb-existing-buffer-p))
713 (throw 'exit nil))) 709 (progn
710 (setq iswitchb-exit 'usefirst)
711 (throw 'exit nil))))
714 712
715 (defun iswitchb-select-buffer-text () 713 (defun iswitchb-select-buffer-text ()
716 "Select the buffer named by the prompt. 714 "Select the buffer named by the prompt.
717 If no buffer exactly matching the prompt exists, maybe create a new one." 715 If no buffer exactly matching the prompt exists, maybe create a new one."
718 (interactive) 716 (interactive)
1344 (add-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup) 1342 (add-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)
1345 (remove-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup))) 1343 (remove-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)))
1346 1344
1347 (provide 'iswitchb) 1345 (provide 'iswitchb)
1348 1346
1347 ;;; arch-tag: d74198ae-753f-44f2-b34f-0c515398d90a
1349 ;;; iswitchb.el ends here 1348 ;;; iswitchb.el ends here