aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2015-02-01 00:37:46 +0100
committerJoakim Verona2015-02-01 00:37:46 +0100
commit69815dfe3704f8a8c733843f1fd04546cbb0f4d0 (patch)
treecee6910753a51b9a5ee88e2431c9bcad099e8ba8 /src
parent4edad429cafb2f0b1fda028be58367286ab04f1c (diff)
parenta2c32b0cfc9f6d3410e2832d8ea0d4f1df576d1e (diff)
downloademacs-69815dfe3704f8a8c733843f1fd04546cbb0f4d0.tar.gz
emacs-69815dfe3704f8a8c733843f1fd04546cbb0f4d0.zip
Merge branch 'master' into xwidget
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog140
-rw-r--r--src/Makefile.in12
-rw-r--r--src/coding.c12
-rw-r--r--src/coding.h1
-rw-r--r--src/dired.c105
-rw-r--r--src/dispextern.h4
-rw-r--r--src/emacs.c6
-rw-r--r--src/frame.c2
-rw-r--r--src/indent.c7
-rw-r--r--src/insdel.c5
-rw-r--r--src/keyboard.c55
-rw-r--r--src/lisp.mk1
-rw-r--r--src/msdos.c2
-rw-r--r--src/nsterm.m2
-rw-r--r--src/w32.c46
-rw-r--r--src/w32fns.c103
-rw-r--r--src/w32font.c10
-rw-r--r--src/w32font.h4
-rw-r--r--src/w32heap.c4
-rw-r--r--src/w32menu.c47
-rw-r--r--src/w32uniscribe.c4
-rw-r--r--src/xdisp.c40
-rw-r--r--src/xfaces.c32
-rw-r--r--src/xfns.c33
24 files changed, 482 insertions, 195 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8e5166e22be..9e564ea6414 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,143 @@
12015-01-31 Eli Zaretskii <eliz@gnu.org>
2
3 * coding.c (raw_text_coding_system_p): New function.
4
5 * keyboard.c (read_decoded_event_from_main_queue): Use it when the
6 keyboard coding-system is 'raw-text'. (Bug#19532)
7
8 * coding.h (raw_text_coding_system_p): Add prototype.
9
102015-01-31 Andreas Schwab <schwab@linux-m68k.org>
11
12 * Makefile.in (gl-stamp): Generate globals.h through the use of
13 move-if-change.
14 (globals.h): Replace with empty command.
15
162015-01-31 Eli Zaretskii <eliz@gnu.org>
17
18 * keyboard.c (kbd_buffer_store_event_hold): Ignore FOCUS_OUT_EVENT
19 and ICONIFY_EVENT for the purposes of breaking while-no-input
20 loops. (Bug#19547)
21
22 * dired.c (read_dirent): Correct the "MSDOS hacks" hack: the
23 special code for errno = ENOENT or EACCES is needed for WINDOWSNT,
24 not for MSDOS.
25
262015-01-31 Paul Eggert <eggert@cs.ucla.edu>
27
28 Simplify read_dirent's MSDOS hacks
29 * dired.c (read_dirent): Simplify by removing the need for the
30 DIR_ENTRY argument. All callers changed. This separates the
31 MS-DOS idiosyncrasies better from the rest of the code.
32
332015-01-30 Eli Zaretskii <eliz@gnu.org>
34
35 * dired.c (read_dirent): Accept an additional argument
36 FIRST_ENTRY. If readdir fails with ENOENT or EACCES the first
37 time it is called, report the error as if it happened in
38 open_directory.
39 (directory_files_internal, file_name_completion): Adjust callers
40 or read_dirent.
41
422015-01-30 Paul Eggert <eggert@cs.ucla.edu>
43
44 Refactor calls to opendir for simplicity
45 * dired.c (open_directory): Accept Lisp_Object, not char *, for
46 dirname. Signal an error if the open fails. All callers changed.
47
482015-01-29 Paul Eggert <eggert@cs.ucla.edu>
49
50 Report readdir failures
51 Previously, on non-MS-Windows platforms the code treated most
52 readdir failures as EOF. This was incorrect, e.g., when readdir
53 fails with errno == EOVERFLOW. Signal an error instead.
54 * dired.c (read_dirent):
55 New function, which signals an error when readdir fails.
56 (directory_files_internal, file_name_completion): Use it.
57
582015-01-29 Eli Zaretskii <eliz@gnu.org>
59
60 Use bool for boolean in w32menu.c, w32font.c, w32uniscribe.c.
61 * w32uniscribe.c (uniscribe_list, uniscribe_match): Use bool where
62 appropriate.
63
64 * w32font.c (struct font_callback_data, w32font_list_internal)
65 (w32font_driver, w32font_match_internal): Use bool where appropriate.
66
67 * w32menu.c (x_activate_menubar, set_frame_menubar)
68 (w32_dialog_show, initialize_frame_menubar, w32_menu_show)
69 (is_simple_dialog): Use bool where appropriate.
70
712015-01-28 Paul Eggert <eggert@cs.ucla.edu>
72
73 Use bool, not int, to track face changes
74 * xfaces.c (face_change): Rename from face_change_count, and
75 change from int to bool. The var is now true (instead of nonzero)
76 if attributes have changed; this is simpler. All uses changed.
77 (Bug#19698)
78
792015-01-28 Eli Zaretskii <eliz@gnu.org>
80
81 * dired.c (directory_files_internal, file_name_completion)
82 [WINDOWSNT]: Signal an error when errno is set non-zero by
83 'readdir', regardless of its value.
84
85 * w32.c (sys_readdir): Set errno to ENOENT when the directory
86 doesn't exist and to EACCES when it's not accessible to the
87 current user. Set errno to zero when FindNextFile exhausts the
88 directory, so that callers don't interpret that as an error and
89 don't signal a file-error.
90 (open_unc_volume): Set errno to ENOENT if WNetOpenEnum fails.
91
92 * dired.c (directory_files_internal) [WINDOWSNT]: If readdir
93 returns NULL and errno is ENOTDIR, behave as if opendir failed to
94 open the directory. (Bug#19701)
95
96 * w32.c (sys_readdir): If FindFirstFile fails because the
97 directory doesn't exist, set errno to ENOTDIR.
98
992015-01-28 Jan Djärv <jan.h.d@swipnet.se>
100
101 * nsterm.m (drawRect:): Add block/unblock_input (Bug#19660).
102
1032015-01-28 Paul Eggert <eggert@cs.ucla.edu>
104
105 Fix coding.c subscript error
106 * coding.c (CODING_ISO_INVOKED_CHARSET):
107 Avoid undefined behavior if CODING_ISO_INVOCATION returns negative.
108
1092015-01-28 Eli Zaretskii <eliz@gnu.org>
110
111 * xdisp.c (produce_image_glyph): Fix display of images in R2L
112 screen lines: prepend the new glyph to the ones already there
113 instead of appending it.
114
115 * w32fns.c (w32_set_title_bar_text): New function, including
116 support for titles with non-ASCII characters outside of the
117 current system codepage.
118 (x_set_name, x_set_title): Use it. (Bug#19590)
119
120 * indent.c (Fvertical_motion): Return zero if we started from ZV
121 and there's an overlay after-string there. (Bug#19553)
122
123 * emacs.c (usage_message): Fix the description of the -nl switch.
124 (Bug#19542)
125
126 * xdisp.c (move_it_to, try_cursor_movement): Don't use the window
127 end information if the window_end_valid flag is unset.
128 (try_window_id): If the call to display_line invalidated the
129 window end information, give up the try_window_id optimization.
130 (Bug#19511)
131
132 * w32fns.c (Fx_server_version, Fx_server_vendor): Doc fix.
133 * xfns.c (Fx_server_version, Fx_server_vendor): Doc fix.
134
135 * emacs.c (syms_of_emacs) <system-configuration>: Doc fix. (Bug#19502)
136
1372015-01-28 Stefan Monnier <monnier@iro.umontreal.ca>
138
139 * lisp.mk (lisp): Add cl-preloaded.
140
12015-01-27 Paul Eggert <eggert@cs.ucla.edu> 1412015-01-27 Paul Eggert <eggert@cs.ucla.edu>
2 142
3 Use bool for boolean in xfaces.c 143 Use bool for boolean in xfaces.c
diff --git a/src/Makefile.in b/src/Makefile.in
index 079e0e41c9f..81977dbfec2 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -504,11 +504,17 @@ buildobj.h: Makefile
504 504
505GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m) 505GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
506 506
507AM_V_GLOBALS = $(am__v_GLOBALS_@AM_V@)
508am__v_GLOBALS_ = $(am__v_GLOBALS_@AM_DEFAULT_V@)
509am__v_GLOBALS_0 = @echo " GEN " globals.h;
510am__v_GLOBALS_1 =
511
507gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES) 512gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
508 $(AM_V_GEN)$(libsrc)/make-docfile -d $(srcdir) -g $(obj) >$@ 513 $(AM_V_GLOBALS)$(libsrc)/make-docfile -d $(srcdir) -g $(obj) > globals.tmp
514 $(AM_V_at)$(top_srcdir)/build-aux/move-if-change globals.tmp globals.h
515 $(AM_V_at)echo timestamp > $@
509 516
510globals.h: gl-stamp 517globals.h: gl-stamp; @true
511 $(AM_V_GEN)cmp $< $@ >/dev/null || cp $< $@
512 518
513$(ALLOBJS): globals.h 519$(ALLOBJS): globals.h
514 520
diff --git a/src/coding.c b/src/coding.c
index 54811588c6a..1a0e1279648 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -350,7 +350,8 @@ static Lisp_Object Vbig5_coding_system;
350#define CODING_ISO_BOL(coding) \ 350#define CODING_ISO_BOL(coding) \
351 ((coding)->spec.iso_2022.bol) 351 ((coding)->spec.iso_2022.bol)
352#define CODING_ISO_INVOKED_CHARSET(coding, plane) \ 352#define CODING_ISO_INVOKED_CHARSET(coding, plane) \
353 CODING_ISO_DESIGNATION ((coding), CODING_ISO_INVOCATION ((coding), (plane))) 353 (CODING_ISO_INVOCATION (coding, plane) < 0 ? -1 \
354 : CODING_ISO_DESIGNATION (coding, CODING_ISO_INVOCATION (coding, plane)))
354#define CODING_ISO_CMP_STATUS(coding) \ 355#define CODING_ISO_CMP_STATUS(coding) \
355 (&(coding)->spec.iso_2022.cmp_status) 356 (&(coding)->spec.iso_2022.cmp_status)
356#define CODING_ISO_EXTSEGMENT_LEN(coding) \ 357#define CODING_ISO_EXTSEGMENT_LEN(coding) \
@@ -5978,6 +5979,15 @@ raw_text_coding_system (Lisp_Object coding_system)
5978 : AREF (raw_text_eol_type, 2)); 5979 : AREF (raw_text_eol_type, 2));
5979} 5980}
5980 5981
5982/* Return true if CODING corresponds to raw-text coding-system. */
5983
5984bool
5985raw_text_coding_system_p (struct coding_system *coding)
5986{
5987 return (coding->decoder == decode_coding_raw_text
5988 && coding->encoder == encode_coding_raw_text) ? true : false;
5989}
5990
5981 5991
5982/* If CODING_SYSTEM doesn't specify end-of-line format, return one of 5992/* If CODING_SYSTEM doesn't specify end-of-line format, return one of
5983 the subsidiary that has the same eol-spec as PARENT (if it is not 5993 the subsidiary that has the same eol-spec as PARENT (if it is not
diff --git a/src/coding.h b/src/coding.h
index d49d786e6dd..c73a9cc3263 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -705,6 +705,7 @@ extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
705extern Lisp_Object encode_file_name (Lisp_Object); 705extern Lisp_Object encode_file_name (Lisp_Object);
706extern Lisp_Object decode_file_name (Lisp_Object); 706extern Lisp_Object decode_file_name (Lisp_Object);
707extern Lisp_Object raw_text_coding_system (Lisp_Object); 707extern Lisp_Object raw_text_coding_system (Lisp_Object);
708extern bool raw_text_coding_system_p (struct coding_system *);
708extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object); 709extern Lisp_Object coding_inherit_eol_type (Lisp_Object, Lisp_Object);
709extern Lisp_Object complement_process_encoding_system (Lisp_Object); 710extern Lisp_Object complement_process_encoding_system (Lisp_Object);
710 711
diff --git a/src/dired.c b/src/dired.c
index e31fdf87ac2..5038e04cd01 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -66,8 +66,9 @@ dirent_namelen (struct dirent *dp)
66} 66}
67 67
68static DIR * 68static DIR *
69open_directory (char const *name, int *fdp) 69open_directory (Lisp_Object dirname, int *fdp)
70{ 70{
71 char *name = SSDATA (dirname);
71 DIR *d; 72 DIR *d;
72 int fd, opendir_errno; 73 int fd, opendir_errno;
73 74
@@ -98,8 +99,9 @@ open_directory (char const *name, int *fdp)
98 99
99 unblock_input (); 100 unblock_input ();
100 101
102 if (!d)
103 report_file_errno ("Opening directory", dirname, opendir_errno);
101 *fdp = fd; 104 *fdp = fd;
102 errno = opendir_errno;
103 return d; 105 return d;
104} 106}
105 107
@@ -120,6 +122,35 @@ directory_files_internal_unwind (void *dh)
120 unblock_input (); 122 unblock_input ();
121} 123}
122 124
125/* Return the next directory entry from DIR; DIR's name is DIRNAME.
126 If there are no more directory entries, return a null pointer.
127 Signal any unrecoverable errors. */
128
129static struct dirent *
130read_dirent (DIR *dir, Lisp_Object dirname)
131{
132 while (true)
133 {
134 errno = 0;
135 struct dirent *dp = readdir (dir);
136 if (dp || errno == 0)
137 return dp;
138 if (! (errno == EAGAIN || errno == EINTR))
139 {
140#ifdef WINDOWSNT
141 /* The MS-Windows implementation of 'opendir' doesn't
142 actually open a directory until the first call to
143 'readdir'. If 'readdir' fails to open the directory, it
144 sets errno to ENOENT or EACCES, see w32.c. */
145 if (errno == ENOENT || errno == EACCES)
146 report_file_error ("Opening directory", dirname);
147#endif
148 report_file_error ("Reading directory", dirname);
149 }
150 QUIT;
151 }
152}
153
123/* Function shared by Fdirectory_files and Fdirectory_files_and_attributes. 154/* Function shared by Fdirectory_files and Fdirectory_files_and_attributes.
124 If not ATTRS, return a list of directory filenames; 155 If not ATTRS, return a list of directory filenames;
125 if ATTRS, return a list of directory filenames and their attributes. 156 if ATTRS, return a list of directory filenames and their attributes.
@@ -130,15 +161,12 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
130 Lisp_Object match, Lisp_Object nosort, bool attrs, 161 Lisp_Object match, Lisp_Object nosort, bool attrs,
131 Lisp_Object id_format) 162 Lisp_Object id_format)
132{ 163{
133 DIR *d;
134 int fd;
135 ptrdiff_t directory_nbytes; 164 ptrdiff_t directory_nbytes;
136 Lisp_Object list, dirfilename, encoded_directory; 165 Lisp_Object list, dirfilename, encoded_directory;
137 struct re_pattern_buffer *bufp = NULL; 166 struct re_pattern_buffer *bufp = NULL;
138 bool needsep = 0; 167 bool needsep = 0;
139 ptrdiff_t count = SPECPDL_INDEX (); 168 ptrdiff_t count = SPECPDL_INDEX ();
140 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 169 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
141 struct dirent *dp;
142#ifdef WINDOWSNT 170#ifdef WINDOWSNT
143 Lisp_Object w32_save = Qnil; 171 Lisp_Object w32_save = Qnil;
144#endif 172#endif
@@ -182,9 +210,8 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
182 /* Now *bufp is the compiled form of MATCH; don't call anything 210 /* Now *bufp is the compiled form of MATCH; don't call anything
183 which might compile a new regexp until we're done with the loop! */ 211 which might compile a new regexp until we're done with the loop! */
184 212
185 d = open_directory (SSDATA (dirfilename), &fd); 213 int fd;
186 if (d == NULL) 214 DIR *d = open_directory (dirfilename, &fd);
187 report_file_error ("Opening directory", directory);
188 215
189 /* Unfortunately, we can now invoke expand-file-name and 216 /* Unfortunately, we can now invoke expand-file-name and
190 file-attributes on filenames, both of which can throw, so we must 217 file-attributes on filenames, both of which can throw, so we must
@@ -221,28 +248,13 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
221 || !IS_ANY_SEP (SREF (directory, directory_nbytes - 1))) 248 || !IS_ANY_SEP (SREF (directory, directory_nbytes - 1)))
222 needsep = 1; 249 needsep = 1;
223 250
224 /* Loop reading blocks until EOF or error. */ 251 /* Loop reading directory entries. */
225 for (;;) 252 for (struct dirent *dp; (dp = read_dirent (d, directory)); )
226 { 253 {
227 ptrdiff_t len; 254 ptrdiff_t len = dirent_namelen (dp);
228 bool wanted = 0; 255 Lisp_Object name = make_unibyte_string (dp->d_name, len);
229 Lisp_Object name, finalname; 256 Lisp_Object finalname = name;
230 struct gcpro gcpro1, gcpro2; 257 struct gcpro gcpro1, gcpro2;
231
232 errno = 0;
233 dp = readdir (d);
234 if (!dp)
235 {
236 if (errno == EAGAIN || errno == EINTR)
237 {
238 QUIT;
239 continue;
240 }
241 break;
242 }
243
244 len = dirent_namelen (dp);
245 name = finalname = make_unibyte_string (dp->d_name, len);
246 GCPRO2 (finalname, name); 258 GCPRO2 (finalname, name);
247 259
248 /* Note: DECODE_FILE can GC; it should protect its argument, 260 /* Note: DECODE_FILE can GC; it should protect its argument,
@@ -255,9 +267,8 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
255 immediate_quit = 1; 267 immediate_quit = 1;
256 QUIT; 268 QUIT;
257 269
258 if (NILP (match) 270 bool wanted = (NILP (match)
259 || re_search (bufp, SSDATA (name), len, 0, len, 0) >= 0) 271 || re_search (bufp, SSDATA (name), len, 0, len, 0) >= 0);
260 wanted = 1;
261 272
262 immediate_quit = 0; 273 immediate_quit = 0;
263 274
@@ -446,8 +457,6 @@ static Lisp_Object
446file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, 457file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
447 Lisp_Object predicate) 458 Lisp_Object predicate)
448{ 459{
449 DIR *d;
450 int fd;
451 ptrdiff_t bestmatchsize = 0; 460 ptrdiff_t bestmatchsize = 0;
452 int matchcount = 0; 461 int matchcount = 0;
453 /* If ALL_FLAG is 1, BESTMATCH is the list of all matches, decoded. 462 /* If ALL_FLAG is 1, BESTMATCH is the list of all matches, decoded.
@@ -481,37 +490,17 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag,
481 work with decoded file names, but we still do some filtering based 490 work with decoded file names, but we still do some filtering based
482 on the encoded file name. */ 491 on the encoded file name. */
483 encoded_file = ENCODE_FILE (file); 492 encoded_file = ENCODE_FILE (file);
484
485 encoded_dir = ENCODE_FILE (Fdirectory_file_name (dirname)); 493 encoded_dir = ENCODE_FILE (Fdirectory_file_name (dirname));
486 494 int fd;
487 d = open_directory (SSDATA (encoded_dir), &fd); 495 DIR *d = open_directory (encoded_dir, &fd);
488 if (!d)
489 report_file_error ("Opening directory", dirname);
490
491 record_unwind_protect_ptr (directory_files_internal_unwind, d); 496 record_unwind_protect_ptr (directory_files_internal_unwind, d);
492 497
493 /* Loop reading blocks */ 498 /* Loop reading directory entries. */
494 /* (att3b compiler bug requires do a null comparison this way) */ 499 for (struct dirent *dp; (dp = read_dirent (d, dirname)); )
495 while (1)
496 { 500 {
497 struct dirent *dp; 501 ptrdiff_t len = dirent_namelen (dp);
498 ptrdiff_t len;
499 bool canexclude = 0; 502 bool canexclude = 0;
500 503
501 errno = 0;
502 dp = readdir (d);
503 if (!dp)
504 {
505 if (errno == EAGAIN || errno == EINTR)
506 {
507 QUIT;
508 continue;
509 }
510 break;
511 }
512
513 len = dirent_namelen (dp);
514
515 QUIT; 504 QUIT;
516 if (len < SCHARS (encoded_file) 505 if (len < SCHARS (encoded_file)
517 || (scmp (dp->d_name, SSDATA (encoded_file), 506 || (scmp (dp->d_name, SSDATA (encoded_file),
diff --git a/src/dispextern.h b/src/dispextern.h
index 9ea64fb9f63..fbf0c74454d 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1860,10 +1860,10 @@ GLYPH_CODE_P (Lisp_Object gc)
1860 : TYPE_MAXIMUM (EMACS_INT))))); 1860 : TYPE_MAXIMUM (EMACS_INT)))));
1861} 1861}
1862 1862
1863/* Non-zero means face attributes have been changed since the last 1863/* True means face attributes have been changed since the last
1864 redisplay. Used in redisplay_internal. */ 1864 redisplay. Used in redisplay_internal. */
1865 1865
1866extern int face_change_count; 1866extern bool face_change;
1867 1867
1868/* For reordering of bidirectional text. */ 1868/* For reordering of bidirectional text. */
1869 1869
diff --git a/src/emacs.c b/src/emacs.c
index 03dea46fe2d..87b1f11d59b 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -234,7 +234,7 @@ Initialization options:\n\
234 "\ 234 "\
235--no-desktop do not load a saved desktop\n\ 235--no-desktop do not load a saved desktop\n\
236--no-init-file, -q load neither ~/.emacs nor default.el\n\ 236--no-init-file, -q load neither ~/.emacs nor default.el\n\
237--no-shared-memory, -nl do not use shared memory\n\ 237--no-loadup, -nl do not load loadup.el into bare Emacs\n\
238--no-site-file do not load site-start.el\n\ 238--no-site-file do not load site-start.el\n\
239--no-site-lisp, -nsl do not add site-lisp directories to load-path\n\ 239--no-site-lisp, -nsl do not add site-lisp directories to load-path\n\
240--no-splash do not display a splash screen on startup\n\ 240--no-splash do not display a splash screen on startup\n\
@@ -2398,9 +2398,7 @@ hpux, irix, usg-unix-v) indicates some sort of Unix system. */);
2398 /* See configure.ac (and config.nt) for the possible SYSTEM_TYPEs. */ 2398 /* See configure.ac (and config.nt) for the possible SYSTEM_TYPEs. */
2399 2399
2400 DEFVAR_LISP ("system-configuration", Vsystem_configuration, 2400 DEFVAR_LISP ("system-configuration", Vsystem_configuration,
2401 doc: /* Value is string indicating configuration Emacs was built for. 2401 doc: /* Value is string indicating configuration Emacs was built for. */);
2402On MS-Windows, the value reflects the OS flavor and version on which
2403Emacs is running. */);
2404 Vsystem_configuration = build_string (EMACS_CONFIGURATION); 2402 Vsystem_configuration = build_string (EMACS_CONFIGURATION);
2405 2403
2406 DEFVAR_LISP ("system-configuration-options", Vsystem_configuration_options, 2404 DEFVAR_LISP ("system-configuration-options", Vsystem_configuration_options,
diff --git a/src/frame.c b/src/frame.c
index 2ce5a623853..e4adfe8f08f 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3632,7 +3632,7 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
3632 3632
3633 XSETFRAME (frame, f); 3633 XSETFRAME (frame, f);
3634 x_set_font (f, Fframe_parameter (frame, Qfont), Qnil); 3634 x_set_font (f, Fframe_parameter (frame, Qfont), Qnil);
3635 ++face_change_count; 3635 face_change = true;
3636 windows_or_buffers_changed = 18; 3636 windows_or_buffers_changed = 18;
3637 } 3637 }
3638} 3638}
diff --git a/src/indent.c b/src/indent.c
index 589aeb9c005..8660400e1ce 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2137,10 +2137,15 @@ whether or not it is currently displayed in some window. */)
2137 if (nlines > 1) 2137 if (nlines > 1)
2138 move_it_by_lines (&it, min (PTRDIFF_MAX, nlines - 1)); 2138 move_it_by_lines (&it, min (PTRDIFF_MAX, nlines - 1));
2139 } 2139 }
2140 else 2140 else /* it_start = ZV */
2141 { 2141 {
2142 it.vpos = 0; 2142 it.vpos = 0;
2143 move_it_by_lines (&it, min (PTRDIFF_MAX, nlines)); 2143 move_it_by_lines (&it, min (PTRDIFF_MAX, nlines));
2144 /* We could have some display or overlay string at ZV,
2145 in which case it.vpos will be nonzero now, while
2146 actually we didn't move vertically at all. */
2147 if (IT_CHARPOS (it) == CHARPOS (pt) && CHARPOS (pt) == it_start)
2148 it.vpos = 0;
2144 } 2149 }
2145 } 2150 }
2146 2151
diff --git a/src/insdel.c b/src/insdel.c
index 3b5b520aac8..80650be25ae 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1,7 +1,6 @@
1/* Buffer insertion/deletion and gap motion for GNU Emacs. 1/* Buffer insertion/deletion and gap motion for GNU Emacs.
2 2 Copyright (C) 1985-1986, 1993-1995, 1997-2015 Free Software
3Copyright (C) 1985-1986, 1993-1995, 1997-2015 Free Software Foundation, 3 Foundation, Inc.
4Inc.
5 4
6This file is part of GNU Emacs. 5This file is part of GNU Emacs.
7 6
diff --git a/src/keyboard.c b/src/keyboard.c
index a5e1363326c..a9ff77d0473 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2288,30 +2288,41 @@ read_decoded_event_from_main_queue (struct timespec *end_time,
2288 { /* An encoded byte sequence, let's try to decode it. */ 2288 { /* An encoded byte sequence, let's try to decode it. */
2289 struct coding_system *coding 2289 struct coding_system *coding
2290 = TERMINAL_KEYBOARD_CODING (terminal); 2290 = TERMINAL_KEYBOARD_CODING (terminal);
2291 unsigned char src[MAX_ENCODED_BYTES]; 2291
2292 unsigned char dest[MAX_ENCODED_BYTES * MAX_MULTIBYTE_LENGTH]; 2292 if (raw_text_coding_system_p (coding))
2293 int i; 2293 {
2294 for (i = 0; i < n; i++) 2294 int i;
2295 src[i] = XINT (events[i]); 2295 if (meta_key != 2)
2296 if (meta_key != 2) 2296 for (i = 0; i < n; i++)
2297 for (i = 0; i < n; i++) 2297 events[i] = make_number (XINT (events[i]) & ~0x80);
2298 src[i] &= ~0x80;
2299 coding->destination = dest;
2300 coding->dst_bytes = sizeof dest;
2301 decode_coding_c_string (coding, src, n, Qnil);
2302 eassert (coding->produced_char <= n);
2303 if (coding->produced_char == 0)
2304 { /* The encoded sequence is incomplete. */
2305 if (n < MAX_ENCODED_BYTES) /* Avoid buffer overflow. */
2306 continue; /* Read on! */
2307 } 2298 }
2308 else 2299 else
2309 { 2300 {
2310 const unsigned char *p = coding->destination; 2301 unsigned char src[MAX_ENCODED_BYTES];
2311 eassert (coding->carryover_bytes == 0); 2302 unsigned char dest[MAX_ENCODED_BYTES * MAX_MULTIBYTE_LENGTH];
2312 n = 0; 2303 int i;
2313 while (n < coding->produced_char) 2304 for (i = 0; i < n; i++)
2314 events[n++] = make_number (STRING_CHAR_ADVANCE (p)); 2305 src[i] = XINT (events[i]);
2306 if (meta_key != 2)
2307 for (i = 0; i < n; i++)
2308 src[i] &= ~0x80;
2309 coding->destination = dest;
2310 coding->dst_bytes = sizeof dest;
2311 decode_coding_c_string (coding, src, n, Qnil);
2312 eassert (coding->produced_char <= n);
2313 if (coding->produced_char == 0)
2314 { /* The encoded sequence is incomplete. */
2315 if (n < MAX_ENCODED_BYTES) /* Avoid buffer overflow. */
2316 continue; /* Read on! */
2317 }
2318 else
2319 {
2320 const unsigned char *p = coding->destination;
2321 eassert (coding->carryover_bytes == 0);
2322 n = 0;
2323 while (n < coding->produced_char)
2324 events[n++] = make_number (STRING_CHAR_ADVANCE (p));
2325 }
2315 } 2326 }
2316 } 2327 }
2317 /* Now `events' should hold decoded events. 2328 /* Now `events' should hold decoded events.
@@ -3639,7 +3650,9 @@ kbd_buffer_store_event_hold (register struct input_event *event,
3639 as input, set quit-flag to cause an interrupt. */ 3650 as input, set quit-flag to cause an interrupt. */
3640 if (!NILP (Vthrow_on_input) 3651 if (!NILP (Vthrow_on_input)
3641 && event->kind != FOCUS_IN_EVENT 3652 && event->kind != FOCUS_IN_EVENT
3653 && event->kind != FOCUS_OUT_EVENT
3642 && event->kind != HELP_EVENT 3654 && event->kind != HELP_EVENT
3655 && event->kind != ICONIFY_EVENT
3643 && event->kind != DEICONIFY_EVENT) 3656 && event->kind != DEICONIFY_EVENT)
3644 { 3657 {
3645 Vquit_flag = Vthrow_on_input; 3658 Vquit_flag = Vthrow_on_input;
diff --git a/src/lisp.mk b/src/lisp.mk
index a9deb2b53d9..ee2a07c0fd7 100644
--- a/src/lisp.mk
+++ b/src/lisp.mk
@@ -71,6 +71,7 @@ lisp = \
71 $(lispsource)/faces.elc \ 71 $(lispsource)/faces.elc \
72 $(lispsource)/button.elc \ 72 $(lispsource)/button.elc \
73 $(lispsource)/startup.elc \ 73 $(lispsource)/startup.elc \
74 $(lispsource)/emacs-lisp/cl-preloaded.elc \
74 $(lispsource)/emacs-lisp/nadvice.elc \ 75 $(lispsource)/emacs-lisp/nadvice.elc \
75 $(lispsource)/minibuffer.elc \ 76 $(lispsource)/minibuffer.elc \
76 $(lispsource)/abbrev.elc \ 77 $(lispsource)/abbrev.elc \
diff --git a/src/msdos.c b/src/msdos.c
index 3c2277e6955..8b05b34795d 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1733,7 +1733,7 @@ IT_set_frame_parameters (struct frame *f, Lisp_Object alist)
1733 1733
1734 if (redraw) 1734 if (redraw)
1735 { 1735 {
1736 face_change_count++; /* forces xdisp.c to recompute basic faces */ 1736 face_change = true; /* forces xdisp.c to recompute basic faces */
1737 if (f == SELECTED_FRAME ()) 1737 if (f == SELECTED_FRAME ())
1738 redraw_frame (f); 1738 redraw_frame (f);
1739 } 1739 }
diff --git a/src/nsterm.m b/src/nsterm.m
index ee1268ef850..e90c3d70db3 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6773,7 +6773,9 @@ if (cols > 0 && rows > 0)
6773 return; 6773 return;
6774 6774
6775 ns_clear_frame_area (emacsframe, x, y, width, height); 6775 ns_clear_frame_area (emacsframe, x, y, width, height);
6776 block_input ();
6776 expose_frame (emacsframe, x, y, width, height); 6777 expose_frame (emacsframe, x, y, width, height);
6778 unblock_input ();
6777 6779
6778 /* 6780 /*
6779 drawRect: may be called (at least in OS X 10.5) for invisible 6781 drawRect: may be called (at least in OS X 10.5) for invisible
diff --git a/src/w32.c b/src/w32.c
index 31b13289b57..90096689776 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -3433,17 +3433,51 @@ sys_readdir (DIR *dirp)
3433 } 3433 }
3434 3434
3435 if (dir_find_handle == INVALID_HANDLE_VALUE) 3435 if (dir_find_handle == INVALID_HANDLE_VALUE)
3436 return NULL; 3436 {
3437 /* Any changes in the value of errno here should be in sync
3438 with what directory_files_internal does when it calls
3439 readdir. */
3440 switch (GetLastError ())
3441 {
3442 /* Windows uses this value when FindFirstFile finds no
3443 files that match the wildcard. This is not supposed
3444 to happen, since our wildcard is "*", but just in
3445 case, if there's some weird empty directory with not
3446 even "." and ".." entries... */
3447 case ERROR_FILE_NOT_FOUND:
3448 errno = 0;
3449 /* FALLTHRU */
3450 default:
3451 break;
3452 case ERROR_ACCESS_DENIED:
3453 case ERROR_NETWORK_ACCESS_DENIED:
3454 errno = EACCES;
3455 break;
3456 case ERROR_PATH_NOT_FOUND:
3457 case ERROR_INVALID_DRIVE:
3458 case ERROR_BAD_NETPATH:
3459 case ERROR_BAD_NET_NAME:
3460 errno = ENOENT;
3461 break;
3462 }
3463 return NULL;
3464 }
3437 } 3465 }
3438 else if (w32_unicode_filenames) 3466 else if (w32_unicode_filenames)
3439 { 3467 {
3440 if (!FindNextFileW (dir_find_handle, &dir_find_data_w)) 3468 if (!FindNextFileW (dir_find_handle, &dir_find_data_w))
3441 return NULL; 3469 {
3470 errno = 0;
3471 return NULL;
3472 }
3442 } 3473 }
3443 else 3474 else
3444 { 3475 {
3445 if (!FindNextFileA (dir_find_handle, &dir_find_data_a)) 3476 if (!FindNextFileA (dir_find_handle, &dir_find_data_a))
3446 return NULL; 3477 {
3478 errno = 0;
3479 return NULL;
3480 }
3447 } 3481 }
3448 3482
3449 /* Emacs never uses this value, so don't bother making it match 3483 /* Emacs never uses this value, so don't bother making it match
@@ -3545,7 +3579,11 @@ open_unc_volume (const char *path)
3545 if (result == NO_ERROR) 3579 if (result == NO_ERROR)
3546 return henum; 3580 return henum;
3547 else 3581 else
3548 return INVALID_HANDLE_VALUE; 3582 {
3583 /* Make sure directory_files_internal reports a sensible error. */
3584 errno = ENOENT;
3585 return INVALID_HANDLE_VALUE;
3586 }
3549} 3587}
3550 3588
3551static void * 3589static void *
diff --git a/src/w32fns.c b/src/w32fns.c
index c269c4f8e68..8435270438d 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1759,6 +1759,50 @@ x_change_tool_bar_height (struct frame *f, int height)
1759 x_clear_under_internal_border (f); 1759 x_clear_under_internal_border (f);
1760} 1760}
1761 1761
1762static void
1763w32_set_title_bar_text (struct frame *f, Lisp_Object name)
1764{
1765 if (FRAME_W32_WINDOW (f))
1766 {
1767 block_input ();
1768#ifdef __CYGWIN__
1769 GUI_FN (SetWindowText) (FRAME_W32_WINDOW (f),
1770 GUI_SDATA (GUI_ENCODE_SYSTEM (name)));
1771#else
1772 /* The frame's title many times shows the name of the file
1773 visited in the selected window's buffer, so it makes sense to
1774 support non-ASCII characters outside of the current system
1775 codepage in the title. */
1776 if (w32_unicode_filenames)
1777 {
1778 Lisp_Object encoded_title = ENCODE_UTF_8 (name);
1779 wchar_t *title_w;
1780 int tlen = pMultiByteToWideChar (CP_UTF8, 0, SSDATA (encoded_title),
1781 -1, NULL, 0);
1782
1783 if (tlen > 0)
1784 {
1785 /* Windows truncates the title text beyond what fits on
1786 a single line, so we can limit the length to some
1787 reasonably large value, and use alloca. */
1788 if (tlen > 10000)
1789 tlen = 10000;
1790 title_w = alloca ((tlen + 1) * sizeof (wchar_t));
1791 pMultiByteToWideChar (CP_UTF8, 0, SSDATA (encoded_title), -1,
1792 title_w, tlen);
1793 title_w[tlen] = L'\0';
1794 SetWindowTextW (FRAME_W32_WINDOW (f), title_w);
1795 }
1796 else /* Conversion to UTF-16 failed, so we punt. */
1797 SetWindowTextA (FRAME_W32_WINDOW (f),
1798 SSDATA (ENCODE_SYSTEM (name)));
1799 }
1800 else
1801 SetWindowTextA (FRAME_W32_WINDOW (f), SSDATA (ENCODE_SYSTEM (name)));
1802#endif
1803 unblock_input ();
1804 }
1805}
1762 1806
1763/* Change the name of frame F to NAME. If NAME is nil, set F's name to 1807/* Change the name of frame F to NAME. If NAME is nil, set F's name to
1764 w32_id_name. 1808 w32_id_name.
@@ -1812,13 +1856,7 @@ x_set_name (struct frame *f, Lisp_Object name, bool explicit)
1812 if (! NILP (f->title)) 1856 if (! NILP (f->title))
1813 name = f->title; 1857 name = f->title;
1814 1858
1815 if (FRAME_W32_WINDOW (f)) 1859 w32_set_title_bar_text (f, name);
1816 {
1817 block_input ();
1818 GUI_FN (SetWindowText) (FRAME_W32_WINDOW (f),
1819 GUI_SDATA (GUI_ENCODE_SYSTEM (name)));
1820 unblock_input ();
1821 }
1822} 1860}
1823 1861
1824/* This function should be called when the user's lisp code has 1862/* This function should be called when the user's lisp code has
@@ -1856,13 +1894,7 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
1856 if (NILP (name)) 1894 if (NILP (name))
1857 name = f->name; 1895 name = f->name;
1858 1896
1859 if (FRAME_W32_WINDOW (f)) 1897 w32_set_title_bar_text (f, name);
1860 {
1861 block_input ();
1862 GUI_FN (SetWindowText) (FRAME_W32_WINDOW (f),
1863 GUI_SDATA (GUI_ENCODE_SYSTEM (name)));
1864 unblock_input ();
1865 }
1866} 1898}
1867 1899
1868void 1900void
@@ -4895,25 +4927,38 @@ If omitted or nil, that stands for the selected frame's display. */)
4895} 4927}
4896 4928
4897DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, 4929DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
4898 doc: /* Return the "vendor ID" string of the W32 system (Microsoft). 4930 doc: /* Return the "vendor ID" string of the GUI software on TERMINAL.
4899The optional argument DISPLAY specifies which display to ask about. 4931
4900DISPLAY should be either a frame or a display name (a string). 4932\(Labeling every distributor as a "vendor" embodies the false assumption
4933that operating systems cannot be developed and distributed noncommercially.)
4934
4935For GNU and Unix systems, this queries the X server software; for
4936MS-Windows, this queries the OS.
4937
4938The optional argument TERMINAL specifies which display to ask about.
4939TERMINAL should be a terminal object, a frame or a display name (a string).
4901If omitted or nil, that stands for the selected frame's display. */) 4940If omitted or nil, that stands for the selected frame's display. */)
4902 (Lisp_Object display) 4941 (Lisp_Object terminal)
4903{ 4942{
4904 return build_string ("Microsoft Corp."); 4943 return build_string ("Microsoft Corp.");
4905} 4944}
4906 4945
4907DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, 4946DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
4908 doc: /* Return the version numbers of the server of DISPLAY. 4947 doc: /* Return the version numbers of the GUI software on TERMINAL.
4909The value is a list of three integers: the major and minor 4948The value is a list of three integers specifying the version of the GUI
4910version numbers of the X Protocol in use, and the distributor-specific 4949software in use.
4911release number. See also the function `x-server-vendor'.
4912 4950
4913The optional argument DISPLAY specifies which display to ask about. 4951For GNU and Unix system, the first 2 numbers are the version of the X
4914DISPLAY should be either a frame or a display name (a string). 4952Protocol used on TERMINAL and the 3rd number is the distributor-specific
4953release number. For MS-Windows, the 3 numbers report the version and
4954the build number of the OS.
4955
4956See also the function `x-server-vendor'.
4957
4958The optional argument TERMINAL specifies which display to ask about.
4959TERMINAL should be a terminal object, a frame or a display name (a string).
4915If omitted or nil, that stands for the selected frame's display. */) 4960If omitted or nil, that stands for the selected frame's display. */)
4916 (Lisp_Object display) 4961 (Lisp_Object terminal)
4917{ 4962{
4918 return list3i (w32_major_version, w32_minor_version, w32_build_number); 4963 return list3i (w32_major_version, w32_minor_version, w32_build_number);
4919} 4964}
@@ -5623,7 +5668,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5623 ptrdiff_t count = SPECPDL_INDEX (); 5668 ptrdiff_t count = SPECPDL_INDEX ();
5624 struct gcpro gcpro1, gcpro2, gcpro3; 5669 struct gcpro gcpro1, gcpro2, gcpro3;
5625 struct kboard *kb; 5670 struct kboard *kb;
5626 int face_change_count_before = face_change_count; 5671 bool face_change_before = face_change;
5627 Lisp_Object buffer; 5672 Lisp_Object buffer;
5628 struct buffer *old_buffer; 5673 struct buffer *old_buffer;
5629 5674
@@ -5835,11 +5880,11 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5835 f->can_x_set_window_size = true; 5880 f->can_x_set_window_size = true;
5836 5881
5837 /* Setting attributes of faces of the tooltip frame from resources 5882 /* Setting attributes of faces of the tooltip frame from resources
5838 and similar will increment face_change_count, which leads to the 5883 and similar will set face_change, which leads to the
5839 clearing of all current matrices. Since this isn't necessary 5884 clearing of all current matrices. Since this isn't necessary
5840 here, avoid it by resetting face_change_count to the value it 5885 here, avoid it by resetting face_change to the value it
5841 had before we created the tip frame. */ 5886 had before we created the tip frame. */
5842 face_change_count = face_change_count_before; 5887 face_change = face_change_before;
5843 5888
5844 /* Discard the unwind_protect. */ 5889 /* Discard the unwind_protect. */
5845 return unbind_to (count, frame); 5890 return unbind_to (count, frame);
diff --git a/src/w32font.c b/src/w32font.c
index ab772679908..360ad3f1c48 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -95,7 +95,7 @@ struct font_callback_data
95 /* The list to add matches to. */ 95 /* The list to add matches to. */
96 Lisp_Object list; 96 Lisp_Object list;
97 /* Whether to match only opentype fonts. */ 97 /* Whether to match only opentype fonts. */
98 int opentype_only; 98 bool opentype_only;
99}; 99};
100 100
101/* Handles the problem that EnumFontFamiliesEx will not return all 101/* Handles the problem that EnumFontFamiliesEx will not return all
@@ -746,7 +746,8 @@ w32font_otf_drive (struct font *font, Lisp_Object features,
746 Additional parameter opentype_only restricts the returned fonts to 746 Additional parameter opentype_only restricts the returned fonts to
747 opentype fonts, which can be used with the Uniscribe backend. */ 747 opentype fonts, which can be used with the Uniscribe backend. */
748Lisp_Object 748Lisp_Object
749w32font_list_internal (struct frame *f, Lisp_Object font_spec, int opentype_only) 749w32font_list_internal (struct frame *f, Lisp_Object font_spec,
750 bool opentype_only)
750{ 751{
751 struct font_callback_data match_data; 752 struct font_callback_data match_data;
752 HDC dc; 753 HDC dc;
@@ -798,7 +799,8 @@ w32font_list_internal (struct frame *f, Lisp_Object font_spec, int opentype_only
798 Additional parameter opentype_only restricts the returned fonts to 799 Additional parameter opentype_only restricts the returned fonts to
799 opentype fonts, which can be used with the Uniscribe backend. */ 800 opentype fonts, which can be used with the Uniscribe backend. */
800Lisp_Object 801Lisp_Object
801w32font_match_internal (struct frame *f, Lisp_Object font_spec, int opentype_only) 802w32font_match_internal (struct frame *f, Lisp_Object font_spec,
803 bool opentype_only)
802{ 804{
803 struct font_callback_data match_data; 805 struct font_callback_data match_data;
804 HDC dc; 806 HDC dc;
@@ -2459,7 +2461,7 @@ w32font_filter_properties (Lisp_Object font, Lisp_Object alist)
2459struct font_driver w32font_driver = 2461struct font_driver w32font_driver =
2460 { 2462 {
2461 LISP_INITIALLY_ZERO, /* Qgdi */ 2463 LISP_INITIALLY_ZERO, /* Qgdi */
2462 0, /* case insensitive */ 2464 false, /* case insensitive */
2463 w32font_get_cache, 2465 w32font_get_cache,
2464 w32font_list, 2466 w32font_list,
2465 w32font_match, 2467 w32font_match,
diff --git a/src/w32font.h b/src/w32font.h
index 82c5e09b9fc..0ad01254be9 100644
--- a/src/w32font.h
+++ b/src/w32font.h
@@ -66,10 +66,10 @@ struct w32font_info
66Lisp_Object w32font_get_cache (struct frame *fe); 66Lisp_Object w32font_get_cache (struct frame *fe);
67Lisp_Object w32font_list_internal (struct frame *f, 67Lisp_Object w32font_list_internal (struct frame *f,
68 Lisp_Object font_spec, 68 Lisp_Object font_spec,
69 int opentype_only); 69 bool opentype_only);
70Lisp_Object w32font_match_internal (struct frame *f, 70Lisp_Object w32font_match_internal (struct frame *f,
71 Lisp_Object font_spec, 71 Lisp_Object font_spec,
72 int opentype_only); 72 bool opentype_only);
73int w32font_open_internal (struct frame *f, Lisp_Object font_entity, 73int w32font_open_internal (struct frame *f, Lisp_Object font_entity,
74 int pixel_size, Lisp_Object font_object); 74 int pixel_size, Lisp_Object font_object);
75void w32font_close (struct font *font); 75void w32font_close (struct font *font);
diff --git a/src/w32heap.c b/src/w32heap.c
index d5a9dae0aa4..ee0eb161502 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -1,5 +1,5 @@
1/* Heap management routines for GNU Emacs on the Microsoft Windows 1/* Heap management routines for GNU Emacs on the Microsoft Windows API.
2 API. Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc. 2 Copyright (C) 1994, 2001-2015 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
diff --git a/src/w32menu.c b/src/w32menu.c
index 2a1dafbd6d7..40b8f5f82a0 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -103,7 +103,7 @@ void set_frame_menubar (struct frame *, bool, bool);
103#ifdef HAVE_DIALOGS 103#ifdef HAVE_DIALOGS
104static Lisp_Object w32_dialog_show (struct frame *, Lisp_Object, Lisp_Object, char **); 104static Lisp_Object w32_dialog_show (struct frame *, Lisp_Object, Lisp_Object, char **);
105#else 105#else
106static int is_simple_dialog (Lisp_Object); 106static bool is_simple_dialog (Lisp_Object);
107static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object); 107static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object);
108#endif 108#endif
109 109
@@ -166,7 +166,7 @@ w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
166void 166void
167x_activate_menubar (struct frame *f) 167x_activate_menubar (struct frame *f)
168{ 168{
169 set_frame_menubar (f, 0, 1); 169 set_frame_menubar (f, false, true);
170 170
171 /* Lock out further menubar changes while active. */ 171 /* Lock out further menubar changes while active. */
172 f->output_data.w32->menubar_active = 1; 172 f->output_data.w32->menubar_active = 1;
@@ -289,7 +289,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
289 XSETFRAME (Vmenu_updating_frame, f); 289 XSETFRAME (Vmenu_updating_frame, f);
290 290
291 if (! menubar_widget) 291 if (! menubar_widget)
292 deep_p = 1; 292 deep_p = true;
293 293
294 if (deep_p) 294 if (deep_p)
295 { 295 {
@@ -388,7 +388,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
388 else 388 else
389 first_wv->contents = wv; 389 first_wv->contents = wv;
390 /* Don't set wv->name here; GC during the loop might relocate it. */ 390 /* Don't set wv->name here; GC during the loop might relocate it. */
391 wv->enabled = 1; 391 wv->enabled = true;
392 wv->button_type = BUTTON_TYPE_NONE; 392 wv->button_type = BUTTON_TYPE_NONE;
393 prev_wv = wv; 393 prev_wv = wv;
394 } 394 }
@@ -501,7 +501,7 @@ set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
501 /* Force the window size to be recomputed so that the frame's text 501 /* Force the window size to be recomputed so that the frame's text
502 area remains the same, if menubar has just been created. */ 502 area remains the same, if menubar has just been created. */
503 if (old_widget == NULL) 503 if (old_widget == NULL)
504 adjust_frame_size (f, -1, -1, 2, 0, Qmenu_bar_lines); 504 adjust_frame_size (f, -1, -1, 2, false, Qmenu_bar_lines);
505 } 505 }
506 506
507 unblock_input (); 507 unblock_input ();
@@ -518,7 +518,7 @@ initialize_frame_menubar (struct frame *f)
518 /* This function is called before the first chance to redisplay 518 /* This function is called before the first chance to redisplay
519 the frame. It has to be, so the frame will have the right size. */ 519 the frame. It has to be, so the frame will have the right size. */
520 fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f))); 520 fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
521 set_frame_menubar (f, 1, 1); 521 set_frame_menubar (f, true, true);
522} 522}
523 523
524/* Get rid of the menu bar of frame F, and free its storage. 524/* Get rid of the menu bar of frame F, and free its storage.
@@ -570,7 +570,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags,
570 Lisp_Object *subprefix_stack 570 Lisp_Object *subprefix_stack
571 = (Lisp_Object *) alloca (menu_items_used * word_size); 571 = (Lisp_Object *) alloca (menu_items_used * word_size);
572 int submenu_depth = 0; 572 int submenu_depth = 0;
573 int first_pane; 573 bool first_pane;
574 574
575 *error = NULL; 575 *error = NULL;
576 576
@@ -590,7 +590,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags,
590 wv = make_widget_value ("menu", NULL, true, Qnil); 590 wv = make_widget_value ("menu", NULL, true, Qnil);
591 wv->button_type = BUTTON_TYPE_NONE; 591 wv->button_type = BUTTON_TYPE_NONE;
592 first_wv = wv; 592 first_wv = wv;
593 first_pane = 1; 593 first_pane = true;
594 594
595 /* Loop over all panes and items, filling in the tree. */ 595 /* Loop over all panes and items, filling in the tree. */
596 i = 0; 596 i = 0;
@@ -601,14 +601,14 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags,
601 submenu_stack[submenu_depth++] = save_wv; 601 submenu_stack[submenu_depth++] = save_wv;
602 save_wv = prev_wv; 602 save_wv = prev_wv;
603 prev_wv = 0; 603 prev_wv = 0;
604 first_pane = 1; 604 first_pane = false;
605 i++; 605 i++;
606 } 606 }
607 else if (EQ (AREF (menu_items, i), Qlambda)) 607 else if (EQ (AREF (menu_items, i), Qlambda))
608 { 608 {
609 prev_wv = save_wv; 609 prev_wv = save_wv;
610 save_wv = submenu_stack[--submenu_depth]; 610 save_wv = submenu_stack[--submenu_depth];
611 first_pane = 0; 611 first_pane = false;
612 i++; 612 i++;
613 } 613 }
614 else if (EQ (AREF (menu_items, i), Qt) 614 else if (EQ (AREF (menu_items, i), Qt)
@@ -664,7 +664,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags,
664 save_wv = wv; 664 save_wv = wv;
665 prev_wv = 0; 665 prev_wv = 0;
666 } 666 }
667 first_pane = 0; 667 first_pane = false;
668 i += MENU_ITEMS_PANE_LENGTH; 668 i += MENU_ITEMS_PANE_LENGTH;
669 } 669 }
670 else 670 else
@@ -883,8 +883,9 @@ w32_dialog_show (struct frame *f, Lisp_Object title,
883 883
884 /* Number of elements seen so far, before boundary. */ 884 /* Number of elements seen so far, before boundary. */
885 int left_count = 0; 885 int left_count = 0;
886 /* 1 means we've seen the boundary between left-hand elts and right-hand. */ 886 /* true means we've seen the boundary between left-hand elts and
887 int boundary_seen = 0; 887 right-hand. */
888 bool boundary_seen = false;
888 889
889 *error = NULL; 890 *error = NULL;
890 891
@@ -928,7 +929,7 @@ w32_dialog_show (struct frame *f, Lisp_Object title,
928 { 929 {
929 /* This is the boundary between left-side elts 930 /* This is the boundary between left-side elts
930 and right-side elts. Stop incrementing right_count. */ 931 and right-side elts. Stop incrementing right_count. */
931 boundary_seen = 1; 932 boundary_seen = true;
932 i++; 933 i++;
933 continue; 934 continue;
934 } 935 }
@@ -986,7 +987,7 @@ w32_dialog_show (struct frame *f, Lisp_Object title,
986 /* Actually create the dialog. */ 987 /* Actually create the dialog. */
987 dialog_id = widget_id_tick++; 988 dialog_id = widget_id_tick++;
988 menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv, 989 menu = lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
989 f->output_data.w32->widget, 1, 0, 990 f->output_data.w32->widget, true, 0,
990 dialog_selection_callback, 0); 991 dialog_selection_callback, 0);
991 lw_modify_all_widgets (dialog_id, first_wv->contents, TRUE); 992 lw_modify_all_widgets (dialog_id, first_wv->contents, TRUE);
992 993
@@ -1037,25 +1038,25 @@ w32_dialog_show (struct frame *f, Lisp_Object title,
1037 anywhere in Emacs that uses the other specific dialog choices that 1038 anywhere in Emacs that uses the other specific dialog choices that
1038 MessageBox provides. */ 1039 MessageBox provides. */
1039 1040
1040static int 1041static bool
1041is_simple_dialog (Lisp_Object contents) 1042is_simple_dialog (Lisp_Object contents)
1042{ 1043{
1043 Lisp_Object options; 1044 Lisp_Object options;
1044 Lisp_Object name, yes, no, other; 1045 Lisp_Object name, yes, no, other;
1045 1046
1046 if (!CONSP (contents)) 1047 if (!CONSP (contents))
1047 return 0; 1048 return false;
1048 options = XCDR (contents); 1049 options = XCDR (contents);
1049 1050
1050 yes = build_string ("Yes"); 1051 yes = build_string ("Yes");
1051 no = build_string ("No"); 1052 no = build_string ("No");
1052 1053
1053 if (!CONSP (options)) 1054 if (!CONSP (options))
1054 return 0; 1055 return false;
1055 1056
1056 name = XCAR (options); 1057 name = XCAR (options);
1057 if (!CONSP (name)) 1058 if (!CONSP (name))
1058 return 0; 1059 return false;
1059 name = XCAR (name); 1060 name = XCAR (name);
1060 1061
1061 if (!NILP (Fstring_equal (name, yes))) 1062 if (!NILP (Fstring_equal (name, yes)))
@@ -1063,18 +1064,18 @@ is_simple_dialog (Lisp_Object contents)
1063 else if (!NILP (Fstring_equal (name, no))) 1064 else if (!NILP (Fstring_equal (name, no)))
1064 other = yes; 1065 other = yes;
1065 else 1066 else
1066 return 0; 1067 return false;
1067 1068
1068 options = XCDR (options); 1069 options = XCDR (options);
1069 if (!CONSP (options)) 1070 if (!CONSP (options))
1070 return 0; 1071 return false;
1071 1072
1072 name = XCAR (options); 1073 name = XCAR (options);
1073 if (!CONSP (name)) 1074 if (!CONSP (name))
1074 return 0; 1075 return false;
1075 name = XCAR (name); 1076 name = XCAR (name);
1076 if (NILP (Fstring_equal (name, other))) 1077 if (NILP (Fstring_equal (name, other)))
1077 return 0; 1078 return false;
1078 1079
1079 /* Check there are no more options. */ 1080 /* Check there are no more options. */
1080 options = XCDR (options); 1081 options = XCDR (options);
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 9cd97e28616..73c0410c7b7 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -67,7 +67,7 @@ memq_no_quit (Lisp_Object elt, Lisp_Object list)
67static Lisp_Object 67static Lisp_Object
68uniscribe_list (struct frame *f, Lisp_Object font_spec) 68uniscribe_list (struct frame *f, Lisp_Object font_spec)
69{ 69{
70 Lisp_Object fonts = w32font_list_internal (f, font_spec, 1); 70 Lisp_Object fonts = w32font_list_internal (f, font_spec, true);
71 FONT_ADD_LOG ("uniscribe-list", font_spec, fonts); 71 FONT_ADD_LOG ("uniscribe-list", font_spec, fonts);
72 return fonts; 72 return fonts;
73} 73}
@@ -75,7 +75,7 @@ uniscribe_list (struct frame *f, Lisp_Object font_spec)
75static Lisp_Object 75static Lisp_Object
76uniscribe_match (struct frame *f, Lisp_Object font_spec) 76uniscribe_match (struct frame *f, Lisp_Object font_spec)
77{ 77{
78 Lisp_Object entity = w32font_match_internal (f, font_spec, 1); 78 Lisp_Object entity = w32font_match_internal (f, font_spec, true);
79 FONT_ADD_LOG ("uniscribe-match", font_spec, entity); 79 FONT_ADD_LOG ("uniscribe-match", font_spec, entity);
80 return entity; 80 return entity;
81} 81}
diff --git a/src/xdisp.c b/src/xdisp.c
index d868633e25c..01d598fe2c2 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2730,9 +2730,9 @@ init_iterator (struct it *it, struct window *w,
2730 free realized faces now because they depend on face definitions 2730 free realized faces now because they depend on face definitions
2731 that might have changed. Don't free faces while there might be 2731 that might have changed. Don't free faces while there might be
2732 desired matrices pending which reference these faces. */ 2732 desired matrices pending which reference these faces. */
2733 if (face_change_count && !inhibit_free_realized_faces) 2733 if (face_change && !inhibit_free_realized_faces)
2734 { 2734 {
2735 face_change_count = 0; 2735 face_change = false;
2736 free_all_realized_faces (Qnil); 2736 free_all_realized_faces (Qnil);
2737 } 2737 }
2738 2738
@@ -9316,6 +9316,7 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
9316 && it->current_x == it->last_visible_x - 1 9316 && it->current_x == it->last_visible_x - 1
9317 && it->c != '\n' 9317 && it->c != '\n'
9318 && it->c != '\t' 9318 && it->c != '\t'
9319 && it->w->window_end_valid
9319 && it->vpos < it->w->window_end_vpos) 9320 && it->vpos < it->w->window_end_vpos)
9320 { 9321 {
9321 it->continuation_lines_width += it->current_x; 9322 it->continuation_lines_width += it->current_x;
@@ -13425,10 +13426,10 @@ redisplay_internal (void)
13425 last_glyphless_glyph_frame = NULL; 13426 last_glyphless_glyph_frame = NULL;
13426 last_glyphless_glyph_face_id = (1 << FACE_ID_BITS); 13427 last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
13427 13428
13428 /* If face_change_count is non-zero, init_iterator will free all 13429 /* If face_change, init_iterator will free all realized faces, which
13429 realized faces, which includes the faces referenced from current 13430 includes the faces referenced from current matrices. So, we
13430 matrices. So, we can't reuse current matrices in this case. */ 13431 can't reuse current matrices in this case. */
13431 if (face_change_count) 13432 if (face_change)
13432 windows_or_buffers_changed = 47; 13433 windows_or_buffers_changed = 47;
13433 13434
13434 if ((FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf)) 13435 if ((FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))
@@ -15436,7 +15437,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
15436 /* Likewise there was a check whether window_end_vpos is nil or larger 15437 /* Likewise there was a check whether window_end_vpos is nil or larger
15437 than the window. Now window_end_vpos is int and so never nil, but 15438 than the window. Now window_end_vpos is int and so never nil, but
15438 let's leave eassert to check whether it fits in the window. */ 15439 let's leave eassert to check whether it fits in the window. */
15439 eassert (w->window_end_vpos < w->current_matrix->nrows); 15440 eassert (!w->window_end_valid
15441 || w->window_end_vpos < w->current_matrix->nrows);
15440 15442
15441 /* Handle case where text has not changed, only point, and it has 15443 /* Handle case where text has not changed, only point, and it has
15442 not moved off the frame. */ 15444 not moved off the frame. */
@@ -18183,6 +18185,21 @@ try_window_id (struct window *w)
18183 if (f->fonts_changed) 18185 if (f->fonts_changed)
18184 return -1; 18186 return -1;
18185 18187
18188 /* The redisplay iterations in display_line above could have
18189 triggered font-lock, which could have done something that
18190 invalidates IT->w window's end-point information, on which we
18191 rely below. E.g., one package, which will remain unnamed, used
18192 to install a font-lock-fontify-region-function that called
18193 bury-buffer, whose side effect is to switch the buffer displayed
18194 by IT->w, and that predictably resets IT->w's window_end_valid
18195 flag, which we already tested at the entry to this function.
18196 Amply punish such packages/modes by giving up on this
18197 optimization in those cases. */
18198 if (!w->window_end_valid)
18199 {
18200 clear_glyph_matrix (w->desired_matrix);
18201 return -1;
18202 }
18186 18203
18187 /* Compute differences in buffer positions, y-positions etc. for 18204 /* Compute differences in buffer positions, y-positions etc. for
18188 lines reused at the bottom of the window. Compute what we can 18205 lines reused at the bottom of the window. Compute what we can
@@ -25728,6 +25745,15 @@ produce_image_glyph (struct it *it)
25728 enum glyph_row_area area = it->area; 25745 enum glyph_row_area area = it->area;
25729 25746
25730 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; 25747 glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
25748 if (it->glyph_row->reversed_p)
25749 {
25750 struct glyph *g;
25751
25752 /* Make room for the new glyph. */
25753 for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
25754 g[1] = *g;
25755 glyph = it->glyph_row->glyphs[it->area];
25756 }
25731 if (glyph < it->glyph_row->glyphs[area + 1]) 25757 if (glyph < it->glyph_row->glyphs[area + 1])
25732 { 25758 {
25733 glyph->charpos = CHARPOS (it->position); 25759 glyph->charpos = CHARPOS (it->position);
diff --git a/src/xfaces.c b/src/xfaces.c
index 7c9f62683fd..6e01ab08cef 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -313,10 +313,10 @@ static int clear_font_table_count;
313 313
314#endif /* HAVE_WINDOW_SYSTEM */ 314#endif /* HAVE_WINDOW_SYSTEM */
315 315
316/* Non-zero means face attributes have been changed since the last 316/* True means face attributes have been changed since the last
317 redisplay. Used in redisplay_internal. */ 317 redisplay. Used in redisplay_internal. */
318 318
319int face_change_count; 319bool face_change;
320 320
321/* True means don't display bold text if a face's foreground 321/* True means don't display bold text if a face's foreground
322 and background colors are the inverse of the default colors of the 322 and background colors are the inverse of the default colors of the
@@ -694,7 +694,7 @@ Optional THOROUGHLY non-nil means try to free unused fonts, too. */)
694 (Lisp_Object thoroughly) 694 (Lisp_Object thoroughly)
695{ 695{
696 clear_face_cache (!NILP (thoroughly)); 696 clear_face_cache (!NILP (thoroughly));
697 ++face_change_count; 697 face_change = true;
698 windows_or_buffers_changed = 53; 698 windows_or_buffers_changed = 53;
699 return Qnil; 699 return Qnil;
700} 700}
@@ -2530,11 +2530,11 @@ Value is a vector of face attributes. */)
2530 /* Changing a named face means that all realized faces depending on 2530 /* Changing a named face means that all realized faces depending on
2531 that face are invalid. Since we cannot tell which realized faces 2531 that face are invalid. Since we cannot tell which realized faces
2532 depend on the face, make sure they are all removed. This is done 2532 depend on the face, make sure they are all removed. This is done
2533 by incrementing face_change_count. The next call to 2533 by setting face_change. The next call to init_iterator will then
2534 init_iterator will then free realized faces. */ 2534 free realized faces. */
2535 if (NILP (Fget (face, Qface_no_inherit))) 2535 if (NILP (Fget (face, Qface_no_inherit)))
2536 { 2536 {
2537 ++face_change_count; 2537 face_change = true;
2538 windows_or_buffers_changed = 54; 2538 windows_or_buffers_changed = 54;
2539 } 2539 }
2540 2540
@@ -2609,11 +2609,11 @@ The value is TO. */)
2609 /* Changing a named face means that all realized faces depending on 2609 /* Changing a named face means that all realized faces depending on
2610 that face are invalid. Since we cannot tell which realized faces 2610 that face are invalid. Since we cannot tell which realized faces
2611 depend on the face, make sure they are all removed. This is done 2611 depend on the face, make sure they are all removed. This is done
2612 by incrementing face_change_count. The next call to 2612 by setting face_change. The next call to init_iterator will then
2613 init_iterator will then free realized faces. */ 2613 free realized faces. */
2614 if (NILP (Fget (to, Qface_no_inherit))) 2614 if (NILP (Fget (to, Qface_no_inherit)))
2615 { 2615 {
2616 ++face_change_count; 2616 face_change = true;
2617 windows_or_buffers_changed = 55; 2617 windows_or_buffers_changed = 55;
2618 } 2618 }
2619 2619
@@ -3107,13 +3107,13 @@ FRAME 0 means change the face on all frames, and change the default
3107 /* Changing a named face means that all realized faces depending on 3107 /* Changing a named face means that all realized faces depending on
3108 that face are invalid. Since we cannot tell which realized faces 3108 that face are invalid. Since we cannot tell which realized faces
3109 depend on the face, make sure they are all removed. This is done 3109 depend on the face, make sure they are all removed. This is done
3110 by incrementing face_change_count. The next call to 3110 by setting face_change. The next call to init_iterator will then
3111 init_iterator will then free realized faces. */ 3111 free realized faces. */
3112 if (!EQ (frame, Qt) 3112 if (!EQ (frame, Qt)
3113 && NILP (Fget (face, Qface_no_inherit)) 3113 && NILP (Fget (face, Qface_no_inherit))
3114 && NILP (Fequal (old_value, value))) 3114 && NILP (Fequal (old_value, value)))
3115 { 3115 {
3116 ++face_change_count; 3116 face_change = true;
3117 windows_or_buffers_changed = 56; 3117 windows_or_buffers_changed = 56;
3118 } 3118 }
3119 3119
@@ -3281,12 +3281,12 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param,
3281 /* Changing a named face means that all realized faces depending on 3281 /* Changing a named face means that all realized faces depending on
3282 that face are invalid. Since we cannot tell which realized faces 3282 that face are invalid. Since we cannot tell which realized faces
3283 depend on the face, make sure they are all removed. This is done 3283 depend on the face, make sure they are all removed. This is done
3284 by incrementing face_change_count. The next call to 3284 by setting face_change. The next call to init_iterator will then
3285 init_iterator will then free realized faces. */ 3285 free realized faces. */
3286 if (!NILP (face) 3286 if (!NILP (face)
3287 && NILP (Fget (face, Qface_no_inherit))) 3287 && NILP (Fget (face, Qface_no_inherit)))
3288 { 3288 {
3289 ++face_change_count; 3289 face_change = true;
3290 windows_or_buffers_changed = 57; 3290 windows_or_buffers_changed = 57;
3291 } 3291 }
3292} 3292}
@@ -5820,7 +5820,7 @@ is non-nil. */)
5820 (Lisp_Object suppress) 5820 (Lisp_Object suppress)
5821{ 5821{
5822 tty_suppress_bold_inverse_default_colors_p = !NILP (suppress); 5822 tty_suppress_bold_inverse_default_colors_p = !NILP (suppress);
5823 ++face_change_count; 5823 face_change = true;
5824 return suppress; 5824 return suppress;
5825} 5825}
5826 5826
diff --git a/src/xfns.c b/src/xfns.c
index 9dd00868d7b..65eb6b497f2 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3542,10 +3542,15 @@ If omitted or nil, that stands for the selected frame's display. */)
3542} 3542}
3543 3543
3544DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, 3544DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
3545 doc: /* Return the "vendor ID" string of the X server of display TERMINAL. 3545 doc: /* Return the "vendor ID" string of the GUI software on TERMINAL.
3546
3546\(Labeling every distributor as a "vendor" embodies the false assumption 3547\(Labeling every distributor as a "vendor" embodies the false assumption
3547that operating systems cannot be developed and distributed noncommercially.) 3548that operating systems cannot be developed and distributed noncommercially.)
3548The optional argument TERMINAL specifies which display to ask about. 3549The optional argument TERMINAL specifies which display to ask about.
3550
3551For GNU and Unix systems, this queries the X server software; for
3552MS-Windows, this queries the OS.
3553
3549TERMINAL should be a terminal object, a frame or a display name (a string). 3554TERMINAL should be a terminal object, a frame or a display name (a string).
3550If omitted or nil, that stands for the selected frame's display. */) 3555If omitted or nil, that stands for the selected frame's display. */)
3551 (Lisp_Object terminal) 3556 (Lisp_Object terminal)
@@ -3558,10 +3563,16 @@ If omitted or nil, that stands for the selected frame's display. */)
3558} 3563}
3559 3564
3560DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, 3565DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
3561 doc: /* Return the version numbers of the X server of display TERMINAL. 3566 doc: /* Return the version numbers of the GUI software on TERMINAL.
3562The value is a list of three integers: the major and minor 3567The value is a list of three integers specifying the version of the GUI
3563version numbers of the X Protocol in use, and the distributor-specific release 3568software in use.
3564number. See also the function `x-server-vendor'. 3569
3570For GNU and Unix system, the first 2 numbers are the version of the X
3571Protocol used on TERMINAL and the 3rd number is the distributor-specific
3572release number. For MS-Windows, the 3 numbers report the version and
3573the build number of the OS.
3574
3575See also the function `x-server-vendor'.
3565 3576
3566The optional argument TERMINAL specifies which display to ask about. 3577The optional argument TERMINAL specifies which display to ask about.
3567TERMINAL should be a terminal object, a frame or a display name (a string). 3578TERMINAL should be a terminal object, a frame or a display name (a string).
@@ -4921,7 +4932,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4921 int width, height; 4932 int width, height;
4922 ptrdiff_t count = SPECPDL_INDEX (); 4933 ptrdiff_t count = SPECPDL_INDEX ();
4923 struct gcpro gcpro1, gcpro2, gcpro3; 4934 struct gcpro gcpro1, gcpro2, gcpro3;
4924 int face_change_count_before = face_change_count; 4935 bool face_change_before = face_change;
4925 Lisp_Object buffer; 4936 Lisp_Object buffer;
4926 struct buffer *old_buffer; 4937 struct buffer *old_buffer;
4927 4938
@@ -5218,11 +5229,11 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
5218 f->can_x_set_window_size = true; 5229 f->can_x_set_window_size = true;
5219 5230
5220 /* Setting attributes of faces of the tooltip frame from resources 5231 /* Setting attributes of faces of the tooltip frame from resources
5221 and similar will increment face_change_count, which leads to the 5232 and similar will set face_change, which leads to the clearing of
5222 clearing of all current matrices. Since this isn't necessary 5233 all current matrices. Since this isn't necessary here, avoid it
5223 here, avoid it by resetting face_change_count to the value it 5234 by resetting face_change to the value it had before we created
5224 had before we created the tip frame. */ 5235 the tip frame. */
5225 face_change_count = face_change_count_before; 5236 face_change = face_change_before;
5226 5237
5227 /* Discard the unwind_protect. */ 5238 /* Discard the unwind_protect. */
5228 return unbind_to (count, frame); 5239 return unbind_to (count, frame);