zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: accept-and-hold in interactive mode of menu select
Date: Tue, 16 Dec 2014 19:07:06 -0800	[thread overview]
Message-ID: <141216190706.ZM19162@torch.brasslantern.com> (raw)
In-Reply-To: <10372.1418757100@thecus.kiddle.eu>

On Dec 16,  8:11pm, Oliver Kiddle wrote:
}
} Bart wrote:
} > 
} > I'm not entirely sure that's wrong; accept means to accept what is on the
} > command line, not to accept what is highlighted in the menu.  You have to
} > finish the action of choosing one of the menu items so that the command
} > line is updated, before you accept.
} 
} No, with menu selection many widgets have quite different behaviour. The
} documented behaviour of accept-and-hold is to insert the currently
} selected match but keep the menu active so that you can select another
} match.

Yes, but my point is that in the interactive sub-mode, so to speak, there
is no "currently selected match" -- there's a highlighted item in the
menu, but in the example given the interactively-entered prefix is still
ambiguous, so nothing has been "selected" until that's resolved.  In this
sense the interactive mode is different from the navigation mode.

In the navigation mode the command line and the menu highlight are always
in sync so this distinction doesn't matter.

I acknowledge that this is being pedantic and that seeing a highlighted
item could lead one to believe it has been "selected" and it's probably
better to have the interactive mode behave that way.

} In a separate thread Bart recently wrote:
} > I hadn't seen auto-fu before but it appears to be a rewrite of the old
} > incremental-complete-word functions.  I'm mildly surprised to see that
} > it's using the keymap+widget technique
} 
} At its basic level keymap+widget seems to just be a way to define the
} behaviour of a widget for a particular keymap separately so you can have
} one function for say ucase and another for say lcase and you can use one
} without the other.

Something like that; it's an attempt to get behavior a bit more similar
to an emacs minor mode.  The examples only deal with rebinding self-insert
and accept-line but you could do a whole suite of related bindings.  I
started rewriting predict-on with it but didn't ever finish; auto-fu seems
to have done a much more thorough job.

} Perhaps a more generic mechanism would be to allow zle widget aliases to
} be keymap specific. (Or possibly conditional on a selection of things
} using zstyle as a backend.)

If at some point I get especially ambitious, I'd like to use zstyles to
create something like emacs "advice" hooks.

} For the too many omz plugins case, we'd need to somehow allow the
} aliases to be chained so I'm not sure that this is a complete solution.

We might learn a lot by looking at the way emacs and Xwindows manage
key bindings.


      reply	other threads:[~2014-12-17  3:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 14:18 Jun T.
2014-12-16 16:45 ` Bart Schaefer
2014-12-16 19:11   ` Oliver Kiddle
2014-12-17  3:07     ` Bart Schaefer [this message]

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=141216190706.ZM19162@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).