emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r102486: * lisp/eshell/: Use with-sil


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102486: * lisp/eshell/: Use with-silent-modifications.
Date: Tue, 23 Nov 2010 12:36:15 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102486
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2010-11-23 12:36:15 -0500
message:
  * lisp/eshell/: Use with-silent-modifications.
  * 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.
modified:
  lisp/ChangeLog
  lisp/eshell/em-script.el
  lisp/eshell/esh-arg.el
  lisp/eshell/esh-cmd.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-11-23 15:13:43 +0000
+++ b/lisp/ChangeLog    2010-11-23 17:36:15 +0000
@@ -1,3 +1,10 @@
+2010-11-23  Stefan Monnier  <address@hidden>
+
+       * 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  <address@hidden>
 
        * vc/vc.el (vc-merge): Remove optional arg PROMPT.  Always prompt

=== modified file 'lisp/eshell/em-script.el'
--- a/lisp/eshell/em-script.el  2010-09-25 21:51:55 +0000
+++ b/lisp/eshell/em-script.el  2010-11-23 17:36:15 +0000
@@ -90,23 +90,25 @@
   (interactive "f")
   (let ((orig (point))
        (here (point-max))
-       (inhibit-point-motion-hooks t)
-       after-change-functions)
-    (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)))))
+       (inhibit-point-motion-hooks t))
+    (goto-char (point-max))
+    (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."

=== modified file 'lisp/eshell/esh-arg.el'
--- a/lisp/eshell/esh-arg.el    2010-01-13 08:35:10 +0000
+++ b/lisp/eshell/esh-arg.el    2010-11-23 17:36:15 +0000
@@ -123,7 +123,7 @@
   :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 @@
       (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."

=== modified file 'lisp/eshell/esh-cmd.el'
--- a/lisp/eshell/esh-cmd.el    2010-09-25 21:51:55 +0000
+++ b/lisp/eshell/esh-cmd.el    2010-11-23 17:36:15 +0000
@@ -355,12 +355,14 @@
           (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


reply via email to

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