From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15457: 24.3.50; buffer local `window-point-insertion-type' Date: Wed, 16 Apr 2014 10:00:44 -0400 Message-ID: References: <87d2nycf3w.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: ger.gmane.org 1397656897 31341 80.91.229.3 (16 Apr 2014 14:01:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Apr 2014 14:01:37 +0000 (UTC) Cc: 15457-done@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 16 16:01:29 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WaQP3-0007ek-E1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Apr 2014 16:01:29 +0200 Original-Received: from localhost ([::1]:54711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaQP2-00049v-SZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Apr 2014 10:01:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaQOn-00047R-9H for bug-gnu-emacs@gnu.org; Wed, 16 Apr 2014 10:01:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WaQOd-0001gu-TE for bug-gnu-emacs@gnu.org; Wed, 16 Apr 2014 10:01:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WaQOd-0001gU-Pe for bug-gnu-emacs@gnu.org; Wed, 16 Apr 2014 10:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WaQOd-0003cv-5Z for bug-gnu-emacs@gnu.org; Wed, 16 Apr 2014 10:01:03 -0400 Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Apr 2014 14:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 15457 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 15457@debbugs.gnu.org, monnier@iro.umontreal.ca, michael_heerdegen@web.de Original-Received: via spool by 15457-done@debbugs.gnu.org id=D15457.139765685013906 (code D ref 15457); Wed, 16 Apr 2014 14:01:02 +0000 Original-Received: (at 15457-done) by debbugs.gnu.org; 16 Apr 2014 14:00:50 +0000 Original-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 Original-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 Original-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) Original-Received: by ceviche.home (Postfix, from userid 20848) id AFDB166644; Wed, 16 Apr 2014 10:00:44 -0400 (EDT) In-reply-to: <87d2nycf3w.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88055 Archived-At: > 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,