aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2019-02-02 13:23:04 -0800
committerPaul Eggert2019-02-02 13:25:00 -0800
commit713eece307bf48717b868f21789eed8160ada5ba (patch)
tree49b9e2a730618ba3222cfec67d6c9bc530858b0f /src
parent42c8399059bb311c8cfaf9428f0a29032d71011d (diff)
downloademacs-713eece307bf48717b868f21789eed8160ada5ba.tar.gz
emacs-713eece307bf48717b868f21789eed8160ada5ba.zip
Support (locale-info 'paper) on GNU platforms
* configure.ac (HAVE_LANGINFO__NL_PAPER_WIDTH): New macro. * src/fns.c (Flocale_info) [HAVE_LANGINFO__NL_PAPER_WIDTH]: Get paper width and height from locale.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/fns.c b/src/fns.c
index 345211418cb..a7279b13552 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3118,8 +3118,8 @@ The data read from the system are decoded using `locale-coding-system'. */)
3118 str = nl_langinfo (CODESET); 3118 str = nl_langinfo (CODESET);
3119 return build_string (str); 3119 return build_string (str);
3120 } 3120 }
3121#ifdef DAY_1 3121# ifdef DAY_1
3122 else if (EQ (item, Qdays)) /* e.g. for calendar-day-name-array */ 3122 if (EQ (item, Qdays)) /* E.g., for calendar-day-name-array. */
3123 { 3123 {
3124 Lisp_Object v = make_nil_vector (7); 3124 Lisp_Object v = make_nil_vector (7);
3125 const int days[7] = {DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7}; 3125 const int days[7] = {DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7};
@@ -3136,9 +3136,9 @@ The data read from the system are decoded using `locale-coding-system'. */)
3136 } 3136 }
3137 return v; 3137 return v;
3138 } 3138 }
3139#endif /* DAY_1 */ 3139# endif
3140#ifdef MON_1 3140# ifdef MON_1
3141 else if (EQ (item, Qmonths)) /* e.g. for calendar-month-name-array */ 3141 if (EQ (item, Qmonths)) /* E.g., for calendar-month-name-array. */
3142 { 3142 {
3143 Lisp_Object v = make_nil_vector (12); 3143 Lisp_Object v = make_nil_vector (12);
3144 const int months[12] = {MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7, 3144 const int months[12] = {MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7,
@@ -3153,13 +3153,12 @@ The data read from the system are decoded using `locale-coding-system'. */)
3153 } 3153 }
3154 return v; 3154 return v;
3155 } 3155 }
3156#endif /* MON_1 */ 3156# endif
3157/* LC_PAPER stuff isn't defined as accessible in glibc as of 2.3.1, 3157# ifdef HAVE_LANGINFO__NL_PAPER_WIDTH
3158 but is in the locale files. This could be used by ps-print. */ 3158 if (EQ (item, Qpaper))
3159#ifdef PAPER_WIDTH 3159 return list2i ((intptr_t) nl_langinfo (_NL_PAPER_WIDTH),
3160 else if (EQ (item, Qpaper)) 3160 (intptr_t) nl_langinfo (_NL_PAPER_HEIGHT));
3161 return list2i (nl_langinfo (PAPER_WIDTH), nl_langinfo (PAPER_HEIGHT)); 3161# endif
3162#endif /* PAPER_WIDTH */
3163#endif /* HAVE_LANGINFO_CODESET*/ 3162#endif /* HAVE_LANGINFO_CODESET*/
3164 return Qnil; 3163 return Qnil;
3165} 3164}