From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10092 invoked by alias); 15 Nov 2017 17:10:37 -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: X-Seq: 22984 Received: (qmail 326 invoked by uid 1010); 15 Nov 2017 17:10:37 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f176.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.216.176):SA:0(-1.4/5.0):. Processed in 3.373598 secs); 15 Nov 2017 17:10:37 -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=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM, SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9xplff8YBZ455a++dixvjGJqzknAogHcJkjgiDIbTys=; b=l65KuSTeHqcVHfc1GsBVcKinmMxDM7R48ldQ++Ac7cBE78sMQ6WNfTStmr1xDrPrps tEVRcA/vJPrOGRYc4TN+k+r73CdhWNpOlu5kPP6oud9CBLxBSb5QILqT4R44WEHTeAbt zko52QNMwXOVEc+ikcJB59mLzXnOb0XT7YFzktR84InEN98Q7dU4UKhEuqlanx9uateS vu10gheX1+7FxKgvf1menmGCU6f531YsUhZ8NgHr9M/npCJHDCQhvvr8mbMGOIYsO3/M kM6ZJhFIRiT4WS8xUZ7+M4LUcc/ToYAdVkZIYceZBHBrWW+aSGklVRJaDygSzY22uH4Y MBFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9xplff8YBZ455a++dixvjGJqzknAogHcJkjgiDIbTys=; b=Xwk+1Yi+9Tlhbcu0N5uHKpQAoGDeo2TxLHVZpBG56t3mNqJS4/Ox6drWHzhBA+ezuW a9QrzYx33kFUBFfSVk1t+DkLQtpSIkfLJNSF14PxHleYBcChzMu67dDebk24dVVaq3PA CH9ic13vdAaVxsN9GnwWrIQQH6QbKg1QGSnAQtKYEeI9jmelbDRff49LtFebD60yw666 bTXAuaVdEo1+BBr1bV+KPzNQutXFKa+WdGmEMnvgVwqltfX2Qz98J929Sywe0ZOYBGdj Ug42MenI9zlILsVXhPBDINVAjd+tvY/VLEAuJ323zkzxdBURD5Lhq8SrMWXfSI34bRpt 7olg== X-Gm-Message-State: AJaThX6kXmzk6xj+Gezczx5C2GVH/XPHEsa4vtl4R60VUn9Ywq+ti0wf RjR88yXbRKOJRQiy8wxNg0tmiCdXuph3getfOk0= X-Google-Smtp-Source: AGs4zMZwuqtgSJ+Y3L2GSFRj7uGogTF+KPPMsv88pd0zZkdZVTbBtDUCivj8ffo0Vl+2+PwCsLSXjHuKuQReekxNHJg= X-Received: by 10.200.1.72 with SMTP id f8mr24537616qtg.146.1510765830578; Wed, 15 Nov 2017 09:10:30 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20171115131326.cazeuiazwmfy5dmh@gentoo.gentoo> References: <20171115104034.p7evb5raltjlg2ja@gentoo.gentoo> <20171115112437.4b2633c1@pwslap01u.europe.root.pri> <20171115130047.oxs4xbetcb3hzuh3@gentoo.gentoo> <20171115131326.cazeuiazwmfy5dmh@gentoo.gentoo> From: Mikael Magnusson Date: Wed, 15 Nov 2017 18:10:29 +0100 Message-ID: Subject: Re: zle kill-region without mark consider start of line as mark To: Hadrien Lacour Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" REGION_ACTIVE (integer) Indicates if the region is currently active. It can be assigned 0 or 1 to deactivate and activate the region respectively. A value of 2 activates the region in line-wise mode with the highlighted text extending for whole lines only; see Character Highlighting below. On Wed, Nov 15, 2017 at 2:13 PM, Hadrien Lacour wrote: > On Wed, Nov 15, 2017 at 02:00:47PM +0100, Hadrien Lacour wrote: >> On Wed, Nov 15, 2017 at 11:24:37AM +0000, Peter Stephenson wrote: >> > On Wed, 15 Nov 2017 11:40:34 +0100 >> > Hadrien Lacour wrote: >> > > I have `bindkey -M emacs '^W' kill-region` in my zshrc and using it without >> > > having set any mark will cut from the beginning of the line to the cursor. >> > > I've tried to read zle's doc but found no mention of this behaviour. >> > > >> > > Any idea about what's happening and how to do nothing if the mark isn't set? >> > >> > Internally, there is actually no notion of the mark not being set --- >> > it's simply initialised to zero, and moved when ask it to be set. >> > Therefore, if you try and use it, it appears as if it's at the start of >> > the line. >> > >> > The documentation doesn't make this explicit. It could do with >> > mentioning the default state. >> > >> > pws >> >> Thanks, that's what I supposed too. I almost have it fixed with >> >> markset= >> my-set-mark() >> { >> zle set-mark-command >> markset=true >> } >> >> my-kill-region() >> { >> [ $markset ] && zle kill-region >> } >> >> zle -N my-kill-region >> zle -N my-set-mark >> >> bindkey -M emacs '^@' my-set-mark >> bindkey -M emacs '^W' my-kill-region >> >> >> But I don't know how to reset markset every newline (other than doing an ugly >> bindkey for Return). > > Disregard this, I just forgot to reset markset in the second widget. -- Mikael Magnusson