added default_properties;
authorwenzelm
Sun, 10 Feb 2008 20:49:46 +0100
changeset 26052 7d5b3e34a735
parent 26051 43bcb30a6d97
child 26053 f8ee5cbb3068
added default_properties;
src/Pure/General/position.ML
--- a/src/Pure/General/position.ML	Sun Feb 10 20:49:45 2008 +0100
+++ b/src/Pure/General/position.ML	Sun Feb 10 20:49:46 2008 +0100
@@ -18,6 +18,7 @@
   val advance: Symbol.symbol -> T -> T
   val of_properties: Markup.property list -> T
   val properties_of: T -> Markup.property list
+  val default_properties: T -> Markup.property list -> Markup.property list
   val str_of: T -> string
   val thread_data: unit -> T
   val setmp_thread_data: T -> ('a -> 'b) -> 'a -> 'b
@@ -71,6 +72,10 @@
     NONE => []
   | SOME (m, n) => [(Markup.lineN, string_of_int m), (Markup.columnN, string_of_int n)]) @ props;
 
+fun default_properties default props =
+  if exists (member (op =) Markup.position_properties o #1) props then props
+  else properties_of default @ props;
+
 
 (* str_of *)