From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7804 invoked by alias); 1 Sep 2015 06:53:49 -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: 36361 Received: (qmail 20199 invoked from network); 1 Sep 2015 06:53:49 -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:mime-version:content-type; bh=SfjeOqyzHG642YhyrzRK9Pe61h5nGf0i+urQApbgkYI=; b=Ub2zfQJ3KviTZ8TpRj/bs3ksAp+BxB2EPpmiAlNFV16icKBDdNDcPKRBfyDs6YGA0m s4eCWboJfElWC7roiXJXTR5oDZ/1kRVwE4lfu5ZUyLveAmbTzgDRc+SPM0bp8778MyOo F+kFqnSVc2ha5W83wNucKawXg4J+xbbfX4mR8QUdRVqb7Qc16Um31Tj5MI/cyYWzzYLf +oQFAj0H0VSMj04NFzcvx6f740/0L+iSphmdUHeEXWKoo0PE4zW5vav/8NJjxwQOP6U6 OSknFSa4IhhH+68yQEbYuk1Mr3a9U02eRt4Y2am9uZtj55DJ2BMrsqMvO9602+4N4+5y Sl0Q== X-Gm-Message-State: ALoCoQlAMJIoIXIi9x7PP4ty4Uk9PNRuoVMAnNP0oeYqj76CUEc59z3cS3uB9il955ZiaHTLVvx4 X-Received: by 10.182.236.102 with SMTP id ut6mr16537802obc.75.1441090427748; Mon, 31 Aug 2015 23:53:47 -0700 (PDT) From: Bart Schaefer Message-Id: <150831235345.ZM1001@torch.brasslantern.com> Date: Mon, 31 Aug 2015 23:53:45 -0700 In-Reply-To: <1441087664-9081-1-git-send-email-mikachu@gmail.com> Comments: In reply to Mikael Magnusson "PATCH v2 (complete): Implement zle -P" (Sep 1, 8:07am) References: <1441087664-9081-1-git-send-email-mikachu@gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: PATCH v2 (complete): Implement zle -P MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I'd forgotten that I originally suggested "zle -P" ... On Sep 1, 8:07am, Mikael Magnusson wrote: } } I can now do this (which is why I originally found this old thread, if } anyone was curious): } } function _start_paste() { } local content } local a b } local oldcutbuf="$CUTBUFFER" } # I haven't quite decided how I want to control quoting yet. } [[ $_SPACE_AFTER_PASTE_QUOTE = 1 ]]; a=$? } (( $+NUMERIC )) || [[ $KEYS = $'\e\e'* ]]; b=$? } zle .$WIDGET -N content } if [[ $a -ne $b ]]; then } CUTBUFFER=${(q-)content}' ' } else } CUTBUFFER=$content } fi } zle .yank } CUTBUFFER="$oldcutbuf" } } } zle -P bracketed-paste bracketed-paste _start_paste So I think this is: autoload -Uz bracketed-paste-magic zle -N bracketed-paste bracketed-paste-magic zstyle :bracketed-paste-magic paste-finish quote-paste zstyle -e :bracketed-paste-magic:finish quote-style \ '() { local a b; [[ $_SPACE_AFTER_PASTE_QUOTE = 1 ]]; a=$?; (( $+NUMERIC )) || [[ $KEYS = $'\''\e\e'\''* ]]; b=$? ; [[ $a -ne $b ]] } && reply=(q-) || reply=(none)' BTW what's the point of doing "zle .$WIDGET ..." when the only widget this can possibly work with is .bracketed-paste ?