zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: PATCH: key bindings, fixes, docs, tests for vi stuff
Date: Fri, 21 Nov 2014 22:59:57 -0800	[thread overview]
Message-ID: <141121225957.ZM13909@torch.brasslantern.com> (raw)
In-Reply-To: <18016.1416566150@thecus.kiddle.eu>

On Nov 21, 11:35am, Oliver Kiddle wrote:
}
} Bart wrote:
} > I have from time to time wondered if segregating some of the builtin
} > widgets into loadable modules might be beneficial.
} 
} This is something I was also pondering. The main obstacle to this, and
} the reason I pulled textobjects inline, relates to keybindings:
} 
} If someone has their bindkey commands early in .zshrc, we don't want
} those to be overridden later when a module gets loaded.  This problem
} already means everyone has to take care to put their listscroll and
} menuselect bindings late in their .zshrc.

Hmm, those seem like two different sides of the coin.  Is it not the
case that the listscroll and menuselect bindings have to be late
because the keymaps don't yet exist?  Thus not because the bindings
would be overridden?  I suppose re-creating the keymap is a form of
override.

But it shouldn't be that difficult to have the modules check for the
existence of the keymap, skip re-creating it it if it's already there,
and then only add bindings that don't conflict?

} As one solution, we could have all default bindings in zle.so. I haven't
} checked what happens if that includes bindings to autoloadable widgets:

Hmm again.  As of right now, I think that would cause the entire module
to load as soon as you attempted to use the binding, which in the case
of e.g. menuselect would re-initialize the keymap and possibly destroy
the binding you just used.

} Do you have any thoughts on what a logical division into modules would
} be? I was thinking along the lines of the vi/emacs split but only for
} those widgets that are unlikely to be used for the opposite mode.

It's difficult to decide.  There are the functional divisions in the
documentation (Movement, History Control, etc.) and then the major
divisions of emacs/vi.

Maybe the way to do it is:

- common default bindings (accept-line, clear-screen, etc.)
- emacs default bindings
- unbound emacs widgets
- vi default bindings
- unbound vi widgets

and then some other modules for miscellaneous stuff that is neither
bound by default, nor really fits into either major editor style
(auto-suffix-retain/remove, read-command, recursive-edit, split-undo,
etc.).  [Maybe there should be a "widgets for use from other widgets"
category.]

} The only existing module: deltochar appears to be mainly there to
} provide an example of doing widgets as a module. Is it a fairly much
} standard thing to an emacs user or is it logical to have it on its own?

I've never used it, but zap-to-char is a standard GNU emacs binding
these days, so perhaps others do.
 
} I also wonder if we could make it possible for shell function widgets
} to specify some sort of default key binding much as is possible for
} completion widgets.

The widgets don't really specify their key binding, that's all done by
compinit when it scans $fpath for #compdef lines.  We could easily have
another such script that looks for a different #something.  There is
already #autoload but it doesn't do bindings.


  reply	other threads:[~2014-11-22  6:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 21:36 Oliver Kiddle
2014-11-18  8:04 ` Jun T.
2014-11-19  8:48   ` Oliver Kiddle
2014-11-19 15:35     ` Ray Andrews
2014-11-21  0:01   ` Oliver Kiddle
2014-11-21  0:49     ` Bart Schaefer
2014-11-21  1:10       ` Ray Andrews
2014-11-21  5:53         ` Bart Schaefer
2014-11-21 10:35       ` Oliver Kiddle
2014-11-22  6:59         ` Bart Schaefer [this message]
2014-12-12 16:47           ` Oliver Kiddle
2014-11-21  1:15     ` Ray Andrews
2014-11-21  2:20       ` Mikael Magnusson
2014-11-21  2:38         ` Ray Andrews
2014-11-21  6:23           ` Bart Schaefer
2014-11-21 17:28             ` trouble with debugging binary Ray Andrews
2014-11-22  4:45               ` Bart Schaefer
2014-11-22  5:27                 ` Ray Andrews
2014-11-22  5:43                 ` Bart Schaefer
2014-11-22 16:49                   ` Ray Andrews
2014-11-22 22:35                     ` Bart Schaefer
2014-11-23  7:58                     ` Lawrence Velázquez
2014-11-23 16:22                       ` Ray Andrews
2014-11-23 18:12                         ` Mikael Magnusson
2014-11-23 18:42                           ` Ray Andrews
2014-11-23 19:01                             ` Mikael Magnusson
2014-11-23 22:30                               ` Ray Andrews
2014-11-21 15:20     ` PATCH: key bindings, fixes, docs, tests for vi stuff Jun T.

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=141121225957.ZM13909@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).