aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-06-10 16:08:48 +0000
committerStefan Monnier2008-06-10 16:08:48 +0000
commita1562258dcd1634303dae465232d87c6505d26d1 (patch)
tree914320d89d7de21b7eb0895baea7336fca42dd25
parent12b139e9a83173b9461e22cc908721b2b3a04245 (diff)
downloademacs-a1562258dcd1634303dae465232d87c6505d26d1.tar.gz
emacs-a1562258dcd1634303dae465232d87c6505d26d1.zip
* window.c (Vwindow_point_insertion_type): New var.
(set_window_buffer): Use it. (syms_of_window): Init and export it to Lisp. * progmodes/compile.el (compilation-mode): Set window-point-insertion-type. (compilation-filter): Don't use insert-before-markers any more. * emacs-lisp/trace.el (trace-make-advice): Set window-point-insertion-type in the trace buffer. * startup.el (normal-top-level): Set window-point-insertion-type in *Messages*. * net/telnet.el (telnet-mode): Set window-point-insertion-type. (telnet-filter): Don't use insert-before-markers any more. * comint.el (comint-mode): Set window-point-insertion-type. (comint-output-filter): Don't use insert-before-markers any more. * button.el (make-text-button): Allow `start' to be a string.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/comint.el46
-rw-r--r--lisp/emacs-lisp/trace.el3
-rw-r--r--lisp/net/telnet.el6
-rw-r--r--lisp/progmodes/compile.el11
-rw-r--r--lisp/startup.el9
-rw-r--r--src/ChangeLog40
-rw-r--r--src/window.c18
9 files changed, 71 insertions, 76 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 7b24a232f2d..18ef4d603b3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -826,6 +826,9 @@ functions and variables (formerly used for Tamil script).
826 826
827* Lisp Changes in Emacs 23.1 827* Lisp Changes in Emacs 23.1
828 828
829** The variable window-point-insertion-type determines the insertion-type
830of the marker used for window-point.
831
829** minibuffer-local-must-match-filename-map is now named 832** minibuffer-local-must-match-filename-map is now named
830minibuffer-local-filename-must-match-map. 833minibuffer-local-filename-must-match-map.
831 834
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a2a80e919fe..690be169092 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,16 @@
12008-06-10 Stefan Monnier <monnier@iro.umontreal.ca> 12008-06-10 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * progmodes/compile.el (compilation-mode):
4 Set window-point-insertion-type.
5 (compilation-filter): Don't use insert-before-markers any more.
6 * emacs-lisp/trace.el (trace-make-advice):
7 Set window-point-insertion-type in the trace buffer.
8 * startup.el (normal-top-level): Set window-point-insertion-type in
9 *Messages*.
10 * net/telnet.el (telnet-mode): Set window-point-insertion-type.
11 (telnet-filter): Don't use insert-before-markers any more.
12 * comint.el (comint-mode): Set window-point-insertion-type.
13 (comint-output-filter): Don't use insert-before-markers any more.
3 * button.el (make-text-button): Allow `start' to be a string. 14 * button.el (make-text-button): Allow `start' to be a string.
4 15
52008-06-10 Juanma Barranquero <lekktu@gmail.com> 162008-06-10 Juanma Barranquero <lekktu@gmail.com>
diff --git a/lisp/comint.el b/lisp/comint.el
index 68745dcb4af..4abb17ed17a 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -618,6 +618,7 @@ to continue it.
618 618
619Entry to this mode runs the hooks on `comint-mode-hook'." 619Entry to this mode runs the hooks on `comint-mode-hook'."
620 (setq mode-line-process '(":%s")) 620 (setq mode-line-process '(":%s"))
621 (set (make-local-variable 'window-point-insertion-type) t)
621 (set (make-local-variable 'comint-last-input-start) (point-min-marker)) 622 (set (make-local-variable 'comint-last-input-start) (point-min-marker))
622 (set (make-local-variable 'comint-last-input-end) (point-min-marker)) 623 (set (make-local-variable 'comint-last-input-end) (point-min-marker))
623 (set (make-local-variable 'comint-last-output-start) (make-marker)) 624 (set (make-local-variable 'comint-last-output-start) (make-marker))
@@ -1755,48 +1756,9 @@ Make backspaces delete the previous character."
1755 (set-marker comint-last-output-start (point)) 1756 (set-marker comint-last-output-start (point))
1756 1757
1757 ;; insert-before-markers is a bad thing. XXX 1758 ;; insert-before-markers is a bad thing. XXX
1758 ;; 1759 ;; Luckily we don't have to use it any more, we use
1759 ;; It is used here to force window-point markers (used to 1760 ;; window-point-insertion-type instead.
1760 ;; store the value of point in non-selected windows) to 1761 (insert string)
1761 ;; advance, but it also screws up any other markers that we
1762 ;; don't _want_ to advance, such as the start-marker of some
1763 ;; of the overlays we create.
1764 ;;
1765 ;; We work around the problem with the overlays by
1766 ;; explicitly adjusting them after we do the insertion, but
1767 ;; in the future this problem should be solved correctly, by
1768 ;; using `insert', and making the insertion-type of
1769 ;; window-point markers settable (via a buffer-local
1770 ;; variable). In comint buffers, this variable would be set
1771 ;; to `t', to cause point in non-select windows to advance.
1772 (insert-before-markers string)
1773 ;; Fixup markers and overlays that got screwed up because we
1774 ;; used `insert-before-markers'.
1775 (let ((old-point (- (point) (length string))))
1776 ;; comint-last-output-start
1777 (set-marker comint-last-output-start old-point)
1778 ;; comint-last-input-end
1779 (when (and comint-last-input-end
1780 (equal (marker-position comint-last-input-end)
1781 (point)))
1782 (set-marker comint-last-input-end old-point))
1783 ;; No overlays we create are set to advance upon insertion
1784 ;; (at the start/end), so we assume that any overlay which
1785 ;; is at the current point was incorrectly advanced by
1786 ;; insert-before-markers. First fixup overlays that might
1787 ;; start at point:
1788 (dolist (over (overlays-at (point)))
1789 (when (= (overlay-start over) (point))
1790 (let ((end (overlay-end over)))
1791 (move-overlay over
1792 old-point
1793 (if (= end (point)) old-point end)))))
1794 ;; Then do overlays that might end at point:
1795 (dolist (over (overlays-at (1- (point))))
1796 (when (= (overlay-end over) (point))
1797 (move-overlay over
1798 (min (overlay-start over) old-point)
1799 old-point))))
1800 1762
1801 ;; Advance process-mark 1763 ;; Advance process-mark
1802 (set-marker (process-mark process) (point)) 1764 (set-marker (process-mark process) (point))
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index b583f8a1b04..f474e8c72d5 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -219,7 +219,8 @@
219 (trace-buffer (get-buffer-create ,buffer))) 219 (trace-buffer (get-buffer-create ,buffer)))
220 (unless inhibit-trace 220 (unless inhibit-trace
221 (with-current-buffer trace-buffer 221 (with-current-buffer trace-buffer
222 ,(unless background '(display-buffer trace-buffer)) 222 (set (make-local-variable 'window-point-insertion-type) t)
223 ,(unless background '(display-buffer trace-buffer))
223 (goto-char (point-max)) 224 (goto-char (point-max))
224 ;; Insert a separator from previous trace output: 225 ;; Insert a separator from previous trace output:
225 (if (= trace-level 1) (insert trace-separator)) 226 (if (= trace-level 1) (insert trace-separator))
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index 3a0405b9fb3..a4bd46bca4c 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -159,8 +159,7 @@ rejecting one login and prompting again for a username and password.")
159 (comint-send-string proc telnet-new-line))) 159 (comint-send-string proc telnet-new-line)))
160 160
161(defun telnet-filter (proc string) 161(defun telnet-filter (proc string)
162 (save-excursion 162 (with-current-buffer (process-buffer proc)
163 (set-buffer (process-buffer proc))
164 (let* ((last-insertion (marker-position (process-mark proc))) 163 (let* ((last-insertion (marker-position (process-mark proc)))
165 (delta (- (point) last-insertion)) 164 (delta (- (point) last-insertion))
166 (ie (and comint-last-input-end 165 (ie (and comint-last-input-end
@@ -168,7 +167,7 @@ rejecting one login and prompting again for a username and password.")
168 (w (get-buffer-window (current-buffer))) 167 (w (get-buffer-window (current-buffer)))
169 (ws (and w (window-start w)))) 168 (ws (and w (window-start w))))
170 (goto-char last-insertion) 169 (goto-char last-insertion)
171 (insert-before-markers string) 170 (insert string)
172 (set-marker comint-last-output-start last-insertion) 171 (set-marker comint-last-output-start last-insertion)
173 (set-marker (process-mark proc) (point)) 172 (set-marker (process-mark proc) (point))
174 (if ws (set-window-start w ws t)) 173 (if ws (set-window-start w ws t))
@@ -245,6 +244,7 @@ It has most of the same commands as comint-mode.
245There is a variable ``telnet-interrupt-string'' which is the character 244There is a variable ``telnet-interrupt-string'' which is the character
246sent to try to stop execution of a job on the remote host. 245sent to try to stop execution of a job on the remote host.
247Data is sent to the remote host when RET is typed." 246Data is sent to the remote host when RET is typed."
247 (set (make-local-variable 'window-point-insertion-type) t)
248 (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern) 248 (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)
249 (set (make-local-variable 'comint-use-prompt-regexp) t)) 249 (set (make-local-variable 'comint-use-prompt-regexp) t))
250 250
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index e8f879f2ffa..0c8bb8473be 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1467,6 +1467,8 @@ Runs `compilation-mode-hook' with `run-mode-hooks' (which see).
1467 (interactive) 1467 (interactive)
1468 (kill-all-local-variables) 1468 (kill-all-local-variables)
1469 (use-local-map compilation-mode-map) 1469 (use-local-map compilation-mode-map)
1470 ;; Let windows scroll along with the output.
1471 (set (make-local-variable 'window-point-insertion-type) t)
1470 (set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map) 1472 (set (make-local-variable 'tool-bar-map) compilation-mode-tool-bar-map)
1471 (setq major-mode 'compilation-mode 1473 (setq major-mode 'compilation-mode
1472 mode-name (or name-of-mode "Compilation")) 1474 mode-name (or name-of-mode "Compilation"))
@@ -1663,13 +1665,16 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'."
1663 1665
1664(defun compilation-filter (proc string) 1666(defun compilation-filter (proc string)
1665 "Process filter for compilation buffers. 1667 "Process filter for compilation buffers.
1666Just inserts the text, but uses `insert-before-markers'." 1668Just inserts the text, and runs `compilation-filter-hook'."
1667 (if (buffer-name (process-buffer proc)) 1669 (if (buffer-live-p (process-buffer proc))
1668 (with-current-buffer (process-buffer proc) 1670 (with-current-buffer (process-buffer proc)
1669 (let ((inhibit-read-only t)) 1671 (let ((inhibit-read-only t))
1670 (save-excursion 1672 (save-excursion
1671 (goto-char (process-mark proc)) 1673 (goto-char (process-mark proc))
1672 (insert-before-markers string) 1674 ;; We used to use `insert-before-markers', so that windows with
1675 ;; point at `process-mark' scroll along with the output, but we
1676 ;; now use window-point-insertion-type instead.
1677 (insert string)
1673 (run-hooks 'compilation-filter-hook)))))) 1678 (run-hooks 'compilation-filter-hook))))))
1674 1679
1675;;; test if a buffer is a compilation buffer, assuming we're in the buffer 1680;;; test if a buffer is a compilation buffer, assuming we're in the buffer
diff --git a/lisp/startup.el b/lisp/startup.el
index eb8898551eb..83b44cacc40 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -396,10 +396,12 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
396 (if command-line-processed 396 (if command-line-processed
397 (message "Back to top level.") 397 (message "Back to top level.")
398 (setq command-line-processed t) 398 (setq command-line-processed t)
399 ;; Give *Messages* the same default-directory as *scratch*,
400 ;; just to keep things predictable.
401 (let ((dir default-directory)) 399 (let ((dir default-directory))
402 (with-current-buffer "*Messages*" 400 (with-current-buffer "*Messages*"
401 ;; Make it easy to do like "tail -f".
402 (set (make-local-variable 'window-point-insertion-type) t)
403 ;; Give *Messages* the same default-directory as *scratch*,
404 ;; just to keep things predictable.
403 (setq default-directory dir))) 405 (setq default-directory dir)))
404 ;; `user-full-name' is now known; reset its standard-value here. 406 ;; `user-full-name' is now known; reset its standard-value here.
405 (put 'user-full-name 'standard-value 407 (put 'user-full-name 'standard-value
@@ -994,8 +996,7 @@ opening the first frame (e.g. open a connection to an X server).")
994 (setq init-file-had-error nil)) 996 (setq init-file-had-error nil))
995 (error 997 (error
996 (let ((message-log-max nil)) 998 (let ((message-log-max nil))
997 (save-excursion 999 (with-current-buffer (get-buffer-create "*Messages*")
998 (set-buffer (get-buffer-create "*Messages*"))
999 (insert "\n\n" 1000 (insert "\n\n"
1000 (format "An error has occurred while loading `%s':\n\n" 1001 (format "An error has occurred while loading `%s':\n\n"
1001 user-init-file) 1002 user-init-file)
diff --git a/src/ChangeLog b/src/ChangeLog
index a4481d2fab7..23189ad9cf9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,21 +1,21 @@
12008-06-10 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * window.c (Vwindow_point_insertion_type): New var.
4 (set_window_buffer): Use it.
5 (syms_of_window): Init and export it to Lisp.
6
12008-06-10 Kenichi Handa <handa@m17n.org> 72008-06-10 Kenichi Handa <handa@m17n.org>
2 8
3 * font.h (font_intern_prop): Prototype adjusted. 9 * font.h (font_intern_prop): Prototype adjusted.
4 10
5 * font.c (font_intern_prop): New arg force_symbol. 11 * font.c (font_intern_prop): New arg force_symbol.
6 (font_parse_xlfd): Adjusted for the change of font_intern_prop. 12 (font_parse_xlfd, font_parse_fcname, font_parse_family_registry):
7 (font_parse_fcname): Likewise. 13 Adjust for the change of font_intern_prop.
8 (font_parse_family_registry): Likewise.
9
10 * ftfont.c (ftfont_pattern_entity): Adjusted for the change of
11 font_intern_prop.
12
13 * w32font.c (add_font_name_to_list): Adjusted for
14 the change of font_intern_prop.
15 (w32_enumfont_pattern_entity): Likewise.
16 (w32_registry): Likewise.
17 14
18 * w32uniscribe.c (add_opentype_font_name_to_list): Adjusted for 15 * ftfont.c (ftfont_pattern_entity):
16 * w32font.c (add_font_name_to_list, w32_enumfont_pattern_entity)
17 (w32_registry):
18 * w32uniscribe.c (add_opentype_font_name_to_list): Adjust for
19 the change of font_intern_prop. 19 the change of font_intern_prop.
20 20
212008-06-09 Juanma Barranquero <lekktu@gmail.com> 212008-06-09 Juanma Barranquero <lekktu@gmail.com>
@@ -24,15 +24,15 @@
24 24
252008-06-09 Jason Rumney <jasonr@gnu.org> 252008-06-09 Jason Rumney <jasonr@gnu.org>
26 26
27 * w32term.c (x_make_frame_visible): Use alternate restore flags. 27 * w32term.c (x_make_frame_visible): Use alternate restore flags.
28 28
29 * w32menu.c (Fx_popup_menu): Unwind protect while building menu. 29 * w32menu.c (Fx_popup_menu): Unwind protect while building menu.
30 (parse_single_submenu): Remove. 30 (parse_single_submenu): Remove.
31 (digest_single_submenu): Remove. 31 (digest_single_submenu): Remove.
32 (syms_of_w32menu): Don't initialise variables that have moved 32 (syms_of_w32menu): Don't initialise variables that have moved
33 to menu.c. 33 to menu.c.
34 (set_frame_menubar): Sync with version in xmenu.c. 34 (set_frame_menubar): Sync with version in xmenu.c.
35 (w32_menu_show): Sync with xmenu_show in xmenu.c. 35 (w32_menu_show): Sync with xmenu_show in xmenu.c.
36 36
37 * menu.c (single_keymap_panes, push_menu_pane, push_menu_item): 37 * menu.c (single_keymap_panes, push_menu_pane, push_menu_item):
38 Make static again. 38 Make static again.
diff --git a/src/window.c b/src/window.c
index 7af0c6db711..27db0296dcf 100644
--- a/src/window.c
+++ b/src/window.c
@@ -167,6 +167,10 @@ static Lisp_Object Vwindow_configuration_change_hook;
167 167
168Lisp_Object Vscroll_preserve_screen_position; 168Lisp_Object Vscroll_preserve_screen_position;
169 169
170/* Non-nil means that text is inserted before window's markers. */
171
172Lisp_Object Vwindow_point_insertion_type;
173
170/* Incremented by 1 whenever a window is deleted. */ 174/* Incremented by 1 whenever a window is deleted. */
171 175
172int window_deletion_count; 176int window_deletion_count;
@@ -3420,6 +3424,8 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p)
3420 Fset_buffer (buffer); 3424 Fset_buffer (buffer);
3421 } 3425 }
3422 3426
3427 XMARKER (w->pointm)->insertion_type = !NILP (Vwindow_point_insertion_type);
3428
3423 if (!keep_margins_p) 3429 if (!keep_margins_p)
3424 { 3430 {
3425 /* Set left and right marginal area width etc. from buffer. */ 3431 /* Set left and right marginal area width etc. from buffer. */
@@ -3486,9 +3492,11 @@ This function runs the hook `window-scroll-functions'. */)
3486 else if (! EQ (tem, Qt)) /* w->buffer is t when the window 3492 else if (! EQ (tem, Qt)) /* w->buffer is t when the window
3487 is first being set up. */ 3493 is first being set up. */
3488 { 3494 {
3489 if (!NILP (w->dedicated) && !EQ (tem, buffer)) 3495 if (!EQ (tem, buffer))
3490 error ("Window is dedicated to `%s'", 3496 if (EQ (w->dedicated, Qt))
3491 SDATA (XBUFFER (tem)->name)); 3497 error ("Window is dedicated to `%s'", SDATA (XBUFFER (tem)->name));
3498 else
3499 w->dedicated = Qnil;
3492 3500
3493 unshow_buffer (w); 3501 unshow_buffer (w);
3494 } 3502 }
@@ -7151,6 +7159,10 @@ by full screens.
7151Any other value means point always keeps its screen position. */); 7159Any other value means point always keeps its screen position. */);
7152 Vscroll_preserve_screen_position = Qnil; 7160 Vscroll_preserve_screen_position = Qnil;
7153 7161
7162 DEFVAR_LISP ("window-point-insertion-type", &Vwindow_point_insertion_type,
7163 doc: /* Type of marker to use for `window-point'. */);
7164 Vwindow_point_insertion_type = Qnil;
7165
7154 DEFVAR_LISP ("window-configuration-change-hook", 7166 DEFVAR_LISP ("window-configuration-change-hook",
7155 &Vwindow_configuration_change_hook, 7167 &Vwindow_configuration_change_hook,
7156 doc: /* Functions to call when window configuration changes. 7168 doc: /* Functions to call when window configuration changes.