Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Suggested improvement for sticky-note



Returning 2.5 years later ...

> On Mon, May 3, 2021 at 7:06 PM vapnik spaknik <vapniks@xxxxxxxxx> wrote:
> >
> > adds options for selecting a background colour &/or blinking when creating a new sticky note, and automatically adds the appropriate escape codes.

The attached revision of sticky-note (which requires the current
development version of zsh for ${| code } and namespaces) implements
these in a more satisfactory way, by keeping a second file of assigned
display attributes alongside the history-formatted file that stores
the notes themselves.  The assignment of colors, blinking, etc. is now
activated by a key binding rather than a command line option, and is
customizable by a style.  I have not implemented "stacking" of styles
at this point, so if you want to change black-on-yellow to
blinking-white-on-red, you'll need a single display name for the
latter.

I'm sure there are undiscovered bugs with this, so mess around if interested.

On Sun, May 9, 2021 at 1:50 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> There are a few reasonable suggestions here mixed with quite a number
> of things that could be improved.  Adding noflowcontrol to the setopts
> is probably a good idea, and passing "-e" to vared should at least be
> configurable.

These are implemented in the attached version.  Several vared options
can now be controlled with
  zstyle :sticky-note vared-options ...

Read the large comment at the top of the file for a description of
what you can do, with some examples.  This should eventually go into
the contributions doc.

> That also caused me to notice that interrupting
> sticky-note with a keyboard interrupt (^C) can cause old notes to
> disappear, so that should be fixed.

I haven't tracked that down yet.  Also yet to be fixed is expiring
lines from the display file when the corresponding lines expire from
the history.

> Having the note blink while it is being edited is rather
> weird/distracting even if you want it to blink when displayed later.

The name of the current selected display style is displayed in the
PREDISPLAY string during editing.

As a final note, I found an error in the doc for "vared":

     ...  If the
     -e flag is given, typing ^D (Control-D) on an empty line causes
     vared to exit immediately with a non-zero return value.

This should say "in an empty note" not "empty line".  It only works if
the whole note would be blank.

Attachment: sticky-note
Description: Binary data



Messages sorted by: Reverse Date, Date, Thread, Author