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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15457 in the body.
You can then email your comments to 15457 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15457; Package emacs. (Tue, 24 Sep 2013 17:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to michael_heerdegen <at> web.de:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 24 Sep 2013 17:20:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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 1 (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 3 (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)



Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 16 Apr 2014 14:01:02 GMT) Full text and rfc822 format available.

Notification sent to michael_heerdegen <at> web.de:
bug acknowledged by developer. (Wed, 16 Apr 2014 14:01:03 GMT) Full text and rfc822 format available.

Message #10 received at 15457-done <at> debbugs.gnu.org (full text, mbox):

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,





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 15 May 2014 11:24:03 GMT) Full text and rfc822 format available.

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

Previous Next


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