Changeset 4166 for trunk/lisp/dnd.el
- Timestamp:
- 09/18/06 20:48:14 (2 years ago)
- Files:
-
- trunk/lisp/dnd.el (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/dnd.el
r4161 r4166 62 62 (defcustom dnd-open-remote-file-function 63 63 (if (eq system-type 'windows-nt) 64 'dnd-open- unc-file64 'dnd-open-local-file 65 65 'dnd-open-remote-url) 66 66 "The function to call when opening a file on a remote machine. … … 68 68 `dnd-open-file' for details. 69 69 If nil, then dragging remote files into Emacs will result in an error. 70 Predefined functions are `dnd-open- unc-file' and `dnd-open-remote-url'.71 `dnd-open- unc-file' attempts to open the file using its UNC name and is the72 default on MS-Windows. `dnd-open-remote-url' uses `url-handler-mode' and 73 is the default except for MS-Windows."70 Predefined functions are `dnd-open-local-file' and `dnd-open-remote-url'. 71 `dnd-open-local-file' attempts to open a remote file using its UNC name and 72 is the default on MS-Windows. `dnd-open-remote-url' uses `url-handler-mode' 73 and is the default except for MS-Windows." 74 74 :version "22.1" 75 75 :type 'function … … 164 164 `dnd-open-file-other-window' is set. URI is the url for the file, 165 165 and must have the format file:file-name or file:///file-name. 166 The last / in file:/// is part of the file name. ACTION is ignored." 166 The last / in file:/// is part of the file name. If the system 167 natively supports unc file names, then remote urls of the form 168 file://server-name/file-name will also be handled by this function. 169 An alternative for systems that do not support unc file names is 170 `dnd-open-remote-url'. ACTION is ignored." 167 171 168 172 (let* ((f (dnd-get-local-file-name uri t))) … … 174 178 'private) 175 179 (error "Can not read %s" uri)))) 176 177 (defun dnd-open-unc-file (uri action)178 "Open a remote file using its unc path.179 The file is opened in the current window, or a new window if180 `dnd-open-file-other-window' is set. URI is the url for the file,181 and must have the format file://hostname/file-name. ACTION is ignored.182 //hostname/file-name is the unc path."183 (let ((unc-file (if (string-match "^file:" uri)184 (substring uri 5))))185 (if (and unc-file (file-readable-p unc-file))186 (progn187 (if dnd-open-file-other-window188 (find-file-other-window unc-file)189 (find-file unc-file))190 'private)191 (error "Invalid file url"))))192 180 193 181 (defun dnd-open-remote-url (uri action)
