+/* Return true if text quoting style should default to quote `like this'. */
+static bool
+default_to_grave_quoting_style (void)
+{
+ if (!text_quoting_flag)
+ return true;
+ if (! DISP_TABLE_P (Vstandard_display_table))
+ return false;
+ Lisp_Object dv = DISP_CHAR_VECTOR (XCHAR_TABLE (Vstandard_display_table),
+ LEFT_SINGLE_QUOTATION_MARK);
+ return (VECTORP (dv) && ASIZE (dv) == 1
+ && EQ (AREF (dv, 0), make_number ('`')));
+}
+
+/* Return the current effective text quoting style. */
+enum text_quoting_style
+text_quoting_style (void)
+{
+ if (NILP (Vtext_quoting_style)
+ ? default_to_grave_quoting_style ()
+ : EQ (Vtext_quoting_style, Qgrave))
+ return GRAVE_QUOTING_STYLE;
+ else if (EQ (Vtext_quoting_style, Qstraight))
+ return STRAIGHT_QUOTING_STYLE;
+ else
+ return CURVE_QUOTING_STYLE;
+}
+