From unknown Sat Aug 16 11:11:24 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15457 <15457@debbugs.gnu.org> To: bug#15457 <15457@debbugs.gnu.org> Subject: Status: 24.3.50; buffer local `window-point-insertion-type' Reply-To: bug#15457 <15457@debbugs.gnu.org> Date: Sat, 16 Aug 2025 18:11:24 +0000 retitle 15457 24.3.50; buffer local `window-point-insertion-type' reassign 15457 emacs submitter 15457 michael_heerdegen@web.de severity 15457 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 24 13:19:59 2013 Received: (at submit) by debbugs.gnu.org; 24 Sep 2013 17:19:59 +0000 Received: from localhost ([127.0.0.1]:32859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VOWHG-00048Y-Gr for submit@debbugs.gnu.org; Tue, 24 Sep 2013 13:19:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45293) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VOWHE-00048L-Ny for submit@debbugs.gnu.org; Tue, 24 Sep 2013 13:19:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOWH2-0007aD-DS for submit@debbugs.gnu.org; Tue, 24 Sep 2013 13:19:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOWH2-0007a9-AS for submit@debbugs.gnu.org; Tue, 24 Sep 2013 13:19:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOWGw-0003DF-2w for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2013 13:19:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOWGp-0007ZP-P1 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2013 13:19:38 -0400 Received: from mout.web.de ([212.227.17.12]:60919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOWGp-0007Yz-G4 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2013 13:19:31 -0400 Received: from drachen.dragon ([188.110.142.205]) by smtp.web.de (mrweb004) with ESMTPA (Nemesis) id 0MN87U-1VV7yy0l9k-006d88 for ; Tue, 24 Sep 2013 19:19:28 +0200 From: Michael Heerdegen To: bug-gnu-emacs@gnu.org Subject: 24.3.50; buffer local `window-point-insertion-type' Date: Tue, 24 Sep 2013 19:18:59 +0200 Message-ID: <87d2nycf3w.fsf@web.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:bUouudfhmqi/bR3p7nazAhqZNvNgY29balK2YVY/LqHqXma734p guAVvX6s1YUhKkflIgESVtKGNbcIEakwsQ8YCiSMNEQnNC+9MrEULmX+aYNGyLUe216c+oB 7NdUKUaOCwT70JFw53eIBKRTD4+OE8nt5Rxh9VG7Bs9dUD5NjauvDiYMaMDH5vU7XxrHV0q b/dxyLHOIErGB/Y0xyw1A== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: michael_heerdegen@web.de List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=insertion-type-bug.el Content-Transfer-Encoding: quoted-printable (defun window-point-insertion-type-test (&optional make-local) (let ((buffer (generate-new-buffer "window-point-insertion-type-test")) w= in timer) (with-current-buffer buffer (set (if make-local (make-local-variable 'window-point-insertion-type) 'window-point-insertion-type) t)) (split-window-below) (sit-for .1) (setq win (cadr (window-list nil nil (selected-window)))) (set-window-buffer win buffer) (setq timer (run-with-idle-timer .1 .1 (lambda (b w) (with-current-buffer b (insert (format "%s\n" (current-time-string))) (set-window-point w (point-max)))) buffer win)) (unwind-protect (read-string "Just a recursive edit, enter a short stri= ng, then hit RET: ") (cancel-timer timer)))) --=-=-= Content-Type: text/plain 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) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 10:00:50 2014 Received: (at 15457-done) by debbugs.gnu.org; 16 Apr 2014 14:00:50 +0000 Received: from localhost ([127.0.0.1]:49761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WaQOP-0003c9-FZ for submit@debbugs.gnu.org; Wed, 16 Apr 2014 10:00:50 -0400 Received: from relais.videotron.ca ([24.201.245.36]:18958) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WaQOM-0003bz-C8 for 15457-done@debbugs.gnu.org; Wed, 16 Apr 2014 10:00:47 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from ceviche.home ([24.201.53.56]) by VL-VM-MR001.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N4400C7FMX8X440@VL-VM-MR001.ip.videotron.ca> for 15457-done@debbugs.gnu.org; Wed, 16 Apr 2014 10:00:45 -0400 (EDT) Received: by ceviche.home (Postfix, from userid 20848) id AFDB166644; Wed, 16 Apr 2014 10:00:44 -0400 (EDT) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#15457: 24.3.50; buffer local `window-point-insertion-type' Message-id: References: <87d2nycf3w.fsf@web.de> Date: Wed, 16 Apr 2014 10:00:44 -0400 In-reply-to: <87d2nycf3w.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 15457-done Cc: 15457-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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, From unknown Sat Aug 16 11:11:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 15 May 2014 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator