-;;; em-unix.el --- UNIX command aliases
+;;; em-unix.el --- UNIX command aliases -*- lexical-binding:t -*-
-;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2014 Free Software Foundation, Inc.
;; Author: John Wiegley <johnw@gnu.org>
(Info-menu (car args))
(setq args (cdr args)))))
-(defun eshell-remove-entries (path files &optional top-level)
- "From PATH, remove all of the given FILES, perhaps interactively."
+(defun eshell-remove-entries (files &optional toplevel)
+ "Remove all of the given FILES, perhaps interactively."
(while files
(if (string-match "\\`\\.\\.?\\'"
(file-name-nondirectory (car files)))
- (if top-level
+ (if toplevel
(eshell-error "rm: cannot remove `.' or `..'\n"))
(if (and (file-directory-p (car files))
(not (file-symlink-p (car files))))
entry)))))
(eshell-funcalln 'unintern entry)))
((stringp entry)
- (if (and (file-directory-p entry)
- (not (file-symlink-p entry)))
- (if (or em-recursive
- eshell-rm-removes-directories)
- (if (or em-preview
- (not em-interactive)
- (y-or-n-p
- (format "rm: descend into directory `%s'? "
- entry)))
- (eshell-remove-entries nil (list entry) t))
- (eshell-error (format "rm: %s: is a directory\n" entry)))
- (eshell-remove-entries nil (list entry) t)))))
+ ;; -f should silently ignore missing files (bug#15373).
+ (unless (and force-removal
+ (not (file-exists-p entry)))
+ (if (and (file-directory-p entry)
+ (not (file-symlink-p entry)))
+ (if (or em-recursive
+ eshell-rm-removes-directories)
+ (if (or em-preview
+ (not em-interactive)
+ (y-or-n-p
+ (format "rm: descend into directory `%s'? "
+ entry)))
+ (eshell-remove-entries (list entry) t))
+ (eshell-error (format "rm: %s: is a directory\n" entry)))
+ (eshell-remove-entries (list entry) t))))))
(setq args (cdr args)))
nil))
(eshell-parse-command
(format "tar %s %s" tar-args archive) args))))
+(defvar ange-cache) ; XEmacs? See esh-util
+
;; this is to avoid duplicating code...
(defmacro eshell-mvcpln-template (command action func query-var
force-var &optional preserve)
(goto-char (point-min))
(resize-temp-buffer-window))))))
+(defvar compilation-scroll-output)
+
(defun eshell-grep (command args &optional maybe-use-occur)
"Generic service function for the various grep aliases.
It calls Emacs's grep utility if the command is not redirecting output,
(setq args nil)
(setcdr (last args 3) nil))
(with-current-buffer
- (condition-case err
+ (condition-case nil
(diff-no-select
old new
(nil-blank-string (eshell-flatten-and-stringify args)))
(put 'eshell/diff 'eshell-no-numeric-conversions t)
+(defvar locate-history-list)
+
(defun eshell/locate (&rest args)
"Alias \"locate\" to call Emacs `locate' function."
(if (or eshell-plain-locate-behavior