Commit 127fd3c2 authored by John Wiegley's avatar John Wiegley
Browse files

Set the property `eshell-no-numeric-conversions' on the following

functions (which all deal with filesystem entities, and never Lisp
numerical values): eshell/cd, eshell/pushd, eshell/popd, eshell/ls,
eshell/source, eshell/., eshell/man, eshell/rm, eshell/mkdir,
eshell/rmdir, eshell/mv, eshell/cp, eshell/ln, eshell/cat,
eshell/make, eshell/diff, eshell/locate, eshell/occur, eshell/which,
eshell/addpath.
parent c26f6b27
......@@ -408,6 +408,8 @@ in the minibuffer:
(eshell-parse-command "ls" (cdr args))))
nil))))
(put 'eshell/cd 'eshell-no-numeric-conversions t)
(defun eshell-add-to-dir-ring (path)
"Add PATH to the last-dir-ring, if applicable."
(unless (and (not (ring-empty-p eshell-last-dir-ring))
......@@ -469,6 +471,8 @@ in the minibuffer:
(eshell/dirs t)))))
nil)
(put 'eshell/pushd 'eshell-no-numeric-conversions t)
;;; popd [+n]
(defun eshell/popd (&rest args)
"Implementation of popd in Lisp."
......@@ -497,6 +501,8 @@ in the minibuffer:
(error "Couldn't popd"))))
nil)
(put 'eshell/popd 'eshell-no-numeric-conversions t)
(defun eshell/dirs (&optional if-verbose)
"Implementation of dirs in Lisp."
(when (or (not if-verbose) eshell-dirtrack-verbose)
......
......@@ -273,6 +273,8 @@ instead."
(flush-func 'eshell-flush))
(eshell-do-ls args)))
(put 'eshell/ls 'eshell-no-numeric-conversions t)
(eval-when-compile
(defvar block-size)
(defvar dereference-links)
......
......@@ -119,6 +119,8 @@ Invoke the Eshell commands in FILE in a subshell, binding ARGS to $1,
$2, etc.")
(eshell-source-file (car args) (cdr args) t)))
(put 'eshell/source 'eshell-no-numeric-conversions t)
(defun eshell/. (&rest args)
"Source a file in the current environment."
(eshell-eval-using-options
......@@ -130,6 +132,8 @@ Invoke the Eshell commands in FILE within the current shell
environment, binding ARGS to $1, $2, etc.")
(eshell-source-file (car args) (cdr args))))
(put 'eshell/. 'eshell-no-numeric-conversions t)
;;; Code:
;;; em-script.el ends here
......@@ -166,6 +166,8 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine."
"Invoke man, flattening the arguments appropriately."
(funcall 'man (apply 'eshell-flatten-and-stringify args)))
(put 'eshell/man 'eshell-no-numeric-conversions t)
(defun eshell-remove-entries (path files &optional top-level)
"From PATH, remove all of the given FILES, perhaps interactively."
(while files
......@@ -276,6 +278,8 @@ Remove (unlink) the FILE(s).")
(setq args (cdr args)))
nil))
(put 'eshell/rm 'eshell-no-numeric-conversions t)
(defun eshell/mkdir (&rest args)
"Implementation of mkdir in Lisp."
(eshell-eval-using-options
......@@ -290,6 +294,8 @@ Create the DIRECTORY(ies), if they do not already exist.")
(setq args (cdr args)))
nil))
(put 'eshell/mkdir 'eshell-no-numeric-conversions t)
(defun eshell/rmdir (&rest args)
"Implementation of rmdir in Lisp."
(eshell-eval-using-options
......@@ -304,6 +310,8 @@ Remove the DIRECTORY(ies), if they are empty.")
(setq args (cdr args)))
nil))
(put 'eshell/rmdir 'eshell-no-numeric-conversions t)
(eval-when-compile
(defvar no-dereference)
(defvar preview)
......@@ -483,6 +491,8 @@ Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
eshell-mv-interactive-query
eshell-mv-overwrite-files))))
(put 'eshell/mv 'eshell-no-numeric-conversions t)
(defun eshell/cp (&rest args)
"Implementation of cp in Lisp."
(eshell-eval-using-options
......@@ -516,6 +526,8 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.")
eshell-cp-interactive-query
eshell-cp-overwrite-files preserve)))
(put 'eshell/cp 'eshell-no-numeric-conversions t)
(defun eshell/ln (&rest args)
"Implementation of ln in Lisp."
(eshell-eval-using-options
......@@ -546,6 +558,8 @@ with '--symbolic'. When creating hard links, each TARGET must exist.")
eshell-ln-interactive-query
eshell-ln-overwrite-files))))
(put 'eshell/ln 'eshell-no-numeric-conversions t)
(defun eshell/cat (&rest args)
"Implementation of cat in Lisp.
If in a pipeline, or the file is not a regular file, directory or
......@@ -593,6 +607,8 @@ Concatenate FILE(s), or standard input, to standard output.")
;; if the file does not end in a newline, do not emit one
(setq eshell-ensure-newline-p nil))))
(put 'eshell/cat 'eshell-no-numeric-conversions t)
;; special front-end functions for compilation-mode buffers
(defun eshell/make (&rest args)
......@@ -608,6 +624,8 @@ Concatenate FILE(s), or standard input, to standard output.")
(eshell-parse-command "*make" (eshell-stringify-list
(eshell-flatten-list args))))))
(put 'eshell/make 'eshell-no-numeric-conversions t)
(defun eshell-occur-mode-goto-occurrence ()
"Go to the occurrence the current line describes."
(interactive)
......@@ -964,6 +982,8 @@ Show wall-clock time elapsed during execution of COMMAND.")
(pop-to-buffer (current-buffer))))))
nil)
(put 'eshell/diff 'eshell-no-numeric-conversions t)
(defun eshell/locate (&rest args)
"Alias \"locate\" to call Emacs `locate' function."
(if (or eshell-plain-locate-behavior
......@@ -979,6 +999,8 @@ Show wall-clock time elapsed during execution of COMMAND.")
(let ((locate-history-list (list (car args))))
(locate-with-filter (car args) (cadr args))))))
(put 'eshell/locate 'eshell-no-numeric-conversions t)
(defun eshell/occur (&rest args)
"Alias \"occur\" to call Emacs `occur' function."
(let ((inhibit-read-only t))
......@@ -986,6 +1008,8 @@ Show wall-clock time elapsed during execution of COMMAND.")
(error "usage: occur: (REGEXP &optional NLINES)")
(apply 'occur args))))
(put 'eshell/occur 'eshell-no-numeric-conversions t)
;;; Code:
;;; em-unix.el ends here
......@@ -239,6 +239,8 @@ Adds the given PATH to $PATH.")
(eshell-printn (car paths))
(setq paths (cdr paths)))))))
(put 'eshell/addpath 'eshell-no-numeric-conversions t)
(defun eshell-script-interpreter (file)
"Extract the script to run from FILE, if it has #!<interp> in it.
Return nil, or a list of the form:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment