From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#33532: 26.1; set-window-configuration does not restore display start Date: Tue, 04 Dec 2018 09:33:14 +0100 Message-ID: <5C063BCA.3090301@gmx.at> References: <87efb62mt2.fsf@metalevel.at> <83o9a9g0ui.fsf@gnu.org> <877egxyvje.fsf@metalevel.at> <5BFFA3FB.4060603@gmx.at> <8736rj4uxg.fsf@metalevel.at> <5C0039D0.2090309@gmx.at> <877eguqz7k.fsf@metalevel.at> <5C0177B2.4030803@gmx.at> <87va4cdfll.fsf@mail.linkov.net> <5C03991F.8030204@gmx.at> <87ftvftoaq.fsf@mail.linkov.net> <5C04DF22.3030100@gmx.at> <87a7lmqkry.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070706020308090208010404" X-Trace: blaine.gmane.org 1543912334 16929 195.159.176.226 (4 Dec 2018 08:32:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Dec 2018 08:32:14 +0000 (UTC) Cc: 33532@debbugs.gnu.org, Markus Triska To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 04 09:32:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gU67k-0004H2-26 for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Dec 2018 09:32:08 +0100 Original-Received: from localhost ([::1]:54571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gU69q-0004N0-P1 for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Dec 2018 03:34:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gU69d-0004La-Fg for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 03:34:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gU69a-00063T-BH for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 03:34:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55509) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gU69a-00063P-7c for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 03:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gU69a-00048L-4E for bug-gnu-emacs@gnu.org; Tue, 04 Dec 2018 03:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Dec 2018 08:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33532-submit@debbugs.gnu.org id=B33532.154391241215827 (code B ref 33532); Tue, 04 Dec 2018 08:34:02 +0000 Original-Received: (at 33532) by debbugs.gnu.org; 4 Dec 2018 08:33:32 +0000 Original-Received: from localhost ([127.0.0.1]:59763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gU696-00047D-5P for submit@debbugs.gnu.org; Tue, 04 Dec 2018 03:33:32 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:53327) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gU694-00046x-HC for 33532@debbugs.gnu.org; Tue, 04 Dec 2018 03:33:31 -0500 Original-Received: from [192.168.1.101] ([213.162.73.140]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (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RMRDqFg8FRFdYvO6J1xlfZs/gyof6DZz32djsASQTdEoSKxjeiefvQdZBdP7v wnX0Wrj06B4xSJ9A+HpQXPLCfI2nEhsyqPUEZ4QA/50JJNUCZ9W832dnIxj3wEW0kkSGu0Rf X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:153060 Archived-At: This is a multi-part message in MIME format. --------------070706020308090208010404 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > What do you think about implementing the same behavior for > markers like it's implemented by 'comint-move-point-for-output'? > I.e. the same way as 'comint-move-point-for-output' moves point > to the end of the output, after erasing the buffer markers could > move their positions towards their previous valid position until > there is enough reverted text that they reach the old position. > > This is straightforward to implement. I see print.c has a question > in the comments: > > case PVEC_MARKER: > print_c_string ("# /* Do you think this is necessary? */ > if (XMARKER (obj)->insertion_type != 0) > print_c_string ("(moves after insertion) ", printcharfun); > > I think this is necessary. And this 'insertion_type' could also > move after insertion until it reaches its old position in the > reverted buffer. 'auto-revert-tail-mode' already has (when buffer-file-name (setq eob (eobp)) (walk-windows (lambda (window) (and (eq (window-buffer window) buffer) (= (window-point window) (point-max)) (push window eoblist))) 'no-mini t)) plus (when buffer-file-name (when eob (goto-char (point-max))) (dolist (window eoblist) (set-window-point window (point-max))))) without changing the markers' point insertion types. We can easily extend that to handle a window's previous buffers' points. But changing the insertion type of markers is far too delicate with all the implications Eli cited. We should avoid that wherever possible. BTW, the last patch I sent was needlessly complicated - a window's next buffers don't have any markers. I attach a better one. martin --------------070706020308090208010404 Content-Type: text/plain; charset=windows-1252; name="fileio.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="fileio.diff" ZGlmZiAtLWdpdCBhL3NyYy9maWxlaW8uYyBiL3NyYy9maWxlaW8uYwppbmRleCBkOTc5NTcx Li5iM2ZkYzYwIDEwMDY0NAotLS0gYS9zcmMvZmlsZWlvLmMKKysrIGIvc3JjL2ZpbGVpby5j CkBAIC0zNTEzLDIzICszNTEzLDU5IEBAIENPTlRFWFQgc2hvdWxkIGJlIGEgbGlzdCAoVVNF UiBST0xFIFRZUEUgUkFOR0UpLCB3aGVyZSB0aGUgbGlzdAogc3RhdGljIExpc3BfT2JqZWN0 CiBnZXRfd2luZG93X3BvaW50c19hbmRfbWFya2VycyAodm9pZCkKIHsKKyAgTGlzcF9PYmpl Y3QgYnVmZmVyID0gRmN1cnJlbnRfYnVmZmVyICgpOwogICBMaXNwX09iamVjdCBwdF9tYXJr ZXIgPSBGcG9pbnRfbWFya2VyICgpOwotICBMaXNwX09iamVjdCB3aW5kb3dzCi0gICAgPSBj YWxsMyAoUWdldF9idWZmZXJfd2luZG93X2xpc3QsIEZjdXJyZW50X2J1ZmZlciAoKSwgUW5p bCwgUXQpOwotICBMaXNwX09iamVjdCB3aW5kb3dfbWFya2VycyA9IHdpbmRvd3M7Ci0gIC8q IFdpbmRvdyBtYXJrZXJzIChhbmQgcG9pbnQpIGFyZSBoYW5kbGVkIHNwZWNpYWxseTogcmF0 aGVyIHRoYW4gbW92ZSB0bwotICAgICBqdXN0IGJlZm9yZSBvciBqdXN0IGFmdGVyIHRoZSBt b2RpZmllZCB0ZXh0LCB3ZSB0cnkgdG8ga2VlcCB0aGUKLSAgICAgbWFya2VycyBhdCB0aGUg c2FtZSBkaXN0YW5jZSAoYnVnIzE5MTYxKS4KLSAgICAgSW4gZ2VuZXJhbCwgdGhpcyBpcyB3 cm9uZywgYnV0IGZvciB3aW5kb3ctbWFya2VycywgdGhpcyBzaG91bG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ydzIHByZXZpb3Vz IGJ1ZmZlcnMuICAqLwogICBmb3IgKDsgQ09OU1AgKHdpbmRvd3MpOyB3aW5kb3dzID0gWENE UiAod2luZG93cykpCi0gICAgaWYgKFdJTkRPV1AgKFhDQVIgKHdpbmRvd3MpKSkKKyAgICBp ZiAoV0lORE9XX0xJVkVfUCAod2luZG93ID0gWENBUiAod2luZG93cykpKQogICAgICAgewot CUxpc3BfT2JqZWN0IHdpbmRvd19tYXJrZXIgPSBYV0lORE9XIChYQ0FSICh3aW5kb3dzKSkt PnBvaW50bTsKLQlYU0VUQ0FSICh3aW5kb3dzLAotCQkgRmNvbnMgKHdpbmRvd19tYXJrZXIs IEZtYXJrZXJfcG9zaXRpb24gKHdpbmRvd19tYXJrZXIpKSk7CisJc3RydWN0IHdpbmRvdyAq dyA9IFhXSU5ET1cgKHdpbmRvdyk7CisJTGlzcF9PYmplY3QgcHJldl9idWZmZXJzID0gdy0+ cHJldl9idWZmZXJzOworCisJLyogTG9vayBhdCB3aW5kb3cncyBidWZmZXIgZmlyc3QuICAq LworCWlmIChFUSAoV0lORE9XX0JVRkZFUiAodyksIGJ1ZmZlcikpCisJICB7CisJICAgIExp c3BfT2JqZWN0IHdpbmRvd19tYXJrZXIgPSBYV0lORE9XIChYQ0FSICh3aW5kb3dzKSktPnBv aW50bTsKKworCSAgICB3aW5kb3dfbWFya2VycyA9CisJICAgICAgRmNvbnMgKEZjb25zICh3 aW5kb3dfbWFya2VyLCBGbWFya2VyX3Bvc2l0aW9uICh3aW5kb3dfbWFya2VyKSksCisJCSAg ICAgd2luZG93X21hcmtlcnMpOworCisJICAgIC8qIFNraXAgdGhlIGxpc3Qgb2YgcHJldmlv dXMgYnVmZmVycy4gICovCisJICAgIGNvbnRpbnVlOworCSAgfQorCisJLyogU2NhbiB3aW5k b3cncyBwcmV2aW91cyBidWZmZXJzLiAgKi8KKwlmb3IgKDsgQ09OU1AgKHByZXZfYnVmZmVy cyk7IHByZXZfYnVmZmVycyA9IFhDR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