From ab742534cab99053887555b48d45a3f8d3fc3185 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Thu, 30 Nov 2006 15:49:24 -0600 Subject: [PATCH] More tools --- moo/mooedit/context.cfg | 58 ++++++++++++--------- moo/mooedit/menu.cfg | 111 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 140 insertions(+), 29 deletions(-) diff --git a/moo/mooedit/context.cfg b/moo/mooedit/context.cfg index 95887ad9..7c7e4bed 100644 --- a/moo/mooedit/context.cfg +++ b/moo/mooedit/context.cfg @@ -1,31 +1,43 @@ +# -%- strip: false -%- [tool] id = SwitchHeaderAndImplementation name = Switch Header and Implementation -langs = C, GAP +langs = c, cpp, gap type = moo-script options = need-file - extensions = [[['.h', '.hh', '.hpp', '.hxx', '.H'], ['.c', '.cc', '.cpp', '.cxx', '.C']], - [['.gd'], ['.gi']]]; - new = none; - - for p in extensions do - if doc.ext in p[0] then - new = p[1]; - break; - elif doc.ext in p[1] then - new = p[0]; - break; - fi; - od; - - if not new then + extensions = [[['.h', '.hh', '.hpp', '.hxx', '.H'], ['.c', '.cc', '.cpp', '.cxx', '.C']], + [['.gd'], ['.gi']]]; + new = none; + + for p in extensions do + if doc.ext in p[0] then + new = p[1]; + break; + elif doc.ext in p[1] then + new = p[0]; + break; + fi; + od; + + if not new then + return; + fi; + + for e in new do + file = doc.dir + '/' + doc.base + e; + if FileExists(file) then + Open(file); return; fi; + od; - for e in new do - file = doc.dir + '/' + doc.base + e; - if FileExists(file) then - Open(file); - return; - fi; - od; +[tool] +id=DVI_Forward_Search +langs=latex +type=exe +name=DVI Forward Search +options=need-file +output=async + kdvi --unique file:$DOC_BASE.dvi#src:$LINE$DOC && + dcop `dcopfind -a 'kviewshell-*'` kdvi-mainwindow#1 hide && + dcop `dcopfind -a 'kviewshell-*'` kdvi-mainwindow#1 show diff --git a/moo/mooedit/menu.cfg b/moo/mooedit/menu.cfg index 4d52f55f..26227f90 100644 --- a/moo/mooedit/menu.cfg +++ b/moo/mooedit/menu.cfg @@ -1,19 +1,118 @@ +# -%- strip: false -%- [tool] id = ShellCommand name = _Shell Command os = unix type = moo-script options = need-doc - cmd = HistoryEntry("", "ShellCommand"); - if cmd then - Insert(Exec(cmd), "\n"); - fi; + cmd = HistoryEntry("", "ShellCommand"); + if cmd then + Insert(Exec(cmd), "\n"); + fi; [tool] id = SortLines -name = Sort +name = Sort Lines type = exe options = need-doc input = lines output = insert - sort + sort + +[tool] +id=Yacc +langs=yacc +type=exe +name=Bison +filter=bison +options=need-save +output=pane + bison $DOC + +[tool] +id=LaTeX +langs=latex +type=exe +name=LaTeX +filter=latex +options=need-save +output=pane +accel=L + latex --src-specials $DOC + +[tool] +id=Make_PDF +langs=latex +type=exe +name=Make PDF +filter=latex +options=need-save +output=pane + latex --src-specials $DOC && + dvips $DOC_BASE.dvi && + ps2pdf $DOC_BASE.ps + +[tool] +id=Bibtex +langs=latex +type=exe +name=Bibtex +options=need-doc +output=pane +accel=B + bibtex $DOC_BASE + +[tool] +id=PdfLaTeX +langs=latex +type=exe +name=PdfLaTeX +filter=latex +options=need-save +output=pane + pdflatex $DOC + +[tool] +id=View_DVI +langs=latex +type=exe +name=View DVI +options=need-doc +output=async +accel=V + kdvi --unique $DOC_BASE.dvi && + dcop `dcopfind -a 'kviewshell-*'` kdvi-mainwindow#1 hide && + dcop `dcopfind -a 'kviewshell-*'` kdvi-mainwindow#1 show + +[tool] +id=View_PDF +langs=latex +type=exe +name=View PDF +options=need-doc +output=async + kpdf=`dcopfind -a 'kpdf-*'` + if [ -z "$kpdf"]; then + kpdf $DOC_BASE.pdf + kpdf=`dcopfind -a 'kpdf-*'` + else + dcop "$kpdf" kpdf openDocument "$DOC_DIR/$DOC_BASE.pdf" + fi + dcop "$kpdf" kpdf-mainwindow#1 hide + dcop "$kpdf" kpdf-mainwindow#1 show + +[tool] +id=Math +langs=latex +type=moo-script +name=Math +options=need-doc +accel=M + selection = Selection(); + if selection then + Insert('$' + selection + '$'); + else + Insert('$ $'); + Left(); + Select(-1); + fi;