unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Short to long form expansion?
Date: Thu, 23 Feb 2006 15:07:38 -0700	[thread overview]
Message-ID: <dtlbnd$cat$1@sea.gmane.org> (raw)
In-Reply-To: <CQJKf.42981$Dn4.35584@newsfe3-gui.ntli.net>

Christopher Campbell wrote:
 > Is there a mode that allows completion of words by taking a short form,
 > and comparing it with text in the buffer to deduce a longer form?  e.g.
 >
 > in a buffer with
 >
 > complete_text
 > some-variable-name
 >
 > c_t M-RET -> complete_text
 > s-v-n M-RET -> some-variable-name
 >
 > Anything like that?  I use pabbrev-mode which helps alot with code
 > editing, but this little extra would be icing on the cake.

I don't know -- what is pabbrev-mode?  It sounds to me like what you
want is a combination of Dynamic Abbrev mode and Partial Completion
mode.  What happens if you turn on both?

,----
|    The abbrev facility described above operates automatically as you
| insert text, but all abbrevs must be defined explicitly.  By contrast,
| "dynamic abbrevs" allow the meanings of abbrevs to be determined
| automatically from the contents of the buffer, but dynamic abbrev
| expansion happens only when you request it explicitly.
|
| `M-/'
|      Expand the word in the buffer before point as a "dynamic abbrev",
|      by searching in the buffer for words starting with that
|      abbreviation (`dabbrev-expand').
|
| `C-M-/'
|      Complete the word before point as a dynamic abbrev
|      (`dabbrev-completion').
|
|    For example, if the buffer contains `does this follow ' and you type
| `f o M-/', the effect is to insert `follow' because that is the last
| word in the buffer that starts with `fo'.  A numeric argument to `M-/'
| says to take the second, third, etc. distinct expansion found looking
| backward from point.  Repeating `M-/' searches for an alternative
| expansion by looking farther back.  After scanning all the text before
| point, it searches the text after point.  The variable `dabbrev-limit',
| if non-`nil', specifies how far in the buffer to search for an
| expansion.
| ...
|    The command `C-M-/' (`dabbrev-completion') performs completion of a
| dynamic abbreviation.  Instead of trying the possible expansions one by
| one, it finds all of them, then inserts the text that they have in
| common.  If they have nothing in common, `C-M-/' displays a list of
| completions, from which you can select a choice in the usual manner.
| *Note Completion::.
`----

,----
|    Partial Completion mode implements a more powerful kind of
| completion that can complete multiple words in parallel.  For example,
| it can complete the command name abbreviation `p-b' into
| `print-buffer', because no other command starts with two words whose
| initials are `p' and `b'.
|
|    Partial completion of directories in file names uses `*' to indicate
| the places for completion; thus, `/u*/b*/f*' might complete to
| `/usr/bin/foo'.
|
|    To enable this mode, use the command `M-x partial-completion-mode',
| or customize the option `partial-completion-mode'.  This binds the
| partial completion commands to <TAB>, <SPC>, <RET>, and `?'.  The usual
| completion commands are available on `M-<TAB>', `M-<SPC>', `M-<RET>'
| and `M-?'.
`----

-- 
Kevin Rodgers

  parent reply	other threads:[~2006-02-23 22:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-21 19:27 Short to long form expansion? Christopher Campbell
2006-02-23 15:44 ` Stefan Monnier
2006-02-23 22:08   ` Christopher Campbell
2006-02-24 22:04   ` Drew Adams
2006-02-23 22:07 ` Kevin Rodgers [this message]
     [not found] ` <mailman.39.1140848322.5016.help-gnu-emacs@gnu.org>
2006-02-27 18:37   ` Christopher Campbell

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='dtlbnd$cat$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /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).