changeset 62915:b89e30bcd2bb

Changed all uses of `directory-sep-char' to ?/, and all uses of `string-to-int' to `string-to-number'.
author John Wiegley <johnw@newartisans.com>
date Tue, 31 May 2005 00:14:26 +0000
parents 6c8a535adaf3
children f093607aa05a
files lisp/eshell/em-cmpl.el lisp/eshell/em-dirs.el lisp/eshell/em-glob.el lisp/eshell/em-unix.el lisp/eshell/esh-ext.el lisp/eshell/esh-io.el lisp/eshell/esh-util.el lisp/eshell/esh-var.el
diffstat 8 files changed, 20 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/eshell/em-cmpl.el	Tue May 31 00:13:51 2005 +0000
+++ b/lisp/eshell/em-cmpl.el	Tue May 31 00:14:26 2005 +0000
@@ -136,8 +136,7 @@
   :type (get 'pcomplete-file-ignore 'custom-type)
   :group 'eshell-cmpl)
 
-(defcustom eshell-cmpl-dir-ignore
-  (format "\\`\\(\\.\\.?\\|CVS\\)%c\\'" directory-sep-char)
+(defcustom eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\)/\\'"
   (documentation-property 'pcomplete-dir-ignore
 			  'variable-documentation)
   :type (get 'pcomplete-dir-ignore 'custom-type)
@@ -155,7 +154,7 @@
   :type (get 'pcomplete-autolist 'custom-type)
   :group 'eshell-cmpl)
 
-(defcustom eshell-cmpl-suffix-list (list directory-sep-char ?:)
+(defcustom eshell-cmpl-suffix-list (list ?/ ?:)
   (documentation-property 'pcomplete-suffix-list
 			  'variable-documentation)
   :type (get 'pcomplete-suffix-list 'custom-type)
--- a/lisp/eshell/em-dirs.el	Tue May 31 00:13:51 2005 +0000
+++ b/lisp/eshell/em-dirs.el	Tue May 31 00:14:26 2005 +0000
@@ -276,8 +276,7 @@
     (let* ((letter (match-string 1))
 	   (regexp (concat "\\`" letter))
 	   (path (eshell-find-previous-directory regexp)))
-      (concat (or path letter)
-	      (char-to-string directory-sep-char)))))
+      (concat (or path letter) "/"))))
 
 (defun eshell-complete-user-reference ()
   "If there is a user reference, complete it."
@@ -300,7 +299,7 @@
   (let* ((path default-directory)
 	 (len (length path)))
     (if (and (> len 1)
-	     (eq (aref path (1- len)) directory-sep-char)
+	     (eq (aref path (1- len)) ?/)
 	     (not (and (eshell-under-windows-p)
 		       (string-match "\\`[A-Za-z]:[\\\\/]\\'" path))))
 	(setq path (substring path 0 (1- (length path)))))
@@ -324,9 +323,7 @@
 	   (len (length extra-dots))
 	   replace-text)
       (while (> len 0)
-	(setq replace-text
-	      (concat replace-text
-		      (char-to-string directory-sep-char) "..")
+	(setq replace-text (concat replace-text "/..")
 	      len (1- len)))
       (setq path
 	    (replace-match replace-text t t path 1))))
@@ -371,7 +368,7 @@
 	(setq path
 	      (ring-remove eshell-last-dir-ring
 			   (if index
-			       (string-to-int index)
+			       (string-to-number index)
 			     0)))))
      ((and path (string-match "^=\\(.*\\)$" path))
       (let ((oldpath (eshell-find-previous-directory
--- a/lisp/eshell/em-glob.el	Tue May 31 00:13:51 2005 +0000
+++ b/lisp/eshell/em-glob.el	Tue May 31 00:14:26 2005 +0000
@@ -265,9 +265,6 @@
   (defvar matches)
   (defvar message-shown))
 
-;; jww (1999-11-18): this function assumes that directory-sep-char is
-;; a forward slash (/)
-
 (defun eshell-glob-entries (path globs &optional recurse-p)
   "Glob the entries in PATHS, possibly recursing if RECURSE-P is non-nil."
   (let* ((entries (ignore-errors
@@ -303,11 +300,11 @@
     ;; can't use `directory-file-name' because it strips away text
     ;; properties in the string
     (let ((len (1- (length incl))))
-      (if (eq (aref incl len) directory-sep-char)
+      (if (eq (aref incl len) ?/)
 	  (setq incl (substring incl 0 len)))
       (when excl
 	(setq len (1- (length excl)))
-	(if (eq (aref excl len) directory-sep-char)
+	(if (eq (aref excl len) ?/)
 	    (setq excl (substring excl 0 len)))))
     (setq incl (eshell-glob-regexp incl)
 	  excl (and excl (eshell-glob-regexp excl)))
@@ -329,7 +326,7 @@
     (while entries
       (setq name (car entries)
 	    len (length name)
-	    isdir (eq (aref name (1- len)) directory-sep-char))
+	    isdir (eq (aref name (1- len)) ?/))
       (if (let ((fname (directory-file-name name)))
 	    (and (not (and excl (string-match excl fname)))
 		 (string-match incl fname)))
--- a/lisp/eshell/em-unix.el	Tue May 31 00:13:51 2005 +0000
+++ b/lisp/eshell/em-unix.el	Tue May 31 00:14:26 2005 +0000
@@ -877,7 +877,7 @@
        (unless by-bytes
 	 (setq block-size (or block-size 1024)))
        (if (and max-depth (stringp max-depth))
-	   (setq max-depth (string-to-int max-depth)))
+	   (setq max-depth (string-to-number max-depth)))
        ;; filesystem support means nothing under Windows
        (if (eshell-under-windows-p)
 	   (setq only-one-filesystem nil))
--- a/lisp/eshell/esh-ext.el	Tue May 31 00:13:51 2005 +0000
+++ b/lisp/eshell/esh-ext.el	Tue May 31 00:14:26 2005 +0000
@@ -103,7 +103,7 @@
   "Invoke a .BAT or .CMD file on DOS/Windows systems."
   ;; since CMD.EXE can't handle forward slashes in the initial
   ;; argument...
-  (setcar args (subst-char-in-string directory-sep-char ?\\ (car args)))
+  (setcar args (subst-char-in-string ?/ ?\\ (car args)))
   (throw 'eshell-replace-command
 	 (eshell-parse-command eshell-windows-shell-file (cons "/c" args))))
 
--- a/lisp/eshell/esh-io.el	Tue May 31 00:13:51 2005 +0000
+++ b/lisp/eshell/esh-io.el	Tue May 31 00:14:26 2005 +0000
@@ -192,7 +192,7 @@
 	  (eshell-finish-arg
 	   (prog1
 	       (list 'eshell-set-output-handle
-		     (or (and sh (string-to-int sh)) 1)
+		     (or (and sh (string-to-number sh)) 1)
 		     (list 'quote
 			   (aref [overwrite append insert]
 				 (1- (length oper)))))
--- a/lisp/eshell/esh-util.el	Tue May 31 00:13:51 2005 +0000
+++ b/lisp/eshell/esh-util.el	Tue May 31 00:14:26 2005 +0000
@@ -253,14 +253,13 @@
 	parts)
     (if (and (eshell-under-windows-p)
 	     (> len 2)
-	     (eq (aref path 0) directory-sep-char)
-	     (eq (aref path 1) directory-sep-char))
+	     (eq (aref path 0) ?/)
+	     (eq (aref path 1) ?/))
 	(setq i 2))
     (while (< i len)
-      (if (and (eq (aref path i) directory-sep-char)
+      (if (and (eq (aref path i) ?/)
 	       (not (get-text-property i 'escaped path)))
-	  (setq parts (cons (if (= li i)
-				(char-to-string directory-sep-char)
+	  (setq parts (cons (if (= li i) "/"
 			      (substring path li (1+ i))) parts)
 		li (1+ i)))
       (setq i (1+ i)))
@@ -268,9 +267,7 @@
 	(setq parts (cons (substring path li i) parts)))
     (if (and (eshell-under-windows-p)
 	     (string-match "\\`[A-Za-z]:\\'" (car (last parts))))
-	(setcar (last parts)
-		(concat (car (last parts))
-			(char-to-string directory-sep-char))))
+	(setcar (last parts) (concat (car (last parts)) "/")))
     (nreverse parts)))
 
 (defun eshell-to-flat-string (value)
@@ -450,8 +447,8 @@
 				 (point) (progn (end-of-line)
 						(point))) ":")))
 	    (if (and (and fields (nth 0 fields) (nth 2 fields))
-		     (not (assq (string-to-int (nth 2 fields)) names)))
-		(setq names (cons (cons (string-to-int (nth 2 fields))
+		     (not (assq (string-to-number (nth 2 fields)) names)))
+		(setq names (cons (cons (string-to-number (nth 2 fields))
 					(nth 0 fields))
 				  names))))
 	  (forward-line))))
--- a/lisp/eshell/esh-var.el	Tue May 31 00:13:51 2005 +0000
+++ b/lisp/eshell/esh-var.el	Tue May 31 00:14:26 2005 +0000
@@ -631,7 +631,7 @@
 	    (if (and value
 		     (stringp value)
 		     (file-directory-p value))
-		(concat varname (char-to-string directory-sep-char))
+		(concat varname "/")
 	      varname))))
        (eshell-envvar-names (eshell-environment-variables)))
       (all-completions argname obarray 'boundp)