Index: src/org/openstreetmap/josm/gui/mappaint/TextElement.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/TextElement.java	(revision 4002)
+++ src/org/openstreetmap/josm/gui/mappaint/TextElement.java	(working copy)
@@ -8,7 +8,7 @@
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy;
-import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.TagLookupCompositionStrategy;
+import org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.StaticLabelCompositionStrategy;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -80,16 +80,17 @@
      * @return the label composition strategy
      */
     protected static LabelCompositionStrategy buildLabelCompositionStrategy(Cascade c, boolean defaultAnnotate){
+
         Keyword textKW = c.get("text", null, Keyword.class, true);
         if (textKW == null) {
             String textKey = c.get("text", null, String.class);
-            if (textKey == null) 
+            if (textKey == null)
                 return defaultAnnotate ? AUTO_LABEL_COMPOSITION_STRATEGY : null;
-            return new TagLookupCompositionStrategy(textKey);
+            return new StaticLabelCompositionStrategy(textKey);
         } else if (textKW.val.equals("auto"))
             return AUTO_LABEL_COMPOSITION_STRATEGY;
         else
-            return new TagLookupCompositionStrategy(textKW.val);
+            return new StaticLabelCompositionStrategy(textKW.val);
     }
 
     /**
@@ -183,11 +184,11 @@
             return false;
         final TextElement other = (TextElement) obj;
         return  equal(labelCompositionStrategy, other.labelCompositionStrategy) &&
-                equal(font, other.font) &&
-                xOffset == other.xOffset &&
-                yOffset == other.yOffset &&
-                equal(color, other.color) &&
-                equal(haloRadius, other.haloRadius) &&
-                equal(haloColor, other.haloColor);
+        equal(font, other.font) &&
+        xOffset == other.xOffset &&
+        yOffset == other.yOffset &&
+        equal(color, other.color) &&
+        equal(haloRadius, other.haloRadius) &&
+        equal(haloColor, other.haloColor);
     }
 }
Index: src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java	(revision 4002)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java	(working copy)
@@ -15,12 +15,13 @@
 import org.openstreetmap.josm.actions.search.SearchCompiler;
 import org.openstreetmap.josm.actions.search.SearchCompiler.Match;
 import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.gui.mappaint.Cascade;
 import org.openstreetmap.josm.gui.mappaint.Environment;
 import org.openstreetmap.josm.tools.Utils;
 
 public interface Expression {
-
     public Object evaluate(Environment env);
 
     public static class LiteralExpression implements Expression {
@@ -46,6 +47,8 @@
     }
 
     public static class FunctionExpression implements Expression {
+        //static Logger logger = Logger.getLogger(FunctionExpression.class.getName());
+
         String name;
         List<Expression> args;
 
@@ -72,9 +75,8 @@
             public Float minus(float... args) {
                 if (args.length == 0)
                     return 0f;
-                if (args.length == 1) { // unary minus
+                if (args.length == 1)
                     return -args[0];
-                }
                 float res = args[0];
                 for (int i=1; i<args.length; ++i) {
                     res -= args[i];
@@ -163,6 +165,29 @@
                 return env.osm.get(key);
             }
 
+            public String tag(String key) {
+                return get_tag_value(key);
+            }
+
+            public String text(String value){
+                return value;
+            }
+
+            /**
+             * <p>Replies the value of a tag with name <tt>key</tt> provided by one of the parent
+             * relations of the OSM object in the environment, or null, if no such tag exists.</p>
+             * 
+             * @param key the tag key
+             * @return the tag value
+             */
+            public String parent_tag(String key) {
+                for (Relation parent: OsmPrimitive.getFilteredList(env.osm.getReferrers(), Relation.class)) {
+                    String value = parent.get(key);
+                    if (value != null) return value;
+                }
+                return null;
+            }
+
             public boolean has_tag_key(String key) {
                 return env.osm.hasKey(key);
             }
@@ -285,8 +310,9 @@
                 throw  new RuntimeException(ex);
             }
             for (Method m : allMethods) {
-                if (!m.getName().equals(name))
+                if (!m.getName().equals(name)) {
                     continue;
+                }
                 Class<?>[] expectedParameterTypes = m.getParameterTypes();
                 Object[] convertedArgs = new Object[expectedParameterTypes.length];
 
@@ -303,8 +329,9 @@
                     }
                     convertedArgs[0] = arrayArg;
                 } else {
-                    if (args.size() != expectedParameterTypes.length)
+                    if (args.size() != expectedParameterTypes.length) {
                         continue;
+                    }
                     for (int i=0; i<args.size(); ++i) {
                         convertedArgs[i] = Cascade.convertTo(args.get(i).evaluate(env), expectedParameterTypes[i]);
                         if (convertedArgs[i] == null)
Index: src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java	(revision 4002)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java	(working copy)
@@ -2,6 +2,7 @@
 package org.openstreetmap.josm.gui.mappaint.mapcss;
 
 import java.util.Arrays;
+import java.util.Collections;
 
 import org.openstreetmap.josm.gui.mappaint.Environment;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
@@ -30,7 +31,26 @@
         public AssignmentInstruction(String key, Object val) {
             this.key = key;
             if (val instanceof Expression.LiteralExpression) {
-                this.val = ((Expression.LiteralExpression) val).evaluate(null);
+                if (key.equals("text")) {
+                    /* Special case for declaration 'text: ...'
+                     * 
+                     * - Treat the value 'auto' as keyword.
+                     * - Treat any other literal value 'litval' as syntactic shortcut for the function expression
+                     *   'tag(litval)'
+                     * - Accept function expressions as is. This allows for
+                     *     tag(a_tag_name)                 value of a tag
+                     *     text("a static text")           a static text
+                     *     parent_tag(a_tag_name)          value of a tag of a parent relation
+                     */
+                    Object value = ((Expression.LiteralExpression) val).evaluate(null);
+                    if (value != null && value.equals("auto")) {
+                        this.val = "auto";
+                    } else {
+                        this.val = new Expression.FunctionExpression("tag", Collections.singletonList((Expression)val));
+                    }
+                } else {
+                    this.val = ((Expression.LiteralExpression) val).evaluate(null);
+                }
             } else {
                 this.val = val;
             }
