summaryrefslogtreecommitdiff
path: root/lisp/eshell
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-09-18 19:28:20 -0700
committerGlenn Morris <rgm@gnu.org>2013-09-18 19:28:20 -0700
commitce5033129f16b6554b922a63ef0d499ced55a223 (patch)
treeadf1eef255cb344ee0a6684630bd03888d08420b /lisp/eshell
parenta022856b0f99e19a51caff163b477f22faf6418f (diff)
downloademacs-ce5033129f16b6554b922a63ef0d499ced55a223.tar.gz
emacs-ce5033129f16b6554b922a63ef0d499ced55a223.tar.bz2
emacs-ce5033129f16b6554b922a63ef0d499ced55a223.zip
Address some "unused lexical argument" warnings in eshell
* eshell/em-ls.el (eshell-ls-use-in-dired): Use `symbol' arg. Fix (f)boundp mix-up. * eshell/em-smart.el (eshell-smart-scroll-window) (eshell-disable-after-change): * eshell/em-term.el (eshell-term-sentinel): Mark unused arg.
Diffstat (limited to 'lisp/eshell')
-rw-r--r--lisp/eshell/em-ls.el20
-rw-r--r--lisp/eshell/em-smart.el6
-rw-r--r--lisp/eshell/em-term.el3
3 files changed, 15 insertions, 14 deletions
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 0e10d984f88..c2334d7bd74 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -50,9 +50,7 @@ properties to colorize its output based on the setting of
(defcustom eshell-ls-unload-hook
(list
- (function
- (lambda ()
- (fset 'insert-directory eshell-ls-orig-insert-directory))))
+ (lambda () (fset 'insert-directory eshell-ls-orig-insert-directory)))
"When unloading `eshell-ls', restore the definition of `insert-directory'."
:type 'hook
:group 'eshell-ls)
@@ -77,17 +75,17 @@ This is useful for enabling human-readable format (-h), for example."
:type '(repeat :tag "Arguments" string)
:group 'eshell-ls)
+;; FIXME should use advice, like ls-lisp.el does now.
(defcustom eshell-ls-use-in-dired nil
- "If non-nil, use `eshell-ls' to read directories in Dired."
+ "If non-nil, use `eshell-ls' to read directories in Dired.
+Changing this without using customize has no effect."
:set (lambda (symbol value)
(if value
- (unless (and (boundp 'eshell-ls-use-in-dired)
- eshell-ls-use-in-dired)
- (fset 'insert-directory 'eshell-ls-insert-directory))
- (when (and (boundp 'eshell-ls-insert-directory)
- eshell-ls-use-in-dired)
- (fset 'insert-directory eshell-ls-orig-insert-directory)))
- (setq eshell-ls-use-in-dired value))
+ (or (bound-and-true-p eshell-ls-use-in-dired)
+ (fset 'insert-directory 'eshell-ls-insert-directory))
+ (and (fboundp 'eshell-ls-insert-directory) eshell-ls-use-in-dired
+ (fset 'insert-directory eshell-ls-orig-insert-directory)))
+ (set symbol value))
:type 'boolean
:require 'em-ls
:group 'eshell-ls)
diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el
index e6fa463aec3..8d60444a889 100644
--- a/lisp/eshell/em-smart.el
+++ b/lisp/eshell/em-smart.el
@@ -194,7 +194,8 @@ The options are `begin', `after' or `end'."
(add-hook 'eshell-post-command-hook
'eshell-smart-maybe-jump-to-end nil t))))
-(defun eshell-smart-scroll-window (wind start)
+;; This is called by window-scroll-functions with two arguments.
+(defun eshell-smart-scroll-window (wind _start)
"Scroll the given Eshell window accordingly."
(unless eshell-currently-handling-window
(let ((inhibit-point-motion-hooks t)
@@ -237,7 +238,8 @@ The options are `begin', `after' or `end'."
(add-hook 'pre-command-hook 'eshell-smart-display-move nil t)
(eshell-refresh-windows))
-(defun eshell-disable-after-change (b e l)
+;; Called from after-change-functions with 3 arguments.
+(defun eshell-disable-after-change (_b _e _l)
"Disable smart display mode if the buffer changes in any way."
(when eshell-smart-command-done
(remove-hook 'pre-command-hook 'eshell-smart-display-move t)
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index 71329f083ee..bfc810f2d2a 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -189,7 +189,8 @@ allowed."
(term-set-escape-char ?\C-x))))
nil)
-(defun eshell-term-sentinel (proc string)
+;; Process sentinels receive two arguments.
+(defun eshell-term-sentinel (proc _string)
"Destroy the buffer visiting PROC."
(let ((proc-buf (process-buffer proc)))
(when (and proc-buf (buffer-live-p proc-buf)