diff options
| author | Eli Zaretskii | 2010-05-15 11:31:40 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-05-15 11:31:40 +0300 |
| commit | 98d8b17e45bb1246df61e51f8917b98faa9f1cdd (patch) | |
| tree | 392c21e9c3856e786d0fef88b7baa77f6080a23d | |
| parent | 78248b76e396d96a7c7c25ae91296e31fee558da (diff) | |
| download | emacs-98d8b17e45bb1246df61e51f8917b98faa9f1cdd.tar.gz emacs-98d8b17e45bb1246df61e51f8917b98faa9f1cdd.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/dos-fns.el | 35 | ||||
| -rw-r--r-- | lisp/files.el | 26 | ||||
| -rw-r--r-- | lisp/w32-fns.el | 13 |
4 files changed, 66 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aed1fbc64d0..760e373d095 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2010-05-15 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | Don't override standard definition of convert-standard-filename. | ||
| 4 | * files.el (convert-standard-filename): Call | ||
| 5 | w32-convert-standard-filename and dos-convert-standard-filename on | ||
| 6 | the corresponding systems. | ||
| 7 | |||
| 8 | * w32-fns.el (w32-convert-standard-filename): Rename from | ||
| 9 | convert-standard-filename. Doc fix. | ||
| 10 | |||
| 11 | * dos-fns.el (dos-convert-standard-filename): Doc fix. | ||
| 12 | (convert-standard-filename): Don't defalias. | ||
| 13 | (register-name-alist, make-register, register-value) | ||
| 14 | (set-register-value, intdos): Obsolete aliases for the | ||
| 15 | corresponding dos-* functions and variables. | ||
| 16 | (dos-intdos): Add a doc string. | ||
| 17 | |||
| 1 | 2010-05-15 Jay Belanger <jay.p.belanger@gmail.com> | 18 | 2010-05-15 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 19 | ||
| 3 | * calc/calc-aent.el (math-read-token, math-find-user-tokens): | 20 | * calc/calc-aent.el (math-read-token, math-find-user-tokens): |
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el index 5834afae8bc..e343446a366 100644 --- a/lisp/dos-fns.el +++ b/lisp/dos-fns.el | |||
| @@ -30,16 +30,16 @@ | |||
| 30 | (declare-function int86 "dosfns.c") | 30 | (declare-function int86 "dosfns.c") |
| 31 | (declare-function msdos-long-file-names "msdos.c") | 31 | (declare-function msdos-long-file-names "msdos.c") |
| 32 | 32 | ||
| 33 | ;; This overrides a trivial definition in files.el. | 33 | ;; See convert-standard-filename in files.el. |
| 34 | (defun dos-convert-standard-filename (filename) | 34 | (defun dos-convert-standard-filename (filename) |
| 35 | "Convert a standard file's name to something suitable for the current OS. | 35 | "Convert a standard file's name to something suitable for MS-DOS. |
| 36 | This means to guarantee valid names and perhaps to canonicalize | 36 | This means to guarantee valid names and perhaps to canonicalize |
| 37 | certain patterns. | 37 | certain patterns. |
| 38 | 38 | ||
| 39 | This function is called by `convert-standard-filename'. | ||
| 40 | |||
| 39 | On Windows and DOS, replace invalid characters. On DOS, make | 41 | On Windows and DOS, replace invalid characters. On DOS, make |
| 40 | sure to obey the 8.3 limitations. On Windows, turn Cygwin names | 42 | sure to obey the 8.3 limitations." |
| 41 | into native names, and also turn slashes into backslashes if the | ||
| 42 | shell requires it (see `w32-shell-dos-semantics')." | ||
| 43 | (if (or (not (stringp filename)) | 43 | (if (or (not (stringp filename)) |
| 44 | ;; This catches the case where FILENAME is "x:" or "x:/" or | 44 | ;; This catches the case where FILENAME is "x:" or "x:/" or |
| 45 | ;; "/", thus preventing infinite recursion. | 45 | ;; "/", thus preventing infinite recursion. |
| @@ -128,11 +128,6 @@ shell requires it (see `w32-shell-dos-semantics')." | |||
| 128 | (dos-convert-standard-filename dir)) | 128 | (dos-convert-standard-filename dir)) |
| 129 | string)))))) | 129 | string)))))) |
| 130 | 130 | ||
| 131 | ;; Only redirect convert-standard-filename if it has a chance of working, | ||
| 132 | ;; otherwise loading dos-fns.el might make your non-DOS Emacs misbehave. | ||
| 133 | (when (fboundp 'msdos-long-file-names) | ||
| 134 | (defalias 'convert-standard-filename 'dos-convert-standard-filename)) | ||
| 135 | |||
| 136 | (defun dos-8+3-filename (filename) | 131 | (defun dos-8+3-filename (filename) |
| 137 | "Truncate FILENAME to DOS 8+3 limits." | 132 | "Truncate FILENAME to DOS 8+3 limits." |
| 138 | (if (or (not (stringp filename)) | 133 | (if (or (not (stringp filename)) |
| @@ -243,9 +238,14 @@ returned unaltered." | |||
| 243 | (al . (0 . 0)) (bl . (1 . 0)) (cl . (2 . 0)) (dl . (3 . 0)) | 238 | (al . (0 . 0)) (bl . (1 . 0)) (cl . (2 . 0)) (dl . (3 . 0)) |
| 244 | (ah . (0 . 1)) (bh . (1 . 1)) (ch . (2 . 1)) (dh . (3 . 1)))) | 239 | (ah . (0 . 1)) (bh . (1 . 1)) (ch . (2 . 1)) (dh . (3 . 1)))) |
| 245 | 240 | ||
| 241 | (define-obsolete-variable-alias | ||
| 242 | 'register-name-alist 'dos-register-name-alist "24.1") | ||
| 243 | |||
| 246 | (defun dos-make-register () | 244 | (defun dos-make-register () |
| 247 | (make-vector 8 0)) | 245 | (make-vector 8 0)) |
| 248 | 246 | ||
| 247 | (define-obsolete-function-alias 'make-register 'dos-make-register "24.1") | ||
| 248 | |||
| 249 | (defun dos-register-value (regs name) | 249 | (defun dos-register-value (regs name) |
| 250 | (let ((where (cdr (assoc name dos-register-name-alist)))) | 250 | (let ((where (cdr (assoc name dos-register-name-alist)))) |
| 251 | (cond ((consp where) | 251 | (cond ((consp where) |
| @@ -257,6 +257,8 @@ returned unaltered." | |||
| 257 | (aref regs where)) | 257 | (aref regs where)) |
| 258 | (t nil)))) | 258 | (t nil)))) |
| 259 | 259 | ||
| 260 | (define-obsolete-function-alias 'register-value 'dos-register-value "24.1") | ||
| 261 | |||
| 260 | (defun dos-set-register-value (regs name value) | 262 | (defun dos-set-register-value (regs name value) |
| 261 | (and (numberp value) | 263 | (and (numberp value) |
| 262 | (>= value 0) | 264 | (>= value 0) |
| @@ -273,9 +275,18 @@ returned unaltered." | |||
| 273 | (aset regs where (logand value 65535)))))) | 275 | (aset regs where (logand value 65535)))))) |
| 274 | regs) | 276 | regs) |
| 275 | 277 | ||
| 278 | (define-obsolete-function-alias | ||
| 279 | 'set-register-value 'dos-set-register-value "24.1") | ||
| 280 | |||
| 276 | (defsubst dos-intdos (regs) | 281 | (defsubst dos-intdos (regs) |
| 282 | "Issue the DOS Int 21h with registers REGS. | ||
| 283 | |||
| 284 | REGS should be a vector produced by `dos-make-register' | ||
| 285 | and `dos-set-register-value', which see." | ||
| 277 | (int86 33 regs)) | 286 | (int86 33 regs)) |
| 278 | 287 | ||
| 288 | (define-obsolete-function-alias 'intdos 'dos-intdos "24.1") | ||
| 289 | |||
| 279 | ;; Backward compatibility for obsolescent functions which | 290 | ;; Backward compatibility for obsolescent functions which |
| 280 | ;; set screen size. | 291 | ;; set screen size. |
| 281 | 292 | ||
| @@ -284,6 +295,8 @@ returned unaltered." | |||
| 284 | (interactive) | 295 | (interactive) |
| 285 | (set-frame-size (selected-frame) 80 25)) | 296 | (set-frame-size (selected-frame) 80 25)) |
| 286 | 297 | ||
| 298 | (define-obsolete-function-alias 'mode25 'dos-mode25 "24.1") | ||
| 299 | |||
| 287 | (defun dos-mode4350 () | 300 | (defun dos-mode4350 () |
| 288 | "Changes the number of rows to 43 or 50. | 301 | "Changes the number of rows to 43 or 50. |
| 289 | Emacs always tries to set the screen height to 50 rows first. | 302 | Emacs always tries to set the screen height to 50 rows first. |
| @@ -295,6 +308,8 @@ that your video hardware might not support 50-line mode." | |||
| 295 | nil ; the original built-in function returned nil | 308 | nil ; the original built-in function returned nil |
| 296 | (set-frame-size (selected-frame) 80 43))) | 309 | (set-frame-size (selected-frame) 80 43))) |
| 297 | 310 | ||
| 311 | (define-obsolete-function-alias 'mode4350 'dos-mode4350 "24.1") | ||
| 312 | |||
| 298 | (provide 'dos-fns) | 313 | (provide 'dos-fns) |
| 299 | 314 | ||
| 300 | ;; arch-tag: 00b03579-8ebb-4a02-8762-5c5a929774ad | 315 | ;; arch-tag: 00b03579-8ebb-4a02-8762-5c5a929774ad |
diff --git a/lisp/files.el b/lisp/files.el index 83ae91dd63a..d4c05bdc5d6 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -574,6 +574,9 @@ Runs the usual ange-ftp hook, but only for completion operations." | |||
| 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 |
| @@ -591,15 +594,20 @@ 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. |
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index efdf26b529c..0b97b184d22 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el | |||
| @@ -253,15 +253,16 @@ You should set this to t when using a non-system shell.\n\n")))) | |||
| 253 | ;; (setq source-directory (file-name-as-directory | 253 | ;; (setq source-directory (file-name-as-directory |
| 254 | ;; (expand-file-name ".." exec-directory))))) | 254 | ;; (expand-file-name ".." exec-directory))))) |
| 255 | 255 | ||
| 256 | (defun convert-standard-filename (filename) | 256 | (defun w32-convert-standard-filename (filename) |
| 257 | "Convert a standard file's name to something suitable for the current OS. | 257 | "Convert a standard file's name to something suitable for the MS-Windows. |
| 258 | This means to guarantee valid names and perhaps to canonicalize | 258 | This means to guarantee valid names and perhaps to canonicalize |
| 259 | certain patterns. | 259 | certain patterns. |
| 260 | 260 | ||
| 261 | On Windows and DOS, replace invalid characters. On DOS, make | 261 | This function is called by `convert-standard-filename'. |
| 262 | sure to obey the 8.3 limitations. On Windows, turn Cygwin names | 262 | |
| 263 | into native names, and also turn slashes into backslashes if the | 263 | Replace invalid characters and turn Cygwin names into native |
| 264 | shell requires it (see `w32-shell-dos-semantics')." | 264 | names, and also turn slashes into backslashes if the shell |
| 265 | requires it (see `w32-shell-dos-semantics')." | ||
| 265 | (save-match-data | 266 | (save-match-data |
| 266 | (let ((name | 267 | (let ((name |
| 267 | (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename) | 268 | (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename) |