From: Stefan Monnier Date: Sun, 11 Mar 2018 02:49:22 +0000 (-0500) Subject: eshell-eval-using-options: Avoid compiler warning differently X-Git-Tag: emacs-27.0.90~5517 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6a2d179a477d6d92fe9df78c4eee392cf83d6d4e;p=emacs.git eshell-eval-using-options: Avoid compiler warning differently * lisp/eshell/em-unix.el (eshell/time): * lisp/eshell/em-tramp.el (eshell/sudo): * lisp/eshell/esh-var.el (eshell/env): Remove artificial use of `args'. * lisp/eshell/esh-opt.el (eshell-eval-using-options): Silence warning when `args' is not used by `body-forms'. --- diff --git a/lisp/eshell/em-tramp.el b/lisp/eshell/em-tramp.el index 9a72f781fc7..004c4954908 100644 --- a/lisp/eshell/em-tramp.el +++ b/lisp/eshell/em-tramp.el @@ -109,7 +109,6 @@ Uses the system sudo through TRAMP's sudo method." :show-usage :usage "[(-u | --user) USER] COMMAND Execute a COMMAND as the superuser or another USER.") - args ; suppress "unused lexical variable" warning (throw 'eshell-external (let ((user (or user "root")) (host (or (file-remote-p default-directory 'host) diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 04c517f82a0..a18fb85507d 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -956,7 +956,6 @@ Summarize disk usage of each FILE, recursively for directories.") :show-usage :usage "COMMAND... Show wall-clock time elapsed during execution of COMMAND.") - args ; suppress "unused lexical variable" warning (setq eshell-time-start (float-time)) (add-hook 'eshell-post-command-hook 'eshell-show-elapsed-time nil t) ;; after setting diff --git a/lisp/eshell/esh-opt.el b/lisp/eshell/esh-opt.el index 18852ce5341..b802696306a 100644 --- a/lisp/eshell/esh-opt.el +++ b/lisp/eshell/esh-opt.el @@ -95,8 +95,8 @@ BODY-FORMS. If instead an external command is run (because of an unknown option), the tag `eshell-external' will be thrown with the new process for its value. -Lastly, any remaining arguments will be available in a locally -interned variable `args' (created using a `let' form)." +Lastly, any remaining arguments will be available in the locally +let-bound variable `args'." (declare (debug (form form sexp body))) `(let* ((temp-args ,(if (memq ':preserve-args (cadr options)) @@ -111,7 +111,8 @@ interned variable `args' (created using a `let' form)." ;; `options' is of the form (quote OPTS). (cadr options)))) (args processed-args)) - ;; Unused lexical variable warning if body does not use `args'. + ;; Silence unused lexical variable warning if body does not use `args'. + (ignore args) ,@body-forms)) ;;; Internal Functions: diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index d400e0a9be7..b5dce80de8c 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -353,7 +353,6 @@ This function is explicit for adding to `eshell-parse-argument-hook'." '((?h "help" nil nil "show this usage screen") :external "env" :usage "") - args ; suppress "unused lexical variable" warning (dolist (setting (sort (eshell-environment-variables) 'string-lessp)) (eshell-buffered-print setting "\n")) (eshell-flush)))