zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: command completion notification
Date: Sun, 05 Aug 2012 11:21:32 -0700	[thread overview]
Message-ID: <120805112132.ZM8095@torch.brasslantern.com> (raw)
In-Reply-To: <671E3B65-DB7D-4C76-B617-18A7EAB28CB9@ucsc.edu>

On Aug 4,  8:43pm, William Scott wrote:
}
} > (2) It depends on what you want the binding to do.  For example, to
} > simply insert "tnot" in front of the current command and then run it:
} > 
} > tnot-widget() { BUFFER="tnot $BUFFER"; zle accept-line }
} > zle -N tnot-widget
} 
} (2) worked like a charm, and am embarrassed since I read that chapter
} in your book last night.

You must mean Peter, Jerry and Oliver's book (credit where due).

} Maybe I am taking a stupid approach. What would be ideal is if a user
} could specify a time in seconds beyond which the notification would be
} issued.

I don't think there's anything particular wrong with the approach.  You
can check the shell variable $SECONDS before and after the command is
run to see how much time has expired and only issue the notice if the
difference is large enough.  The example from last October does this by
saving $SECONDS in preexec and the comparing it in precmd, but it can
also be done entirely inside a wrapper like your tnot function.


  reply	other threads:[~2012-08-05 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-04  6:08 William G. Scott
2012-08-04 23:10 ` Bart Schaefer
2012-08-05  3:43   ` William Scott
2012-08-05 18:21     ` Bart Schaefer [this message]
2012-09-20  9:04     ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=120805112132.ZM8095@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).