changeset 41273:793fceb3e6de

(iswitchb-cannot-complete-hook): New variable to control behaviour when no further completion is possible.
author Richard M. Stallman <rms@gnu.org>
date Mon, 19 Nov 2001 14:08:49 +0000
parents 8156b5a21c30
children 8814f47be264
files lisp/iswitchb.el
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/iswitchb.el	Mon Nov 19 07:44:56 2001 +0000
+++ b/lisp/iswitchb.el	Mon Nov 19 14:08:49 2001 +0000
@@ -271,6 +271,14 @@
   :type '(repeat regexp)
   :group 'iswitchb)
 
+(defcustom iswitchb-cannot-complete-hook 'iswitchb-completion-help
+  "*Hook run when `iswitchb-complete' can't complete any more.
+The most useful values are `iswitchb-completion-help', which pops up a
+window with completion alternatives, or `iswitchb-next-match' or
+`iswitchb-prev-match', which cycle the buffer list."
+  :type 'hook
+  :group 'iswitchb)
+
 ;;; Examples for setting the value of iswitchb-buffer-ignore
 ;(defun iswitchb-ignore-c-mode (name)
 ;  "Ignore all c mode buffers -- example function for iswitchb."
@@ -632,7 +640,7 @@
   (interactive)
   (let (res)
     (cond ((not  iswitchb-matches)
-	   (iswitchb-completion-help))
+	   (run-hooks 'iswitchb-cannot-complete-hook))
 	  
 	  ((= 1 (length iswitchb-matches))
 	   ;; only one choice, so select it.
@@ -649,7 +657,7 @@
 		 (delete-region (minibuffer-prompt-end) (point))
 		 (insert  res))
 	     ;; else nothing to complete
-	     (iswitchb-completion-help)
+	     (run-hooks 'iswitchb-cannot-complete-hook)
 	     )))))
 
 ;;; TOGGLE FUNCTIONS