]> git.eshelyaron.com Git - emacs.git/commitdiff
(ange-ftp-completion-hook-function): New function.
authorRichard M. Stallman <rms@gnu.org>
Tue, 20 Jul 1993 07:12:30 +0000 (07:12 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 20 Jul 1993 07:12:30 +0000 (07:12 +0000)
lisp/files.el

index aefc4fa4e880392aa404216b7fe6a5a2e41782de..5ed1ad4b7ab0906e3eaa1ae29d23c5755a8548d2 100644 (file)
@@ -229,6 +229,16 @@ and ignores this variable.")
     (defalias 'lock-buffer 'ignore))
 (or (fboundp 'unlock-buffer)
     (defalias 'unlock-buffer 'ignore))
+
+;; This hook function provides support for ange-ftp host name
+;; completion.  It runs the usual ange-ftp hook, but only for
+;; completion operations.  Having this here avoids the need
+;; to load ange-ftp when it's not really in use.
+(defun ange-ftp-completion-hook-function (op &rest args)
+  (if (memq op '(file-name-completion file-name-all-completions))
+      (apply 'ange-ftp-hook-function op args)
+    (let (file-name-handler-alist)
+      (apply op args))))
 \f
 (defun pwd ()
   "Show the current default directory."