--- Begin Message ---
Subject: |
24.3.50; buffer local `window-point-insertion-type' |
Date: |
Tue, 24 Sep 2013 19:18:59 +0200 |
Hello,
while experimenting with my logging mode, I stumbled over an
inconsistency regarding `window-point-insertion-type'. Recipe from
emacs -Q:
(1) Eval the attached defun
(2a) Eval (window-point-insertion-type-test t)
Result: After hitting RET (or C-g), window-point of the second window is
restored to the value it had before the recursive edit (i.e. 1 in this
case).
Now, repeat the recipe, but with
(2b) Eval (window-point-insertion-type-test nil)
Result: window-point in the second window remains at the end of the
buffer.
`window-point-insertion-type' is always bound to t in the test buffer;
the difference between the two recipes is just that it is set to t
buffer-locally in (2a), and globally in (2b). I would expect that the
behavior is identical for both recipes.
BTW, for my mode, I want the behavior of (2b), but, of course, without
modifying a global variable binding. let-binding also doesn't help.
Thanks,
Michael.
insertion-type-bug.el
Description: application/emacs-lisp
In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.4)
of 2013-09-24 on drachen
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description: Debian GNU/Linux testing (jessie)
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#15457: 24.3.50; buffer local `window-point-insertion-type' |
Date: |
Wed, 16 Apr 2014 10:00:44 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> while experimenting with my logging mode, I stumbled over an
> inconsistency regarding `window-point-insertion-type'. Recipe from
> emacs -Q:
> (1) Eval the attached defun
> (2a) Eval (window-point-insertion-type-test t)
> Result: After hitting RET (or C-g), window-point of the second window is
> restored to the value it had before the recursive edit (i.e. 1 in this
> case).
> Now, repeat the recipe, but with
> (2b) Eval (window-point-insertion-type-test nil)
> Result: window-point in the second window remains at the end of the
> buffer.
That seems to be because the insertion type of the markers saved by
window-configuration is determined by the value of
window-point-insertion-type in the current-buffer rather than each
window's buffer.
I installed the patch below into emacs-24, which should fix it,
Stefan
=== modified file 'src/window.c'
--- src/window.c 2014-03-07 15:11:12 +0000
+++ src/window.c 2014-04-16 13:58:18 +0000
@@ -55,6 +55,7 @@
static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
static Lisp_Object Qsafe, Qabove, Qbelow, Qwindow_size, Qclone_of;
static Lisp_Object Qfloor, Qceiling;
+static Lisp_Object Qwindow_point_insertion_type;
static int displayed_window_lines (struct window *);
static int count_windows (struct window *);
@@ -124,7 +125,7 @@
/* Hook to run when window config changes. */
static Lisp_Object Qwindow_configuration_change_hook;
-/* Used by the function window_scroll_pixel_based */
+/* Used by the function window_scroll_pixel_based. */
static int window_scroll_pixel_based_preserve_x;
static int window_scroll_pixel_based_preserve_y;
@@ -6618,7 +6619,8 @@
else
p->pointm = Fcopy_marker (w->pointm, Qnil);
XMARKER (p->pointm)->insertion_type
- = !NILP (Vwindow_point_insertion_type);
+ = !NILP (buffer_local_value_1 /* Don't signal error if void. */
+ (Qwindow_point_insertion_type, w->contents));
p->start = Fcopy_marker (w->start, Qnil);
p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;
@@ -7235,6 +7237,7 @@
DEFVAR_LISP ("window-point-insertion-type", Vwindow_point_insertion_type,
doc: /* Type of marker to use for `window-point'. */);
Vwindow_point_insertion_type = Qnil;
+ DEFSYM (Qwindow_point_insertion_type, "window_point_insertion_type");
DEFVAR_LISP ("window-configuration-change-hook",
Vwindow_configuration_change_hook,
--- End Message ---