* lisp/eshell/: Use with-silent-modifications.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 23 Nov 2010 17:36:15 +0000 (12:36 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 23 Nov 2010 17:36:15 +0000 (12:36 -0500)
* lisp/eshell/esh-cmd.el (eshell-parse-command):
* lisp/eshell/esh-arg.el (eshell-parse-arguments):
* lisp/eshell/em-script.el (eshell-source-file):
Use with-silent-modifications.

lisp/ChangeLog
lisp/eshell/em-script.el
lisp/eshell/esh-arg.el
lisp/eshell/esh-cmd.el

index d2969ea..c29cd08 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * eshell/esh-cmd.el (eshell-parse-command):
+       * eshell/esh-arg.el (eshell-parse-arguments):
+       * eshell/em-script.el (eshell-source-file):
+       Use with-silent-modifications.
+
 2010-11-23  Chong Yidong  <cyd@stupidchicken.com>
 
        * vc/vc.el (vc-merge): Remove optional arg PROMPT.  Always prompt
index 183faa1..21a5d80 100644 (file)
@@ -90,23 +90,25 @@ Comments begin with '#'."
   (interactive "f")
   (let ((orig (point))
        (here (point-max))
-       (inhibit-point-motion-hooks t)
-       after-change-functions)
+       (inhibit-point-motion-hooks t))
     (goto-char (point-max))
-    (insert-file-contents file)
-    (goto-char (point-max))
-    (throw 'eshell-replace-command
-          (prog1
-              (list 'let
-                    (list (list 'eshell-command-name (list 'quote file))
-                          (list 'eshell-command-arguments
-                                (list 'quote args)))
-                    (let ((cmd (eshell-parse-command (cons here (point)))))
-                      (if subcommand-p
-                          (setq cmd (list 'eshell-as-subcommand cmd)))
-                      cmd))
-            (delete-region here (point))
-            (goto-char orig)))))
+    (with-silent-modifications
+      ;; FIXME: Why not use a temporary buffer and avoid this
+      ;; "insert&delete" business?  --Stef
+      (insert-file-contents file)
+      (goto-char (point-max))
+      (throw 'eshell-replace-command
+             (prog1
+                 (list 'let
+                       (list (list 'eshell-command-name (list 'quote file))
+                             (list 'eshell-command-arguments
+                                   (list 'quote args)))
+                       (let ((cmd (eshell-parse-command (cons here (point)))))
+                         (if subcommand-p
+                             (setq cmd (list 'eshell-as-subcommand cmd)))
+                         cmd))
+               (delete-region here (point))
+               (goto-char orig))))))
 
 (defun eshell/source (&rest args)
   "Source a file in a subshell environment."
index 6395fe2..e6d73ac 100644 (file)
@@ -123,7 +123,7 @@ treated as a literal character."
   :type 'hook
   :group 'eshell-arg)
 
-(defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ?  ?\t ?\n)
+(defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ?\s ?\t ?\n)
   "List of characters to recognize as argument separators."
   :type '(repeat character)
   :group 'eshell-arg)
@@ -214,25 +214,24 @@ Point is left at the end of the arguments."
       (narrow-to-region beg end)
       (let ((inhibit-point-motion-hooks t)
            (args (list t))
-           after-change-functions
            delim)
-       (remove-text-properties (point-min) (point-max)
-                               '(arg-begin nil arg-end nil))
-       (if (setq
-            delim
-            (catch 'eshell-incomplete
-              (while (not (eobp))
-                (let* ((here (point))
-                       (arg (eshell-parse-argument)))
-                  (if (= (point) here)
-                      (error "Failed to parse argument '%s'"
-                             (buffer-substring here (point-max))))
-                  (and arg (nconc args (list arg)))))))
-           (if (listp delim)
-               (throw 'eshell-incomplete delim)
-             (throw 'eshell-incomplete
-                    (list delim (point) (cdr args)))))
-       (cdr args)))))
+        (with-silent-modifications
+          (remove-text-properties (point-min) (point-max)
+                                  '(arg-begin nil arg-end nil))
+          (if (setq
+               delim
+               (catch 'eshell-incomplete
+                 (while (not (eobp))
+                   (let* ((here (point))
+                          (arg (eshell-parse-argument)))
+                     (if (= (point) here)
+                         (error "Failed to parse argument '%s'"
+                                (buffer-substring here (point-max))))
+                     (and arg (nconc args (list arg)))))))
+              (throw 'eshell-incomplete (if (listp delim)
+                                            delim
+                                          (list delim (point) (cdr args)))))
+          (cdr args))))))
 
 (defun eshell-parse-argument ()
   "Get the next argument.  Leave point after it."
index 0dc1cb2..a12d8fb 100644 (file)
@@ -355,12 +355,14 @@ hooks should be run before and after the command."
           (if (consp command)
               (eshell-parse-arguments (car command) (cdr command))
             (let ((here (point))
-                  (inhibit-point-motion-hooks t)
-                  after-change-functions)
-              (insert command)
-              (prog1
-                  (eshell-parse-arguments here (point))
-                (delete-region here (point)))))
+                  (inhibit-point-motion-hooks t))
+               (with-silent-modifications
+                 ;; FIXME: Why not use a temporary buffer and avoid this
+                 ;; "insert&delete" business?  --Stef
+                 (insert command)
+                 (prog1
+                     (eshell-parse-arguments here (point))
+                   (delete-region here (point))))))
           args))
         (commands
          (mapcar