Show
Ignore:
Timestamp:
09/18/06 20:48:14 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/dnd.el

    r4161 r4166  
    6262(defcustom dnd-open-remote-file-function 
    6363  (if (eq system-type 'windows-nt) 
    64       'dnd-open-unc-file 
     64      'dnd-open-local-file 
    6565    'dnd-open-remote-url) 
    6666  "The function to call when opening a file on a remote machine. 
     
    6868`dnd-open-file' for details. 
    6969If 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 the  
    72 default on MS-Windows.  `dnd-open-remote-url' uses `url-handler-mode' and 
    73 is the default except for MS-Windows." 
     70Predefined 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 
     72is the  default on MS-Windows.  `dnd-open-remote-url' uses `url-handler-mode' 
     73and is the default except for MS-Windows." 
    7474  :version "22.1" 
    7575  :type 'function 
     
    164164`dnd-open-file-other-window' is set.  URI is the url for the file, 
    165165and 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." 
     166The last / in file:/// is part of the file name.  If the system 
     167natively supports unc file names, then remote urls of the form 
     168file://server-name/file-name will also be handled by this function. 
     169An alternative for systems that do not support unc file names is 
     170`dnd-open-remote-url'. ACTION is ignored." 
    167171 
    168172  (let* ((f (dnd-get-local-file-name uri t))) 
     
    174178          'private) 
    175179      (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 if 
    180 `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         (progn 
    187           (if dnd-open-file-other-window 
    188               (find-file-other-window unc-file) 
    189             (find-file unc-file)) 
    190           'private) 
    191       (error "Invalid file url")))) 
    192180 
    193181(defun dnd-open-remote-url (uri action)