comparison lisp/files.el @ 108594:a5969c855306

Don't override standard definition of convert-standard-filename. Add obsolete aliases for dos-fns.el functions. files.el (convert-standard-filename): Call w32-convert-standard-filename and dos-convert-standard-filename on the corresponding systems. w32-fns.el (w32-convert-standard-filename): Rename from convert-standard-filename. Doc fix. dos-fns.el (dos-convert-standard-filename): Doc fix. (convert-standard-filename): Don't defalias. (register-name-alist, make-register, register-value) (set-register-value, intdos): Obsolete aliases for the corresponding dos-* functions and variables. (dos-intdos): Add a doc string.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 15 May 2010 11:31:40 +0300
parents 973b5bc5fcfe
children 511da81b16c5
comparison
equal deleted inserted replaced
108593:5daf8821df70 108594:a5969c855306
572 (and (eq inhibit-file-name-operation op) 572 (and (eq inhibit-file-name-operation op)
573 inhibit-file-name-handlers))) 573 inhibit-file-name-handlers)))
574 (inhibit-file-name-operation op)) 574 (inhibit-file-name-operation op))
575 (apply op args)))) 575 (apply op args))))
576 576
577 (declare-function dos-convert-standard-filename "dos-fns.el" (filename))
578 (declare-function w32-convert-standard-filename "w32-fns.el" (filename))
579
577 (defun convert-standard-filename (filename) 580 (defun convert-standard-filename (filename)
578 "Convert a standard file's name to something suitable for the OS. 581 "Convert a standard file's name to something suitable for the OS.
579 This means to guarantee valid names and perhaps to canonicalize 582 This means to guarantee valid names and perhaps to canonicalize
580 certain patterns. 583 certain patterns.
581 584
589 In the native Windows build, turn Cygwin names into native names, 592 In the native Windows build, turn Cygwin names into native names,
590 and also turn slashes into backslashes if the shell requires it (see 593 and also turn slashes into backslashes if the shell requires it (see
591 `w32-shell-dos-semantics'). 594 `w32-shell-dos-semantics').
592 595
593 See Info node `(elisp)Standard File Names' for more details." 596 See Info node `(elisp)Standard File Names' for more details."
594 (if (eq system-type 'cygwin) 597 (cond
595 (let ((name (copy-sequence filename)) 598 ((eq system-type 'cygwin)
596 (start 0)) 599 (let ((name (copy-sequence filename))
597 ;; Replace invalid filename characters with ! 600 (start 0))
598 (while (string-match "[?*:<>|\"\000-\037]" name start) 601 ;; Replace invalid filename characters with !
599 (aset name (match-beginning 0) ?!) 602 (while (string-match "[?*:<>|\"\000-\037]" name start)
600 (setq start (match-end 0))) 603 (aset name (match-beginning 0) ?!)
601 name) 604 (setq start (match-end 0)))
602 filename)) 605 name))
606 ((eq system-type 'windows-nt)
607 (w32-convert-standard-filename filename))
608 ((eq system-type 'ms-dos)
609 (dos-convert-standard-filename filename))
610 (t filename)))
603 611
604 (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) 612 (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
605 "Read directory name, prompting with PROMPT and completing in directory DIR. 613 "Read directory name, prompting with PROMPT and completing in directory DIR.
606 Value is not expanded---you must call `expand-file-name' yourself. 614 Value is not expanded---you must call `expand-file-name' yourself.
607 Default name to DEFAULT-DIRNAME if user exits with the same 615 Default name to DEFAULT-DIRNAME if user exits with the same