I've only just started with Emacs (about 6 weeks now) so I'm not really familiar with its coding language. I was wondering if it was possible to write, for Emacs, the equivalent of a Python macro I have in my Sublime Text setup.
In Sublime Text, I have a Python macro which can transform selected lines of text. If I select the lines
foo
bar
baz
and press my chosen shortcut C-l C-s
the text is transformed to ['foo', 'bar', 'baz']
.
I was wondering how to could do this for Emacs.
'fo''c''sle'
, or'fo\'c\'sle'
or something entirely different?C-h i g (elisp) Macros
). Secondly there is an editing feature referred to as Keyboard Macros (seeC-h i g (emacs) Keyboard Macros
). I don't think you actually meant either of these things, so you should definitely avoid the word "macro" entirely in order to avoid confusion.