Example #1
0
def delete_elc_files():
    dirs = [".emacs.d/", ".emacs.d/site-lisp/",
            ".emacs.d/setup/", ".emacs.d/defuns/"]

    home = os.environ['HOME']
    for d in dirs:
        files = glob.glob(os.path.join(home, d) + "*.elc")
        for f in files:
            lisp._eval('(delete-file "%s")' % f)
Example #2
0
def byte_compile_el_files():
    dirs = [".emacs.d/", ".emacs.d/site-lisp/",
            ".emacs.d/setup/", ".emacs.d/defuns/",
            "/home/bro/programmer/emacs/predictive/predictive/"]

    home = os.environ['HOME']
    for d in dirs:
        files = glob.glob(os.path.join(home, d) + "*.el")
        for f in files:
            lisp.message("Byte compiling '%s'" % f)
            lisp._eval('(byte-compile-file "%s")' % f)
Example #3
0
def delete_elc_files():
    dirs = [
        ".emacs.d/", ".emacs.d/site-lisp/", ".emacs.d/setup/",
        ".emacs.d/defuns/"
    ]

    home = os.environ['HOME']
    for d in dirs:
        files = glob.glob(os.path.join(home, d) + "*.elc")
        for f in files:
            lisp._eval('(delete-file "%s")' % f)
Example #4
0
def byte_compile_el_files():
    dirs = [
        ".emacs.d/", ".emacs.d/site-lisp/", ".emacs.d/setup/",
        ".emacs.d/defuns/", "/home/bro/programmer/emacs/predictive/predictive/"
    ]

    home = os.environ['HOME']
    for d in dirs:
        files = glob.glob(os.path.join(home, d) + "*.el")
        for f in files:
            lisp.message("Byte compiling '%s'" % f)
            lisp._eval('(byte-compile-file "%s")' % f)
Example #5
0
def read_glossaries(file=""):
    import re
    ifile = open("/home/bro/master/master_opp/oppgave/glossaries.tex", 'r')
    text = ifile.read()
    ifile.close()

    acr_pattern = re.compile(
        r"""
    \\newacronym{(?P<id>[^}]*)}{(?P<short>[^}]*)}{(?P<long>[^}]*)}
    """, re.VERBOSE | re.MULTILINE)

    acronyms = []
    for match in acr_pattern.finditer(text):
        v = "(%s) (%s) (%s)\n" % (match.group("id"), match.group("short"),
                                  match.group("long"))
        lisp.message("Acronym: '%s'" % v)
        acronyms.append(match.group("id"))

    lisp._eval('(LaTeX-add-glossaries \"%s\")' % "\" \"".join(acronyms))
Example #6
0
def read_glossaries(file=""):
    import re
    ifile = open("/home/bro/master/master_opp/oppgave/glossaries.tex", 'r')
    text = ifile.read()
    ifile.close()

    acr_pattern = re.compile(r"""
    \\newacronym{(?P<id>[^}]*)}{(?P<short>[^}]*)}{(?P<long>[^}]*)}
    """, re.VERBOSE | re.MULTILINE)

    acronyms = []
    for match in acr_pattern.finditer(text):
        v = "(%s) (%s) (%s)\n" % (match.group("id"),
                                  match.group("short"),
                                  match.group("long"))
        lisp.message("Acronym: '%s'" % v)
        acronyms.append(match.group("id"))

    lisp._eval('(LaTeX-add-glossaries \"%s\")' %
               "\" \"".join(acronyms))