aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-06-13 16:22:16 +0000
committerStefan Monnier2008-06-13 16:22:16 +0000
commitec4e0abcd2ec5e1523fca615487878e89a9e366e (patch)
treed5729bfec5554779621bd93b8c1ae00d0da016d7
parent747d0c440f834ebbbf12c1004f2510a8f76372f0 (diff)
downloademacs-ec4e0abcd2ec5e1523fca615487878e89a9e366e.tar.gz
emacs-ec4e0abcd2ec5e1523fca615487878e89a9e366e.zip
* progmodes/compile.el (compilation-start): Don't disable undo in
comint buffer. Don't override the comint-filter with our own. (compilation-filter): Change point's insertion-type. * comint.el (comint-output-filter): Use copy-marker.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/comint.el8
-rw-r--r--lisp/progmodes/compile.el36
3 files changed, 32 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7e310e10c33..932dc0b10e9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12008-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/compile.el (compilation-start): Don't disable undo in
4 comint buffer. Don't override the comint-filter with our own.
5 (compilation-filter): Change point's insertion-type.
6
7 * comint.el (comint-output-filter): Use copy-marker.
8
12008-06-13 David Reitter <david.reitter@gmail.com> 92008-06-13 David Reitter <david.reitter@gmail.com>
2 10
3 * textmodes/flyspell.el (mail-mode-flyspell-verify): 11 * textmodes/flyspell.el (mail-mode-flyspell-verify):
diff --git a/lisp/comint.el b/lisp/comint.el
index 4abb17ed17a..00528f38ab0 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1740,12 +1740,8 @@ Make backspaces delete the previous character."
1740 1740
1741 ;; Insert STRING 1741 ;; Insert STRING
1742 (let ((inhibit-read-only t) 1742 (let ((inhibit-read-only t)
1743 ;; Avoid the overhead of save-excursion, since we just 1743 ;; The point should float after any insertion we do.
1744 ;; fiddle with the point 1744 (saved-point (copy-marker (point) t)))
1745 (saved-point (point-marker)))
1746
1747 ;; The point should float after any insertion we do
1748 (set-marker-insertion-type saved-point t)
1749 1745
1750 ;; We temporarly remove any buffer narrowing, in case the 1746 ;; We temporarly remove any buffer narrowing, in case the
1751 ;; process mark is outside of the restriction 1747 ;; process mark is outside of the restriction
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 07e5600d373..65e8f952b64 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1159,7 +1159,6 @@ Returns the compilation buffer created."
1159 (error nil)) 1159 (error nil))
1160 (error "Cannot have two processes in `%s' at once" 1160 (error "Cannot have two processes in `%s' at once"
1161 (buffer-name))))) 1161 (buffer-name)))))
1162 (buffer-disable-undo (current-buffer))
1163 ;; first transfer directory from where M-x compile was called 1162 ;; first transfer directory from where M-x compile was called
1164 (setq default-directory thisdir) 1163 (setq default-directory thisdir)
1165 ;; Make compilation buffer read-only. The filter can still write it. 1164 ;; Make compilation buffer read-only. The filter can still write it.
@@ -1177,7 +1176,9 @@ Returns the compilation buffer created."
1177 (erase-buffer) 1176 (erase-buffer)
1178 ;; Select the desired mode. 1177 ;; Select the desired mode.
1179 (if (not (eq mode t)) 1178 (if (not (eq mode t))
1180 (funcall mode) 1179 (progn
1180 (buffer-disable-undo)
1181 (funcall mode))
1181 (setq buffer-read-only nil) 1182 (setq buffer-read-only nil)
1182 (with-no-warnings (comint-mode)) 1183 (with-no-warnings (comint-mode))
1183 (compilation-shell-minor-mode)) 1184 (compilation-shell-minor-mode))
@@ -1262,7 +1263,10 @@ Returns the compilation buffer created."
1262 (setq mode-line-process 1263 (setq mode-line-process
1263 (list (propertize ":%s" 'face 'compilation-warning))) 1264 (list (propertize ":%s" 'face 'compilation-warning)))
1264 (set-process-sentinel proc 'compilation-sentinel) 1265 (set-process-sentinel proc 'compilation-sentinel)
1265 (set-process-filter proc 'compilation-filter) 1266 (unless (eq mode t)
1267 ;; Keep the comint filter, since it's needed for proper handling
1268 ;; of the prompts.
1269 (set-process-filter proc 'compilation-filter))
1266 ;; Use (point-max) here so that output comes in 1270 ;; Use (point-max) here so that output comes in
1267 ;; after the initial text, 1271 ;; after the initial text,
1268 ;; regardless of where the user sees point. 1272 ;; regardless of where the user sees point.
@@ -1666,17 +1670,21 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'."
1666(defun compilation-filter (proc string) 1670(defun compilation-filter (proc string)
1667 "Process filter for compilation buffers. 1671 "Process filter for compilation buffers.
1668Just inserts the text, and runs `compilation-filter-hook'." 1672Just inserts the text, and runs `compilation-filter-hook'."
1669 (if (buffer-live-p (process-buffer proc)) 1673 (when (buffer-live-p (process-buffer proc))
1670 (with-current-buffer (process-buffer proc) 1674 (with-current-buffer (process-buffer proc)
1671 (let ((inhibit-read-only t)) 1675 (let ((inhibit-read-only t)
1672 (save-excursion 1676 ;; `save-excursion' doesn't use the right insertion-type for us.
1673 (goto-char (process-mark proc)) 1677 (pos (copy-marker (point) t)))
1674 ;; We used to use `insert-before-markers', so that windows with 1678 (unwind-protect
1675 ;; point at `process-mark' scroll along with the output, but we 1679 (progn
1676 ;; now use window-point-insertion-type instead. 1680 (goto-char (process-mark proc))
1677 (insert string) 1681 ;; We used to use `insert-before-markers', so that windows with
1678 (set-marker (process-mark proc) (point)) 1682 ;; point at `process-mark' scroll along with the output, but we
1679 (run-hooks 'compilation-filter-hook)))))) 1683 ;; now use window-point-insertion-type instead.
1684 (insert string)
1685 (set-marker (process-mark proc) (point))
1686 (run-hooks 'compilation-filter-hook))
1687 (goto-char pos))))))
1680 1688
1681;;; test if a buffer is a compilation buffer, assuming we're in the buffer 1689;;; test if a buffer is a compilation buffer, assuming we're in the buffer
1682(defsubst compilation-buffer-internal-p () 1690(defsubst compilation-buffer-internal-p ()