zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: vapnik spaknik <vapniks@yahoo.com>
Cc: Zsh Hackers List <zsh-workers@zsh.org>
Subject: Re: quick bugfix for sticky-note
Date: Sun, 15 Nov 2020 11:44:47 -0800	[thread overview]
Message-ID: <CAH+w=7Zt+=TxrRk6VMCc+ew3XnZ1xdOsDX1a2jJ5EGMN6kMwZg@mail.gmail.com> (raw)
In-Reply-To: <1177177665.5499794.1605395141729@mail.yahoo.com>

On Sat, Nov 14, 2020 at 3:06 PM vapnik spaknik <vapniks@yahoo.com> wrote:
>
> The problem is that sticky-note resets all options which means that flowcontrol is enabled and so pressing ctrl+s overrides any keybindings and stops output. I can't see any reason for needing this behaviour, so a quick fix would be to just add 'noflowcontrol' to the 'setopt' line near the start of the function.

Hm.  The problem with that is that people who want flow control
suddenly lose it.

The doc for "emulate" says:
     If the -R switch is given, all settable options are reset to their
     default value corresponding to the specified emulation mode, except
     for certain options describing the interactive environment;

I wonder if flowcontrol should be considered an option "describing the
interactive environment" and therefore should not be reset by "emulate
-R".  That would be a change to long-standing behavior, of course, but
is there an obvious case where it would really matter?

In the meantime, this (apologies for any gmail word-wrapping):

diff --git a/Functions/Misc/sticky-note b/Functions/Misc/sticky-note
index efe5ec1eb..dd31eb81f 100644
--- a/Functions/Misc/sticky-note
+++ b/Functions/Misc/sticky-note
@@ -48,7 +48,7 @@

 # I encourage all you creative people to contribute enhancements ...

-emulate -LR zsh
+emulate -LR zsh -o ${${options[flowcontrol]/off/no}/on/}flowcontrol
 setopt nobanghist extendedhistory histignoredups

 local STICKYFILE=${STICKYFILE:-$HOME/.zsticky}


  reply	other threads:[~2020-11-15 19:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1177177665.5499794.1605395141729.ref@mail.yahoo.com>
2020-11-14 23:05 ` vapnik spaknik
2020-11-15 19:44   ` Bart Schaefer [this message]
2020-11-15 20:29     ` Peter Stephenson
2020-11-16 13:06     ` vapnik spaknik
2020-11-16 16:07       ` Mikael Magnusson

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='CAH+w=7Zt+=TxrRk6VMCc+ew3XnZ1xdOsDX1a2jJ5EGMN6kMwZg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=vapniks@yahoo.com \
    --cc=zsh-workers@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).