From: Julien Rioux Date: Tue, 7 Jun 2011 15:01:00 +0000 (+0000) Subject: Fix part of bug #7609 (PDF (pdflatex) no more directly X-Git-Tag: 2.1.0beta1~3099 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=54b626b8e0d37800efc6d98429027f08e50231fd;p=lyx.git Fix part of bug #7609 (PDF (pdflatex) no more directly listed in file->export menu). Do not remove customized document formats from the export menu. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38975 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/scripts/prefs2prefs_prefs.py b/lib/scripts/prefs2prefs_prefs.py index 2a77d79376..40b5072f82 100644 --- a/lib/scripts/prefs2prefs_prefs.py +++ b/lib/scripts/prefs2prefs_prefs.py @@ -77,12 +77,24 @@ def latex_flavor(line): return (True, "\\converter \"%s\" \"%s\" \"%s\" \"latex=%s\"" % (conv, fmat, args, flavor)) +emre = re.compile(r'^\\[Ff]ormat\s+(.*)\s+"(document[^"]*?)"') +def export_menu(line): + if not line.lower().startswith("\\format"): + return no_match + m = emre.match(line) + if not m: + return no_match + fmat = m.group(1) + opts = m.group(2) + return (True, + "\\Format %s \"%s,menu=export\"" % (fmat, opts)) ######################## conversions = [ [ # this will be a long list of conversions for format 0 + export_menu, latex_flavor, remove_obsolete, language_use_babel,