- Hello, here is the autocompletion macro.
Aim: if you are writing a document, or a program you are writing the
words again and again. Often if you are a programmer you have to
the name of a certain function you just were creating. In my cases most
compiler-error-messages are coming from misspelled function or variable
names. To minimise such trouble you can use the following macro. Start
writing the word the first two, three, four or five letters and execute
the macro, it will search backward for these letters and fill the word
with the first possible word it was founding. So these letters should
match the proper word beginning correctly. This is especially useful if
you see the other word still on the screen. Normally you would thy the
function or macro-name: what-for-a-wonderful-macro again, or you try to
copy and past it, very borrowing. I simple write "what-" and press "C-1"
the name is completed: what-for-a-wonderful-macro.
The macro can be also found at: www.microemacs.de/macros.htm
; remember position
; copy clip to variable
set-variable #l0 @y
; how many letters ?
set-variable #l1 &len #l0
; empty clipboard
; search clip and extract rest of the word
global-bind-key "autocomplete-word" "C-1"