From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.bugs Subject: bug#23906: 25.0.95; Undo boundary after process output is not consistent Date: Mon, 11 Jul 2016 12:45:42 +0100 Message-ID: <87h9bw5rfd.fsf@russet.org.uk> References: <83r3b6lih2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468237595 25791 80.91.229.3 (11 Jul 2016 11:46:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jul 2016 11:46:35 +0000 (UTC) Cc: Markus Triska , 23906@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 11 13:46:24 2016 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 1bMZfL-0005l2-9n for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Jul 2016 13:46:23 +0200 Original-Received: from localhost ([::1]:32936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMZfC-000180-66 for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Jul 2016 07:46:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMZf6-00017q-0K for bug-gnu-emacs@gnu.org; Mon, 11 Jul 2016 07:46:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMZf0-0005qq-H5 for bug-gnu-emacs@gnu.org; Mon, 11 Jul 2016 07:46:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMZf0-0005qm-Cr for bug-gnu-emacs@gnu.org; Mon, 11 Jul 2016 07:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bMZf0-0007qm-5M for bug-gnu-emacs@gnu.org; Mon, 11 Jul 2016 07:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: phillip.lord@russet.org.uk (Phillip Lord) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jul 2016 11:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23906 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23906-submit@debbugs.gnu.org id=B23906.146823755330160 (code B ref 23906); Mon, 11 Jul 2016 11:46:02 +0000 Original-Received: (at 23906) by debbugs.gnu.org; 11 Jul 2016 11:45:53 +0000 Original-Received: from localhost ([127.0.0.1]:46114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMZer-0007qO-E5 for submit@debbugs.gnu.org; Mon, 11 Jul 2016 07:45:53 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:38809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMZeo-0007q9-0h for 23906@debbugs.gnu.org; Mon, 11 Jul 2016 07:45:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From; bh=w43L0mZocSU78nhQ/HUpBBFn1lrdOH+QEORvrS0hQoE=; b=YbvRENkGeqXBYhET8aVwRmYdQ0 jw0tdbbgNSeqSDmQDa221mNTnOkmr5FcxIElUU4X3xVOVH9/Rj6xMcMIhH56eCXoQpELWbLH8y8h/ Qht/bjDWFCurM14A8cJapd8EjUe8Ul/oXlB49vzgrBR7/j2w9VFVQiZeETpUJdBBOhU/jpJjcT3dt HO/0ZY57aZEDzRx8ckzI8ydKVtXChQjJDO6L2uIG/V9M5VwyLx3mMWa6w3FOhk7qVszLQUiqtwwGA A8OMM48f2BaEZ8srkI9qGBcMFym0i+UX3cOEeWtL50peb2hAsoXetYiySBC7x1mwffqbDjiO30zgJ uOffDCsg==; Original-Received: from janus-nat-128-240-225-60.ncl.ac.uk ([128.240.225.60]:32959 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bMZeh-001jnb-SX; Mon, 11 Jul 2016 12:45:43 +0100 In-Reply-To: <83r3b6lih2.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 06 Jul 2016 21:38:49 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk 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:120838 Archived-At: Eli Zaretskii writes: >> From: Markus Triska >> Date: Wed, 06 Jul 2016 19:56:30 +0200 >> >> 7) Now the point: *Most* of the time, after undo, the buffer is exactly >> as it was before. But sometimes, about 1 out of 7 times, after undo >> is pressed, the characters "%@ " remain at the end of the buffer: >> >> %?- time(ceiled_square_root(2^10000, R)). >> %@ >> >> These three characters ("%@ ") are inserted by ediprolog before >> receiving process output, and in most cases removed after the undo. >> >> The issue in this case is not so much that the %@ appears in the buffer, >> but that it is not handled consistently. Most often (and preferably), a >> single undo removes both the process output _and_ the %@, but sometimes >> a single undo removes *only* the process output, and the %@ remains. The >> behaviour I desire is that C-/ consistently removes everything that was >> inserted in direct sequence, both the "%@ " _and_ the process output. > > Given the fact that (AFAIU) undo for subprocesses is caught by code > that runs off a timer, isn't the above expected? Phillip? Assuming that ceiled_square_root takes a significant length of time (10/7 seconds in this case!), yes, I think this is the case. I assume that the %@ is inserted first before the process is started, then the results put in after the results come back? This would mean that after the insertion of %@ there would be no undo-boundary. You could check by adding %@ immediately before you insert data from prolog, rather than after you send data to it. To me, this makes more sense -- you are adding text over an elongated period (i.e. during the evaluation) without the expectation of an undo boundary. Likewise, forcing an undo-boundary immediately after %@ would give you consistent behaviour (although different). There are a number of fixes we could make for this in the undo system. I could check for the size of the last undo, before forcing an undo-boundary. Or, we could add an option to suppress the timer in a specific buffer; although, this would add the possibility of out-of-memory if it's not turned on again. In this case, though, I am inclined toward suggesting changing ediprolog.el. Phil