From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21904 invoked by alias); 18 Jan 2016 17:04:37 -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: 37677 Received: (qmail 21754 invoked from network); 18 Jan 2016 17:04:36 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=H957NNvN+HS0ZtgI0A0S8HxlRod1lciSJWiPei4+vLw=; b=tOGLbZXpvPfLxbzd1+/doVZm7QDdcupp9dHZFccz3w9P+4d0ebfYlMrOmbkuiPfxJb 6/xqRDs8LkbkyKgR8ENW/z8yodP3XC1SGzrIq4y4aoNZPpzLF1YC2W0hliRknyswTx3r WBpKwfNkJBBWItfQSl5nesx3L7NHbOfyDAsjtm/bTAwUoFMehpmxhdjfbrUOL3BpWX0w VRR58xhr+sMKo9jLoUH+l5OHRor3NwScL5MZExN3td896R6le+be2TF/2WApfW6aGsx3 oMTAvxxYf7f/yKFj2uDDYvMb0m4HuWLaNHd9JT+zLZNuZh0TPklTd/qjqjSGEtxzZ1Tc ck9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=H957NNvN+HS0ZtgI0A0S8HxlRod1lciSJWiPei4+vLw=; b=N/pnVcnq+SSKyh3xOf3RwTtsh9znf54qhvP5HnaUFj9StMyxkD1C09jeOl7wjUL+kE mw+HkpV9fZFKOUlbEVhThXOOsyAFqAyoKLl7EJ5llyplcJ56ejEd9aSMm2AR6PCZXIFr ITznHXAp5WR8sBnNtrAigkCMGUZAmDC2+z2mAJfElPx4AfuTaNrx3PkZDtRcjOPPMn0/ CjRX5Jlg4pM1p2CXm1YpaKWBjfGPqv9RyVbJ8Zidsb6QPlv3myS5ubSy9J4D/y3CgBJT P17RmC26H9rqivO8LVM2bzLm8sQupei/RuN2TrCkAYGwVvCwB9Cp8wEhZq4cnw0B70tD hxjw== X-Gm-Message-State: ALoCoQnhl+QImsHeohT5mqWCiA0yOnAUk0SFYbv6H6XxURFkdijm3ucJ+g64uRf3VLpK2R1oeApON38FVS1JXWoyEJr3Nevg4g== X-Received: by 10.112.198.102 with SMTP id jb6mr8763131lbc.44.1453136673103; Mon, 18 Jan 2016 09:04:33 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <160111233259.ZM6719@torch.brasslantern.com> References: <160111233259.ZM6719@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Mon, 18 Jan 2016 18:04:13 +0100 Message-ID: Subject: Re: "drop-in replacement" and transpose-words-match To: Bart Schaefer Cc: Zsh hackers list Content-Type: multipart/mixed; boundary=001a11c34aa8365d5c05299ebf3b --001a11c34aa8365d5c05299ebf3b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12 January 2016 at 08:32, Bart Schaefer wrot= e: > This still isn't perfect -- if you are on or immediately after a space > in the middle of a quoted string, for example, you'll swap around that > space. I haven't decided on the best way to deal with that. But this > works much better if you are at the end of a line and invoke transpose: > it swaps the two words to the left, like the builtin. I was looking at various sources in recent months and earlier, and was getting an impression of how important LBUFFER is to them. Your implementation of widen_for_history is recent example. I am in general quite repelled by LBUFFER and can even see it as not actually working, how it was with the widen_for_history =E2=80=93 only after a while I saw th= at it was working perfectly. However in my code I choose to use the function I've attached, available also here: https://github.com/psprint/zsh-editing-workbench/blob/master/zew-process-bu= ffer My point is: isn't it that sticking to LBUFFER is the source of various problems? Its use is always more or less hackish and has effects like "you should position cursor on beginning of a word to swap it". Implementation generates features while it should be the opposite. It's hard for me to provide more evidence to what I'm stating, but maybe you agree with me in general Best regards, Sebastian Gniazdowski --001a11c34aa8365d5c05299ebf3b Content-Type: application/octet-stream; name=zew-process-buffer Content-Disposition: attachment; filename=zew-process-buffer Content-Transfer-Encoding: base64 X-Attachment-Id: f_ijk7umm50 IyBJbnB1dDoKIyAkMSAtIGJ1ZmZlciB0byBwcm9jZXNzCiMKIyBPdXRwdXQ6CiMgWkVXX1BCX1dP UkRTIC0gc3BsaXQgb2YgIiQxIiBpbnRvIHNoZWxsIHdvcmRzOyBhcnJheQojIFpFV19QQl9XT1JE U19CRUdJTk5JTkdTIC0gaW5kZXhlcyBvZiBmaXJzdCBsZXR0ZXJzIG9mIGNvcnJlc3BvbmRpbmcg d29yZHMgaW4gWkVXX1BCX1dPUkRTCiMgWkVXX1BCX1NQQUNFUyAtIHdoaXRlIHNwYWNlcyBiZWZv cmUgY29ycmVzcG9uZGluZyB3b3JkcyBpbiBaRVdfUEJfV09SRFMKIyBaRVdfUEJfU0VMRUNURURf V09SRCAtIGluZGV4IGluIFpFV19QQl9XT1JEUyBwb2ludGluZyB0byB3b3JkIGFjdGl2YXRlZCBi eSBDVVJTT1IgcG9zaXRpb24KIyBaRVdfUEJfTEVGVCAtIGxlZnQgcGFydCBvZiBhY3RpdmUgd29y ZAojIFpFV19QQl9SSUdIVCAtIHJpZ2h0IHBhcnQgb2YgYWN0aXZlIHdvcmQKIwoKZW11bGF0ZSAt TFIgenNoCnNldG9wdCB0eXBlc2V0c2lsZW50IGV4dGVuZGVkZ2xvYiBub3Nob3J0bG9vcHMKCmxv Y2FsIE1CRUdJTiBNRU5EIE1BVENIIG1iZWdpbiBtZW5kIG1hdGNoCgpsb2NhbCBidWY9IiQxIgpa RVdfUEJfV09SRFM9KCAiJHsoWituKylCVUZGRVJ9IiApClpFV19QQl9TUEFDRVM9KCApClpFV19Q Ql9XT1JEU19CRUdJTk5JTkdTPSggKQpaRVdfUEJfU0VM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