Commit 6eaebaa2 authored by Karl Heuer's avatar Karl Heuer
Browse files

Pass operation to find-file-name-handler.

parent 49307295
...@@ -497,7 +497,7 @@ and use this command with a prefix argument (the value does not matter)." ...@@ -497,7 +497,7 @@ and use this command with a prefix argument (the value does not matter)."
;; Compress or uncompress FILE. ;; Compress or uncompress FILE.
;; Return the name of the compressed or uncompressed file. ;; Return the name of the compressed or uncompressed file.
;; Return nil if no change in files. ;; Return nil if no change in files.
(let ((handler (find-file-name-handler file))) (let ((handler (find-file-name-handler file 'dired-compress-file)))
(cond (handler (cond (handler
(funcall handler 'dired-compress-file file)) (funcall handler 'dired-compress-file file))
((file-symlink-p file) ((file-symlink-p file)
......
...@@ -646,7 +646,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." ...@@ -646,7 +646,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
;; Remove directory DIR from any directory cache. ;; Remove directory DIR from any directory cache.
(defun dired-uncache (dir) (defun dired-uncache (dir)
(let ((handler (find-file-name-handler dir))) (let ((handler (find-file-name-handler dir 'dired-uncache)))
(if handler (if handler
(funcall handler 'dired-uncache dir)))) (funcall handler 'dired-uncache dir))))
......
...@@ -321,7 +321,7 @@ This is an interface to the function `load'." ...@@ -321,7 +321,7 @@ This is an interface to the function `load'."
"Copy the file FILE into a temporary file on this machine. "Copy the file FILE into a temporary file on this machine.
Returns the name of the local copy, or nil, if FILE is directly Returns the name of the local copy, or nil, if FILE is directly
accessible." accessible."
(let ((handler (find-file-name-handler file))) (let ((handler (find-file-name-handler file 'file-local-copy)))
(if handler (if handler
(funcall handler 'file-local-copy file) (funcall handler 'file-local-copy file)
nil))) nil)))
...@@ -338,7 +338,7 @@ containing it, until no links are left at any level." ...@@ -338,7 +338,7 @@ containing it, until no links are left at any level."
(setq filename (expand-file-name filename)) (setq filename (expand-file-name filename))
(if (string= filename "") (if (string= filename "")
(setq filename "/")))) (setq filename "/"))))
(let ((handler (find-file-name-handler filename))) (let ((handler (find-file-name-handler filename 'file-truename)))
;; For file name that has a special handler, call handler. ;; For file name that has a special handler, call handler.
;; This is so that ange-ftp can save time by doing a no-op. ;; This is so that ange-ftp can save time by doing a no-op.
(if handler (if handler
...@@ -1326,7 +1326,7 @@ This is a separate procedure so your site-init or startup file can ...@@ -1326,7 +1326,7 @@ This is a separate procedure so your site-init or startup file can
redefine it. redefine it.
If the optional argument KEEP-BACKUP-VERSION is non-nil, If the optional argument KEEP-BACKUP-VERSION is non-nil,
we do not remove backup version numbers, only true file version numbers." we do not remove backup version numbers, only true file version numbers."
(let ((handler (find-file-name-handler name))) (let ((handler (find-file-name-handler name 'file-name-sans-versions)))
(if handler (if handler
(funcall handler 'file-name-sans-versions name keep-backup-version) (funcall handler 'file-name-sans-versions name keep-backup-version)
(substring name 0 (substring name 0
...@@ -1735,7 +1735,7 @@ to create parent directories if they don't exist." ...@@ -1735,7 +1735,7 @@ to create parent directories if they don't exist."
(list (read-file-name "Make directory: " default-directory default-directory (list (read-file-name "Make directory: " default-directory default-directory
nil nil) nil nil)
t)) t))
(let ((handler (find-file-name-handler dir))) (let ((handler (find-file-name-handler dir 'make-directory)))
(if handler (if handler
(funcall handler 'make-directory dir parents) (funcall handler 'make-directory dir parents)
(if (not parents) (if (not parents)
...@@ -2000,7 +2000,7 @@ switches do not contain `d', so that a full listing is expected. ...@@ -2000,7 +2000,7 @@ switches do not contain `d', so that a full listing is expected.
This works by running a directory listing program This works by running a directory listing program
whose name is in the variable `insert-directory-program'. whose name is in the variable `insert-directory-program'.
If WILDCARD, it also runs the shell specified by `shell-file-name'." If WILDCARD, it also runs the shell specified by `shell-file-name'."
(let ((handler (find-file-name-handler file))) (let ((handler (find-file-name-handler file 'insert-directory)))
(if handler (if handler
(funcall handler 'insert-directory file switches (funcall handler 'insert-directory file switches
wildcard full-directory-p) wildcard full-directory-p)
......
...@@ -62,7 +62,7 @@ It does not support ordinary shell wildcards; instead, it allows ...@@ -62,7 +62,7 @@ It does not support ordinary shell wildcards; instead, it allows
regular expressions to match file names. regular expressions to match file names.
The switches that work are: A a c i r S s t u" The switches that work are: A a c i r S s t u"
(let ((handler (find-file-name-handler file))) (let ((handler (find-file-name-handler file 'insert-directory)))
(if handler (if handler
(funcall handler 'insert-directory file switches (funcall handler 'insert-directory file switches
wildcard full-directory-p) wildcard full-directory-p)
......
...@@ -283,7 +283,7 @@ q, \\[keyboard-quit] Leave the command loop. You can come back later with \\[is ...@@ -283,7 +283,7 @@ q, \\[keyboard-quit] Leave the command loop. You can come back later with \\[is
(unwind-protect (unwind-protect
(progn (progn
(cond ((or (null filename) (cond ((or (null filename)
(find-file-name-handler buffer-file-name)) (find-file-name-handler buffer-file-name nil))
(setq filename (make-temp-name "/usr/tmp/ispell")) (setq filename (make-temp-name "/usr/tmp/ispell"))
(setq delete-temp t) (setq delete-temp t)
(write-region (point-min) (point-max) filename)) (write-region (point-min) (point-max) filename))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment