changeset 55881:79a700a71463

(comint-replace-by-expanded-history-before-point): Obey `start' as the docstring says. (comint-send-input, comint-snapshot-last-prompt, comint-output-filter) (comint-update-fence): Prevent font-lock from running unnecessarily. (comint-dynamic-list-completions): Use with-current-buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 02 Jun 2004 00:02:18 +0000
parents 1b2cb608f18e
children 247e609a304f
files lisp/comint.el
diffstat 1 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Tue Jun 01 23:31:00 2004 +0000
+++ b/lisp/comint.el	Wed Jun 02 00:02:18 2004 +0000
@@ -1182,7 +1182,7 @@
 than the logical beginning of line."
   (save-excursion
     (let ((toend (- (line-end-position) (point)))
-	  (start (comint-line-beginning-position)))
+	  (start (or start (comint-line-beginning-position))))
       (goto-char start)
       (while (progn
 	       (skip-chars-forward "^!^" (- (line-end-position) toend))
@@ -1482,7 +1482,8 @@
 				(concat input "\n")))
 
 	  (let ((beg (marker-position pmark))
-		(end (if no-newline (point) (1- (point)))))
+	      (end (if no-newline (point) (1- (point))))
+	      (inhibit-modification-hooks t))
 	    (when (> end beg)
 	      ;; Set text-properties for the input field
 	      (add-text-properties
@@ -1578,7 +1579,8 @@
 freeze its attributes in place, even when more input comes a long
 and moves the prompt overlay."
   (when comint-last-prompt-overlay
-    (let ((inhibit-read-only t))
+    (let ((inhibit-read-only t)
+	  (inhibit-modification-hooks t))
       (add-text-properties (overlay-start comint-last-prompt-overlay)
                            (overlay-end comint-last-prompt-overlay)
                            (overlay-properties comint-last-prompt-overlay)))))
@@ -1709,7 +1711,8 @@
 	    (goto-char (process-mark process)) ; in case a filter moved it
 
 	    (unless comint-use-prompt-regexp-instead-of-fields
-              (let ((inhibit-read-only t))
+              (let ((inhibit-read-only t)
+		    (inhibit-modification-hooks t))
                 (add-text-properties comint-last-output-start (point)
                                      '(rear-nonsticky t
 				       field output
@@ -1718,7 +1721,8 @@
 	    ;; Highlight the prompt, where we define `prompt' to mean
 	    ;; the most recent output that doesn't end with a newline.
 	    (let ((prompt-start (save-excursion (forward-line 0) (point)))
-		  (inhibit-read-only t))
+		  (inhibit-read-only t)
+		  (inhibit-modification-hooks t))
 	      (when comint-prompt-read-only
 		(or (= (point-min) prompt-start)
 		    (get-text-property (1- prompt-start) 'read-only)
@@ -2347,7 +2351,8 @@
 If the character after point does not have a front-sticky
 read-only property, any read-only property of `fence' on the
 preceding newline is removed."
-  (let* ((pt (point)) (lst (get-text-property pt 'front-sticky)))
+  (let* ((pt (point)) (lst (get-text-property pt 'front-sticky))
+	 (inhibit-modification-hooks t))
     (and (bolp)
 	 (not (bobp))
 	 (if (and (get-text-property pt 'read-only)
@@ -2966,10 +2971,8 @@
 
     ;; Read the next key, to process SPC.
     (let (key first)
-      (if (save-excursion
-	    (set-buffer (get-buffer "*Completions*"))
-	    (set (make-local-variable
-		  'comint-displayed-dynamic-completions)
+      (if (with-current-buffer (get-buffer "*Completions*")
+	    (set (make-local-variable 'comint-displayed-dynamic-completions)
 		 completions)
 	    (setq key (read-key-sequence nil)
 		  first (aref key 0))