From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13322 invoked by alias); 24 Dec 2016 08:28:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40230 Received: (qmail 3454 invoked from network); 24 Dec 2016 08:28:55 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk0-f50.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.213.50):SA:0(-0.0/5.0):. Processed in 1.144544 secs); 24 Dec 2016 08:28:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.213.50 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=MM9tf13z8bLf4VxKu7s9zejHmhTnlm/GUqdSeswDthc=; b=JAaMsxF5jUocCqjxZWl0lX9Nb4CAQCB2FxWEfRZJYBDBvwRzwLPm3uOGp00C3lHMg6 4tTObHBmD4BaNvpqqeIaNi3ztLbMmk9IRlJzkQT0A1EjUCg18eeNZWXUEW24FPtYd+67 iWMXep78TRaSyMMj/KxgCXiIJvY9oVf8HDg/ANKR+ekA/cR4WcF9+4Yh0iIUaPhMS2If 6RPkCQhpBPK5rrFl2Pz5kReJBBAUVixQIauUF6ode04RlFa+uQxs+ZFo2Ueuj7ZOuTU2 1UjJhecgBkhAouqnmLoBFZVJD4KJj8SJwHXXOwkB8JrOBABQ/TM+BjOCoJzxHl87eOr/ ZD9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=MM9tf13z8bLf4VxKu7s9zejHmhTnlm/GUqdSeswDthc=; b=m80aNj9UNWbyajxzi/jyDL7t1yAHEwiOdYUWN3Ay+jIEyBAl1UVKqRdtzB/XEFRQiL myi2ZvvUu7VJvi4NkFp32g1xSyh01ISckAdhNnbpvmXEdPZL/hARjoIYrmiVNFN+X+p6 BdZBeFn3gfA5a6+Yv6wKvbbfAxybr/+poMCUV6uzz1OVLcRxCkXvjFLOa+X/dMQOHiWJ oP4q/wPf+pqT4Be0AgKHeQe5e3J+Af5RJbzZML0B4IZj+L7uvRhWgNJ0AQ2YUduHqvOh wm88aZKNDflgywTR9+IYLHOU6VgnGmHdN9/NNETsGuKXaZAbZEPrANwL4zVHIACcXpSe 5Z+w== X-Gm-Message-State: AIkVDXLgypS26We52bmrLQ+8vrTx+/Vm+Z0amurW49AWGI60723e+wNzrK/b0wlrIqrduQ== X-Received: by 10.31.66.141 with SMTP id p135mr3268011vka.72.1482568124942; Sat, 24 Dec 2016 00:28:44 -0800 (PST) From: Bart Schaefer Message-Id: <161224002846.ZM27351@torch.brasslantern.com> Date: Sat, 24 Dec 2016 00:28:46 -0800 In-Reply-To: <13854.1481114391@hydra.kiddle.eu> Comments: In reply to Oliver Kiddle "Re: Regression in bracketed-paste-magic (not in 5.2, but affects 5.3's test releases)" (Dec 7, 1:39pm) References: <13854.1481114391@hydra.kiddle.eu> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: Regression in bracketed-paste-magic (not in 5.2, but affects 5.3's test releases) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Dec 7, 1:39pm, Oliver Kiddle wrote: } } In this particular case, the problem is that fc -p doesn't result } in a call to zle's remember_edits(). remember_edits() updates the } table of history entries for the current line. The edit associated } with doing BUFFER= CURSOR=1 is thus lost. So when it does the } undo, the line is first restored when the history line is reselected } and then the contents are duplicated when the effect of clearing } $BUFFER is undone. This reminds me of a question I had when 38579 was applied: What's the point of assigning CURSOR=1 here? If BUFFER is empty, the only valid value of CURSOR is 0 (isn't it?), and the assignment to BUFFER resets CURSOR implicitly as far as I can tell. } What I would suggest for 5.3 is the patch below. [...] } } If you're wondering why I suggest this rather than adding a hook } to call remember_edits(), it is because, for a proper post-5.3 } patch, fc -p wouldn't actually change the current history line. Now that 5.3.1 is out, I've re-commited bracketed-paste-magic to its state after 38579 plus the patch in this thread (40118), in spite of my question above. We can now begin fiddling with the proper post-5.3 fix to "fc -p".