(eshell-manipulate): Check eshell-debug-command is bound before using it.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 25 Jun 2008 15:05:33 +0000 (15:05 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 25 Jun 2008 15:05:33 +0000 (15:05 +0000)
lisp/ChangeLog
lisp/eshell/esh-cmd.el

index b487774..82822ff 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-25  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * eshell/esh-cmd.el (eshell-manipulate): Check eshell-debug-command
+       is bound before using it.
+
 2008-06-25  Kenichi Handa  <handa@m17n.org>
 
        * image.el (image-jpeg-p): Convert DATA to unibyte at first.
 
 2008-06-25  Andreas Schwab  <schwab@suse.de>
 
-       * faces.el (face-font-family-alternatives, variable-pitch): Use
-       "Sans Serif", not "Sans-Serif".
+       * faces.el (face-font-family-alternatives, variable-pitch):
+       Use "Sans Serif", not "Sans-Serif".
 
 2008-06-24  Chong Yidong  <cyd@stupidchicken.com>
 
-       * faces.el (face-font-family-alternatives, variable-pitch): Change
-       "Sans" to the canonical name "Sans-Serif".
+       * faces.el (face-font-family-alternatives, variable-pitch):
+       Change "Sans" to the canonical name "Sans-Serif".
 
 2008-06-24  Jay Belanger  <jay.p.belanger@gmail.com>
 
index 1c75eca..82619d6 100644 (file)
@@ -397,8 +397,7 @@ hooks should be run before and after the command."
   "Output a debugging message to '*eshell last cmd*'."
   (let ((buf (get-buffer-create "*eshell last cmd*"))
        (text (eshell-stringify eshell-current-command)))
-    (save-excursion
-      (set-buffer buf)
+    (with-current-buffer buf
       (if (not tag)
          (erase-buffer)
        (insert "\n\C-l\n" tag "\n\n" text
@@ -997,11 +996,9 @@ at the moment are:
                          (list 'eshell-do-eval
                                (list 'quote command)))))
     (and eshell-debug-command
-        (save-excursion
-          (let ((buf (get-buffer-create "*eshell last cmd*")))
-            (set-buffer buf)
-            (erase-buffer)
-            (insert "command: \"" input "\"\n"))))
+         (with-current-buffer (get-buffer-create "*eshell last cmd*")
+           (erase-buffer)
+           (insert "command: \"" input "\"\n")))
     (setq eshell-current-command command)
     (let ((delim (catch 'eshell-incomplete
                   (eshell-resume-eval))))
@@ -1041,7 +1038,9 @@ at the moment are:
 
 (defmacro eshell-manipulate (tag &rest commands)
   "Manipulate a COMMAND form, with TAG as a debug identifier."
-  (if (not eshell-debug-command)
+  ;; Check `bound'ness since at compile time the code until here has not
+  ;; executed yet.
+  (if (not (and (boundp 'eshell-debug-command) eshell-debug-command))
       `(progn ,@commands)
     `(progn
        (eshell-debug-command ,(eval tag) form)