From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8063 invoked from network); 28 Jul 2020 10:31:29 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 28 Jul 2020 10:31:29 -0000 Received: (qmail 21241 invoked by alias); 28 Jul 2020 10:31:20 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: Sender: zsh-users@zsh.org X-Seq: 25005 Received: (qmail 18571 invoked by uid 1010); 28 Jul 2020 10:31:20 -0000 X-Qmail-Scanner-Diagnostics: from pepin.polanet.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25884. spamassassin: 3.4.4. Clear:RC:0(193.34.52.2):SA:0(-1.9/5.0):. Processed in 1.989832 secs); 28 Jul 2020 10:31:20 -0000 X-Envelope-From: gotar@polanet.pl X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at polanet.pl designates 193.34.52.2 as permitted sender) Date: Tue, 28 Jul 2020 12:30:39 +0200 From: Tomasz Pala To: zsh-users@zsh.org Subject: zle - keep state of the buffer on accept-and-hold or hold only part Message-ID: <20200728103038.GA7887@polanet.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi there, I wonder if it is possible to retain entire state of the command line buffer on accept-and-hold, I'm looking especially for mark location ("^@" set-mark-command) and possibly the undo history. Or hold only a part of the command line? My usage scenario follows - consider having (not so) many files with similar names, like date/counter-suffixed. I need to perform some operations on them, one by one (the commands slightly differ, assume it's not scriptable worthy), e.g. [1] xsltproc style.xslt file_200701.xml [alt-a: accept-and-hold] [2] xsltproc style.xslt file_200701.xml | grep -v some_spam [accept-and-hold] [3] xsltproc style.xslt file_200701.xml | grep -i sth_interesting | actual command [accept-and-hold] [1] xsltproc style.xslt file_200702.xml [accept-and-hold] [2] xsltproc style.xslt file_200702.xml | grep -v something_other [...] Now, I got the " | grep -i sth_interesting | actual command" in xterm PRIMARY and insert it fast with alt-shift-insert - so the [3] line is fine. The [2] line changes depending on xsltproc output, it's written ad-hoc, no optimization can be made. However, most of the time I'm wasting is on going back to the point: xsltproc style.xslt file_2007 <- here. I can set a mark (ctrl-space) and then kill entire region, but the mark doesn't propagate to the buffer after accept-and-hold. Alternatively, and ideally, I would like to set a mark for a accept-and-hold to retain only preceeding part of the buffer, e.g.: $ xsltproc style.xslt file_2007 [ctrl-space: set-mark-command] [tab completion to select some files] | some commands [alt-a: accept-and-hold] $ xsltproc style.xslt file_2007 TIA, best regards, -- Tomasz Pala