diff options
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/em-unix.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 850d51dcac5..384fa083947 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -974,6 +974,13 @@ Show wall-clock time elapsed during execution of COMMAND.") | |||
| 974 | (if eshell-diff-window-config | 974 | (if eshell-diff-window-config |
| 975 | (set-window-configuration eshell-diff-window-config))) | 975 | (set-window-configuration eshell-diff-window-config))) |
| 976 | 976 | ||
| 977 | (defun nil-blank-string ( string ) | ||
| 978 | "if a string is all blanks return nil, if there are non-blank characters | ||
| 979 | return the string" | ||
| 980 | (cond | ||
| 981 | ((string-match "[^[:blank:]]" string ) string) | ||
| 982 | (nil))) | ||
| 983 | |||
| 977 | (defun eshell/diff (&rest args) | 984 | (defun eshell/diff (&rest args) |
| 978 | "Alias \"diff\" to call Emacs `diff' function." | 985 | "Alias \"diff\" to call Emacs `diff' function." |
| 979 | (let ((orig-args (eshell-stringify-list (eshell-flatten-list args)))) | 986 | (let ((orig-args (eshell-stringify-list (eshell-flatten-list args)))) |
| @@ -995,7 +1002,8 @@ Show wall-clock time elapsed during execution of COMMAND.") | |||
| 995 | (setcdr (last args 3) nil)) | 1002 | (setcdr (last args 3) nil)) |
| 996 | (with-current-buffer | 1003 | (with-current-buffer |
| 997 | (condition-case err | 1004 | (condition-case err |
| 998 | (diff old new (eshell-flatten-and-stringify args)) | 1005 | (diff old new |
| 1006 | (nil-blank-string (eshell-flatten-and-stringify args))) | ||
| 999 | (error | 1007 | (error |
| 1000 | (throw 'eshell-replace-command | 1008 | (throw 'eshell-replace-command |
| 1001 | (eshell-parse-command "*diff" orig-args)))) | 1009 | (eshell-parse-command "*diff" orig-args)))) |