Moo Local Editing

From Gwen Morse's Wiki
Jump to: navigation, search
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Local editing with can be done in principle (we did not test it) 
;;; The following has been taken from the MOO case: 
;;;
;;; From: http://tecfa.unige.ch/moo/book2/node14.html

/def -mregexp -t"^\\.$" do_localedit = \
        /if /test %{shipping} %;\
           /then /set shipping 0 %;\
           /log -w off %;\
           /sys echo . >> %loced_doc %;\
           /sh %editor %loced_doc %;\
           /quote '%loced_doc %;\
           /sys rm %loced_doc %{loced_doc}\~ %;\
        /endif

;;; if you want backups, move the document somewhere instead of deleting it

/def -mregexp -t"^#\\$# edit name: (.*) upload: (.*)$" localedit_trigger = \
        /substitute %P2%;\
        /set shipping 1 %;\
        /set loced_doc %{loced_basedir}/tf_edit.doc %;\
        /log -w %loced_doc %;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;