unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Marcin Borkowski <mbork@wmi.amu.edu.pl>, help-gnu-emacs@gnu.org
Subject: RE: Abbrevs for the most frequent elisp symbols
Date: Mon, 29 Dec 2014 07:28:08 -0800 (PST)	[thread overview]
Message-ID: <03140087-e244-4b01-b563-cead1ddafaf5@default> (raw)
In-Reply-To: <87a926puv0.fsf@wmi.amu.edu.pl>

> > The idea is trivial, so probably somebody has done something like
> > this already, but I thought I'd share it in case someone else
> > finds it useful.
> 
> I guess so.  I would be quite surprised if Icicles (which I'm slowly
> learning to use and appreciate!) couldn't do this.

No, Icicles does not do anything for this by default. As Stefan
mentioned, for input to `M-x' you already get a kind of
command-name abbreviation with vanilla Emacs completion (e.g.
partial-completion).  The same holds for Icicles.

Icicles adds an ability to use custom command abbrevs (but none
are defined by default).  With this feature you can:

. treat command abbrevs the same as command names, for input
. define command abbrevs on the fly
. define a list of command abbrevs as user option
  `icicle-command-abbrev-alist'

So for example, you could customize `icicle-command-abbrev-alist'
to what the OP wants, for commands (essentially all commands).

By default, `C-x SPC' in Icicle mode is multi-command
`icicle-command-abbrev'.  It is similar to `M-x' but handles
custom command abbreviations too.  See the Icicles doc, section
"Multi `M-x' with Abbreviations: `icicle-command-abbrev'".
Doc string:

,----
| icicle-command-abbrev is an interactive compiled Lisp function in
| `icicles-cmd1.el'.
| 
| It is bound to C-x SPC.
| 
| (icicle-command-abbrev)
| 
| Read command name or its abbreviation, read command args, call command.
| Read input, then call `icicle-command-abbrev-action' to act on it.
| 
| If `icicle-add-proxy-candidates-flag' is non-nil, then command
| abbreviations, as well as commands, are available as completion
| candidates.  Otherwise, only commands are available.  You can toggle
| `icicle-add-proxy-candidates-flag' using `C-M-_'in the minibuffer.
| 
| When an abbreviation is available, you can treat it just like a
| command.  The rest of this description covers the behavior of choosing
| an abbreviation.
| 
| Completion for an abbreviation is lax.  If you enter a new
| abbreviation then it is added to option `icicle-command-abbrev-alist',
| which is the list of your known abbreviations.  You can also customize
| this list.
| 
| If an abbreviation that you enter matches a single command name then
| that command is invoked.  If it matches more than one, then you can
| use (strict) completion to choose one.
| 
| Hyphens (`-') in command names divide them into parts.  For example,
| `find-file' has two parts: `find' and `file'.  Each character of a
| command abbreviation corresponds to one part of each of the commands
| that match the abbreviation.  For example, abbreviation `ff' matches
| commands `find-file' and `focus-frame', and abbreviation `fg' matches
| `find-grep'.
| 
| If user option `icicle-command-abbrev-match-all-parts-flag' is nil
| then an abbreviation need not match all parts of a command name; it
| need match only a prefix.  For example, if nil then abbreviation `ff'
| also matches `find-file-other-window' and `fg' also matches
| `find-grep-dired'.
| 
| You can use `C-$' to toggle filtering of candidates to those that are
| bound to keys.
| 
| You can use `C-x C-a' to toggle showing key bindings as annotations.
| (Menu bindings are not shown.)
| 
| Read input, then call `icicle-command-abbrev-action'
| to act on it.
| 
| Input-candidate completion and cycling are available.  While cycling,
| these keys with prefix `C-' are active:
| 
| `C-mouse-2', `C-return' - Act on current completion candidate only
| `C-down', `C-wheel-down' - Move to next completion candidate and act
| `C-up', `C-wheel-up' - Move to previous completion candidate and act
| `C-next'  - Move to next apropos-completion candidate and act
| `C-prior' - Move to previous apropos-completion candidate and act
| `C-end'   - Move to next prefix-completion candidate and act
| `C-home'  - Move to previous prefix-completion candidate and act
| `C-!'     - Act on *all* candidates, successively (careful!)
| 
| When candidate action and cycling are combined (e.g. `C-next'), user
| option `icicle-act-before-cycle-flag' determines which occurs first.
| 
| With prefix `C-M-' instead of `C-', the same keys (`C-M-mouse-2',
| `C-M-RET', `C-M-down', and so on) provide help about candidates.
| 
| Use `mouse-2', `RET', or `S-RET' to finally choose a candidate, or
| `C-g' to quit.
| 
| This is an Icicles command - see command `icicle-mode'.
`----



  reply	other threads:[~2014-12-29 15:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19 19:58 Abbrevs for the most frequent elisp symbols Tom
2014-12-25 14:56 ` Andreas Röhler
2014-12-29 15:58   ` Tom
2014-12-29 18:41     ` Andreas Röhler
2014-12-30 10:19       ` Tom
2014-12-30 12:01         ` Artur Malabarba
2014-12-30 21:47           ` Stefan Monnier
2014-12-31  9:50             ` Tom
2014-12-31 21:46               ` Artur Malabarba
2015-01-01  0:16                 ` Robert Thorpe
2014-12-30 14:12         ` Óscar Fuentes
     [not found] ` <mailman.16706.1419519419.1147.help-gnu-emacs@gnu.org>
2014-12-29  4:55   ` Emanuel Berg
2014-12-29 11:18 ` Marcin Borkowski
2014-12-29 15:28   ` Drew Adams [this message]
     [not found] <mailman.16504.1419019164.1147.help-gnu-emacs@gnu.org>
2014-12-29  4:21 ` Emanuel Berg
2014-12-29 11:24   ` Marcin Borkowski
     [not found]     ` <(message>
     [not found]       ` <from>
     [not found]         ` <Marcin>
     [not found]           ` <Borkowski>
     [not found]             ` <on>
     [not found]               ` <Mon>
     [not found]                 ` <29>
     [not found]                   ` <Dec>
     [not found]                     ` <2014>
     [not found]                       ` <12:24:20>
2014-12-29 13:09     ` Robert Thorpe
2014-12-29 15:28       ` Drew Adams
2014-12-29 16:28         ` Robert Thorpe
2014-12-29 13:26     ` Stefan Monnier
2014-12-29 13:40       ` Marcin Borkowski
2014-12-29 14:57         ` Stefan Monnier
2014-12-29 15:49   ` Tom
     [not found]   ` <mailman.16844.1419852282.1147.help-gnu-emacs@gnu.org>
2015-01-03  2:25     ` Emanuel Berg
2015-01-04  0:19       ` Artur Malabarba
     [not found]       ` <mailman.17204.1420330787.1147.help-gnu-emacs@gnu.org>
2015-01-05 21:16         ` Emanuel Berg
2015-01-08 20:53           ` Artur Malabarba
2015-01-03  2:31     ` Emanuel Berg

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=03140087-e244-4b01-b563-cead1ddafaf5@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mbork@wmi.amu.edu.pl \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).