I would like to translate the following function from a vim script to emacs elisp (I use it to set email recipients when writing emails).
My question basically is how to get and set the contents of the string in emacs, because with a quick search in googling I could not find this (maybe I just did not know the correct conditions for google for, "getline" and "setline" in any case showed any results).
function! G_set_to()
let address = system('my-address-script') "shell command to choose addresses
let line = getline (2)
if strlen(line) == 4
call setline(2, line . address)
else
call setline(2, line . "; " . address)
endif
endfunction
Sorry if the answer is obvious, I'm completely new to emacs and don’t even know how to use the built-in help system.
Cheers Arian
source
share