From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11601 invoked by alias); 16 Feb 2015 15:17:02 -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: 34557 Received: (qmail 23947 invoked from network); 16 Feb 2015 15:17:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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:date :message-id:subject:from:to:cc:content-type; bh=kzzXgsH6Ho7h5rUUEXctN3z4wDFZZQNtVKfdm/pKO60=; b=VXT5csmySAx3X6SrPQig/kMkurCv/njvAazNKaD0Bw8RFlbqMDBfsjA6nHZ8SVnSLN jerI3h59tFK5lnThAAZ6lSWYFcM7/ukFtn19hnKhoW5jcqqnGK3q+utqK0Wnr8Vwh3jU gL7WZjZJh2WpmkEJBeJWVupMK+c09F1es+obehKtyn3Aeercvm8KBjoEuhr9aGDr1dY0 7faig77lJdypD8jpoJXNlkx8YiEo29DpN09mubctIkMy68je0zeJjVK4k6Ba2OqmH+J0 dPEzkMncd4r0e8N//986czq7ZmYvhjVkv58r0NAjHH/IUqMbQvt98b8nV0oS7oj/u+DU CJEw== X-Gm-Message-State: ALoCoQnCYxYNMhmKfOUK8QihQqy0+RqIsh+v9kG9jDEplQe0cPXPM0mx93dQojyfeIDouZSuxYvy MIME-Version: 1.0 X-Received: by 10.60.42.8 with SMTP id j8mr15800191oel.41.1424099818207; Mon, 16 Feb 2015 07:16:58 -0800 (PST) In-Reply-To: References: <20150214213757.010b0c82@ntlworld.com> Date: Mon, 16 Feb 2015 09:16:58 -0600 Message-ID: Subject: Re: prexec never gets empty string? From: Derek Gleim To: Peter Stephenson , Mikael Magnusson Cc: zsh workers Content-Type: multipart/alternative; boundary=089e0149d0b2ca0f37050f361347 --089e0149d0b2ca0f37050f361347 Content-Type: text/plain; charset=UTF-8 Sorry, I meant "minus one from the normal event count" in my half-baked example. On Mon, Feb 16, 2015 at 9:11 AM, Derek Gleim wrote: > I understood the real intent of preexec, I hoped I could use it as part of > some work-around for my real goal: to /detect/ when a command was (or, is > about to be, seems to be the more accurate way of putting it?) ignored from > history. Something like "if preexex sees an command destined to be > ignored by > history, add one to the normal event count". Just to re-cap, I thought I > could because of this bit in the manual: > > > If the history mechanism is active (and the line was not discarded from > the > > history buffer), the string that the user typed is passed as the first > > argument, otherwise it is an empty string. > > An impression that was reinforced for me when I also found the first post > Mikael cited: > > > when the current command is discarded from the history (as is often the > case > > when the user is ignoring functions, history commands, and/or lines that > > start with a space) ... so I decided to set the first parameter to an > empty > > string when this happens. > > ... But, I missed the second post linked talking about leaving it off. So, > thanks, not a bug, looks like the docs just need an update (21 days in > 2001, > ha!). > > As an aside, I'd still like to be able to get the prompt expansion `%!` to > always show the number to be assigned to the next command... > > % PROMPT='%! >' zsh --no-rcs --histignorespace > 1 > true ignore me > 2 >this command will really be event 1 > 2 > > > ... maybe it's just me, but it trips me up sometimes (and histnostore has > the > same behavior). But, looks like re-purposing preexec is a dead-end. > --089e0149d0b2ca0f37050f361347--