changeset 105741:90bde63d7310

(file-cache-completions-keymap): Bind mouse-2 to file-cache-choose-completion. (file-cache-choose-completion): Handle an optional event argument. (file-cache-mouse-choose-completion): Make it an obsolete alias.
author Glenn Morris <rgm@gnu.org>
date Sat, 24 Oct 2009 03:51:51 +0000
parents f6fc3559bd1d
children 97655a0c7e67
files lisp/ChangeLog lisp/filecache.el
diffstat 2 files changed, 16 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Oct 24 03:50:20 2009 +0000
+++ b/lisp/ChangeLog	Sat Oct 24 03:51:51 2009 +0000
@@ -4,6 +4,11 @@
 	* term.el (term-dynamic-list-completions): Use choose-completion rather
 	than obsolete alias mouse-choose-completion.
 
+	* filecache.el (file-cache-completions-keymap): Bind mouse-2 to
+	file-cache-choose-completion.
+	(file-cache-choose-completion): Handle an optional event argument.
+	(file-cache-mouse-choose-completion): Make it an obsolete alias.
+
 	* progmodes/octave-mod.el (octave-complete-symbol): Use
 	choose-completion if mouse-choose-completion is ever removed.
 
--- a/lisp/filecache.el	Sat Oct 24 03:50:20 2009 +0000
+++ b/lisp/filecache.el	Sat Oct 24 03:51:51 2009 +0000
@@ -1,11 +1,11 @@
 ;;; filecache.el --- find files using a pre-loaded cache
-;;
+
+;; Copyright (C) 1996, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+;;   2008, 2009  Free Software Foundation, Inc.
+
 ;; Author:  Peter Breton <pbreton@cs.umb.edu>
 ;; Created: Sun Nov 10 1996
 ;; Keywords: convenience
-;;
-;; Copyright (C) 1996, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -260,7 +260,7 @@
 (defvar file-cache-completions-keymap
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map completion-list-mode-map)
-    (define-key map [mouse-2] 'file-cache-mouse-choose-completion)
+    (define-key map [mouse-2] 'file-cache-choose-completion)
     (define-key map "\C-m" 'file-cache-choose-completion)
     map)
   "Keymap for file cache completions buffer.")
@@ -655,25 +655,16 @@
   (with-current-buffer standard-output ;; i.e. file-cache-completions-buffer
     (use-local-map file-cache-completions-keymap)))
 
-(defun file-cache-choose-completion  ()
+(defun file-cache-choose-completion (&optional event)
   "Choose a completion in the `*Completions*' buffer."
-  (interactive)
+  (interactive (list last-nonmenu-event))
   (let ((completion-no-auto-exit t))
-    (choose-completion)
+    (choose-completion event)
     (select-window (active-minibuffer-window))
-    (file-cache-minibuffer-complete nil)
-    )
-  )
+    (file-cache-minibuffer-complete nil)))
 
-(defun file-cache-mouse-choose-completion  (event)
-  "Choose a completion with the mouse."
-  (interactive "e")
-  (let ((completion-no-auto-exit t))
-    (mouse-choose-completion event)
-    (select-window (active-minibuffer-window))
-    (file-cache-minibuffer-complete nil)
-    )
-  )
+(define-obsolete-function-alias 'file-cache-mouse-choose-completion
+  'file-cache-choose-completion "23.2")
 
 (defun file-cache-complete  ()
   "Complete the word at point, using the filecache."