[emacs-berlin] A riddle to be solved with Emacs

jman emacs-berlin at city17.xyz
Tue Jun 8 07:21:17 UTC 2021


Zelphir Kaltstahl <zelphirkaltstahl at posteo.de> writes:

> This looks like it should be solvable using one or more keyboard macros [1].
>
> Here is one I just created:
>
> ~~~~
> (fset 'experiment-to-json-macro
>    (kmacro-lambda-form [?\M-m ?l ?a ?b ?e ?l ?: ?\S-  M-right ?\} ?\M-m ?\{ ?v 
>    ?a ?l ?u ?e ?: ?  ?\" ?\" ?, ?  ?\C-s ?\" return left M-S-right ?\M-w 
>    M-left M-left M-left M-S-right ?\C-y M-S-left ?\M-x ?d ?o ?w ?- ?r ?e ?g 
>    return M-S-right ?\M-% ?  return ?- return ?! home down] 0 "%d"))
> ~~~~

This is the kind of sorcery I am scared but so fascinated about Emacs :D
There is a lot to unpack for me here that this will be a great tutorial
on itself.

Also thanks @Jack for the alternate solution with a straight regexp! Now
I have both very good examples of how I can retry to solve this in two
different ways.

These examples are for me worth their weight in gold, thank you so much!

Best,


More information about the emacs-berlin mailing list