From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19052 invoked by alias); 18 Apr 2018 16:11:18 -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: 23347 Received: (qmail 25584 invoked by uid 1010); 18 Apr 2018 16:11:18 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf0-f43.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.215.43):SA:0(-1.9/5.0):. Processed in 1.556351 secs); 18 Apr 2018 16:11:18 -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.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIMWL_WL_MED,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+zKK6tL+ODrXzpQfg5ZP2taG8XR7gTQPp9pq41r5Aro=; b=bboSh1RGRD8PaRzwtRBFS43m9hTI03Qi6yD2HUgEDWQTUguZjwL/HzY2ffFcX0jCJW LgPUJiaotGmOCy+l9qZLMJVxZwick890sZpmtX4/TFW+3tsj1DQ2jlEZ6ZK0D6W4TXPo 0ZUI56MLFQt7Chx3yII8/TtjTJopEaIfsD+qVRg6FR3qPzn+ilTHFm6nKngE/COlB1hP 7qGBZNmlPcAXKNCiRQkEnTg2+w9hNWsunFYfkBIeeQOm358f5H5ROpOPwHWO6KiPNcDn it9YL/Ln3jLyywmuLfgqO4js01kdBhrNG1bT/tgrT5gC55OGRE2X4hFVek0602JiRk7W /1mA== 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; bh=+zKK6tL+ODrXzpQfg5ZP2taG8XR7gTQPp9pq41r5Aro=; b=fkZLzlU9CTohZ7zIO+cYkSxiVivcFvcV8TrvXxfcy5aej3UvBSupRm3hu6NrSDH65v jgZ3bf0gsmT88oOgvc1cnJZf7ShstkepvpxIc3BzgUwWR9nLxT59B2LaOsRurYsMwla2 j+zSdJEw2W19kA32ufXX9Ob+f0HC40SoNEuvEGb0lM+TvTUcdacPhEyKS1ghrjOUUMj8 6Wpg/JlRrbxKxUfz8yIX6DKT3uPMOZH0YIXgGXA61N0oB3h1S5cZSCFk+iqNnSKHrLt/ A3iTbzp7ETFSrR8VB0esNcIMhb8AyDAGCE+EpqeMeUMME5mXZkc8JTGy3p503vDDt9hQ W10Q== X-Gm-Message-State: ALQs6tBdbWh5rtiAbLJUUV/Oh2UdbbkSkouqcW8k3vYCog1V/uBBWkkH 6q8oyc107OBuzrQkIQpB+veXym3DNDCeeMuM6/3uqjMH X-Google-Smtp-Source: AIpwx4+9NxmWh7lAh+o692m0ZYmqTdq+CwdMZibxpCxESLHWIss/2ZJOp2iyb8zg/mce2/reye2+6SNha/4ig0qYCVA= X-Received: by 10.46.62.12 with SMTP id l12mr1832474lja.66.1524067872091; Wed, 18 Apr 2018 09:11:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180418135817.7edca58c@camnpupstephen.cam.scsc.local> References: <20180418094018.54559594@camnpupstephen.cam.scsc.local> <87in8o6fjx.fsf@luffy.cx> <20180418104555.25fef55b@camnpupstephen.cam.scsc.local> <874lk866zp.fsf@luffy.cx> <20180418135817.7edca58c@camnpupstephen.cam.scsc.local> From: Bart Schaefer Date: Wed, 18 Apr 2018 09:11:11 -0700 Message-ID: Subject: Re: make history-complete-older do nothing on empty string To: Zsh Users Content-Type: text/plain; charset="UTF-8" On Wed, Apr 18, 2018 at 5:58 AM, Peter Stephenson wrote: > > So when you interrupted it it was apparently reading in 66742 history > words Some people have really large shell history. Manipulating that many completion possibilities takes a long time. Vincent, what version of zsh are you running? There were some memory management optimizations done in the past year or so that might speed up large history accesses in general. Although it would be nice to find out exactly what part of completion is occupying time in this case (if only so that we might look into making it interruptible), to answer the original question: You'd want a wrapper around _history_complete_word to check the state of the editor buffer, or you could copy that function to a location at the front of your $fpath and modify it. The test you want is probably something like: [[ ${LBUFFER:- } == ' ' && ${RBUFFER:- } == ' ' ]] && return 1 There's a space after :- in both of those references. This means "if either the buffer is empty or the cursor is sitting in the middle of a run of spaces, then return" (i.e. don't complete anything).