src/Pure/Tools/update.scala
changeset 76972 6c542f2aab85
parent 76970 7d23555fda83
child 76973 e5dafe9e120f
equal deleted inserted replaced
76971:d1776c5ddc93 76972:6c542f2aab85
    11   val update_elements: Markup.Elements =
    11   val update_elements: Markup.Elements =
    12     Markup.Elements(Markup.UPDATE, Markup.LANGUAGE)
    12     Markup.Elements(Markup.UPDATE, Markup.LANGUAGE)
    13 
    13 
    14   def update_xml(options: Options, xml: XML.Body): XML.Body = {
    14   def update_xml(options: Options, xml: XML.Body): XML.Body = {
    15     val path_cartouches = options.bool("update_path_cartouches")
    15     val path_cartouches = options.bool("update_path_cartouches")
       
    16     val cite_commands = options.bool("update_cite_commands")
    16 
    17 
    17     def upd(lang: Markup.Language, ts: XML.Body): XML.Body =
    18     def upd(lang: Markup.Language, ts: XML.Body): XML.Body =
    18       ts flatMap {
    19       ts flatMap {
    19         case XML.Wrapped_Elem(markup, body1, body2) =>
    20         case XML.Wrapped_Elem(markup, body1, body2) =>
    20           val body = if (markup.name == Markup.UPDATE) body1 else body2
    21           val body = if (markup.name == Markup.UPDATE) body1 else body2
    26               case None => upd(lang1, body)
    27               case None => upd(lang1, body)
    27             }
    28             }
    28           }
    29           }
    29           else upd(lang1, body)
    30           else upd(lang1, body)
    30         case XML.Elem(_, body) => upd(lang, body)
    31         case XML.Elem(_, body) => upd(lang, body)
       
    32         case XML.Text(s) if lang.is_document && cite_commands =>
       
    33           List(XML.Text(Bibtex.update_cite(s)))
    31         case t => List(t)
    34         case t => List(t)
    32       }
    35       }
    33     upd(Markup.Language.outer, xml)
    36     upd(Markup.Language.outer, xml)
    34   }
    37   }
    35 
    38