changeset 4186:45fc16fdf07e

(ange-ftp-completion-hook-function): New function.
author Richard M. Stallman <rms@gnu.org>
date Tue, 20 Jul 1993 07:12:30 +0000
parents 05a314aafd74
children b3df9c7072bb
files lisp/files.el
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Tue Jul 20 07:12:00 1993 +0000
+++ b/lisp/files.el	Tue Jul 20 07:12:30 1993 +0000
@@ -229,6 +229,16 @@
     (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))))
 
 (defun pwd ()
   "Show the current default directory."