[buug] Quick Emacs Macro?

Ian Zimmerman itz at buug.org
Sat Jul 3 21:41:29 PDT 2004


Joseph> On Fri, 2004-07-02 at 22:42, Ian Zimmerman wrote: Foo bar baz
Joseph> and turn it into

Joseph> <a name="Foo_bar_baz"><b>Foo bar baz</b></a>

Joseph> either prompting for the string to be processed or by selecting
Joseph> it as a region and then using the macro.

(fset 'xmlize-region
   [?\M-x ?e ?n ?a ?b ?l ?e ?- ?c ?o ?m ?m ?a ?n ?d return
    ?n ?a ?r ?r ?o ?w ?- ?t ?o ?- ?r ?e ?g ?i ?o ?n return 
    ?\C-x ?\C-x ?\C-x ?\C-x ?\M-w ?\C-x ?\C-x ?< ?/ ?b ?> 
    ?< ?/ ?a ?> ?\C-x ?\C-x ?< ?b ?> left left left ?< ?> 
    left ?a ?  ?n ?a ?m ?e ?= ?" ?" left ?\C-y ?\C-x ?\C-x 
    ?\M-x ?n ?a ?r ?r ?o ?w ?- ?t ?o ?- ?r ?e ?g ?i ?o ?n return 
    ?\M-% ?r ?e ?p ?l ?a ?c ?e ?- ?s ?t ?r ?i ?n ?g return ?  
    return ?\M-x ?r ?e ?p ?l ?a ?c ?e ?- ?s ?t ?r ?i ?n ?g return ?  
    return ?_ return ?\M-x ?w ?i ?d ?e ?n return])

This inserts the literal tags <a> and <b>, which is likely not what you
really wanted :-)

-- 
"It's not true or not."  A reality show producer (real quote)



More information about the buug mailing list