GNU bug report logs - #15457
24.3.50; buffer local `window-point-insertion-type'

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Tue, 24 Sep 2013 17:20:02 UTC

Severity: normal

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: michael_heerdegen <at> web.de
Subject: bug#15457: closed (Re: bug#15457: 24.3.50; buffer local
 `window-point-insertion-type')
Date: Wed, 16 Apr 2014 14:01:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#15457: 24.3.50; buffer local `window-point-insertion-type'

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 15457 <at> debbugs.gnu.org.

-- 
15457: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15457
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 15457-done <at> debbugs.gnu.org
Subject: Re: bug#15457: 24.3.50; buffer local `window-point-insertion-type'
Date: Wed, 16 Apr 2014 10:00:44 -0400
> 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,


[Message part 3 (message/rfc822, inline)]
From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; buffer local `window-point-insertion-type'
Date: Tue, 24 Sep 2013 19:18:59 +0200
[Message part 4 (text/plain, inline)]
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 (application/emacs-lisp, attachment)]
[Message part 6 (text/plain, inline)]



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)



This bug report was last modified 11 years and 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.