diff --git a/moo/mooedit/Makefile.incl b/moo/mooedit/Makefile.incl index 53a5cc91..fa6f39b2 100644 --- a/moo/mooedit/Makefile.incl +++ b/moo/mooedit/Makefile.incl @@ -5,6 +5,9 @@ mooedit = $(moo_prefix)/mooedit mooedit_srcdir = $(srcdir)/$(mooedit) +mooedit_toolsdir = $(MOO_DATA_DIR) +mooedit_tools_DATA = $(mooedit)/tools.cfg + mooedit_include_headers = \ $(mooedit)/moocmdview.h \ $(mooedit)/moocompletion.h \ @@ -146,7 +149,7 @@ else mooedit_extra_dist = $(mooedit_gtk_2_10_sources) endif -moo_extra_dist += $(mooedit_extra_dist) +moo_extra_dist += $(mooedit_extra_dist) $(mooedit_tools_DATA) if MOO_BUILD_EDIT moo_sources += $(mooedit_sources) diff --git a/moo/mooedit/tools.cfg b/moo/mooedit/tools.cfg new file mode 100644 index 00000000..599af823 --- /dev/null +++ b/moo/mooedit/tools.cfg @@ -0,0 +1,42 @@ +action: ShellCommand +label: _Shell Command + cmd = HistoryEntry("", "ShellCommand"); + if cmd then + Insert(Exec(cmd), "\n"); + fi; + +action: SwitchHeaderAndImpl +label: _Switch Header And Implementation +options: need-file +lang: C + h_ext = ['.h']; + c_ext = ['.c']; + new = none; + if doc.ext in h_ext then + new = c_ext; + elif doc.ext in c_ext then + new = h_ext; + else + return; + fi; + for e in new do + file = doc.dir + '/' + doc.base + e; + if FileExists(file) then + Open(file); + return; + fi; + od; + +action: Latex +label: LaTeX +lang: LaTeX +command: shell +options: need-save + cd $dir && latex $name + +action: ViewDVI +label: View DVI +lang: LaTeX +command: shell +options: need-file, silent + cd $dir && kdvi $base.dvi &