aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2006-10-03 05:04:21 +0000
committerMiles Bader2006-10-03 05:04:21 +0000
commitf3bbbd11451643c49997116d639612ae434dcaa0 (patch)
tree6ce54c0dbf43746478357847960e9621fe3a5719 /src
parent84356ba74da100da043fea790d1253b2d92e9110 (diff)
parent670992917f2ee196a667797e4c3806d89c0f6d61 (diff)
downloademacs-f3bbbd11451643c49997116d639612ae434dcaa0.tar.gz
emacs-f3bbbd11451643c49997116d639612ae434dcaa0.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 447-459) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 141-144) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-115
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog120
-rw-r--r--src/buffer.c2
-rw-r--r--src/callint.c6
-rw-r--r--src/config.in6
-rw-r--r--src/fns.c32
-rw-r--r--src/gtkutil.c4
-rw-r--r--src/indent.c30
-rw-r--r--src/keymap.c7
-rw-r--r--src/macterm.c59
-rw-r--r--src/makefile.w32-in4
-rw-r--r--src/minibuf.c6
-rw-r--r--src/regex.c8
-rw-r--r--src/s/gnu-linux.h6
-rw-r--r--src/search.c11
-rw-r--r--src/w32fns.c61
-rw-r--r--src/w32proc.c68
-rw-r--r--src/window.c21
-rw-r--r--src/xdisp.c9
-rw-r--r--src/xfns.c2
19 files changed, 391 insertions, 71 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4b22c5d5dc0..79bfe7fe4eb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,121 @@
12006-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xdisp.c (handle_fontified_prop): Don't fontify at EOB.
4
52006-09-30 Eli Zaretskii <eliz@gnu.org>
6
7 * config.in Regenerated.
8
92006-09-29 Juri Linkov <juri@jurta.org>
10
11 * buffer.c (syms_of_buffer): Reorder coding systems in the
12 docstring of %z to the real order displayed in the modeline.
13
142006-09-28 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * keymap.c (Fdefine_key): Yet another int/Lisp_Object mixup (YAILOM).
17
182006-09-26 Chong Yidong <cyd@stupidchicken.com>
19
20 * indent.c (Fvertical_motion): Do move back if the Lisp string
21 being displayed contains newlines.
22
232006-09-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24
25 * macterm.c (mac_compute_glyph_string_overhangs, XLoadQueryFont)
26 [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw before QDTextBounds.
27
282006-09-26 Kenichi Handa <handa@m17n.org>
29
30 * keymap.c (Fsingle_key_description): For an invalid char, return
31 "Invalid char code NNNNN".
32
332006-09-25 Chong Yidong <cyd@stupidchicken.com>
34
35 * callint.c (Fcall_interactively): Doc fix.
36
372006-09-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
38
39 * macterm.c (x_underline_at_descent_line): New variable.
40 (syms_of_macterm): DEFVAR_BOOL it.
41 (x_draw_glyph_string): Use it.
42 (XLoadQueryFont): Calculate min_bounds.descent and max_bounds.descent.
43
442006-09-25 Kenichi Handa <handa@m17n.org>
45
46 * keymap.c (Fsingle_key_description): Return unique names for
47 generic characters.
48
492006-09-24 Richard Stallman <rms@gnu.org>
50
51 * search.c (compile_pattern_1): Don't BLOCK_INPUT.
52
532006-09-24 Eli Zaretskii <eliz@gnu.org>
54
55 * makefile.w32-in ($(BLD)/fns.$(O), $(BLD)/w32proc.$(O)): Depend
56 on nt/inc/langinfo.h and nt/inc/nl_types.h.
57
58 * w32proc.c (nl_langinfo): New function.
59
60 * w32fns.c (w32-pass-alt-to-system, w32-alt-is-meta)
61 (w32-pass-lwindow-to-system, w32-enable-num-lock)
62 (w32-enable-caps-lock, w32-scroll-lock-modifier)
63 (w32-lwindow-modifier, w32-rwindow-modifier)
64 (w32-apps-modifier, w32-mouse-button-tolerance): Doc fix.
65
662006-09-23 Juanma Barranquero <lekktu@gmail.com>
67
68 * minibuf.c (Finternal_complete_buffer, Fread_minibuffer)
69 (Fdisplay_completion_list): Fix typos in docstrings.
70
712006-09-23 Romain Francoise <romain@orebokech.com>
72
73 * s/gnu-linux.h (MAIL_USE_FLOCK): Check for HAVE_LIBLOCKFILE too.
74
752006-09-23 Kenichi Handa <handa@m17n.org>
76
77 * keymap.c (Fmap_keymap): Docstring mentions about generic character.
78
792006-09-22 Stefan Monnier <monnier@iro.umontreal.ca>
80
81 * regex.c (analyse_first): For eight-bit-control chars, mark both the
82 char's value and its leading byte in the fastmap.
83 (re_search_2): When fast-scanning without translation, be careful to
84 check that we only match the leading byte of a multibyte char.
85
86 * charset.h (PREV_CHAR_BOUNDARY): Make it work from within a char's
87 byte sequence.
88 (AT_CHAR_BOUNDARY): New macro.
89
902006-09-22 Kenichi Handa <handa@m17n.org>
91
92 * fns.c (optimize_sub_char_table): Don't optimize a sub-char-table
93 whose default value is non-nil.
94
952006-09-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
96
97 * gtkutil.c (xg_get_file_with_chooser): Only show C-l help for
98 Gtk+ versions < 2.10.
99
100 * xfns.c (syms_of_xfns): Fix typo in help text for
101 x-gtk-file-dialog-help-text.
102
1032006-09-21 Kim F. Storm <storm@cua.dk>
104
105 * fns.c (Fmemq): Refill doc string.
106 (Fmemql): New defun, like memq but using eql.
107 (syms_of_fns): Defsubr it.
108
1092006-09-20 Kim F. Storm <storm@cua.dk>
110
111 * xdisp.c (pos_visible_p): CHARPOS < 0 means return info for
112 last visible glyph in window.
113
114 * window.c (Fset_window_hscroll, Fwindow_line_height):
115 Doc fix. Use "off-window" instead of "off-screen".
116 (Fpos_visible_in_window_p): Likewise.
117 If POS is t, return info for last visible glyph in window.
118
12006-09-19 Chong Yidong <cyd@stupidchicken.com> 1192006-09-19 Chong Yidong <cyd@stupidchicken.com>
2 120
3 * search.c (struct regexp_cache): New entry syntax_table. 121 * search.c (struct regexp_cache): New entry syntax_table.
@@ -242,7 +360,7 @@
242 360
2432006-08-27 Martin Rudalics <rudalics@gmx.at> 3612006-08-27 Martin Rudalics <rudalics@gmx.at>
244 362
245 * xdisp.c (mouse_autoselect_window): Removed. 363 * xdisp.c (mouse_autoselect_window): Remove.
246 (Vmouse_autoselect_window): New variable. DEFVAR_LISP it. 364 (Vmouse_autoselect_window): New variable. DEFVAR_LISP it.
247 365
248 * dispextern.h (mouse_autoselect_window): Remove extern. 366 * dispextern.h (mouse_autoselect_window): Remove extern.
diff --git a/src/buffer.c b/src/buffer.c
index 5369fe0fac1..47877b6a37b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5507,7 +5507,7 @@ A string is printed verbatim in the mode line except for %-constructs:
5507 or print Bottom or All. 5507 or print Bottom or All.
5508 %n -- print Narrow if appropriate. 5508 %n -- print Narrow if appropriate.
5509 %t -- visited file is text or binary (if OS supports this distinction). 5509 %t -- visited file is text or binary (if OS supports this distinction).
5510 %z -- print mnemonics of buffer, terminal, and keyboard coding systems. 5510 %z -- print mnemonics of keyboard, terminal, and buffer coding systems.
5511 %Z -- like %z, but including the end-of-line format. 5511 %Z -- like %z, but including the end-of-line format.
5512 %e -- print error message about full memory. 5512 %e -- print error message about full memory.
5513 %[ -- print one [ for each recursive editing level. %] similar. 5513 %[ -- print one [ for each recursive editing level. %] similar.
diff --git a/src/callint.c b/src/callint.c
index 4c8a5718cd9..392b6f00eec 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -257,9 +257,11 @@ See `interactive'.
257Optional second arg RECORD-FLAG non-nil 257Optional second arg RECORD-FLAG non-nil
258means unconditionally put this command in the command-history. 258means unconditionally put this command in the command-history.
259Otherwise, this is done only if an arg is read using the minibuffer. 259Otherwise, this is done only if an arg is read using the minibuffer.
260
260Optional third arg KEYS, if given, specifies the sequence of events to 261Optional third arg KEYS, if given, specifies the sequence of events to
261supply if the command inquires which events were used to invoke it. 262supply, as a vector, if the command inquires which events were used to
262If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) 263invoke it. If KEYS is omitted or nil, the return value of
264`this-command-keys-vector' is used. */)
263 (function, record_flag, keys) 265 (function, record_flag, keys)
264 Lisp_Object function, record_flag, keys; 266 Lisp_Object function, record_flag, keys;
265{ 267{
diff --git a/src/config.in b/src/config.in
index 44a56e36dd3..106aeea920c 100644
--- a/src/config.in
+++ b/src/config.in
@@ -124,10 +124,6 @@ Boston, MA 02110-1301, USA. */
124 don't. */ 124 don't. */
125#undef HAVE_DECL_SYS_SIGLIST 125#undef HAVE_DECL_SYS_SIGLIST
126 126
127/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
128 */
129#undef HAVE_DECL_TZNAME
130
131/* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you 127/* Define to 1 if you have the declaration of `__sys_siglist', and to 0 if you
132 don't. */ 128 don't. */
133#undef HAVE_DECL___SYS_SIGLIST 129#undef HAVE_DECL___SYS_SIGLIST
@@ -809,7 +805,7 @@ Boston, MA 02110-1301, USA. */
809 805
810/* If using the C implementation of alloca, define if you know the 806/* If using the C implementation of alloca, define if you know the
811 direction of stack growth for your system; otherwise it will be 807 direction of stack growth for your system; otherwise it will be
812 automatically deduced at runtime. 808 automatically deduced at run-time.
813 STACK_DIRECTION > 0 => grows toward higher addresses 809 STACK_DIRECTION > 0 => grows toward higher addresses
814 STACK_DIRECTION < 0 => grows toward lower addresses 810 STACK_DIRECTION < 0 => grows toward lower addresses
815 STACK_DIRECTION = 0 => direction of growth unknown */ 811 STACK_DIRECTION = 0 => direction of growth unknown */
diff --git a/src/fns.c b/src/fns.c
index 044f82fcdb6..e77d8cbca7e 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1383,11 +1383,10 @@ The value is actually the tail of LIST whose car is ELT. */)
1383} 1383}
1384 1384
1385DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, 1385DEFUN ("memq", Fmemq, Smemq, 2, 2, 0,
1386 doc: /* Return non-nil if ELT is an element of LIST. 1386doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eq'.
1387Comparison done with `eq'. The value is actually the tail of LIST 1387The value is actually the tail of LIST whose car is ELT. */)
1388whose car is ELT. */)
1389 (elt, list) 1388 (elt, list)
1390 Lisp_Object elt, list; 1389 register Lisp_Object elt, list;
1391{ 1390{
1392 while (1) 1391 while (1)
1393 { 1392 {
@@ -1410,6 +1409,30 @@ whose car is ELT. */)
1410 return list; 1409 return list;
1411} 1410}
1412 1411
1412DEFUN ("memql", Fmemql, Smemql, 2, 2, 0,
1413doc: /* Return non-nil if ELT is an element of LIST. Comparison done with `eql'.
1414The value is actually the tail of LIST whose car is ELT. */)
1415 (elt, list)
1416 register Lisp_Object elt;
1417 Lisp_Object list;
1418{
1419 register Lisp_Object tail;
1420
1421 if (!FLOATP (elt))
1422 return Fmemq (elt, list);
1423
1424 for (tail = list; !NILP (tail); tail = XCDR (tail))
1425 {
1426 register Lisp_Object tem;
1427 CHECK_LIST_CONS (tail, list);
1428 tem = XCAR (tail);
1429 if (FLOATP (tem) && internal_equal (elt, tem, 0, 0))
1430 return tail;
1431 QUIT;
1432 }
1433 return Qnil;
1434}
1435
1413DEFUN ("assq", Fassq, Sassq, 2, 2, 0, 1436DEFUN ("assq", Fassq, Sassq, 2, 2, 0,
1414 doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST. 1437 doc: /* Return non-nil if KEY is `eq' to the car of an element of LIST.
1415The value is actually the first element of LIST whose car is KEY. 1438The value is actually the first element of LIST whose car is KEY.
@@ -5207,6 +5230,7 @@ used if both `use-dialog-box' and this variable are non-nil. */);
5207 defsubr (&Selt); 5230 defsubr (&Selt);
5208 defsubr (&Smember); 5231 defsubr (&Smember);
5209 defsubr (&Smemq); 5232 defsubr (&Smemq);
5233 defsubr (&Smemql);
5210 defsubr (&Sassq); 5234 defsubr (&Sassq);
5211 defsubr (&Sassoc); 5235 defsubr (&Sassoc);
5212 defsubr (&Srassq); 5236 defsubr (&Srassq);
diff --git a/src/gtkutil.c b/src/gtkutil.c
index cdc87044c81..fb3c9447f84 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1382,7 +1382,9 @@ xg_get_file_with_chooser (f, prompt, default_filename,
1382 if (x_gtk_file_dialog_help_text) 1382 if (x_gtk_file_dialog_help_text)
1383 { 1383 {
1384 message[0] = '\0'; 1384 message[0] = '\0';
1385 if (action != GTK_FILE_CHOOSER_ACTION_SAVE) 1385 /* Gtk+ 2.10 has the file name text entry box integrated in the dialog.
1386 Show the C-l help text only for versions < 2.10. */
1387 if (gtk_check_version (2, 10, 0) && action != GTK_FILE_CHOOSER_ACTION_SAVE)
1386 strcat (message, "\nType C-l to display a file name text entry box.\n"); 1388 strcat (message, "\nType C-l to display a file name text entry box.\n");
1387 strcat (message, "\nIf you don't like this file selector, use the " 1389 strcat (message, "\nIf you don't like this file selector, use the "
1388 "corresponding\nkey binding or customize " 1390 "corresponding\nkey binding or customize "
diff --git a/src/indent.c b/src/indent.c
index 8ea3ea66c1d..6a3cda9e9d5 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2074,7 +2074,7 @@ whether or not it is currently displayed in some window. */)
2074 { 2074 {
2075 int it_start; 2075 int it_start;
2076 int oselective; 2076 int oselective;
2077 int start_on_image_or_stretch_or_string_p; 2077 int it_overshoot_expected_p;
2078 2078
2079 SET_TEXT_POS (pt, PT, PT_BYTE); 2079 SET_TEXT_POS (pt, PT, PT_BYTE);
2080 start_display (&it, w, pt); 2080 start_display (&it, w, pt);
@@ -2086,9 +2086,26 @@ whether or not it is currently displayed in some window. */)
2086 while the end position is really at some X > 0, the same X that 2086 while the end position is really at some X > 0, the same X that
2087 PT had. */ 2087 PT had. */
2088 it_start = IT_CHARPOS (it); 2088 it_start = IT_CHARPOS (it);
2089 start_on_image_or_stretch_or_string_p = (it.method == GET_FROM_IMAGE 2089
2090 || it.method == GET_FROM_STRETCH 2090 /* We expect the call to move_it_to, further down, to overshoot
2091 || it.method == GET_FROM_STRING); 2091 if the starting point is on an image, stretch glyph, or Lisp
2092 string. We won't need to backtrack in this situation, except
2093 for one corner case: when the Lisp string contains a
2094 newline. */
2095 if (it.method == GET_FROM_STRING)
2096 {
2097 const char *s = SDATA (it.string);
2098 const char *e = s + SBYTES (it.string);
2099
2100 while (s < e && *s != '\n')
2101 ++s;
2102
2103 it_overshoot_expected_p = (s == e);
2104 }
2105 else
2106 it_overshoot_expected_p = (it.method == GET_FROM_IMAGE
2107 || it.method == GET_FROM_STRETCH);
2108
2092 reseat_at_previous_visible_line_start (&it); 2109 reseat_at_previous_visible_line_start (&it);
2093 it.current_x = it.hpos = 0; 2110 it.current_x = it.hpos = 0;
2094 /* Temporarily disable selective display so we don't move too far */ 2111 /* Temporarily disable selective display so we don't move too far */
@@ -2099,10 +2116,9 @@ whether or not it is currently displayed in some window. */)
2099 2116
2100 /* Move back if we got too far. This may happen if 2117 /* Move back if we got too far. This may happen if
2101 truncate-lines is on and PT is beyond right margin. 2118 truncate-lines is on and PT is beyond right margin.
2102 It may also happen if it_start is on an image, stretch 2119 Don't go back if the overshoot is expected (see above). */
2103 glyph, or string -- in that case, don't go back. */
2104 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 2120 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0
2105 && !start_on_image_or_stretch_or_string_p) 2121 && !it_overshoot_expected_p)
2106 move_it_by_lines (&it, -1, 0); 2122 move_it_by_lines (&it, -1, 0);
2107 2123
2108 it.vpos = 0; 2124 it.vpos = 0;
diff --git a/src/keymap.c b/src/keymap.c
index 9720708ecf9..237bc0db9df 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -725,7 +725,10 @@ map_keymap_call (key, val, fun, dummy)
725DEFUN ("map-keymap", Fmap_keymap, Smap_keymap, 2, 3, 0, 725DEFUN ("map-keymap", Fmap_keymap, Smap_keymap, 2, 3, 0,
726 doc: /* Call FUNCTION once for each event binding in KEYMAP. 726 doc: /* Call FUNCTION once for each event binding in KEYMAP.
727FUNCTION is called with two arguments: the event that is bound, and 727FUNCTION is called with two arguments: the event that is bound, and
728the definition it is bound to. 728the definition it is bound to. If the event is an integer, it may be
729a generic character (see Info node `(elisp)Splitting Characters'), and
730that means that all actual character events belonging to that generic
731character are bound to the definition.
729 732
730If KEYMAP has a parent, the parent's bindings are included as well. 733If KEYMAP has a parent, the parent's bindings are included as well.
731This works recursively: if the parent has itself a parent, then the 734This works recursively: if the parent has itself a parent, then the
@@ -1176,7 +1179,7 @@ binding KEY to DEF is added at the front of KEYMAP. */)
1176 1179
1177 meta_bit = VECTORP (key) ? meta_modifier : 0x80; 1180 meta_bit = VECTORP (key) ? meta_modifier : 0x80;
1178 1181
1179 if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, make_number (0)))) 1182 if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, 0)))
1180 { /* DEF is apparently an XEmacs-style keyboard macro. */ 1183 { /* DEF is apparently an XEmacs-style keyboard macro. */
1181 Lisp_Object tmp = Fmake_vector (make_number (ASIZE (def)), Qnil); 1184 Lisp_Object tmp = Fmake_vector (make_number (ASIZE (def)), Qnil);
1182 int i = ASIZE (def); 1185 int i = ASIZE (def);
diff --git a/src/macterm.c b/src/macterm.c
index 03b96ac7f25..719b703a77c 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -110,6 +110,10 @@ static Lisp_Object last_window;
110 (Not yet supported.) */ 110 (Not yet supported.) */
111int x_use_underline_position_properties; 111int x_use_underline_position_properties;
112 112
113/* Non-zero means to draw the underline at the same place as the descent line. */
114
115int x_underline_at_descent_line;
116
113/* This is a chain of structures for all the X displays currently in 117/* This is a chain of structures for all the X displays currently in
114 use. */ 118 use. */
115 119
@@ -2632,6 +2636,11 @@ mac_compute_glyph_string_overhangs (s)
2632 Rect r; 2636 Rect r;
2633 MacFontStruct *font = s->font; 2637 MacFontStruct *font = s->font;
2634 2638
2639#if USE_CG_DRAWING
2640 mac_prepare_for_quickdraw (s->f);
2641#endif
2642 SetPortWindowPort (FRAME_MAC_WINDOW (s->f));
2643
2635 TextFont (font->mac_fontnum); 2644 TextFont (font->mac_fontnum);
2636 TextSize (font->mac_fontsize); 2645 TextSize (font->mac_fontsize);
2637 TextFace (font->mac_fontface); 2646 TextFace (font->mac_fontface);
@@ -3673,18 +3682,45 @@ x_draw_glyph_string (s)
3673 /* Draw underline. */ 3682 /* Draw underline. */
3674 if (s->face->underline_p) 3683 if (s->face->underline_p)
3675 { 3684 {
3676 unsigned long h = 1; 3685 unsigned long tem, h;
3677 unsigned long dy = s->height - h; 3686 int y;
3687
3688#if 0
3689 /* Get the underline thickness. Default is 1 pixel. */
3690 if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h))
3691#endif
3692 h = 1;
3693
3694 y = s->y + s->height - h;
3695 if (!x_underline_at_descent_line)
3696 {
3697 /* Get the underline position. This is the recommended
3698 vertical offset in pixels from the baseline to the top of
3699 the underline. This is a signed value according to the
3700 specs, and its default is
3701
3702 ROUND ((maximum descent) / 2), with
3703 ROUND(x) = floor (x + 0.5) */
3704
3705#if 0
3706 if (x_use_underline_position_properties
3707 && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
3708 y = s->ybase + (long) tem;
3709 else
3710#endif
3711 if (s->face->font)
3712 y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
3713 }
3678 3714
3679 if (s->face->underline_defaulted_p) 3715 if (s->face->underline_defaulted_p)
3680 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, 3716 mac_fill_rectangle (s->f, s->gc, s->x, y,
3681 s->background_width, h); 3717 s->background_width, h);
3682 else 3718 else
3683 { 3719 {
3684 XGCValues xgcv; 3720 XGCValues xgcv;
3685 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); 3721 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
3686 XSetForeground (s->display, s->gc, s->face->underline_color); 3722 XSetForeground (s->display, s->gc, s->face->underline_color);
3687 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, 3723 mac_fill_rectangle (s->f, s->gc, s->x, y,
3688 s->background_width, h); 3724 s->background_width, h);
3689 XSetForeground (s->display, s->gc, xgcv.foreground); 3725 XSetForeground (s->display, s->gc, xgcv.foreground);
3690 } 3726 }
@@ -7989,6 +8025,9 @@ XLoadQueryFont (Display *dpy, char *fontname)
7989 FontInfo the_fontinfo; 8025 FontInfo the_fontinfo;
7990 int is_two_byte_font; 8026 int is_two_byte_font;
7991 8027
8028#if USE_CG_DRAWING
8029 mac_prepare_for_quickdraw (NULL);
8030#endif
7992 /* Save the current font number used. */ 8031 /* Save the current font number used. */
7993 GetPort (&port); 8032 GetPort (&port);
7994#if TARGET_API_MAC_CARBON 8033#if TARGET_API_MAC_CARBON
@@ -8104,6 +8143,8 @@ XLoadQueryFont (Display *dpy, char *fontname)
8104 pcm->width); 8143 pcm->width);
8105 font->min_bounds.ascent = min (font->min_bounds.ascent, 8144 font->min_bounds.ascent = min (font->min_bounds.ascent,
8106 pcm->ascent); 8145 pcm->ascent);
8146 font->min_bounds.descent = min (font->min_bounds.descent,
8147 pcm->descent);
8107 8148
8108 font->max_bounds.lbearing = max (font->max_bounds.lbearing, 8149 font->max_bounds.lbearing = max (font->max_bounds.lbearing,
8109 pcm->lbearing); 8150 pcm->lbearing);
@@ -8113,6 +8154,8 @@ XLoadQueryFont (Display *dpy, char *fontname)
8113 pcm->width); 8154 pcm->width);
8114 font->max_bounds.ascent = max (font->max_bounds.ascent, 8155 font->max_bounds.ascent = max (font->max_bounds.ascent,
8115 pcm->ascent); 8156 pcm->ascent);
8157 font->max_bounds.descent = max (font->max_bounds.descent,
8158 pcm->descent);
8116 } 8159 }
8117 if ( 8160 if (
8118#if USE_ATSUI 8161#if USE_ATSUI
@@ -11617,6 +11660,14 @@ to 4.1, set this to nil.
11617NOTE: Not supported on Mac yet. */); 11660NOTE: Not supported on Mac yet. */);
11618 x_use_underline_position_properties = 0; 11661 x_use_underline_position_properties = 0;
11619 11662
11663 DEFVAR_BOOL ("x-underline-at-descent-line",
11664 &x_underline_at_descent_line,
11665 doc: /* *Non-nil means to draw the underline at the same place as the descent line.
11666nil means to draw the underline according to the value of the variable
11667`x-use-underline-position-properties', which is usually at the baseline
11668level. The default value is nil. */);
11669 x_underline_at_descent_line = 0;
11670
11620 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, 11671 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
11621 doc: /* If not nil, Emacs uses toolkit scroll bars. */); 11672 doc: /* If not nil, Emacs uses toolkit scroll bars. */);
11622#ifdef USE_TOOLKIT_SCROLL_BARS 11673#ifdef USE_TOOLKIT_SCROLL_BARS
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index ec407c883f3..98ecc759034 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -719,6 +719,8 @@ $(BLD)/fns.$(O) : \
719 $(EMACS_ROOT)/src/s/ms-w32.h \ 719 $(EMACS_ROOT)/src/s/ms-w32.h \
720 $(EMACS_ROOT)/src/m/intel386.h \ 720 $(EMACS_ROOT)/src/m/intel386.h \
721 $(EMACS_ROOT)/src/config.h \ 721 $(EMACS_ROOT)/src/config.h \
722 $(EMACS_ROOT)/nt/inc/langinfo.h \
723 $(EMACS_ROOT)/nt/inc/nl_types.h \
722 $(SRC)/atimer.h \ 724 $(SRC)/atimer.h \
723 $(SRC)/blockinput.h \ 725 $(SRC)/blockinput.h \
724 $(SRC)/buffer.h \ 726 $(SRC)/buffer.h \
@@ -1044,6 +1046,8 @@ $(BLD)/w32proc.$(O) : \
1044 $(SRC)/w32proc.c \ 1046 $(SRC)/w32proc.c \
1045 $(SRC)/s/ms-w32.h \ 1047 $(SRC)/s/ms-w32.h \
1046 $(SRC)/m/intel386.h \ 1048 $(SRC)/m/intel386.h \
1049 $(EMACS_ROOT)/nt/inc/langinfo.h \
1050 $(EMACS_ROOT)/nt/inc/nl_types.h \
1047 $(SRC)/config.h \ 1051 $(SRC)/config.h \
1048 $(SRC)/process.h \ 1052 $(SRC)/process.h \
1049 $(SRC)/syssignal.h \ 1053 $(SRC)/syssignal.h \
diff --git a/src/minibuf.c b/src/minibuf.c
index 63eee29c494..9505c22d39e 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1021,7 +1021,7 @@ DEFUN ("read-minibuffer", Fread_minibuffer, Sread_minibuffer, 1, 2, 0,
1021Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS 1021Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
1022is a string to insert in the minibuffer before reading. 1022is a string to insert in the minibuffer before reading.
1023\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such 1023\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such
1024arguments are used as in `read-from-minibuffer') */) 1024arguments are used as in `read-from-minibuffer'.) */)
1025 (prompt, initial_contents) 1025 (prompt, initial_contents)
1026 Lisp_Object prompt, initial_contents; 1026 Lisp_Object prompt, initial_contents;
1027{ 1027{
@@ -1910,7 +1910,7 @@ DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete
1910If the argument FLAG is nil, invoke `try-completion', if it's t, invoke 1910If the argument FLAG is nil, invoke `try-completion', if it's t, invoke
1911`all-completions', otherwise invoke `test-completion'. 1911`all-completions', otherwise invoke `test-completion'.
1912 1912
1913The arguments STRING and PREDICATE are as in `try-completion', 1913The arguments STRING and PREDICATE are as in `try-completion',
1914`all-completions', and `test-completion'. */) 1914`all-completions', and `test-completion'. */)
1915 (string, predicate, flag) 1915 (string, predicate, flag)
1916 Lisp_Object string, predicate, flag; 1916 Lisp_Object string, predicate, flag;
@@ -2402,7 +2402,7 @@ The optional second arg COMMON-SUBSTRING is a string.
2402It is used to put faces, `completions-first-difference' and 2402It is used to put faces, `completions-first-difference' and
2403`completions-common-part' on the completion buffer. The 2403`completions-common-part' on the completion buffer. The
2404`completions-common-part' face is put on the common substring 2404`completions-common-part' face is put on the common substring
2405specified by COMMON-SUBSTRING. If COMMON-SUBSTRING is nil 2405specified by COMMON-SUBSTRING. If COMMON-SUBSTRING is nil
2406and the current buffer is not the minibuffer, the faces are not put. 2406and the current buffer is not the minibuffer, the faces are not put.
2407Internally, COMMON-SUBSTRING is bound to `completion-common-substring' 2407Internally, COMMON-SUBSTRING is bound to `completion-common-substring'
2408during running `completion-setup-hook'. */) 2408during running `completion-setup-hook'. */)
diff --git a/src/regex.c b/src/regex.c
index 09776848220..05f1fb53b1a 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -3989,7 +3989,13 @@ analyse_first (p, pend, fastmap, multibyte)
3989 for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH - 1, p++; 3989 for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH - 1, p++;
3990 j >= 0; j--) 3990 j >= 0; j--)
3991 if (!!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) ^ not) 3991 if (!!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) ^ not)
3992 fastmap[j] = 1; 3992 {
3993 fastmap[j] = 1;
3994#ifdef emacs
3995 if (j >= 0x80 && j < 0xa0)
3996 fastmap[LEADING_CODE_8_BIT_CONTROL] = 1;
3997#endif
3998 }
3993 3999
3994 if ((not && multibyte) 4000 if ((not && multibyte)
3995 /* Any leading code can possibly start a character 4001 /* Any leading code can possibly start a character
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 817f1facdee..55d9a725293 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -142,8 +142,12 @@ Boston, MA 02110-1301, USA. */
142 movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and 142 movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
143 HAVE_MAILLOCK_H are defined, so the following appears to be the 143 HAVE_MAILLOCK_H are defined, so the following appears to be the
144 correct logic. -- fx */ 144 correct logic. -- fx */
145/* We must check for HAVE_LIBLOCKFILE too, as movemail does.
146 liblockfile is a Free Software replacement for libmail, used on
147 Debian systems and elsewhere. -rfr */
145 148
146#if !(defined (HAVE_LIBMAIL) && defined (HAVE_MAILLOCK_H)) 149#if !((defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) && \
150 defined (HAVE_MAILLOCK_H))
147#define MAIL_USE_FLOCK 151#define MAIL_USE_FLOCK
148#endif 152#endif
149 153
diff --git a/src/search.c b/src/search.c
index 72ce7e79559..5f3f953595b 100644
--- a/src/search.c
+++ b/src/search.c
@@ -138,10 +138,11 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte)
138 cp->buf.target_multibyte = multibyte; 138 cp->buf.target_multibyte = multibyte;
139 cp->whitespace_regexp = Vsearch_spaces_regexp; 139 cp->whitespace_regexp = Vsearch_spaces_regexp;
140 cp->syntax_table = current_buffer->syntax_table; 140 cp->syntax_table = current_buffer->syntax_table;
141 /* Doing BLOCK_INPUT here has the effect that 141 /* rms: I think BLOCK_INPUT is not needed here any more,
142 the debugger won't run if an error occurs. 142 because regex.c defines malloc to call xmalloc.
143 Why is BLOCK_INPUT needed here? */ 143 Using BLOCK_INPUT here means the debugger won't run if an error occurs.
144 BLOCK_INPUT; 144 So let's turn it off. */
145 /* BLOCK_INPUT; */
145 old = re_set_syntax (RE_SYNTAX_EMACS 146 old = re_set_syntax (RE_SYNTAX_EMACS
146 | (posix ? 0 : RE_NO_POSIX_BACKTRACKING)); 147 | (posix ? 0 : RE_NO_POSIX_BACKTRACKING));
147 re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL 148 re_set_whitespace_regexp (NILP (Vsearch_spaces_regexp) ? NULL
@@ -153,7 +154,7 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte)
153 re_set_whitespace_regexp (NULL); 154 re_set_whitespace_regexp (NULL);
154 155
155 re_set_syntax (old); 156 re_set_syntax (old);
156 UNBLOCK_INPUT; 157 /* UNBLOCK_INPUT; */
157 if (val) 158 if (val)
158 xsignal1 (Qinvalid_regexp, build_string (val)); 159 xsignal1 (Qinvalid_regexp, build_string (val));
159 160
diff --git a/src/w32fns.c b/src/w32fns.c
index 7fd90d7e75a..f2e456b85bf 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -8671,14 +8671,15 @@ syms_of_w32fns ()
8671 Vw32_color_map = Qnil; 8671 Vw32_color_map = Qnil;
8672 8672
8673 DEFVAR_LISP ("w32-pass-alt-to-system", &Vw32_pass_alt_to_system, 8673 DEFVAR_LISP ("w32-pass-alt-to-system", &Vw32_pass_alt_to_system,
8674 doc: /* Non-nil if alt key presses are passed on to Windows. 8674 doc: /* Non-nil if Alt key presses are passed on to Windows.
8675When non-nil, for example, alt pressed and released and then space will 8675When non-nil, for example, Alt pressed and released and then space will
8676open the System menu. When nil, Emacs silently swallows alt key events. */); 8676open the System menu. When nil, Emacs processes the Alt key events, and
8677then silently swallows them. */);
8677 Vw32_pass_alt_to_system = Qnil; 8678 Vw32_pass_alt_to_system = Qnil;
8678 8679
8679 DEFVAR_LISP ("w32-alt-is-meta", &Vw32_alt_is_meta, 8680 DEFVAR_LISP ("w32-alt-is-meta", &Vw32_alt_is_meta,
8680 doc: /* Non-nil if the alt key is to be considered the same as the meta key. 8681 doc: /* Non-nil if the Alt key is to be considered the same as the META key.
8681When nil, Emacs will translate the alt key to the Alt modifier, and not Meta. */); 8682When nil, Emacs will translate the Alt key to the ALT modifier, not to META. */);
8682 Vw32_alt_is_meta = Qt; 8683 Vw32_alt_is_meta = Qt;
8683 8684
8684 DEFVAR_INT ("w32-quit-key", &w32_quit_key, 8685 DEFVAR_INT ("w32-quit-key", &w32_quit_key,
@@ -8687,14 +8688,32 @@ When nil, Emacs will translate the alt key to the Alt modifier, and not Meta. *
8687 8688
8688 DEFVAR_LISP ("w32-pass-lwindow-to-system", 8689 DEFVAR_LISP ("w32-pass-lwindow-to-system",
8689 &Vw32_pass_lwindow_to_system, 8690 &Vw32_pass_lwindow_to_system,
8690 doc: /* Non-nil if the left \"Windows\" key is passed on to Windows. 8691 doc: /* If non-nil, the left \"Windows\" key is passed on to Windows.
8691When non-nil, the Start menu is opened by tapping the key. */); 8692
8693When non-nil, the Start menu is opened by tapping the key.
8694If you set this to nil, the left \"Windows\" key is processed by Emacs
8695according to the value of `w32-lwindow-modifier', which see.
8696
8697Note that some combinations of the left \"Windows\" key with other keys are
8698caught by Windows at low level, and so binding them in Emacs will have no
8699effect. For example, <lwindow>-r always pops up the Windows Run dialog,
8700<lwindow>-<Pause> pops up the "System Properties" dialog, etc. However, see
8701the doc string of `w32-phantom-key-code'. */);
8692 Vw32_pass_lwindow_to_system = Qt; 8702 Vw32_pass_lwindow_to_system = Qt;
8693 8703
8694 DEFVAR_LISP ("w32-pass-rwindow-to-system", 8704 DEFVAR_LISP ("w32-pass-rwindow-to-system",
8695 &Vw32_pass_rwindow_to_system, 8705 &Vw32_pass_rwindow_to_system,
8696 doc: /* Non-nil if the right \"Windows\" key is passed on to Windows. 8706 doc: /* If non-nil, the right \"Windows\" key is passed on to Windows.
8697When non-nil, the Start menu is opened by tapping the key. */); 8707
8708When non-nil, the Start menu is opened by tapping the key.
8709If you set this to nil, the right \"Windows\" key is processed by Emacs
8710according to the value of `w32-rwindow-modifier', which see.
8711
8712Note that some combinations of the right \"Windows\" key with other keys are
8713caught by Windows at low level, and so binding them in Emacs will have no
8714effect. For example, <rwindow>-r always pops up the Windows Run dialog,
8715<rwindow>-<Pause> pops up the "System Properties" dialog, etc. However, see
8716the doc string of `w32-phantom-key-code'. */);
8698 Vw32_pass_rwindow_to_system = Qt; 8717 Vw32_pass_rwindow_to_system = Qt;
8699 8718
8700 DEFVAR_LISP ("w32-phantom-key-code", 8719 DEFVAR_LISP ("w32-phantom-key-code",
@@ -8711,29 +8730,29 @@ acting on \"Windows\" key events when `w32-pass-lwindow-to-system' or
8711 8730
8712 DEFVAR_LISP ("w32-enable-num-lock", 8731 DEFVAR_LISP ("w32-enable-num-lock",
8713 &Vw32_enable_num_lock, 8732 &Vw32_enable_num_lock,
8714 doc: /* Non-nil if Num Lock should act normally. 8733 doc: /* If non-nil, the Num Lock key acts normally.
8715Set to nil to see Num Lock as the key `kp-numlock'. */); 8734Set to nil to handle Num Lock as the `kp-numlock' key. */);
8716 Vw32_enable_num_lock = Qt; 8735 Vw32_enable_num_lock = Qt;
8717 8736
8718 DEFVAR_LISP ("w32-enable-caps-lock", 8737 DEFVAR_LISP ("w32-enable-caps-lock",
8719 &Vw32_enable_caps_lock, 8738 &Vw32_enable_caps_lock,
8720 doc: /* Non-nil if Caps Lock should act normally. 8739 doc: /* If non-nil, the Caps Lock key acts normally.
8721Set to nil to see Caps Lock as the key `capslock'. */); 8740Set to nil to handle Caps Lock as the `capslock' key. */);
8722 Vw32_enable_caps_lock = Qt; 8741 Vw32_enable_caps_lock = Qt;
8723 8742
8724 DEFVAR_LISP ("w32-scroll-lock-modifier", 8743 DEFVAR_LISP ("w32-scroll-lock-modifier",
8725 &Vw32_scroll_lock_modifier, 8744 &Vw32_scroll_lock_modifier,
8726 doc: /* Modifier to use for the Scroll Lock on state. 8745 doc: /* Modifier to use for the Scroll Lock ON state.
8727The value can be hyper, super, meta, alt, control or shift for the 8746The value can be hyper, super, meta, alt, control or shift for the
8728respective modifier, or nil to see Scroll Lock as the key `scroll'. 8747respective modifier, or nil to handle Scroll Lock as the `scroll' key.
8729Any other value will cause the key to be ignored. */); 8748Any other value will cause the Scroll Lock key to be ignored. */);
8730 Vw32_scroll_lock_modifier = Qt; 8749 Vw32_scroll_lock_modifier = Qt;
8731 8750
8732 DEFVAR_LISP ("w32-lwindow-modifier", 8751 DEFVAR_LISP ("w32-lwindow-modifier",
8733 &Vw32_lwindow_modifier, 8752 &Vw32_lwindow_modifier,
8734 doc: /* Modifier to use for the left \"Windows\" key. 8753 doc: /* Modifier to use for the left \"Windows\" key.
8735The value can be hyper, super, meta, alt, control or shift for the 8754The value can be hyper, super, meta, alt, control or shift for the
8736respective modifier, or nil to appear as the key `lwindow'. 8755respective modifier, or nil to appear as the `lwindow' key.
8737Any other value will cause the key to be ignored. */); 8756Any other value will cause the key to be ignored. */);
8738 Vw32_lwindow_modifier = Qnil; 8757 Vw32_lwindow_modifier = Qnil;
8739 8758
@@ -8741,7 +8760,7 @@ Any other value will cause the key to be ignored. */);
8741 &Vw32_rwindow_modifier, 8760 &Vw32_rwindow_modifier,
8742 doc: /* Modifier to use for the right \"Windows\" key. 8761 doc: /* Modifier to use for the right \"Windows\" key.
8743The value can be hyper, super, meta, alt, control or shift for the 8762The value can be hyper, super, meta, alt, control or shift for the
8744respective modifier, or nil to appear as the key `rwindow'. 8763respective modifier, or nil to appear as the `rwindow' key.
8745Any other value will cause the key to be ignored. */); 8764Any other value will cause the key to be ignored. */);
8746 Vw32_rwindow_modifier = Qnil; 8765 Vw32_rwindow_modifier = Qnil;
8747 8766
@@ -8749,7 +8768,7 @@ Any other value will cause the key to be ignored. */);
8749 &Vw32_apps_modifier, 8768 &Vw32_apps_modifier,
8750 doc: /* Modifier to use for the \"Apps\" key. 8769 doc: /* Modifier to use for the \"Apps\" key.
8751The value can be hyper, super, meta, alt, control or shift for the 8770The value can be hyper, super, meta, alt, control or shift for the
8752respective modifier, or nil to appear as the key `apps'. 8771respective modifier, or nil to appear as the `apps' key.
8753Any other value will cause the key to be ignored. */); 8772Any other value will cause the key to be ignored. */);
8754 Vw32_apps_modifier = Qnil; 8773 Vw32_apps_modifier = Qnil;
8755 8774
@@ -8765,7 +8784,7 @@ Any other value will cause the key to be ignored. */);
8765 &w32_mouse_button_tolerance, 8784 &w32_mouse_button_tolerance,
8766 doc: /* Analogue of double click interval for faking middle mouse events. 8785 doc: /* Analogue of double click interval for faking middle mouse events.
8767The value is the minimum time in milliseconds that must elapse between 8786The value is the minimum time in milliseconds that must elapse between
8768left/right button down events before they are considered distinct events. 8787left and right button down events before they are considered distinct events.
8769If both mouse buttons are depressed within this interval, a middle mouse 8788If both mouse buttons are depressed within this interval, a middle mouse
8770button down event is generated instead. */); 8789button down event is generated instead. */);
8771 w32_mouse_button_tolerance = GetDoubleClickTime () / 2; 8790 w32_mouse_button_tolerance = GetDoubleClickTime () / 2;
@@ -8780,7 +8799,7 @@ reported as lisp events. */);
8780 8799
8781 DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system", 8800 DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system",
8782 &w32_pass_extra_mouse_buttons_to_system, 8801 &w32_pass_extra_mouse_buttons_to_system,
8783 doc: /* Non-nil if the fourth and fifth mouse buttons are passed to Windows. 8802 doc: /* If non-nil, the fourth and fifth mouse buttons are passed to Windows.
8784Recent versions of Windows support mice with up to five buttons. 8803Recent versions of Windows support mice with up to five buttons.
8785Since most applications don't support these extra buttons, most mouse 8804Since most applications don't support these extra buttons, most mouse
8786drivers will allow you to map them to functions at the system level. 8805drivers will allow you to map them to functions at the system level.
diff --git a/src/w32proc.c b/src/w32proc.c
index d874d183b17..29491931015 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -49,6 +49,11 @@ Boston, MA 02110-1301, USA.
49extern BOOL WINAPI IsValidLocale(LCID, DWORD); 49extern BOOL WINAPI IsValidLocale(LCID, DWORD);
50#endif 50#endif
51 51
52#ifdef HAVE_LANGINFO_CODESET
53#include <nl_types.h>
54#include <langinfo.h>
55#endif
56
52#include "lisp.h" 57#include "lisp.h"
53#include "w32.h" 58#include "w32.h"
54#include "w32heap.h" 59#include "w32heap.h"
@@ -1817,6 +1822,69 @@ If successful, the return value is t, otherwise nil. */)
1817 return result; 1822 return result;
1818} 1823}
1819 1824
1825#ifdef HAVE_LANGINFO_CODESET
1826/* Emulation of nl_langinfo. Used in fns.c:Flocale_info. */
1827char *nl_langinfo (nl_item item)
1828{
1829 /* Conversion of Posix item numbers to their Windows equivalents. */
1830 static const LCTYPE w32item[] = {
1831 LOCALE_IDEFAULTANSICODEPAGE,
1832 LOCALE_SDAYNAME1, LOCALE_SDAYNAME2, LOCALE_SDAYNAME3,
1833 LOCALE_SDAYNAME4, LOCALE_SDAYNAME5, LOCALE_SDAYNAME6, LOCALE_SDAYNAME7,
1834 LOCALE_SMONTHNAME1, LOCALE_SMONTHNAME2, LOCALE_SMONTHNAME3,
1835 LOCALE_SMONTHNAME4, LOCALE_SMONTHNAME5, LOCALE_SMONTHNAME6,
1836 LOCALE_SMONTHNAME7, LOCALE_SMONTHNAME8, LOCALE_SMONTHNAME9,
1837 LOCALE_SMONTHNAME10, LOCALE_SMONTHNAME11, LOCALE_SMONTHNAME12
1838 };
1839
1840 static char *nl_langinfo_buf = NULL;
1841 static int nl_langinfo_len = 0;
1842
1843 if (nl_langinfo_len <= 0)
1844 nl_langinfo_buf = xmalloc (nl_langinfo_len = 1);
1845
1846 if (item < 0 || item >= _NL_NUM)
1847 nl_langinfo_buf[0] = 0;
1848 else
1849 {
1850 LCID cloc = GetThreadLocale ();
1851 int need_len = GetLocaleInfo (cloc, w32item[item] | LOCALE_USE_CP_ACP,
1852 NULL, 0);
1853
1854 if (need_len <= 0)
1855 nl_langinfo_buf[0] = 0;
1856 else
1857 {
1858 if (item == CODESET)
1859 {
1860 need_len += 2; /* for the "cp" prefix */
1861 if (need_len < 8) /* for the case we call GetACP */
1862 need_len = 8;
1863 }
1864 if (nl_langinfo_len <= need_len)
1865 nl_langinfo_buf = xrealloc (nl_langinfo_buf,
1866 nl_langinfo_len = need_len);
1867 if (!GetLocaleInfo (cloc, w32item[item] | LOCALE_USE_CP_ACP,
1868 nl_langinfo_buf, nl_langinfo_len))
1869 nl_langinfo_buf[0] = 0;
1870 else if (item == CODESET)
1871 {
1872 if (strcmp (nl_langinfo_buf, "0") == 0 /* CP_ACP */
1873 || strcmp (nl_langinfo_buf, "1") == 0) /* CP_OEMCP */
1874 sprintf (nl_langinfo_buf, "cp%u", GetACP ());
1875 else
1876 {
1877 memmove (nl_langinfo_buf + 2, nl_langinfo_buf,
1878 strlen (nl_langinfo_buf) + 1);
1879 nl_langinfo_buf[0] = 'c';
1880 nl_langinfo_buf[1] = 'p';
1881 }
1882 }
1883 }
1884 }
1885 return nl_langinfo_buf;
1886}
1887#endif /* HAVE_LANGINFO_CODESET */
1820 1888
1821DEFUN ("w32-get-locale-info", Fw32_get_locale_info, 1889DEFUN ("w32-get-locale-info", Fw32_get_locale_info,
1822 Sw32_get_locale_info, 1, 2, 0, 1890 Sw32_get_locale_info, 1, 2, 0,
diff --git a/src/window.c b/src/window.c
index 2a3d29a8da8..a78360cda2f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -333,6 +333,7 @@ Return nil if that position is scrolled vertically out of view.
333If a character is only partially visible, nil is returned, unless the 333If a character is only partially visible, nil is returned, unless the
334optional argument PARTIALLY is non-nil. 334optional argument PARTIALLY is non-nil.
335If POS is only out of view because of horizontal scrolling, return non-nil. 335If POS is only out of view because of horizontal scrolling, return non-nil.
336If POS is t, it specifies the position of the last visible glyph in WINDOW.
336POS defaults to point in WINDOW; WINDOW defaults to the selected window. 337POS defaults to point in WINDOW; WINDOW defaults to the selected window.
337 338
338If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, 339If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
@@ -340,7 +341,7 @@ return value is a list of 2 or 6 elements (X Y [RTOP RBOT ROWH VPOS]),
340where X and Y are the pixel coordinates relative to the top left corner 341where X and Y are the pixel coordinates relative to the top left corner
341of the window. The remaining elements are omitted if the character after 342of the window. The remaining elements are omitted if the character after
342POS is fully visible; otherwise, RTOP and RBOT are the number of pixels 343POS is fully visible; otherwise, RTOP and RBOT are the number of pixels
343off-screen at the top and bottom of the row, ROWH is the height of the 344off-window at the top and bottom of the row, ROWH is the height of the
344display row, and VPOS is the row number (0-based) containing POS. */) 345display row, and VPOS is the row number (0-based) containing POS. */)
345 (pos, window, partially) 346 (pos, window, partially)
346 Lisp_Object pos, window, partially; 347 Lisp_Object pos, window, partially;
@@ -357,7 +358,9 @@ display row, and VPOS is the row number (0-based) containing POS. */)
357 buf = XBUFFER (w->buffer); 358 buf = XBUFFER (w->buffer);
358 SET_TEXT_POS_FROM_MARKER (top, w->start); 359 SET_TEXT_POS_FROM_MARKER (top, w->start);
359 360
360 if (!NILP (pos)) 361 if (EQ (pos, Qt))
362 posint = -1;
363 else if (!NILP (pos))
361 { 364 {
362 CHECK_NUMBER_COERCE_MARKER (pos); 365 CHECK_NUMBER_COERCE_MARKER (pos);
363 posint = XINT (pos); 366 posint = XINT (pos);
@@ -369,8 +372,8 @@ display row, and VPOS is the row number (0-based) containing POS. */)
369 372
370 /* If position is above window start or outside buffer boundaries, 373 /* If position is above window start or outside buffer boundaries,
371 or if window start is out of range, position is not visible. */ 374 or if window start is out of range, position is not visible. */
372 if (posint >= CHARPOS (top) 375 if ((EQ (pos, Qt)
373 && posint <= BUF_ZV (buf) 376 || (posint >= CHARPOS (top) && posint <= BUF_ZV (buf)))
374 && CHARPOS (top) >= BUF_BEGV (buf) 377 && CHARPOS (top) >= BUF_BEGV (buf)
375 && CHARPOS (top) <= BUF_ZV (buf) 378 && CHARPOS (top) <= BUF_ZV (buf)
376 && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos) 379 && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos)
@@ -402,10 +405,10 @@ counts from the end of the window.
402 405
403Value is a list (HEIGHT VPOS YPOS OFFBOT), where HEIGHT is the height 406Value is a list (HEIGHT VPOS YPOS OFFBOT), where HEIGHT is the height
404in pixels of the visible part of the line, VPOS and YPOS are the 407in pixels of the visible part of the line, VPOS and YPOS are the
405vertical position in lines and pixels of the row, relative to the top 408vertical position in lines and pixels of the line, relative to the top
406of the first text line, and OFFBOT is the number of off-screen pixels at 409of the first text line, and OFFBOT is the number of off-window pixels at
407the bottom of the text row. If there are off-screen pixels at the top 410the bottom of the text line. If there are off-window pixels at the top
408of the (first) text row, YPOS is negative. 411of the (first) text line, YPOS is negative.
409 412
410Return nil if window display is not up-to-date. In that case, use 413Return nil if window display is not up-to-date. In that case, use
411`pos-visible-in-window-p' to obtain the information. */) 414`pos-visible-in-window-p' to obtain the information. */)
@@ -565,7 +568,7 @@ DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0,
565Return NCOL. NCOL should be zero or positive. 568Return NCOL. NCOL should be zero or positive.
566 569
567Note that if `automatic-hscrolling' is non-nil, you cannot scroll the 570Note that if `automatic-hscrolling' is non-nil, you cannot scroll the
568window so that the location of point moves off-screen. */) 571window so that the location of point moves off-window. */)
569 (window, ncol) 572 (window, ncol)
570 Lisp_Object window, ncol; 573 Lisp_Object window, ncol;
571{ 574{
diff --git a/src/xdisp.c b/src/xdisp.c
index 9ab61c09c2a..7ca259e2b10 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1284,6 +1284,7 @@ line_bottom_y (it)
1284 1284
1285 1285
1286/* Return 1 if position CHARPOS is visible in window W. 1286/* Return 1 if position CHARPOS is visible in window W.
1287 CHARPOS < 0 means return info about WINDOW_END position.
1287 If visible, set *X and *Y to pixel coordinates of top left corner. 1288 If visible, set *X and *Y to pixel coordinates of top left corner.
1288 Set *RTOP and *RBOT to pixel height of an invisible area of glyph at POS. 1289 Set *RTOP and *RBOT to pixel height of an invisible area of glyph at POS.
1289 Set *ROWH and *VPOS to row's visible height and VPOS (row number). */ 1290 Set *ROWH and *VPOS to row's visible height and VPOS (row number). */
@@ -1322,10 +1323,10 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
1322 1323
1323 start_display (&it, w, top); 1324 start_display (&it, w, top);
1324 move_it_to (&it, charpos, -1, it.last_visible_y-1, -1, 1325 move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
1325 MOVE_TO_POS | MOVE_TO_Y); 1326 (charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y);
1326 1327
1327 /* Note that we may overshoot because of invisible text. */ 1328 /* Note that we may overshoot because of invisible text. */
1328 if (IT_CHARPOS (it) >= charpos) 1329 if (charpos >= 0 && IT_CHARPOS (it) >= charpos)
1329 { 1330 {
1330 int top_x = it.current_x; 1331 int top_x = it.current_x;
1331 int top_y = it.current_y; 1332 int top_y = it.current_y;
@@ -3254,7 +3255,9 @@ handle_fontified_prop (it)
3254 && !NILP (Vrun_hooks) 3255 && !NILP (Vrun_hooks)
3255 && (pos = make_number (IT_CHARPOS (*it)), 3256 && (pos = make_number (IT_CHARPOS (*it)),
3256 prop = Fget_char_property (pos, Qfontified, Qnil), 3257 prop = Fget_char_property (pos, Qfontified, Qnil),
3257 NILP (prop))) 3258 /* Ignore the special cased nil value always present at EOB since
3259 no amount of fontifying will be able to change it. */
3260 NILP (prop) && IT_CHARPOS (*it) < Z))
3258 { 3261 {
3259 int count = SPECPDL_INDEX (); 3262 int count = SPECPDL_INDEX ();
3260 Lisp_Object val; 3263 Lisp_Object val;
diff --git a/src/xfns.c b/src/xfns.c
index c60035e41c2..419eccb308e 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5904,7 +5904,7 @@ chooser to show or not show hidden files on a case by case basis. */);
5904 x_gtk_show_hidden_files = 0; 5904 x_gtk_show_hidden_files = 0;
5905 5905
5906 DEFVAR_BOOL ("x-gtk-file-dialog-help-text", &x_gtk_file_dialog_help_text, 5906 DEFVAR_BOOL ("x-gtk-file-dialog-help-text", &x_gtk_file_dialog_help_text,
5907 doc: /* *If non-nil, the GTK file chooser will by show additional help text. 5907 doc: /* *If non-nil, the GTK file chooser will show additional help text.
5908If more space for files in the file chooser dialog is wanted, set this to nil 5908If more space for files in the file chooser dialog is wanted, set this to nil
5909to turn the additional text off. */); 5909to turn the additional text off. */);
5910 x_gtk_file_dialog_help_text = 1; 5910 x_gtk_file_dialog_help_text = 1;