diff options
| author | Stefan Monnier | 2008-06-25 15:05:33 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-06-25 15:05:33 +0000 |
| commit | ee5b7365d543288bf354ef40dae34a2d4c6258b8 (patch) | |
| tree | 53bca1524ec6a496cf00338546e43a10369a0215 /lisp/eshell | |
| parent | 32bed934f91f074c2adab249461b0039b90589a3 (diff) | |
| download | emacs-ee5b7365d543288bf354ef40dae34a2d4c6258b8.tar.gz emacs-ee5b7365d543288bf354ef40dae34a2d4c6258b8.zip | |
(eshell-manipulate): Check eshell-debug-command is bound before using it.
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/esh-cmd.el | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 1c75eca28ee..82619d60791 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el | |||
| @@ -397,8 +397,7 @@ hooks should be run before and after the command." | |||
| 397 | "Output a debugging message to '*eshell last cmd*'." | 397 | "Output a debugging message to '*eshell last cmd*'." |
| 398 | (let ((buf (get-buffer-create "*eshell last cmd*")) | 398 | (let ((buf (get-buffer-create "*eshell last cmd*")) |
| 399 | (text (eshell-stringify eshell-current-command))) | 399 | (text (eshell-stringify eshell-current-command))) |
| 400 | (save-excursion | 400 | (with-current-buffer buf |
| 401 | (set-buffer buf) | ||
| 402 | (if (not tag) | 401 | (if (not tag) |
| 403 | (erase-buffer) | 402 | (erase-buffer) |
| 404 | (insert "\n\C-l\n" tag "\n\n" text | 403 | (insert "\n\C-l\n" tag "\n\n" text |
| @@ -997,11 +996,9 @@ at the moment are: | |||
| 997 | (list 'eshell-do-eval | 996 | (list 'eshell-do-eval |
| 998 | (list 'quote command))))) | 997 | (list 'quote command))))) |
| 999 | (and eshell-debug-command | 998 | (and eshell-debug-command |
| 1000 | (save-excursion | 999 | (with-current-buffer (get-buffer-create "*eshell last cmd*") |
| 1001 | (let ((buf (get-buffer-create "*eshell last cmd*"))) | 1000 | (erase-buffer) |
| 1002 | (set-buffer buf) | 1001 | (insert "command: \"" input "\"\n"))) |
| 1003 | (erase-buffer) | ||
| 1004 | (insert "command: \"" input "\"\n")))) | ||
| 1005 | (setq eshell-current-command command) | 1002 | (setq eshell-current-command command) |
| 1006 | (let ((delim (catch 'eshell-incomplete | 1003 | (let ((delim (catch 'eshell-incomplete |
| 1007 | (eshell-resume-eval)))) | 1004 | (eshell-resume-eval)))) |
| @@ -1041,7 +1038,9 @@ at the moment are: | |||
| 1041 | 1038 | ||
| 1042 | (defmacro eshell-manipulate (tag &rest commands) | 1039 | (defmacro eshell-manipulate (tag &rest commands) |
| 1043 | "Manipulate a COMMAND form, with TAG as a debug identifier." | 1040 | "Manipulate a COMMAND form, with TAG as a debug identifier." |
| 1044 | (if (not eshell-debug-command) | 1041 | ;; Check `bound'ness since at compile time the code until here has not |
| 1042 | ;; executed yet. | ||
| 1043 | (if (not (and (boundp 'eshell-debug-command) eshell-debug-command)) | ||
| 1045 | `(progn ,@commands) | 1044 | `(progn ,@commands) |
| 1046 | `(progn | 1045 | `(progn |
| 1047 | (eshell-debug-command ,(eval tag) form) | 1046 | (eshell-debug-command ,(eval tag) form) |