From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10361 invoked by alias); 18 Aug 2015 07:05:16 -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: 36213 Received: (qmail 19455 invoked from network); 18 Aug 2015 07:05:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:cc:mime-version:content-type; bh=WBh001acNnE7rPy2F30UIuodfXEuyLdW3yT/FTKyjbM=; b=Skh1uGrT+0HbSIRSKpVYx+BOWZIXuKAv3E0KCDF8VY5z3SPB1yx3g/ezuZBnvrYUDo WzZ/tbpmuPSPV1zpos0tv5XDnj7bCQrk2/aJM9Tgj0qV0QJO8AjHj1am8nR/zxKKOo64 EWj2b4FaceCb57ev/vqaIELUNSYp08Kpg292lP7UvNge2IWePaN+ET8pZPK5aIpCvb2K blPTA1USFZ/fafw/vM9Fj9fRDUxDC5UzjEYsYY95QYQVfzoUJqOW2KFq++hAuUOu6aiJ +arIO1IupJNeARQ5z7XGmOE84+dqC1qO/njJWnGBMUdeI5s7y+Zfj0UkMyl8RwXafhjg nVLg== X-Gm-Message-State: ALoCoQlxdfwlrCyAG/kRrUJ8XhnMCQUFVv2O4TWCcodYSjb72xH79kMpVelbi5ByujLiIvXAvphG X-Received: by 10.202.219.67 with SMTP id s64mr4052138oig.25.1439881512896; Tue, 18 Aug 2015 00:05:12 -0700 (PDT) From: Bart Schaefer Message-Id: <150818000503.ZM28698@torch.brasslantern.com> Date: Tue, 18 Aug 2015 00:05:03 -0700 In-Reply-To: <55D24EDF.1060202@thequod.de> Comments: In reply to Daniel Hahler "Re: PATCH: Re: Undo and narrow-to-region (was ...)" (Aug 17, 11:15pm) References: <150620102144.ZM5618@torch.brasslantern.com> <150718164224.ZM4759@torch.brasslantern.com> <19747.1437278114@thecus.kiddle.eu> <150719012304.ZM18439@torch.brasslantern.com> <9927.1437383950@thecus.kiddle.eu> <150722224101.ZM14105@torch.brasslantern.com> <29489.1438011895@thecus.kiddle.eu> <6736.1439398803@thecus.kiddle.eu> <55D24EDF.1060202@thequod.de> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: PATCH: Re: Undo and narrow-to-region (was ...) Cc: Daniel Hahler MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 17, 11:15pm, Daniel Hahler wrote: } } function _history-incremental-preserving-pattern-search-backward } { } local state } MARK=CURSOR # magick, else multiple ^R don't work } narrow-to-region -p "$LBUFFER${BUFFER:+>>}" -P "${BUFFER:+<<}$RBUFFER" -S state } zle end-of-history } zle history-incremental-pattern-search-backward } narrow-to-region -R state } } Incidentally, the MARK=CURSOR "magick" doesn't seem to be needed any more with the most recent revision of narrow-to-region. However, if you remove that, then the retrieved history will *replace* whatever text starts out in the region between MARK and CURSOR. (This is consistent with what bracketed-paste does, if that matters.) -- Barton E. Schaefer