emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114445: * lisp/eshell/esh-cmd.el (eshell--sep-terms


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114445: * lisp/eshell/esh-cmd.el (eshell--sep-terms): New var.
Date: Mon, 23 Sep 2013 23:23:37 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114445
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2013-09-23 19:23:32 -0400
message:
  * lisp/eshell/esh-cmd.el (eshell--sep-terms): New var.
  (eshell-parse-command, eshell-parse-pipeline): Use it since
  eshell-separate-commands requires a dynamic scoped var.
  Reported by Jan Moringen <address@hidden>.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/eshell/esh-cmd.el         eshcmd.el-20091113204419-o5vbwnq5f7feedwu-1850
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-09-23 04:21:41 +0000
+++ b/lisp/ChangeLog    2013-09-23 23:23:32 +0000
@@ -1,3 +1,10 @@
+2013-09-23  Stefan Monnier  <address@hidden>
+
+       * eshell/esh-cmd.el (eshell--sep-terms): New var.
+       (eshell-parse-command, eshell-parse-pipeline): Use it since
+       eshell-separate-commands requires a dynamic scoped var.
+       Reported by Jan Moringen <address@hidden>.
+
 2013-09-23  Leo Liu  <address@hidden>
 
        * autoinsert.el (auto-insert-alist): Make the value of

=== modified file 'lisp/eshell/esh-cmd.el'
--- a/lisp/eshell/esh-cmd.el    2013-09-17 15:19:12 +0000
+++ b/lisp/eshell/esh-cmd.el    2013-09-23 23:23:32 +0000
@@ -339,13 +339,15 @@
 
 ;; Command parsing
 
+(defvar eshell--sep-terms)
+
 (defun eshell-parse-command (command &optional args toplevel)
   "Parse the COMMAND, adding ARGS if given.
 COMMAND can either be a string, or a cons cell demarcating a buffer
 region.  TOPLEVEL, if non-nil, means that the outermost command (the
 user's input command) is being parsed, and that pre and post command
 hooks should be run before and after the command."
-  (let* (sep-terms
+  (let* (eshell--sep-terms
         (terms
          (append
           (if (consp command)
@@ -365,16 +367,16 @@
           (function
            (lambda (cmd)
               (setq cmd
-                    (if (or (not (car sep-terms))
-                            (string= (car sep-terms) ";"))
+                    (if (or (not (car eshell--sep-terms))
+                            (string= (car eshell--sep-terms) ";"))
                        (eshell-parse-pipeline cmd)
                      `(eshell-do-subjob
                         (list ,(eshell-parse-pipeline cmd)))))
-             (setq sep-terms (cdr sep-terms))
+             (setq eshell--sep-terms (cdr eshell--sep-terms))
              (if eshell-in-pipeline-p
                  cmd
                `(eshell-trap-errors ,cmd))))
-          (eshell-separate-commands terms "[&;]" nil 'sep-terms))))
+          (eshell-separate-commands terms "[&;]" nil 'eshell--sep-terms))))
     (let ((cmd commands))
       (while cmd
        (if (cdr cmd)
@@ -586,9 +588,9 @@
 
 (defun eshell-parse-pipeline (terms)
   "Parse a pipeline from TERMS, return the appropriate Lisp forms."
-  (let* (sep-terms
+  (let* (eshell--sep-terms
         (bigpieces (eshell-separate-commands terms "\\(&&\\|||\\)"
-                                             nil 'sep-terms))
+                                             nil 'eshell--sep-terms))
         (bp bigpieces)
         (results (list t))
         final)
@@ -620,15 +622,15 @@
          results (nreverse results)
          final (car results)
          results (cdr results)
-         sep-terms (nreverse sep-terms))
+         eshell--sep-terms (nreverse eshell--sep-terms))
     (while results
-      (cl-assert (car sep-terms))
+      (cl-assert (car eshell--sep-terms))
       (setq final (eshell-structure-basic-command
-                  'if (string= (car sep-terms) "&&") "if"
+                  'if (string= (car eshell--sep-terms) "&&") "if"
                   `(eshell-protect ,(car results))
                   `(eshell-protect ,final))
            results (cdr results)
-           sep-terms (cdr sep-terms)))
+           eshell--sep-terms (cdr eshell--sep-terms)))
     final))
 
 (defun eshell-parse-subcommand-argument ()


reply via email to

[Prev in Thread] Current Thread [Next in Thread]