Fix return values of set-file-acl and set-file-selinux-context when ENOTSUP.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
e7ae8039
EZ
12012-12-29 Eli Zaretskii <eliz@gnu.org>
2
ccad023b
EZ
3 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
4 file's SELinux context or ACLs successfully set, nil otherwise.
5 (Bug#13298)
6
e7ae8039
EZ
7 * w32proc.c (reader_thread): Avoid passing NULL handles to
8 SetEvent and WaitForSingleObject.
9
7456e13f
PE
102012-12-28 Paul Eggert <eggert@cs.ucla.edu>
11
12 Port EXTERNALLY_VISIBLE to Clang 3.2.
13 * conf_post.h (__has_attribute): New macro.
14 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
15
1ab0c851
GM
162012-12-27 Glenn Morris <rgm@gnu.org>
17
18 * cygw32.c (Fcygwin_convert_file_name_to_windows)
19 (Fcygwin_convert_file_name_from_windows): Doc fixes.
20
82e2a1f0 212012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80
EZ
22
23 * fileio.c (file_name_as_directory, directory_file_name): Accept
24 an additional argument MULTIBYTE to indicate whether the input C
25 came from a multibyte or a unibyte Lisp string; all callers
26 adjusted. Don't assume the input string is always multibyte.
27 (Bug#13262)
28 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
29 don't ENCODE_FILE them, and return a unibyte string if the input
30 was unibyte.
31 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
32 don't assume the input strings will always be multibyte. If the
33 input strings are multibyte, decode strings obtained from C
34 library functions.
35
8847a0de
DA
362012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
37
38 * lisp.h (toplevel): Add two notices to the comment about
39 defining a new Lisp data type.
6cda572a
DA
40 * print.c (print_object): If Lisp_Save_Value object's pointer
41 is the address of a memory area containing Lisp_Objects, try
42 to print them.
43 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 44
4b298d5a
DA
452012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
46
47 * keyboard.c (record_asynch_buffer_change): Initialize an event
48 only if it's really needed.
49 * frame.h (enum output_method): Remove output_mac member since
50 it's a leftover from the deleted code.
51 * frame.c (Fframep): Adjust user here ...
52 * terminal.c (Fterminal_live_p): ... and here.
53 * coding.c (Qmac): Now here because it's only used to denote
54 end-of-line encoding type.
55 (syms_of_coding): DEFSYM it.
56 * frame.h (Qmac): Remove duplicated declaration.
57
12384b01
PE
582012-12-26 Paul Eggert <eggert@cs.ucla.edu>
59
60 * window.c (select_window_1): Now static, since it's used only here.
61
f1665bdc
EZ
622012-12-25 Eli Zaretskii <eliz@gnu.org>
63
64 * window.c (window_body_cols): Subtract display margins from the
65 window body width on TTYs as well. See
66 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
67 for the original report.
68
9a0d4f34
DA
692012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
70
71 * xdisp.c (redisplay_window): Remove inner local variable
72 because the outer shadowed one has the same meaning.
cd78d9b1
DA
73 * xterm.h (struct x_output): Remove toolbar_detached member since it's
74 set but never used.
75 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
76 (xg_create_tool_bar): Adjust users.
9a0d4f34 77
f9e7c67e
DA
782012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
79
80 * buffer.h (BUF_COMPACT): New macro to follow the common style.
81 * buffer.c (Fget_buffer_create): Use it to set compact field of
82 struct buffer_text to avoid accessing an uninitialized value
83 when compact_buffer is called for the first time.
84 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
85 (Fset_buffer_modified_p): Use buffer_window_count to check
86 whether the buffer is displayed in some window.
87 * xdisp.c (message_dolog): Likewise.
f9e7c67e 88
299614f3
EZ
892012-12-23 Eli Zaretskii <eliz@gnu.org>
90
40ff07a5
EZ
91 * w32.c (acl_set_file): If setting the file security descriptor
92 fails, and the new DACL is identical to the existing one, silently
93 return success. This fixes problems for users backing up their
94 own files without having the necessary privileges for setting
95 security descriptors.
96
299614f3
EZ
97 * w32proc.c (reader_thread): Do not index fd_info[] with negative
98 values.
99 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
100 after WaitForSingleObject returns normally. This expedites reader
101 thread shutdown when delete_child triggers it.
102 (reap_subprocess): More accurate commentary for why we call
103 delete_child only when cp->fd is negative.
104
105 * w32.c (sys_close): Do not call delete_child on a subprocess
106 whose handle is not yet closed. Instead, set its file descriptor
107 to a negative value, so that reap_subprocess will call
108 delete_child on that subprocess when its SIGCHLD arrives. This
109 avoids closing handles used for communications between sys_select
110 and reader_thread, which doesn't give sys_select a chance to
111 notice that the process exited and invoke the SIGCHLD handler for
112 it.
113
cf162aee
JD
1142012-12-23 Jan Djärv <jan.h.d@swipnet.se>
115
116 * nsfns.m (Fns_do_applescript): Run event loop until script has
117 been executed (Bug#12969).
118 (ns_run_ascript): Chech as_script for nil, set to nil after
119 executing script.
120
94900bfe
MR
1212012-12-22 Martin Rudalics <rudalics@gmx.at>
122
123 * window.c (Fselect_window): Reword doc-string (Bug#13248).
124
b2faf49c
EZ
1252012-12-22 Eli Zaretskii <eliz@gnu.org>
126
127 * w32term.c (w32fullscreen_hook): New function.
128 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
129
7efa3fb3
EZ
1302012-12-21 Eli Zaretskii <eliz@gnu.org>
131
bb085aed
EZ
132 * fileio.c (Finsert_file_contents): Doc fix.
133
7efa3fb3
EZ
134 * w32proc.c (new_child, delete_child, find_child_pid): For a
135 subprocess, consider its slot being in use as long as its process
136 handle (procinfo.hProcess) is not NULL. This avoids reusing the
137 slot when a new process is started immediately after killing
138 another one, without waiting enough time for the first process to
139 be reaped and resources allocated for it be orderly freed.
140 (Bug#13086)
141 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
142
c1f02afa
CY
1432012-12-21 Chong Yidong <cyd@gnu.org>
144
145 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
146
5bec25eb
CY
147 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
148
a4b0cca1 1492012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
150
151 * w32.c (get_name_and_id): Always pass NULL as the first argument
152 of lookup_account_sid. Avoids crashes with UNC file names that
153 refer to DFS domains, not to specific machine names. (Bug#12621)
154 Remove now unused argument FNAME; all callers changed.
155 (get_file_owner_and_group): Remove now unused argument FNAME; all
156 callers changed.
157
34b4b7eb
CY
1582012-12-21 Chong Yidong <cyd@gnu.org>
159
160 * editfns.c (Finsert_char): Since read-char-by-name now signals an
161 error for invalid chars, don't check for a nil return value.
162
13002885
DA
1632012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
164
165 Avoid calls to CHAR_TO_BYTE if byte position is known.
166 * editfns.c (make_buffer_string_both): Use move_gap_both.
167 (Fbuffer_string): Use make_buffer_string_both.
168 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
169 Adjust comment.
170 (buf_bytepos_to_charpos): Likewise.
171 (charpos_to_bytepos): Remove.
172 * fileio.c (Finsert_file_contents): Use move_gap_both.
173 * search.c (Freplace_match): Likewise.
9a0d4f34 174 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
175 names for byte positions.
176 * lisp.h (charpos_to_bytepos): Remove prototype.
177 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
178 * insdel.c (move_gap): Likewise.
179
99e9311c
PE
1802012-12-20 Paul Eggert <eggert@cs.ucla.edu>
181
182 * xdisp.c (redisplay_internal): Remove now-unused local.
183
e02230bf
SM
1842012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
185
186 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
187 (redisplay_internal): Don't bother selecting the frame to get the
188 proper value of frame-local variables.
189
1687fb14
DA
1902012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
191
192 * textprop.c (set_text_properties_1): Do not allow NULL interval.
193 Rename 4th argument since it may be buffer or string. Adjust comment.
194 * intervals.c (graft_intervals_info_buffer): Find an interval here.
195
a2f07cd2
DA
1962012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
197
198 * coding.c (Fdetect_coding_region): Do not check start and end with
199 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
200 (code_convert_region): Likewise.
201
474d441e
EZ
2022012-12-18 Eli Zaretskii <eliz@gnu.org>
203
204 * w32.c (acl_get_file, acl_set_file): Run the file name through
205 map_w32_filename, and resolve any symlinks in the file name, like
206 Posix platforms do.
207 (acl_set_file): Call revert_to_self, if any privileges were
208 enabled.
209
8725c076
JB
2102012-12-17 Juanma Barranquero <lekktu@gmail.com>
211
212 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
213 ($(BLD)/w32.$(O)): Update dependencies.
214
1e101a4b
SM
2152012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
216
217 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
218 propagate redisplay's scrolling (if any) to the right window.
219 (redisplay_internal): Use ensure_selected_frame.
220 (display_mode_lines): Complete last fix.
221 * window.c (select_window_1): New func, extracted from select_window.
222 (select_window): Use it.
223 * window.h (select_window_1): Declare.
224
66447e07
EZ
2252012-12-17 Eli Zaretskii <eliz@gnu.org>
226
227 Emulate Posix ACL APIs on MS-Windows.
228 * w32.c: Include sddl.h and sys/acl.h.
229 (SDDL_REVISION_1): Define if not already defined.
230 (g_b_init_get_security_descriptor_dacl)
231 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
232 (g_b_init_is_valid_security_descriptor)
233 (g_b_init_set_file_security): New static flags.
234 (globals_of_w32): Initialize them to zero.
235 (SetFileSecurity_Name): New string constant.
236 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
237 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
238 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
239 (IsValidSecurityDescriptor_Proc): New typedefs.
240 (get_file_security, get_security_descriptor_owner)
241 (get_security_descriptor_group): Set errno to ENOTSUP.
242 (set_file_security, get_security_descriptor_dacl)
243 (is_valid_security_descriptor, convert_sd_to_sddl)
244 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
245 (acl_free, acl_get_file, acl_set_file): New functions.
246
247 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
248
207a7ef0
PE
2492012-12-17 Paul Eggert <eggert@cs.ucla.edu>
250
251 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
252 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
253 for some of that bug's symptoms can now cause Emacs to abort.
254 Remove the workaround.
255 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
256 The bug that caused SIGCHLD to get lost has been fixed, and the
257 workaround for it can now cause Emacs to abort.
258
17fdfc15
PE
2592012-12-16 Paul Eggert <eggert@cs.ucla.edu>
260
261 * sysdep.c (emacs_abort): Bump backtrace size to 40.
262 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
263 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
264
7c3d167f
RF
2652012-12-16 Romain Francoise <romain@orebokech.com>
266
267 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
268 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 269 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
270 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
271
272 * Makefile.in (LIBACL_LIBS): New macro.
273 (LIBES): Use it.
274
7d80ea23
PE
2752012-12-15 Paul Eggert <eggert@cs.ucla.edu>
276
277 * fileio.c (internal_delete_file): Use bool for boolean.
278
b0728617
EZ
2792012-12-15 Eli Zaretskii <eliz@gnu.org>
280
281 Fix bug #13079 on MS-Windows with temp files not being deleted.
282 * w32.h (_child_process): New members input_file and
283 pending_deletion.
284 (register_child): First argument is now pid_t.
285 (record_infile, record_pending_deletion): New prototypes.
286
287 * w32proc.c (new_child): Initialize input_file and
288 pending_deletion members of the child.
289 (delete_child): Delete the child's temporary input file, if any,
290 that is pending deletion.
291 (register_child): First argument is now pid_t.
292 (record_infile, record_pending_deletion): New functions.
293 (reap_subprocess): Fix a typo in DebPrint string.
294 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
295
296 * fileio.c (internal_delete_file): Return an int again: non-zero
297 if delete-file succeeds, zero otherwise.
298
299 * lisp.h (internal_delete_file): Adjust prototype.
300
301 * callproc.c (Fcall_process): Don't overwrite infile with result
302 of DECODE_FILE.
303 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
304 asynchronous subprocess, record the name of the input file name,
305 if any.
306 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
307 delete the file, record it as pending deletion when the subprocess
308 exits.
309
7e90af26
EZ
3102012-12-14 Eli Zaretskii <eliz@gnu.org>
311
312 * editfns.c [HAVE_PWD_H]: Include grp.h.
313
314 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
315
97976f9f
PE
3162012-12-14 Paul Eggert <eggert@cs.ucla.edu>
317
318 Fix permissions bugs with setgid directories etc. (Bug#13125)
319 * dired.c (Ffile_attributes): Return t as the 9th attribute,
320 to mark it as a placeholder. The old value was often wrong.
321 The only user of this attribute has been changed to use
322 file-ownership-preserved-p instead, with its new group arg.
323 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
324
26ec1f49
SM
3252012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
326
ad966fe7
SM
327 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
328 Keep selected_window and selected_frame in sync.
26ec1f49 329
5c207910
EZ
3302012-12-14 Eli Zaretskii <eliz@gnu.org>
331
332 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
333 try to get accurate owner and group information from NT file
334 security APIs. This is to make most callers of 'stat' and
335 'lstat', which don't need that information, much faster.
336
26ec1f49
SM
337 * dired.c (Ffile_attributes) [WINDOWSNT]:
338 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
339 owner and group information from 'lstat'.
340
893f52d8
PE
3412012-12-13 Paul Eggert <eggert@cs.ucla.edu>
342
4c95c9a5
PE
343 * fileio.c (Finsert_file_contents): Don't put tail into head area,
344 as that confuses set-auto-coding, so insist on the head-read
345 returning the full 1024 bytes. Let lseek compute the tail offset;
346 less work for us. Do not ignore I/O errors when reading the tail.
347
893f52d8
PE
348 * xdisp.c: Minor style fixes.
349 (init_iterator): Hoist assignment out of if-expression.
350 (markpos_of_region): Callers now test for sign, not for -1.
351
40d1e434
DA
3522012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
353
354 Minor redisplay optimization when the region length is zero.
355 * xdisp.c (markpos_of_region): New function.
356 (init_iterator): Do not highlight the region of zero length.
357 (redisplay_window): Check whether the region is of non-zero length.
358 (try_cursor_movement): Allow if the region length is zero.
359 (try_window_reusing_current_matrix, try_window_id): Likewise.
360
727f9739 3612012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
362
363 * search.c (search_buffer): Check the inverse translations of each
364 character in pattern when the buffer being searched is unibyte.
365 (Bug#13084)
366
727f9739 3672012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
368
369 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
370 files, fixing a regression from 24.2.
645c6a30 371 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 372
d20704ef
PE
3732012-12-13 Paul Eggert <eggert@cs.ucla.edu>
374
375 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
376 fstat shouldn't fail, and if it does fail copy-file should not proceed.
377 Remove unnecessary S_ISLNK test, as (contra the comments) this
378 function can't copy symlinks. Improve quality of error message
379 when attempting to copy files that are neither regular files nor
380 directories.
381
2dd61a9b
DA
3822012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
383
384 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
385 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
386 * window.c (Frecenter):
387 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
388 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
389
cc98b684
DC
3902012-12-12 Daniel Colascione <dancol@dancol.org>
391
1e101a4b 392 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
393 the dumped Emacs is not a sparse file, greatly improving Cygwin
394 "make bootstrap" performance.
395
38e791fd
MA
3962012-12-11 Michael Albinus <michael.albinus@gmx.de>
397
398 * inotify.c (inotify_callback): Generate an Emacs event for every
399 incoming inotify event.
400
f9d1448f
EZ
4012012-12-11 Eli Zaretskii <eliz@gnu.org>
402
403 * xdisp.c (handle_face_prop): Fix logic of computing
404 it->start_of_box_run_p.
405 (append_space_for_newline): If the glyph row is R2L, reset the
406 iterator's end_of_box_run_p flag before prepending the space glyph.
407 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
408 iterator's start_of_box_run_p flag before prepending the stretch.
409 (append_glyph, produce_image_glyph, append_composite_glyph)
410 (append_stretch_glyph, append_glyphless_glyph): Reverse the
411 left_box_line_p and right_box_line_p flags of the glyph for R2L
412 glyph rows. (Bug#13011)
413
c6afe371
DA
4142012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
415
416 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
417 if changed buffer is not shown in a window.
418 * insdel.c (prepare_to_modify_buffer): Likewise.
419 * window.c (replace_buffer_in_windows_safely): Do nothing
420 if buffer is not shown in a window.
421 (Fforce_window_update): Likewise if string or buffer argument
422 is passed.
423
1b47babd
EZ
4242012-12-11 Eli Zaretskii <eliz@gnu.org>
425
426 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
427 encoded_file_name, which is what it is.
428
4c1acb95
DA
4292012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
430
431 Consistently use marker_position and marker_byte_position.
432 * fringe.c (Ffringe_bitmaps_at_pos):
433 * indent.c (Fvertical_motion):
434 * insdel.c (prepare_to_modify_buffer):
435 * keyboard.c (make_lispy_position):
436 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
437 (window_scroll_pixel_based, displayed_window_lines)
438 (Fset_window_configuration):
439 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
440 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
441 Replace direct access to marker fields with calls
442 to marker_position and/or marker_byte_position.
443
0eeb69fe
JB
4442012-12-11 Juanma Barranquero <lekktu@gmail.com>
445
446 * makefile.w32-in (SIG2STR_H): New macro.
447 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
448 ($(BLD)/w32notify.$(O)): Update dependencies.
449
1cf1bbd5
DC
4502012-12-10 Daniel Colascione <dancol@dancol.org>
451
8db4b52f
DC
452 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
453 Windows file notification functionality unless WINDOWSNT.
454
1cf1bbd5
DC
455 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
456 declarations.
457
458 * w32fns.c (cache_system_info): Initialize the global hinst
459 variable here so various initialization calls DTRT.
460
1e101a4b 461 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
462 (hinst): Remove unneeded extern declaration.
463 (_start): Remove initialization of above variables; remove
464 initialization of hinst, as cache_system_info now does that.
465
466 * emacs.c (main): Call cache_system_info early in startup; we
467 previously weren't calling it in Cygwin builds.
468
26ec1f49
SM
469 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
470 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
471 and link it to Emacs.
472
98a07056
DA
4732012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
474
475 Per-buffer window counters.
476 * buffer.h (struct buffer): New member window_count.
477 (buffer_window_count): New function.
478 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
479 Initialize window_count.
480 (Fkill_buffer): Verify window_count for the buffer being killed.
481 (modify_overlay): Do not force redisplay if buffer is not shown
482 in any window.
483 (init_buffer_once): Initialize window_count for buffer_defaults
484 and buffer_local_symbols.
485 * window.h (buffer_shared): Remove declaration.
486 (wset_buffer): Convert from inline ...
487 * window.c (wset_buffer): ... to an ordinary function.
488 (adjust_window_count): New function.
489 (make_parent_window): Use it.
490 * xdisp.c (buffer_shared): Remove.
491 (redisplay_internal, redisplay_window): Adjust users.
492 (buffer_shared_and_changed): Use per-buffer window counter.
493
2b8c9064
EZ
4942012-12-10 Eli Zaretskii <eliz@gnu.org>
495
496 Support for filesystem notifications on MS-Windows.
497 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
498 and this is a TTY frame, signal the caller that keyboard input is
499 available.
500
501 * w32xfns.c (drain_message_queue): Now returns an int: an
502 indication whether any WM_EMACS_FILENOTIFY messages were found in
503 the queue.
504
505 * w32inevt.c (handle_file_notifications): New function.
506 (w32_console_read_socket): Call it to process file notifications.
507
508 * w32console.c (initialize_w32_display): Record the main thread ID
509 in dwMainThreadId.
510
511 * deps.mk (inotify.o): New dependency list.
512
513 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
514
515 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
516 (WM_EMACS_END): Bump value by 1.
517 (notification_buffer_in_use, file_notifications)
518 (notifications_size, notifications_desc): Declare.
519 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
520 Add prototypes.
521
522 * w32term.c (lispy_file_action, queue_notifications): New functions.
523 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
524 <Qrenamed_to>: New symbols.
525 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
526
527 * w32notify.c: New file, implements file event notifications for
528 MS-Windows.
529
530 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
531 by posting it to the w32_read_socket queue.
532
1e101a4b 533 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
534
535 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
536 (GLOBAL_SOURCES): Add w32notify.c
537 ($(BLD)/w32notify.$(O)): New set of dependencies.
538
539 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
540
1e101a4b
SM
541 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
542 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
543 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
544 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
545 w32notify-handle-event by default.
546
547 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
548 syms_of_w32notify.
549
81606b10
RS
5502012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
551
2b8c9064 552 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 553 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
554
555 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
556
557 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
558 (syms_of_keyboard): DEFSYM it.
559 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
560 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
561 Qfile_inotify events.
562 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
563 special-event-map to inotify-handle-event.
564
565 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
566
567 * Makefile.in (base_obj): Add inotify.o.
568
569 * inotify.c: New file.
570
265c2fbf 5712012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
572
573 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
574
265c2fbf 5752012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
576
577 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
578 DWORD_PTR, for compatibility with 64-bit builds.
579
a06ae17d 580 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
581 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
582 (system_process_attributes): Use SIZE_T rather than DWORD, for
583 compatibility with 64-bit builds.
584
265c2fbf 5852012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
586
587 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
588
265c2fbf 5892012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
590
591 * indent.c (Fvertical_motion): If a display string will be
592 displayed on the left or the right margin, don't consider it as a
593 factor in cursor positioning. (Bug#13108)
594
265c2fbf 5952012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
596
597 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
598
5f460827
PE
5992012-12-10 Paul Eggert <eggert@cs.ucla.edu>
600
601 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
602 for string length.
603
a16e75cd
EZ
6042012-12-08 Eli Zaretskii <eliz@gnu.org>
605
606 * w32.c (unsetenv): Return 0 if the input string is too long.
607
5745a7df
PE
6082012-12-08 Paul Eggert <eggert@cs.ucla.edu>
609
610 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
611 * alloc.c (xputenv): New function.
612 * dbusbind.c (Fdbus_init_bus):
613 * emacs.c (main):
614 * xterm.c (x_term_init):
615 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
616 * editfns.c (initial_tz): Move static var decl up.
617 (tzvalbuf_in_environ): New static var.
618 (init_editfns): Initialize these two static vars.
619 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
620 Save old TZ value on stack, if it's small.
621 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
622 instead, use xputenv+unsetenv to set and restore TZ.
623 (environbuf): Remove static var. All uses removed.
624 (Fset_time_zone_rule): Do not save TZ and environ;
625 no longer needed here.
626 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
627 Move to inside set_time_zone_rule; they don't need file scope any more.
628 (set_time_zone_rule): Maintain the TZ=value string separately.
629 (syms_of_editfns): Don't initialize initial_tz;
630 init_editfns now does it.
631 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
632 * lisp.h (xputenv): New decl.
633
c56efa40
FP
6342012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
635
636 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
637
75ceee05
EZ
6382012-12-08 Eli Zaretskii <eliz@gnu.org>
639
640 * w32.c (unsetenv, sys_putenv): New functions.
641
1b6dbfeb
CY
6422012-12-08 Chong Yidong <cyd@gnu.org>
643
644 * editfns.c (Finsert_char): Make the error message more
645 informative (Bug#12992).
646
d983a10b
PE
6472012-12-08 Paul Eggert <eggert@cs.ucla.edu>
648
7be78020
PE
649 Simplify get_lim_data.
650 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
651 Remove USG and vlimit methods; no longer used these days.
652 Add #error catchall just in case.
653
d983a10b
PE
654 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
655 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
656 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
657 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
658 (deleted_pid_list, Fdelete_process, create_process)
659 (record_child_status_change, handle_child_signal, deliver_child_signal)
660 (init_process_emacs, syms_of_process):
661 Assume SIGCHLD is defined.
662 (parse_signal): Remove. All uses removed.
663 (abbr_to_signal): New static function.
664 (Fsignal_process): Use it to convert signal names to ints.
665 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
666 kill (getpgrp (), ...).
667 (emacs_sigaction_init): Assume SIGCHLD is defined.
668 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
669 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
670 * syssignal.h (EMACS_KILLPG): Remove.
671 All uses replaced by 'kill' with a negative pid.
672 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
673 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
674
9cdde1e2
PE
6752012-12-07 Paul Eggert <eggert@cs.ucla.edu>
676
677 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
678 This will cause a production Emacs to dump core instead of
679 infinite-looping.
680
822995f8
DA
6812012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
682
683 * frame.c (make_frame): Do not set window's buffer to t.
684 * window.c (Fsplit_window_internal): Likewise. Previously it was
685 used to indicate that the window is being set up. Now we use
686 set_window_buffer for all new windows, so the condition in ...
687 (Fset_window_buffer): ... is always true and can be removed.
688
ed08365b
DA
6892012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
690
691 Convenient macro to check whether the buffer is hidden.
692 * buffer.h (BUFFER_HIDDEN_P): New macro.
693 * frame.c (make_frame): Use it. Adjust comment.
694 * buffer.c (candidate_buffer): New function.
695 (Fother_buffer, other_buffer_safely): Use it.
696
e86f5134
EZ
6972012-12-06 Eli Zaretskii <eliz@gnu.org>
698
699 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
700 if the child process is still running. Instead, exit the wait
701 loop and return zero. (Bug#13086)
702
1700db3c
DA
7032012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
704
705 * frame.h (x_char_width, x_char_height): Remove prototypes.
706 * w32term.h (x_char_width, x_char_height): Likewise.
707 * xfns.c (x_char_width, x_char_height): Remove.
708 * w32fns.c (x_char_width, x_char_height): Likewise.
709 * nsfns.c (x_char_width, x_char_height): Likewise.
710 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
711 all window frames.
712 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
713 * keyboard.c (command_loop_1): Remove prototype.
714 (command_loop_2, top_level_1): Add static to match prototype.
715
35fb8050
PE
7162012-12-06 Paul Eggert <eggert@cs.ucla.edu>
717
718 Fix a recently-introduced delete-process race condition.
719 * callproc.c, process.h (record_kill_process):
720 New function, containing part of the old call_process_kill.
721 (call_process_kill): Use it.
722 This does not change call_process_kill's behavior.
723 * process.c (Fdelete_process): Use record_kill_process to fix a
724 race condition that could cause Emacs to lose track of a child.
725
565212e5
DA
7262012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
727
728 Avoid code duplication between prev_frame and next_frame.
729 * frame.c (candidate_frame): New function. Add comment.
730 (prev_frame, next_frame): Use it. Adjust comment.
731
d8ad4d3f 7322012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
733
734 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
735 fails, signal an error instead of continuing with an empty
736 string. (Bug#13079)
7c2fcf9b
EZ
737 Encode expanded temp file pattern before passing it to mkstemp or
738 mktemp.
d3cefd13 739
2e7cddd3
EZ
740 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
741 Encode the file name before passing it to dostounix_filename, in
742 case it will downcase it (under w32-downcase-file-names).
743 (Bug#12933)
744
644d3f0d
PE
7452012-12-05 Paul Eggert <eggert@cs.ucla.edu>
746
747 Minor call-process cleanups.
748 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
749 at the same time as other platforms, to simplify analysis.
750 No need for fd0_volatile since we have synch_process_fd.
751 Avoid needless emacs_close; arg is always negative.
752
396376f1
AS
7532012-12-04 Andreas Schwab <schwab@linux-m68k.org>
754
755 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
756 processes.
757
350f51ad
DA
7582012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
759
760 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
761 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
762 and mouse_face_hidden members to a bitfields.
763 * frame.h (struct frame): Remove set-but-not-used space_width member.
764 (FRAME_SPACE_WIDTH): Remove.
765 * nsterm.m, w32term.c, xterm.c: Adjust users.
766 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
767 member. Adjust users. Convert term_initted, delete_in_insert_mode,
768 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
769 members to a bitfields.
770
bc9dbce6
PE
7712012-12-03 Paul Eggert <eggert@cs.ucla.edu>
772
bb5f74ee
PE
773 Don't let call-process be a zombie factory (Bug#12980).
774 Fixing this bug required some cleanup of the signal-handling code.
775 As a side effect, this change also fixes a longstanding rare race
776 condition whereby Emacs could mistakenly kill unrelated processes,
777 and it fixes a bug where a second C-g does not kill a recalcitrant
778 synchronous process in GNU/Linux and similar platforms.
779 The patch should also fix the last vestiges of Bug#9488,
780 a bug which has mostly been fixed on the trunk by other changes.
781 * callproc.c, process.h (synch_process_alive, synch_process_death)
782 (synch_process_termsig, sync_process_retcode):
783 Remove. All uses removed, to simplify analysis and so that
784 less consing is done inside critical sections.
785 * callproc.c (call_process_exited): Remove. All uses replaced
786 with !synch_process_pid.
787 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
788 These take the role of what used to be in unwind-protect arg.
789 All uses changed.
790 (block_child_signal, unblock_child_signal):
791 New functions, to avoid races that could kill innocent-victim processes.
792 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
793 (call_process_kill): Record killed processes as deleted, so that
794 zombies do not clutter up the system. Do this inside a critical
795 section, to avoid a race that would allow the clutter.
796 (call_process_cleanup): Fix code so that the second C-g works again
797 on common platforms such as GNU/Linux.
798 (Fcall_process): Create the child process in a critical section,
799 to fix a race condition. If creating an asynchronous process,
800 record it as deleted so that zombies do not clutter up the system.
801 Do unwind-protect for WINDOWSNT too, as that's simpler in the
802 light of these changes. Omit unnecessary call to emacs_close
803 before failure, as the unwind-protect code does that.
804 * callproc.c (call_process_cleanup):
805 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
806 * process.c (record_deleted_pid): New function, containing
807 code refactored out of Fdelete_process.
808 (Fdelete_process): Use it.
809 (process_status_retrieved): Remove. All callers changed to use
810 child_status_change.
811 (record_child_status_change): Remove, folding its contents into ...
812 (handle_child_signal): ... this signal handler. Now, this
813 function is purely a handler for SIGCHLD, and is not called after
814 a synchronous waitpid returns; the synchronous code is moved to
815 wait_for_termination. There is no need to worry about reaping
816 more than one child now.
817 * sysdep.c (get_child_status, child_status_changed): New functions.
818 (wait_for_termination): Now takes int * status and bool
819 interruptible arguments, too. Do not record child status change;
820 that's now the caller's responsibility. All callers changed.
821 Reimplement in terms of get_child_status.
822 (wait_for_termination_1, interruptible_wait_for_termination):
823 Remove. All callers changed to use wait_for_termination.
824 * syswait.h: Include <stdbool.h>, for bool.
825 (record_child_status_change, interruptible_wait_for_termination):
826 Remove decls.
827 (record_deleted_pid, child_status_changed): New decls.
828 (wait_for_termination): Adjust to API changes noted above.
829
bc9dbce6
PE
830 * bytecode.c, lisp.h (Qbytecode): Remove.
831 No longer needed after 2012-11-20 interactive-p changes.
832
3cf3c607
EZ
8332012-12-03 Eli Zaretskii <eliz@gnu.org>
834
835 * xdisp.c (redisplay_window): If the cursor is visible, but inside
836 the scroll margin, move point outside the margin. (Bug#13055)
837
005c8d13
JD
8382012-12-03 Jan Djärv <jan.h.d@swipnet.se>
839
840 * gtkutil.c (my_log_handler): New function.
841 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
842
20edc1c9
DA
8432012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
844
845 * lisp.h (modify_region): Rename to...
846 (modify_region_1): ...new prototype.
847 * textprop.c (modify_region): Now static. Adjust users.
848 * insdel.c (modify_region): Rename to...
849 (modify_region_1): ...new function to work with current buffer.
850 Adjust comment and users. Use true and false for booleans.
851
62c2e5ed
DA
8522012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
853
854 * alloc.c (free_save_value): New function.
855 (safe_alloca_unwind): Use it.
856 * lisp.h (free_save_value): New prototype.
857 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
858 Add comment.
859 (save_excursion_restore): Adjust to match saved data structure.
860 Use free_save_value to offload some work from GC. Drop obsolete
861 #if 0 code.
862
c5bc2d1d 8632012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
864
865 * fileio.c (Vauto_save_list_file_name): Doc fix.
866
c5bc2d1d 8672012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
868
869 * w32fns.c: Remove prototype of atof.
1e101a4b 870 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 871 builds.
1e101a4b 872 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
873
874 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
875 with 64-bit builds.
876
877 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
878 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
879 defined.
880
c5bc2d1d 8812012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 882
a9de9f0c 883 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 884
21e54a94
PE
8852012-12-02 Paul Eggert <eggert@cs.ucla.edu>
886
2dd2e622
PE
887 Fix xpalloc confusion after memory is exhausted.
888 * alloc.c (xpalloc): Comment fix.
889 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
890 and signals an error, do not clear charset_table_size, as
891 charset_table is still valid.
892 * doprnt.c (evxprintf): Clear *BUF after freeing it.
893
21e54a94
PE
894 Use execve to avoid need to munge environ (Bug#13054).
895 * callproc.c (Fcall_process):
896 * process.c (create_process):
897 Don't save and restore environ; no longer needed.
898 * callproc.c (child_setup):
899 Use execve, not execvp, to preserve environ.
900
3e5490f7
PE
9012012-12-01 Paul Eggert <eggert@cs.ucla.edu>
902
903 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
904
75b4f59c
YM
9052012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
906
907 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
908 display for sliced images (Bug#10500).
909
910 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
911
f8aff4c6
JB
9122012-11-30 Juanma Barranquero <lekktu@gmail.com>
913
914 * doc.c (Fdocumentation): Re-add handling of function-documentation,
915 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
916
3940b924
DA
9172012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
918
919 * xdisp.c (window_outdated): Remove eassert since it hits
920 some suspicious corner cases (see Bug#13007 and Bug#13012).
921 (mode_line_update_needed): New function.
922 (redisplay_internal, redisplay_window): Use it.
923 (ensure_selected_frame): New function.
924 (redisplay_internal, unwind_redisplay): Use it.
925 (redisplay_internal): Move comment about buffer_shared...
926 (buffer_shared_and_changed): ...near to its real use.
927
4a9204fe
PE
9282012-11-29 Paul Eggert <eggert@cs.ucla.edu>
929
930 * callproc.c (Fcall_process): Don't misreport vfork failure.
931
60aeceb8
PE
9322012-11-28 Paul Eggert <eggert@cs.ucla.edu>
933
934 * callproc.c (Fcall_process): Fix vfork portability problems.
935 Do not assume that fd[0], count, filefd, and save_environ survive
936 vfork. Fix bug whereby wrong errno value could be reported for
937 pipe failure. Some minor cleanups, too, as follows. Move buf and
938 bufsize to the context where they're needed. Change new_argv to
939 be of type char **, as this is more convenient and avoids casts.
940 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
941 Now local constants, not macros.
942
00dc3ead
KH
9432012-11-18 Kenichi Handa <handa@gnu.org>
944
945 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
946 for the variable "f".
947
e1bf05c1
KH
9482012-11-13 Kenichi Handa <handa@gnu.org>
949
950 * font.c (font_unparse_xlfd): Exclude special characters from the
951 generating XLFD name.
952
22626a85
PE
9532012-11-27 Paul Eggert <eggert@cs.ucla.edu>
954
350e0088
PE
955 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
956 * dired.c (stat_uname, stat_gname):
957 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
958
22626a85
PE
959 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
960 * dired.c (directory_files_internal, file_name_completion):
961 Assume EAGAIN and EINTR are defined.
350e0088 962
22626a85
PE
963 * fileio.c (Fcopy_file): Assume EISDIR is defined.
964 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
965 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
966 * lread.c (readbyte_from_file): Assume EINTR is defined.
967 * process.c (wait_reading_process_output, send_process) [subprocesses]:
968 Assume EIO and EAGAIN are defined.
969 * unexcoff.c (write_segment): Assume EFAULT is defined.
970
5c9cf0a3 9712012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
972
973 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
974 (Bug#11964)
975
22294a56
EZ
976 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
977 highlighting on the frame was cleared. Prevents assertion
978 violations when repeatedly clicking on the "Top" link of the
979 "bread-crumbs" in Info buffers.
980
5fbab051
PE
9812012-11-25 Paul Eggert <eggert@cs.ucla.edu>
982
983 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
984
bcd77a2b
KB
9852012-11-24 Ken Brown <kbrown@cornell.edu>
986
987 * keyboard.c (HAVE_MOUSE):
988 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
989 were always defined.
990
d125ca15 9912012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 992
24becea4
EZ
993 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
994 between bpos_covered and bpos_max. This fixes cursor display when
995 several display strings follow each other.
996
8654a41b
EZ
997 * .gdbinit (pgx): If the glyph's object is a string, display the
998 pointer to string data, rather than the value of the string object
999 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
1000
cb5867b1
EZ
1001 * indent.c (Fvertical_motion): If the starting position is covered
1002 by a display string, return to one position before that, to avoid
1003 overshooting it inside move_it_to. (Bug#12930)
1004
f418b22e
DA
10052012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
1006
1007 * frame.h (struct frame): Remove display_preempted member
1008 since all users are dead long ago.
1009 * nsterm.h (struct x_output): Use the only dummy member.
1010 * w32menu.c (pending_menu_activation): Remove since not
1011 really used.
1012 (set_frame_menubar): Adjust user.
1013 * w32term.h (struct x_output): Drop outdated #if 0 code.
1014 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
1015 asked_for_visible and menubar_active members.
1016 Drop unused pending_menu_activation member.
f418b22e
DA
1017 * xterm.h (struct x_output): Drop outdated #if 0 code.
1018 Use bitfields for explicit_parent, asked_for_visible,
1019 has_been_visible and net_wm_state_hidden_seen members.
1020
a879f0ea
EZ
10212012-11-23 Eli Zaretskii <eliz@gnu.org>
1022
1023 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
1024 of a literal "/". (Bug#12955)
1025 (gl-stamp): Invoke fc.exe directly, not through cmd.
1026
95ef7787
PE
10272012-11-23 Paul Eggert <eggert@cs.ucla.edu>
1028
1029 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
1030 * dired.c: Assume HAVE_DIRENT_H.
1031 (NAMLEN): Remove, replacing with ...
1032 (dirent_namelen): New function. All uses changed. Use the GNU macro
1033 _D_EXACT_NAMELEN if available, as it's faster than strlen.
1034 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
1035 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
1036 * makefile.w32-in (DIR_H): Remove. All uses replaced with
1037 $(NT_INC)/dirent.h.
1038 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
1039 * ndir.h: Rename to ../nt/inc/dirent.h.
1040 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
1041 Do not include <dirent.h>; no longer needed.
1042 * w32.c: Include <dirent.h> rather than "ndir.h".
1043
12645ae6
CY
10442012-11-23 Chong Yidong <cyd@gnu.org>
1045
1046 * xftfont.c (xftfont_open): Remove duplicate assignment.
1047
5c747675
DA
10482012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1049
1050 * alloc.c (Fgarbage_collect): Unblock input after clearing
1051 gc_in_progress to avoid note_mouse_highlight glitch with GC.
1052 * frame.h (FRAME_MOUSE_UPDATE): New macro.
1053 * msdos.c (IT_frame_up_to_date): Use it here...
1054 * w32term.c (w32_frame_up_to_date): ...here...
1055 * xterm.c (XTframe_up_to_date): ...and here...
1056 * nsterm.m (ns_frame_up_to_date): ...but not here.
1057 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
1058 Adjust users.
1059 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
1060 Do not check whether GC is in progress.
1061
6ceeb5f1
DA
10622012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1063
1064 * xdisp.c (window_buffer_changed): New function.
1065 (update_menu_bar, update_tool_bar): Use it to
1066 simplify large 'if' statements.
1067 (redisplay_internal): Generalize commonly used
1068 'tail' and 'frame' local variables.
1069
ec84768f
EZ
10702012-11-22 Eli Zaretskii <eliz@gnu.org>
1071
1072 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
1073 with Windows system header.
1074
9239d970
PE
10752012-11-21 Paul Eggert <eggert@cs.ucla.edu>
1076
1077 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
1078 * alloc.c: Assume unistd.h exists.
1079 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
1080 * sysdep.c (get_current_dir_name): Assume getcwd exists.
1081 (getwd) [USG]: Remove; no longer needed.
1082 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
1083 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
1084 * w32.h (getcwd): Remove decl.
1085
954bba56
SM
10862012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
1087
1088 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
1089 Make it set selected_window as well.
1090 (update_tool_bar): Use it.
1091
6ef2e5ef 10922012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
1093
1094 * emacs.c (main): Set the G_SLICE environment variable for all
1095 Cygwin builds, not just GTK builds. See
1096 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
1097
6ef2e5ef 10982012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
1099
1100 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1101 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
1102 Define for the MSVC compiler.
1103
6ef2e5ef 1104 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
1105
1106 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
1107 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
1108 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
1109 dostounix_filename assumes it gets a unibyte string.
1110 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
1111 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
1112
eadf1faa
SM
11132012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1114
1115 Conflate Qnil and Qunbound for `symbol-function'.
1116 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
1117 * lread.c (init_obarray): Set `function' fields to Qnil.
1118 * eval.c (Fcommandp): Ignore Qunbound.
1119 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
1120 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
1121 Test NILP rather than Qunbound.
1122 (Ffmakunbound): Set to Qnil.
1123 (Fsymbol_function): Never signal an error.
1124 (Finteractive_form): Ignore Qunbound.
1125
b83fdfa9
PE
11262012-11-20 Paul Eggert <eggert@cs.ucla.edu>
1127
1128 * eval.c (interactive_p): Remove no-longer-used decl.
1129
952580c5
DA
11302012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
1131
1132 * xdisp.c (buffer_shared): Adjust comment.
1133 (buffer_shared_and_changed): New function.
1134 (prepare_menu_bars, redisplay_internal): Use it to
1135 decide whether all windows or frames should be updated.
ea6de9b1
DA
1136 (window_outdated): New function.
1137 (text_outside_line_unchanged_p, redisplay_window): Use it.
1138 (redisplay_internal): Likewise. Fix indentation.
952580c5 1139
23ba2705
SM
11402012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1141
1142 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
1143 (syms_of_eval): Remove corresponding defsubr.
1144 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
1145
6e9f7997
DC
11462012-11-19 Daniel Colascione <dancol@dancol.org>
1147
1148 * w32fns.c (Fx_file_dialog):
1149 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
1150 cygwin_convert_file_name*.
1151
1152 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
1153 Rename cygwin_convert_path* to cygwin_convert_file_name*.
1154
552a1590
PE
11552012-11-18 Paul Eggert <eggert@cs.ucla.edu>
1156
1157 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
1158
2ac9538d 11592012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
1160
1161 * w32select.c: Include w32common.h before w32term.h, so that
1162 windows.h gets included before w32term.h uses some of its
1163 features, see below.
1164
23ba2705
SM
1165 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
1166 New typedefs.
1167 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
1168 New prototypes.
d8715cdf
EZ
1169 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
1170
2ac9538d 11712012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
1172
1173 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
1174 (ns_select): Return at once if events are held (Bug#12834).
1175
2ac9538d 11762012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 1177
1178 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
1179 Needed following 2012-10-20 change. (Bug#12902)
1180
c1f7ba3a
JB
11812012-11-18 Juanma Barranquero <lekktu@gmail.com>
1182
1183 * w32proc.c (waitpid): Remove unused label get_result.
1184
a75ce9d3
JB
11852012-11-17 Juanma Barranquero <lekktu@gmail.com>
1186
1187 * makefile.w32-in (SYSWAIT_H): New macro.
1188 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
1189 ($(BLD)/sysdep.$(O)): Update dependencies.
1190
49cdacda
PE
11912012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1192
1193 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
1194 * callproc.c (relocate_fd): Assume F_DUPFD.
1195 * emacs.c, term.c (O_RDWR): Remove.
1196 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
1197 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
1198 * nsterm.m: Assume <fcntl.h> exists.
1199 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
1200 (create_pty, Fmake_network_process, server_accept_connection)
1201 (wait_reading_process_output, init_process_emacs):
1202 Assume O_NONBLOCK.
1203 (wait_reading_process_output): Put in a special case for WINDOWSNT
1204 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
1205 It's not clear this is needed, but it's a more-conservative change.
1206 (create_process): Assume FD_CLOEXEC.
1207 (create_process, create_pty): Assume O_NOCTTY.
1208 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
1209 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
1210 Omit if not DOS_NT, since F_GETFL is not defined there.
1211 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
1212 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
1213 (O_NOCTTY): Remove.
1214 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
1215 lack it, since gnulib guarantees this.
1216 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
1217
22bae83f
EZ
12182012-11-17 Eli Zaretskii <eliz@gnu.org>
1219
6ad30855
EZ
1220 * w32.c (faccessat): Pretend that directories have the execute bit
1221 set. Emacs expects that, e.g., in files.el:cd-absolute.
1222
22bae83f
EZ
1223 * w32proc.c (create_child): Don't clip the PID of the child
1224 process to fit into an Emacs integer, as this is no longer a
1225 restriction.
1226 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
1227 reaping only the process specified by PID argument, if that is
1228 positive. Use PID instead of dead_child to know which process to
1229 reap. Wait for the child to die only if WNOHANG is not in
1230 OPTIONS.
1231 (sys_select): Don't set dead_child.
1232
1233 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
1234 as it is no longer needed.
1235
1236 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
1237 no longer needed.
1238 (record_child_status_change): Remove the setting of
1239 record_at_most_one_child for the !WNOHANG case.
1240
a631d0e0
PE
12412012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1242
1243 Fix problems in ns port found by static checking.
1244 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
1245 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
1246 not to process group.
1247 (ns_select): Use emacs_write, not write, as that's more robust
1248 in the presence of signals.
1249 (fd_handler:): Check for read errors.
1250
d56f2e49
GM
12512012-11-16 Glenn Morris <rgm@gnu.org>
1252
1253 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
1254
96e05507 12552012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
1256
1257 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
1258
96e05507 12592012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
1260
1261 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
1262 use the same value of thread handle.
1263 (start_timer_thread): If the timer thread exited (due to error),
1264 clean up by closing the two handles it used. Duplicate the caller
1265 thread's handle here, so it gets duplicated only once, when
1266 launching the timer thread. Set priority of the timer thread, not
1267 the caller thread.
1268 (getitimer): Don't duplicate the caller thread's handle here.
1269 (Bug#12832)
1270
96e05507 12712012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
1272
1273 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
1274 called (Bug#12834).
1275
3d082a26
PE
12762012-11-16 Paul Eggert <eggert@cs.ucla.edu>
1277
1278 Remove no-longer-used pty_max_bytes variable.
1279 * process.c (pty_max_bytes): Remove; unused.
1280 (send_process): Do not set it.
1281
b72c161c
JB
12822012-11-15 Juanma Barranquero <lekktu@gmail.com>
1283
1284 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
1285 Update dependencies.
1286
bf20ea80
PE
12872012-11-15 Paul Eggert <eggert@cs.ucla.edu>
1288
1289 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
1290 This follows up on the 2012-09-29 patch that removed indirection
1291 for the 'function' field. Reported by Sergey Vinokurov in
1292 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
1293
14f20728
EZ
12942012-11-14 Eli Zaretskii <eliz@gnu.org>
1295
1296 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
1297 different name, as the MS runtime does not have such a function,
1298 and probably never will.) All callers changed. Ignore DIRFD
1299 value if PATH is an absolute file name, to match Posix spec
1300 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
1301 symlinks.
1302
77731919
DA
13032012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
1304
1305 * xdisp.c (echo_area_display, redisplay_internal):
1306 Omit redundant check whether frame_garbaged is set.
1307
73dcdb9f
PE
13082012-11-14 Paul Eggert <eggert@cs.ucla.edu>
1309
1310 Use faccessat, not access, when checking file permissions (Bug#12632).
1311 This fixes a bug that has been present in Emacs since its creation.
1312 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
1313 which must set some sort of record. (Torek's bug report was against
1314 a predecessor of GNU Emacs, but GNU Emacs happened to have the
1315 same common flaw.) See Torek's Usenet posting
1316 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
1317 Posted: Fri Apr 8 14:18:56 1983.
1318 * Makefile.in (LIB_EACCESS): New macro.
1319 (LIBES): Use it.
1320 * callproc.c (init_callproc):
1321 * charset.c (init_charset):
1322 * fileio.c (check_existing, check_executable, check_writable)
1323 (Ffile_readable_p):
1324 * lread.c (openp, load_path_check):
1325 * process.c (allocate_pty):
1326 * xrdb.c (file_p):
1327 Use effective UID when checking permissions, not real UID.
1328 * callproc.c (init_callproc):
1329 * charset.c (init_charset):
1330 * lread.c (load_path_check, init_lread):
1331 Test whether directories are accessible, not merely whether they exist.
1332 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
1333 * fileio.c (check_existing, check_executable, check_writable)
1334 (Ffile_readable_p):
1335 Use symbolic names instead of integers for the flags, as they're
1336 portable now.
1337 (check_writable): New arg AMODE. All uses changed.
1338 Set errno on failure.
1339 (Ffile_readable_p): Use faccessat, not stat + open + close.
1340 (Ffile_writable_p): No need to call check_existing + check_writable.
1341 Just call check_writable and then look at errno. This saves a syscall.
1342 dir should never be nil; replace an unnecessary runtime check
1343 with an eassert. When checking the parent directory of a nonexistent
1344 file, check that the directory is searchable as well as writable, as
1345 we can't create files in unsearchable directories.
1346 (file_directory_p): New function, which uses 'stat' on most platforms
1347 but faccessat with D_OK (for efficiency) if WINDOWSNT.
1348 (Ffile_directory_p, Fset_file_times): Use it.
1349 (file_accessible_directory_p): New function, which uses a single
1350 syscall for efficiency.
1351 (Ffile_accessible_directory_p): Use it.
1352 * xrdb.c (file_p): Use file_directory_p.
1353 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
1354 * lread.c (openp): When opening a file, use fstat rather than
1355 stat, as that avoids a permissions race. When not opening a file,
1356 use file_directory_p rather than stat.
1357 (dir_warning): First arg is now a usage string, not a format.
1358 Use errno. All uses changed.
1359 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1360 that merely introduced a race.
1361 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1362 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1363 and similarly for the other O_* flags.
1364 * w32.c (sys_faccessat): Rename from sys_access and switch to
1365 faccessat's API. All uses changed.
1366 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1367 (magic_db): Rename from magic_file_p.
1368 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1369 char *, so that we don't have to test for file existence
1370 separately from opening the file for reading. This removes a race
1371 fixes a permission-checking problem, and simplifies the code.
1372 All uses changed.
1373 (file_p): Remove; no longer needed.
1374
2a14f83b
DA
13752012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1376
1377 Omit glyphs initialization at startup.
1378 * dispnew.c (glyphs_initialized_initially_p): Remove.
1379 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1380 (Fredraw_frame): Move actual code from here...
c7085245 1381 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
1382 (Fredraw_display): Use redraw_frame.
1383 * xdisp.c (clear_garbaged_frames): Likewise.
1384
f78ee6af 13852012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
1386
1387 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1388 passed to pint2str and pint2hrstr to be at most the size of the
1389 frame's decode_mode_spec_buffer. This avoids crashes with very
1390 large values of FIELD_WIDTH argument to decode_mode_spec.
1391 (Bug#12867)
1392
b95a9c0c
PE
13932012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1394
1395 Fix a race with verify-visited-file-modtime (Bug#12863).
1396 Since at least 1991 Emacs has ignored an mtime difference of no
1397 more than one second, but my guess is that this was to work around
1398 file system bugs that were fixed long ago. Since the race is
1399 causing problems now, let's remove that code.
1400 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1401 whose time stamp is off by no more than a second. Insist that the
1402 file time stamps match exactly.
1403
be49ba74
DA
14042012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1405
1406 * frame.h (struct frame): Convert external_tool_bar member to
1407 1-bit unsigned bitfield.
1408 * termhooks.h (struct terminal): Remove mouse_moved member since
1409 all users are long dead. Adjust comment on mouse_position_hook.
1410
5b04e9f9
DA
14112012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1412
1413 Simplify by using FOR_EACH_FRAME here and there.
1414 * frame.c (next_frame, prev_frame, other_visible_frames)
1415 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1416 * w32term.c (x_window_to_scroll_bar): Likewise.
1417 * window.c (window_list): Likewise.
1418 * xdisp.c (x_consider_frame_title): Likewise.
1419 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1420 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1421 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1422 * xmenu.c (menubar_id_to_frame): Likewise.
1423 * xselect.c (frame_for_x_selection): Likewise.
1424 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1425 (x_window_to_menu_bar): Likewise.
1426 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1427
76ae24d7
PE
14282012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1429
12cc4337
PE
1430 * data.c (Qdefalias_fset_function): Now static.
1431
76ae24d7
PE
1432 Another tweak to vectorlike_header change.
1433 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1434 Remove, and replace all uses with ...
1435 (next_in_free_list, set_next_in_free_list):
1436 New functions, which respect C's aliasing rules better.
1437
1479c557
PE
14382012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1439
1440 * window.c (list4i): Rename from 'quad'. All uses changed.
1441 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1442
11235c03
JB
14432012-11-11 Juanma Barranquero <lekktu@gmail.com>
1444
1445 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1446 warning about mixing declarations and code in ISO C90.
1447
6baf66d5 14482012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
1449
1450 * window.c (Fsplit_window_internal): Set combination limit of
1451 new parent window to t iff Vwindow_combination_limit is t;
1452 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 1453 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 1454
6baf66d5 14552012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
1456
1457 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1458 amount when the scroll margins are too large. When scrolling
1459 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
1460 scroll margin within a reasonable number of screen lines.
1461 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
1462 point is positioned many lines beyond the window top/bottom.
1463 (Bug#12811)
1464
508f51f5
EZ
1465 * ralloc.c (relinquish): If real_morecore fails to return memory
1466 to the system, don't crash; instead, leave the last heap
1467 unchanged and return. (Bug#12774)
1468
32e5c58c
SM
14692012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1470
1471 * lisp.h (AUTOLOADP): New macro.
1472 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1473 * data.c (Ffset): Remove special ad-advice-info handling.
1474 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1475 (Fsubr_arity): CSE.
1476 (Finteractive_form): Simplify.
1477 (Fquo): Don't insist on having at least 2 arguments.
1478 (Qdefalias_fset_function): New var.
1479
719b0aa5
JD
14802012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1481
4ab15c3e
JD
1482 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1483
719b0aa5
JD
1484 * nsfont.m (Qcondensed, Qexpanded): New variables.
1485 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1486 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1487
535cc8e9
DA
14882012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1489
1490 Fix recently introduced crash on MS-Windows (Bug#12839).
1491 * w32term.h (struct scroll_bar): Use convenient header.
1492 (SCROLL_BAR_VEC_SIZE): Remove.
1493 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1494
7d377c48
DA
14952012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1496
1497 Tweak last vectorlike_header change.
1498 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1499 vectorlike object on the free list. This is introduced to avoid
1500 some (but not all) pointer casting and aliasing problems, see
1501 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1502 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1503 objects.
1504 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1505
7ad27466
JD
15062012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1507
32e5c58c 1508 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
1509 been removed, so remove them here also.
1510
57618ecf
SM
15112012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1512
1513 * doc.c (Fdocumentation): Handle new property
1514 dynamic-docstring-function to replace the old ad-advice-info.
1515
53371430
PE
15162012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1517
1518 * fns.c (Qeql, hashtest_eq): Now static.
1519
61ddb1b9
SM
15202012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1521
1522 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1523 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1524 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1525 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1526
04a2d0d3
PE
15272012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 Use same hash function for hashfn_profiler as for hash_string etc.
1530 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1531 * lisp.h (sxhash_combine): New inline function, with the contents
1532 of the old SXHASH_COMBINE.
1533 * profiler.c (hashfn_profiler): Use it, instead of having a
1534 special hash function containing a comparison that always yields 1.
1535
de5ef41a
SM
15362012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1537
1538 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1539 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1540 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1541 Remove unused vars.
1542
a23c4171
JD
15432012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1544
1545 * image.c (xpm_make_color_table_h): Fix compiler error because
1546 make_hash_table changed.
1547
074d7bb0
JD
15482012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1549
1550 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1551
b7432bb2
SM
15522012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1553
1554 Use ad-hoc comparison function for the profiler's hash-tables.
1555 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1556 (make_log): Use them.
1557 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1558 call Fequal any more.
1559 (Ffunction_equal): New function.
1560 (cmpfn_profiler, hashfn_profiler): New functions.
1561 (syms_of_profiler): Initialize them.
1562 * lisp.h (struct hash_table_test): New struct.
1563 (struct Lisp_Hash_Table): Use it.
1564 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1565 * fns.c (make_hash_table): Take a struct to describe the test.
1566 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1567 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1568 (hash_lookup, hash_remove_from_table): Move assertion checking of
1569 hashfn result here. Check hash-equality before calling cmpfn.
1570 (Fmake_hash_table): Adjust call to make_hash_table.
1571 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1572 (syms_of_fns): Initialize them.
1573 * emacs.c (main): Move syms_of_fns earlier.
1574 * xterm.c (syms_of_xterm):
1575 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1576 * print.c (print_object): Adjust to new hash-table struct.
1577 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1578
88002743
EZ
15792012-11-08 Eli Zaretskii <eliz@gnu.org>
1580
1581 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1582 value of w32-scroll-lock-modifier is neither nil nor one of the
1583 known key modifiers. (Bug#12806)
1584
914adc42
DA
15852012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1586
1587 Shrink struct vectorlike_header to the only size field.
1588 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1589 Adjust comment.
1590 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1591 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1592 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1593 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1594 information from the vector header. Adjust comment.
1595 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1596 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1597 layout.
1598 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1599 (struct vectorlike_header): Remove next member. Adjust comment.
1600 (struct Lisp_Subr): Add convenient header. Adjust comment.
1601 (allocate_pseudovector): Adjust prototype.
1602 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1603 (sweep_string, lisp_malloc): Remove useless prototypes.
1604 (enum mem_type): Adjust comment.
1605 (NEXT_IN_FREE_LIST): New macro.
1606 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1607 (Fmake_bool_vector): Likewise.
1608 (struct large_vector): New type to represent allocation unit for
1609 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1610 (large_vectors): Change type to struct large_vector.
1611 (allocate_vector_from_block): Simplify.
1612 (PSEUDOVECTOR_NBYTES): Replace with...
1613 (vector_nbytes): ...new function. Adjust users.
1614 (sweep_vectors): Adjust processing of large vectors.
1615 (allocate_vectorlike): Likewise.
1616 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1617 Add easserts. Adjust XSETPVECTYPESIZE usage.
1618 (allocate_buffer): Use BUFFER_PVEC_INIT.
1619 (live_vector_p): Adjust to match large vector.
1620 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1621 * buffer.h (struct buffer): Add next member.
1622 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1623 New macros.
1624 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1625 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1626 (copy_hash_table): Adjust to match vector header change.
1627 * lread.c (defsubr): Use XSETPVECTYPE.
1628 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1629 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1630 (xvecsize): New command.
1631
c66f21ea
DA
16322012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1633
1634 * keyboard.c (event_to_kboard): Do not dereference
1635 frame_or_window field of SELECTION_REQUEST_EVENT
1636 and SELECTION_CLEAR_EVENT events (Bug#12814).
1637 * xterm.h (struct selection_input_event): Adjust comment.
1638
eb147960
EZ
16392012-11-07 Eli Zaretskii <eliz@gnu.org>
1640
dab72075
EZ
1641 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1642 such as Scroll Lock, if the respective keys are treated as
1643 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 1644 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 1645
5890e400
DA
16462012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1647
1648 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1649
b6b3b294
PE
16502012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1651
1652 Restore some duplicate definitions (Bug#12814).
1653 This undoes part of the 2012-11-03 changes. Some people build
1654 with plain -g rather than with -g3, and they need the duplicate
1655 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1656 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1657 Define as macros, as well as as enums or as constants.
1658
e770aad5
JD
16592012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1660
1661 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1662 to keypad keys (Bug#12816).
1663
68f8f1c0
PE
16642012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1665
1666 Minor adjustments of recently-changed frame functions.
1667 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1668 known to be a frame (we're in the FRAMEP branch).
1669 * lisp.h (Qframep): Remove decl. frame.h declares this.
1670 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1671 since they're meant for Lisp fixnum values.
1672
72f94d4b
DA
16732012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1674
1675 * window.c (Fwindow_combination_limit): Revert to the only
1676 required argument and adjust docstring as suggested in
1677 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1678 by Martin Rudalics <rudalics@gmx.at>.
1679
d9f07150
DA
16802012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1681
1682 Widely used frame validity and checking functions.
1683 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1684 * frame.c (decode_live_frame, decode_any_frame): New functions.
1685 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1686 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1687 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1688 (Fframe_pointer_visible_p): Use decode_any_frame.
1689 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1690 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1691 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1692 (Fframe_focus): Likewise. Allow zero number of arguments.
1693 Adjust docstring.
1694 (frame_buffer_list, frame_buffer_predicate): Remove.
1695 * lisp.h (frame_buffer_predicate): Remove prototype.
1696 * buffer.c (Fother_buffer): Use decode_any_frame.
1697 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1698 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1699 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1700 (Fclose_font, Ffont_info): Use decode_live_frame.
1701 * fontset.c (check_fontset_name): Likewise.
1702 * terminal.c (Fframe_terminal): Likewise.
1703 * w32fns.c (check_x_frame): Likewise.
1704 * window.c (Fminibuffer_window, Fwindow_at)
1705 (Fcurrent_window_configuration): Likewise.
1706 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1707 Likewise. Allow zero number of arguments. Adjust docstring.
1708 * dispnew.c (Fredraw_frame): Likewise.
1709 * xfaces.c (frame_or_selected_frame): Remove.
1710 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1711 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1712 (Fframe_face_alist): Use decode_live_frame.
1713 * xfns.c (check_x_frame): Likewise.
1714
89bc0592
DA
17152012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1716
1717 * window.c (quad): New function.
1718 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1719 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1720 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1721 (Fwindow_line_height): Use it.
1722 (Fwindow_fringes): Use list3.
1723 (Fwindow_scroll_bars): Use list4.
1724 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1725 (Fwindow_combination_limit): Allow zero number of arguments.
1726
c8e3a9c3
EZ
17272012-11-05 Eli Zaretskii <eliz@gnu.org>
1728
1729 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1730
8e2417bf 1731 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 1732 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 1733 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 1734
209c6a58
CY
17352012-11-05 Chong Yidong <cyd@gnu.org>
1736
1737 * process.c (wait_reading_process_output): Revert previous change.
1738
8148369c
PE
17392012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1740
dd0333b6
PE
1741 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1742 This removes code that has been obsolete since around 1990.
1743 * callproc.c (Fcall_process):
1744 * emacs.c (main):
1745 * process.c (create_process):
1746 * term.c (dissociate_if_controlling_tty):
1747 Assume setsid exists.
1748 * callproc.c (child_setup): Assume setpgid exists and behaves as
1749 per POSIX.1-1988 or later.
1750 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1751 * emacs.c (shut_down_emacs):
1752 * sysdep.c (sys_suspend, init_foreground_group):
1753 Assume getpgrp behaves as per POSIX.1-1998 or later.
1754 * msdos.c (setpgrp): Remove.
1755 (tcgetpgrp, setpgid, setsid): New functions.
1756 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1757 * term.c (no_controlling_tty): Remove; unused.
1758 * w32proc.c (setpgrp): Remove.
1759 (setsid, tcgetpgrp): New functions.
1760
8148369c
PE
1761 Simplify by assuming __fpending.
1762 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1763 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1764 Do not assume that __fpending's result fits in int.
1765
76abf5e5
PE
17662012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1767
06b63c9b
PE
1768 Remove EMACS_OUTQSIZE+sleep hack.
1769 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
1770 than 2400 bps, which throttled Emacs by having it sleep.
1771 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
1772 was added, and anyway those old terminals are long dead.
1773 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1774 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1775
76abf5e5
PE
1776 Fix data-loss with --version (Bug#9574).
1777 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1778 as we can't assume that emacs_strerror is initialized, and strerror
1779 is good enough here.
1780 (main): Invoke atexit earlier, to catch earlier instances of
1781 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1782
8f31e74b
MM
17832012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1784
1785 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1786 (keyDown): Remap keypad keys to X11 virtual key codes.
1787
0d879dca
PE
17882012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1789
7ccfb720
PE
1790 Fix data-loss with --batch (Bug#9574).
1791 * emacs.c: Include <close-stream.h>.
1792 (close_output_streams): New function.
1793 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1794 and handles errors appropriately.
1795 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1796 does that now.
1797
0b3d4a47
PE
1798 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1799 The symptom is a diagnostic "GLib-WARNING **: In call to
1800 g_spawn_sync(), exit status of a child process was requested but
1801 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1802 waitpid(), so exit status can't be returned." The diagnostic
1803 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1804 The real bug is a race condition between Emacs and glib: Emacs
1805 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1806 so that glib can't find it. Work around the bug by invoking
1807 waitpid only on subprocesses that Emacs itself creates.
1808 * process.c (create_process, record_child_status_change):
1809 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
1810 know the pid rather than having the callee infer it.
1811 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
1812 (create_process): Set new 'alive' member if child is created.
1813 (process_status_retrieved): New function.
1814 (record_child_status_change): Use it.
1815 Accept negative 1st argument, which means to wait for the
1816 processes that Emacs already knows about. Move special-case code
1817 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1818 processes that have already been waited for, by testing and
1819 clearing new 'alive' member.
1820 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1821 now does this internally.
1822 (handle_child_signal): Let record_child_status_change do all
1823 the work, since we do not want to reap all exited child processes,
1824 only the child processes that Emacs itself created.
1825 * process.h (Lisp_Process): New boolean member 'alive'.
1826
0d879dca
PE
1827 Omit duplicate definitions no longer needed with gcc -g3.
1828 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1829 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1830 Define only as macros. There's no longer any need to also define
1831 these symbols as enums or as constants, since we now assume
1832 gcc -g3 when debugging.
1833
3478f4b5
EZ
18342012-11-03 Eli Zaretskii <eliz@gnu.org>
1835
1836 * lisp.mk: Adjust comments to the fact that term/internal is now
1837 loaded from loadup.el.
1838
1839 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1840 (msdos_fatal_signal): New function.
1841 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1842 its argument list.
1843
1844 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1845 for GCC versions before 4.
1846 (emacs_raise): Define to call msdos_fatal_signal.
1847
1848 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1849 iterator when starting in the middle of a display or overlay
1850 string. (Bug#12745)
1851
85fabcb7
CY
18522012-11-03 Chong Yidong <cyd@gnu.org>
1853
1854 * process.c (wait_reading_process_output): Clean up the last
1855 change.
1856
893cc455
CY
18572012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1858
1859 * process.c (wait_reading_process_output): Avoid a race condition
1860 with SIGIO delivery (Bug#11536).
1861
0f7b074f
CY
18622012-11-03 Chong Yidong <cyd@gnu.org>
1863
1864 * buffer.c (cursor_type): Untabify docstring.
1865
3737fee7
DA
18662012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1867
1868 * frame.h (struct frame): Drop can_have_scroll_bars member
1869 which is meaningless for a long time. Adjust comments.
1870 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1871 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1872
b6a9e8b1
DA
18732012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1874
1875 * window.c (decode_next_window_args): Update window arg after
1876 calling decode_live_window and so fix crash reported at
1877 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1878 by Juanma Barranquero <lekktu@gmail.com>.
1879 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1880 * font.c (Ffont_at): Likewise.
1881
600d4768
JD
18822012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1883
1884 * widget.c (resize_cb): New function.
1885 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1886 (EmacsFrameResize): Check if all is up to date before changing frame
1887 size.
1888
1005b4b9
EZ
18892012-11-02 Eli Zaretskii <eliz@gnu.org>
1890
1891 Implement backtrace output for fatal errors on MS-Windows.
1892 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1893 (BACKTRACE_LIMIT_MAX): New macro.
1894 (w32_backtrace): New function.
1895 (emacs_abort): Use w32_backtrace when the user chooses not to
1896 attach a debugger. Update the text of the abort dialog.
1897
b9e9df47
DA
18982012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1899
1900 Window-related stuff cleanup here and there.
1901 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1902 Use decode_any_window.
1903 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1904 * xdisp.c (Fformat_mode_line): Likewise.
1905 * font.c (Ffont_at): Use decode_live_window.
1906 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1907 * window.c (decode_next_window_args): Likewise.
1908 (decode_any_window): Remove static.
1909 * window.h (decode_any_window): Add prototype.
1910 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1911 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1912 respectively.
1913
2b371ff7
DA
19142012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1915
1916 Remove pad from struct input_event.
1917 * termhooks.h (struct input_event): Remove padding field.
1918 Adjust comment.
1919 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1920 member is never cons for a long time. Adjust comment.
1921 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1922 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1923 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1924 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1925
7e8b50d9
EZ
19262012-11-01 Eli Zaretskii <eliz@gnu.org>
1927
1928 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1929
322aea6d
PE
19302012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1931
1932 Fix crash when using Emacs as commit editor for git (Bug#12697).
1933 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1934 and it is configured in conf_post.h.
1935 (Fcall_process): Don't invoke both setsid and setpgid; the former
1936 is enough, if it exists.
1937 * callproc.c (Fcall_process, child_setup):
1938 * process.c (create_process): Use setpgid.
1939 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1940 for the real thing.
1941 * dispnew.c (init_display): Initialize the foreground group
1942 if we are running a tty display.
1943 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1944 * lisp.h (init_foreground_group): New decl.
1945 * sysdep.c (inherited_pgroup): New static var.
1946 (init_foreground_group, tcsetpgrp_without_stopping)
1947 (narrow_foreground_group, widen_foreground_group): New functions.
1948 (init_sys_modes): Narrow foreground group.
1949 (reset_sys_modes): Widen foreground group.
1950
220cb2bd
MA
19512012-10-31 Michael Albinus <michael.albinus@gmx.de>
1952
1953 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1954
218e997a
MR
19552012-10-31 Martin Rudalics <rudalics@gmx.at>
1956
1957 * minibuf.c (read_minibuf): Restore current buffer since
1958 choose_minibuf_frame calling Fset_frame_selected_window may
1959 change it (Bug#12766).
1960
02615da0
JD
19612012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1962
1963 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1964
aee5b18e
KH
19652012-10-30 Kenichi Handa <handa@gnu.org>
1966
1967 * font.c (Ffont_at): If WINDOW is specified and it is not
1968 displaying the current buffer, signal an error.
1969
ba116008
DC
19702012-10-29 Daniel Colascione <dancol@dancol.org>
1971
de5ef41a
SM
1972 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1973 In preparation for fixing bug#12739, move these functions from
ba116008
DC
1974 here...
1975
1976 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
1977 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1978 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 1979
640bf8ad
EZ
19802012-10-28 Eli Zaretskii <eliz@gnu.org>
1981
1982 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1983 (timer_loop, getitimer, setitimer): Use it instead of
1984 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1985 'clock'.
1986 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1987 literal 10000.
1988
64ccff5f
JD
19892012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1990
1991 * nsterm.m (NO_APPDEFINED_DATA): New define.
1992 (last_appdefined_event_data): New variable
1993 (last_appdefined_event): Remove.
1994 (ns_select): Initialize t from last_appdefined_event_data instead
1995 of [last_appdefined_event data1].
1996 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1997 remove last_appdefined_event (Bug#12698).
1998
e483264c
SM
19992012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2000
2001 * frame.c (x_set_font): Catch internal error.
2002
6c16c13e
EZ
20032012-10-27 Eli Zaretskii <eliz@gnu.org>
2004
e483264c
SM
2005 Avoid overflow in w32 implementation of interval timers.
2006 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
2007 actually executes.
2008 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
2009 'volatile ULONGLONG' types. All the other data which was
2010 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
2011 (GetThreadTimes_Proc): New typedef.
2012 (w32_get_timer_time): New function, returns a suitable time value
2013 for the timer.
2014 (timer_loop): Enter critical section when accessing ULONGLONG
2015 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
2016 atomic. Call 'w32_get_timer_time' instead of 'clock'.
2017 Remove unused variable.
6c16c13e
EZ
2018 (init_timers): Initialize s_pfn_Get_Thread_Times.
2019 (start_timer_thread): Don't assign itimer->caller_thread here.
2020 (getitimer): Assign itimer->caller_thread here.
2021 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 2022 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 2023
ccc83f50
EZ
20242012-10-26 Eli Zaretskii <eliz@gnu.org>
2025
2026 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
2027 mouse movement events if the menu bar is active. This avoids
2028 producing a busy "hour-glass" cursor by Windows if the mouse
2029 pointer is positioned over a tooltip shown for some menu item.
2030
69deda53
PE
20312012-10-25 Paul Eggert <eggert@cs.ucla.edu>
2032
2033 Don't assume process IDs fit in int.
2034 * emacs.c (shut_down_emacs) [!DOS_NT]:
2035 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
2036 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
2037 Use pid_t, not int, to store process IDs, as 'int'
2038 is not wide enough on a few platforms (e.g., AIX and IRIX).
2039
7e70a152
KH
20402012-10-23 Kenichi Handa <handa@gnu.org>
2041
2042 The following change is to make face-font-rescale-alist work
2043 correctly for non-ASCII fonts.
2044
2045 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
2046 (font_open_for_lface): Handle Vface_font_rescale_alist.
2047
49238e7f
CY
20482012-10-23 Chong Yidong <cyd@gnu.org>
2049
2050 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
2051
5ec86886
JD
20522012-10-21 Jan Djärv <jan.h.d@swipnet.se>
2053
ef446959
JD
2054 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
2055 for screen font.
2056 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
2057
5ec86886
JD
2058 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
2059 event (Bug#12681).
2060
ee7a418d
GM
20612012-10-21 Glenn Morris <rgm@gnu.org>
2062
2063 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
2064
4973679b
PE
20652012-10-20 Paul Eggert <eggert@cs.ucla.edu>
2066
2067 Port to OpenBSD 5.1.
2068 * frame.c (Fmouse_position, Fmouse_pixel_position):
2069 * xdisp.c (produce_stretch_glyph):
2070 Declare local vars only when they're needed.
2071 This is clearer and avoids a warning on OpenBSD about unused vars.
2072 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
2073 This is safer, and avoids OpenBSD warnings about unused vars.
2074 * keyboard.c (record_menu_key): Remove unnecessary decl.
2075 (poll_timer): Define only if POLL_FOR_INPUT is defined.
2076 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
2077 as our definition clashes with OpenBSD's.
2078 * xfaces.c (load_face_colors, check_lface_attrs)
2079 (get_lface_attributes_no_remap, get_lface_attributes)
2080 (lface_fully_specified_p, x_supports_face_attributes_p)
2081 (tty_supports_face_attributes_p, face_fontset, realize_face)
2082 (realize_x_face, realize_tty_face):
2083 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
2084 merely Lisp_Object *. This is more informative and avoids
2085 a warning on OpenBSD about accessing beyond an object's size.
2086
c664f463
CY
20872012-10-20 Chong Yidong <cyd@gnu.org>
2088
2089 * lread.c (Fload): Doc fix (Bug#12592).
2090
6ec83f92 20912012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
2092
2093 * font.c (Ffont_at): Fix previous change.
2094
d2824928
EZ
20952012-10-19 Eli Zaretskii <eliz@gnu.org>
2096
e483264c
SM
2097 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
2098 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
2099 for the reasons.
2100
d2824928
EZ
2101 * alloc.c (NSTATICS): Decrease to 0x800.
2102
f60d391f
SM
21032012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2104
4a0e1924 2105 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
2106 error (bug#12677).
2107
1a9327d5
JD
21082012-10-18 Jan Djärv <jan.h.d@swipnet.se>
2109
2110 * nsterm.m (ns_select): Check writefds before call to
2111 FD_ISSET (Bug#12668).
2112
14145a1e
DC
21132012-10-18 Daniel Colascione <dancol@dancol.org>
2114
2115 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
2116 (staticpro): If we run out of staticpro slots, die with an
2117 informative error instead of just calling emacs_abort.
2118
1f76f6f5
MR
21192012-10-18 Martin Rudalics <rudalics@gmx.at>
2120
2121 Fix two flaws reported by Dmitry Antipov.
2122 * window.c (Ftemp_output_buffer_show): Remove.
2123 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
2124 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
2125
fcf14875
EZ
21262012-10-17 Eli Zaretskii <eliz@gnu.org>
2127
1f76f6f5
MR
2128 * makefile.w32-in ($(BLD)/w32.$(O)):
2129 ($(BLD)/vm-limit.$(O)):
2130 ($(BLD)/term.$(O)):
2131 ($(BLD)/unexw32.$(O)):
2132 ($(BLD)/fileio.$(O)):
a68089e4
EZ
2133 ($(BLD)/dispnew.$(O)): Update dependencies.
2134
2135 * w32term.h (w32_initialize_display_info, initialize_w32_display):
2136 Add prototypes.
2137
2138 * w32proc.c: Include ctype.h.
2139
2140 * w32.h (init_environment, check_windows_init_file)
2141 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
2142 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
2143 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
2144 (sys_link): Add prototypes.
2145
2146 * w32.c: Include w32select.h.
2147 (sys_access, e_malloc, sys_select): Add prototypes.
2148 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
2149
2150 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
2151
2152 * unexw32.c: Include lisp.h and w32.h.
2153
2154 * term.c [WINDOWSNT]: Include w32term.h.
2155
2156 * process.c [WINDOWSNT]: Add prototype of sys_select.
2157
2158 * fileio.c [WINDOWSNT]: Include w32.h.
2159
2160 * dispnew.c [WINDOWSNT]: Include w32.h.
2161
fcf14875
EZ
2162 * cygw32.c (Fcygwin_convert_path_to_windows)
2163 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
2164 Lisp_Object values. (Bug#12661)
2165
2166 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
2167 to Lisp_Object. (Bug#12661)
2168
fe0b1ec4
KH
21692012-10-17 Kenichi Handa <handa@gnu.org>
2170
2171 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
2172 invalidate.
2173
d556ebf9
DA
21742012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2175
2176 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 2177 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 2178
f0863a54
DA
21792012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2180
2181 Do not verify indirection counters of killed buffers (Bug#12579).
2182 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
2183 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
2184
12fbe755
DA
21852012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2186
2187 * alloc.c (Fmake_byte_code): Fix typo in comment.
2188 * print.c (print_interval): Define as static to match prototype.
2189 * indent.c (disptab_matches_widthtab, recompute_width_table):
2190 Convert to eassert.
2191
61655b89
DA
21922012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2193
2194 * editfns.c (get_system_name): Remove.
2195 * lisp.h (get_system_name): Remove prototype.
2196 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
2197 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
2198
9520f2f2
DC
21992012-10-15 Daniel Colascione <dancol@dancol.org>
2200
2201 * dbusbind.c: Add comment explaining reason for previous change.
2202
dca778d5
MR
22032012-10-15 Martin Rudalics <rudalics@gmx.at>
2204
2205 * window.c (Fwindow_end): Rewrite check whether cached position
2206 can be used (Bug#12600).
2207 (resize_frame_windows, grow_mini_window, shrink_mini_window):
2208 Set windows_or_buffers_changed.
2209
3e0341b0
DC
22102012-10-15 Daniel Colascione <dancol@dancol.org>
2211
2212 * dbusbind.c: Fix cygw32 build break when compiling with dbus
2213 enabled by undefining the symbol "interface", which the platform
2214 headers define to something incompatible.
2215
33d4113c
DC
22162012-10-14 Daniel Colascione <dancol@dancol.org>
2217
2218 * image.c (init_tiff_functions, init_imagemagick_functions)
2219 (init_svg_functions): Fix cygw32 build break by using these
2220 functions only when WINDOWSNT _and_ HAVE_NTGUI.
2221
a36fb15e
JD
22222012-10-14 Jan Djärv <jan.h.d@swipnet.se>
2223
2224 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
2225
537f336d
JD
22262012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2227
2228 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
2229
0ba06a77
KH
22302012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
2231
2232 * coding.c (detect_coding): Set coding->id before calling
2233 this->detector.
2234
ce2fe65a
AS
22352012-10-13 Andreas Schwab <schwab@linux-m68k.org>
2236
2237 * fileio.c: Formatting fixes.
2238
d6453ce4
PE
22392012-10-13 Paul Eggert <eggert@cs.ucla.edu>
2240
2241 Fix some stat-related races.
2242 * fileio.c (Fwrite_region): Avoid race condition if a file is
2243 removed or renamed by some other process immediately after Emacs
2244 writes it but before Emacs stats it. Do not assume that stat (or
2245 fstat) succeeds.
2246 * image.c (slurp_file): Resolve the file name with fopen + fstat
2247 rather than stat + fopen.
2248 (pbm_read_file) [0]: Remove unused code with stat race.
2249 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
2250 Remove ineffective code with stat race.
2251
06485aa8
SM
22522012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2253
2254 * doc.c (get_doc_string): Don't signal an error if the file is missing.
2255
167e3640
JD
22562012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2257
2258 * nsterm.m (hold_event_q): New static variable.
2259 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
2260 ! q_event_ptr.
2261 (hold_event): New function.
2262 (ns_read_socket): If hold_event_q have events, store them and
2263 return (Bug#12384).
2264 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
2265 is zero (Bug#12384).
2266
c40239df
JB
22672012-10-12 Juanma Barranquero <lekktu@gmail.com>
2268
2269 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
2270
bb385a92
EZ
22712012-10-12 Eli Zaretskii <eliz@gnu.org>
2272
2a9f1099
EZ
2273 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2274
bb385a92
EZ
2275 * fileio.c (check_existing): New function.
2276 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
2277 instead of calling 'stat', when what's needed is to check whether
2278 a file exists. This avoids expensive system calls on MS-Windows.
2279 (Bug#12587)
2280
8599b23a 2281 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
2282
2283 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
2284 determine whether a file exists and is not a directory.
2285
2286 * lisp.h (check_existing): Add prototype.
2287
2b9c2e68
JD
22882012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2289
2290 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
2291
81749a23
GM
22922012-10-12 Glenn Morris <rgm@gnu.org>
2293
2294 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
2295
5253a5fd
SM
22962012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2297
389a94a5
SM
2298 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
2299
5253a5fd
SM
2300 * eval.c (Fautoload): Remember previous autoload status in load-history.
2301
7cded46f
PE
23022012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2303
2304 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
2305 * lread.c (load_each_byte, new_backquote_flag, readchar)
2306 (read_filtered_event, lisp_file_lexically_bound_p)
2307 (safe_to_load_version, Fload, complete_filename_p, openp)
2308 (build_load_history, readevalloop, read_escape, read1)
2309 (string_to_number, read_vector, read_list):
2310 * macros.c (Fstart_kbd_macro):
2311 * marker.c (CONSIDER):
2312 * menu.c (parse_single_submenu, digest_single_submenu)
2313 (find_and_return_menu_selection, Fx_popup_menu):
2314 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
2315 (Ftry_completion):
2316 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
2317 (ns_menu_show):
2318 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
2319 (xmenu_show, xdialog_show):
2320 Use bool for booleans.
2321 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
2322 as it's not a predicate. All uses changed. Omit unnecessary
2323 buffer termination.
2324
549c3414
DA
23252012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2326
2327 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
2328 (save_excursion_restore): Do not restore mark if it was not saved.
2329
e85aafe7
PE
23302012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2331
fd2f90cf
PE
2332 * marker.c (cached_modiff): EMACS_INT, not int.
2333
c1af190b
PE
2334 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
2335 instead of having a wrong decl.
e85aafe7
PE
2336 * nsmenu.m (waiting_for_input): Remove wrong decl.
2337
e738ca56
PE
23382012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2339
9fa1de30
PE
2340 keyboard.c, keymap.c: Use bool for booleans.
2341 * dispnew.c (sit_for): Distinguish between 3-way display_option
2342 and boolean do_display.
2343 * keyboard.c (single_kboard, this_command_key_count_reset)
2344 (waiting_for_input, echoing, immediate_quit, input_pending)
2345 (interrupt_input, interrupts_deferred, pop_kboard)
2346 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
2347 (command_loop_1, adjust_point_for_property)
2348 (safe_run_hooks_error, input_polling_used, read_char):
2349 (help_char_p, readable_events, kbd_buffer_events_waiting)
2350 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
2351 (lucid_event_type_list_p, get_input_pending):
2352 (gobble_input, menu_separator_name_p, menu_bar_item)
2353 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
2354 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
2355 (keyremap_step, test_undefined, read_key_sequence)
2356 (detect_input_pending, detect_input_pending_ignore_squeezables)
2357 (detect_input_pending_run_timers, requeued_events_pending_p)
2358 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2359 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2360 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2361 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2362 (accessible_keymaps_1, Fkey_description, push_key_description):
2363 (shadow_lookup, struct where_is_internal_data)
2364 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2365 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2366 (describe_map, describe_vector):
2367 * menu.c (single_menu_item):
2368 * nsmenu.m (ns_update_menubar):
2369 * process.c (wait_reading_process_output):
2370 * search.c (scan_buffer, scan_newline):
2371 Use bool for boolean.
2372 * keyboard.c (timers_run, swallow_events)
2373 (detect_input_pending_run_timers):
2374 * process.c (wait_reading_process_output):
2375 Use unsigned for counter where wraparound-on-overflow is desired,
2376 since unsigned is guaranteed to have that behavior and signed is not.
2377 (read_char): Use ptrdiff_t for string length.
2378 (get_input_pending): Remove first argument, since it was always
2379 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2380 and behave as if it had that value. Return new value of
2381 input_pending. All callers changed.
2382 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2383 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2384 a string length.
2385 * keymap.c (push_key_description): Omit last arg, which was always 1.
2386 All callers changed.
2387
e738ca56
PE
2388 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2389
29f21cdf
JB
23902012-10-10 Juanma Barranquero <lekktu@gmail.com>
2391
2392 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2393 ($(BLD)/term.$(O)): Update dependencies.
2394
6aea7528
DA
23952012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2396
2397 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2398 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2399 initializer for PVEC_NORMAL_VECTOR.
2400
5f3f57be
PE
24012012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2402
2403 Clean out old termopts cruft.
2404 * termopts.h (flow_control, meta_key): Remove unused decls.
2405 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2406 Don't include termopts.h.
2407
3e98c68e
DA
24082012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2409
2410 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2411
77e344e5
PE
24122012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2413
2414 * commands.h (immediate_quit): Remove duplicate decl.
2415
5683d7cd
JD
24162012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2417
2418 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2419 caching.
2420 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 2421 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 2422
cf5fc6db
EZ
24232012-10-09 Eli Zaretskii <eliz@gnu.org>
2424
b15736e6
EZ
2425 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2426 match what GetLastError returns. Explain why the function is
2427 needed.
2428
cf5fc6db
EZ
2429 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2430 'is_tooltip_frame', to avoid confusion with its global namesake.
2431
f99714ce
DC
24322012-10-08 Daniel Colascione <dancol@dancol.org>
2433
2434 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
2435 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2436 build that caused Emacs to display the hourglass cursor forever.
f99714ce 2437
fd59cb29
GM
2438 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2439 which is broken under remote desktop, calculate the number of
2440 colors available for a display based on the display's number of
2441 planes and number of bits per pixel per plane. (bug#10397).
2442
62c480c9 24432012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 2444
62c480c9
JD
2445 * nsfont.m (Vfonts_in_cache): New variable.
2446 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2447 are used. Add cached fonts to Vfonts_in_cache.
2448 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2449
607446ba
JB
24502012-10-08 Juanma Barranquero <lekktu@gmail.com>
2451
fd5125ad
JB
2452 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2453 in nt/config.nt.
46979e0b
JB
2454 (FONT_H): Define after FRAME_H.
2455 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2456 Update dependencies.
fd5125ad 2457
607446ba
JB
2458 * w32term.c: Remove leftover declaration of keyboard_codepage.
2459
b6f4e300
EZ
24602012-10-08 Eli Zaretskii <eliz@gnu.org>
2461
c54ebba4
EZ
2462 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2463 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2464 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2465 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
2466 ($(BLD)/unexw32.$(O)):
2467 ($(BLD)/w32.$(O)):
2468 ($(BLD)/w32console.$(O)):
2469 ($(BLD)/w32fns.$(O)):
2470 ($(BLD)/w32heap.$(O)):
2471 ($(BLD)/w32menu.$(O)):
15c720a3 2472 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 2473
b6f4e300
EZ
2474 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2475 'const char *'.
2476 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2477
501199a3
DC
24782012-10-08 Daniel Colascione <dancol@dancol.org>
2479
2480 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2481 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2482 accidental message numbering hole. Change other messages to
2483 match.
2484
2485 * w32select.h (HAVE_W32SELECT): Remove.
2486
2487 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 2488 w32common.h instead of w32heap.h.
501199a3
DC
2489
2490 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2491 (get_allocation_unit, get_processor_type, get_w32_major_version)
2492 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2493 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2494 (OS_NT, os_subtype, cache_system_info): Move declarations to
2495 w32common.
2496
2497 * w32heap.c: Include w32common.h.
2498 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
2499 (w32_minor_version, w32_build_number, w32_subtype):
2500 Remove duplicate definitions.
501199a3
DC
2501
2502 * w32fns.c: Include w32common.h; include w32heap.h only in
2503 WINDOWSNT.
2504
2505 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2506 Use `report_file_error' instead of `error' in order to better
2507 inform users of what went wrong. Increase NTGUI_UNICODE file
2508 dialog box file name length to 32k, the maximum allowed by the NT
2509 kernel.
2510
2511 * w32common.h: New file.
2512 (ROUND_UP, ROUND_DOWN, get_page_size)
2513 (get_allocation_unit, get_processor_type, get_w32_major_version)
2514 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2515 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2516 (OS_NT, os_subtype, cache_system_info): Move here.
2517
2518 * unexw32.c, unexcw.c: Include w32common.h.
2519
2520 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2521 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2522 to call syms_of_w32select.
2523
2524 * cygw32.h: Remove obsolete EXFUN declarations.
2525
2526 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2527
2528 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2529 of w32inevt.o from SOME_MACHINE_OBJECTS.
2530
93aa5c81
DC
25312012-10-08 Daniel Colascione <dancol@dancol.org>
2532
2533 * image.c: Permanent fix for JPEG compilation issue --- limit
2534 jpeglib `boolean' redefinition to Cygwin builds.
2535
d424f3d8
EZ
25362012-10-08 Eli Zaretskii <eliz@gnu.org>
2537
8ee4c6ce
EZ
2538 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2539
d424f3d8
EZ
2540 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2541 Cygwin.
2542
e08348a0
DC
25432012-10-08 Daniel Colascione <dancol@dancol.org>
2544
2545 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2546 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2547 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2548 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2549 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2550 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2551 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2552 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2553 now a supported configuration.
2554
2555 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 2556 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
2557
2558 * conf_post.h:
2559 (_DebPrint) declare tracing facility for W32 debugging. We need
2560 to unify tracing later.
2561
2562 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2563 unconditional use of W32 Unicode functions. Cygwin runs only on
2564 100% Unicode operating systems.
2565
2566 * cygw32.c: New file. Define Cygwin-specific facilities.
2567 (Fcygwin_convert_path_to_windows)
2568 (Fcygwin_convert_path_from_windows): New user functions for
2569 accessing Cygwin path-munging routines.
2570
2571 * cygw32.h: New file.
2572 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2573 UTF-16LE strings temporarily inside non-Lisp-visible string
2574 objects.
2575
2576 (w32_strerror): Just what it says on the tin.
2577
2578 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2579 also run for Cygwin; both systems have the same problem with using
2580 GUI facilities in a forked child. Also call syms_of_cygw32,
2581 syms_of_w32select in correct places.
2582
2583 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2584 needs fork-then-exec for daemon launching.
2585
2586 * font.h: Include frame.h.
2587
2588 * image.c: Use the image library cache machinery only when we're
2589 compiling for native WINDOWSNT; Cygwin can use shared libraries
2590 like any other Unixlike system.
2591
2592 * keyboard.c: Clarify a comment regarding the input loop.
2593
2594 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2595 functions directly instead of trying to detect at runtime that our
2596 host operating system supports them. We make this change for two
2597 reasons: Cygwin lacks support for the multibyte character
2598 conversion functions used by the legacy menu code, and Cygwin
2599 never needs to rely on non-Unicode APIs.
2600
2601 * unexw32.c (hinst): Declare extern.
2602
2603 * w32.c: Change header order;
2604 (w32_strerror): Move to w32fns.c because we need it for
2605 non-WINDOWSNT builds.
2606
2607 * w32.h: Add #error macro to make sure we don't include w32.h for
2608 Cygwin builds. Remove w32select declarations.
2609
2610 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 2611 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
2612
2613 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2614 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2615 POSIXy alternative.
2616 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2617 (w32_major_version, w32_minor_version, w32_build_number)
2618 (os_subtype, sound_type): Define here
2619 (w32_defined_color): Make color parameter const for consistency
2620 with other _defined_color functions.
2621 (w32_createwindow): Unconditionally call w32_init_class instead of
2622 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2623 through the code is complex and unnecessary because class
2624 registration is practically free.
2625 (w32_name_of_message): New EMACSDEBUG-only function.
2626 (Fset_message_beep): Move here
2627 (Fx_open_connection): Require that the display name for Windows be
2628 "w32" for consistency, emacsclient disambiguation, and maybe, one
2629 day, multi-window-system support.
2630 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2631 Cygwin files for W32 GUI facilities, since these clearly don't
2632 expect Cygwin names.
2633 (_DebPrint): Define.
2634 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2635 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2636 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2637 (w32_last_error): Remove.
2638
2639 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2640
2641 * w32heap.c (syspage_mask): Declare here.
2642 (cache_system_info): Remove.
2643
2644 * w32inevt.c (faked_key): Define globally, not statically.
2645 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2646 (w32_console_toggle_lock_key): Move to w32fns.c.
2647
2648 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2649
2650 * w32proc.c (_DebPrint): Move to w32fns.c.
2651 * w32select.c: Include string.h, stdio.h for Cygwin.
2652 * w32select.h: New File.
2653
2654 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2655 get_osfhandle.
2656 (w32_message_fd): New variable. Under Cygwin, holds the file
2657 descriptor the system used to tell us about pending thread
2658 messages.
2659
2660 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2661 that prevented compilation under non-WINDOWSNT systems.
2662
2663 (w32_initialize): Open /dev/windows and assign it to
2664 w32_message_fd. Provide w32 feature.
2665
2666 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2667 (WM_EMACS_INPUT_READY): add.
2668 (prepend_msg, w32_message_fd): Declare globally.
2669
2670 * w32xfns.c:
2671 (keyboard_handle): Use only when WINDOWSNT.
2672 (notify_msg_ready): New function. Posts a message to the main
2673 thread's message queue under CYGWIN, which wakes up the main
2674 thread from select(2) by making the /dev/windows file descriptor
2675 ready. Under WINDOWSNT, it sets an event the same way the old
2676 code did.
2677
2678 (post, prepend_msg): Actually call notify_msg_ready instead of
2679 setting the input event directly.
2680
98daa893
EZ
26812012-10-07 Eli Zaretskii <eliz@gnu.org>
2682
2683 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2684 but it still has blocs in it, don't return it to the system,
2685 instead of aborting. (Bug#12402)
2686
3bc0a2f7
JD
26872012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2688
8ad5b73b 2689 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 2690
335f5ae4
JD
2691 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2692 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
2693 (syms_of_nsterm): Remove comment about Panther and above for
2694 ns-antialias-text.
335f5ae4
JD
2695 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2696 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2697 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2698
2699 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2700 MAC_OS_X_VERSION_10_4.
2701
8ad5b73b
JD
2702 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2703 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
2704
2705 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2706
2707 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2708 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2709
3bc0a2f7
JD
2710 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2711 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
2712 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2713 Remove ns_in_resize check.
3bc0a2f7
JD
2714 (ns_clear_frame_area): Remove resize handle code.
2715
2716 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
2717 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2718 Remove ns_in_resize check.
3bc0a2f7 2719
c622b48f
PE
27202012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2721
2722 Improve sys_siglist detection.
2723 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2724 defined as a macro, as is done in Solaris.
2725 (sys_siglist_entries): New macro.
2726 (save_strsignal): Use it.
2727 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2728 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2729
04fafa46
JD
27302012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2731
2732 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2733 fullscreen/Fullscreen.
2734
2735 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2736 tobar_height is new.
2737
2738 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2739 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2740 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2741 (windowDidResize:): Check for correct window if old style fullscreen.
2742 Capitalize word in comment. Remove incorrect comment.
2743 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2744 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2745 error in drawing background.
1f9f395d 2746 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
2747 Set toolbar values to zero, save old height in tobar_height.
2748 Restore tool bar height when leaving fullscreen.
2749 (canBecomeMainWindow): New function.
2750
c6e21c03
PE
27512012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2752
2753 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2754
0d9f584b
EZ
27552012-10-05 Eli Zaretskii <eliz@gnu.org>
2756
a65fbb5f
EZ
2757 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2758
0d9f584b 2759 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
2760 that time stamps of directories could also be changed.
2761 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
2762 FILE_WRITE_ATTRIBUTES access rights.
2763
2764 * fileio.c (Fset_file_times): Special-case ignoring errors for
2765 directories only on MSDOS, not on MS-Windows.
2766
e8757f09 27672012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
2768
2769 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2770
7604f298
EZ
27712012-10-04 Eli Zaretskii <eliz@gnu.org>
2772
2773 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2774 see whether CreateFile failed.
2775
88d69b7d
PE
27762012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2777
2778 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2779 to avoid similar races.
2780 * keyboard.c (pending_signals): Now bool, not int.
2781
7509f454
PE
2782 Port timers to OpenBSD, plus check for timer failures.
2783 OpenBSD problem reported by Han Boetes.
2784 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2785 and/or setitimer.
2786 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2787 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2788 like OpenBSD, which has timer_settime but does not declare it.
2789 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2790 whether to use itimerspec-related primitives. All uses of
2791 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2792
a3c5c0c5
PE
27932012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2794
2795 * profiler.c (handle_profiler_signal): Fix a malloc race
2796 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2797
914e743b
JD
27982012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2799
2800 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2801
d8ab37a8
EZ
28022012-10-02 Eli Zaretskii <eliz@gnu.org>
2803
2804 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2805 consistent with the change in return value of 'safe_strsignal'.
2806
b3ecad33
PE
28072012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2808
0a99eee1
PE
2809 Prefer plain 'static' to 'static inline' (Bug#12541).
2810 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2811 (bidi_set_sor_type, bidi_push_embedding_level)
2812 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2813 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2814 (bidi_cache_search, bidi_cache_ensure_space)
2815 (bidi_cache_iterator_state, bidi_cache_find)
2816 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2817 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2818 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2819 Now 'static', not 'static inline'.
2820
b3ecad33
PE
2821 Count overruns when profiling; change units to ns.
2822 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2823 Give extra weight to samples after overruns, to attempt to count
2824 the time more accurately.
2825 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2826 the underlying primitives nominally do ns.
2827 (Fprofiler_cpu_start): Document the change. Mention that
2828 the sampling intervals are only approximate.
2829
090cf9db
SM
28302012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2831
2832 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2833
2834 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2835 case for the special 0 coding-system.
2836
2837 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2838 (Fmake_overlay): Remove redundant tests.
64edc777 2839 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 2840
81550bf4
JB
28412012-10-02 Juanma Barranquero <lekktu@gmail.com>
2842
2843 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2844 Update dependencies.
2845
aa1ba90e
PE
28462012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2847
2848 Fix a malloc race condition involving strsignal.
2849 A signal can arrive in the middle of a malloc, and Emacs's signal
2850 handler can invoke strsignal, which can invoke malloc, which is
2851 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2852 Fix it by altering the signal handler so that it does not invoke
2853 strsignal.
2854 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2855 * process.c (status_message): Use const pointer, in case strsignal
2856 is #defined to safe_strsignal.
2857 * sysdep.c (sys_siglist, init_signals): Always define and
2858 initialize a substitute sys_siglist if the system does not define
2859 one, even if HAVE_STRSIGNAL.
2860 (safe_strsignal): Rename from strsignal. Always define,
2861 using sys_siglist. Return a const pointer.
2862 * syssignal.h (safe_strsignal): New decl.
2863 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2864
ace917bd
EZ
28652012-10-01 Eli Zaretskii <eliz@gnu.org>
2866
2867 * w32proc.c (timer_loop): Fix code that waits for timer
2868 expiration, to avoid high CPU usage.
2869
9eb71b9c
SM
28702012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2871
2872 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2873 (sweep_weak_table): Remove redundant prototypes.
2874
b3317662
FP
28752012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2876
2877 * emacs.c: Move the inclusion of TERM_HEADER after including
2878 windows.h on WINDOWSNT. This avoids compilation problems with
2879 MSVC.
2880
f0e5f225
EZ
28812012-10-01 Eli Zaretskii <eliz@gnu.org>
2882
2d7d1608
EZ
2883 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2884 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2885 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2886 as the previous version used 'void *'.
2887
2888 * ralloc.c (ROUNDUP): Fix last change.
2889 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2890 'size_t'.
2891
f0e5f225
EZ
2892 * w32proc.c <disable_itimers>: New static flag.
2893 (init_timers): Initialize it to zero, after creating the critical
2894 sections used by the timer threads.
2895 (term_timers): Set to 1 before deleting the critical sections.
2896 (getitimer, setitimer): If disable_itimers is non-zero, return an
2897 error indication without doing anything. Reported by Fabrice
2898 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
2899 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2900 return results.
2901 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2902 support timers.
f0e5f225
EZ
2903
2904 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2905 term_ntproc after all the other bookkeeping, to get timers working
2906 as long as possible.
2907
82ef37c1
PE
29082012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2909
b3a4c387
PE
2910 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2911 Suggested by Juri Linkov in
2912 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2913
b0ab8123
PE
2914 Prefer plain 'static' to 'static inline' (Bug#12541).
2915 With static functions, modern compilers inline pretty well by
2916 themselves; advice from programmers often hurts as much as it helps.
2917 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2918 this change shrinks the text size of the Emacs executable by 1.1%
2919 without affecting CPU significantly in my benchmark.
2920 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2921 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2922 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2923 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2924 (bset_auto_fill_function, bset_auto_save_file_format)
2925 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2926 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2927 (bset_cache_long_line_scans, bset_case_fold_search)
2928 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2929 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2930 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2931 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2932 (bset_header_line_format, bset_indicate_buffer_boundaries)
2933 (bset_indicate_empty_lines, bset_invisibility_spec)
2934 (bset_left_fringe_width, bset_major_mode, bset_mark)
2935 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2936 (bset_name, bset_overwrite_mode, bset_pt_marker)
2937 (bset_right_fringe_width, bset_save_length)
2938 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2939 (bset_scroll_up_aggressively, bset_selective_display)
2940 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2941 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2942 (set_buffer_overlays_after):
2943 * category.c (bset_category_table):
2944 * charset.c (read_hex):
2945 * coding.c (produce_composition, produce_charset)
2946 (handle_composition_annotation, handle_charset_annotation)
2947 (char_encodable_p):
2948 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2949 (assign_row, set_frame_matrix_frame, make_current)
2950 (add_row_entry):
2951 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2952 * fns.c (maybe_resize_hash_table):
2953 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2954 * gmalloc.c (register_heapinfo):
2955 * image.c (lookup_image_type):
2956 * intervals.c (set_interval_object, set_interval_left)
2957 (set_interval_right, copy_interval_parent, rotate_right)
2958 (rotate_left, balance_possible_root_interval):
2959 * keyboard.c (kset_echo_string, kset_kbd_queue)
2960 (kset_keyboard_translate_table, kset_last_prefix_arg)
2961 (kset_last_repeatable_command, kset_local_function_key_map)
2962 (kset_overriding_terminal_local_map, kset_real_last_command)
2963 (kset_system_key_syms, clear_event, set_prop):
2964 * lread.c (digit_to_number):
2965 * marker.c (attach_marker, live_buffer, set_marker_internal):
2966 * nsterm.m (ns_compute_glyph_string_overhangs):
2967 * process.c (pset_buffer, pset_command)
2968 (pset_decode_coding_system, pset_decoding_buf)
2969 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2970 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2971 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2972 * syntax.c (bset_syntax_table, dec_bytepos):
2973 * terminal.c (tset_param_alist):
2974 * textprop.c (interval_has_some_properties)
2975 (interval_has_some_properties_list):
2976 * window.c (wset_combination_limit, wset_dedicated)
2977 (wset_display_table, wset_hchild, wset_left_fringe_width)
2978 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2979 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2980 (wset_right_fringe_width, wset_right_margin_cols)
2981 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2982 (wset_vertical_scroll_bar_type, wset_window_parameters):
2983 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2984 (wset_column_number_displayed, wset_region_showing)
2985 (window_box_edges, run_window_scroll_functions)
2986 (append_glyph_string_lists, prepend_glyph_string_lists)
2987 (append_glyph_string, set_glyph_string_background_width)
2988 (append_glyph, append_composite_glyph)
2989 (take_vertical_position_into_account):
2990 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2991 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2992 (lface_hash, lface_same_font_attributes_p, lookup_face):
2993 * xml.c (libxml2_loaded_p):
2994 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2995 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2996 Now 'static', not 'static inline'.
2997
05584c31
PE
2998 * bidi.c: Tune.
2999 (bidi_copy_it): Do the whole copy with a single memcpy.
3000 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
3001
86ec63ba
PE
3002 Revert the FOLLOW-SYMLINKS change for file-attributes.
3003 Doing it right would require several changes to Tramp, and there's
3004 not enough time to get that tested before the freeze today.
3005 * dired.c (directory_files_internal, Ffile_attributes):
3006 Undo last change.
3007
82ef37c1
PE
3008 * frame.c (x_report_frame_params): Port better to wider ints.
3009 Do not assume that EMACS_UINT is the same width as uprintmax_t,
3010 or that pointers can be printed in 15 decimal digits.
3011 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
3012
62aba0d4
FP
30132012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
3014
3015 Support x64 build on MS-Windows.
3016 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
3017 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
3018 compatibility with x64.
5e4daaf3 3019 (x_get_focus_frame): Add prototype.
62aba0d4
FP
3020
3021 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
3022 defining an XRectangle structure.
3023
3024 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
3025 arithmetics for compatibility with x64.
3026
3027 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
3028 compatibility with x64.
3029
3030 * w32heap.h: Adjust prototypes and declarations.
3031
3032 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
3033 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
3034 DWORD, long, and unsigned long, for compatibility with x64.
3035 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
3036 (sbrk): Argument is now of type ptrdiff_t.
3037
3038 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
3039 less than 0x0500.
3040 (w32_msg_pump): Use WPARAM type for 'result'.
3041
3042 * w32.c (init_environment, get_emacs_configuration): Support AMD64
3043 architecture.
3044 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
3045 compatibility with x64.
3046
3047 * vm-limit.c (lim_data): Now size_t.
3048 (check_memory_limits): Adjust prototypes of real_morecore and
3049 __morecore to receive argument of type ptrdiff_t. Use size_t for
3050 five_percent and data_size.
3051
3052 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
3053 variables, for compatibility with x64.
3054 (rva_to_section, offset_to_section, relocate_offset)
3055 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
3056 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
3057 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
3058 for compatibility with x64.
3059
3060 * sysdep.c (STDERR_FILENO): Define if not already defined.
3061
3062 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
3063 (__morecore): Argument type is now ptrdiff_t.
3064 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
3065 (relinquish): Use ptrdiff_t type for 'excess'.
3066 (r_alloc_sbrk): Argument type is now ptrdiff_t.
3067
3068 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
3069 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
3070 instead of a literal number.
3071
3072 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
3073 (min): Define only if not already defined.
3074
3075 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
3076 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
3077 hosts.
3078
3079 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
3080 'bitmaps' is a pointer.
3081
3082 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
3083
3084 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
3085
e7a2937b
PE
30862012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3087
3088 file-attributes has a new optional arg FOLLOW-SYMLINKS.
3089 * dired.c (directory_files_internal, Ffile_attributes):
3090 New arg follow_symlinks. All uses changed.
3091
b43d62ae
SM
30922012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
3093
3094 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
3095
c06c382a
EZ
30962012-09-30 Eli Zaretskii <eliz@gnu.org>
3097
3098 Support atimers and CPU profiler via profile.c on MS-Windows.
3099 * w32proc.c (sig_mask, crit_sig): New static variables.
3100 (sys_signal): Support SIGALRM and SIGPROF.
3101 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 3102 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
3103 sigfillset, and sigprocmask are no longer no-ops.
3104 (sigismember): New function.
3105 (struct itimer_data): New definition.
3106 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
3107 (crit_prof): New static variables.
3108 (MAX_SINGLE_SLEEP): New definition.
3109 (timer_loop, stop_timer_thread, term_timers, init_timers)
3110 (start_timer_thread, getitimer, setitimer): New functions.
3111 (alarm): No longer a no-op, calls setitimer.
3112
3113 * w32.c (term_ntproc): Call term_timers.
3114 (init_ntproc): Make sure all signals are unblocked at startup, to
3115 erase any traces of dumping. Call init_timers.
3116
3117 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
3118 Windows-specific code to display the hourglass mouse pointer is no
3119 longer used.
3120 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
3121 to hourglass timer expiration.
3122 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
3123 Remove, no longer used.
b43d62ae
SM
3124 (w32_note_current_window, show_hourglass, hide_hourglass):
3125 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
3126 window systems.
3127 (syms_of_w32fns): Don't initialize hourglass_timer.
3128
3129 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
3130 WINDOWSNT as well.
3131 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
3132
3133 * w32.h (init_timers, term_timers): Add prototypes.
3134
95402d5f
KH
31352012-09-30 Kenichi Handa <handa@gnu.org>
3136
3137 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
3138 to the buffer relocation which may be caused by ccl_driver.
3139
dd946752
JD
31402012-09-30 Jan Djärv <jan.h.d@swipnet.se>
3141
d7e642cc
JD
3142 * xfns.c (Fx_file_dialog): Update comment.
3143
3144 * w32fns.c (Fx_file_dialog): Update comment.
3145
3146 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
3147 Initialize panel name field if OSX >= 10.6.
3148
3149 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
3150
dd946752
JD
3151 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
3152
3153 * nsterm.m (NEW_STYLE_FS): New define.
3154 (ns_fullscreen_hook, windowWillEnterFullScreen)
3155 (windowDidEnterFullScreen, windowWillExitFullScreen)
3156 (windowDidExitFullScreen, toggleFullScreen, handleFS)
3157 (setFSValue): New functions.
3158 (EmacsFSWindow): New implementation.
3159 (canBecomeKeyWindow): New function for EmacsFSWindow.
3160 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
3161 (dealloc): Release nonfs_window if in fullscreen.
3162 (updateFrameSize:): Call windowDidMove to update top/left.
3163 (windowWillResize:toSize:): Check if frame is still maximized.
3164 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
3165 next_maximized, maximized_width, maximized_height and nonfs_window.
3166 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
3167 tbar_height.
3168 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 3169 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
3170
3171 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
3172 (EmacsView): Add variables for fullscreen.
3173 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
3174 (EmacsFSWindow): New interface for fullscreen.
3175
427730eb
JB
31762012-09-30 Juanma Barranquero <lekktu@gmail.com>
3177
3178 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3179
48de8b12
CY
31802012-09-30 Chong Yidong <cyd@gnu.org>
3181
3182 * fns.c (Frandom): Doc fix.
3183
5938d519
MR
31842012-09-30 Martin Rudalics <rudalics@gmx.at>
3185
3186 * window.c (Vwindow_combination_limit): New default value.
3187 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
3188
cb5b0266
PE
31892012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3190
3191 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
3192 Suggested by Eli Zaretskii in
3193 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
3194
84f72efd
EZ
31952012-09-30 Eli Zaretskii <eliz@gnu.org>
3196
3197 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
3198 HAVE_TIMER_SETTIME is defined.
3199
9d4dcdc9
PE
32002012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3201
d89460ed
PE
3202 Profiler improvements: more-accurate timers, overflow checks.
3203 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
3204 signal.h, setjmp.h. Include systime.h instead.
3205 (saturated_add): New function.
3206 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
3207 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
3208 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
3209 New static vars.
84f72efd 3210 (enum profiler_cpu_running): New enum.
d89460ed
PE
3211 (profiler_cpu_running): Now of that enum type, not bool.
3212 All uses changed to store the new value.
3213 (handle_profiler_signal): Rename from sigprof_handler_1,
3214 for consistency with other handlers. Do not check whether
3215 cpu_log is a hash-table if garbage collecting, since it
3216 doesn't matter in that case.
3217 (deliver_profiler_signal): Rename from sigprof_handler,
3218 for consistency with other handlers.
3219 (setup_cpu_timer): New function, with much of what used to be in
3220 Fprofiler_cpu_start. Check for out-of-range argument.
3221 Prefer timer_settime if available, and prefer
3222 thread cputime clocks, then process cputime clocks, then
3223 monotonic clocks, to the old realtime clock. Use make_timeval
3224 to round more-correctly when falling back to setitimer.
3225 (Fprofiler_cpu_start): Use it.
3226 (Fprofiler_cpu_stop): Prefer timer_settime if available.
3227 Don't assume that passing NULL as the 2nd argument of setitimer
3228 is the same as passing a pointer to all-zero storage.
3229 Ignore SIGPROF afterwards.
3230 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
3231 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
3232 non-fatal signal handlers. Ignore SIGPROF on startup.
3233 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
3234 in profiler.c, since sysdep.c now uses it.
3235
9d4dcdc9
PE
3236 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
3237 Suggested by Eli Zaretskii in
3238 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3239
8e5691a0
JB
32402012-09-29 Juanma Barranquero <lekktu@gmail.com>
3241
3242 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3243
e7c1b6ef
SM
32442012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
3245
3246 * lisp.h (struct backtrace): Remove indirection for `function' field.
3247 * xdisp.c (redisplay_internal):
3248 * profiler.c (record_backtrace, sigprof_handler_1):
3249 * alloc.c (Fgarbage_collect):
3250 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
3251 (Fbacktrace_frame): Adjust accordingly.
3252
e61d39cd 32532012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
3254
3255 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
3256 (Frun_hook_with_args_until_failure): Doc fixes.
3257
404043ea
EZ
32582012-09-28 Eli Zaretskii <eliz@gnu.org>
3259
3260 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
3261 Qautomatic_redisplay and change the symbol name. All users changed.
3262
704d3f45
TM
32632012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
3264
3265 * profiler.c (sigprof_handler): Fix race condition.
3266
757140ff
GM
32672012-09-28 Glenn Morris <rgm@gnu.org>
3268
3269 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
3270
a615a3ae
PE
32712012-09-27 Paul Eggert <eggert@cs.ucla.edu>
3272
3273 Check more robustly for timer_settime.
89d17fd0
PE
3274 * Makefile.in (LIB_TIMER_TIME): New macro.
3275 (LIBES): Add it.
a615a3ae
PE
3276 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
3277 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
3278 call timer_settime.
3279
3670daf7
TM
32802012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3281
3282 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
3283
6a586b7f
JB
32842012-09-26 Juanma Barranquero <lekktu@gmail.com>
3285
3286 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3287
41c8bfcf
PE
32882012-09-26 Paul Eggert <eggert@cs.ucla.edu>
3289
3290 * character.h (MAYBE_UNIFY_CHAR): Remove.
3291 * charset.c, charset.h (maybe_unify_char): Now static.
3292 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
3293 Since this stuff is now private to charset.c, there's no need for
3294 a public macro and no need to inline by hand.
3295
3a880af4
SM
32962012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3297 Stefan Monnier <monnier@iro.umontreal.ca>
3298 Juanma Barranquero <lekktu@gmail.com>
611b7507 3299
3a880af4
SM
3300 * profiler.c: New file.
3301 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
3302 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
3303 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
3304 * emacs.c (main): Call syms_of_profiler.
3305 * alloc.c (Qautomatic_gc): New constant.
3306 (MALLOC_PROBE): New macro.
3307 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
3308 (total_bytes_of_live_objects): New function.
3309 (Fgarbage_collect): Use it. Record itself in backtrace_list.
3310 Call malloc_probe for the memory profiler.
3311 (syms_of_alloc): Define Qautomatic_gc.
3312 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
3313 race condition.
3314 (struct backtrace): Move definition...
3315 * lisp.h (struct backtrace): ..here.
3316 (Qautomatic_gc, profiler_memory_running): Declare vars.
3317 (malloc_probe, syms_of_profiler): Declare functions.
3318 * xdisp.c (Qautomatic_redisplay): New constant.
3319 (redisplay_internal): Record itself in backtrace_list.
3320 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 3321
5938d519 33222012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
33232012-09-25 Juanma Barranquero <lekktu@gmail.com>
3324
3325 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
3326
e26fd2e4
PE
33272012-09-25 Paul Eggert <eggert@cs.ucla.edu>
3328
3329 Prefer POSIX timers if available.
3330 They avoid a race if the timer is too close to the current time.
3331 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
3332 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 3333 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 3334
eedec3ee
EZ
33352012-09-25 Eli Zaretskii <eliz@gnu.org>
3336
3337 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
3338 CHAR_STRING_ADVANCE.
3339 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
3340 STRING_CHAR_ADVANCE.
3341
aa15c6bb
JB
33422012-09-25 Juanma Barranquero <lekktu@gmail.com>
3343
3344 Move Vlibrary_cache to emacs.c and reset before dumping.
3345
3346 * lisp.h (reset_image_types): Declare.
3347 [WINDOWSNT] (Vlibrary_cache): Declare.
3348
3349 * image.c (reset_image_types): New function.
3350
3351 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
3352 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
3353 (Fdump_emacs): Reset Vlibrary_cache and image_types.
3354
3355 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
3356 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3357
3358 * w32.h (Vlibrary_cache): Do not declare.
3359
54d629be
EZ
33602012-09-25 Eli Zaretskii <eliz@gnu.org>
3361
16b22fef
EZ
3362 * w32proc.c (sys_signal): Handle all signals defined by the
3363 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3364 handlers for signals supported by Windows. Don't override
3365 term_ntproc as the handler for SIGABRT.
3366 (sigaction): Rewrite to call sys_signal instead of duplicating its
3367 code.
3368 (sys_kill): Improve commentary.
3369
3370 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3371 consistency with a signature of a signal handler. All callers
3372 changed.
3373 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3374 install term_ntproc as a signal handler for SIGABRT, as that
3375 should be done by the dumped Emacs.
3376
3377 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3378
3379 * w32select.c (term_w32select): Protect against repeated
3380 invocation by setting clipboard_owner to NULL after calling
3381 DestroyWindow.
3382
3383 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3384 and term_ntproc to their modified signatures.
3385
54d629be
EZ
3386 * character.c (char_string, string_char): Remove calls to
3387 MAYBE_UNIFY_CHAR. See the discussion starting at
3388 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3389 for the details.
3390
59f7af81
CY
33912012-09-25 Chong Yidong <cyd@gnu.org>
3392
3393 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3394
22e8cf4a
SM
33952012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3396
3397 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3398 when encountering an unknown bytecode.
3399
578098f3
PE
34002012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 image.c, indent.c: Use bool for booleans.
3403 * dispextern.h (struct image_type): Members valid_p, load, init
3404 now return bool, not int. All uses changed.
3405 * image.c: Omit unnecessary static decls.
3406 (x_create_bitmap_mask, x_build_heuristic_mask):
3407 Return void, not int, since callers don't care about the return value.
3408 (x_create_bitmap_mask, define_image_type, valid_image_p)
3409 (struct image_keyword, parse_image_spec, image_spec_value)
3410 (check_image_size, image_background)
3411 (image_background_transparent, x_clear_image_1)
3412 (postprocess_image, lookup_image, x_check_image_size)
3413 (x_create_x_image_and_pixmap, xbm_image_p)
3414 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3415 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3416 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3417 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3418 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3419 (png_image_p, init_png_functions, png_load_body, png_load)
3420 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3421 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3422 (init_gif_functions, gif_load, imagemagick_image_p)
3423 (imagemagick_load_image, imagemagick_load, svg_image_p)
3424 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3425 (gs_load):
3426 * nsimage.m (ns_load_image):
3427 * nsterm.m (ns_defined_color):
3428 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3429 * xfns.c (x_defined_color):
3430 * xterm.c (x_alloc_lighter_color_for_widget)
3431 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3432 (x_alloc_lighter_color):
3433 * indent.c (disptab_matches_widthtab, current_column)
3434 (scan_for_column, string_display_width, indented_beyond_p)
3435 (compute_motion, vmotion, Fvertical_motion):
3436 Use bool for booleans.
3437
a5f2b6ec
CY
34382012-09-24 Chong Yidong <cyd@gnu.org>
3439
3440 * chartab.c (Fset_char_table_default): Obsolete function removed.
3441
18e27ea8
PE
34422012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3443
afea8a8a
PE
3444 Move pid_t related decls out of lisp.h.
3445 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3446 (interruptible_wait_for_termination):
3447 Move these decls from lisp.h to syswait.h, since they use pid_t.
3448 Needed on FreeBSD; see Herbert J. Skuhra in
3449 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3450 * callproc.c: Include syswait.h.
3451
18e27ea8
PE
3452 gnutls.c, gtkutil.c: Use bool for boolean.
3453 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3454 (emacs_gnutls_handle_error):
3455 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3456 (xg_hide_tooltip, xg_create_frame_widgets)
3457 (create_dialog, xg_uses_old_file_dialog)
3458 (xg_get_file_with_chooser, xg_get_file_with_selection)
3459 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3460 (xg_item_label_same_p, xg_update_menubar)
3461 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3462 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3463 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3464 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3465 (update_frame_tool_bar, free_frame_tool_bar):
3466 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3467 * nsmenu.m (ns_update_menubar):
3468 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3469 * xfns.c (Fx_show_tip) [USE_GTK]:
3470 Use bool for boolean.
3471 * gtkutil.c (xg_update_frame_menubar):
3472 * xmenu.c (update_frame_menubar):
3473 Return void, not int, since caller ignores return value.
3474 * gtkutil.c (xg_change_toolbar_position):
3475 Return void, not 1.
3476
af0e9f75
JB
34772012-09-23 Juanma Barranquero <lekktu@gmail.com>
3478
3479 * makefile.w32-in (BLOCKINPUT_H): Remove.
3480 (SYSSIGNAL_H): New macro.
3481 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3482 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3483 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3484 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3485 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3486 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3487 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3488 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3489 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3490 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3491 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3492 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3493 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3494 ($(BLD)/w32xfns.$(O)): Update dependencies.
3495
5101529e
EZ
34962012-09-23 Eli Zaretskii <eliz@gnu.org>
3497
3498 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3499 fatal_error_backtrace.
3500
3501 * w32proc.c (sys_kill): Undo last change: don't do anything when
3502 invoked to deliver SIGABRT to our own process. This is now
3503 handled by emacs_raise.
3504
2c3ee0ad
JB
35052012-09-23 Juanma Barranquero <lekktu@gmail.com>
3506
3507 * w32term.c (w32_read_socket): Remove leftover reference to
3508 interrupt_input_pending.
3509
62a1d661
PE
35102012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3511
3512 Do not use SA_NODEFER.
3513 Problem reported by Dani Moncayo in
3514 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3515 * alloc.c (die):
3516 * sysdep.c (emacs_abort): Do not reset signal handler.
3517 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3518 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3519 wanted even on POSIXish hosts, and it doesn't work on Windows.
3520
a0942b9a
JD
35212012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3522
3523 * xterm.c (x_term_init): Call fixup_locale before and after calling
3524 gtk_init (Bug#12392).
3525
d07ff9db
CY
35262012-09-23 Chong Yidong <cyd@gnu.org>
3527
3528 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3529 Vdynamic_library_alist.
3530
3531 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3532 (Fgnutls_available_p): Caller changed.
3533
3534 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3535 (Flibxml_parse_xml_region): Likewise.
3536
3537 * dispextern.h (struct image_type): Remove arg from init function.
3538
3539 * image.c (Finit_image_library, lookup_image_type)
3540 (define_image_type): Remove now-unneeded second arg.
3541 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3542 (init_tiff_functions, init_gif_functions, init_svg_functions):
3543 Arglist and w32_delayed_load calling convention changed.
3544 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 3545 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 3546
4d7e6e51
PE
35472012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3548
3549 Simplify and avoid signal-handling races (Bug#12471).
3550 * alloc.c (die):
3551 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3552 Avoid recursive loop if there's a fatal error in the function itself.
3553 * atimer.c (pending_atimers):
3554 * blockinput.h: Don't include "atimer.h"; no longer needed.
3555 (interrupt_input_pending): Remove. All uses removed.
3556 pending_signals now counts both atimers and ordinary interrupts.
3557 This is less racy than having three separate pending-signal flags.
3558 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3559 (input_blocked_p):
3560 Rename from their upper-case counterparts BLOCK_INPUT,
3561 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3562 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3563 This makes it easier to access volatile variables more accurately.
3564 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3565 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3566 that's more reliable if the code is buggy and sets
3567 interrupt_input_blocked to a negative value. All uses changed.
3568 * atimer.c (deliver_alarm_signal):
3569 Remove. No need to deliver this to the parent; any thread can
3570 handle this signal now. All uses replaced by underlying handler.
3571 * atimer.c (turn_on_atimers):
3572 * dispnew.c (handle_window_change_signal):
3573 * emacs.c (handle_danger_signal):
3574 * keyboard.c (kbd_buffer_get_event):
3575 Don't reestablish signal handler; not needed with sigaction.
3576 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3577 (UNBLOCK_INPUT_TO):
3578 Rework to avoid unnecessary accesses to volatile variables.
3579 (UNBLOCK_INPUT_TO): Now a function.
3580 (totally_unblock_input, unblock_input): New decls.
3581 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3582 (init_data): Remove. Necessary stuff now done in init_signal.
3583 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3584 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3585 (fatal_error_code): Remove; no longer needed.
3586 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3587 it doesn't always backtrace. All uses changed. No need to reset
3588 signal to default, since sigaction and/or die does that for us now.
3589 Use emacs_raise (FOO), not kill (getpid (), FOO).
3590 (main): Check more-accurately whether we're dumping.
3591 Move fatal-error setup to sysdep.c
3592 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3593 * gtkutil.c (xg_get_file_name, xg_get_font):
3594 Remove no-longer-needed signal-mask manipulation.
3595 * keyboard.c, process.c (POLL_FOR_INPUT):
3596 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3597 * keyboard.c (read_avail_input): Remove.
3598 All uses replaced by gobble_input.
3599 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3600 (kbd_buffer_store_event_hold, gobble_input):
3601 (record_asynch_buffer_change) [USABLE_SIGIO]:
3602 (store_user_signal_events):
3603 No need to mess with signal mask.
3604 (gobble_input): If blocking input and there are terminals, simply
3605 set pending_signals to 1 and return. All hooks changed to not
3606 worry about whether input is blocked.
3607 (process_pending_signals): Clear pending_signals before processing
3608 them, in case a signal comes in while we're processing.
3609 By convention callers now test pending_signals before calling us.
3610 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3611 New functions, to support changes to blockinput.h.
3612 (handle_input_available_signal): Now extern.
3613 (reinvoke_input_signal): Remove. All uses replaced by
3614 handle_async_input.
3615 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
3616 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3617 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
3618 Clear sigmask reliably, even if Fsignal returns, which it can.
3619 Omit unnecessary accesses to volatile var.
3620 (quit_throw_to_read_char): No need to restore sigmask.
3621 * keyboard.c (gobble_input, handle_user_signal):
3622 * process.c (wait_reading_process_output):
3623 Call signal-handling code rather than killing ourselves.
3624 * lisp.h: Include <float.h>, for...
3625 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3626 (pending_signals): Now volatile.
3627 (syms_of_data): Now const if IEEE floating point.
3628 (handle_input_available_signal) [USABLE_SIGIO]:
3629 (terminate_due_to_signal, record_child_status_change): New decls.
3630 * process.c (create_process): Avoid disaster if memory is exhausted
3631 while we're processing a vfork, by tightening the critical section
3632 around the vfork.
3633 (send_process_frame, process_sent_to, handle_pipe_signal)
3634 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3635 ignores SIGPIPE.
3636 (send_process): No need for setjmp/longjmp any more, since the
3637 SIGPIPE stuff is now gone. Instead, report an error if errno
3638 is EPIPE.
3639 (record_child_status_change): Now extern. PID and W are now args.
3640 Return void, not bool. All callers changed.
3641 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3642 Remove. All uses removed. This bug should be fixed now in a
3643 different way.
3644 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3645 and record the child status change directly. This avoids the
3646 need to futz with the signal mask.
3647 (process_fatal_action): Move here from emacs.c.
3648 (emacs_sigaction_flags): New function, containing
3649 much of what used to be in emacs_sigaction_init.
3650 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3651 caught by emacs, to make races less likely.
3652 (deliver_process_signal): Rename from handle_on_main_thread.
3653 All uses changed.
3654 (BACKTRACE_LIMIT_MAX): Now at top level.
3655 (thread_backtrace_buffer, threadback_backtrace_pointers):
3656 New static vars.
3657 (deliver_thread_signal, deliver_fatal_thread_signal):
3658 New functions, for more-accurate delivery of thread-specific signals.
3659 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3660 (deliver_arith_signal): Handle in this thread, not
3661 in the main thread, since it's triggered by this thread.
3662 (maybe_fatal_sig): New function.
3663 (init_signals): New arg DUMPING so that we can be more accurate
3664 about whether we're dumping. Caller changed.
3665 Treat thread-specific signals differently from process-general signals.
3666 Block all signals while handling fatal error; that's safer.
3667 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3668 on IEEE hosts.
3669 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3670 Ignore SIGPIPE unless batch.
3671 (emacs_backtrace): Output backtrace for the appropriate thread,
3672 which is not necessarily the main thread.
3673 * syssignal.h: Include <stdbool.h>.
3674 (emacs_raise): New macro.
3675 * xterm.c (x_connection_signal): Remove; no longer needed
3676 now that we use sigaction.
3677 (x_connection_closed): No need to mess with sigmask now.
3678 (x_initialize): No need to reset SIGPIPE handler here, since
3679 init_signals does this for us now.
3680
8f4635e9
JD
36812012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3682
3683 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 3684 background rect may be larger (Bug#12245).
8f4635e9 3685
3296976d
CY
36862012-09-23 Chong Yidong <cyd@gnu.org>
3687
3688 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3689
d41e491e
PE
36902012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3691
3692 * .gdbinit: Just stop at fatal_error_backtrace.
3693 See Stefan Monnier's request in
3694 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3695 Remove no-longer-used query of system type.
3696
c88b867f
CY
36972012-09-22 Chong Yidong <cyd@gnu.org>
3698
3699 * search.c (Freplace_match): Doc fix (Bug#12325).
3700
3701 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3702
3703 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3704 (Fline_end_position): Doc fix.
3705
3706 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3707
bb4d86b4
CY
37082012-09-22 Chong Yidong <cyd@gnu.org>
3709
3710 * dispextern.h (struct image_type): Add new slot, storing a type
3711 initialization function.
3712
3713 * image.c (define_image_type): Call the image initializer function
3714 if it is defined. Arguments and return value changed.
3715 (valid_image_p, make_image): Callers changed.
3716 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
3717 (gif_type, imagemagick_type, svg_type, gs_type):
3718 Add initialization functions.
bb4d86b4
CY
3719 (Finit_image_library): Call lookup_image_type.
3720 (CHECK_LIB_AVAILABLE): Macro deleted.
3721 (lookup_image_type): Call define_image_type here, rather than via
3722 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3723 (syms_of_image): Move define_image_type calls for xbm_type and
3724 pbm_type to lookup_image_type.
3725
df9685f3
EZ
37262012-09-22 Eli Zaretskii <eliz@gnu.org>
3727
3728 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3729 'idle_timers' from here ...
3730 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3731 lists, to avoid infloops when the timer does something stupid,
3732 like reinvoke itself with the same or smaller time-out.
3733 (Bug#12447)
3734
8e17c9ba
MR
37352012-09-22 Martin Rudalics <rudalics@gmx.at>
3736
3737 * window.c (Fsplit_window_internal): Handle only Qt value of
3738 Vwindow_combination_limit separately.
3739 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
3740 (Vwindow_combination_limit): New default value.
3741 Rewrite doc-string.
8e17c9ba 3742
589bd69b
EZ
37432012-09-22 Eli Zaretskii <eliz@gnu.org>
3744
3745 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3746 the new overlay string. (Bug#10159)
3747
01108e3f
PE
37482012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3749
3750 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3751 or that fprintf is async-signal-safe. POSIX doesn't require
3752 either assumption.
3753
82f8cd94
CY
37542012-09-22 Chong Yidong <cyd@gnu.org>
3755
3756 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3757 (Bug#8207).
3758
3cccbd87
KH
37592012-09-22 Kenichi Handa <handa@gnu.org>
3760
3761 * composite.c (composition_reseat_it): Handle the case that a
3762 grapheme cluster is not covered by a single font (Bug#12352).
3763
09c01941
CY
37642012-09-21 Chong Yidong <cyd@gnu.org>
3765
3766 * image.c (define_image_type): Avoid adding duplicate types to
3767 image_types (Bug#12463). Suggested by Jörg Walter.
3768
acfa068f 37692012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
3770
3771 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3772 (print_load_command_name): Add case LC_DATA_IN_CODE.
3773 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3774
acfa068f 37752012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
3776
3777 * eval.c (Frun_hook_with_args_until_success)
3778 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3779
acfa068f 37802012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
3781
3782 * fileio.c (Ffile_selinux_context): Only call freecon when
3783 lgetfilecon succeeded.
3784 (Fset_file_selinux_context): Likewise. (Bug#12444)
3785
acfa068f 37862012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
3787
3788 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3789 reordering, locate the cursor by calling set_cursor_from_row; if
3790 that fails, clear the desired glyph matrix before returning a
3791 failure indication to the caller. Fixes leaving garbled display
3792 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
3793 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3794 scrolling through multibyte text.
aa36e4d2 3795
e99f70c8
SM
37962012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3797
3798 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3799 calling mark_vectorlike since that's the one that marks the window.
3800 (mark_discard_killed_buffers): Mark the final cdr.
3801 * window.h (struct window): Move prev/next_buffers to the
3802 non-standard fields.
3803 * window.c (make_window): Initialize prev/next_buffers manually.
3804
f75beb47
PE
38052012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3806
3807 Omit unused arg EXPECTED from socket hooks.
3808 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3809 * nsterm.m (ns_term_init):
3810 * termhooks.h (struct terminal.read_socket_hook):
3811 * w32inevt.c (w32_console_read_socket):
3812 * w32term.c (w32_read_socket):
3813 * xterm.c (XTread_socket):
3814 Omit unused arg EXPECTED. All callers changed.
3815 (store_user_signal_events): Return void, not int, since callers no
3816 longer care about the return value. All uses changed.
3817
b019b76a
JB
38182012-09-20 Juanma Barranquero <lekktu@gmail.com>
3819
3820 * w32gui.h (XParseGeometry): Do not declare.
3821
05642592
PE
38222012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3823
e4bce92a 3824 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 3825 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
3826 <http://bugs.gnu.org/12471#8> (last line).
3827
05642592
PE
3828 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3829 (XParseGeometry): Now static. Substitute extremal values for
3830 values that are out of range.
3831
e543ae91
JD
38322012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3833
3834 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3835
3836 * nsfns.m (XParseGeometry): Remove.
3837 (Fx_create_frame): Call x_set_offset to correctly interpret
3838 top_pos in geometry.
3839
3a880af4 3840 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
3841 (Fx_parse_geometry): If there is a space in string, call
3842 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3843
45ba16c7
EZ
38442012-09-17 Eli Zaretskii <eliz@gnu.org>
3845
c8b9f1bc
EZ
3846 * search.c (scan_buffer): Use character positions in calls to
3847 region_cache_forward and region_cache_backward, not byte
3848 positions. (Bug#12196)
3849
b4c932a2
EZ
3850 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3851 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3852
45ba16c7
EZ
3853 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3854 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3855 emacs_blocked_malloc, now deleted.
3856
eeceac93
PE
38572012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3858
3859 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3860 The workaround was for improving performance on Solaris 2.4, but
3861 is getting in the way now. Emacs will still work if someone is
3862 still running Solaris 2.4 in a museum somewhere; Sun dropped
3863 support for Solaris 2.4 in 2003.
3864 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3865 * process.c (create_process) [HAVE_WORKING_VFORK]:
3866 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3867 since Emacs no longer uses vfork on that platform.
3868
78f83752
GM
38692012-09-17 Glenn Morris <rgm@gnu.org>
3870
3871 * emacs.c: Use COPYRIGHT.
3872
634b8cac
PE
38732012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3874
0caaedb1
PE
3875 Remove configure's --without-sync-input option (Bug#12450).
3876 When auditing signal-handling in preparation for cleaning it up,
3877 I found that SYNC_INPUT has race conditions and would be a real
3878 pain to fix. Since it's an undocumented and deprecated
3879 configure-time option, now seems like a good time to remove it.
3880 Also see <http://bugs.gnu.org/11080#16>.
3881 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3882 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3883 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3884 (malloc_hysteresis):
3885 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3886 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3887 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3888 (dont_register_blocks, bytes_used_when_reconsidered)
3889 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3890 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3891 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 3892 Remove. All uses removed.
0caaedb1
PE
3893 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3894 implementation, one that depends on whether the new macro
3895 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3896 is defined.
3897 * atimer.c (run_timers, handle_alarm_signal):
3898 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3899 (handle_async_input, process_pending_signals)
3900 (handle_input_available_signal, init_keyboard):
3901 * nsterm.m (ns_read_socket):
3902 * process.c (wait_reading_process_output):
3903 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3904 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3905 (emacs_write):
3906 * xterm.c (XTread_socket):
3907 Assume SYNC_INPUT.
3908 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3909 * eval.c (handling_signal): Remove. All uses removed.
3910 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3911 All uses replaced with the SYNC_INPUT version.
3912 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3913 Remove decls.
3914 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3915 Now static.
3916
634b8cac
PE
3917 * font.c (Ffont_shape_gstring): Remove unused local.
3918
83da1b55
GM
39192012-09-16 Glenn Morris <rgm@gnu.org>
3920
518650a5
GM
3921 * Makefile.in (clean): No longer run nextstep's clean.
3922
83da1b55
GM
3923 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3924 (ns_frag): Remove.
3925 (ns-app): Move here from ns.mk, and simplify.
3926 (clean): Simplify nextstep entry.
3927 * ns.mk: Remove file.
3928
85a43e2e
KH
39292012-09-17 Kenichi Handa <handa@gnu.org>
3930
3931 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3932 not covert the last few charactes.
3933
ba13e616 39342012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
3935
3936 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3937 here, but just check the validity of glyphs in the glyph-string.
3938
a8c729af
MR
39392012-09-16 Martin Rudalics <rudalics@gmx.at>
3940
3a880af4
SM
3941 * window.c (Fwindow_parameter, Fset_window_parameter):
3942 Accept any window as argument (Bug#12452).
a8c729af 3943
c077c059
JD
39442012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3945
3946 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3947 to ns_term_init to avoid memory leak.
3948
3949 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3950 explicit retain/release.
3951 (ns_term_init): Only allow one display. Initialize outerpool and
3952 ns_*_types.
3953
39a57ad0
PE
39542012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3955
3956 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3957 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3958 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3959 the Microsoft problem in a different way, by altering ../nt/config.nt.
3960
7105c8cb
EZ
39612012-09-15 Eli Zaretskii <eliz@gnu.org>
3962
3963 * w32xfns.c:
3964 * w32uniscribe.c:
3965 * w32term.c:
3966 * w32select.c:
3967 * w32reg.c:
3968 * w32proc.c:
3969 * w32menu.c:
3970 * w32inevt.c:
3971 * w32heap.c:
3972 * w32font.c:
3973 * w32fns.c:
3974 * w32console.c:
3975 * w32.c:
3976 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3977 by lisp.h. This completes removal of setjmp.h inclusion
3978 erroneously announced in the previous commit. (Bug#12446)
3979
3980 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3981 more accurate.
3982
3983 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3984 not defined as a macro. The latter happens on MS-Windows.
3985 (Bug#12446)
3986
0328b6de
PE
39872012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3988
3989 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3990 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 3991 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
3992 only reason for the instance was because "lisp.h" was included.
3993 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3994 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3995 and _longjmp with the new symbols. Emacs already uses _setjmp if
3996 available, so this change affects only POSIXish hosts that have
3997 sigsetjmp but not _setjmp, such as some versions of Solaris and
3998 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3999 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
4000 (png_load_body) [HAVE_PNG]:
4001 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
4002 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
4003 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
4004 since PNG requires jmp_buf. This is the only exception to the
4005 general rule that we now use sys_setjmp and sys_longjmp.
4006 This exception is OK since this code does not change the signal
4007 mask or longjmp out of a signal handler.
4008
2af03429
PE
40092012-09-14 Paul Eggert <eggert@cs.ucla.edu>
4010
4011 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4012 Include "syssignal.h", for 'main_thread'.
4013
2f294edf
DA
40142012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
4015
4016 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
4017 * insdel.c (replace_range, replace_range_2):
4018 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
4019 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
4020 Remove redundant check before calling offset_intervals.
4021
6b533e9c
MR
40222012-09-14 Martin Rudalics <rudalics@gmx.at>
4023
4024 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
4025 current buffer (Bug#12387).
4026
2a7931e3
JB
40272012-09-14 Juanma Barranquero <lekktu@gmail.com>
4028
4029 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
4030
c18e885b
PE
40312012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4032
4033 Use a more backwards-compatible timer format (Bug#12430).
4034 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
4035 vector element, not from the 4th, since PSECS is now at the end.
4036 (Fcurrent_idle_time): Doc fix.
4037
d59a1afb
DA
40382012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
4039
4040 Function to mark objects and remove killed buffers at once.
4041 * alloc.c (discard_killed_buffers): Rename to ...
4042 (mark_discard_killed buffers) ... new name. Add marking
4043 of remaining objects. Fix comment. Adjust users.
4044 (mark_object): Do not touch frame buffer lists here.
4045 * frame.c (delete_frame): Reset frame buffer lists here.
4046
5f0cb45a
PE
40472012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4048
8ea47e3a
PE
4049 Better workaround for GNOME bug when --enable-gcc-warnings.
4050 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
4051 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
4052 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
4053
4a4bbad2
PE
4054 Simplify SIGIO usage (Bug#12408).
4055 The code that dealt with SIGIO was crufty and confusing, e.g., it
4056 played tricks like "#undef SIGIO" but these tricks were not used
4057 consistently. Simplify mostly by not #undeffing standard symbols,
4058 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
4059 or not as we please) rather than "defined SIGIO" (standard symbol
4060 that we probably shouldn't #undef).
4061 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
4062 Modules that need it can include it.
4063 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
4064 * dispextern.h (ignore_sigio): New decl.
4065 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
4066 unconditionally, since it's now a no-op if !USABLE_SIGIO.
4067 * emacs.c (shut_down_emacs):
4068 * keyboard.c (kbd_buffer_store_event_hold):
4069 Use ignore_sigio rather than invoking 'signal' directly.
4070 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
4071 for FIONREAD.
4072 (FIONREAD, SIGIO): Do not #undef.
4073 (tty_read_avail_input): Use #error rather than a syntax error.
4074 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
4075 for I_PIPE, used by SETUP_SLAVE_PTY.
4076 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
4077 * sysdep.c (croak): Remove; no longer needed. This bit of
4078 temporary code, with Fred N. Fish's comment that it's temporary,
4079 has been in Emacs since at least 1992!
4080 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
4081 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
4082 * syssignal.h (croak): Remove decl.
4083 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
4084 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
4085 now that we're termios-only.
4086 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
4087 * term.c (dissociate_if_controlling_tty): Use #error rather than
4088 a run-time error.
4089
5f0cb45a
PE
4090 Work around GCC and GNOME bugs when --enable-gcc-warnings.
4091 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
4092 to work around GNOME bug 683906.
4093 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
4094 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
4095 This works around GCC bug 54561.
4096
40bce90b
PE
40972012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4098
4099 More fixes for 'volatile' and setjmp/longjmp.
4100 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
4101 * image.c (struct png_load_context) [HAVE_PNG]: New type.
4102 (png_load_body) [HAVE_PNG]:
4103 (jpeg_load_body) [HAVE_JPEG]:
4104 New function, with most of the old parent function's body.
4105 (png_load) [HAVE_PNG]:
4106 (jpeg_load) [HAVE_JPEG]:
4107 Invoke the new function, to avoid longjmp munging our locals.
4108 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
4109 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
4110 longjmp is passed 2, as the C standard doesn't guarantee this.
4111 Instead, store the failure code into mgr->failure_code.
4112
bfeae2cf
SM
41132012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4114
4115 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
4116 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
4117 (syms_of_keyboard): Remove support for unread-command-char.
4118
8099e36b
EZ
41192012-09-12 Eli Zaretskii <eliz@gnu.org>
4120
4121 * w32proc.c (sys_kill): If PID is our process ID and the signal is
4122 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
4123 violation. (Bug#12426)
4124
92547ff9
PE
41252012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4126
4127 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
4128
45b82ad0
SM
41292012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4130
4131 * eval.c: Add `inhibit-debugger'.
4132 (Qinhibit_debugger): New symbol.
4133 (call_debugger): Bind it instead of Qdebug_on_error.
4134 (maybe_call_debugger): Test Vinhibit_debugger.
4135 (syms_of_eval): Define inhibit-debugger.
4136 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
4137 (syms_of_xdisp): Remove inhibit-debug-on-message.
4138
5779a1dc
PE
41392012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4140
50f2e553
PE
4141 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
4142 If a nonvolatile local variable is written before a _longjmp to
4143 the frame containing the variable, and is read after the _longjmp,
4144 the value read is indeterminate. Some local variables of type
4145 'struct handler' and 'struct catchtag' are used in this way, so
4146 mark each of their slots as volatile if the slot can be set before
4147 _longjmp and read afterwards.
4148 * lisp.h (struct handler): var and chosen_clause are now volatile.
4149 (struct catchtag): val, next, and pdlcount are now volatile.
4150
ae1d87e2
PE
4151 * bidi.c (bidi_push_it, bidi_pop_it):
4152 * fns.c (copy_hash_table):
4153 * image.c (define_image_type):
4154 * keyboard.c (kbd_buffer_store_event_hold):
4155 * process.c (Fprocess_send_eof):
4156 * xfaces.c (x_create_gc) [HAVE_NS]:
4157 * xgselect.c (xg_select):
4158 Prefer assignment to memcpy when either will do.
4159
5779a1dc
PE
4160 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
4161 Use pointer-to-a-pointer to simplify and avoid a NILP check each
4162 time an item is removed. No need to mark this function 'inline';
4163 the compiler knows better than we do.
4164
c4c9756b
JD
41652012-09-11 Jan Djärv <jan.h.d@swipnet.se>
4166
4167 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
4168 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
4169 to change_frame_size (Bug#12388).
4170 (windowDidResize:): Pass YES to updateFrameSize.
4171
4172 * nsterm.h: Add delay parameter to updateFrameSize.
4173
d73e321c
DA
41742012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4175
4176 Discard killed buffers from deleted window and frame objects.
4177 This reduces an amount of references to killed buffers and
4178 helps GC to reclaim them faster.
4179 * alloc.c (discard_killed_buffers): New function.
4180 (mark_object): Use it for deleted windows and frames.
4181 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 4182 or deleted frame, restore its global binding.
d73e321c
DA
4183 * data.c (swap_in_global_binding): Add GC notice.
4184 (swap_in_symval_forwarding): Use convenient set_blv_where.
4185 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
4186 * window.h: ... to here.
4187
e578f381
DA
41882012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4189
4190 Convenient macro to check whether the buffer is live.
4191 * buffer.h (BUFFER_LIVE_P): New macro.
4192 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
4193 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
4194
3057e615
YM
41952012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4196
4197 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
4198 composition cases (Bug#12364).
4199
4200 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
4201 overhang of succeeding glyphs overlapping box cursor.
4202
4203 * w32term.c (x_draw_glyph_string): Likewise.
4204
6fda35f2
PE
42052012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4206
c990426a
PE
4207 Simplify, document, and port floating-point (Bug#12381).
4208 The porting part of this patch fixes bugs on non-IEEE platforms
4209 with frexp, ldexp, logb.
4210 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
4211 Now static.
4212 * floatfns.c: Simplify discussion of functions that Emacs doesn't
4213 support, by removing commented-out code and briefly listing the
4214 C89 functions excluded. The commented-out stuff was confusing
4215 maintenance, e.g., we thought we needed cbrt but it was commented out.
4216 (logb): Remove decl; no longer needed.
4217 (isfinite): New macro, if not already supplied.
4218 (isnan): Don't replace any existing macro.
4219 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
4220 are present on all C89 platforms.
4221 (Ffrexp): Do not special-case zero, as frexp does the right thing
4222 for that case.
4223 (Flogb): Do not use logb, as it doesn't have the desired meaning
4224 on hosts that use non-base-2 floating point. Instead, stick with
4225 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
4226 frexp, to avoid getting an unspecified result.
4227
6fda35f2
PE
4228 * xdisp.c (Qinhibit_debug_on_message): Now static.
4229
16130a58
JD
42302012-09-10 Jan Djärv <jan.h.d@swipnet.se>
4231
4232 * nsterm.m (ns_update_begin): Set clip path to whole view by using
4233 NSBezierPath (Bug#12131).
4234
d105a573
CY
42352012-09-10 Chong Yidong <cyd@gnu.org>
4236
4237 * fns.c (Fdelq, Fdelete): Doc fix.
4238
ff55dfe8
PE
42392012-09-10 Paul Eggert <eggert@cs.ucla.edu>
4240
4241 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
4242 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
4243
e7032e7c
SM
42442012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
4245
4246 * lisp.h (make_lisp_ptr): New macro to replace XSET.
4247 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
4248 Use it.
4249
e9957956
EZ
42502012-09-09 Eli Zaretskii <eliz@gnu.org>
4251
aba05ce9
EZ
4252 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
4253 left fringe if the window has a left margin. This avoids leaving
4254 traces of the cursor because its leftmost pixel is not drawn over.
4255
e9957956
EZ
4256 * dispnew.c (update_window_line): When the left margin area of a
4257 screen line is updated, set the redraw_fringe_bitmaps_p flag of
4258 that screen line. (Bug#12277)
4259
f6196b87
PE
42602012-09-09 Paul Eggert <eggert@cs.ucla.edu>
4261
4262 Assume C89 or later for math functions (Bug#12381).
4263 This simplifies the code, and makes it a bit smaller and faster,
4264 and (most important) makes it easier to clean up signal handling
4265 since we can stop worring about floating-point exceptions in
4266 library code. That was a problem before C89, but the problem
4267 went away many years ago on all practical Emacs targets.
4268 * data.c, image.c, lread.c, print.c:
4269 Don't include <math.h>; no longer needed.
4270 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
4271 might be autoconfigured, as that never happens.
4272 * data.c (fmod):
4273 * doprnt.c (DBL_MAX_10_EXP):
4274 * print.c (DBL_DIG):
4275 Remove. C89 or later always defines these.
4276 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
4277 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
4278 (arith_error, domain_error, domain_error2):
4279 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
4280 no longer needed -- we simply return what C returns. All uses removed.
4281 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
4282 the wrapped code.
4283 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
4284 Remove. All uses expanded, as these macros are no longer used
4285 more than once and are now more trouble than they're worth.
4286 (Ftan): Use tan, not sin / cos.
4287 (Flogb): Assume C89 frexp.
4288 (fmod_float): Assume C89 fmod.
4289 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
4290 (init_floatfns): Remove. All uses removed.
4291
9d7f1863
JD
42922012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4293
4294 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4295 compositeToPoint for OSX < 10.6 (Bug#12390).
4296
eabf0404
PE
42972012-09-08 Paul Eggert <eggert@cs.ucla.edu>
4298
4299 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4300 This produces more-accurate results.
4301
0b3b1d23
JD
43022012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4303
4304 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
4305 changes (Bug#12088).
4306
6dcef6ec
CY
43072012-09-08 Chong Yidong <cyd@gnu.org>
4308
4309 * syntax.c (Fstring_to_syntax): Doc fix.
4310
aa7d57c5
JD
43112012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4312
4313 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
4314 in the internal border.
4315 (x_set_window_size): Remove static variables and their usage.
4316 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
4317 (ns_after_update_window_line, ns_draw_fringe_bitmap):
4318 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
4319 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
4320 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
4321 (ns_fix_rect_ibw): Remove.
4322 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
4323 (ns_dumpglyphs_box_or_relief): Ditto.
4324 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
4325 adjustment.
4326 (ns_dumpglyphs_image): Ditto.
fc0c31f8 4327 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
4328 border adjustment.
4329 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
4330 their usage. Add fringe_extended_p and its use as in other terms.
4331 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
4332 scroll bar was removed.
4333 (updateFrameSize): New function.
4334 (windowDidResize): Move code to updateFrameSize and call it.
4335
4336 * nsterm.h (EmacsView): Add updateFrameSize.
4337
1a5432bc
CY
43382012-09-07 Chong Yidong <cyd@gnu.org>
4339
b4f5313e
CY
4340 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
4341
1a5432bc
CY
4342 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4343
1a4f1e9b
PE
43442012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4345
4346 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
4347 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
4348 Problem introduced when merging patches. Noted by Eli Zaretskii in
4349 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
4350 * floatfns.c: Comment fix.
4351 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
4352 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
4353 and anyway the declaration is harmless even if SIGDANGER is not defined.
4354 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
4355 defined BROKEN_FIONREAD). systty.h formerly did this, but other
4356 source files not surprisingly expected syssignal.h to define, or
4357 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4358 Include <sys/ioctl.h>, for FIONREAD.
4359 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4360 This eliminates a problem whereby other files mysteriously had
4361 to include "syssignal.h" before including "systty.h" if they
4362 wanted to use "#ifdef SIGIO".
4363
bc8000ff
EZ
43642012-09-07 Eli Zaretskii <eliz@gnu.org>
4365
3e6d6928
EZ
4366 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4367
4368 * w32.c (sigemptyset): Empty the set.
4369 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4370
bc8000ff
EZ
4371 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4372
b4fa72f2
DA
43732012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4374
4375 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4376 (mark_object): Likewise for frame objects.
4377
30730c93
PE
43782012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4379
4380 * syssignal.h (handle_on_main_thread): Always declare,
4381 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4382 This ports to platforms without HAVE_PTHREAD.
4383
2fe28299
PE
43842012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4385
4386 Signal-handler cleanup (Bug#12327).
4387 Emacs's signal handlers were written in the old 4.2BSD style with
4388 sigblock and sigmask and so forth, and this led to some
4389 inefficiencies and confusion. Rewrite these to use
4390 pthread_sigmask etc. without copying signal sets around. Also,
4391 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4392 'signal', and instead use functions that do not attempt to take
4393 over the system name space. This patch causes Emacs's text
4394 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4395 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4396 Do not include <signal.h> or "syssignal.h", as these
4397 modules do not use signals.
4398 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4399 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4400 Do not include <signal.h>, as "syssignal.h" does that for us now.
4401 * atimer.c (sigmask_atimers): New function.
4402 (block_atimers, unblock_atimers): New functions,
4403 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4404 All uses replaced.
4405 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4406 no longer needed here.
4407 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 4408 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
4409 * sysdep.c (struct save_signal): New member 'action', replacing
4410 old member 'handler'.
4411 (save_signal_handlers, restore_signal_handlers):
4412 Use sigaction instead of 'signal' to save and restore.
4413 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4414 New function. All users of 'signal' modified to use set_sighandler
4415 if they're writeonly, and to use sys_signal if they're read+write.
4416 (emacs_sigaction_init, forwarded_signal): New functions.
4417 (sys_signal): Remove. All uses replaced by calls to sigaction
4418 and emacs_sigaction_init, or by direct calls to 'signal'.
4419 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4420 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4421 all uses replaced by pthread_sigmask etc. calls.
4422 * syssignal.h: Include <signal.h>.
4423 (emacs_sigaction_init, forwarded_signal): New decls.
4424 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4425 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4426 (sigmask, sys_sigmask): Remove; no longer needed.
4427 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4428 (sigblock, sigunblock, sigfree):
4429 (sigsetmask) [!defined sigsetmask]:
4430 Remove. All uses replaced by pthread_sigmask.
4431 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4432 no longer need to be replaced, and its typical old uses
4433 are now done via emacs_sigaction_init and sigaction.
4434 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4435 (sys_sigdel): Remove; unused.
4436 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4437
0216c128
EZ
44382012-09-06 Eli Zaretskii <eliz@gnu.org>
4439
4440 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4441 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4442
c752cfa9
DA
44432012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4444
4445 Explicitly mark buffer_defaults and buffer_local_symbols.
4446 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4447 mark_local_symbols here.
4448 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4449 since special buffers aren't marked here any more.
4450 (allocate_buffer): Chain new buffer with all_buffers here...
4451 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4452 not here.
4453 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4454 (syms_of_buffer): Remove staticpro of the above.
4455 (init_buffer_once): Set names for buffer_defaults and
4456 buffer_local_symbols.
4457
a864ef14
PE
44582012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4459
4460 Use bool for booleans in font-related modules.
4461 * font.c (font_intern_prop, font_style_to_value)
4462 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4463 (generate_otf_features, font_check_otf_features, font_check_otf)
4464 (font_match_p, font_list_entities, font_at):
4465 * fontset.c (fontset_id_valid_p, reorder_font_vector
4466 (fontset_find_font, Fset_fontset_font)
4467 (face_suitable_for_char_p) [0]:
4468 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4469 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4470 (m17n_flt_initialized, ftfont_shape_by_flt):
4471 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4472 * nsfont.m (nsfont_draw):
4473 * w32font.c (w32font_draw):
4474 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4475 Use bool for booleans.
4476 * font.h: Adjust to above API changes.
4477 (struct font, struct font_driver, struct font_driver_list):
4478 Use bool for booleans.
4479 (struct font): Remove useless member encoding_type.
4480 All users removed.
4481 * fontset.c, xftfont.c: Omit unnecessary static decls.
4482
0699fc18
DA
44832012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4484
4485 * alloc.c (mark_object): Revert window marking code
4486 since it's unsafe for the Fset_window_configuration.
4487
20ef56db
PE
44882012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4489
2fe28299 4490 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
4491 Be more systematic about preserving errno whenever a signal
4492 handler returns, even if it's not in the main thread. Do this by
4493 renaming signal handlers to distinguish between signal delivery
4494 and signal handling. All uses changed.
4495 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4496 * data.c (deliver_arith_signal): Rename from arith_error.
4497 * dispnew.c (deliver_window_change_signal): Rename from
4498 window_change_signal.
4499 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4500 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4501 * keyboard.c (deliver_input_available_signal): Rename from
4502 input_available_signal.
4503 (deliver_user_signal): Rename from handle_user_signal.
4504 (deliver_interrupt_signal): Rename from interrupt_signal.
4505 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4506 (deliver_child_signal): Rename from sigchld_handler.
4507 * atimer.c (handle_alarm_signal):
4508 * data.c (handle_arith_signal):
4509 * dispnew.c (handle_window_change_signal):
4510 * emacs.c (handle_fatal_signal, handle_danger_signal):
4511 * keyboard.c (handle_input_available_signal):
4512 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4513 * process.c (handle_pipe_signal, handle_child_signal):
4514 New functions, with the actual signal-handling code taken from the
4515 original respective signal handlers, sans the sporadic attempts to
4516 preserve errno, since that's now done by handle_on_main_thread.
4517 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4518 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4519 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4520 Move to sysdep.c.
4521 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4522 Move initialization of main_thread to sysdep.c's init_signals.
4523 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4524 our usage, and simplifies the mainline code.
4525 (record_child_status_change): New static function, as a helper
4526 for handle_child_signal, and with most of the old child handler's
4527 contents.
4528 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4529 (handle_child_signal): Use the above.
4530 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4531 Moved here from emacs.c.
4532 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4533 code moved here from emacs.c's main function.
4534 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
4535 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4536 This lets callers save and restore errno properly.
20ef56db 4537
e3ccf108
DA
45382012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4539
4540 Remove redundant or unused things here and there.
4541 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4542 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4543 * editfns.c (Fcompare_buffer_substrings): Likewise.
4544 * frame.h (struct terminal, struct font_driver_list):
4545 Remove redundant declarations.
4546 * window.h (Qleft, Qright): Likewise.
4547
697e1e39
DA
45482012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4549
4550 Do not mark objects from deleted buffers, windows and frames.
4551 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4552 (mark_object): Likewise for windows and frames.
4553
c1ca42ca
DA
45542012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4555
4556 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4557 buffer_defaults and buffer_local_symbols as valid objects.
4558 Return special value to denote them.
4559
014d93be
PE
45602012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4561
f75d7a91
PE
4562 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4563 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4564 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4565 (file_name_absolute_p, Fsubstitute_in_file_name):
4566 (check_executable, check_writable, Ffile_accessible_directory_p)
4567 (Fset_file_selinux_context, Fdefault_file_modes)
4568 (Finsert_file_contents, choose_write_coding_system)
4569 (Fwrite_region, build_annotations, a_write, e_write)
4570 (Fdo_auto_save):
4571 * filelock.c (boot_time_initialized, get_boot_time)
4572 (get_boot_time_1, lock_file_1, within_one_second):
4573 * floatfns.c (in_float):
4574 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4575 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4576 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4577 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4578 * window.c (compare_window_configurations):
4579 Use bool for booleans.
4580 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4581 (Fdefault_file_modes): Now mode_t, not int, for modes.
4582 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4583 (internal_delete_file): Now returns void, not a (boolean) int,
4584 since nobody was looking at the return value.
4585 * lisp.h, window.h: Adjust to above API changes.
4586
014d93be
PE
4587 * xdisp.c (set_message): Simplify and reindent last change.
4588
776f29e1
JB
45892012-09-05 Juanma Barranquero <lekktu@gmail.com>
4590
4591 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4592
7f7e0167
LI
45932012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4594
4595 * eval.c (call_debugger): Make the function non-static so that we
4596 can call it from set_message.
4597
4598 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4599 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4600
cf29dd84
PE
46012012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4602
4603 Give more-useful info on a fatal error (Bug#12328).
4604 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4605 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4606 of doing the work ourselves.
4607 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4608 do most of the work.
4609 (fatal_error_backtrace): New function, taken from the guts
4610 of the old fatal_error_signal, but with a new option to output
4611 a backtrace.
4612 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4613 info about the signal than just its number.
4614 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4615 * sysdep.c: Include <execinfo.h>
4616 (emacs_backtrace): New function, taken partly from the previous
4617 code of the 'die' function.
4618 (emacs_abort): Call fatal_error_backtrace rather than abort.
4619
972debf2
SM
46202012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4621
4622 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4623 eager (load-time) macro-expansion.
4624 * lisp.mk (lisp): Add macroexp.
4625
1088b922
PE
46262012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4627
4628 Simplify redefinition of 'abort' (Bug#12316).
4629 Do not try to redefine the 'abort' function. Instead, redo
4630 the code so that it calls 'emacs_abort' rather than 'abort'.
4631 This removes the need for the NO_ABORT configure-time macro
4632 and makes it easier to change the abort code to do a backtrace.
4633 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4634 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4635 Remove; sysdep.c's emacs_abort now takes its place.
4636 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4637 'abort' changed to use 'emacs_abort'.
4638 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4639 (abort) [!defined abort]: Rename to ...
4640 (emacs_abort): ... new name.
4641 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4642 the place of the old 'abort' in emacs.c.
4643 * w32.c, w32fns.c (abort): Do not #undef.
4644 * w32.c (emacs_abort): Rename from w32_abort.
4645
30934d33
EZ
46462012-09-04 Eli Zaretskii <eliz@gnu.org>
4647
4648 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4649 offsets[j].dv, since the y axis of the screen coordinates points
4650 down, while the y axis of the font definition coordinates points
4651 up. This fixes display of Arabic diacritics such as KASRA and
4652 KASRATAN. (Bug#11860)
4653
af26b72c
PE
46542012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4655
4656 Be more systematic about _setjmp vs setjmp.
4657 * alloc.c (test_setjmp, mark_stack):
4658 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4659 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4660 (png_load, my_error_exit, jpeg_load):
4661 * process.c (send_process_trap, send_process):
4662 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4663 The underscored versions are up to 30x faster on some hosts.
4664 Formerly, the code used setjmp+longjmp sometimes and
4665 _setjmp+_longjmp at other times, with no particular reason to
4666 prefer setjmp+longjmp.
4667
26d4541d
PE
46682012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4669
d42f4f0f 4670 Fix minor problem found by static checking.
26d4541d 4671 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 4672
c5e28e39
MR
46732012-09-03 Martin Rudalics <rudalics@gmx.at>
4674
4675 * buffer.c (Fdelete_all_overlays): New function.
4676
3eab3ca9
CY
46772012-09-03 Chong Yidong <cyd@gnu.org>
4678
4679 * gtkutil.c: Add extern decl for Qxft.
4680
c04889f8
PE
46812012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4682
1882aa38
PE
4683 * emacs.c, eval.c: Use bool for boolean.
4684 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4685 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4686 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4687 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4688 (main, decode_env_path, Fdaemon_initialized):
4689 * eval.c (call_debugger, Finteractive_p, interactive_p):
4690 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4691 (maybe_call_debugger, Fbacktrace):
4692 * process.c (read_process_output, exec_sentinel):
4693 Use bool for booleans.
4694 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4695 All callers changed.
4696 * eval.c (interactive_p): Omit always-true boolean argument
4697 EXCLUDE_SUBRS_P. All callers changed.
4698 * dispextern.h, lisp.h: Reflect above API changes.
4699 * firstfile.c (dummy): Use the address of 'main', whose signature
4700 won't change, instead of the address of 'initialize', whose
4701 signature just changed from int to bool.
4702 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4703 * msdos.c (fatal_error_in_progress): ... from here.
4704 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4705 of incrementing it.
4706 (redisplay_internal, unwind_redisplay): Simply clear
4707 REDISPLAYING_P when unwinding, instead of saving its previous,
4708 always-false value and then restoring it.
4709
a411ac43
PE
4710 Clean up some extern decls.
4711 Mostly, this hoists extern decls out of .c files and into .h files.
4712 That way, we're more likely to catch errors if the interfaces change.
4713 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4714 declare xg_mark_data.
4715 * dispextern.h (x_frame_parm_handlers):
4716 * font.h (Qxft):
4717 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4718 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4719 (Qultra_bold, Qoblique, Qitalic):
4720 Move extern decl here from .c file.
4721 * alloc.c (xg_mark_data) [USE_GTK]:
4722 * doc.c (Qclosure):
4723 * eval.c (Qlexical_binding):
4724 * fns.c (time) [!HAVE_UNISTD_H]:
4725 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4726 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4727 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4728 * lread.c (Qinternal_interpreter_environment):
4729 * minibuf.c (Qbuffer):
4730 * process.c (QCfamily, QCfilter):
4731 * widget.c (free_frame_faces):
4732 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4733 * xfont.c (x_clear_errors):
4734 * xterm.c (x_frame_parm_handlers):
4735 Remove now-redundant extern decls.
4736 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4737 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4738 Now static.
4739 * xfaces.c: Remove unnecessary static decls.
4740 * xterm.c (updating_frame): Remove decl of nonexistent object.
4741
c04889f8
PE
4742 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4743 when building globals.h, as the objects that are not built on
4744 this host are not needed to compile C files on this host.
4745
8b339673
JD
47462012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4747
4748 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4749
4750 * frame.h: Add missing prototype for x_wm_set_size_hint.
4751
a08d4ba7
PE
47522012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4753
4754 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4755 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4756 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4757 (Fsubstitute_command_keys):
4758 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4759 (save_excursion_save, save_excursion_restore)
4760 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4761 (format_time_string, general_insert_function)
4762 (make_buffer_string, make_buffer_string_both)
4763 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4764 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4765 (copy_text, insert_1, insert_1_both, insert_from_string)
4766 (insert_from_string_before_markers, insert_from_string_1)
4767 (insert_from_buffer, insert_from_buffer_1, replace_range)
4768 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4769 (del_range_2, modify_region):
4770 * intervals.c (intervals_equal, balance_possible_root_interval)
4771 (adjust_intervals_for_insertion, merge_properties_sticky)
4772 (graft_intervals_into_buffer, lookup_char_property)
4773 (adjust_for_invis_intang, set_point_both)
4774 (get_property_and_range, compare_string_intervals)
4775 (set_intervals_multibyte_1, set_intervals_multibyte):
4776 * keyboard.c (decode_timer):
4777 Use bool for boolean.
4778 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4779 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4780
48c948de
CY
47812012-09-02 Chong Yidong <cyd@gnu.org>
4782
4783 * keymap.c (push_key_description): Print M-TAB as C-M-i
4784 (Bug#11758).
4785
6c49a40b
JB
47862012-09-02 Juanma Barranquero <lekktu@gmail.com>
4787
4788 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4789 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4790 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4791 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4792 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4793 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4794 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4795
4dfbd238
EZ
47962012-09-01 Eli Zaretskii <eliz@gnu.org>
4797
7e510e28
EZ
4798 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4799 more than one grapheme cluster passed to the shaper: compute the
4800 offset adjustment values separately for each cluster. (Bug#11860)
4801
4dfbd238
EZ
4802 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4803 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4804 about implicit conversions from integer to pointer.
4805
86571ae0
DC
48062012-09-01 Daniel Colascione <dancol@dancol.org>
4807
4808 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4809 system used too early.
4810
0e23ef9d
PE
48112012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4812
4813 Better seed support for (random).
4814 * emacs.c (main): Call init_random.
4815 * fns.c (Frandom): Set the seed from a string argument, if given.
4816 Remove long-obsolete Gentzel cruft.
4817 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4818 (init_random): New function.
4819
17a2cbbd
DC
48202012-09-01 Daniel Colascione <dancol@dancol.org>
4821
4822 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4823 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4824 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4825 x_wm_set_size_hint, x_query_colors, x_real_positions,
4826 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4827 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4828 all of which have been moved to common code.
4829
4830 * xfaces.c: Include TERM_HEADER instead of listing all possible
4831 window-system headers.
4832
4833 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4834 to match header.
4835
4836 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4837 directly accessing frame internals.
4838
f18cbb28 4839 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
4840 globals_of_w32font.
4841
4842 * process.c: Include TERM_HEADER instead of listing all possible
4843 window-system headers.
4844
3a880af4
SM
4845 * nsterm.h: Remove declarations now in frame.h.
4846 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
4847
4848 * menu.c: Include TERM_HEADER instead of listing all possible
4849 window-system headers.
4850
4851 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4852 window system.
4853
4854 * keyboard.c: Include TERM_HEADER instead of listing all possible
4855 window-system headers.
4856
4857 * image.c: Include TERM_HEADER instead of listing all possible
4858 window-system headers. Declare Vlibrary_cache when compiling for
4859 Windows.
4860
4861 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4862 window system declarations.
4863
4864 * frame.h: Move common functions here: set_frame_menubar,
4865 x_set_window_size, x_sync, x_get_focus_frame,
4866 x_set_mouse_position, x_set_mouse_pixel_position,
4867 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4868 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4869 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4870 x_activate_menubar, x_real_positions, x_bitmap_icon,
4871 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4872 and x_query_colors.
4873
4874 * frame.c: Include TERM_HEADER instead of listing all possible
4875 window-system headers.
4876
4877 * font.c: Include TERM_HEADER instead of listing all possible
4878 window-system headers.
4879
4880 * emacs.c: Include TERM_HEADER.
4881
f18cbb28
EZ
4882 * dispnew.c: Include TERM_HEADER instead of listing all possible
4883 window-system headers.
17a2cbbd 4884
f18cbb28 4885 * ccl.h: Include character.h.
17a2cbbd
DC
4886
4887 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4888 the current window system; include in list of objects to link into
4889 Emacs.
4890
c650a5de
DA
48912012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4892
4893 Remove mark_ttys function and fix tty_display_info initialization.
4894 * lisp.h (mark_ttys): Remove prototype.
4895 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4896 to mark_ttys because all possible values of 'top_frame' slot are
4897 the frames which are reachable from Vframe_list.
4898 * term.c (mark_ttys): Remove.
4899 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4900
4e0f6479
DA
49012012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4902
4903 Change struct frame bitfields from unsigned char to unsigned.
4904 * frame.h (struct frame): Change type of 'display_preempted',
4905 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4906 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4907 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4908 bitfields from unsigned char to unsigned.
4909
8b96a52c
DA
49102012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4911
4912 Remove unused member of struct x_output and struct w32_output.
4913 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4914 * w32term.h (struct w32_output): Likewise.
4915
b4444c8a
JD
49162012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4917
4918 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4919 does not become zero (Bug#12234).
4920
b98521db
PE
49212012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4922
4923 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4924 for GCC 4.7.1 x86-64.
4925
31d02438
GM
49262012-08-30 Glenn Morris <rgm@gnu.org>
4927
4928 * lread.c (init_lread): For out-of-tree builds, only add the
4929 source directory's site-lisp dir to the load-path if it exists,
4930 consistent with in-tree builds. (Bug#12302)
4931
7f8941d8
JD
49322012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4933
4934 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 4935 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
4936 (windowShouldClose:): Set window_closed.
4937 (dealloc): New member, free button_values.
fc0c31f8
JB
4938 (process_dialog:): Make member function. Remove window argument,
4939 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
4940 in button_values.
4941 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 4942 with tag. Remove return self, declare return value as void.
7f8941d8
JD
4943 (addString:row:): Remove return self, declare return value as void.
4944 (addSplit): Remove return self, declare return value as void.
4945 (clicked:): Remove return self, declare return value as void.
fc0c31f8 4946 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
4947 (initFromContents:isQuestion:): Adjust call to process_dialog.
4948 Code formatting change.
4949 (timeout_handler:): Set timer_fired to YES.
4950 (runDialogAt:): Set timer_fired to NO.
4951 Handle click on close button as quit.
4952
4953 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4954 Add window_closed and button_values. Add void as return value for
4955 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4956 Add process_dialog as new member.
4957
eada0861 49582012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 4959
eada0861
GM
4960 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4961 is not one of the heaps we manage. (Bug#12242)
4962
49632012-08-28 Glenn Morris <rgm@gnu.org>
4964
4965 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4966
457294dd
MR
49672012-08-28 Martin Rudalics <rudalics@gmx.at>
4968
4969 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
4970 auto-buffer-name window parameter. Install revision of reverted
4971 fix.
457294dd 4972
4f2daf31
DA
49732012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4974
4975 Do not allow to set major mode for a dead buffer.
4976 * buffer.c (Fset_buffer_major_mode): Signal an error
4977 if the buffer is dead.
4978 (Fother_buffer, other_buffer_safely): Remove redundant
4979 nested declaration.
4980
66322887
DA
49812012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4982
4983 Always use set_buffer_if_live to restore original buffer at unwind.
4984 * buffer.h (record_unwind_current_buffer): New function.
4985 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4986 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4987 * undo.c, window.c: Adjust users.
4988 * buffer.c (set_buffer_if_live): Fix comment.
4989
a3d794a1
DA
49902012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4991
4992 Fix usage of set_buffer_internal.
4993 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4994 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4995 * coding.c (decode_coding): Omit redundant test.
4996 * fileio.c (decide_coding_unwind): Likewise.
4997 * fns.c (secure_hash): Likewise.
4998 * insdel.c (modify_region): Likewise.
4999 * keyboard.c (command_loop_1): Likewise.
5000 * print.c (PRINTFINISH): Likewise.
5001 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
5002
59ea14cd
PE
50032012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5004
5005 * dispnew.c: Use bool for boolean.
5006 (frame_garbaged, display_completed, delayed_size_change)
5007 (fonts_changed_p, add_window_display_history)
5008 (add_frame_display_history, verify_row_hash)
5009 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
5010 (row_equal_p, realloc_glyph_pool)
5011 (allocate_matrices_for_frame_redisplay)
5012 (showing_window_margins_p)
5013 (adjust_frame_glyphs_for_frame_redisplay)
5014 (build_frame_matrix_from_leaf_window, make_current)
5015 (mirrored_line_dance, mirror_line_dance, update_frame)
5016 (update_window_tree, update_single_window)
5017 (check_current_matrix_flags, update_window, update_text_area)
5018 (update_window_line, set_window_update_flags, scrolling_window)
5019 (update_frame_1, scrolling, buffer_posn_from_coords)
5020 (do_pending_window_change, change_frame_size)
5021 (change_frame_size_1, sit_for):
5022 Use bool for boolean.
5023 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
5024 and remove last int (actually boolean) argument, which was always 0.
5025 All callers changed.
5026 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
5027 * dispextern.h (struct composition_it): Use bool for boolean.
5028 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
5029 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
5030 * dired.c (file_name_completion):
5031 Use bool for boolean. (This was missed in an earlier change.)
5032
95072a94
MR
50332012-08-27 Martin Rudalics <rudalics@gmx.at>
5034
5035 * window.c (Fset_window_configuration): Revert first part of
5036 last change.
5037
0f19feff
JD
50382012-08-27 Jan Djärv <jan.h.d@swipnet.se>
5039
5040 * nsterm.h (NSPanel): New class variable dialog_return.
5041
3a880af4
SM
5042 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
5043 Initialize dialog_return.
0f19feff
JD
5044 (windowShouldClose:): Use stop instead of stopModalWithCode.
5045 (clicked:): Ditto, and also set dialog_return (Bug#12258).
5046 (timeout_handler:): Use stop instead of abortModal. Send a dummy
5047 event.
5048 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
5049 modal loop returns.
5050
f10fe38f
PE
50512012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5052
de1339b0
PE
5053 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
5054 * composite.c (find_composition, composition_gstring_p)
5055 (composition_reseat_it, find_automatic_composition):
5056 * data.c (let_shadows_buffer_binding_p)
5057 (let_shadows_global_binding_p, set_internal, make_blv)
5058 (Fmake_variable_buffer_local, Fmake_local_variable)
5059 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
5060 (cons_to_signed, arith_driver):
5061 * dbusbind.c (xd_in_read_queued_messages):
5062 * dired.c (directory_files_internal, file_name_completion):
5063 Use bool for booleans.
5064 * dired.c (file_name_completion):
5065 * process.h (fd_callback):
5066 Omit int (actually boolean) argument. It wasn't being used.
5067 All uses changed.
5068 * composite.h, lisp.h: Reflect above API changes.
5069
f10fe38f
PE
5070 * cmds.c, coding.c: Use bool for booleans.
5071 * cmds.c (move_point, Fself_insert_command):
5072 * coding.h (struct composition status, struct coding_system):
5073 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
5074 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
5075 (emacs_mule_char, decode_coding_emacs_mule)
5076 (encode_coding_emacs_mule, detect_coding_iso_2022)
5077 (decode_coding_iso_2022, encode_invocation_designation)
5078 (encode_designation_at_bol, encode_coding_iso_2022)
5079 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
5080 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
5081 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
5082 (encode_coding_raw_text, detect_coding_charset)
5083 (decode_coding_charset, encode_coding_charset, detect_eol)
5084 (detect_coding, get_translation_table, produce_chars)
5085 (consume_chars, reused_workbuf_in_use)
5086 (make_conversion_work_buffer, code_conversion_save)
5087 (decode_coding_object, encode_coding_object)
5088 (detect_coding_system, char_encodable_p)
5089 (Funencodable_char_position, code_convert_region)
5090 (code_convert_string, code_convert_string_norecord)
5091 (Fset_coding_system_priority):
5092 * fileio.c (Finsert_file_contents):
5093 Use bool for booleans.
5094 * coding.h, lisp.h: Reflect above API changes.
5095 * coding.c: Remove unnecessary static function decls.
5096 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
5097 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
5098 not a boolean 'int', since callers never look at the return value.
5099 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
5100 * coding.h (decoding_buffer_size, encoding_buffer_size)
5101 (emacs_mule_string_char): Remove unused extern decls.
5102 (struct iso_2022_spec, struct coding_system):
5103 Use 'unsigned int : 1' for boolean fields, since there's more than one.
5104 (struct emacs_mule_spec): Remove unused field 'full_support'.
5105 All initializations removed.
5106 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
5107
5474c384
DA
51082012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5109
f10fe38f 5110 Fix spare memory change (Bug#12286).
5474c384
DA
5111 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
5112 (valid_lisp_object_p): Likewise.
5113
c4b6914d
MR
51142012-08-27 Martin Rudalics <rudalics@gmx.at>
5115
5116 * window.c (Fset_window_configuration): Record any window's old
5117 buffer if it's replaced (see Bug#8789). If the new current
5118 buffer doesn't appear in the selected window, go to its old
5119 point (Bug#12208).
5120
35aaa1ea
DA
51212012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5122
5123 Special MEM_TYPE_SPARE to denote reserved memory.
5124 * alloc.c (enum mem_type): New memory type.
5125 (refill_memory_reserve): Use new type for spare memory.
5126 This prevents live_cons_p and live_string_p from incorrect
5127 detection of uninitialized objects from spare memory as live.
5128
6af64513
PE
51292012-08-26 Paul Eggert <eggert@cs.ucla.edu>
5130
8b2e00a3
PE
5131 Spelling fixes.
5132 * Makefile.in (.PHONY): versioclean -> versionclean.
5133
b52d6985
PE
5134 Remove unused external symbols.
5135 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
5136 * window.c (Qwindow_valid_p, decode_valid_window):
5137 Now static, not extern.
5138 * data.c (Qinterval): Remove; unused.
5139 (syms_of_data): Do not define 'interval'.
5140 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
5141 * window.h (decode_valid_window):
5142 Remove decls.
5143
d5172d4f
PE
5144 * character.c, charset.c, chartab.c: Use bool for booleans.
5145 * character.c (lisp_string_width, string_count_byte8)
5146 (string_escape_byte8):
5147 * charset.c (charset_map_loaded, load_charset_map, read_hex):
5148 (load_charset_map_from_file, map_charset_chars)
5149 (Fdefine_charset_internal, define_charset_internal)
5150 (Fdeclare_equiv_charset, find_charsets_in_text)
5151 (Ffind_charset_region, char_charset, Fiso_charset):
5152 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
5153 (sub_char_table_set, sub_char_table_set_range)
5154 (char_table_set_range, optimize_sub_char_table)
5155 (map_sub_char_table):
5156 Use bool for boolean.
5157 * character.c (str_to_unibyte): Omit last boolean argument; it was
5158 always 0. All callers changed.
5159 * character.h, charset.h: Adjust to match previous changes.
5160 * character.h (char_printable_p): Remove decl of nonexistent function.
5161 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
5162 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
5163 are all boolean, so make them single-bit bitfields.
5164
6af64513
PE
5165 * lisp.h (ASET): Remove attempt to detect side effects.
5166 It was meant to be temporary and it often doesn't work,
5167 because when IDX has side effects the behavior of IDX==IDX
5168 is undefined. See Stefan Monnier in
5169 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
5170
e1f29348
BR
51712012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5172
5173 * lisp.h (functionp): New function (extracted from Ffunctionp).
5174 (FUNCTIONP): Use it.
5175 * eval.c (Ffunctionp): Use it.
5176
17c05d74
PE
51772012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5178
0f46bc75
PE
5179 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
5180 as that's faster and simpler than static storage. Don't bother
5181 with the g_main_context_query overhead if g_main_context_pending
5182 says no events are pending.
5183 (gfds, gfds_size): Remove these static vars.
5184 (xgselect_initialize): Remove; no longer needed.
5185 All uses and decls removed.
5186
ee4c0f69
PE
5187 * emacs.c (fatal_error_signal_hook): Remove.
5188 All uses removed. This leftover from old code was always 0.
5189
17c05d74
PE
5190 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
5191 * casefiddle.c (casify_object, casify_region):
5192 * casetab.c (set_case_table):
5193 * category.c, category.h (word_boundary_p):
5194 * category.h (CHAR_HAS_CATEGORY):
5195 Use bool for booleans, instead of int.
5196
391ceac5
EZ
51972012-08-25 Eli Zaretskii <eliz@gnu.org>
5198
5199 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
5200
2f221583
PE
52012012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5202
f4a681b0
PE
5203 On assertion failure, print backtrace if available.
5204 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
5205 (die) [ENABLE_CHECKING]: Print a backtrace if available.
5206 * Makefile.in (LIB_EXECINFO): New macro.
5207 (LIBES): Use it.
5208
2f221583
PE
5209 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
5210 * bytecode.c (exec_byte_code):
5211 * callint.c (check_mark, Fcall_interactively):
5212 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
5213 (getenv_internal, sync_process_alive, call_process_exited):
5214 * lisp.h (USE_SAFE_ALLOCA):
5215 Use bool for booleans, instead of int.
5216 * lisp.h, process.h: Adjust prototypes to match above changes.
5217 * callint.c (Fcall_interactively): Don't assume the mark's
5218 offset fits in 'int'.
5219
37ef52bb
PE
52202012-08-24 Paul Eggert <eggert@cs.ucla.edu>
5221
5222 * buffer.c, buffer.h: Use bool for boolean.
5223 * buffer.c (reset_buffer_local_variables)
5224 (buffer_lisp_local_variables, Fset_buffer_modified_p)
5225 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
5226 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
5227 (overlay_touches_p, overlay_strings, Foverlay_put)
5228 (report_overlay_modification, call_overlay_mod_hooks):
5229 (mmap_enlarge, mmap_set_vars):
5230 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
5231 Use bool for booleans, instead of int.
5232 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
5233 since the 1-or-0 return value is always ignored anyway.
5234 (mmap_initialized_p):
5235 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
5236 * buffer.h, lisp.h: Adjust prototypes to match above changes.
5237
2cc21167
PE
52382012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5239
5240 * bidi.c: Use bool for boolean.
5241 This is a bit more readable, and makes the text segment of bidi.o
5242 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
5243 Presumably it's faster too.
5244 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
5245 Now bool.
5246 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5247 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
5248 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
5249 (bidi_explicit_dir_char, bidi_level_of_next_char)
5250 (bidi_find_other_level_edge, bidi_move_to_visually_next):
5251 Use bool for booleans, instead of int.
5252 * dispextern.h (bidi_init_it, bidi_paragraph_init)
5253 (bidi_unshelve_cache): Adjust decls to match code.
5254
7db4ddf4
MR
52552012-08-23 Martin Rudalics <rudalics@gmx.at>
5256
5257 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
5258 argument.
5259
b1bb8011
PE
52602012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5261
5262 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
5263 * atimer.h: Include <stdbool.h>.
5264
ff687885
DN
52652012-08-22 Dan Nicolaescu <dann@gnu.org>
5266
5267 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
5268 compile time tests instead of run time tests on systems that do
5269 not use them.
5270 (FRAME_MAC_P): Remove leftover from deleted code.
5271 * frame.c (syms_of_frame): Remove leftover from deleted code.
5272
4ce7a138
JD
52732012-08-22 Jan Djärv <jan.h.d@swipnet.se>
5274
5275 * nsterm.m (insertText:): Don't clear modifiers if code is space.
5276
d733ec6d
PE
52772012-08-22 Paul Eggert <eggert@cs.ucla.edu>
5278
5279 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
5280 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 5281 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
5282 (fontset_add): Return void, for FONTSET_ADD.
5283
d0d2d26f
PE
52842012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5285
fce31d69
PE
5286 * alloc.c: Use bool for booleans.
5287 (gc_in_progress, abort_on_gc)
5288 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5289 (dont_register_blocks) [GC_MALLOC_CHECK]:
5290 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
5291 (check_string_bytes, make_specified_string, memory_full)
5292 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
5293 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
5294 (mark_stack, valid_pointer_p, make_pure_string)
5295 (Fgarbage_collect, survives_gc_p, gc_sweep):
5296 Use bool for booleans, instead of int.
5297 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5298 Remove unused local.
5299 * alloc.c (PURE_POINTER_P):
5300 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
5301 * editfns.c (Fformat):
5302 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
5303 (Fdo_auto_save):
5304 * fns.c (sweep_weak_table):
5305 * lisp.h (suppress_checking, push_message, survives_gc_p)
5306 (make_pure_string, gc_in_progress, abort_on_gc):
5307 * lread.c (readchar, read1):
5308 * print.c (Fprin1_to_string):
5309 * xdisp.c (push_message):
5310 Use bool for booleans affected directly or indirectly by
5311 alloc.c's changes.
5312
d0d2d26f
PE
5313 Make recently-introduced setters macros.
5314 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5315 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
5316 (set_fontset_default, set_fontset_fallback): Rename from their
5317 upper-case counterparts, and make them functions rather than macros.
5318 This is more consistent with the other recently-introduced setters.
5319 These don't need to be inline, since they're local.
5320
d18e2bb6
JD
53212012-08-21 Jan Djärv <jan.h.d@swipnet.se>
5322
5323 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
5324 the loop (Bug#12247).
5325
1b9d9d16
PE
53262012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5327
5328 * lisp.h (vcopy): Use memcpy rather than our own loop.
5329 This fixes a performance regression introduced by the recent
5330 addition of vcopy. This means 'vcopy' will need to be modified
5331 for a copying collector, but that's OK. Also, tighten the
5332 checking in the assertion.
5333
b2f09701
EZ
53342012-08-21 Eli Zaretskii <eliz@gnu.org>
5335
5336 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
5337 components for RTL text (Bug#11860). Adjust X-OFFSET of each
5338 non-base glyph for the width of the base character, according to
e1f29348
BR
5339 what x_draw_composite_glyph_string_foreground expects.
5340 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
5341 expectations, to produce correct width of the composed character.
5342 Reverse the sign of the DU offset produced by ScriptPlace.
5343
9b994fed
PE
53442012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5345
5346 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
5347
086ca913
DA
53482012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5349
5350 Avoid direct writes to contents member of struct Lisp_Vector.
5351 * lisp.h (vcopy): New function to copy data into vector.
5352 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
5353 * fns.c (Ffillarray): Use ASET.
5354 * keyboard.c (timer_check_2): Use AREF and ASET.
5355 (append_tool_bar_item, Frecent_keys): Use vcopy.
5356 * lread.c (read_vector): Use ASET.
5357 * msdos.c (Frecent_doskeys): Use vcopy.
5358 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5359 (Finternal_merge_in_global_face): Use ASET and vcopy.
5360 * xfont.c (xfont_list_pattern): Likewise.
5361
5481664a
MR
53622012-08-21 Martin Rudalics <rudalics@gmx.at>
5363
5364 * window.c (Fwindow_point): For the selected window always return
5365 the position of its buffer's point.
5366 (Fset_window_point): For the selected window always go in its
5367 buffer to the specified position.
5368
6d470bdd
DA
53692012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5370
5371 Setter macros for fontsets.
5372 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5373 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5374 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5375 Adjust users.
5376
24564fe1
GM
53772012-08-20 Glenn Morris <rgm@gnu.org>
5378
5379 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5380 Don't assume that `ln -f' works.
5381
0a05a035
EZ
53822012-08-20 Eli Zaretskii <eliz@gnu.org>
5383
5384 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5385 and later about non-assignments with no effect. See discussion at
5386 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5387 details.
5388
e46f2325
DA
53892012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5390
5391 Inline setter functions for Lisp_Objects slots of struct specbinding.
5392 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5393 Adjust users.
5394
734fbd86
MR
53952012-08-20 Martin Rudalics <rudalics@gmx.at>
5396
5397 * window.c (select_window): Always make selected window's buffer
5398 current.
5399
f1a95992
DA
54002012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5401
5402 Use AREF and ASET for docstrings of category tables.
5403 * category.h (CATEGORY_DOCSTRING): Use AREF.
5404 (SET_CATEGORY_DOCSTRING): Use ASET.
5405 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5406
e83064be
DA
54072012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5408
5409 Inline setter functions for hash table members.
5410 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5411 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5412 (set_hash_key_and_value, set_hash_index, set_hash_next)
5413 (set_hash_hash): New functions.
5414 * charset.c, fns.c: Adjust users.
5415
4ce60d2e
DA
54162012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5417
5418 Inline getter and setter functions for per-buffer values.
5419 * buffer.h (per_buffer_default, set_per_buffer_default)
5420 (per_buffer_value, set_per_buffer_value): New functions.
5421 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5422 * buffer.c, data.c: Adjust users.
5423
c06c9690
JB
54242012-08-20 Juanma Barranquero <lekktu@gmail.com>
5425
5426 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5427
32bd4250
PE
54282012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5429
bad03192 5430 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
5431 as gnulib does this if the system doesn't.
5432 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
5433 Remove declaration. MS-Windows declares it on stdlib.h which is
5434 included by conf_post.h.
b69a6d22
PE
5435 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5436 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5437 * vm-limit.c: Include <unistd.h>, for 'environ'.
5438
22d7feb2
PE
5439 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5440 (start_of_data): Remove decl; mem-limits.h provides it.
5441
32bd4250
PE
5442 * xdisp.c (handle_invisible_prop): Make it a bit faster
5443 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5444
450809af
CY
54452012-08-19 Chong Yidong <cyd@gnu.org>
5446
5447 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5448 ends (Bug#3874).
5449
9e677988
AS
54502012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5451
6b1319ce
AS
5452 * .gdbinit: Use call instead of set when calling a function in the
5453 inferior.
5454
9e677988
AS
5455 * data.c (set_internal): Don't use set_blv_found.
5456 (Fkill_local_variable): Likewise.
5457
d7191076
AA
54582012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5459
5460 * nsfont.m (ns_ascii_average_width): Ensure the string
5461 ascii_printable is initialized with a null-terminated character
5462 array. Otherwise, it can contain undesired extra characters.
5463
e757f1c6
PE
54642012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5465
5466 port new setting code to Sun C 5.8 2005/10/13
5467 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5468 Return void, not Lisp_Object. Otherwise, the compiler
5469 complains about (A?B:C) where B is void and C is Lisp_Object
5470 when compiling CHAR_TABLE_SET, due to the recent change to
5471 the API of sub_char_table_set_contents.
5472
a999ce26
CY
54732012-08-18 Chong Yidong <cyd@gnu.org>
5474
5475 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5476 for the string case (Bug#3874).
5477
3f22b86f
PE
54782012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5479
39eb03f1
PE
5480 * buffer.h (BSET): Remove (Bug#12215).
5481 Replace all uses with calls to new setter functions.
5482 (bset_bidi_paragraph_direction, bset_case_canon_table)
5483 (bset_case_eqv_table, bset_directory, bset_display_count)
5484 (bset_display_time, bset_downcase_table)
5485 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5486 (bset_last_selected_window, bset_local_var_alist)
5487 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5488 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5489 (bset_width_table):
5490 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5491 (bset_auto_fill_function, bset_auto_save_file_format)
5492 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5493 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5494 (bset_cache_long_line_scans, bset_case_fold_search)
5495 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5496 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5497 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5498 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5499 (bset_header_line_format, bset_indicate_buffer_boundaries)
5500 (bset_indicate_empty_lines, bset_invisibility_spec)
5501 (bset_left_fringe_width, bset_major_mode, bset_mark)
5502 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5503 (bset_name, bset_overwrite_mode, bset_pt_marker)
5504 (bset_right_fringe_width, bset_save_length)
5505 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5506 (bset_scroll_up_aggressively, bset_selective_display)
5507 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5508 (bset_word_wrap, bset_zv_marker):
5509 * category.c (bset_category_table):
5510 * syntax.c (bset_syntax_table):
5511 New setter functions.
5512
6a09a33b
PE
5513 * process.h (PSET): Remove (Bug#12215).
5514 Replace all uses with calls to new setter functions.
5515 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5516 (PROCESS_INLINE): New macro.
5517 (pset_childp): New setter function.
5518 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5519 * process.c (PROCESS_INLINE):
5520 Define to EXTERN_INLINE, so that the corresponding functions
5521 are compiled into code.
5522 (pset_buffer, pset_command, pset_decode_coding_system)
5523 (pset_decoding_buf, pset_encode_coding_system)
5524 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5525 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5526 (pset_type, pset_write_queue): New setter functions.
5527
e8c17b81
PE
5528 * window.h (WSET): Remove (Bug#12215).
5529 Replace all uses with calls to new setter functions.
5530 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5531 (WINDOW_INLINE): New macro.
5532 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5533 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5534 (wset_total_lines, wset_vertical_scroll_bar)
5535 (wset_window_end_pos, wset_window_end_valid)
5536 (wset_window_end_vpos): New setter functions.
5537 * window.c (WINDOW_INLINE):
5538 Define to EXTERN_INLINE, so that the corresponding functions
5539 are compiled into code.
5540 (wset_combination_limit, wset_dedicated, wset_display_table)
5541 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5542 (wset_new_normal, wset_new_total, wset_next_buffers)
5543 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5544 (wset_prev_buffers, wset_right_fringe_width)
5545 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5546 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5547 (wset_window_parameters):
5548 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5549 (wset_column_number_displayed, wset_region_showing):
5550 New setter functions.
5551
3f22b86f
PE
5552 * termhooks.h (TSET): Remove (Bug#12215).
5553 Replace all uses with calls to new setter functions.
5554 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5555 (TERMHOOKS_INLINE): New macro.
5556 (tset_charset_list, tset_selection_alist): New setter functions.
5557 * terminal.c (TERMHOOKS_INLINE):
5558 Define to EXTERN_INLINE, so that the corresponding functions
5559 are compiled into code.
5560 (tset_param_alist): New setter function.
5561
742af32f
PE
55622012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5563
15dbb4d6
PE
5564 * keyboard.h (KSET): Remove (Bug#12215).
5565 Replace all uses with calls to new setter functions.
5566 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5567 (KEYBOARD_INLINE): New macro.
5568 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5569 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5570 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5571 New setter functions.
5572 * keyboard.c (KEYBOARD_INLINE):
5573 Define to EXTERN_INLINE, so that the corresponding functions
5574 are compiled into code.
5575 (kset_echo_string, kset_kbd_queue)
5576 (kset_keyboard_translate_table, kset_last_prefix_arg)
5577 (kset_last_repeatable_command, kset_local_function_key_map)
5578 (kset_overriding_terminal_local_map, kset_real_last_command)
5579 (kset_system_key_syms): New setter functions.
5580
f00af5b1
PE
5581 * frame.h (FSET): Remove (Bug#12215).
5582 Replace all uses with calls to new setter functions.
5583 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5584 (FRAME_INLINE): New macro.
5585 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5586 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5587 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5588 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5589 (fset_param_alist, fset_root_window, fset_scroll_bars)
5590 (fset_selected_window, fset_title, fset_tool_bar_items)
5591 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5592 * frame.c (FRAME_INLINE):
5593 Define to EXTERN_INLINE, so that the corresponding functions
5594 are compiled into code.
5595 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5596
0c94c8d6
PE
5597 A few more naming-convention fixes for getters and setters.
5598 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5599 and rename from buffer_overlays_set_before.
5600 (set_buffer_overlays_after): Move here from buffer.h, and rename
5601 from buffer_overlays_set_after.
5602 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5603 All uses changed.
5604 (set_buffer_intervals): Rename from buffer_set_intervals.
5605 * intervals.c (set_interval_object): Move here from intervals.h,
5606 and rename from interval_set_object.
5607 (set_interval_left): Move here from intervals.h, and rename from
5608 interval_set_left.
5609 (set_interval_right): Move here from intervals.h, and rename from
5610 interval_set_right.
5611 (copy_interval_parent): Move here from intervals.h, and rename from
5612 interval_copy_parent.
5613 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5614 (set_interval_plist): Rename from interval_set_plist.
5615 Return void, not Lisp_Object, since no caller uses the result.
5616 * lisp.h (string_intervals): Rename from string_get_intervals.
5617 (set_string_intervals): Rename from string_set_intervals.
5618
34dabdb7
PE
5619 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5620 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 5621 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
5622 All uses changed. See the end of
5623 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5624
742af32f
PE
5625 * lisp.h (CSET): Remove (Bug#12215).
5626 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5627 (set_char_table_purpose): New functions,
5628 replacing CSET. All uses changed. For example, replace
5629 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 5630 "set_char_table_parent (char_table, parent);".
742af32f
PE
5631 The old version was confusing because it used the same name
5632 'parent' for two different things.
5633
a04e2c62
DA
56342012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5635
5636 Functions to get and set Lisp_Object fields of buffer-local variables.
5637 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5638 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5639 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5640 * data.c, eval.c, frame.c: Adjust users.
5641
383dcbf9
CY
56422012-08-17 Chong Yidong <cyd@gnu.org>
5643
5644 * xfaces.c (merge_face_vectors): If the target font specfies a
5645 font spec, make the font's attributes take precedence over
5646 directly-specified attributes.
5647 (merge_face_ref): Recognize :font.
5648
44386687
DA
56492012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5650
5651 Do not use memcpy for copying intervals.
5652 * intervals.c (reproduce_interval): New function.
5653 (reproduce_tree, reproduce_tree_obj): Use it.
5654 (reproduce_tree_obj): Remove prototype.
5655
927c7216
PE
56562012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5657
5658 * lisp.h (duration_to_sec_usec): Remove unused decl.
5659
93044f7b
AA
56602012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5661
5662 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5663 to an allocated instance of NSString, not to the class itself.
5664
9851e4a5
JB
56652012-08-17 Juanma Barranquero <lekktu@gmail.com>
5666
5667 * makefile.w32-in (C_CTYPE_H): New macro.
5668 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5669 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5670 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5671
620f13b0
PE
56722012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5673
5674 Use ASCII tests for character types.
5675 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5676 * xfns.c, xterm.c:
5677 Don't include <ctype.h>; was not needed.
5678 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5679 * sysdep.c, xfaces.c:
5680 Include <c-ctype.h> instead of <ctype.h>.
5681 * nsterm.m: Include <c-ctype.h>.
5682 * charset.c (read_hex):
5683 * doc.c (Fsnarf_documentation):
5684 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5685 (DRIVE_LETTER) [DOS_NT]:
5686 (Ffile_name_directory, Fexpand_file_name)
5687 (Fsubstitute_in_file_name):
5688 * font.c (font_parse_xlfd, font_parse_fcname):
5689 * frame.c (x_set_font_backend):
5690 * gtkutil.c (xg_get_font):
5691 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5692 * nsimage.m (hexchar):
5693 * nsterm.m (ns_xlfd_to_fontname):
5694 * sysdep.c (system_process_attributes):
5695 * xfaces.c (hash_string_case_insensitive):
5696 Use C-locale tests instead of locale-specific tests for character
5697 types, since we want the ASCII interpretation here, not the
5698 interpretation suitable for whatever happens to be the current locale.
5699
52162052
MR
57002012-08-16 Martin Rudalics <rudalics@gmx.at>
5701
5702 Consistently check windows for validity/liveness
5703 (Bug#11984, Bug#12025, Bug#12026).
5704 * lisp.h (CHECK_VALID_WINDOW): New macro.
5705 * window.c (decode_window): Rename to decode_live_window.
5706 (decode_valid_window, Fwindow_valid_p): New functions.
5707 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5708 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5709 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5710 (Fwindow_prev_sibling, Fwindow_combination_limit)
5711 (Fset_window_combination_limit, Fwindow_use_time)
5712 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5713 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5714 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5715 (Fwindow_hscroll, Fset_window_hscroll)
5716 (Fwindow_redisplay_end_trigger)
5717 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5718 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5719 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5720 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5721 (Fwindow_end, Fset_window_point, Fset_window_start)
5722 (Fpos_visible_in_window_p, Fwindow_line_height)
5723 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5724 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5725 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5726 (Fset_window_parameter, Fwindow_display_table)
5727 (Fset_window_display_table, Fdelete_other_windows_internal)
5728 (Fset_window_buffer, Fset_window_new_total)
5729 (Fset_window_new_normal, Fdelete_window_internal)
5730 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5731 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5732 (Fwindow_scroll_bars): Check whether argument window is a valid or
5733 live window. Update doc-strings.
5734 (syms_of_window): New symbol Qwindow_valid_p.
5735 * keyboard.c (Fposn_at_x_y): Check whether argument
5736 frame_or_window denotes a valid window.
5737
2751c80f
DA
57382012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5739
5740 Fix previous char table change.
5741 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5742 * chartab.c (optimize_sub_char_table): Likewise.
5743
032a42c8
CY
57442012-08-16 Chong Yidong <cyd@gnu.org>
5745
a2d19368
CY
5746 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5747
032a42c8
CY
5748 * xfont.c (xfont_open):
5749 * xftfont.c (xftfont_open): Set the font's max_width field.
5750
5751 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5752 min_width to space_width and average_width to the average over
5753 printable ASCII characters.
5754 (ns_char_width): Code cleanup.
5755 (ns_ascii_average_width): New utility function.
5756
5757 * font.h (struct font): Update comments.
5758
a098c930
DA
57592012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5760
032a42c8 5761 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
5762 * lisp.h (CSET): New macro.
5763 (char_table_set_extras, char_table_set_contents)
5764 (sub_char_table_set_contents): New function.
5765 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5766 * syntax.c: Adjust users.
5767
8be3a09c
SM
57682012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5769
5770 * eval.c (eval_sub): Bind lexical-binding.
5771 * lread.c (Qlexical_binding): Make non-static.
5772
ac4845a6
JD
57732012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5774
ddee6515
JD
5775 * nsmenu.m (popupSession): Remove.
5776 (pop_down_menu): Remove endModalSession.
5777 (timeout_handler:): New method.
5778 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5779 Call runModalForWindow. Check timer_fired when it returns.
5780 If not set, cancel timer and break out of loop.
5781 Otherwise loop again, with a new timeout.
5782
5783 * nsterm.m: Include fcntl.h if present.
5784 (fd_entry, t_readfds, inNsSelect): Remove.
5785 (select_writefds, select_valid, select_timeout, selfds)
5786 (select_mutex, apploopnr): Add.
5787 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5788 Otherwise call kbd_buffer_store_event.
5789 (ns_send_appdefined): Remove release of fd_entry.
5790 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5791 Increment and decrement apploopnr.
5792 (ns_select): If no file descriptors, just do a NSTimer.
5793 Otherwise copy read/write masks and start select thread (fd_handler).
5794 Start main loop and wait for application defined event.
5795 Inform select thread to stop selecting after main loop is exited.
5796 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 5797 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
5798 (fd_handler:): Loop forever, wait for info from the main thread
5799 to either start or stop selecting. When select returns, send
5800 and appdefined event.
5801 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5802 If not call kbd_buffer_store_event.
5803
5804 * nsterm.h (EmacsApp): fd_handler takes id argument.
5805 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5806
ac4845a6
JD
5807 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5808
eb424fe3
EZ
58092012-08-15 Eli Zaretskii <eliz@gnu.org>
5810
5811 * region-cache.c (move_cache_gap): Update gap_len using the actual
5812 growth of the boundaries array. Do not change cache_len.
5813 (Bug#12196)
5814
4e6a86c6
DA
58152012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5816
5817 Generalize and cleanup font subsystem checks.
5818 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
5819 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5820 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 5821
5bf192ca
DA
58222012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5823
5824 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5825
f2045622
CY
58262012-08-15 Chong Yidong <cyd@gnu.org>
5827
8be3a09c
SM
5828 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5829 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5830 extract the font descriptor instead of just the font name.
5831 In that case, return a font spec instead of a string.
f2045622
CY
5832 (x_last_font_name): Move to this file from xfns.c.
5833
5834 * xfns.c (Fx_select_font): The return value can also be a font
5835 spec. Move x_last_font_name management to gtkutil.c.
5836
5837 * xfaces.c: Make font weight and style symbols non-static.
5838
7f6feb56
SM
58392012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5840
5841 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5842 (bug#12117).
5843
fecbd8ff
SM
58442012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5845
5846 * alloc.c (Fgarbage_collect): Use plural form consistently.
5847
9b8d5165
EZ
58482012-08-14 Eli Zaretskii <eliz@gnu.org>
5849
5850 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5851 iteration through the command loop. Fixes a problem whereby mouse
5852 movements are ignored until the first mouse click.
5853
f5d9e83a
PE
58542012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 Use bool, not int, for Lisp booleans.
5857 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5858 makes Emacs a bit smaller and presumably a bit faster.
5859 * lisp.h: Include <stdbool.h>.
5860 (struct Lisp_Boolfwd, defvar_bool):
5861 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5862 * regex.c [!emacs]: Include <stdbool.h>.
5863 (false, true): Remove; <stdbool.h> does this for us now.
5864
55802e4a
CY
58652012-08-14 Chong Yidong <cyd@gnu.org>
5866
4abcdac8
CY
5867 * character.c (Fcharacterp): Doc fix (Bug#12076).
5868
5869 * data.c (Findirect_variable): Doc fix (Bug#11040).
5870
55802e4a
CY
5871 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5872
5873 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 5874 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 5875
8e99d072
BR
58762012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5877
5878 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5879 (bug#12022).
5880
08908aca
MR
58812012-08-14 Martin Rudalics <rudalics@gmx.at>
5882
5883 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5884 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5885 * minibuf.c (choose_minibuf_frame, read_minibuf):
5886 * w32fns.c (x_create_tip_frame):
5887 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5888 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5889
56120d6f
PE
58902012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5891
5892 * intervals.c (offset_intervals): Remove obsolete comment.
5893
67b77c0b
AS
58942012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5895
5896 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5897
f48b82fd
GR
58982012-08-14 Gergely Risko <gergely@risko.hu>
5899
5900 * coding.c (decode_coding): Record buffer modification before
5901 disabling undo_list (Bug#11773).
5902
fd318b54
DA
59032012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5904
5905 Revert and cleanup some recent overlay changes.
5906 * buffer.h (enum overlay_type): Remove.
5907 (buffer_get_overlays, buffer_set_overlays): Likewise.
5908 (buffer_set_overlays_before, buffer_set_overlays_after):
5909 New function. Adjust users.
5910 (unchain_both): Add eassert.
5911
41a62dd9
DA
59122012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5913
5914 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5915
5884c324
PE
59162012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5917
5918 * gtkutil.c (xg_mark_data): Don't assume C99.
5919
ca06f160
JD
59202012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5921
5922 * gtkutil.c (xg_frame_tb_info): New struct.
5923 (TB_INFO_KEY): New define.
5924 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5925 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5926 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5927 if not present.
5928 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 5929 is up to date. Otherwise store new data.
ca06f160
JD
5930 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5931
7864a3f7
DA
59322012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5933
5934 Use KSET for write access to Lisp_Object members of struct kboard.
5935 * keyboard.h (KSET): New macro.
5936 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5937 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5938 * xterm.c: Adjust users.
5939
4c31be61
DA
59402012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5941
5942 Use BSET for write access to Lisp_Object members of struct buffer.
5943 * buffer.h (BSET): New macro.
5944 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5945 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5946 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5947 * window.c, xdisp.c, xfns.c: Adjust users.
5948
14ae4239
BT
59492012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5950
5951 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5952
32bcadb4
JD
59532012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5954
3d29b2ce 5955 * nsterm.m (not_in_argv): New function.
fc0c31f8 5956 (application:openFile, application:openTempFile:):
3d29b2ce
JD
5957 (application:openFileWithoutUI:, application:openFiles:): Open file
5958 if not_in_argv returns non-zero (bug#12171).
5959
32bcadb4 5960 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
5961 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5962 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
5963 (xg_get_font_name): Use those functions/macros here.
5964 Reported by Frans Oilinki <moilinki@gmail.com>.
5965
9ff9402d 59662012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
5967
5968 * unexmacosx.c (copy_data_segment): Copy initialized data in
5969 statically linked libraries from input file rather than memory.
5970
db74a5fc
YM
5971 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5972 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5973 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5974
25e65510
GM
59752012-08-10 Glenn Morris <rgm@gnu.org>
5976
5977 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5978 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5979
7961135c
DA
59802012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5981
5982 Fix last change to allow compilation with low optimization levels.
5983 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5984 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5985
42b3a444
DA
59862012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5987
5988 Use common inline syntax in intervals.h.
5989 * intervals.h (INTERVALS_INLINE): New macro.
5990 Change all users from LISP_INLINE.
5991
9fb0c957
DA
59922012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5993
5994 Define Qnone once for all platforms.
5995 * frame.c (Qnone): Define here.
5996 (syms_of_frame): DEFSYM it.
5997 * lisp.h (Qnone): New declaration.
5998 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5999 * xfns.c: Remove duplication. Adjust users.
6000
65e8ee52
DA
60012012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6002
6003 Remove unused macros from intervals.h.
6004 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
6005 * intervals.c: Adjust comment.
6006
9b855fd6
EZ
60072012-08-10 Eli Zaretskii <eliz@gnu.org>
6008
6009 * w32fns.c <w32_unicode_gui>: New static variable.
6010 (globals_of_w32fns): Initialize it according to os_subtype.
6011 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
6012 testing os_subtype.
6013
39cb9e56 60142012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
6015 Eli Zaretskii <eliz@gnu.org>
6016
6017 Fix bug #10299 with Unicode characters sent by customized
6018 keyboards created by MSKLC.
6019 * w32fns.c (INIT_WINDOW_CLASS): New macro.
6020 (w32_init_class): Use it to initialize the Emacs class with either
6021 ANSI or Unicode API calls.
6022 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
6023 later.
6024 (w32_wnd_proc): If the character code sent by WM_CHAR or
6025 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
6026 original message. Call DefWindowProcW on NT and later.
6027
9374581a
GM
60282012-08-10 Glenn Morris <rgm@gnu.org>
6029
4b94e8cf
GM
6030 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
6031
9374581a
GM
6032 * lisp.h (DIRECTORY_SEP): Let configure set it.
6033
a2752828
DA
60342012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
6035
6036 Use TSET for write access to Lisp_Object slots of struct terminal.
6037 * termhooks.h (TSET): New macro.
6038 * coding.c, terminal.c, xselect.c: Adjust users.
6039
cc92c454
SM
60402012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
6041
6042 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
6043 the failing expression, include them in the error message.
6044 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
6045 * lisp.h (internal_condition_case_n): Update declaration.
6046
4cb3e6b3
DA
60472012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6048
6049 Inline functions to examine and change buffer overlays.
6050 * buffer.c (unchain_both): New function.
6051 * buffer.h (buffer_get_overlays, buffer_set_overlays):
6052 (buffer_has_overlays): New function.
6053 (enum overlay_type): New enum.
6054 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
6055 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
6056
8707c1e5
DA
60572012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6058
6059 Inline functions to examine and change buffer intervals.
6060 * alloc.c (mark_interval_tree): Remove.
6061 (MARK_INTERVAL_TREE): Simplify.
6062 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
6063 * intervals.c (buffer_balance_intervals): New function.
6064 (graft_intervals_into_buffer): Adjust indentation.
6065 (set_intervals_multibyte): Simplify.
6066 * buffer.h (BUF_INTERVALS): Remove.
6067 (buffer_get_intervals, buffer_set_intervals): New function.
6068 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
6069 * intervals.c, textprop.c: Adjust users.
6070
ad8c997f
DA
60712012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6072
6073 Inline functions to examine and change string intervals.
6074 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
6075 (string_get_intervals, string_set_intervals): New function.
6076 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6077 * lread.c, print.c, textprop.c: Adjust users.
6078
32ac3a6b
GM
60792012-08-08 Glenn Morris <rgm@gnu.org>
6080
6081 * lisp.mk (lisp): Remove language/persian.elc.
6082
77c7bcb1
DA
60832012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6084
6085 Cleanup intervals.
6086 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
6087 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
6088 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
6089 Adjust comment. Move under #if 0.
77c7bcb1
DA
6090 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6091 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
6092
9c08a8d4
DA
60932012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6094
6095 Check total length of intervals with eassert.
6096 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
6097 * intervals.c: Change all users to eassert.
6098
26d16b35
EZ
60992012-08-07 Eli Zaretskii <eliz@gnu.org>
6100
14ae4239
BT
6101 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
6102 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
6103 INTERNAL_FIELD in Lisp_Cons.
6104
c644523b
DA
61052012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6106
6107 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
6108 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
6109 name since all xname users are fixed long time ago. Do not
6110 use INTERNAL_FIELD.
6111 (set_symbol_name, set_symbol_function, set_symbol_plist):
6112 (set_symbol_next, set_overlay_plist): New function.
6113 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
6114 (struct Lisp_Overlay): Likewise.
6115 (CVAR, MVAR, SVAR): Remove.
6116 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
6117 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
6118 * xterm.c: Adjust users.
6119 * .gdbinit: Change to use name field of struct Lisp_Symbol
6120 where appropriate.
6121
6a3d20cc
DA
61222012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6123
6124 Basic functions to set Lisp_Object and pointer slots of intervals.
6125 * intervals.h (interval_set_parent, interval_set_object):
6126 (interval_set_left, interval_set_right, interval_set_plist):
6127 (interval_copy_parent): New function.
6128 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
6129 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
6130 Adjust indentation.
6a3d20cc
DA
6131 (INTERVAL_SIZE): Remove. Adjust users.
6132 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
6133
4d2b044c
DA
61342012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6135
6136 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
6137 * process.h (PGET): Remove.
6138 (struct Lisp_Process): Do not use INTERNAL_FIELD.
6139 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6140
d3d50620
DA
61412012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6142
6143 Drop WGET and revert read access to Lisp_Objects slots of struct window.
6144 * window.h (WGET): Remove.
6145 (struct window): Do not use INTERNAL_FIELD.
6146 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6147 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6148 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6149 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6150 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6151 Adjust users.
6152
d10a51dc
CY
61532012-08-07 Chong Yidong <cyd@gnu.org>
6154
6155 * window.c (Fwindow_edges, Fwindow_pixel_edges)
6156 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
6157 (Fdelete_window_internal): Signal an error if the window is not on
6158 a live frame (Bug#12025).
6159
e69b0960
DA
61602012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6161
6162 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
6163 * frame.h (FGET): Remove.
6164 (struct frame): Do not use INTERNAL_FIELD.
6165 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6166 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6167 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6168 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6169
25a20a3a
JB
61702012-08-06 Juanma Barranquero <lekktu@gmail.com>
6171
6172 * w32.c: Silence compiler warnings.
6173 (map_w32_filename): Remove unused variable `is_fat'.
6174 (chase_symlinks): Add parentheses around expression.
6175
1c6f11f4
GM
61762012-08-06 Glenn Morris <rgm@gnu.org>
6177
1db4583a
GM
6178 * sysdep.c: Respect BROKEN_GETWD.
6179
1c6f11f4
GM
6180 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
6181 Let configure handle it.
6182 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
6183
2b90362b
DA
61842012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6185
6186 Use GCALIGNMENT where appropriate.
6187 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
6188 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
6189 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
6190
5f50daf2
EZ
61912012-08-06 Eli Zaretskii <eliz@gnu.org>
6192
14ae4239
BT
6193 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
6194 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 6195
cbcc7007
SM
61962012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
6197
6198 * buffer.h (struct buffer): Revert `indirections' to a simple int;
6199 that should be sufficient for everyone.
6200
4d365fa4
JD
62012012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6202
6203 * keyboard.c (timer_check_2): Add break so timer_check returns next
6204 timeout.
6205
dd86bd82
DA
62062012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6207
6208 Fix Windows build errors introduced after converting to WGET and WSET.
6209 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
6210 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6211
054e1668
JD
62122012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6213
6214 * nsterm.m (ns_frame_rehighlight): Use FSET.
6215
6216 * nsmenu.m (ns_update_menubar): Use FSET.
6217
21238f11
DA
62182012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6219
6220 Separate read and write access to Lisp_Object slots of Lisp_Process.
6221 * process.h (PGET, PSET): New macros similar to AREF and ASET.
6222 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6223
077288cf
DA
62242012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6225
6226 Separate read and write access to Lisp_Object slots of struct window.
6227 * window.h (WGET, WSET): New macros similar to AREF and ASET.
6228 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6229 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6230 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6231 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6232 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6233 Adjust users.
6234
71688bd7
DA
62352012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6236
6237 Fix Windows build errors introduced after converting to FGET and FSET.
6238 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
6239 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
6240 (w32_judge_scroll_bars): Change to use FSET.
6241 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6242
f99bac93
DA
62432012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6244
6245 Fix replacement typo.
6246 * window.c (replace_window): Set root_window instead of
6247 selected_window. This fixes a total window subsystem
6248 malfunction reported by Bastien Guerry <bzg@gnu.org>.
6249
8c2a0f2d
GM
62502012-08-06 Glenn Morris <rgm@gnu.org>
6251
6252 * lisp.mk (lisp): Add language/persian.elc.
6253
edd74c35
DA
62542012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6255
6256 Separate read and write access to Lisp_Object slots of struct frame.
6257 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
6258 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6259 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6260 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6261 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6262
8671676c
AS
62632012-08-05 Andreas Schwab <schwab@linux-m68k.org>
6264
6265 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
6266
663e2b3f
DA
62672012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
6268
6269 Generalize common compile-time constants.
6270 * lisp.h (header_size, bool_header_size, word_size): Now here.
6271 (struct Lisp_Vector): Add comment.
6272 (struct Lisp_Bool_Vector): Move up to define handy constants.
6273 (VECSIZE, PSEUDOVECSIZE): Simplify.
6274 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
6275 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
6276 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
6277 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
6278 * xfont.c, xmenu.c: Use word_size where appropriate.
6279
d32e47af
LM
62802012-08-05 Lawrence Mitchell <wence@gmx.li>
6281
6282 * search.c (Freplace_match): Treat \? in the replacement text
6283 literally (Bug#8161).
6284
e5d9c0d1
CY
62852012-08-05 Chong Yidong <cyd@gnu.org>
6286
6287 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
6288 * frame.c (Vdelete_frame_functions):
6289 * emacs.c (Vkill_emacs_hook): Doc fix.
6290
8da0576b
EZ
62912012-08-04 Eli Zaretskii <eliz@gnu.org>
6292
6293 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
6294 --with-x-toolkit=no builds.
6295 Reported by Carsten Mattner <carstenmattner@gmail.com>.
6296
02676e5d
CY
62972012-08-04 Chong Yidong <cyd@gnu.org>
6298
6299 * syntax.c (Fmodify_syntax_entry): Doc fix.
6300
97147da9
EZ
63012012-08-04 Eli Zaretskii <eliz@gnu.org>
6302
76151e2c
EZ
6303 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
6304 * w32.c (init_environment): Change the default values of many
6305 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
6306 them into environment when they were not already defined.
6307 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 6308 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
6309 (check_windows_init_file): Now external, not static.
6310 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
6311 called when Vload_path is already set up.
6312
6313 * w32.h (check_windows_init_file): Add prototype.
6314
6315 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
6316 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
6317 compatibility with Posix platforms.
6318 (main): Move the call to check_windows_init_file to here from
6319 w32.c.
6320 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
6321 any, in the DEFALT argument into the root of the Emacs build or
6322 installation tree, as appropriate.
6323
6324 * callproc.c (init_callproc_1): Call decode_env_path instead of
6325 doing its equivalent by hand.
6326 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
6327 the code that sets Vexec_path run on MS-Windows.
6328
6329 * lread.c (init_lread): Add comments to #ifdef's.
6330
97147da9
EZ
6331 * msdos.c (dos_set_window_size, IT_update_begin)
6332 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
6333 instead of direct references.
6334
185ee146
PE
63352012-08-04 Paul Eggert <eggert@cs.ucla.edu>
6336
6337 Export DEFAULT_REHASH_* to GDB.
6338 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
6339 Now constants, not macros.
6340
8834c57a
PE
63412012-08-03 Paul Eggert <eggert@cs.ucla.edu>
6342
98c6f1e3
PE
6343 Remove unnecessary casts involving pointers.
6344 These casts are no longer needed now that we assume C89 or later,
6345 since they involve casting to or from void *.
6346 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
6347 (make_pure_float, make_pure_vector):
6348 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
6349 * macros.c (Fstart_kbd_macro):
6350 * menu.c (find_and_return_menu_selection):
6351 * minibuf.c (read_minibuf_noninteractive):
6352 * sysdep.c (closedir):
6353 * xdisp.c (x_produce_glyphs):
6354 * xfaces.c (compare_fonts_by_sort_order):
6355 * xfns.c (x_real_positions, select_visual):
6356 * xselect.c (x_stop_queuing_selection_requests)
6357 (x_get_window_property, x_get_window_property_as_lisp_data):
6358 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6359 Remove unnecessary pointer casts.
6360 * alloc.c (record_xmalloc): New function.
6361 * lisp.h (record_xmalloc): New decl.
6362 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6363 more like a function. This is because the pointer cast is not
6364 needed. All uses changed.
6365 * print.c (print_string, print_error_message): Avoid length recalc.
6366
8834c57a
PE
6367 Improve fix for macroexp crash with debugging (Bug#12118).
6368 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6369 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6370 not supposed to be invoked from the garbage collector.
6371 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6372 (gc_aset): New function, which is like ASET but can be
6373 used in the garbage collector.
6374 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6375 (set_hash_index): Use it instead of ASET.
6376
6dad7178
EZ
63772012-08-03 Eli Zaretskii <eliz@gnu.org>
6378
6379 Support symlinks on latest versions of MS-Windows.
6380 * w32.c: Include winioctl.h and aclapi.h.
6381 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6382 (revert_to_self): Forward declarations of static functions.
6383 <static BOOL g_b_init_get_security_info>:
6384 <g_b_init_create_symbolic_link>: New static flags.
6385 (globals_of_w32): Initialize them to zero.
6386 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6387 (map_w32_filename): Improve commentary. Simplify switch.
6388 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6389 headers (most versions of MinGW w32api don't).
6390 (get_security_info, create_symbolic_link)
6391 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6392 New functions.
6393 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6394 in the argument file name.
6395 (sys_access): Call unc_volume_file_attributes only if
6396 GetFileAttributes fails with network-related error codes.
6397 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6398 have the required privileges.
14ae4239 6399 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
6400 get_file_security_desc.
6401 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
6402 with addition of handling of symlinks and support for 'lstat'.
6403 If possible, get file's attributes and security information by
6dad7178
EZ
6404 handle, not by name. Produce S_IFLNK bit for symlinks, when
6405 called from 'lstat'.
6406 (stat, lstat): New functions, call 'stat_worker'.
6407 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6408 symlinks when the underlying filesystem supports them.
6409
f162bcc3
PE
64102012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6411
79ea6c20
PE
6412 Fix macroexp crash on Windows with debugging (Bug#12118).
6413 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6414 checking subscripts; problem introduced with the recent
6415 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6416 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6417 since it's used in non-static inline functions now.
6418
c0ce93fd
PE
6419 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6420 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 6421
f162bcc3
PE
6422 Use C99-style 'extern inline' if available.
6423 * buffer.h (BUFFER_INLINE):
6424 * category.h (CATEGORY_INLINE):
6425 * character.h (CHARACTER_INLINE):
6426 * charset.h (CHARSET_INLINE):
6427 * composite.h (COMPOSITE_INLINE):
6428 * dispextern.h (DISPEXTERN_INLINE):
6429 * lisp.h (LISP_INLINE):
6430 * systime.h (SYSTIME_INLINE):
6431 New macro, replacing 'static inline' in this header.
6432 * buffer.h, category.h, character.h, charset.h, composite.h:
6433 * dispextern.h, lisp.h, systime.h:
6434 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6435 * alloc.c (LISP_INLINE):
6436 * buffer.c (BUFFER_INLINE):
6437 * category.c (CATEGORY_INLINE):
6438 * character.c (CHARACTER_INLINE):
6439 * charset.c (CHARSET_INLINE):
6440 * composite.c (COMPOSITE_INLINE):
6441 * dispnew.c (DISPEXTERN_INLINE):
6442 * sysdep.c (SYSTIME_INLINE):
6443 Define to EXTERN_INLINE, so that the corresponding functions
6444 are compiled into code.
6445 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6446 (INLINE_HEADER_END): New macros.
6447 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6448 since it's used in non-static inline functions now.
a8333d03 6449 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 6450
837b365b
GM
64512012-08-02 Glenn Morris <rgm@gnu.org>
6452
d66b744d
GM
6453 * s/: Remove empty directory.
6454
837b365b
GM
6455 * s/ms-w32.h: Move to ../nt/inc.
6456 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6457 Update for new ms-w32.h location.
6458
13294f95
PE
64592012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6460
6461 Port to Solaris 8.
6462 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6463
90df0db3
GM
64642012-08-02 Glenn Morris <rgm@gnu.org>
6465
6466 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6467 hard-coding the path separator.
6468
4939150c
PE
64692012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6470
6471 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6472 This how ASET and AREF are supposed to work, and makes
6473 it easier to think about future improvements. See
6474 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6475 * charset.h (set_charset_attr): New function.
6476 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6477 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6478 (aref_addr): New function. All uses of &AREF(...) changed.
6479 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6480 (set_hash_index): New functions. All lvalue-style uses of
6481 HASH_KEY etc. changed.
6482 * keyboard.c (set_prop): New function. All lvalue-style uses
6483 of PROP changed.
6484
947b2afd
AA
64852012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6486
6487 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6488 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 6489 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
6490 * nsfns.m (ns_set_name_as_filename): Likewise.
6491 * nsmenu.m (ns_update_menubar): Likewise.
6492 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6493
4f5d0325
EZ
64942012-08-01 Eli Zaretskii <eliz@gnu.org>
6495
2008beae
EZ
6496 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6497 Adapt to latest changes in field names of the corresponding Lisp
288479f6 6498 objects.
2008beae 6499
4f5d0325
EZ
6500 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6501
fe3cc771
GM
65022012-08-01 Glenn Morris <rgm@gnu.org>
6503
6504 * s/msdos.h: Remove file.
6505 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6506 * Makefile.in (S_FILE): Remove.
6507 (config_h): Remove S_FILE.
6508
c90acc54
JB
65092012-08-01 Juanma Barranquero <lekktu@gmail.com>
6510
6511 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6512 Remove; moved to nt/config.nt.
6513
d8a05828
DA
65142012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6515
6516 Use INTERNAL_FIELD for conses and overlays.
6517 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6518 Remove obsolete comment.
6519 (MVAR): New macro.
6520 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6521 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6522
8271d590
DA
65232012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6524
6525 Use INTERNAL_FIELD for symbols.
6526 * lisp.h (SVAR): New macro. Adjust users.
6527 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6528 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6529
3193acd2
DA
65302012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6531
6532 Use INTERNAL_FIELD for processes.
6533 * process.h (PVAR): New macro. Adjust style.
6534 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6535 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6536
3a45383a
DA
65372012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6538
6539 Use INTERNAL_FIELD for windows.
6540 * window.h (WVAR): New macro.
6541 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6542 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6543 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6544 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6545 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6546 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6547
c1dbc63c
PE
65482012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6549
6550 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6551
5c0c0e8a
GM
65522012-08-01 Glenn Morris <rgm@gnu.org>
6553
6554 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6555 Move to configure.ac.
6556
552a99b4
JB
65572012-08-01 Juanma Barranquero <lekktu@gmail.com>
6558
6559 * makefile.w32-in (CONFIG_H): Update dependencies.
6560 (CONF_POST_H): New macro.
6561
6562 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6563
8d8e2dfe
GM
65642012-07-31 Glenn Morris <rgm@gnu.org>
6565
bc96620a
GM
6566 * Makefile.in (S_FILE): No longer set by configure.
6567
476b1b2d
GM
6568 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6569 is available.
6570 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6571
b2c7a106
GM
6572 * process.h (NULL_DEVICE):
6573 * emacs.c (SEPCHAR):
6574 * editfns.c (USER_FULL_NAME): Let configure set them.
6575
d53d062a
GM
6576 * s/README, s/template.h: Remove files.
6577
4515017f
GM
6578 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6579
8d8e2dfe
GM
6580 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6581 Move to configure.ac.
6582
5b20b3cc
EZ
65832012-07-31 Eli Zaretskii <eliz@gnu.org>
6584
1e0afd9a
EZ
6585 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6586 resulting renaming of 'struct frame' members.
6587
5b20b3cc
EZ
6588 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6589
6590 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6591 after introduction of FVAR.
6592
f1310128
JD
65932012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6594
79e721e0
JD
6595 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6596
6597 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6598 instead of compositeToPoint.
6599 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6600
8d7c7eed 6601 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 6602
e34f7f79
DA
66032012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6604
6605 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6606 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 6607 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
6608 (BVAR): Change to use INTERNAL_FIELD.
6609 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6610 (KVAR): Change to use INTERNAL_FIELD.
6611 * frame.h (FVAR): New macro.
6612 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
6613 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6614 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6615 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
6616 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6617
c09bfb2f
DA
66182012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6619
6620 Miscellaneous fixes for non-default X toolkits.
6621 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6622 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6623 Move under #ifdef USE_LUCID.
6624 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6625 definition and usage to avoid warnings.
6626
14c114ae
JD
66272012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6628
6629 * nsterm.m (openFiles): Fix previous checkin.
6630
3bd21e82
PE
66312012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6632
6633 * indent.c (compute_motion): Remove unused local.
6634
c1529ded
GM
66352012-07-31 Glenn Morris <rgm@gnu.org>
6636
400d5621
GM
6637 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6638
268e2432
GM
6639 * conf_post.h [USG5_4]:
6640 Move remaining contents of s/usg5-4-common.h here.
6641 * s/usg5-4-common.h: Remove file.
6642
7552f3ee
GM
6643 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6644 * s/irix6-5.h: Remove file.
6645
6a381852
GM
6646 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6647 * s/darwin.h: Remove file.
6648
c1529ded
GM
6649 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6650 * s/hpux10-20.h: Remove file, which is now empty.
6651
b429a4ee
GM
66522012-07-30 Glenn Morris <rgm@gnu.org>
6653
6654 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6655 * Makefile.in (config_h): Add conf_post.h.
6656 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6657
adff3182
JD
66582012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6659
6660 * nsterm.m (ns_do_open_file): New variable.
b9031d69 6661 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
6662 (openFile, openTempFile, openFileWithoutUI, openFiles):
6663 Open files only if ns_do_open_file.
adff3182 6664
c32af1e4
PE
66652012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6666
7393bcbb
PE
6667 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6668 This no-op macro hasn't been needed for many years.
6669 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6670
c32af1e4
PE
6671 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6672 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6673 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6674 gdb_make_enums_visible.
6675 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6676 (DIRECTORY_SEP): Now a constant, not a macro.
6677
302fc036
EZ
66782012-07-30 Eli Zaretskii <eliz@gnu.org>
6679
6680 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6681 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6682
6683 * w32term.c <w32_keyboard_codepage>: Renamed from
6684 keyboard_codepage and now external. All users changed.
6685
6686 * w32term.h: Add declaration of w32_keyboard_codepage.
6687
6688 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6689 the codepage to translate keys to Unicode. If this argument is
6690 -1, use the value returned by GetConsoleCP. All callers changed.
6691
88fb40b4
PE
66922012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6693
0aee6912
PE
6694 Update .PHONY listings in makefiles.
6695 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6696 bootstrap-clean, distclean, maintainer-clean, versioclean,
6697 extraclean, frc.
6698
88fb40b4
PE
6699 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6700 This is a bit clearer. Fix some commentary typos.
6701
0a763bd1
GM
67022012-07-30 Glenn Morris <rgm@gnu.org>
6703
32bac6d6
GM
6704 * s/netbsd.h: Let configure include signal.h if needed.
6705 Remove file, which is now empty.
6706
b65e7c46
GM
6707 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6708 Let configure set them.
6709 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6710 No more need to undefine.
0a763bd1 6711
169304bd
AS
67122012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6713
6714 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6715 non-single-byte char when adding meta modifier. (Bug#12090)
6716
6cd7a139
DA
67172012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6718
6719 Convert safe_call to use variable number of arguments.
6720 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6721 (safe_call2): Fix comment.
6722 * lisp.h (safe_call): Adjust prototype.
6723 * coding.c (encode_coding_object): Change to use safe_call2.
6724 * xfaces.c (merge_face_heights): Change to use safe_call1.
6725
d34d6ffc
GM
67262012-07-30 Glenn Morris <rgm@gnu.org>
6727
7b8a48e4 6728 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 6729 does that unconditionally. Remove file, which is now empty.
7b8a48e4 6730
d34d6ffc
GM
6731 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6732 Remove empty files.
6733
03a660a6
PE
67342012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6735
6736 Export to GDB most of lisp.h's remaining object-like macros.
6737 * lisp.h (min, max): Move earlier, because they're used earlier now.
6738 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6739 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6740 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6741 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6742 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6743 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6744 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6745 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6746 Now constants, for GDB. They need not be macros.
6747 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6748 Now constants, for GDB, as well as macros, for static initializers.
6749 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6750 Move to after the definition of struct Lisp_Char_Table,
6751 since the former now needs that type defined.
6752 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6753 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6754 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6755 New enums, for gdb_make_enums_visible.
6756 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 6757 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
6758 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6759 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6760 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6761 enum maxargs, enum MAX_ALLOCA.
6762 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6763 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6764 no longer needed, now that they are done in lisp.h.
6765
e499d0ee
DA
67662012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6767
6768 Cleanup string bytes checking.
6769 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6770 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6771 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6772 (check_sblock, compact_small_strings): Simplify.
6773
d5040d2d
PE
67742012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6777 These macros are confusing and no longer need to be defined, as
6778 the enum values now suffice. All uses replaced with definiens.
6779 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6780
7f259ae6
JB
67812012-07-29 Juanma Barranquero <lekktu@gmail.com>
6782
6783 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6784 ($(BLD)/w32console.$(O)): Update dependencies.
6785
7e63e0c3
DA
67862012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6787
6788 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6789 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6790 time. Adjust users.
6791 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6792
ffd817eb
JD
67932012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6794
6795 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6796 setting sitelisp (Bug#12010).
6797
417a7a0e
EZ
67982012-07-29 Eli Zaretskii <eliz@gnu.org>
6799
14ae4239 6800 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
6801
6802 * w32heap.c (cache_system_info):
6803 * w32.c (sys_rename):
6804 * w32proc.c (find_child_console, sys_kill): All users changed.
6805
387d4d92
PE
68062012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6807
6808 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6809
55a6cca6
EZ
68102012-07-29 Eli Zaretskii <eliz@gnu.org>
6811
6812 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6813
dbcf001c
DA
68142012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6815
6816 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
6817 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6818 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 6819
e2688e4a
DA
68202012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6821
6822 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6823 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6824 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6825 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6826 (replace_range, replace_range_2, del_range_2): Change to eassert.
6827 * marker.c (byte_char_debug_check): Adjust style.
6828
b46a6a83
PE
68292012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6830
6831 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6832 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6833 long-ago-commented-out code that talks about "WIN32".
6834 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6835 All uses changed.
6836
e32a5799
PE
68372012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6838
6839 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6840 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6841 Simplify by using alignof.
6842 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6843 * lisp.h: Include <stdalign.h>.
6844 (GCALIGNMENT): New macro and constant.
6845 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6846 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6847 (stdalign): New macro, if not already defined.
6848
df81cd29
EZ
68492012-07-28 Eli Zaretskii <eliz@gnu.org>
6850
01bd1b0d
EZ
6851 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6852 * w32inevt.c: Include w32inevt.h.
6853 (w32_read_console_input): New inline function, calls either
6854 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6855 w32_console_unicode_input.
6856 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6857 (w32_kbd_patch_key, key_event): Use the codepage returned by
6858 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6859 (key_event): use uChar.UnicodeChar only if
6860 w32_console_unicode_input is non-zero.
6861
6862 * w32console.c: Include w32heap.h.
6863 <w32_console_unicode_input>: New global variable.
6864 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6865 family of Windows, zero otherwise.
6866
6867 * w32inevt.h: Declare w32_console_unicode_input.
6868
df81cd29
EZ
6869 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6870 --without-x. (Bug#11742)
6871
c20fdd9e
PE
68722012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6873
6874 Adjust GDB to reflect pvec_type changes (Bug#12036).
6875 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
6876 2012-07-04 changes to pseudovector representation.
6877 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 6878
32770973 68792012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
6880
6881 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6882 bus address.
6883 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6884
3438fe21
EZ
68852012-07-27 Eli Zaretskii <eliz@gnu.org>
6886
bcfbc9de
EZ
6887 * alloc.c (listn): Fix the order the arguments are consed onto the
6888 list.
6889
3438fe21
EZ
6890 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6891 enumeration constants, as PURE and HEAP are too general, and clash
6892 with other headers and sources, such as gmalloc.c and the
6893 MS-Windows system headers. All users changed.
6894
eeaea515
DA
68952012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6896
6897 Revert last save_excursion_save and save_excursion_restore changes.
6898 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6899 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6900
073c88c2
DA
69012012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6902
6903 Fix recently-introduced typos in Windows port.
6904 Reported by Martin Rudalics <rudalics@gmx.at>.
6905 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 6906 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 6907
4706125e
PE
69082012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6909
6910 Improve GDB symbol export (Bug#12036).
6911 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6912 arms of an 'if', not using conditional expressions; otherwise GDB
6913 complains about the types in the unevaluated arm when the argument
6914 is an integer literal.
6915 (xgetint): Simplify expression.
6916 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6917 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6918 Zaretskii in <http://bugs.gnu.org/12036#13>.
6919 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6920 needed now that we have gdb_make_enums_visible.
6921 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6922 (enum enum_USE_LSB_TAG):
6923 New enum types, packaging up enums that need to be exported to GDB.
6924
694b6c97
DA
69252012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6926
6927 Utility function to make a list from specified amount of objects.
6928 * lisp.h (enum constype): New datatype.
6929 (listn): New prototype.
6930 * alloc.c (listn): New function.
6931 (Fmemory_use_count, syms_of_alloc): Use it.
6932 * buffer.c (syms_of_buffer): Likewise.
6933 * callint.c (syms_of_callint): Likewise.
6934 * charset.c (define_charset_internal): Likewise.
6935 * coding.c (syms_of_coding): Likewise.
6936 * keymap.c (syms_of_keymap): Likewise.
6937 * search.c (syms_of_search): Likewise.
6938 * syntax.c (syms_of_syntax): Likewise.
6939 * w32.c (init_environment): Likewise.
6940 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6941 * xdisp.c (syms_of_xdisp): Likewise.
6942 * xfns.c (syms_of_xfns): Likewise.
6943
6195f384
DA
69442012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6945
6946 Fast save_excursion_save and save_excursion_restore.
6947 * lisp.h (struct Lisp_Excursion): New data type.
6948 (PVEC_EXCURSION): New pseudovector type.
6949 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6950 to deal with it. Adjust comments.
6951 (init_marker, attach_marker): New prototype.
6952 (unchain_marker): Adjust prototype.
6953 * marker.c (attach_marker): Change to global.
6954 (init_marker): New function.
6955 * alloc.c (Fmake_marker, build_marker): Use it.
6956 (build_marker): More easserts.
6957 (mark_object): Handle struct Lisp_Excursion.
6958 * editfns.c (save_excursion_save, save_excursion_restore):
6959 Reimplement to use struct Lisp_Excursion. Add comments.
6960
5eceb8fb
PE
69612012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6962
6963 Fix export of symbols to GDB (Bug#12036).
6964 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6965 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6966 emacs.c, as this is a more-suitable home. Had this been done earlier
6967 the fix for 12036 would have avoided some of the problems noted in
6968 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6969 would have been more obvious.
562157c8
PE
6970 * emacs.c: Do not include <verify.h>; no longer needed.
6971 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
6972 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6973 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6974 Remove; now done in lisp.h.
6975 * lisp.h (PUBLISH_TO_GDB): New macro.
6976 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6977 (DATA_SEG_BITS): Use it.
6978 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6979 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6980 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6981 not be usable in #if. This simplifies things.
6982
d6749401
JB
69832012-07-26 Juanma Barranquero <lekktu@gmail.com>
6984
6985 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6986
1781b9e9
PE
69872012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6988
d89518db 6989 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
6990 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6991 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6992 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6993 Adjust to changes in lisp.h and emacs.c, by using
6994 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6995 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6996 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6997 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6998 instead of gdb_valbits.
6999 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
7000 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
7001 instead of gdb_array_mark_flag.
7002 (xboolvector): Get size from $->size, not $->header.size.
7003 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
7004 (xreload, hook-run, hookpost-run): Remove.
7005 * emacs.c: Include <verify.h>.
7006 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
7007 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
7008 Remove.
7009 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
7010 (gdb_USE_LSB_TAG): New enum constants.
7011 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7012 Also define these as enum constants, so they're visible to GDB.
7013 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
7014 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
7015 as constants, so they're visible to GDB.
7016 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
7017 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
7018 Now enum constants, not macros, so they're visible to GDB.
7019 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
7020 more convenient now. All uses changed.
7021 (VALMASK) [USE_LSB_TAG]: Also define in this case.
7022 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
7023
3628596a
DA
70242012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
7025
7026 Explicitly free restriction data that are not needed anymore.
7027 * editfns.c (save_restriction_restore): Free restriction data.
7028
7abaf5cc
SM
70292012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
7030
7031 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
7032 add argument, tune behavior, and adjust all callers.
7033
71f88e00
PE
70342012-07-25 Paul Eggert <eggert@cs.ucla.edu>
7035
7036 Use typedef for EMACS_INT, EMACS_UINT.
7037 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
7038 than macros. This simplifies debugging in the usual case, since
7039 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
7040 and it allows expressions involving EMACS_INT casts.
7041 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
7042
57ec3034
JD
70432012-07-25 Jan Djärv <jan.h.d@swipnet.se>
7044
7045 * nsterm.m (ns_read_socket): Return early if there is a modal
7046 window (Bug#12043).
7047
8137e7b3
MR
70482012-07-25 Martin Rudalics <rudalics@gmx.at>
7049
7050 * frame.c (Fredirect_frame_focus): In doc-string don't mention
7051 that FOCUS-FRAME can be omitted.
7052
04e9897c
DA
70532012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
7054
7055 Adjust buffer text indirection counters at the end of Fkill_buffer.
7056 * buffer.c (Fkill_buffer): Adjust indirection counters when the
7057 buffer is definitely dead. This should really fix an issue reported
7058 by Christoph Scholtes again. (Bug#12007).
7059 (init_buffer_once): Initialize indirection counters of
7060 buffer_defaults and buffer_local_symbols (for sanity and safety).
7061
8a0484e1
EZ
70622012-07-24 Eli Zaretskii <eliz@gnu.org>
7063
7064 * xdisp.c (init_iterator): Don't compute dimensions of truncation
7065 and continuation glyphs on tooltip frames, leave them at zero.
7066 Avoids continued lines in tooltips. (Bug#11832)
7067
fa691a83
DA
70682012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
7069
7070 Simplify copy_overlay.
04e9897c 7071 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
7072 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
7073
436bc8e0
EZ
70742012-07-23 Eli Zaretskii <eliz@gnu.org>
7075
7076 * print.c (print_object): Don't crash when a frame's name is nil
7077 or invalid. (Bug#12025)
7078
7079 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
7080 it signals an error when a tooltip frame is being created.
7081
d7a7fda3
DA
70822012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
7083
7084 Cleanup miscellaneous objects allocation and initialization.
7085 * alloc.c (allocate_misc): Change to static. Add argument to
7086 specify the subtype. Adjust comment and users.
7087 (build_overlay): New function.
7088 * buffer.c (copy_overlays, Fmake_overlay): Use it.
7089 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
7090 (allocate_misc): Remove prototype.
7091 (build_overlay): Add prototype.
7092
70932012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
7094
7095 Swap buffer text indirection counters in Fbuffer_swap_text.
7096 * buffer.c (Fbuffer_swap_text): Swap indirections too.
7097 This avoids crash reported by Christoph Scholtes at
7098 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
7099
9d7fa573
JD
71002012-07-22 Jan Djärv <jan.h.d@swipnet.se>
7101
7102 * nsmenu.m (Popdown_data): New struct.
7103 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
7104 free Popdown_data.
7105 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
7106 (initWithContentRect): Make imgView and contentView non-static
7107 and autorelease them. Also autorelease img and matrix (Bug#12005).
7108 (dealloc): Remove (Bug#12005).
7109
0dd6d66d
DA
71102012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7111
7112 Adjust consing_since_gc when objects are explicitly freed.
7113 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
7114 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
7115 (free_cons, free_misc): Subtract object size from consing_since_gc.
7116
d36d71df
DA
71172012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7118
7119 Simplify and cleanup markers positioning code.
7120 * marker.c (attach_marker): More useful eassert.
7121 (live_buffer, set_marker_internal): New function.
7122 (Fset_marker, set_marker_restricted): Use set_marker_internal.
7123 (set_marker_both, set_marker_restricted_both): Use live_buffer.
7124
fb9ea40f
PE
71252012-07-22 Paul Eggert <eggert@cs.ucla.edu>
7126
7127 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
7128 as it's limited by the amount of memory, not by INT_MAX.
7129
2d5c5f7d
EZ
71302012-07-21 Eli Zaretskii <eliz@gnu.org>
7131
07fb592e
EZ
7132 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
7133 in special-event-map. See the discussion at
7134 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
7135 for the reasons.
7136
37a9eac8 7137 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
7138 info.dwItemData. Fixes crashes on 64-bit Windows.
7139 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 7140
c4328746
JD
71412012-07-21 Jan Djärv <jan.h.d@swipnet.se>
7142
fc0c31f8 7143 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 7144 (conversationIdentifier): Return value is NSInteger.
784051c4 7145 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 7146
6e5d1c12
CY
71472012-07-21 Chong Yidong <cyd@gnu.org>
7148
7149 * window.c (decode_any_window): Signal an error if the window is
7150 on a dead frame (Bug#11984).
7151
9928463d
DA
71522012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7153
7154 Add indirection counting to speed up Fkill_buffer.
7155 * buffer.h (struct buffer): New member.
7156 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
7157 (Fmake_indirect_buffer): Set indirection counter to -1, increment
7158 base buffer indirection counter.
7159 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
7160 (Fkill_buffer): Adjust indirection counters as needed, don't walk
7161 through buffer list if indirection counter is 0.
7162
f8643a6b
DA
71632012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7164
7165 Extend the value returned by Fgarbage_collect with heap statistics.
7166 * alloc.c (Qheap): New symbol.
7167 (syms_of_alloc): DEFSYM it.
7168 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
7169 (Fmemory_free): Remove.
7170 (syms_of_alloc): Don't defsubr it.
7171 * buffer.c (Fcompact_buffer): Remove.
7172 (syms_of_buffer): Don't defsubr it.
7173
dac616ff
DA
71742012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7175
7176 Make maybe_gc inline.
7177 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
7178 * lisp.h (consing_since_gc, gc_relative_threshold)
7179 (memory_full_cons_threshold): Revert declaration.
7180 (maybe_gc): Remove prototype, define as inline.
7181 * alloc.c: Remove old commented-out code.
7182 (consing_since_gc, gc_relative_threshold)
7183 (memory_full_cons_threshold): Revert to global.
7184 (maybe_gc): Remove.
7185
d7ea76b4
DA
71862012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7187
7188 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
7189 * lisp.h (build_unibyte_string): New function.
7190 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
7191 * sysdep.c, w32fns.c, xfns.c: Use it.
7192 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
7193 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
7194 Adjust users accordingly.
7195 * font.h (font_open_by_name): Adjust prototype.
7196
765e61e3
DA
71972012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7198
7199 Cleanup calls to Fgarbage_collect.
7200 * lisp.h (maybe_gc): New prototype.
7201 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7202 Remove declarations.
7203 * alloc.c (maybe_gc): New function.
7204 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7205 Make them static.
7206 * bytecode.c (MAYBE_GC): Use maybe_gc.
7207 * eval.c (eval_sub, Ffuncall): Likewise.
7208 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
7209 to avoid dependency from auto-save feature.
7210
52b852c7
PE
72112012-07-19 Paul Eggert <eggert@cs.ucla.edu>
7212
7213 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
7214 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
7215 'for_each_per_buffer_object_at'.
7216 All uses changed. It's better to use upper-case for macros that
7217 cannot be implemented as functions, to give the reader a clue
7218 that they're special.
7219
5db81e33
SM
72202012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7221
7222 * alloc.c (Fgarbage_collect): Tweak docstring.
7223
5b835e1d
DA
72242012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7225
7226 Tweak the value returned from Fgarbage_collect again.
7227 * alloc.c (Fgarbage_collect): New return value, as confirmed in
7228 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
7229 Adjust documentation.
7230 (total_vector_bytes): Rename to total_vector_slots, adjust
7231 accounting.
7232 (total_free_vector_bytes): Rename to total_free_vector_slots,
7233 adjust accounting.
7234 (Qstring_bytes, Qvector_slots): New symbols.
7235 (syms_of_alloc): DEFSYM them.
7236
9cd47b72
DA
72372012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7238
7239 Buffer compaction primitive which may be used from Lisp.
7240 * buffer.c (compact_buffer, Fcompact_buffer): New function.
7241 (syms_of_buffer): Register Fcompact_buffer.
7242 * alloc.c (Fgarbage_collect): Use compact_buffer.
7243 * buffer.h (compact_buffer): New prototype.
7244 (struct buffer_text): New member.
7245
d17337e5
DA
72462012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7247
7248 New macro to iterate over all buffers, miscellaneous cleanups.
7249 * lisp.h (all_buffers): Remove declaration.
7250 * buffer.h (all_buffers): Add declaration, with comment.
7251 (for_each_buffer): New macro.
7252 * alloc.c (Fgarbage_collect, mark_object): Use it.
7253 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
7254 (init_buffer): Likewise.
7255 * data.c (Fset_default): Likewise.
7256 * coding.c (code_conversion_restore): Remove redundant check
7257 for dead buffer.
7258 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
7259
60cfd278
AS
72602012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7261
7262 Fix bug that created negative-length intervals.
7263 * intervals.c (merge_interval_right, merge_interval_left):
7264 Do not zero out this interval if it is absorbed by its children,
7265 as this interval's total length doesn't change in that case. See
7266 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
7267
d06714cb
PE
72682012-07-18 Paul Eggert <eggert@cs.ucla.edu>
7269
83713154
PE
7270 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
7271 when invoking (make-bool-vector N t) and N is a positive
7272 multiple of 8 -- the last 8 bits were mistakenly cleared.
7273
d06714cb
PE
7274 Remove some struct layout assumptions in bool vectors.
7275 * alloc.c (bool_header_size): New constant.
7276 (header_size, word_size): Move earlier, as they're now used earlier.
7277 Use 'word_size' in a few more places, where it's appropriate.
7278 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
7279 padding before the data member of a bool vector.
7280 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
7281 than doing the check by hand with an abort ().
7282
464d5a5e
SM
72832012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7284
5fbc0409
SM
7285 * eval.c (Fdefvar): Don't check constants since we only set the var if
7286 it's not yet defined anyway (bug#11904).
7287
464d5a5e
SM
7288 * lisp.h (last_undo_boundary): Declare new var.
7289 * keyboard.c (command_loop_1): Set it.
7290 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
7291 were auto-added by the command loop (bug#11774).
7292
8dc2e44a
AS
72932012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7294
7295 * w32font.c (Qsymbol): Remove local definition.
7296 (syms_of_w32font): Don't DEFSYM it.
7297
169925ec
DA
72982012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7299
7300 Fix sweep_vectors to handle large bool vectors correctly.
7301 * alloc.c (sweep_vectors): Account total_vector_bytes for
7302 bool vectors larger than VBLOCK_BYTES_MAX.
7303
5fbfb018
CY
73042012-07-18 Chong Yidong <cyd@gnu.org>
7305
7306 * frame.c (x_set_frame_parameters): Revert bogus change introduced
7307 in 2012-05-25 commit by Paul Eggert (Bug#11738).
7308
3ab6e069
DA
73092012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7310
7311 Return more descriptive data from Fgarbage_collect.
7312 Suggested by Stefan Monnier in
7313 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
7314 * alloc.c (bounded_number): New function.
7315 (total_buffers, total_vectors): New variable.
7316 (total_string_size): Rename to total_string_bytes, adjust users.
7317 (total_vector_size): Rename to total_vector_bytes, adjust users.
7318 (sweep_vectors): Account total_vectors and total_vector_bytes.
7319 (Fgarbage_collect): New return value. Adjust documentation.
7320 (gc_sweep): Account total_buffers.
7321 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
7322 (VECTOR_SIZE): Remove.
7323 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
7324 (Qinterval, Qmisc): New symbols.
7325 (syms_of_data): Initialize them.
7326 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
7327 (Qcons, Qbuffer): New declarations.
7328
6d02fe5b
PE
73292012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7330
7331 * alloc.c (Fmemory_free): Account for memory-free's own storage.
7332 Round up, not down. Improve doc.
7333
b7ffe040
DA
73342012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7335
7336 Restore old code in allocate_string_data to avoid Faset breakage.
7337 Reported by Julien Danjou <julien@danjou.info> in
7338 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
7339 * alloc.c (allocate_string_data): Restore old code with minor
7340 adjustments, fix comment to explain this subtle issue.
7341
4dc7c8d5
SM
73422012-07-17 Eli Zaretskii <eliz@gnu.org>
7343
7344 Remove FILE_SYSTEM_CASE.
7345 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
7346
7347 * fileio.c (FILE_SYSTEM_CASE): Don't define.
7348 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
7349 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
7350 call-process-region passes it through expand-file-name.
7351
7352 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
7353
73542012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7355
7356 Fix crash when creating indirect buffer (Bug#11917)
7357 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7358 Don't handle unbound variables specially if non-zero.
7359 (Fbuffer_local_variables): Pass zero.
7360 (clone_per_buffer_values): Pass non-zero.
7361
73622012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7363
7364 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7365 to make the loop interruptible.
7366
73672012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7368
7369 * gnutls.c (emacs_gnutls_handshake): Only retry if
7370 GNUTLS_E_INTERRUPTED.
7371
cce7fefc
DA
73722012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7373
7374 Cleanup and convert miscellaneous checks to eassert.
7375 * alloc.c (mark_interval): Fix comment, partially rephrase
7376 old comment from intervals.h (see below).
7377 * intervals.c (find_interval, adjust_intervals_for_insertion)
7378 (delete_interval, adjust_intervals_for_deletion)
7379 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7380 Convert to eassert.
7381 (adjust_intervals_for_insertion, make_new_interval):
7382 Remove obsolete and unused code.
7383 * intervals.h (struct interval): Remove obsolete comment.
7384 * textprotp.c (erase_properties): Remove unused code.
7385 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7386 (Fremove_list_of_text_properties): Convert to eassert.
7387
9ea10cc3
CY
73882012-07-17 Chong Yidong <cyd@gnu.org>
7389
7390 * editfns.c (Finsert_char): Doc fix.
7391
3900d5de
DA
73922012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7393
7394 Fix previous change to make Fmemory_free always accurate.
7395 * alloc.c (make_interval): Update total_free_intervals.
7396 (make_float): Likewise for total_free_floats.
7397 (free_cons, Fcons): Likewise for total_free_conses.
7398 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7399 Likewise for total_free_vector_bytes.
7400 (Fmake_symbol): Likewise for total_free_symbols.
7401 (bytes_free): Remove.
7402
7098646f
DA
74032012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7404
7405 Simple free memory accounting feature.
7406 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7407 (sweep_vectors): Accumulate size of free vectors.
7408 (Fgarbage_collect): Setup bytes_free.
7409 (Fmemory_free): New function.
7410 (syms_of_alloc): Register it.
7411
22657b40
DA
74122012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7413
7414 Cleanup overlays checking.
7415 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7416 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7417 eassert and OVERLAYP.
7418 (sort_overlays): Change to use OVERLAYP.
7419
ddfc8813
RK
74202012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7421
7422 * editfns.c (Finsert_char): Make it interactive, and make the
7423 second arg optional. Copy interactive spec and docstring from
7424 ucs-insert.
7425
7c26cf3c
PE
74262012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7427
7428 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7429 Unlike the other wrapped functions, fabs has an unspecified
7430 effect on errno.
7431
5d127af9
JD
74322012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7433
7434 * nsterm.m (keyDown): Interpret flags without left/right bits
7435 as the left key (Bug#11670).
7436
6a0dd1d7
DA
74372012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7438
7439 Remove empty and useless init functions.
7440 * lisp.h (init_character_once, init_fns, init_image)
7441 (init_filelock, init_sound): Remove prototype.
7442 * character.c (init_character_once): Remove.
7443 * filelock.c (init_filelock): Likewise.
7444 * fns.c (init_fns): Likewise.
7445 * image.c (init_image): Likewise.
7446 * sound.c (init_sound): Likewise.
7447 * emacs.c (main): Adjust accordingly.
7448
7a6136fd
DA
74492012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7450
7451 * gtkutil.h: Tiny cleanups.
7452 (use_old_gtk_file_dialog): Remove useless declaration.
7453 (xg_uses_old_file_dialog): Add suggested const attribute.
7454
ce811ad9
EZ
74552012-07-15 Eli Zaretskii <eliz@gnu.org>
7456
7457 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7458 (bidi_paragraph_init): Use it to limit search forward for a strong
7459 directional character in abnormally large paragraphs full of
7460 neutral or weak characters. (Bug#11943)
7461
c9adfeaa
SF
74622012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7463
7464 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7465 the toolbar (Bug#9451).
7466 (xg_make_tool_item): Give the widget event box a transparent
7467 background.
7468
fff62aa9
DA
74692012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7470
7471 Cleanup basic allocation variables and functions.
7472 * alloc.c (ignore_warnings, init_intervals, init_float)
7473 (init_cons, init_symbol, init_marker): Remove.
7474 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7475 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7476 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7477 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7478 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7479 (staticidx, init_alloc_once, init_strings, free_ablock):
7480 Remove redundant initialization.
7481 * fns.c (init_weak_hash_tables): Remove.
7482 * lisp.h (init_weak_hash_tables): Remove prototype.
7483
9730daca
DA
74842012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7485
7486 Use zero_vector where appropriate.
7487 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7488 accordingly.
7489 * lisp.h (zero_vector): New declaration.
7490 * font.c (null_vector): Remove.
7491 (syms_of_font): Remove initialization and staticpro.
7492 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7493 * keymap.c (Faccessible_keymaps): Likewise.
7494
2e2d2a13
LL
74952012-07-15 Leo Liu <sdl.web@gmail.com>
7496
7497 * fringe.c: Fix typo in comments.
7498
cd276f6e
LL
74992012-07-14 Leo Liu <sdl.web@gmail.com>
7500
7501 * fringe.c: Add a new bitmap exclamation-mark.
7502
5a1131d9
EZ
75032012-07-14 Eli Zaretskii <eliz@gnu.org>
7504
7505 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7506
7507 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7508 (HAVE_MENUS): Don't define, defined by editing config.in with
7509 msdos/sed2v2.inp.
7510 (GMALLOC_INHIBIT_VALLOC): Don't define.
7511 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7512
22e983b7
JB
75132012-07-14 Juanma Barranquero <lekktu@gmail.com>
7514
7515 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7516
5b3f250f
GM
75172012-07-14 Glenn Morris <rgm@gnu.org>
7518
7519 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7520 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7521 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7522
33d63ff4
GM
75232012-07-13 Glenn Morris <rgm@gnu.org>
7524
5b633342
GM
7525 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7526
33d63ff4
GM
7527 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7528 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7529
b55b9f85
JD
75302012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7531
0dc8cf50
JD
7532 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7533 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7534 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7535 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7536 where appropriate.
7537 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7538 as boolean expression.
7539 (x_set_window_size): Remove unused variable toolbar.
7540 (ns_get_color_default, ns_mod_to_lisp): Remove.
7541 (ns_mouse_position): Remove unused variables xchar and ychar.
7542 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7543 (ns_set_vertical_scroll_bar): Remove unused variable count.
7544 (ns_delete_terminal): Remove unused variable i.
7545 (ns_term_init): Remove unused variables r, g and b.
7546 (mouseDown): Remove unused variable window.
7547 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7548 (initFrameFromEmacs): Remove unused variable vbextra.
7549 (mouseEntered): Remove unused variables p and dpyinfo.
7550 (mouseExited): Remove unused variables p and r.
7551 (ns_define_frame_cursor, ns_clear_frame_area)
7552 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7553 (menuDown): Assign [sender tag] to variable and cast the variable.
7554
7555 * nsterm.h (menuDown): Add id as type to argument sender.
7556 (ns_display_info_for_name): Add Lisp_Object argument.
7557 (ns_term_init): Add Lisp_Object argument.
7558 (ns_map_event_to_object): Add void argument.
7559 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7560 prototype with arguments and only declare if __OBJC__.
7561 (nxatoms_of_nsselect): Add void argument.
7562 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7563 (ns_alloc_autorelease_pool): Add void argument.
7564 (ns_release_autorelease_pool): Add void* argument.
7565 (ns_get_defaults_value): Add const char* argument.
7566
7567 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7568 (initFromContents): Use SSDATA where appropriate.
7569 (ns_update_menubar): Add braces to ambigous if-else.
7570 (initWithTitle): Put () around assignment in if statement.
7571 (ns_menu_show): Remove unused variables window and keymap.
7572 (update_frame_tool_bar): Remove unused variable selected_p.
7573 (initWithContentRect): Remove unused variable this_cmd_name.
7574
7575 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7576 appropriate.
7577 (setXBMColor): Remove unused variable len.
7578 (setPixmapData): Put () around assignment in loop statement.
7579
7580 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7581 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7582 where appropriate.
7583 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7584 around assignment in loop statement.
7585 (nsfont_open): Remove unused variable i.
7586 (nsfont_open): Remove unused variable len.
7587 (nsfont_draw): Remove unused variable cs.
7588
7589 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7590 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7591 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7592 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7593 (Fns_font_name, Fns_perform_service)
7594 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7595 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7596 (ns_set_name): Remove unused variable view.
7597 (x_set_menu_bar_lines): Remove unused variable olines.
7598 (x_set_tool_bar_lines): Remove unused variable root_window.
7599 (Fns_list_colors): Put () around assignment in while statement.
7600 (Fns_perform_service): Remove unused variable len.
7601 (Fns_display_usable_bounds): Remove unused variable top.
7602 (syms_of_nsfns): Remove unused variable i.
7603
b55b9f85
JD
7604 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7605 memcpy (Bug#11907).
7606
ed9265fc 76072012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
7608
7609 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7610 and free it with DestroyExceptionInfo (Bug#11558).
7611
ef099b57
JB
76122012-07-13 Juanma Barranquero <lekktu@gmail.com>
7613
7614 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7615 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7616 Set here, not in nt/config.nt.
7617
ea814a5d
EZ
76182012-07-13 Eli Zaretskii <eliz@gnu.org>
7619
7620 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7621 cursor overflow into the last glyph on display line when the right
7622 fringe is off. (Bug#11832)
7623
1a952767
PE
76242012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7625
7626 * xdisp.c (produce_special_glyphs): Now static.
7627 * dispextern.h (produce_special_glyphs): Remove decl.
7628
983188fd
GM
76292012-07-13 Glenn Morris <rgm@gnu.org>
7630
8d7c7eed 7631 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
7632 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7633
983188fd
GM
7634 * s/usg5-4-common.h (USG, USG5):
7635 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7636 * s/sol2-6.h (SOLARIS2):
7637 * s/irix6-5.h (IRIX6_5):
7638 * s/hpux10-20.h (USG, USG5, HPUX):
7639 * s/gnu-linux.h (USG, GNU_LINUX):
7640 * s/freebsd.h (BSD_SYSTEM):
7641 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7642 * s/cygwin.h (CYGWIN):
7643 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7644 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7645
d1e68667 76462012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
7647
7648 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 7649
6de0e799
GM
76502012-07-13 Glenn Morris <rgm@gnu.org>
7651
739ae010
GM
7652 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7653
dbee5793
GM
7654 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7655
6de0e799
GM
7656 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7657 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7658
b82da769
GM
76592012-07-12 Glenn Morris <rgm@gnu.org>
7660
4fae5a7a 7661 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
7662
7663 * process.c (init_process_emacs): Rename from init_process.
7664 The old name is also the name of a Mach system call.
7665 * lisp.h, emacs.c: Update for this name change.
7666 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7667 longer needed.
7668
5a979817
EZ
76692012-07-12 Eli Zaretskii <eliz@gnu.org>
7670
7671 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7672 memmove call that removes glyphs covered by the left truncation
7673 glyph. Improve commentary.
7674 (display_line): Fix display of continuation glyphs on GUI frames
7675 when the right fringe is turned off and variable-size fonts are
7676 used in the window. Move the code that appends a stretch glyph to
7677 produce_special_glyphs, so that it could be used for truncation
7678 and continuation glyphs alike.
7679 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7680 glyph of a suitably computed width, to align the special glyphs at
7681 the window margin. Code moved from display_line. (Bug#11832)
7682
3e91a053
GM
76832012-07-12 Glenn Morris <rgm@gnu.org>
7684
ba9e4b84
GM
7685 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7686
7687 * s/gnu-linux.h, s/hpux10-20.h:
7688 Do not unconditionally define HAVE_XRMSETDATABASE.
7689
3e91a053
GM
7690 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7691
b300b1f4
PE
76922012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7693
7694 Fix typos that broke OS X build.
7695 Reported by Randal L. Schwartz in
7696 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7697 * nsterm.m (ns_timeout): Add missing local decl.
7698 (ns_get_color): snprintf -> sprintf, to fix typo.
7699
6e777848
GM
77002012-07-12 Glenn Morris <rgm@gnu.org>
7701
3f922c37
GM
7702 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7703 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7704 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7705 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7706
0ab7b23a
GM
7707 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7708 Move PTY_OPEN to configure.
7709
6e777848
GM
7710 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7711 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7712 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7713
4a7edc24
DA
77142012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7715
7716 Use empty_unibyte_string where applicable.
7717 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7718 * lread.c (read1): Likewise.
7719 * xsettings.c (syms_of_xsettings): Likewise.
7720
308aab79
GM
77212012-07-12 Glenn Morris <rgm@gnu.org>
7722
42bd1719
GM
7723 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7724 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
7725 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7726 * s/hpux10-20.h (RUN_TIME_REMAP):
7727 * s/bsd-common.h (TABDLY): Move to configure.
7728
7729 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7730
7731 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7732
ea0bbd17 7733 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 7734 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
7735
7736 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 7737
308aab79
GM
7738 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7739 * s/template.h: Move NARROWPROTO to configure.
7740
ee1cf5cf
GM
77412012-07-11 Glenn Morris <rgm@gnu.org>
7742
30fe9bf4
GM
7743 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7744 unused since 2011-01-17 change to systty.h.
7745
ee1cf5cf
GM
7746 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7747 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7748 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7749
63e47e07
PE
77502012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7751
7752 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7753
c43fb4c3
GM
77542012-07-11 Glenn Morris <rgm@gnu.org>
7755
7756 * s/darwin.h, s/gnu-linux.h, s/template.h:
7757 Move INTERRUPT_INPUT to configure.
7758
e8df9267
DA
77592012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7760
7761 Minor adjustments to interning code.
7762 * lisp.h (intern, intern_c_string): Redefine as static inline
7763 wrappers for intern_1 and intern_c_string_1, respectively.
7764 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
7765 * lread.c (intern_1, intern_c_string_1, oblookup):
7766 Simplify Vobarray checking.
e8df9267
DA
7767 * font.c (font_intern_prop): Likewise. Adjust comment.
7768 * w32font.c (intern_font_name): Likewise.
7769
34348bd4
AS
77702012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7771
d96a1e0c
AS
7772 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7773
34348bd4
AS
7774 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7775 of Fcar/Fcdr if possible.
7776 * font.c (check_otf_features): Likewise.
7777 * fontset.c (Fnew_fontset): Likewise.
7778 * gnutls.c (Fgnutls_boot): Likewise.
7779 * minibuf.c (read_minibuf): Likewise.
7780 * msdos.c (IT_set_frame_parameters): Likewise.
7781 * xmenu.c (Fx_popup_dialog): Likewise.
7782 * w32menu.c (Fx_popup_dialog): Likewise.
7783
c8add24e
GM
77842012-07-11 Glenn Morris <rgm@gnu.org>
7785
4b575b3c
GM
7786 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7787 since nothing has defined it on these platforms.
7788
09f4e3b0
GM
7789 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7790 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7791
172bedef
GM
7792 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7793 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7794 Move CLASH_DETECTION to configure.
7795
249685df
GM
7796 * s/gnu.h: Remove file, which is now empty.
7797
c8add24e
GM
7798 * s/gnu.h, s/gnu-linux.h:
7799 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7800
b41253a3
JW
78012012-07-11 John Wiegley <johnw@newartisans.com>
7802
7803 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7804 function attribute, so we only use it if it exists in the
7805 compiler.
7806
d923b542
DA
78072012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7808
7809 Avoid call to strlen in fast_c_string_match_ignore_case.
7810 * search.c (fast_c_string_match_ignore_case): Change to use
7811 length argument. Adjust users accordingly.
7812 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7813
5ebbef1d
PE
78142012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7815
bb352260
PE
7816 Assume mkdir, rmdir.
7817 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7818 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7819
57054ddd
PE
7820 Assume rename.
7821 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7822
b747d3f7
PE
7823 Assume perror.
7824 * s/hpux10-20.h (HAVE_PERROR): Remove.
7825 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7826 Remove dummy definition, as this problem was obsolete long ago.
7827
5ebbef1d
PE
7828 Assume strerror.
7829 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7830
984e7f30
DA
78312012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7832
7833 Avoid calls to strlen in font processing functions.
7834 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
7835 (font_open_by_name): Change to use length argument.
7836 Adjust users accordingly.
d923b542
DA
7837 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7838 Adjust prototypes.
7839 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7840 Change to return ptrdiff_t.
984e7f30
DA
7841 (xfont_list_pattern, xfont_match): Use length returned by
7842 xfont_decode_coding_xlfd.
7843 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7844
20e94fdd
GM
78452012-07-11 Glenn Morris <rgm@gnu.org>
7846
9d596af3
GM
7847 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7848 Move DONT_REOPEN_PTY to configure.
7849
20e94fdd
GM
7850 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7851 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7852
e99a530f
PE
78532012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7854
22ffb973
PE
7855 Remove "#define unix" that is no longer needed (Bug#11905).
7856 * s/aix4-2.h (unix): Remove; no longer needed.
7857
e9a9ae03
PE
7858 EMACS_TIME simplification (Bug#11875).
7859 This replaces macros (which typically do not work in GDB)
7860 with functions, typedefs and enums, making the code easier to debug.
7861 The functional style also makes code easier to read and maintain.
7862 * systime.h: Include <sys/time.h> on all hosts, not just if
7863 WINDOWSNT, since 'struct timeval' is needed in general.
7864 (EMACS_TIME): Now a typedef, not a macro.
7865 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7866 not macros.
7867 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7868 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7869 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7870 (EMACS_TIME_LE): Now functions, not macros.
7871 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7872 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7873 which are not functions. All uses rewritten to use:
7874 (make_emacs_time): New function.
7875 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7876 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7877 not functions. All uses rewritten to use the following, respectively:
7878 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7879 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 7880 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
7881 * fileio.c (Fcopy_file):
7882 * xterm.c (XTflash): Get the current time closer to when it's used.
7883 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7884
ffacb126
PE
7885 * bytecode.c (targets): Suppress -Woverride-init warnings.
7886
e99a530f
PE
7887 Simplify by avoiding confusing use of strncpy etc.
7888 * doc.c (Fsnarf_documentation):
7889 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7890 * frame.c (Fmake_terminal_frame):
7891 * gtkutil.c (get_utf8_string):
7892 * lread.c (openp):
7893 * nsmenu.m (ns_update_menubar):
7894 * regex.c (regerror):
7895 Prefer memcpy to strncpy and strncat when either will do.
7896 * fileio.c (Fsubstitute_in_file_name):
7897 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7898 (menu_separator_name_p):
7899 * nsmenu.m (ns_update_menubar):
7900 Prefer memcmp to strncmp when either will do.
7901 * nsterm.m: Include <ftoastr.h>.
7902 (ns_get_color):
7903 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7904 Prefer snprintf to strncpy.
7905 * nsterm.m (ns_term_init):
7906 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7907 * nsterm.m (ns_term_init):
7908 Avoid the need for strncpy, by using build_string or
7909 make_unibyte_string directly. Use dtoastr, not snprintf.
7910 * process.c (Fmake_network_process): Diagnose service names that
7911 are too long, rather than silently truncating them or creating
7912 non-null-terminated names.
7913 (Fnetwork_interface_info): Likewise, for interface names.
7914 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7915 Prefer sprintf to strncat.
7916 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7917 Prefer vsnprintf to vsprintf + strncpy.
7918
c59592b3
GM
79192012-07-10 Glenn Morris <rgm@gnu.org>
7920
7921 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7922 Clarify fallback case.
7923
7d7bbefd
DA
79242012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7925
7926 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7927 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7928 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 7929 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
7930 where argument type is known to be a Lisp_Cons.
7931
3a4c8000
TT
79322012-07-10 Tom Tromey <tromey@redhat.com>
7933
7934 * bytecode.c (BYTE_CODE_THREADED): New macro.
7935 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7936 (enum byte_code_op): New type.
7937 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7938 (exec_byte_code): Use them. Use token threading when applicable.
7939
2a0213a6
DA
79402012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7941
7942 Optimize pure C strings initialization.
7943 * lisp.h (make_pure_string): Fix prototype.
7944 (build_pure_c_string): New function, defined as static inline. This
7945 provides a better opportunity to optimize away calls to strlen when
7946 the function is called with compile-time constant argument.
7947 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7948 argument, adjust users accordingly. Use build_pure_c_string where
7949 appropriate.
7950 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7951 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7952 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7953
cb1caeaf
DA
79542012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7955
7956 Avoid calls to strlen in miscellaneous functions.
7957 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7958 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7959 * lread.c (openp): Likewise.
7960
c293e30c
DA
79612012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7962
7963 Avoid calls to strlen in path processing functions.
7964 * fileio.c (file_name_as_directory): Add comment. Change to add
7965 srclen argument and return the length of result. Adjust users
7966 accordingly.
7967 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
7968 swap 1st and 2nd arguments to obey the common convention.
7969 Adjust users accordingly.
c293e30c
DA
7970 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7971
9e059e3f
GM
79722012-07-10 Glenn Morris <rgm@gnu.org>
7973
d02eb359
GM
7974 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7975 Move PENDING_OUTPUT_COUNT definition to configure.
7976
882cf227
GM
7977 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7978 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7979 * s/gnu.h (DATA_START): Move definitions to configure.
7980
af6e839f
GM
7981 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7982 We include usg5-4-common.h, which defines them both.
7983
40289a12
GM
7984 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7985 O_RDONLY already includes it).
7986
9e059e3f
GM
7987 Stop ns builds setting the EMACSLOADPATH environment variable.
7988 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7989 Now it does not set EMACSLOADPATH, just returns the load-path string.
7990 * nsterm.h: Update accordingly.
7991 * lread.c [HAVE_NS]: Include nsterm.h.
7992 (init_lread) [HAVE_NS]: Use ns_load_path.
7993 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7994
7c4e8ec0
GM
79952012-07-09 Glenn Morris <rgm@gnu.org>
7996
d4f600ff
GM
7997 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7998 since the included bsd-common.h does so.
7999
cbb31951
GM
8000 Stop ns builds setting the EMACSPATH environment variable.
8001 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
8002 (ns_init_paths): Do not set EMACSPATH.
8003 * nsterm.h (ns_exec_path): Add it.
8004 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
8005 Use ns_exec_path.
8006
7c4e8ec0
GM
8007 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
8008
26bccfae
PE
80092012-07-09 Paul Eggert <eggert@cs.ucla.edu>
8010
a0bee46f
PE
8011 * process.c (wait_reading_process_output): 'waitchannels' was unset
8012 when read_kbd || !NILP (wait_for_cell); fix this.
8013
5994c183
PE
8014 Add GCC-style 'const' attribute to functions that can use it.
8015 * character.h (char_resolve_modifier_mask):
8016 * keyboard.h (make_ctrl_char):
8017 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
8018 (init_character_once, next_almost_prime, init_fns, init_image)
8019 (flush_pending_output, init_sound):
8020 * mem-limits.h (start_of_data):
8021 * menu.h (finish_menu_items):
8022 Add ATTRIBUTE_CONST.
8023 * emacs.c (DEFINE_DUMMY_FUNCTION):
8024 Declare the dummy function with ATTRIBUTE_CONST.
8025 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
8026 Add decls with ATTRIBUTE_CONST.
8027
26bccfae
PE
8028 Minor improvements to make_formatted_string.
8029 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
8030 where int is good enough, as vsprintf returns an int.
8031 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
8032
a8290ec3
DA
80332012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8034
8035 Use make_formatted_string to avoid double length calculation.
8036 * lisp.h (make_formatted_string): New prototype.
8037 * alloc.c (make_formatted_string): New function.
8038 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 8039 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
8040 * editfns.c (Fcurrent_time_zone): Likewise.
8041 * filelock.c (get_boot_time): Likewise.
8042 * frame.c (make_terminal_frame, set_term_frame_name)
8043 (x_report_frame_params): Likewise.
8044 * image.c (gs_load): Likewise.
8045 * minibuf.c (get_minibuffer): Likewise.
8046 * msdos.c (dos_set_window_size): Likewise.
8047 * process.c (make_process): Likewise.
8048 * xdisp.c (ensure_echo_area_buffers): Likewise.
8049 * xsettings.c (apply_xft_settings): Likewise.
8050
d01ba2f1
GM
80512012-07-09 Glenn Morris <rgm@gnu.org>
8052
8053 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
8054 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
8055 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
8056 * nsterm.h (ns_etc_directory): Add it.
8057 * callproc.c [HAVE_NS]: Include nsterm.h.
8058 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
8059
f1f924b6
DA
80602012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8061
8062 Move marker debugging code under MARKER_DEBUG.
8063 * marker.c (MARKER_DEBUG): Move marker debugging code under
8064 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
8065 for bootstrap with --enable-checking (~3x slowdown reported
8066 by Juanma Barranquero <lekktu@gmail.com>).
8067 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
8068
ab531b66
PE
80692012-07-08 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
8072 See <http://bugs.gnu.org/11825#29>.
8073
c4b3bc8a
EZ
80742012-07-08 Eli Zaretskii <eliz@gnu.org>
8075
8076 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
8077 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
8078 (display_line): Add commentary about displaying truncation glyphs
8079 on GUI frames.
8080 (produce_special_glyphs): Move here from term.c.
8081
8082 * term.c (produce_special_glyphs): Move to xdisp.c.
8083
8084 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
8085 section.
c4b3bc8a 8086
b676b881
AS
80872012-07-07 Andreas Schwab <schwab@linux-m68k.org>
8088
f17c5273
AS
8089 * xdisp.c (display_line): Avoid warning about implicit declaration
8090 of FRAME_FONT.
8091
298819b9
AS
8092 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
8093
b676b881
AS
8094 * lisp.h: Remove empty conditional.
8095
6045c4fd
PE
80962012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8097
b3350bf9
PE
8098 * lread.c (load_path_check): Now static.
8099
6045c4fd
PE
8100 Fix some minor --with-ns problems found by static checking.
8101 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
8102 (x_set_font) [!HAVE_X_WINDOWS]:
8103 * image.c (xpm_load_image) [HAVE_NS]:
8104 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
8105 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
8106 Remove unused local.
8107 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
8108 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
8109 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
8110 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
8111 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
8112 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
8113 Fix pointer signedness problem.
8114 * xfaces.c (FRAME_X_FONT_TABLE):
8115 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
8116
929e7845
GM
81172012-07-07 Glenn Morris <rgm@gnu.org>
8118
8119 * lread.c (load_path_check): New function, split from init_lread.
8120 (init_lread): Reorganize. Motivation:
8121 If EMACSLOADPATH is set, check/warn about that rather than the
8122 defaults, which we are not going to use. Hence we can remove
8123 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
8124 Don't warn if site-lisp directories are missing.
8125 If not installed, start from a blank load-path, since
8126 PATH_LOADSEARCH refers to the eventual installation directories.
8127
58dd0aa4
EZ
81282012-07-07 Eli Zaretskii <eliz@gnu.org>
8129
8130 Support truncation and continuation glyphs on GUI frames, when
8131 fringes are disabled. (Bug#11832)
8132 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
8133 continuation glyphs even if on GUI frames.
8134 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
8135 or both, are absent.
8136 (start_display, move_it_in_display_line_to): Handle the case of a
8137 GUI frame without a fringe to display continuation or truncation
8138 glyphs.
8139 (insert_left_trunc_glyphs): Support GUI frames: make sure
8140 truncation glyphs overwrite enough glyphs from the current line to
8141 have sufficient space in pixels.
8142 (display_line): Support truncation and continuation glyphs on GUI
8143 frames. If some spare pixels are left on the line after inserting
8144 the truncation glyphs, fill that space with a stretch glyph of a
8145 suitably computed width.
8146
8147 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
8148 produce_glyphs, to support GUI sessions.
8149
31571fd7
PE
81502012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8151
5a16b9bc
PE
8152 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
8153
f3047c75
PE
8154 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
8155
31571fd7
PE
8156 Do not require float-time's arg to fit in time_t (Bug#11825).
8157 This works better on hosts where time_t is unsigned, and where
8158 float-time is applied to the (negative) difference between two times.
8159 * editfns.c (decode_time_components): Last arg is now double *,
8160 not int *, and means to store all the result as a double, without
8161 worrying about whether the seconds part fits in time_t.
8162 All callers changed.
8163 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
8164 All callers changed.
8165 (Ffloat_time): Do not fail merely because the specified time falls
8166 outside of time_t range.
8167
4516fbef
GM
81682012-07-07 Glenn Morris <rgm@gnu.org>
8169
8170 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
8171 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
8172 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
8173
07adc2c6
JB
81742012-07-07 Juanma Barranquero <lekktu@gmail.com>
8175
8176 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
8177 Update dependencies.
8178
8179 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
8180
fd573f31
PE
81812012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8182
fee5959d
PE
8183 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
8184 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
8185 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
8186 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
8187 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
8188 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
8189
fd573f31
PE
8190 * xfont.c (compare_font_names): Redo to omit the need for casts.
8191
ddadbc0e
AS
81922012-07-06 Andreas Schwab <schwab@linux-m68k.org>
8193
fca8d6b6
AS
8194 * xfns.c (Fx_change_window_property): Doc fix.
8195 * w32fns.c (Fx_change_window_property): Doc fix.
8196
ddadbc0e
AS
8197 * w32fns.c (Fx_window_property): Accept the same arguments as the
8198 X Windows version. Doc fix.
8199 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
8200
ed9265fc 82012012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
8202 Eli Zaretskii <eliz@gnu.org>
8203
8204 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
8205 Windows-specific code from nt/config.nt moved here.
8206 Obsolete settings removed.
8207
216ee680
PE
82082012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8209
8210 * process.c: Avoid unnecessary calls to gettime.
8211 (wait_reading_process_output): Don't get the time of day
8212 when gobbling data immediately and not waiting, as there's no need
8213 for it in that case. This removes a FIXME.
8214
bdd091e4
JD
82152012-07-06 Jan Djärv <jan.h.d@swipnet.se>
8216
8217 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
8218 is defined (Bug#11768).
8219
9d44f8ce
DA
82202012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8221
8222 Fix marker debugging code.
8223 * marker.c (byte_char_debug_check): Do not perform the check
8224 if buffer is not multibyte.
090bd7cb
JB
8225 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8226 Call byte_char_debug_check with correct arguments.
9d44f8ce 8227
90fc4786
DA
82282012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8229
8230 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
8231 * marker.c (byte_char_debug_check, count_markers):
8232 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
8233 (byte_debug_flag): Remove.
8234 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8235 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
8236
7b7ae965
DA
82372012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8238
4e57b342
DA
8239 Avoid code repetition in marker-related functions.
8240 * marker.c (attach_marker): New function.
8241 (Fset_marker, set_marker_restricted, set_marker_both)
8242 (set_marker_restricted_both): Use it.
8243 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
8244 Consistently rename charno to charpos.
8245 (marker_position): Add eassert.
8246 (marker_byte_position): Convert to eassert.
8247
82482012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8249
8250 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 8251 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 8252 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 8253
657924ff
DA
82542012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8255
8256 Introduce fast path for the widely used marker operation.
8257 * alloc.c (build_marker): New function.
8258 * lisp.h (build_marker): New prototype.
8259 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
8260 * composite.c (autocmp_chars): Likewise.
8261 * editfns.c (buildmark): Remove.
8262 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
8263 (save_restriction_save): Use build_marker.
8264 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
8265 * window.c (save_window_save): Likewise.
8266
041a49a6
DA
82672012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8268
8269 Do not use Fdelete_overlay in delete_all_overlays
8270 to avoid redundant calls to unchain_overlay.
8271 * buffer.c (drop_overlay): New function.
8272 (delete_all_overlays, Fdelete_overlay): Use it.
8273 * minibuf.c (get_minibuffer): Fix comment.
8274
7dca65a4
PE
82752012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8276
8277 Port to OpenBSD 5.1 amd64.
8278 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
8279 This is needed for OpenBSD, and should be harmless on all BSD systems.
8280 Also, include <sys/sysctl.h>, as it should be available on all
8281 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8282 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
8283 use p_pid member, not kp_proc.pid.
8284
8eb876e2
GM
82852012-07-06 Glenn Morris <rgm@gnu.org>
8286
8287 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
8288
38182d90
PE
82892012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8290
8291 More xmalloc and related cleanup.
8292 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
8293 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
8294 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
8295 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
8296 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
8297 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
8298 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
8299 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
8300 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
8301 * xterm.c:
8302 Omit needless casts involving void * pointers and allocation.
8303 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
8304 as the former is more robust if P's type is changed.
8305 Prefer xzalloc to xmalloc + memset 0.
8306 Simplify malloc-or-realloc to realloc.
8307 Don't worry about xmalloc returning a null pointer.
8308 Prefer xstrdup to xmalloc + strcpy.
8309 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
8310 growing it.
8311 * keyboard.c (apply_modifiers_uncached): Prefer local array to
8312 alloca of a constant.
8313
6dd5a677
EZ
83142012-07-05 Eli Zaretskii <eliz@gnu.org>
8315
8316 * xdisp.c (display_line): Fix horizontal pixel coordinates when
8317 hscroll is larger than the line width. Fixes long and futile
8318 looping inside extend_face_to_end_of_line (on a TTY) producing
8319 glyphs that are not needed and thrown away.
8320
6b312f0f
DA
83212012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8322
8323 * marker.c (set_marker_restricted_both): Simplify by using
8324 clip_to_bounds.
8325
f520ef9b
PE
83262012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8327
8328 * editfns.c (region_limit): Simplify by using clip_to_bounds.
8329
383b7c95
JD
83302012-07-05 Jan Djärv <jan.h.d@swipnet.se>
8331
8332 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
8333 not defined (Bug#11768).
8334 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
8335 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
8336 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
8337 followed by gtk_box_set_homogeneous (Bug#11768).
8338 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
8339 (update_theme_scrollbar_width, xg_create_scroll_bar):
8340 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
8341 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
8342 (is_box_type): New function (Bug#11768).
8343 (xg_tool_item_stale_p): Call is_box_type.
5293d758 8344 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
8345 with default display (Bug#11768).
8346
d6e7bf45
EZ
83472012-07-05 Eli Zaretskii <eliz@gnu.org>
8348
8349 * xdisp.c (window_hscroll_limited): New function.
8350 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
8351 coordinates when window's hscroll is set to insanely large
8352 values. (Bug#11857)
8353
431391ec
JB
83542012-07-05 Juanma Barranquero <lekktu@gmail.com>
8355
8356 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8357 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8358
23f86fce
DA
83592012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8360
8361 Cleanup xmalloc.
8362 * lisp.h (xzalloc): New prototype. Omit needless casts.
8363 * alloc.c (xzalloc): New function. Omit needless casts.
8364 * charset.c: Omit needless casts. Convert all calls to
8365 xmalloc with following memset to xzalloc.
8366 * dispnew.c: Likewise.
8367 * fringe.c: Likewise.
8368 * image.c: Likewise.
8369 * sound.c: Likewise.
8370 * term.c: Likewise.
8371 * w32fns.c: Likewise.
8372 * w32font.c: Likewise.
8373 * w32term.c: Likewise.
8374 * xfaces.c: Likewise.
8375 * xfns.c: Likewise.
8376 * xterm.c: Likewise.
8377 * atimer.c: Omit needless casts.
8378 * buffer.c: Likewise.
8379 * callproc.c: Likewise.
8380 * ccl.c: Likewise.
8381 * coding.c: Likewise.
8382 * composite.c: Likewise.
8383 * doc.c: Likewise.
8384 * doprnt.c: Likewise.
8385 * editfns.c: Likewise.
8386 * emacs.c: Likewise.
8387 * eval.c: Likewise.
8388 * filelock.c: Likewise.
8389 * fns.c: Likewise.
8390 * gtkutil.c: Likewise.
8391 * keyboard.c: Likewise.
8392 * lisp.h: Likewise.
8393 * lread.c: Likewise.
8394 * minibuf.c: Likewise.
8395 * msdos.c: Likewise.
8396 * print.c: Likewise.
8397 * process.c: Likewise.
8398 * region-cache.c: Likewise.
8399 * search.c: Likewise.
8400 * sysdep.c: Likewise.
8401 * termcap.c: Likewise.
8402 * terminal.c: Likewise.
8403 * tparam.c: Likewise.
8404 * w16select.c: Likewise.
8405 * w32.c: Likewise.
8406 * w32reg.c: Likewise.
8407 * w32select.c: Likewise.
8408 * w32uniscribe.c: Likewise.
8409 * widget.c: Likewise.
8410 * xdisp.c: Likewise.
8411 * xmenu.c: Likewise.
8412 * xrdb.c: Likewise.
8413 * xselect.c: Likewise.
8414
0497dc44
PE
84152012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8416
8417 * fileio.c (time_error_value): Check the right error number.
8418 Problem reported by Troels Nielsen in
8419 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8420
356e7178
PE
84212012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8422
4e71fd89
PE
8423 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8424 This should be fixed in a better way; see Eli Zaretskii in
8425 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8426 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8427
f0941253
PE
8428 * fileio.c (time_error_value): Rename from special_mtime.
8429 The old name's problems were noted by Eli Zaretskii in
8430 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8431
065c9eb4
PE
8432 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8433 This variable's comment says Emacs needs at least one GDB-visible
8434 symbol of type enum pvec_type, to work around GDB problems.
8435 The symbol's value doesn't matter.
8436
356e7178
PE
8437 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8438 that causes compilation to fail on pre-C99 compilers.
8439
ed9265fc 84402012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
8441
8442 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8443 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8444
3884d954
DA
84452012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8446
d209e2fb 8447 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
8448 headers for buffer_defaults and buffer_local_symbols.
8449 Reported by Juanma Barranquero <lekktu@gmail.com>.
8450
ee28be33
SM
84512012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8452
8453 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8454 * lisp.h (enum pvec_type): Use fewer bits.
8455 (PSEUDOVECTOR_SIZE_BITS): New constant.
8456 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8457 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8458 change in pvec_type.
8459 (PSEUDOVECTOR_TYPEP): New macro.
8460 (TYPED_PSEUDOVECTORP): Use it.
8461 * fns.c (internal_equal): Adapt code to extract pvectype.
8462 * emacs.c (gdb_pvec_type): Update type.
8463 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8464 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8465 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8466 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8467 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8468 abusing vector->header.next.nbytes.
8469 (live_vector_p): Use PVEC_TYPE.
8470 (mark_object): Adapt code to extract pvectype. Use switch.
8471
c7f2cd7f
PE
84722012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8473
8474 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8475 Tighten new eassert a bit.
8476
8ce70ed2
DA
84772012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8478
8479 Fix compilation with --enable-gcc-warnings and -O1
8480 optimization level.
8481 * doprnt.c (doprnt): Change type of tem to int, initialize
8482 to avoid compiler warning. Add eassert.
8483 * search.c (simple_search): Initialize match_byte to avoid
8484 compiler warning. Add eassert.
8485
dea7f1e5
PE
84862012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8487
24a212eb
PE
8488 Avoid weird behavior with large horizontal scrolls.
8489 Without this change, for example, large hscroll values would
8490 mess up Emacs's display on Fedora 15 x86, presumably due to
8491 overflows in int calculations in the display code.
8492 Also, if buffers had long lines, Emacs would freeze.
8493 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8494 (set_window_hscroll): New function, containing the old guts of
8495 Fset_window_hscroll. Return the clipped value.
8496 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8497 This avoids the need to check against PTRDIFF_MAX.
8498
dea7f1e5
PE
8499 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8500
76046526
DA
85012012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8502
8503 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8504
39adff0d
PE
85052012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8506
63807d47
PE
8507 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8508 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8509 since GCC 4.4.6 issues a bogus warning for them.
8510
39adff0d
PE
8511 Fix bugs in file timestamp newness comparisons.
8512 * fileio.c (Ffile_newer_than_file_p):
8513 * lread.c (Fload): Use full timestamp resolution of files,
8514 not just the 1-second resolution, so that files that are only
8515 slightly newer still count as newer.
8516 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8517 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8518
dbeed9a6
PE
85192012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8520
8521 * fileio.c: Improve handling of file time marker. (Bug#11852)
8522 (special_mtime): New function.
8523 (Finsert_file_contents, Fverify_visited_file_modtime):
8524 Use it to set special mtime values consistently.
8525
636334d6
AS
85262012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8527
8528 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8529 marker for non-existing file. (Bug#11852)
8530
e2017fe2
GM
85312012-07-03 Glenn Morris <rgm@gnu.org>
8532
8533 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8534 and did not make it into globals.h).
8535
404dbd37
TT
85362012-07-03 Tom Tromey <tromey@redhat.com>
8537
8538 * window.c (Fset_window_margins, Fset_window_fringes)
8539 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8540 * textprop.c (Fprevious_property_change): No longer static.
8541 * syntax.c (Fsyntax_table_p): No longer static.
8542 * process.c (Fget_process, Fprocess_datagram_address): No longer
8543 static.
8544 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8545 * keyboard.c (Fcommand_execute): No longer static.
8546 Remove EXFUN.
8547 * insdel.c (Fcombine_after_change_execute): No longer static.
8548 * image.c (Finit_image_library): No longer static.
8549 * fileio.c (Fmake_symbolic_link): No longer static.
8550 * eval.c (Ffetch_bytecode): No longer static.
8551 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
8552 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8553 No longer static.
404dbd37
TT
8554 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8555 static.
8556 * dired.c (Ffile_attributes): No longer static.
8557 * composite.c (Fcomposition_get_gstring): No longer static.
8558 * callproc.c (Fgetenv_internal): No longer static.
8559
8560 * ccl.h: Remove EXFUNs.
8561 * buffer.h: Remove EXFUNs.
8562 * dispextern.h: Remove EXFUNs.
8563 * intervals.h: Remove EXFUNs.
8564 * fontset.h: Remove EXFUN.
8565 * font.h: Remove EXFUNs.
8566 * dosfns.c (system_process_attributes): Remove EXFUN.
8567 * keymap.h: Remove EXFUNs.
8568 * lisp.h: Remove EXFUNs.
8569 * w32term.h: Remove EXFUNs.
8570 * window.h: Remove EXFUNs.
8571 * xsettings.h: Remove EXFUN.
8572 * xterm.h: Remove EXFUN.
8573
8e4fd1e1
GM
85742012-07-03 Glenn Morris <rgm@gnu.org>
8575
8576 * lisp.h (Frandom): Make it visible to C.
8577 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8578 buffer for invisible buffers. (Bug#1229)
8579
ca95b3eb
DA
85802012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8581
8582 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8583 values which aren't power of 2.
14ae4239 8584 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 8585 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
8586 accordingly.
8587
7555c33f
SM
85882012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8589
8590 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8591
8592 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8593
d12e8f5a
DA
85942012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8595
8596 * alloc.c (allocate_vector_block): Remove redundant
8597 calls to mallopt if DOUG_LEA_MALLOC is defined.
8598 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8599 avoid calls to mallopt if zero_vector is returned.
8600
296094c3
DA
86012012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8602
8603 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8604 is enabled, avoid dereferencing NULL current_sblock if
8605 running undumped.
8606
36429c89
DA
86072012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8608
8609 Cleanup basic buffer management.
8610 * buffer.h (struct buffer): Change layout to use generic vector
8611 marking code. Fix some comments. Change type of 'clip_changed'
8612 to bitfield. Remove unused #ifndef old.
8613 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8614 (GET_OVERLAYS_AT): Fix indentation.
8615 (for_each_per_buffer_object_at): New macro.
8616 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8617 (Fbuffer_local_variables): Use it.
8618 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8619 * alloc.c (allocate_buffer): Adjust to match new layout of
8620 struct buffer. Fix comment.
8621 (mark_overlay): New function.
8622 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8623 Lisp area of struct buffer.
8624 (mark_object): Use it. Adjust marking of misc objects
8625 and related comments.
8626
3b3e4cac
PE
86272012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8628
8629 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8630 wrapper that is not needed because the wrapped code is a no-op (zero
8631 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8632 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8633
cf5c0175
DA
86342012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8635
8636 * alloc.c (mark_buffer): Simplify. Remove prototype.
8637 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 8638 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
8639 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8640 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 8641
ca26824c
GM
86422012-06-30 Glenn Morris <rgm@gnu.org>
8643
2e4c5312
GM
8644 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8645
ca26824c
GM
8646 * epaths.in (PATH_SITELOADSEARCH): New.
8647 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8648 This is rather than relying on --enable-locallisppath elements
8649 having "site-lisp" in their names. (Bug#10208#25, 11658)
8650
0d23c240
EZ
86512012-06-30 Eli Zaretskii <eliz@gnu.org>
8652
c9240d7a
EZ
8653 * w32proc.c (sys_select): Accept and ignore one more argument.
8654
8655 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8656
0d23c240 8657 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 8658 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
8659
8660 * sysdep.c: Don't include dos.h and dosfns.h.
8661
8662 * process.c (sys_select):
8663 * msdos.c (sys_select): Accept one more argument and ignore it.
8664
8665 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8666 adapt data types and code to that.
8667
8668 * dosfns.c:
8669 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8670 which clashes with the gnulib function of the same name.
8671
af5a5a98
AS
86722012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8673
c5e4379c
AS
8674 * font.c (font_style_to_value, font_style_symbolic)
8675 (font_prop_validate_style): Add type checks for values in
8676 font_style_table.
8677
af5a5a98
AS
8678 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8679 argument.
8680 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8681 uses.
8682
8d38f461
EZ
86832012-06-29 Eli Zaretskii <eliz@gnu.org>
8684
2e5a6631
EZ
8685 * xdisp.c (try_window_id): Undo last change.
8686
8d38f461
EZ
8687 * w32.c (getwd): Adjust commentary about startup_dir.
8688 (init_environment): Always call sys_access, even in non-MSVC
8689 builds. Don't chdir to the directory of the Emacs executable.
8690 This undoes code from 1997 which was justified by the need to
8691 "avoid conflicts when removing and renaming directories". But its
8692 downside was that every relative file name was being interpreted
8693 relative to the directory of the Emacs executable, which can never
8694 be TRT. In particular, it broke sys_access when called with
8695 relative file names.
8696 (sys_access): Map GetLastError to errno.
8697
2af3565e
DA
86982012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8699
8700 * window.h (struct window): Change type of 'fringes_outside_margins'
8701 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 8702 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
8703 Adjust comment.
8704 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8705 to ptrdiff_t.
8706
c8d3a25c 87072012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 8708
c8d3a25c
GM
8709 * gnutls.c (emacs_gnutls_handshake):
8710 Add QUIT to make the loop interruptible.
57570cd3 8711
c8d3a25c 87122012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 8713
c8d3a25c
GM
8714 * charset.c (init_charset): Make lack of etc/charsets fatal.
8715
3e984ee8
DA
87162012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8717
8718 * editfns.c (region_limit): Fix type mismatch.
8719
ef884f23
DA
87202012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8721
8722 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8723 undefined. Convert from xassert to eassert.
8724 * nsmenu.m: Convert from xassert to eassert.
8725 * nsterm.m: Likewise.
8726
7d7e0027
SM
87272012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8728
8729 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8730
aa754e6a
PE
87312012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8732
8733 Avoid integer overflow on scroll-left and scroll-right.
8734 * window.c (HSCROLL_MAX): New macro.
8735 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8736 overflow when requested scroll falls outside ptrdiff_t range.
8737
80b00b08
DA
87382012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8739
8740 * window.h (struct window): Change type of 'hscroll',
8741 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8742 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8743 Adjust users accordingly.
8744 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8745 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8746 from EMACS_INT to ptrdiff_t.
8747 (make_window): Omit redundant initialization.
8748
62b2bcf6
JB
87492012-06-28 Juanma Barranquero <lekktu@gmail.com>
8750
8751 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8752
45942c7d
DA
87532012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8754
8755 * window.h (struct window): Change type of 'use_time' and
8756 'sequence_number' from Lisp_Object to int.
8757 * frame.c (make_frame): Adjust users accordingly.
8758 * print.c (print_object): Likewise.
8759 * window.c (select_window, Fwindow_use_time, make_parent_window)
8760 (make_window): Likewise.
8761
e509cfa6
DA
87622012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8763
8764 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8765 enabled with --enable-checking=[all,glyphs] configure option.
8766 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8767 adjust comments accordingly.
8768 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8769 undefined, adjust comments accordingly.
8770 * image.c: Likewise.
8771 * scroll.c: Likewise.
8772 * w32fns.c: Likewise.
8773 * w32term.c: Likewise.
8774 * xdisp.c: Likewise.
8775 * xfaces.c: Likewise.
8776 * xfns.c: Likewise.
8777 * xterm.c: Likewise.
8778
a54e2c05
DA
87792012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8780
8781 Generalize run-time debugging checks.
8782 * dispextern.h (XASSERTS): Remove.
8783 * fontset.c (xassert): Remove.
8784 Convert from xassert to eassert.
8785 * alloc.c: Convert from xassert to eassert.
8786 * bidi.c: Likewise.
8787 * dispnew.c: Likewise.
8788 * fns.c: Likewise.
8789 * fringe.c: Likewise.
8790 * ftfont.c: Likewise.
8791 * gtkutil.c: Likewise.
8792 * image.c: Likewise.
8793 * keyboard.c: Likewise.
8794 * menu.c: Likewise.
8795 * process.c: Likewise.
8796 * scroll.c: Likewise.
8797 * sound.c: Likewise.
8798 * term.c: Likewise.
8799 * w32console.c: Likewise.
8800 * w32fns.c: Likewise.
8801 * w32term.c: Likewise.
8802 * window.c: Likewise.
8803 * xdisp.c: Likewise.
8804 * xfaces.c: Likewise.
8805 * xfns.c: Likewise.
8806 * xselect.c: Likewise.
8807 * xterm.c: Likewise.
8808
1ec4b7b2
SM
88092012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8810
8811 * fns.c (maybe_resize_hash_table): Output message when growing the
8812 purify-hashtable.
8813
2014308a
DA
88142012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8815
8816 * alloc.c (allocate_string_data): Remove dead code.
8817 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8818 avoid GCC warning about unused macro.
8819
246155eb
DA
88202012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8821
8822 * alloc.c (allocate_string): Omit intervals initialization.
8823 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8824 as in make_pure_string and make_pure_c_string.
8825
43184b7b
DA
88262012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8827
d209e2fb 8828 * alloc.c (allocate_string): Fix last change.
43184b7b 8829
3fe6dd74
DA
88302012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8831
d209e2fb 8832 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
8833 to memset, add explicit initialization where appropriate.
8834
1ba6038a
GM
88352012-06-27 Glenn Morris <rgm@gnu.org>
8836
8837 * lisp.mk (lisp): Remove paths.elc.
8838
c89926a5
CY
88392012-06-27 Chong Yidong <cyd@gnu.org>
8840
8841 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8842
ed6b3510
JW
88432012-06-26 John Wiegley <johnw@newartisans.com>
8844
1ec4b7b2 8845 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
8846 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8847
ed6b3510
JW
8848 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8849 when building with Clang.
8850
8edd4a2b
SM
88512012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8852
8853 * eval.c (Fapply): Allow calling it with a single argument.
8854
f6f62d1b
EZ
88552012-06-26 Eli Zaretskii <eliz@gnu.org>
8856
8857 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8858 _stricmp and _strnicmp.
8859 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8860
62efea5e
DA
88612012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8862
8863 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8864 allocated window.
8865 (allocate_process): Likewise for new process.
8edd4a2b 8866 (allocate_terminal): Change to use offsetof.
62efea5e
DA
8867 (allocate_frame): Likewise.
8868 * frame.c (make_frame): Omit redundant initialization.
8869 * window.c (make_parent_window): Use memset.
8870 (make_window): Omit redundant initialization.
8871 * process.c (make_process): Omit redundant initialization.
8872 * terminal.c (create_terminal): Likewise.
8873
42997f4d
DA
88742012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8875
8876 * term.c (delete_tty): Remove redundant call to memset.
8877
1130ecfc
DA
88782012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8879
8880 * alloc.c: Remove build_string.
8881 * lisp.h: Define build_string as static inline. This provides
8882 a better opportunity to optimize away calls to strlen when the
8883 function is called with compile-time constant argument.
8884 * image.c (imagemagick_error): Convert to build_string.
8885 * w32proc.c (sys_spawnve): Likewise.
8886 * xterm.c (x_term_init): Likewise.
8887
cf38a720
PE
88882012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8889
99027bdd
PE
8890 Use sprintf return value instead of invoking strlen on result.
8891 In the old days this wasn't portable, since some sprintf
8892 implementations returned char *. But they died out years ago and
8893 Emacs already assumes sprintf returns int.
8894 Similarly for float_to_string.
8895 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8896 * ccl.c (ccl_driver):
8897 * character.c (string_escape_byte8):
8898 * data.c (Fnumber_to_string):
8899 * doprnt.c (doprnt):
8900 * print.c (print_object):
8901 * xdisp.c (message_dolog):
8902 * xfns.c (syms_of_xfns):
8903 Use sprintf or float_to_string result to avoid need to call strlen.
8904 * data.c (Fnumber_to_string):
8905 Use make_unibyte_string, since the string must be ASCII.
8906 * lisp.h, print.c (float_to_string): Now returns int length.
8907 * term.c (produce_glyphless_glyph):
8908 Use sprintf result rather than recomputing it.
8909
cf38a720
PE
8910 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8911 * Makefile.in (ALL_CFLAGS):
8912 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8913 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8914
3511c784
DA
89152012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8916
0a08eb21 8917 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
8918 strcasecmp if available.
8919 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8920
fb7da12e
AS
89212012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8922
8923 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8924 Avoid comma operator.
8925 * menu.c (push_submenu_start, push_submenu_end)
8926 (push_left_right_boundary, push_menu_pane): Likewise.
8927 * msdos.c (dos_rawgetc): Likewise.
8928
afa2ffd8
DA
89292012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8930
8931 * xfns.c (xic_create_fontsetname): Remove redundant calls
8932 to memset.
8933
b3b4476b
PE
89342012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8935
4495ff38
PE
8936 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8937 sprintf already null-terminates its output.
8938
b3b4476b
PE
8939 * xfns.c (x_window): Remove redundant cast.
8940
b00876c9
DA
89412012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8942
8943 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8944 `const char *' to `char *' to avoid compiler warning.
8945
d188e26b
PE
89462012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8947
885d1d74
PE
8948 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8949 instead of truncating it to 63 (admittedly a generous limit).
8950
d188e26b
PE
8951 * process.c: Fix spelling and caps in comments.
8952
e2f560b1
DN
89532012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8954
e86db54b 8955 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
8956 * sysdep.c (setpgrp): Remove definition, not used in this file.
8957
7583a3a1
JB
89582012-06-24 Juanma Barranquero <lekktu@gmail.com>
8959
8960 * makefile.w32-in: Update dependencies.
8961
696056c2
EZ
89622012-06-24 Eli Zaretskii <eliz@gnu.org>
8963
8964 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8965 (SYSTIME_H): Add nt/inc/sys/time.h.
8966
8967 * systime.h [WINDOWSNT]: Include sys/time.h.
8968
8969 * s/ms-w32.h (struct timespec): Definition moved from
8970 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8971
845ca893
PE
89722012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8973
8974 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8975 * buffer.h (buffer_slot_type_mismatch):
8976 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8977 * eval.c (unwind_to_catch):
8978 * image.c (my_png_error, my_error_exit):
8979 * keyboard.c (quit_throw_to_read_char, user_error)
8980 (Fexit_recursive_edit, Fabort_recursive_edit):
8981 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8982 (wrong_type_argument, buffer_overflow, __executable_start)
8983 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8984 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8985 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8986 (fatal):
8987 (child_setup) [!DOS_NT]:
8988 * lread.c (end_of_file_error, invalid_syntax):
8989 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8990 * puresize.h (pure_write_error):
8991 * search.c (matcher_overflow):
8992 * sound.c (sound_perror, alsa_sound_perror):
8993 * sysdep.c, syssignal.h (croak):
8994 * term.c (maybe_fatal, vfatal):
8995 * textprop.c (text_read_only):
8996 * undo.c (user_error):
8997 * unexmacosx.c (unexec_error):
8998 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8999 Use _Noreturn rather than NO_RETURN.
9000 No need for separate decl merely because of _Noreturn.
9001 * sound.c (sound_warning, parse_sound):
9002 Remove unnecessary forward decls.
9003
f1dd8073
PE
90042012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9005
9006 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
9007 * lisp.h (WAIT_READING_MAX): New macro.
9008 * dispnew.c (Fsleep_for, sit_for):
9009 * keyboard.c (kbd_buffer_get_event):
9010 * process.c (Faccept_process_output):
9011 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
9012 This improves on the previous patch, which introduced a bug
9013 when time_t is unsigned and as wide as intmax_t.
9014 See <http://bugs.gnu.org/9000#51>.
9015
b82c1755
EZ
90162012-06-23 Eli Zaretskii <eliz@gnu.org>
9017
9018 * dispnew.c (sit_for, Fsleep_for):
9019 * keyboard.c (kbd_buffer_get_event):
9020 * process.c (Faccept_process_output): Avoid compiler warnings when
9021 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
9022
ca300656
JB
90232012-06-23 Juanma Barranquero <lekktu@gmail.com>
9024
049ec95b
JB
9025 * makefile.w32-in: Update dependencies.
9026
ca300656
JB
9027 * w32.c (ltime): Add return type and declare static.
9028 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
9029
db7b8d06
PE
90302012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9031
9032 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
9033 Privately reported by Herbert J. Skuhra.
9034 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
9035 All uses changed.
9036 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
9037 not make_lisp_timeval, when the argument is of type EMACS_TIME.
9038
0bd8297f
EZ
90392012-06-23 Eli Zaretskii <eliz@gnu.org>
9040
96512555
EZ
9041 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
9042 last argument of make_unibyte_string.
9043
0bd8297f
EZ
9044 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
9045 language ID in the event parameters.
9046
9047 * w32term.c (w32_read_socket): Put the new keyboard codepage into
9048 event.code, not the obscure "character set ID".
9049
63def6b6
CY
90502012-06-23 Chong Yidong <cyd@gnu.org>
9051
9052 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
9053
e8a02204
EZ
90542012-06-23 Eli Zaretskii <eliz@gnu.org>
9055
388cdec0
EZ
9056 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
9057 * w32.c (fdutimens): New function.
9058
9059 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
9060
9061 * s/ms-w32.h (pselect): Redirect to sys_select.
9062
9063 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
9064
e8a02204
EZ
9065 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
9066 in the logic of incrementing and decrementing the value of
9067 use_relocatable_buffers.
9068
d054f3fb
PE
90692012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9070
9071 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
9072 Privately reported by Herbert J. Skuhra.
9073 [__FreeBSD__]: Remove "*/" typo after "#include".
9074 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
9075 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
9076 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
9077 Don't assume EMACS_TIME and struct timeval are the same type.
9078
d35af63c
PE
90792012-06-22 Paul Eggert <eggert@cs.ucla.edu>
9080
9081 Support higher-resolution time stamps (Bug#9000).
9082 The time stamps are only nanosecond-resolution at the C level,
9083 since that's the best that any real-world system supports now.
9084 But they are picosecond-resolution at the Lisp level, as that's
9085 easy, and leaves room for future OS improvements.
9086
9087 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
9088 (LIBES): Use it.
9089
9090 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
9091 Don't get current time unless it's needed.
9092
9093 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
9094 now provides it if it's absent.
9095 (start_atimer): Port to higher-res time stamps.
9096 Check for time stamp overflow. Don't get current time more
9097 often than is needed.
9098
9099 * buffer.h (struct buffer): Buffer modtime now has high resolution.
9100 Include systime.h, not time.h.
9101 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
9102
9103 * dired.c: Include stat-time.h.
9104 (Ffile-attributes): File times now have higher resolution.
9105
9106 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
9107 (struct image): Timestamp now has higher resolution.
9108
9109 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
9110 has at least microseconds now. All uses removed.
9111 (update_frame, update_single_window, update_window, update_frame_1)
9112 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 9113 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
9114
9115 * editfns.c (time_overflow): Now extern.
9116 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
9117 (float-time, Fformat_time_string, Fcurrent_time_string)
9118 (Fcurrent_time_zone): Accept and generate higher-resolution
9119 time stamps.
9120 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
9121 (decode_time_components, lisp_seconds_argument): New functions.
9122 (make_time): Now static.
9123 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
9124 Report an error if the time is invalid, rather than having the caller
9125 do that.
9126
9127 * fileio.c: Include <stat-time.h>
9128 (Fcopy_file): Copy higher-resolution time stamps.
9129 Prefer to set the time stamp via a file descriptor if that works.
9130 (Fset_file_times, Finsert_file_contents, Fwrite_region)
9131 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
9132 (Fvisited_file_modtime, Fset_visited_file_modtime):
9133 Support higher-resolution time stamps.
9134
9135 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
9136
9137 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
9138
9139 * image.c (prepare_image_for_display, clear_image_cache)
9140 (lookup_image): Port to higer-resolution time stamps.
9141
9142 * keyboard.c (start_polling, bind_polling_period):
9143 Check for time stamp overflow.
9144 (read_char, kbd_buffer_get_event, timer_start_idle)
9145 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
9146 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
9147 Port to higher-resolution time stamps. Do not assume time_t is signed.
9148 (decode_timer): New function. Timers are now vectors of length 9,
9149 not 8, to accommodate the picosecond component.
9150 (timer_check_2): Use it.
9151
9152 * nsterm.m (select_timeout, timeval_subtract): Remove.
9153 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
9154 as they're a bit more accurate and handle overflow better.
9155 (ns_select): Change prototype to be compatible with pselect.
9156 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
9157 * nsterm.h (ns_select): Adjust prototype.
9158
9159 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
9160 us-resolution time stamps.
9161 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
9162
9163 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
9164
9165 * lisp.h (time_overflow): New decl.
9166 (wait_reading_process_output): First arg is now intmax_t, not int,
9167 to accommodate larger waits.
9168
9169 * process.h (struct Lisp_Process.read_output_delay):
9170 Now counts nanoseconds, not microseconds.
9171 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
9172 EMACS_HAS_USECS.
9173 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
9174 (wait_reading_process_output):
9175 Port to ns-resolution time stamps.
9176 (Faccept_process_output, wait_reading_process_output):
9177 Check for time stamp overflow. Do not assume time_t is signed.
9178 (select_wrapper): Remove; we now use pselect.
9179 (Fprocess_attributes): Now generates ns-resolution time stamps.
9180
9181 * sysdep.c: Include utimens.h. Don't include utime.h
9182 or worry about struct utimbuf; gnulib does that for us now.
9183 (gettimeofday): Remove; gnulib provides a substitute.
9184 (make_timeval): New function.
9185 (set_file_times): Now sets ns-resolution time stamps.
9186 New arg FD; all uses changed.
9187 (time_from_jiffies, ltime_from_jiffies, get_up_time)
9188 (system_process_attributes):
9189 Now returns ns-resolution time stamp. All uses changed.
9190 Check for time stamp overflow.
9191
9192 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
9193 provides a substitute now.
9194
9195 * systime.h: Include timespec.h rather than sys/time.h and time.h,
9196 since it guarantees struct timespec.
9197 (EMACS_TIME): Now struct timespec, so that we can support
9198 ns-resolution time stamps.
9199 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
9200 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
9201 (EMACS_USECS): Remove.
9202 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
9203 so multiply the arg by 1000 before storing it.
9204 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
9205 New macros.
9206 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
9207 Port to ns-resolution time stamps.
9208 (EMACS_TIME_NEG_P): Remove; replaced by....
9209 (EMACS_TIME_SIGN): New macro.
9210 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
9211 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
9212 (set_file_times, make_time, lisp_time_argument): Adjust signature.
9213 (make_timeval, make_lisp_time, decode_time_components): New decls.
9214 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
9215 that it mishandled time_t overflow. You can't compare by subtracting!
9216 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
9217 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
9218
9219 * term.c: Include <sys/time.h>.
9220 (timeval_to_Time): New function, for proper overflow wraparound.
9221 (term_mouse_position, term_mouse_click): Use it.
9222
9223 * undo.c (record_first_change): Support higher-resolution time stamps
9224 in the undo buffer.
9225 (Fprimitive_undo): Use them when restoring time stamps.
9226
9227 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
9228 (w32_get_internal_run_time):
9229 Port to higher-resolution Emacs time stamps.
9230 (ltime): Now accepts single 64-bit integer, as that's more convenient
9231 for callers.
9232
9233 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
9234
9235 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
9236 for compatibility with pselect. Support ns-resolution time stamps.
9237
9238 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
9239
9240 * xselect.c (wait_for_property_change, x_get_foreign_selection):
9241 Check for time stamp overflow, and support ns-resolution time stamps.
9242
9243 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
9244 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
9245 (timeval_subtract): Remove; no longer needed.
9246 (XTflash, XTring_bell, x_wait_for_event):
9247 Port to ns-resolution time stamps. Don't assume time_t is signed.
9248
b6a92dfe
CY
92492012-06-22 Chong Yidong <cyd@gnu.org>
9250
9251 * xdisp.c (x_consider_frame_title): Revert last change.
9252
d251c37c
EZ
92532012-06-22 Eli Zaretskii <eliz@gnu.org>
9254
9255 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
9256 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
9257 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
9258 staticidx goes up to 1597 out of 1600 = 0x640.)
9259
f10deafb
PE
92602012-06-20 Paul Eggert <eggert@cs.ucla.edu>
9261
9262 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
9263 Otherwise, the umask might be mistakenly 0 while handling input signals.
9264
ec6de1e2
SM
92652012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
9266
9267 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
9268
28be1ada
DA
92692012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
9270
9271 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
9272 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
9273 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
9274 access to `contents' member of Lisp_Vector objects with AREF and ASET
9275 where appropriate.
9276
c6bf3022
CY
92772012-06-19 Chong Yidong <cyd@gnu.org>
9278
9279 * frame.c (delete_frame): When selecting a frame on a different
9280 text terminal, do not alter the terminal's top-frame.
9281
9282 * xdisp.c (format_mode_line_unwind_data): Record the target
9283 frame's selected window and its terminal's top-frame.
9284 (unwind_format_mode_line): Restore them.
9285 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
9286 Callers changed.
9287 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
9288 since tty frames can be explicitly named.
9289 (prepare_menu_bars): Likewise.
9290
9291 * term.c (Ftty_top_frame): New function.
9292
defd4196
PE
92932012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9294
9295 Port byte-code-meter to modern targets.
9296 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
9297 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 9298 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
9299 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
9300 (METER_1, METER_2): Simplify.
9301
1053a871
SM
93022012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
9303
9304 * data.c (Fdefalias): Return `symbol' (bug#11686).
9305
b7e8d081
MR
93062012-06-18 Martin Rudalics <rudalics@gmx.at>
9307
9308 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
9309 gets killed during executing of this function (Bug#11665).
9310 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
9311 (Vkill_buffer_query_functions): In doc-string say that functions
9312 run by this hook should not change the current buffer.
9313
7ea2b339
PE
93142012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9315
9316 Fix recently-introduced process.c problems found by static checking.
9317 * process.c (write_queue_push, write_queue_pop, send_process):
9318 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
9319 (write_queue_pop): Fix pointer signedness problem.
9320 (send_process): Remove unused local.
9321
96a313a1
CY
93222012-06-17 Chong Yidong <cyd@gnu.org>
9323
9324 * xdisp.c (redisplay_internal): No need to redisplay terminal
9325 frames that are not on top.
9326
20ca2e94
TN
93272012-06-17 Troels Nielsen <bn.troels@gmail.com>
9328
9329 * process.c (make_process): Initialize write_queue.
9330 (write_queue_push, write_queue_pop): New functions.
9331 (send_process): Use them to maintain correct ordering of process
9332 writes (Bug#10815).
9333
9a900ca9
PE
93342012-06-17 Paul Eggert <eggert@cs.ucla.edu>
9335
310fbfa8
PE
9336 * lisp.h (eassert): Assume C89 or later.
9337 This removes the need for CHECK.
9338 (CHECK): Remove. Its comments about always evaluating its
9339 argument were confusing, as 'eassert' typically does not evaluate
9340 its argument.
9341
27bb1ca4
PE
9342 * coding.c (produce_chars): Use ptrdiff_t, not int.
9343
9a900ca9
PE
9344 * xterm.c (x_draw_underwave): Check for integer overflow.
9345 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
9346
41b7f8bc 93472012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
9348
9349 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
9350 referenced (Bug#11583).
9351
9b0e3eba
AA
93522012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
9353
9354 Implement wave-style variant of underlining.
9355 * dispextern.h (face_underline_type): New enum.
9356 (face): Add field for underline type.
9357 * nsterm.m (ns_draw_underwave): New function.
9358 (ns_draw_text_decoration): Use it.
9359 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9360 New functions.
9361 (x_draw_glyph_string): Use them.
9362 * xfaces.c (Qline, Qwave): New Lisp objects.
9363 (check_lface_attrs, merge_face_ref)
1053a871
SM
9364 (Finternal_set_lisp_face_attribute, realize_x_face):
9365 Handle wave-style underline face attributes.
9b0e3eba
AA
9366 * xterm.c (x_draw_underwave): New function.
9367 (x_draw_glyph_string): Use it.
9368
0fb52f11
JB
93692012-06-16 Juanma Barranquero <lekktu@gmail.com>
9370
9371 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9372 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9373 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9374 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9375 ($(BLD)/w32select.$(O)): Update dependencies.
9376
e5560ff7
AS
93772012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9378
9379 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9380 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9381 * character.c (_fetch_multibyte_char_p): Remove.
9382 * alloc.c: Include "character.h" before "buffer.h".
9383 * bidi.c: Likewise.
9384 * buffer.c: Likewise.
9385 * bytecode.c: Likewise.
9386 * callint.c: Likewise.
9387 * callproc.c: Likewise.
9388 * casefiddle.c: Likewise.
9389 * casetab.c: Likewise.
9390 * category.c: Likewise.
9391 * cmds.c: Likewise.
9392 * coding.c: Likewise.
9393 * composite.c: Likewise.
9394 * dired.c: Likewise.
9395 * dispnew.c: Likewise.
9396 * doc.c: Likewise.
9397 * dosfns.c: Likewise.
9398 * editfns.c: Likewise.
9399 * emacs.c: Likewise.
9400 * fileio.c: Likewise.
9401 * filelock.c: Likewise.
9402 * font.c: Likewise.
9403 * fontset.c: Likewise.
9404 * fringe.c: Likewise.
9405 * indent.c: Likewise.
9406 * insdel.c: Likewise.
9407 * intervals.c: Likewise.
9408 * keyboard.c: Likewise.
9409 * keymap.c: Likewise.
9410 * lread.c: Likewise.
9411 * macros.c: Likewise.
9412 * marker.c: Likewise.
9413 * minibuf.c: Likewise.
9414 * nsfns.m: Likewise.
9415 * nsmenu.m: Likewise.
9416 * print.c: Likewise.
9417 * process.c: Likewise.
9418 * regex.c: Likewise.
9419 * region-cache.c: Likewise.
9420 * search.c: Likewise.
9421 * syntax.c: Likewise.
9422 * term.c: Likewise.
9423 * textprop.c: Likewise.
9424 * undo.c: Likewise.
9425 * unexsol.c: Likewise.
9426 * w16select.c: Likewise.
9427 * w32fns.c: Likewise.
9428 * w32menu.c: Likewise.
9429 * window.c: Likewise.
9430 * xdisp.c: Likewise.
9431 * xfns.c: Likewise.
9432 * xmenu.c: Likewise.
9433 * xml.c: Likewise.
9434 * xselect.c: Likewise.
9435
2f07e6af
EZ
94362012-06-16 Eli Zaretskii <eliz@gnu.org>
9437
1053a871
SM
9438 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9439 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 9440 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
9441 row.
9442 (handle_face_prop): Use chunk-relative overlay string index when
9443 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
9444 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9445 the rightmost. (Bug#11720)
2f07e6af 9446
29b83cec
AS
94472012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9448
9449 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9450 (CATEGORY_MEMBER): Enforce 1/0 value.
9451 * category.c (_temp_category_set): Remove.
9452
4c5501e9
EZ
94532012-06-16 Eli Zaretskii <eliz@gnu.org>
9454
9455 * window.c (Fdelete_other_windows_internal)
9456 (Fdelete_window_internal): Don't access frame's mouse highlight
9457 info of the initial frame. (Bug#11677)
9458
2b570124
PE
94592012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9460
e93864f9
PE
9461 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9462 Assume USE_2_TAGS_FOR_INTS.
9463 (xreload): Adjust $tagmask width to match recent lisp.h change.
9464
2b570124
PE
9465 Simplify lisp.h in minor ways that should not affect code.
9466 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9467 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9468 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9469 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9470 (INTTYPEBITS): New macro, for clarity.
9471 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
9472 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9473 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
9474 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9475 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9476
81755f69
JB
94772012-06-13 Juanma Barranquero <lekktu@gmail.com>
9478
9479 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9480
16192a57
GM
94812012-06-13 Glenn Morris <rgm@gnu.org>
9482
9483 * s/bsd-common.h (BSD4_3):
9484 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9485
646b5f55
AS
94862012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9487
9488 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9489 instead of union.
9490 (XLI, XIL): Define.
1053a871
SM
9491 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9492 Use them.
9493 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 9494 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 9495 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
9496 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9497 * frame.c (delete_frame): Remove outdated comment.
9498 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9499 USE_LISP_UNION_TYPE.
9500 (Fw32_unregister_hot_key): Likewise.
9501 (Fw32_toggle_lock_key): Likewise.
9502 * w32menu.c (add_menu_item): Likewise.
9503 (w32_menu_display_help): Use XIL instead of checking
9504 USE_LISP_UNION_TYPE.
9505 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9506 (init_heap): Likewise.
9507 * w32term.c (w32_read_socket): Update comment.
9508
1d3823c9
GM
95092012-06-13 Glenn Morris <rgm@gnu.org>
9510
c62ff706
GM
9511 * s/usg5-4-common.h, src/s/unixware.h:
9512 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9513
1d3823c9
GM
9514 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9515
bfe3e0a2
PE
95162012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9517
9518 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9519 * alloc.c (make_number) [!defined make_number]:
9520 Remove, as lisp.h always defines this now.
9521 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9522 (roundup_size): Verify that it is a power of 2.
9523 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9524 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9525 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9526 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9527 USE_LSB_TAG now is always defined to be either 0 or 1.
9528 All uses changed.
9529 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9530 code works fine either way, and efficiency is not a concern here,
9531 as the union type is for debugging, not for production.
9532 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9533 Use an inline function on all platforms when using the union type,
9534 since this is simpler and 'static inline' can be used portably
9535 within Emacs now.
9536 (LISP_INITIALLY_ZERO): New macro.
9537 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9538 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9539
45fa9c0f
GM
95402012-06-12 Glenn Morris <rgm@gnu.org>
9541
b4492cba
GM
9542 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9543
9544 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 9545
45fa9c0f
GM
9546 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9547 Move BROKEN_SIGIO to configure.
9548
9549 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9550 Move NO_TERMIO to configure.
9551
0e25d334
CY
95522012-06-12 Chong Yidong <cyd@gnu.org>
9553
9554 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9555 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9556 MagickExportImagePixels is undefined.
9557
43682bb6
PE
95582012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9559
9560 * image.c (imagemagick_load_image): Remove unused label.
9561
a9be7d2b
GM
95622012-06-11 Glenn Morris <rgm@gnu.org>
9563
9564 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9565 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9566 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9567 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9568
3017f87f
SM
95692012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9570
9571 * alloc.c (make_byte_code): New function.
9572 (Fmake_byte_code): Use it. Don't purify here.
9573 * lread.c (read1): Use it as well to avoid extra allocation.
9574
1b9b4cf4
CY
95752012-06-11 Chong Yidong <cyd@gnu.org>
9576
9577 * image.c (imagemagick_load_image): Implement transparency.
9578
95988fcf
AS
95792012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9580
9581 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9582 account for preceding backslashes. (Bug#11663)
9583
cd4eb164
CY
95842012-06-09 Chong Yidong <cyd@gnu.org>
9585
9586 * term.c: Support italics in capable terminals (Bug#9652).
9587 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9588 (turn_on_face): Output using TS_enter_italic_mode if available.
9589 Don't handle unused blinking and alt-charset cases.
9590 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9591 and tty_alt_charset_p cases.
9592 (tty_capable_p, init_tty): Support italics.
9593
9594 * termchar.h (struct tty_display_info): Add field for italics.
9595 Remove unused blink field.
9596
9597 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9598 Handle slant.
9599
9600 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9601 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9602 tty_alt_charset_p. Add tty_italic_p.
9603
ff88beb8
MA
96042012-06-09 Michael Albinus <michael.albinus@gmx.de>
9605
9606 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9607 dbus_type_is_basic if available.
9608 (xd_extract_signed, xd_extract_unsigned): Rename from
9609 extract_signed and extract_unsigned, respectively. Adapt callers.
9610
44286096
CY
96112012-06-09 Chong Yidong <cyd@gnu.org>
9612
1682701f
CY
9613 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9614
44286096
CY
9615 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9616 case (Bug#9752).
9617
d86feb17
PE
96182012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9619
9620 * xdisp.c (vmessage): Treat frame message as multibyte.
9621 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9622 would generate the diagnostic "Making \302\247 buffer-local while
9623 let-bound!".
9624
d5c20fe8
EZ
96252012-06-08 Eli Zaretskii <eliz@gnu.org>
9626
9627 * dispnew.c (showing_window_margins_p): Undo last change, which
9628 was done due to an inadvertent commit.
9629 (adjust_frame_glyphs_for_frame_redisplay): Do call
9630 showing_window_margins_p.
9631
513749ee
SM
96322012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9633
9634 * eval.c (Fmake_var_non_special): New primitive.
9635 (syms_of_eval): Defsubr it.
9636 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9637
d4a8f5c1
JB
96382012-06-08 Juanma Barranquero <lekktu@gmail.com>
9639
9640 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9641 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9642
8bbbc977
EZ
96432012-06-08 Eli Zaretskii <eliz@gnu.org>
9644
9645 * alloc.c (allocate_vectorlike): Fix last change.
9646
f3372c87
DA
96472012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9648
9649 Block-based vector allocation of small vectors.
9650 * lisp.h (struct vectorlike_header): New field `nbytes',
9651 adjust comment accordingly.
9652 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 9653 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
9654 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9655 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9656 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9657 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9658 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9659 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9660 (roundup_size): New constant.
9661 (struct vector_block): New data type.
9662 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 9663 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
9664 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9665 (sweep_vectors): New functions.
9666 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 9667 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
9668 or equal to VBLOCK_BYTES_MAX.
9669 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9670 (init_alloc_once): Add call to init_vectors.
9671
4f18a4ed
SM
96722012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9673
9674 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9675
86f158bc
PE
96762012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9677
9678 * doprnt.c (doprnt): Truncate multibyte char correctly.
9679 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9680 would mishandle a string argument "Xc" if X was a multibyte
9681 character of length 2: it would truncate after X's first byte
9682 rather than including all of X.
9683
c5cfcbe0
CY
96842012-06-06 Chong Yidong <cyd@gnu.org>
9685
9686 * buffer.c (word_wrap): Doc fix.
9687
c05cf390
PE
96882012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9689
9690 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9691
0c3461de
GM
96922012-06-03 Glenn Morris <rgm@gnu.org>
9693
9694 * xdisp.c (tool-bar-style): Doc fix.
9695
c71232db
UM
96962012-06-03 Ulrich Müller <ulm@gentoo.org>
9697
9698 * Makefile.in (PAXCTL): Define.
9699 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9700 binary via PaX flags if the paxctl utility is available.
9701 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9702 Restore PaX flags to their default. (Bug#11398)
9703
383f7350
CY
97042012-06-03 Chong Yidong <cyd@gnu.org>
9705
9706 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9707 buffer (Bug#11226).
9708
5f2c76c6
CY
97092012-06-03 Chong Yidong <cyd@gnu.org>
9710
9711 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9712 (note_mode_line_or_margin_highlight): If there is no help echo,
9713 use mode-line-default-help-echo. Handle the case where the mouse
9714 position is past the end of the mode line string.
9715
9716 * buffer.c (buffer_local_value_1): New function, split from
9717 Fbuffer_local_value; can return Qunbound.
9718 (Fbuffer_local_value): Use it.
9719 (Vmode_line_format): Docstring tweaks.
9720
773d47f6
PE
97212012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9722
9723 * sysdep.c (system_process_attributes): Improve comment.
9724
f2d6a3df
SM
97252012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9726
9727 * keyboard.c: Export real-this-command to Elisp.
9728 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9729 and DEFVAR it. Update all users.
9730
63810350
PE
97312012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9732
7bd5c1f4
PE
9733 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9734
63810350
PE
9735 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9736 Convert pctcpu and pctmem to Lisp float properly.
9737 Let the compiler fold better, as 100.0/0x8000 is exact.
9738
a2821611
AS
97392012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9740
9741 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9742 cons_block.
9743
5fceba1d
PE
97442012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9745
9746 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9747
c98ff5dd
DA
97482012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9749
9750 For a 'struct window', replace some Lisp_Object fields to
9751 bitfields where appropriate, remove unused fields.
9752 * window.h (struct window): Remove unused 'last_mark_x' and
9753 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 9754 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
9755 Change type of 'force_start', 'optional_new_start',
9756 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 9757 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 9758
ca34e0be
PE
97592012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9760
9761 Pacify gcc -Wdouble-precision when using Xaw.
9762 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9763 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9764 Use 'float' consistently, rather than 'float' in most places
9765 and 'double' in a couple of places.
9766
efc00ab1 97672012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
9768
9769 * xdisp.c (handle_stop): Detect whether we have overlay strings
9770 loaded by testing it->current.overlay_string_index to be
9771 non-negative, instead of checking whether n_overlay_strings is
9772 positive. (Bug#11587)
9773
efc00ab1 97742012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
9775
9776 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9777
9778 * doc.c (Fsubstitute_command_keys): Doc fix.
9779
efc00ab1 97802012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
9781
9782 * search.c (search_buffer): Remove calls to
9783 r_alloc_inhibit_buffer_relocation, as it is now called by
9784 maybe_unify_char, which was the cause of relocation of buffer text
9785 in bug#11519.
9786
efc00ab1 97872012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
9788
9789 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9790 for the duration of call to load_charset, to avoid problems with
9791 callers of maybe_unify_char that access buffer text through C
9792 pointers.
9793
9794 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9795 decrement the inhibition flag, instead of just setting or
9796 resetting it.
9797
ba93a187
PE
97982012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9799
9800 Remove obsolete '#define static' cruft.
9801 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9802 This #undef was "temporary" in 2000; it is no longer needed
9803 now that '#define static' has gone away.
9804 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9805 (gray_bitmap_bits): Remove; no longer needed.
9806 All uses replaced with definiens.
9807 * xterm.c: Include "bitmaps/gray.xbm".
9808
9e4bf381
PE
98092012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9810
9811 Clean up __executable_start, monstartup when --enable-profiling.
9812 The following changes affect the code only when profiling.
9813 * dispnew.c (__executable_start): Rename from safe_bcopy.
9814 Define only on platforms that need it.
9815 * emacs.c: Include <sys/gmon.h> when profiling.
9816 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9817 (__executable_start): Remove decl, since lisp.h does it now.
9818 (safe_bcopy): Remove decl; no longer has that name.
9819 (main): Coalesce #if into single bit of code, for simplicity.
9820 Cast pointers to uintptr_t, since standard libraries want integers
9821 and not pointers.
9822 * lisp.h (__executable_start): New decl.
9823
32d72c2f
GM
98242012-05-31 Glenn Morris <rgm@gnu.org>
9825
9826 * image.c (Fimagemagick_types): Doc fix.
9827
baac5bc7
JM
98282012-05-30 Jim Meyering <meyering@redhat.com>
9829
9830 * callproc.c (Fcall_process_region): Include directory component
9831 in mkstemp error message (Bug#11586).
9832
72cb32cf
PE
98332012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9834
9835 * alloc.c, lisp.h (make_pure_vector): Now static.
9836
61b108cc
SM
98372012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9838
9839 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9840 Move to byte-run.el.
9841 (Fautoload): Do the hash-doc more carefully.
9842 * data.c (Fdefalias): Purify definition, except for keymaps.
9843 (Qdefun): Move from eval.c.
9844 * lisp.h (Qdefun): Remove.
9845 * lread.c (read1): Tiny simplification.
9846
471fe23d
TN
98472012-05-29 Troels Nielsen <bn.troels@gmail.com>
9848
934f3f58 9849 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
9850 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9851 Bug#9642, but explicitly check that the buffer the overlay would
9852 be moved to is live and rearrange lines to make sure that errors
9853 will not put the overlay in an inconsistent state.
9854 (Fdelete_overlay): Cosmetics.
9855
85d0efd1
EZ
98562012-05-28 Eli Zaretskii <eliz@gnu.org>
9857
9858 * w32term.c (my_bring_window_to_top): New function.
9859 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
9860 could be different from the original one.
9861 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
9862 (Bug#11513)
9863
9864 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9865 by calling BringWindowToTop.
9866
9867 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9868 (WM_EMACS_END): Increase by one.
9869
da92a98c
PE
98702012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9871
9872 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9873 This avoids undefined behavior that might cause the eassert
9874 to not catch an out-of-range value.
9875
74d1f848
JB
98762012-05-28 Juanma Barranquero <lekktu@gmail.com>
9877
9878 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9879 Update dependencies.
9880
9e1a06fc
EZ
98812012-05-27 Eli Zaretskii <eliz@gnu.org>
9882
9883 * bidi.c (bidi_mirror_char): Fix last change.
9884
f3dd7312
AS
98852012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9886
9887 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9888 when referring to sectname field in printf format.
9889
81899c91
PE
98902012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9891
57b81a9f
PE
9892 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9893 Only r_alloc_inhibit_buffer_relocation needed to be added;
9894 the others were already declared.
9895
81899c91
PE
9896 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9897 before checking whether it's out of range. Put the check inside
9898 eassert. See
9899 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9900
33017faf 99012012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
9902
9903 * callproc.c (Fcall_process): Restore a line that was accidentally
9904 commented out in the 2011-02-13 change (bug#11547).
9905
33017faf 99062012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
9907
9908 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9909 defined on ralloc.c.
9910
9911 * buffer.c [REL_ALLOC]: Remove prototypes of
9912 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9913 they are now on lisp.h.
9914
9915 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9916
9917 * search.c (search_buffer): Use it to inhibit relocation of buffer
9918 text while re_search_2 is doing its job, because re_search_2 is
9919 passed C pointers to buffer text. (Bug#11519)
9920
23415acf
EZ
9921 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9922 Update value to 24.
9923
44e27368
EZ
9924 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9925 state after an additional call to move_it_in_display_line_to, keep
9926 the values of it->max_ascent and it->max_descent found for the
9927 entire line.
9928 (pos_visible_p): Revert the comparison against bottom_y to what it
9929 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9930 (Bug#11464)
9931
c1892f11
PE
99322012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9933
9934 Fix coding-related core dumps with gcc -ftrapv.
9935 The code was computing A - B, where A and B are pointers, and B is
9936 random garbage. This can lead to core dumps on platforms that
9937 have special pointer registers, and it also leads to core dumps on
9938 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9939 A - B only when B is initialized properly.
9940 * coding.c (coding_set_source, coding_set_destination): Return void.
9941 (coding_change_source, coding_change_destinations): New functions,
9942 with the old behaviors of coding_set_source and coding_set_destination.
9943 All callers that need an offset changed to use these new functions.
9944
eb7afdad
GM
99452012-05-26 Glenn Morris <rgm@gnu.org>
9946
9947 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9948
f12fdf02
EZ
99492012-05-26 Eli Zaretskii <eliz@gnu.org>
9950
53a63be6 9951 Extend mouse support on W32 text-mode console.
61b108cc
SM
9952 * xdisp.c (draw_row_with_mouse_face):
9953 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 9954
eb3f6f01 9955 * w32console.c: Include window.h.
61b108cc
SM
9956 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9957 New functions.
eb3f6f01
EZ
9958 (initialize_w32_display): Initialize mouse-highlight data.
9959
53a63be6
EZ
9960 * w32inevt.c: Include termchar.h and window.h.
9961 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9962 moves, call note_mouse_highlight. If help_echo changed, call
9963 gen_help_event to produce help-echo message in the echo area.
9964 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9965 highlight info.
9966
4cfd81f6
PE
99672012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9968
9969 * lread.c (read1): Simplify slightly to avoid an overflow warning
9970 with GCC 4.7.0 on x86-64.
9971
4446092a
EZ
99722012-05-26 Eli Zaretskii <eliz@gnu.org>
9973
9974 * bidi.c (bidi_mirror_char): Revert last change: an int is
9975 definitely wide enough here.
9976
42b2a986 99772012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 9978
42b2a986 9979 Fix integer width and related bugs (Bug#9874).
eb106a49 9980 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
9981 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9982 (string_bytes, check_sblock, allocate_string_data):
9983 (compact_small_strings, Fmake_bool_vector, make_string)
9984 (make_unibyte_string, make_multibyte_string)
9985 (make_string_from_bytes, make_specified_string)
9986 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9987 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9988 (mark_vectorlike):
9989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9990 (allocate_pseudovector):
9991 Use int, not EMACS_INT, where int is wide enough.
9992 (inhibit_garbage_collection, Fgarbage_collect):
9993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9994 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9995 int might not be wide enough.
9996 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9997 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9998 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9999 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10000 (bidi_level_of_next_char, bidi_move_to_visually_next):
10001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10002 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
10003 (Fkill_buffer, Fset_buffer_major_mode)
10004 (advance_to_char_boundary, Fbuffer_swap_text)
10005 (Fset_buffer_multibyte, overlays_at, overlays_in)
10006 (overlay_touches_p, struct sortvec, record_overlay_string)
10007 (overlay_strings, recenter_overlay_lists)
10008 (adjust_overlays_for_insert, adjust_overlays_for_delete)
10009 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
10010 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
10011 (Foverlay_recenter, last_overlay_modification_hooks_used)
10012 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
10013 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
10014 (validate_region): Omit unnecessary test for b <= e,
10015 since that's guaranteed by the previous test.
d311d28c
PE
10016 (adjust_overlays_for_delete): Avoid pos + length overflow.
10017 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
10018 (report_overlay_modification):
10019 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10020 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
10021 Omit pointer cast, which isn't needed anyway, and doesn't work
10022 after the EMACS_INT -> ptrdiff_t change.
02481186 10023 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
10024 * buffer.h: Adjust decls to match defn changes elsewhere.
10025 (struct buffer_text, struct buffer):
10026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10027 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
10028 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
10029 not int, to avoid needless 32-bit limit on 64-bit hosts.
10030 (exec_byte_code): Use tighter memory-full test, one that checks
10031 for alloca overflow. Don't compute the address of the object just
10032 before an array, as that's not portable. Use EMACS_INT, not
10033 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
10034 * callint.c (Fcall_interactively):
10035 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10036 * callproc.c (call_process_kill, Fcall_process):
10037 Don't assume pid_t fits into an Emacs fixnum.
10038 (call_process_cleanup, Fcall_process, child_setup):
10039 Don't assume pid_t fits into int.
10040 (call_process_cleanup, Fcall_process, delete_temp_file)
10041 (Fcall_process_region):
10042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10043 (Fcall_process): Simplify handling of volatile integers.
10044 Use int, not EMACS_INT, where int will do.
10045 * casefiddle.c (casify_object, casify_region, operate_on_word)
10046 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
10047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10048 (casify_object): Avoid integer overflow when overallocating buffer.
10049 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 10050 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
10051 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
10052 * category.h (CATEGORYP): Don't assume arg is nonnegative.
10053 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
10054 integers are now checked earlier. All uses replaced with XINT.
10055 (ccl_driver):
10056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10057 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
10058 (ccl_driver, Fregister_code_conversion_map):
10059 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
10060 (resolve_symbol_ccl_program): Check that vector header is in range.
10061 Always copy the vector, so that we can check its contents reliably
10062 now rather than having to recheck each instruction as it's being
10063 executed. Check that vector words fit in 'int'.
10064 (ccl_get_compiled_code, Fregister_ccl_program)
10065 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
10066 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
10067 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
10068 contents are in range.
10069 (Fccl_execute_on_string): Check that status is in range.
10070 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
10071 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
10072 Accept and return EMACS_INT, not int, because callers can pass values
10073 out of 'int' range.
10074 (c_string_width, strwidth, lisp_string_width, chars_in_text)
10075 (multibyte_chars_in_text, parse_str_as_multibyte)
10076 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
10077 (str_as_unibyte, str_to_unibyte, string_count_byte8)
10078 (string_escape_byte8, Fget_byte):
10079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 10080 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
10081 avoid mishandling large integers.
10082 * character.h: Adjust decls to match defn changes elsewhere.
10083 * charset.c (load_charset_map_from_file, find_charsets_in_text)
10084 (Ffind_charset_region):
10085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10086 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
10087 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 10088 Don't assume fixnum fits in int.
d311d28c
PE
10089 (load_charset_map_from_vector, Fmap_charset_chars):
10090 Remove now-unnecessary CHECK_NATNUMs.
10091 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
10092 Don't rely on undefined behavior with signed left shift overflow.
10093 Don't assume unsigned int fits into fixnum, or that fixnum fits
10094 into unsigned int. Don't require max_code to be a valid fixnum;
10095 that's not true for gb10830 4-byte on a 32-bit host. Allow
10096 invalid_code to be a cons, for the same reason. Require code_offset
10097 to be a character. Avoid int overflow if max_char is close
10098 to INT_MAX.
10099 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
10100 this is intended anyway and avoids some undefined behavior.
10101 (load_charset_map): Pass unsigned, not int, as 2nd arg of
10102 INDEX_TO_CODE_POINT, as that's what it expects.
10103 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
10104 * charset.h (DECODE_CHAR): Return int, not unsigned;
10105 this is what was intended anyway, and it avoids undefined behavior.
10106 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
10107 integer-overflow issues.
10108 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
10109 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
10110 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
10111 * chartab.c (Fmake_char_table, Fset_char_table_range)
10112 (uniprop_get_decoder, uniprop_get_encoder):
10113 Don't assume fixnum fits in int.
10114 * cmds.c (move_point): New function, that does the gist of
10115 Fforward_char and Fbackward_char, but does so while checking
10116 for integer overflow more accurately.
c96e5d6a 10117 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
10118 (Fforward_line, Fend_of_line, internal_self_insert)
10119 (internal_self_insert):
10120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10121 Fix a FIXME, by checking for integer overflow when calculating
10122 target_clm and actual_clm.
10123 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 10124 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
10125 (ASSURE_DESTINATION, coding_alloc_by_realloc)
10126 (coding_alloc_by_making_gap, alloc_destination)
10127 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
10128 (encode_coding_utf_16, detect_coding_emacs_mule)
10129 (decode_coding_emacs_mule, encode_coding_emacs_mule)
10130 (detect_coding_iso_2022, decode_coding_iso_2022)
10131 (encode_invocation_designation, encode_designation_at_bol)
10132 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10133 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
10134 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
10135 (encode_coding_ccl, encode_coding_raw_text)
10136 (detect_coding_charset, decode_coding_charset)
10137 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
10138 (produce_composition, produce_charset, produce_annotation)
10139 (decode_coding, handle_composition_annotation)
10140 (handle_charset_annotation, consume_chars, decode_coding_gap)
10141 (decode_coding_object, encode_coding_object, detect_coding_system)
10142 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
10143 (code_convert_region, code_convert_string)
8f50130c
PE
10144 (Fdefine_coding_system_internal)
10145 (coding_set_source, coding_set_destination):
d311d28c
PE
10146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10147 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
10148 (Fdefine_coding_system_internal):
10149 Don't assume fixnums fit in int.
10150 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 10151 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
10152 (Funencodable_char_position, Fcheck_coding_systems_region)
10153 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 10154 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 10155 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 10156 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 10157 Don't access memory outside of the args array.
d311d28c 10158 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
10159 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
10160 result of ENCODE_CHAR.
d311d28c
PE
10161 * coding.h: Adjust decls to match defn changes elsewhere.
10162 (struct coding_system):
10163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10164 * composite.c (get_composition_id, find_composition)
10165 (run_composition_function, update_compositions)
10166 (compose_text, composition_gstring_put_cache)
10167 (composition_gstring_p, composition_gstring_width)
10168 (fill_gstring_header, fill_gstring_body, autocmp_chars)
10169 (composition_compute_stop_pos, composition_reseat_it)
10170 (composition_update_it, struct position_record)
10171 (find_automatic_composition, composition_adjust_point)
10172 (Fcomposition_get_gstring, Ffind_composition_internal):
10173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10174 (update_compositions):
10175 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10176 * composite.h: Adjust decls to match defn changes elsewhere.
10177 (struct composition):
10178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10179 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
10180 Do not attempt to compute the address of the object just before a
10181 buffer; this is not portable.
10182 (Faref, Faset):
10183 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10184 (Faset): Use int, not EMACS_INT, where int is wide enough.
10185 (Fstring_to_number): Don't assume fixnums fit in int.
10186 (Frem): Don't assume arg is nonnegative.
10187 * dbusbind.c (xd_append_arg): Check for integers out of range.
10188 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 10189 (extract_signed, extract_unsigned): New functions.
243e0530
PE
10190 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
10191 (xd_get_connection_references): Return ptrdiff_t, not int.
10192 All uses changed.
10193 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
10194 (xd_read_message_1):
10195 Use int, not unsigned, where the dbus API uses int.
10196 (Fdbus_message_internal): Don't overflow mtype.
10197 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
10198 * dired.c (directory_files_internal, file_name_completion, scmp)
10199 (file_name_completion_stat):
10200 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10201 (file_name_completion): Don't overflow matchcount.
10202 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
10203 * dispextern.h: Adjust decls to match defn changes elsewhere.
10204 (struct text_pos, struct glyph, struct bidi_saved_info)
10205 (struct bidi_string_data, struct bidi_it, struct composition_it)
10206 (struct it):
10207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10208 (struct display_pos, struct composition_it, struct it):
10209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10210 * dispnew.c (increment_matrix_positions)
10211 (increment_row_positions, mode_line_string)
10212 (marginal_area_string):
10213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 10214 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
10215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10216 (duration_to_sec_usec): New function, to check for overflow better.
10217 (Fsleep_for, sit_for): Use it.
10218 * doc.c (get_doc_string, store_function_docstring):
10219 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10220 (get_doc_string, Fsnarf_documentation):
10221 Use int, not EMACS_INT, where int is wide enough.
10222 (get_doc_string):
10223 Use SAFE_ALLOCA, not alloca.
10224 Check for overflow when converting EMACS_INT to off_t.
10225 * doprnt.c (doprnt):
10226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10227 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
10228 Don't assume uid_t fits into fixnum.
10229 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
10230 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
10231 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
10232 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
10233 (general_insert_function)
10234 (Finsert_char, make_buffer_string, make_buffer_string_both)
10235 (update_buffer_properties, Fbuffer_substring)
10236 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
10237 (Fsubst_char_in_region, check_translation)
10238 (Ftranslate_region_internal, save_restriction_restore, Fformat)
10239 (transpose_markers, Ftranspose_regions):
10240 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10241 (clip_to_bounds): Move to lisp.h as an inline function).
10242 (Fconstrain_to_field): Don't assume integers are nonnegative.
10243 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
10244 (Fsubst_char_in_region, Fsave_restriction):
10245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10246 (Femacs_pid): Don't assume pid_t fits into fixnum.
10247 (lo_time): Use int, not EMACS_INT, when int suffices.
10248 (lisp_time_argument): Check for usec out of range.
10249 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
10250 (Fuser_login_name, Fuser_full_name): Signal an error
10251 if a uid argument is out of range, rather than relying on
10252 undefined behavior.
c8d5c857
PE
10253 (Fformat_time_string): Remove now-unnecessary check.
10254 lisp_time_argument checks for out-of-range usec now.
243e0530 10255 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
10256 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
10257 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
10258 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
10259 (init_cmdargs, Fdump_emacs):
10260 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10261 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
10262 the bottom (typically) 32 bits of the fixnum.
10263 * eval.c (specpdl_size, call_debugger):
10264 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10265 (when_entered_debugger, Fbacktrace_debug):
10266 Don't assume fixnum can fit in int.
10267 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
10268 the object just before a buffer; this is not portable.
10269 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
10270 (grow_specpdl, unbind_to):
10271 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10272 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
10273 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 10274 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
10275 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
10276 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
10277 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10278 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
10279 (a_write, e_write):
10280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10281 (Fcopy_file, non_regular_nbytes, read_non_regular)
10282 (Finsert_file_contents):
10283 Use int, not EMACS_INT, where int is wide enough.
10284 (READ_BUF_SIZE): Verify that it fits in int.
10285 (Finsert_file_contents): Check that counts are in proper range,
10286 rather than assuming fixnums fit into ptrdiff_t etc.
10287 Don't assume fixnums fit into int.
125b3835 10288 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
10289 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
10290 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
10291 (string_char_to_byte, string_byte_to_char)
10292 (string_make_multibyte, string_to_multibyte)
10293 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
10294 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
10295 (substring_both, Fdelete, internal_equal, Ffillarray)
10296 (Fclear_string, mapcar1)
10297 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
10298 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
10299 (larger_vector, make_hash_table, maybe_resize_hash_table)
10300 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
10301 (Fmaphash, secure_hash):
10302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10303 (concat): Check for string index and length overflow.
10304 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
10305 (Frequire):
10306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10307 (larger_vector): New API (vec, incr_min, size_max) replaces old
10308 one (vec, new_size, init). This catches size overflow.
10309 INIT was removed because it was always Qnil.
10310 All callers changed.
10311 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
10312 the upper bound on a hash table index size.
10313 (make_hash_table, maybe_resize_hash_table): Use it.
10314 (secure_hash): Computer start_byte and end_byte only after
10315 they're known to be in ptrdiff_t range.
10316 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
10317 (Ffont_get_glyphs, Ffont_at):
10318 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10319 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
10320 (Flist_fonts, Fopen_font):
10321 Don't assume fixnum can fit in int.
10322 (check_gstring): Don't assume index can fit in int.
10323 (font_match_p): Check that fixnum is a character, not a nonnegative
10324 fixnum, since the later code needs to stuff it into an int.
10325 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
10326 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
10327 conversion overflow issues.
10328 (Fopen_font): Check for integer out of range.
10329 (Ffont_get_glyphs): Don't assume index can fit in int.
10330 * font.h: Adjust decls to match defn changes elsewhere.
10331 * fontset.c (reorder_font_vector): Redo score calculation to avoid
10332 integer overflow.
10333 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
10334 printmax_t, where ptrdiff_t is wide enough.
10335 (Finternal_char_font):
10336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10337 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
10338 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
10339 (Fset_frame_position, x_set_frame_parameters)
10340 (x_set_line_spacing, x_set_border_width)
10341 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
10342 Check that fixnums are in proper range for system types.
10343 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
10344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10345 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
10346 Use SAFE_ALLOCA_LISP, not alloca.
10347 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
10348 intptr_t is wide enough.
10349 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
10350 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
10351 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
10352 Check for fixnum out of range.
10353 * ftfont.c (ftfont_list): Don't assume index fits in int.
10354 Check that fixnums are in proper range for system types.
10355 (ftfont_shape_by_flt):
10356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
10357 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10359 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10360 Check that fixnums are in proper range for system types.
10361 * gnutls.h: Adjust decls to match defn changes elsewhere.
10362 * gtkutil.c (xg_dialog_run):
10363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10364 (update_frame_tool_bar):
10365 Check that fixnums are in proper range for system types.
10366 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 10367 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
10368 * indent.c (last_known_column, last_known_column_point):
10369 (current_column_bol_cache):
10370 (skip_invisible, current_column, check_display_width):
10371 (check_display_width, scan_for_column, current_column_1)
10372 (Findent_to, Fcurrent_indentation, position_indentation)
10373 (indented_beyond_p, Fmove_to_column, compute_motion):
10374 (Fcompute_motion, Fvertical_motion):
10375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10376 (last_known_column_modified): Use EMACS_INT, not int.
10377 (check_display_width):
10378 (Fcompute_motion):
10379 Check that fixnums and floats are in proper range for system types.
10380 (compute_motion): Don't assume index or fixnum fits in int.
10381 (compute_motion, Fcompute_motion):
10382 Use int, not EMACS_INT, when it is wide enough.
10383 (vmotion): Omit local var start_hpos that is always 0; that way
10384 we don't need to worry about overflow in expressions involving it.
10385 * indent.h: Adjust decls to match defn changes elsewhere.
10386 (struct position):
10387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10388 Use int, not EMACS_INT, where int is wide enough.
10389 Remove unused members ovstring_chars_done and tab_offset;
10390 all uses removed.
10391 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10392 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10393 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10394 (make_gap, copy_text, insert, insert_and_inherit)
10395 (insert_before_markers, insert_before_markers_and_inherit)
10396 (insert_1, count_combining_before, count_combining_after)
10397 (insert_1_both, insert_from_string)
10398 (insert_from_string_before_markers, insert_from_string_1)
10399 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10400 (adjust_after_replace, adjust_after_insert, replace_range)
10401 (replace_range_2, del_range, del_range_1, del_range_byte)
10402 (del_range_both, del_range_2, modify_region)
10403 (prepare_to_modify_buffer, signal_before_change)
10404 (signal_after_change, Fcombine_after_change_execute):
10405 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10406 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10407 (balance_an_interval, split_interval_right, split_interval_left)
10408 (find_interval, next_interval, update_interval)
10409 (adjust_intervals_for_insertion, delete_node, delete_interval)
10410 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10411 (static_offset_intervals, offset_intervals)
10412 (merge_interval_right, merge_interval_left, make_new_interval)
10413 (graft_intervals_into_buffer, temp_set_point_both)
10414 (temp_set_point, set_point, adjust_for_invis_intang)
10415 (set_point_both, move_if_not_intangible, get_property_and_range)
10416 (get_local_map, copy_intervals, copy_intervals_to_string)
10417 (compare_string_intervals, set_intervals_multibyte_1):
10418 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10419 * intervals.h: Adjust decls to match defn changes elsewhere.
10420 (struct interval):
10421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10422 * keyboard.c (this_command_key_count, this_single_command_key_start)
10423 (before_command_key_count, before_command_echo_length, echo_now)
10424 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10425 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10426 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10427 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10428 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10429 (last_non_minibuf_size, last_point_position, echo_truncate)
10430 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10431 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10432 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10433 (stuff_buffered_input):
10434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10435 (last_auto_save, command_loop_1, read_char):
10436 Use EMACS_INT, not int, to avoid integer overflow.
10437 (record_char): Avoid overflow in total_keys computation.
10438 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10439 * keyboard.h: Adjust decls to match defn changes elsewhere.
10440 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10441 (Fkey_description, Fdescribe_vector, Flookup_key):
10442 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10443 (click_position): New function, to check that positions are in range.
10444 (Fcurrent_active_maps):
10445 (describe_command):
10446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10447 (Faccessible_keymaps, Fkey_description):
10448 (preferred_sequence_p):
10449 Don't assume fixnum can fit into int.
10450 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10451 Check for integer overflow in size calculations.
10452 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10453 avoid mishandling large integers.
10454 * lisp.h: Adjust decls to match defn changes elsewhere.
10455 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10456 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10457 (struct Lisp_Marker):
10458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10459 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
10460 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10461 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10462 All callers changed.
10463 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10464 Assume the arg has valid form, since it always does.
10465 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10466 unsigned integer system type.
10467 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10468 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10470 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10471 (duration_to_sec_usec): New decl.
10472 * lread.c (read_from_string_index, read_from_string_index_byte)
10473 (read_from_string_limit, readchar, unreadchar, openp)
10474 (read_internal_start, read1, oblookup):
10475 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10476 (Fload, readevalloop, Feval_buffer, Feval_region):
10477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10478 (openp): Check for out-of-range argument to 'access'.
10479 (read1): Use int, not EMACS_INT, where int is wide enough.
10480 Don't assume fixnum fits into int.
6efdadfd 10481 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
10482 (read_filtered_event): Use duration_to_sec_usec
10483 to do proper overflow checking on durations.
d311d28c
PE
10484 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10485 in size calculation.
10486 (Fexecute_kbd_macro):
10487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10488 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10489 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10490 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10491 (set_marker_both, set_marker_restricted_both, marker_position)
10492 (marker_byte_position, Fbuffer_has_markers_at):
10493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10494 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 10495 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
10496 It now merely ensures that the menu is large enough, without
10497 necessarily growing it, as this avoids some integer overflow issues.
10498 All callers changed.
10499 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10500 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10501 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10502 Use SAFE_ALLOCA_LISP, not alloca.
10503 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10504 to EMACS_INT. Check that fixnums are in proper range for system types.
10505 * minibuf.c (minibuf_prompt_width, string_to_object)
10506 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10507 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10509 (get_minibuffer, read_minibuf_unwind):
10510 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10511 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10512 this simplifies overflow checking. All callers changed.
10513 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10514 (Ftest_completion):
10515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10516 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10517 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10518 Check that fixnums are in proper range for system types.
10519 (Fx_create_frame, Fx_show_tip):
10520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10521 * nsfont.m (ns_findfonts, nsfont_list_family):
10522 Don't assume fixnum fits in long.
10523 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10525 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10526 wide enough.
17fdb222 10527 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
10528 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10529 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10530 (PRINTDECLARE, PRINTPREPARE):
10531 (strout, print_string):
10532 (print, print_preprocess, print_check_string_charset_prop)
10533 (print_object):
10534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10535 (PRINTDECLARE):
10536 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10537 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10538 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 10539 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 10540 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
10541 (print_error_message): Use SAFE_ALLOCA, not alloca.
10542 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
10543 (print_depth, new_backquote_output, print_number_index):
10544 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
10545 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10546 (Fset_process_window_size, Fformat_network_address)
10547 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 10548 (sigchld_handler):
d311d28c 10549 Check that fixnums are in proper range for system types.
d44287d4 10550 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
10551 Check for process-ids out of pid_t range rather than relying on
10552 undefined behavior.
e4d81efc 10553 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
10554 (Fformat_network_address, read_process_output, send_process)
10555 (Fprocess_send_region, status_notify):
10556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10557 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10558 (wait_reading_process_output, read_process_output, exec_sentinel):
10559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10560 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10561 (Faccept_process_output): Use duration_to_sec_usec to do proper
10562 overflow checking on durations.
dde14581
PE
10563 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10564 Don't assume pid_t fits in int.
02481186
PE
10565 * process.h (struct Lisp_Process): Members tick and update_tick
10566 are now of type EMACS_INT, not int.
b62b53e8
PE
10567 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10568 configured --with-wide-int.
d311d28c
PE
10569 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10570 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10571 * search.c (looking_at_1, string_match_1):
10572 (fast_string_match, fast_c_string_match_ignore_case)
10573 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10574 (scan_newline, find_before_next_newline, search_command)
10575 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10576 (set_search_regs, wordify):
10577 (Freplace_match):
10578 (Fmatch_data):
10579 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10580 (string_match_1, search_buffer, set_search_regs):
10581 (Fmatch_data):
10582 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10583 (wordify): Check for overflow in size calculation.
10584 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10585 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10586 Check that fixnums are in proper range for system types.
10587 * sound.c (struct sound_device)
10588 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10590 (Fplay_sound_internal):
10591 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 10592 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
10593 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10594 (Fparse_partial_sexp):
10595 Don't assume fixnums can fit in int.
10596 (struct lisp_parse_state, find_start_pos, find_start_value)
10597 (find_start_value_byte, find_start_begv)
10598 (update_syntax_table, char_quoted, dec_bytepos)
10599 (find_defun_start, prev_char_comend_first, back_comment):
10600 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10601 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10603 (Finternal_describe_syntax_value): Check that match_lisp is a
10604 character, not an integer, since the code stuffs it into int.
10605 (scan_words, scan_sexps_forward):
10606 Check that fixnums are in proper range for system types.
10607 (Fforward_word):
10608 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10609 (scan_sexps_forward):
10610 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10611 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10612 * syntax.h: Adjust decls to match defn changes elsewhere.
10613 (struct gl_state_s):
10614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
10615 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10616 MOST_POSITIVE_FIXNUM.
d311d28c
PE
10617 * sysdep.c (wait_for_termination_1, wait_for_termination)
10618 (interruptible_wait_for_termination, mkdir):
10619 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10620 (emacs_read, emacs_write):
10621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
10622 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10623 and double all fit in int.
d311d28c
PE
10624 * term.c (set_tty_color_mode):
10625 Check that fixnums are in proper range for system types.
10626 * termhooks.h (struct input_event):
10627 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10628 * textprop.c (validate_interval_range, interval_of)
10629 (Fadd_text_properties, set_text_properties_1)
10630 (Fremove_text_properties, Fremove_list_of_text_properties)
10631 (Ftext_property_any, Ftext_property_not_all)
10632 (copy_text_properties, text_property_list, extend_property_ranges)
10633 (verify_interval_modification):
10634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10635 (Fnext_single_char_property_change)
10636 (Fprevious_single_char_property_change):
10637 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
10638 (copy_text_properties):
10639 Check for integer overflow in index calculation.
d311d28c
PE
10640 * undo.c (last_boundary_position, record_point, record_insert)
10641 (record_delete, record_marker_adjustment, record_change)
10642 (record_property_change):
10643 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10644 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10645 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10646 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10647 (Fx_hide_tip, Fx_file_dialog):
10648 * w32menu.c (set_frame_menubar):
10649 Use ptrdiff_t, not int, for consistency with rest of code.
10650 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10651 (select_window, Fdelete_other_windows_internal)
10652 (window_scroll_pixel_based, window_scroll_line_based)
10653 (Frecenter, Fset_window_configuration):
10654 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10655 (Fset_window_hscroll, run_window_configuration_change_hook)
10656 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 10657 (Fscroll_other_window, Frecenter):
d311d28c
PE
10658 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10659 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10660 Don't assume fixnum fits in int.
10661 (Fset_window_scroll_bars):
10662 Check that fixnums are in proper range for system types.
10663 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10664 (string_pos, c_string_pos, number_of_chars, init_iterator)
10665 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10666 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10667 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
10668 (face_before_or_after_it_pos, handle_invisible_prop)
10669 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
10670 (display_prop_intangible_p, string_buffer_position_lim)
10671 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10672 (get_overlay_strings_1, get_overlay_strings)
10673 (iterate_out_of_display_property, forward_to_next_line_start)
10674 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10675 (get_next_display_element, set_iterator_to_next)
10676 (get_visually_first_element, compute_stop_pos_backwards)
10677 (handle_stop_backwards, next_element_from_buffer)
10678 (move_it_in_display_line_to, move_it_in_display_line)
10679 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10680 (add_to_log, message_dolog, message_log_check_duplicate)
10681 (message2, message2_nolog, message3, message3_nolog
10682 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10683 (current_message_1, truncate_echo_area, truncate_message_1)
10684 (set_message, set_message_1, store_mode_line_noprop)
10685 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10686 (text_outside_line_unchanged_p, check_point_in_composition)
10687 (reconsider_clip_changes)
10688 (redisplay_internal, set_cursor_from_row, try_scrolling)
10689 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10690 (redisplay_window, find_last_unchanged_at_beg_row)
10691 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10692 (trailing_whitespace_p, find_row_edges, display_line)
10693 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10694 (display_mode_element, store_mode_line_string)
10695 (pint2str, pint2hrstr, decode_mode_spec)
10696 (display_count_lines, display_string, draw_glyphs)
10697 (x_produce_glyphs, x_insert_glyphs)
10698 (rows_from_pos_range, mouse_face_from_buffer_pos)
10699 (fast_find_string_pos, mouse_face_from_string_pos)
10700 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10701 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10702 (safe_call, init_from_display_pos, handle_fontified_prop)
10703 (handle_single_display_spec, load_overlay_strings)
10704 (with_echo_area_buffer, setup_echo_area_for_printing)
10705 (display_echo_area, echo_area_display)
10706 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10707 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
10708 (redisplay_window, dump_glyph_row, display_mode_line)
10709 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 10710 (handle_display_spec, display_prop_string_p):
d311d28c
PE
10711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10712 (handle_single_display_spec, build_desired_tool_bar_string)
10713 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10714 (get_specified_cursor_type):
10715 Check that fixnums are in proper range for system types.
10716 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10717 (Flookup_image_map):
10718 Don't assume fixnums fit in int.
10719 (compare_overlay_entries):
10720 Avoid mishandling comparisons due to subtraction overflow.
10721 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10722 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10723 (handle_tool_bar_click):
10724 Use int, not unsigned, since we prefer signed and the signedness
10725 doesn't matter here.
10726 (get_next_display_element, next_element_from_display_vector):
10727 Use int, not EMACS_INT, when int is wide enough.
10728 (start_hourglass): Use duration_to_sec_usec to do proper
10729 overflow checking on durations.
10730 * xfaces.c (Fbitmap_spec_p):
10731 Check that fixnums are in proper range for system types.
10732 (compare_fonts_by_sort_order):
10733 Avoid mishandling comparisons due to subtraction overflow.
10734 (Fx_family_fonts, realize_basic_faces):
10735 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10736 (Fx_family_fonts):
10737 Don't assume fixnum fits in int.
10738 Use SAFE_ALLOCA_LISP, not alloca.
10739 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10740 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10741 (face_at_buffer_position, face_for_overlay_string)
10742 (face_at_string_position):
10743 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10744 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10745 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10746 (Fx_show_tip):
10747 Check that fixnums are in proper range for system types.
10748 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10749 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10750 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10751 (Fx_change_window_property): Don't assume fixnums fit in int.
10752 * xfont.c (xfont_chars_supported):
10753 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10754 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10755 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10756 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10757 * xml.c (parse_region):
10758 * xrdb.c (magic_file_p):
10759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10760 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10761 (x_get_local_selection, x_reply_selection_request)
10762 (x_handle_selection_request, wait_for_property_change):
10763 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10764 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10765 short is wide enough.
10766 (x_send_client_event): Don't assume fixnum fits in int.
10767 * xterm.c (x_x_to_emacs_modifiers):
10768 Don't assume EMACS_INT overflows nicely into int.
10769 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10770 may come from Lisp.
10771 (handle_one_xevent): NATNUMP can eval its arg twice.
10772 (x_connection_closed):
10773 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10774 * xterm.h: Adjust decls to match defn changes elsewhere.
10775 (struct scroll_bar): Use struct vectorlike_header
10776 rather than rolling our own approximation.
10777 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10778
c6574eb5
GM
107792012-05-25 Glenn Morris <rgm@gnu.org>
10780
10781 * lisp.mk (lisp): Update for more files being compiled now.
10782
e8d32c7e
SM
107832012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10784
48def666
SM
10785 * lread.c: Remove `read_pure' which makes no difference.
10786 (read_pure): Remove var.
10787 (unreadpure): Remove function.
10788 (readevalloop): Don't call read_list with -1 flag.
10789 (read1, read_vector): Don't test read_pure any more.
10790 (read_list): Simplify.
10791
e8d32c7e
SM
10792 * fileio.c, character.h: Minor style tweaks.
10793
4b2addb7
DA
107942012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10795
10796 * window.h (clip_changed): Remove useless declaration.
10797
584461b2
JB
107982012-05-22 Juanma Barranquero <lekktu@gmail.com>
10799
10800 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10801 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10802
34374650
PE
108032012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10804
10805 Remove src/m/*.
10806 This directory predates autoconf and is no longer needed nowadays.
10807 Move its few remaining bits of functionality to where they're needed.
10808 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10809 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10810 * m/template.h: Remove.
10811 * Makefile.in (M_FILE): Remove. All uses removed.
10812 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10813 * lisp.h (USE_LSB_TAG):
10814 * mem-limits.h (EXCEEDS_LISP_PTR):
10815 Use VAL_MAX, not VALBITS, in #if.
10816 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10817 (EMACS_UINT): Define unconditionally now.
10818 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10819 (BITS_PER_EMACS_INT): New constants, replacing
10820 what used to be in config.h, but not useful in #if.
10821 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10822 define them any more.
10823 (VAL_MAX): New macro.
10824 (VALMASK): Use it.
10825 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10826 BITS_PER_EMACS_INT, in #if.
10827 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10828 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10829 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10830 * s/ms-w32.h (DATA_START):
10831 Move here from removed file m/intel386.h.
10832 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10833 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10834
261cb4bb
PE
108352012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10836
10837 Assume C89 or later.
10838 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10839 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10840 (xrealloc):
10841 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10842 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10843 * textprop.c, tparam.c (NULL): Remove.
10844 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10845 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10846 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10847 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10848 * xterm.c (input_signal_count): Assume volatile works.
10849
ff23cd9f
KB
108502012-05-21 Ken Brown <kbrown@cornell.edu>
10851
10852 * xgselect.c (xg_select): Fix first argument in call to 'select'
10853 (bug#11508).
10854
1b170bc6
KB
108552012-05-20 Ken Brown <kbrown@cornell.edu>
10856
10857 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 10858 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 10859
b2f4d39f
KB
108602012-05-19 Ken Brown <kbrown@cornell.edu>
10861
10862 * xfns.c (x_in_use): Remove `static' qualifier.
10863 * xterm.h (x_in_use): Declare.
10864 * xgselect.c: Include xterm.h.
10865 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10866 and `display_arg' (bug#9754).
10867
003fdae2
PE
108682012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10869
9232a6d9
PE
10870 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10871
003fdae2
PE
10872 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10873 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10874
784b56e2
EZ
108752012-05-18 Eli Zaretskii <eliz@gnu.org>
10876
10877 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10878
10879 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 10880 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
10881
10882 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10883 reference to image_cache->refcount.
10884 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10885
a0a79cde
JL
108862012-05-17 Juri Linkov <juri@jurta.org>
10887
10888 * search.c (Fword_search_regexp, Fword_search_backward)
10889 (Fword_search_forward, Fword_search_backward_lax)
10890 (Fword_search_forward_lax): Move functions to isearch.el
10891 (bug#10145, bug#11381).
10892
b0572523
PE
108932012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10894
10895 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10896
9660f5fc
SM
108972012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10898
10899 * lread.c (init_obarray): Declare Qt and Qnil as special.
10900
4374de83
GM
109012012-05-14 Glenn Morris <rgm@gnu.org>
10902
10903 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 10904 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 10905
dc44c39a
PE
109062012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10907
078c97cb
PE
10908 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10909
dc44c39a
PE
10910 * unexaix.c: Port to more-recent AIX compilers.
10911 (report_error, report_error_1, make_hdr, copy_sym)
10912 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10913 Make arguments const char *, not char *, to avoid violations of C
10914 standard and to fix some AIX warnings reported by Gilles Pion.
10915
e18afed7 109162012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
10917
10918 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10919 already have overlays loaded.
10920 (handle_single_display_spec): Before returning without displaying
10921 fringe bitmap, synchronize the bidi iterator with the main display
10922 iterator, by calling iterate_out_of_display_property.
10923 (iterate_out_of_display_property): Detect buffer iteration by
10924 testing that it->string is a Lisp string.
10925 (get_next_display_element): When the current object is exhausted,
10926 and there's something on it->stack, call set_iterator_to_next to
10927 proceed with what's on the stack, instead of returning zero.
10928 (set_iterator_to_next): If called at the end of a Lisp string,
10929 proceed to consider_string_end without incrementing string
10930 position. Don't increment display vector index past the end of
10931 the display vector. (Bug#11417)
c8fb9dc6
EZ
10932 (pos_visible_p): Don't report a position visible when move_it_to
10933 stopped at the last line of window, which happens to be scanned
10934 backwards by the bidi iteration. (Bug#11464)
ac268e67 10935
e18afed7 109362012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
10937
10938 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10939 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
10940 are on a TTY, and thus unable to display on the fringes.
10941 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
10942 so we need to signal to the caller that this is a "replacing"
10943 display spec. This fixes display when the spec is invalid or we
10944 are on a TTY.
10945
e18afed7 109462012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
10947
10948 * unexaix.c (make_hdr): Fix typo in prototype.
10949 This bug broke the build on AIX. Problem reported by Gilles Pion.
10950
9d0a235a
MA
109512012-05-14 Michael Albinus <michael.albinus@gmx.de>
10952
10953 * keyboard.c (kbd_buffer_get_event): Read special events also in
10954 batch mode. (Bug#11415)
10955
9e6b06ed
GM
109562012-05-12 Glenn Morris <rgm@gnu.org>
10957
10958 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10959
c1a1d7a3
EZ
109602012-05-12 Eli Zaretskii <eliz@gnu.org>
10961
10962 * lisp.mk (lisp): Add newcomment.elc.
10963
3fe7cdc8
GM
109642012-05-12 Glenn Morris <rgm@gnu.org>
10965
10966 * Makefile.in (MKDIR_P): New, set by configure.
10967 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10968
53f7d2c0
PE
109692012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10970
10971 Remove unused function hourglass_started.
10972 * dispextern.h (hourglass_started):
10973 * w32fns.c (hourglass_started):
10974 * xdisp.c (hourglass_started): Remove.
10975
75aafb17
JB
109762012-05-10 Juanma Barranquero <lekktu@gmail.com>
10977
10978 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10979 Update dependencies.
10980
12959e8e
PE
109812012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10982
97107e2e
PE
10983 * xgselect.c (xg_select): Put maxfds+1 into a var.
10984 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10985
12959e8e
PE
10986 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10987
836d29b3
DA
109882012-05-10 Dave Abrahams <dave@boostpro.com>
10989
10990 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10991 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10992
5cb67954
MA
109932012-05-09 Michael Albinus <michael.albinus@gmx.de>
10994
10995 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 10996 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
10997 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10998 Initialize xd_registered_buses.
10999
3478ec45
PE
110002012-05-09 Paul Eggert <eggert@cs.ucla.edu>
11001
b263a6b0
PE
11002 Untag more efficiently if USE_LSB_TAG.
11003 This is based on a proposal by YAMAMOTO Mitsuharu in
11004 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
11005 For an admittedly artificial (nth 8000 longlist) benchmark on
11006 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
11007 Emacs's overall text size by 1%.
11008 * lisp.h (XUNTAG): New macro.
11009 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
11010 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
11011 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
11012 * eval.c (Fautoload):
11013 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
11014 * frame.h (XFRAME): Use XUNTAG.
11015
3478ec45
PE
11016 Port recent dbusbind.c changes to 32-bit --with-wide-int.
11017 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
11018 Remove unportable assumptions about print widths of types like
11019 dbus_uint32_t.
11020 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
11021 intptr_t when converting between pointer and integer, to avoid GCC
11022 warnings about wrong width.
11023
666b903b 110242012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
11025
11026 * w32proc.c (new_child): Force Windows to reserve only 64KB of
11027 stack for each reader_thread, instead of defaulting to 8MB
11028 determined by the linker. This avoids failures in creating
11029 subprocesses on Windows 7, see the discussion in this thread:
11030 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
11031
b120cc17
JC
110322012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
11033
11034 Fix up display of the *Minibuf-0* buffer in the mini window.
11035 * keyboard.c (read_char): Don't clear the echo area if there's no
11036 message to clear.
11037 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 11038 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 11039
9a4b36f8
MA
110402012-05-07 Michael Albinus <michael.albinus@gmx.de>
11041
11042 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
11043 batch mode.
11044
e5f9458f
CY
110452012-05-06 Chong Yidong <cyd@gnu.org>
11046
11047 * lisp.mk (lisp): Update.
11048
eceeb5fc 110492012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
11050
11051 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
11052
71873e2b
SM
110532012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
11054
11055 * data.c (PUT_ERROR): New macro.
11056 (syms_of_data): Use it. Add new error type `user-error'.
11057 * undo.c (user_error): New function.
11058 (Fprimitive_undo): Use it.
11059 * print.c (print_error_message): Adjust print style for `user-error'.
11060 * keyboard.c (user_error): New function.
11061 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
11062
ab0fa4e4
PE
110632012-05-03 Paul Eggert <eggert@cs.ucla.edu>
11064
11065 Do not limit current-time-string to years 1000..9999.
11066 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
11067 (Fcurrent_time_string): Support any year that is supported by the
11068 underlying localtime representation. Don't use asctime, as it
11069 has undefined behavior for years outside the range -999..9999.
11070
7ed806a7
PE
110712012-05-02 Paul Eggert <eggert@cs.ucla.edu>
11072
11073 Fix race conditions involving setenv, gmtime, localtime, asctime.
11074 Without this fix, interrupts could mess up code that uses these
11075 nonreentrant functions, since setting TZ invalidates existing
11076 tm_zone or tzname values, and since most of these functions return
11077 pointers to static storage.
11078 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
11079 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
11080 Grow the critical sections to include not just invoking
11081 localtime/gmtime, but also accessing these functions' results
11082 including their tm_zone values if any, and any related TZ setting.
11083 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
11084 so that the struct tm is saved in the critical section.
11085 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
11086 motivated by the fact that memory allocation needs to be outside
11087 the critical section.
11088
0c16dfed
DA
110892012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
11090
11091 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
11092 with RESET_INTERVAL.
11093
11094 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11095 Remove duplicated buffer name initialization.
11096
3f83ace8
JM
110972012-05-02 Jim Meyering <jim@meyering.net>
11098
11099 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
11100
c7b8541e
JM
11101 * xfns.c (x_window): Use xstrdup (Bug#11375).
11102
90207a15 111032012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
11104
11105 * xdisp.c (pos_visible_p): If already at a newline from the
11106 display string before the 'while' loop, don't walk back the glyphs
11107 from it3.glyph_row. Solves assertion violation when the display
11108 string begins with a newline (egg.el). (Bug#11367)
11109
b593d6a9
AH
111102012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
11111
11112 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
11113 Move to simple.el.
11114
4737362e
GM
111152012-05-01 Glenn Morris <rgm@gnu.org>
11116
99cf43f9
GM
11117 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
11118 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
11119 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
11120 All were removed before 23.1.
11121
9311dcff
GM
11122 * dispnew.c: Remove HAVE_LIBNCURSES test;
11123 it is always true on relevant platforms.
11124
4d5c6349
GM
11125 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
11126 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
11127
4737362e
GM
11128 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
11129
74dd3a6b
AS
111302012-04-30 Andreas Schwab <schwab@linux-m68k.org>
11131
11132 * .gdbinit (xpr): Remove checks for no longer existing misc types.
11133 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
11134 Remove.
11135
13c379ee
PE
111362012-04-28 Paul Eggert <eggert@cs.ucla.edu>
11137
11138 Do not avoid creating empty evaporating overlays (Bug#9642).
11139 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
11140 That is, do not delete an evaporating overlay if it becomes
11141 empty after its bounds are adjusted to fit within its buffer.
11142 This fix caused other problems, and I'm reverting it until we get
11143 to the bottom of them.
11144
a8e7d6d7 111452012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
11146
11147 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
11148
a8e7d6d7 111492012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
11150
11151 * xdisp.c (pos_visible_p): If the window start position is beyond
11152 ZV, start the display from buffer beginning. Prevents assertion
11153 violation in init_iterator when the minibuffer window is scrolled
11154 via the scroll bar.
11155
11156 * window.c (window_scroll_pixel_based): Likewise.
11157
a8e7d6d7 111582012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
11159
11160 * keymap.c (where_is_internal): Doc fix (Bug#10872).
11161
a8e7d6d7 111622012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
11163
11164 * fileio.c (Fcopy_file, Fset_file_selinux_context):
11165 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
11166
a8e7d6d7 111672012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 11168
b593d6a9
AH
11169 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
11170 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 11171
1c6900d9
EZ
111722012-04-26 Eli Zaretskii <eliz@gnu.org>
11173
4c3fa1d9
EZ
11174 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
11175 display element, check also the underlying string or buffer
11176 character. (Bug#11341)
11177
1c6900d9
EZ
11178 * w32menu.c: Include w32heap.h.
11179 (add_menu_item): If the call to AppendMenuW (via
11180 unicode_append_menu) fails, disable Unicode menus only if we are
11181 running on Windows 9X/Me.
11182
42bf8205
AS
111832012-04-24 Andreas Schwab <schwab@linux-m68k.org>
11184
11185 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
11186 (xgetint): Add missing shift for LSB tags.
11187
b1bac16e
MR
111882012-04-24 Martin Rudalics <rudalics@gmx.at>
11189
11190 * keyboard.c (read_char): Don't wipe echo area for select window
11191 events: These might get delayed via `mouse-autoselect-window'
11192 (Bug#11304).
11193
d69621cc
JB
111942012-04-24 Juanma Barranquero <lekktu@gmail.com>
11195
11196 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
11197 manipulation of :loaded-from data.
11198
02fd101b
JB
111992012-04-23 Juanma Barranquero <lekktu@gmail.com>
11200
11201 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
11202 now a cons (bug#11311).
11203
888bec30
PE
112042012-04-23 Paul Eggert <eggert@cs.ucla.edu>
11205
89a438bd
PE
11206 Do not create empty overlays with the evaporate property (Bug#9642).
11207 * buffer.c (Fmove_overlay): Delete an evaporating overlay
11208 if it becomes empty after its bounds are adjusted to fit within
11209 its buffer. Without this fix, in a nonempty buffer (let ((o
11210 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
11211 yields an empty overlay that has the evaporate property, which is
11212 not supposed to happen.
11213
1068fe4d
PE
11214 Fix minor GTK3 problems found by static checking.
11215 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11216 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11217 (struct _EmacsFixedClass, emacs_fixed_get_type):
11218 Move decls here from emacsgtkfixed.h, since they needn't be public.
11219 (emacs_fixed_get_type): Now static.
11220 (emacs_fixed_class_init): Omit unused local.
11221 (emacs_fixed_child_type): Remove; unused.
11222 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11223 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11224 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
11225 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
11226 (EMACS_FIXED_GET_CLASS): Remove; unused.
11227 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
11228
888bec30
PE
11229 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
11230 Problem reported by Juanma Barranquero for Windows -Wunused-function.
11231
de85e130
PE
112322012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11233
d0baac98 11234 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 11235 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
11236 (__malloc_size_t, __malloc_ptrdiff_t):
11237 Remove. All uses removed, replaced by the definiens if needed,
11238 since we can assume C89 or better now.
11239 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
11240 (protect_malloc_state, align, get_contiguous_space)
11241 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
11242 (malloc_atfork_handler_child, malloc_enable_thread)
11243 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
11244 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
11245 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
11246 (special_realloc, _realloc_internal_nolock, _realloc_internal)
11247 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
11248 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
11249 Define using prototypes, not old style.
11250 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
11251 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
11252 (align): Don't assume that signed integer overflow wraps around.
11253 Omit unused local var.
11254 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
11255 (_free_internal_nolock, memalign, mallochook, reallochook):
11256 Omit no-longer-needed casts.
11257 (valloc): Use getpagesize, not __getpagesize.
11258 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
11259 (struct hdr): The 'magic' member is now size_t, not unsigned long.
11260
de85e130
PE
11261 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
11262
dcbf5805
MA
112632012-04-22 Michael Albinus <michael.albinus@gmx.de>
11264
11265 Move functions from C to Lisp. Make non-blocking method calls
11266 the default. Implement further D-Bus standard interfaces.
11267
11268 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
11269 (QCdbus_request_name_allow_replacement)
11270 (QCdbus_request_name_replace_existing)
11271 (QCdbus_request_name_do_not_queue)
11272 (QCdbus_request_name_reply_primary_owner)
11273 (QCdbus_request_name_reply_in_queue)
11274 (QCdbus_request_name_reply_exists)
11275 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
11276 (QCdbus_registered_serial, QCdbus_registered_method)
11277 (QCdbus_registered_signal): New Lisp objects.
11278 (XD_DEBUG_MESSAGE): Use sizeof.
11279 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
11280 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
11281 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
11282 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
11283 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
11284 (xd_signature, xd_append_arg): Allow float for integer types.
11285 (xd_get_connection_references): New function.
b593d6a9
AH
11286 (xd_get_connection_address): Rename from xd_initialize.
11287 Return cached address.
dcbf5805
MA
11288 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
11289 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
11290 level.
11291 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 11292 Return number of refcounts.
dcbf5805
MA
11293 (Fdbus_get_unique_name): Make stronger parameter check.
11294 (Fdbus_message_internal): New defun.
11295 (Fdbus_call_method, Fdbus_call_method_asynchronously)
11296 (Fdbus_method_return_internal, Fdbus_method_error_internal)
11297 (Fdbus_send_signal, Fdbus_register_service)
11298 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
11299 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
11300 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
11301 (Vdbus_compiled_version, Vdbus_runtime_version)
11302 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
11303 (Vdbus_message_type_method_return, Vdbus_message_type_error)
11304 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
11305 (Vdbus_registered_buses, Vdbus_registered_objects_table):
11306 Adapt docstring.
dcbf5805 11307
52828e02
PE
113082012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11309
da05bc4c
PE
11310 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
11311 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
11312 Do not assume ptrdiff_t is the same width as 'int'.
11313
52828e02
PE
11314 * alloc.c: Handle unusual debugging option combinations.
11315 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
11316 since the two debugging options are incompatible.
11317 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
11318 is defined.
11319 (mem_init, mem_insert, mem_insert_fixup):
11320 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
11321 (NEED_MEM_INSERT): Remove; no longer needed.
11322
f01769f9
LL
113232012-04-22 Leo Liu <sdl.web@gmail.com>
11324
11325 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
11326
5790543d
PE
113272012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11328
11329 * sysdep.c [__FreeBSD__]: Minor cleanups.
11330 (list_system_processes, system_process_attributes) [__FreeBSD__]:
11331 Use Emacs indenting style more consistently. Avoid some casts.
11332 Use 'double' consistently rather than mixing 'float' and 'double'.
11333
b91b7e4d
EW
113342012-04-21 Eduard Wiebe <usenet@pusto.de>
11335
b593d6a9
AH
11336 * sysdep.c (list_system_processes, system_process_attributes):
11337 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 11338
6114eb15
AS
113392012-04-21 Andreas Schwab <schwab@linux-m68k.org>
11340
11341 * lisp.mk (lisp): Update.
11342
2f38dff7
PE
113432012-04-20 Paul Eggert <eggert@cs.ucla.edu>
11344
11345 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
11346 It is never used otherwise.
11347
4ae29f89
SM
113482012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
11349
11350 * print.c (print_preprocess): Only check print_depth if print-circle
11351 is nil.
11352 (print_object): Check for cycles even when print-circle is nil and
11353 print-gensym is t, but only check print_depth if print-circle is nil.
11354
f30d612a
CY
113552012-04-20 Chong Yidong <cyd@gnu.org>
11356
11357 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11358 set the status to "failed" and ensure that sentinel is run.
11359
c07a4c0b 113602012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
11361
11362 * process.c (Fset_process_inherit_coding_system_flag)
11363 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 11364 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 11365
c07a4c0b 113662012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
11367
11368 * xdisp.c (string_buffer_position_lim): Limit starting position to
11369 BEGV.
11370 (set_cursor_from_row): If called for a mode-line or header-line
11371 row, return zero immediately.
11372 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
11373 farther than the first row after the header line, if any.
11374 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
11375 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11376
c07a4c0b 113772012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11378
4ae29f89
SM
11379 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11380 (bug#11238).
ad3a2b41 11381
c07a4c0b 113822012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 113832012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
11384
11385 configure: new option --enable-gcc-warnings (Bug#11207)
11386 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11387 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11388 (ALL_CFLAGS): Use new macros rather than old.
11389 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11390 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11391 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11392 -Wunused-result, -Wunused-variable. This should go away once
11393 the Emacs and Gnulib regex code is merged.
11394 (xmalloc, xrealloc): Now static.
11395
aba027e8
PE
113962012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11397
11398 * dired.c (Fsystem_groups): Remove unused local.
11399
e5a36063
GM
114002012-04-17 Glenn Morris <rgm@gnu.org>
11401
11402 * dired.c (Fsystem_users): Doc fix.
11403
316411f0
DA
114042012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11405
11406 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11407 (syms_of_dired): Add them.
11408
9426aba4
PE
114092012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11410
b62a57be
PE
11411 Fix minor alloc.c problems found by static checking.
11412 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11413 New extern decls, to avoid calling undeclared functions.
11414 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11415 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11416 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11417 (NEED_MEM_INSERT): New macro.
11418 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 11419 Remove one incorrect comment and fix another.
b62a57be 11420
3539f31f
PE
11421 Fix minor ralloc.c problems found by static checking.
11422 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11423 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11424 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11425 (r_alloc_sbrk): Now static.
11426
a041960a
PE
11427 Improve ralloc.c interface checking.
11428 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11429 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11430 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11431 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11432 [REL_ALLOC]: ... to here, to check interface.
11433 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11434 Remove decls. This fixes an "It stinks!".
11435
9426aba4
PE
11436 * alloc.c (which_symbols): Fix alignment issue / type clash.
11437
d55c12ed
AS
114382012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11439
11440 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11441 (struct Lisp_Misc_Any): Likewise.
11442 (struct Lisp_Free): Likewise.
11443 * alloc.c (union aligned_Lisp_Symbol): Define.
11444 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11445 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11446 (union aligned_Lisp_Misc): Define.
11447 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11448 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 11449 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 11450
b948ce8b
PE
114512012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11452
11453 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11454 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11455 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11456 * s/netbsd.h, s/sol2-6.h:
11457 Remove definition of GC_MARK_STACK, since the default now works.
11458 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11459 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11460 no longer the default.
11461 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11462
35dc09a1 114632012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11464
35dc09a1
GM
11465 * lread.c (lisp_file_lexically_bound_p):
11466 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 11467
35dc09a1
GM
114682012-04-14 Eli Zaretskii <eliz@gnu.org>
11469
11470 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11471 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11472
114732012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11474
11475 * nsterm.m (constrainFrameRect): Always constrain when there is only
11476 one screen (Bug#10962).
11477
bcd86815
KB
114782012-04-13 Ken Brown <kbrown@cornell.edu>
11479
11480 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11481
c25df26e
RT
114822012-04-13 Reuben Thomas <rrt@sc3d.org>
11483
11484 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11485
0fc59f1e
DC
114862012-04-11 Daniel Colascione <dancol@dancol.org>
11487
11488 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11489 against is gone. It's better to use vfork now so that when Cygwin
11490 gains a new, working vfork, we use it automatically (bug#10398).
11491
de8c03dc
SM
114922012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11493
11494 * window.c (save_window_save): Obey window-point-insertion-type.
11495
2f097256
GM
114962012-04-11 Glenn Morris <rgm@gnu.org>
11497
11498 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11499
453b951e
SM
115002012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11501
11502 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11503
75f1671a 115042012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
11505
11506 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11507 (force_quit_count): New var.
11508 (handle_interrupt): Use it.
11509
2a8ce227
JB
115102012-04-10 Juanma Barranquero <lekktu@gmail.com>
11511
11512 * w32.c (w32_delayed_load): Record the full path of the library
11513 being loaded (bug#10424).
11514
935396c0
GM
115152012-04-09 Glenn Morris <rgm@gnu.org>
11516
05920a43
GM
11517 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11518 not just in the obarray, before snarfing them. (Bug#11036)
11519
935396c0
GM
11520 * Makefile.in ($(leimdir)/leim-list.el):
11521 Pass EMACS rather than BUILT_EMACS.
11522
a18ecafa
TZ
115232012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11524
11525 * process.c (make_process):
11526 * process.h: Add integer `gnutls_handshakes_tried' member to
11527 process struct.
11528
6bbef4e5
JC
11529 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11530 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
11531
11532 * gnutls.c (gnutls_log_function2i): Convenience log function.
11533 (emacs_gnutls_read): Use new log functions,
11534 `gnutls_handshakes_tried' process member, and
11535 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11536 attempts per process (connection).
11537
b4d3bc10
CY
115382012-04-09 Chong Yidong <cyd@gnu.org>
11539
11540 * eval.c (Fuser_variable_p, user_variable_p_eh)
11541 (lisp_indirect_variable): Functions deleted.
11542 (Fdefvar): Caller changed.
11543
11544 * callint.c (Finteractive, Fcall_interactively):
11545 * minibuf.c (Fread_variable): Callers changed.
11546
70f4d973
EZ
115472012-04-09 Eli Zaretskii <eliz@gnu.org>
11548
11549 * xdisp.c (set_cursor_from_row): If the display string appears in
11550 the buffer at position that is closer to point than the position
11551 after the display string, display the cursor on the first glyph of
11552 the display string. Fixes cursor display when a 'display' text
11553 property immediately follows invisible text. (Bug#11094)
11554
cb3c2e3e
PE
115552012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11556
11557 composite.c: use 'double' consistently
11558 * composite.c (get_composition_id): Use 'double' consistently
11559 instead of converting 'float' to 'double' and vice versa; this is
11560 easier to understand and avoids a GCC warning.
11561
fd06db5d
GM
115622012-04-09 Glenn Morris <rgm@gnu.org>
11563
50fe702a
GM
11564 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11565 preparation for dumping it with emacs. (Bug#4789)
11566 (leimdir): New variable.
11567 ($(leimdir)/leim-list.el): New rule.
11568 (emacs$(EXEEXT)): Depend on leim-list.el.
11569
fd06db5d
GM
11570 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11571 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11572 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11573
55c131ee
AS
115742012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11575
11576 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11577 proper alignment.
11578
9209588f
JB
115792012-04-07 Juanma Barranquero <lekktu@gmail.com>
11580
11581 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11582 Remove unused local variable.
11583
e3fb2efb
PE
115842012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11585
11586 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11587 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11588 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11589 objects, as mark_maybe_pointer will catch them otherwise.
11590 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11591 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11592
b5385551
PE
115932012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11594
11595 Fix typo that broke non-Windows builds.
11596 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11597
9078ead6
EZ
115982012-04-07 Eli Zaretskii <eliz@gnu.org>
11599
11600 Support building on MS-Windows with libxml2.
11601
11602 * makefile.w32-in (OBJ2): Add xml.$(O).
11603 (GLOBAL_SOURCES): Add xml.c.
11604 ($(BLD)/xml.$(O)): New dependency list.
11605
11606 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11607 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11608 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11609 [!WINDOWSNT]: New macros.
11610 (init_libxml2_functions, libxml2_loaded_p): New functions.
11611 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11612 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11613 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11614 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11615 linked in).
6bbef4e5
JC
11616 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11617 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
11618 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11619
11620 * emacs.c: Don't include libxml/parser.h.
11621 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11622 xmlCleanupParser directly.
11623
11624 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11625
3811fdf3
EZ
116262012-04-07 Eli Zaretskii <eliz@gnu.org>
11627
11628 * indent.c (Fvertical_motion): If there is a display string at
11629 point, use it.vpos to compute how many lines to backtrack after
11630 move_it_to point. (Bug#11133)
11631
2f8e16b2
EZ
116322012-04-06 Eli Zaretskii <eliz@gnu.org>
11633
11634 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11635 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11636 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11637 macros related to unification of CJK characters. For the details,
11638 see the discussion following the message here:
11639 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11640
3d439cd1
CY
116412012-04-04 Chong Yidong <cyd@gnu.org>
11642
11643 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11644
8bc53d00
EZ
116452012-04-01 Eli Zaretskii <eliz@gnu.org>
11646
11647 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11648 instead of alloca. (Bug#11138)
11649
3b0512a3
AS
116502012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11651
11652 * w32menu.c (is_simple_dialog): Properly check lisp types.
11653 (Bug#11141)
11654
8427ddd2
EZ
116552012-03-31 Eli Zaretskii <eliz@gnu.org>
11656
979022ef
EZ
11657 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11658 position we get to after a call to move_it_to fails the
11659 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11660 only if we wind up in a string from display property. (Bug#11063)
11661
a6b1c7cc
EZ
11662 * window.c (Fdelete_other_windows_internal): Invalidate the row
11663 and column information about mouse highlight, so that redisplay
11664 restores it after reallocating the glyph matrices. (Bug#7464)
11665
8427ddd2
EZ
11666 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11667 string comes from a `display' text property, use the buffer
11668 position of that property as if we actually saw that position in
11669 the row's glyphs.
697ba24b
EZ
11670 (move_it_by_lines): Remove the assertion that
11671 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11672 violated when there's a before-string at the beginning of a line.
11673 (Bug#11063)
8427ddd2 11674
65a0a738
EZ
116752012-03-30 Eli Zaretskii <eliz@gnu.org>
11676
11677 * xdisp.c (append_space_for_newline): If the default face was
11678 remapped, use the remapped face for the appended newline.
11679 (extend_face_to_end_of_line): Use the remapped default face for
11680 extending the face to the end of the line.
11681 (display_line): Call extend_face_to_end_of_line when the default
11682 face was remapped. (Bug#11068)
11683
581355cc
EZ
116842012-03-29 Eli Zaretskii <eliz@gnu.org>
11685
11686 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11687
e8fc049f
SM
116882012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11689
11690 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11691
4fb9a543
GM
116922012-03-27 Glenn Morris <rgm@gnu.org>
11693
11694 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11695 Doc fixes.
11696
679910f1
KH
116972012-03-26 Kenichi Handa <handa@m17n.org>
11698
11699 * dispextern.h (struct glyph): Fix previous change. Change the
11700 bit length of glyphless.ch to 25 (Bug#11082).
11701
90d49b7f
CY
117022012-03-26 Chong Yidong <cyd@gnu.org>
11703
11704 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11705 (command_loop_1): Use it; inhibit selection update for
11706 handle-select-window too (Bug#8996).
11707
f514f6f0
FP
117082012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11709
e8fc049f 11710 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 11711
bf43fa51
KH
117122012-03-25 Kenichi Handa <handa@m17n.org>
11713
11714 * dispextern.h (struct glyph): Change the bit length of
11715 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11716
8a0c01dd
EZ
117172012-03-24 Eli Zaretskii <eliz@gnu.org>
11718
11719 * s/ms-w32.h (tzname): Include time.h before redirecting to
11720 _tzname. Fixes the MSVC build. (Bug#9960)
11721
7d1c3a76
AS
117222012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11723
8ed79523
AS
11724 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11725 characters.
11726
7d1c3a76
AS
11727 * xterm.c (XTread_socket): Only modify handling_signal if
11728 !SYNC_INPUT. (Bug#11080)
11729
e99a9b8b
EZ
117302012-03-23 Eli Zaretskii <eliz@gnu.org>
11731
11732 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11733 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11734 when fetching a multibyte character consumes more bytes than
11735 CHAR_BYTES returns, due to unification of CJK characters in
11736 string_char. (Bug#11073)
11737
5063c0e1
TN
117382012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11739
11740 * process.c (wait_reading_process_output): Handle pty disconnect
11741 by refraining from sending oneself a SIGCHLD (bug#10933).
11742
9f851fbd
CY
117432012-03-22 Chong Yidong <cyd@gnu.org>
11744
11745 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11746
5063c0e1 11747 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
11748 Mark string as coming from a prefix property.
11749 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11750 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11751
fb5b8aca
CY
117522012-03-21 Chong Yidong <cyd@gnu.org>
11753
11754 * xfaces.c (Vface_remapping_alist): Doc fix.
11755
62356a1b
EZ
117562012-03-20 Eli Zaretskii <eliz@gnu.org>
11757
11758 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
11759 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11760 Doc fixes.
62356a1b 11761
025de85b
CY
117622012-03-20 Chong Yidong <cyd@gnu.org>
11763
11764 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11765 to reflect default non-nil value of redisplay-dont-pause.
11766
4827f94e
KH
117672012-03-19 Kenichi Handa <handa@m17n.org>
11768
11769 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11770 it fit in a valid range (Bug#11003).
11771
e50a24a2
EZ
117722012-03-18 Eli Zaretskii <eliz@gnu.org>
11773
11774 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11775 that is not from display property, accept the row as a "cursor
11776 row" if one of the string's character has a non-nil `cursor'
11777 property. Fixes cursor positioning when there are newlines in
11778 overlay strings, e.g. in icomplete.el. (Bug#11035)
11779
9af5ed87
PE
117802012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11781
11782 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11783
d1f55f16
CY
117842012-03-12 Chong Yidong <cyd@gnu.org>
11785
11786 * eval.c (inhibit_lisp_code): Rename from
11787 inhibit_window_configuration_change_hook; move from window.c.
11788
11789 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11790 * window.c (run_window_configuration_change_hook)
11791 (syms_of_window): Callers changed.
11792
66c5eebd
CY
117932012-03-11 Chong Yidong <cyd@gnu.org>
11794
413df973
CY
11795 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11796
66c5eebd
CY
11797 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11798
1de11f56
CY
117992012-03-10 Chong Yidong <cyd@gnu.org>
11800
11801 * frame.c (other_visible_frames): Don't assume the selected frame
11802 is visible (Bug#10955).
11803
cae07000
SM
118042012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11805
11806 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11807
89c94350
JD
118082012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11809
11810 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11811 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11812 zero (Bug#10954).
11813
999dd333
GM
118142012-03-03 Glenn Morris <rgm@gnu.org>
11815
01a6dcc8 11816 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 11817
de0100f2
EZ
118182012-03-02 Eli Zaretskii <eliz@gnu.org>
11819
11820 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11821 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
11822 (redisplay_window, next_element_from_string): Fix typos in
11823 comments.
3e441275
EZ
11824 (redisplay_window): Pass to move_it_vertically the margin in
11825 pixels, not in screen lines.
de0100f2 11826
96a72ee9
GM
118272012-03-02 Glenn Morris <rgm@gnu.org>
11828
11829 * buffer.c (buffer-list-update-hook): Doc fix.
11830
312508d7
EZ
118312012-02-29 Eli Zaretskii <eliz@gnu.org>
11832
11833 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11834 push_it before setting up the iterator for the first overlay
11835 string, even if we have an empty string loaded.
11836 (next_overlay_string): If there's an empty string on the iterator
11837 stack, pop the stack. (Bug#10903)
11838
27f3c637
PE
118392012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11840
11841 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11842 Suggested by Stefan Monnier in
11843 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11844 * alloc.c (widen_to_Lisp_Object): New static function.
11845 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11846 and widening them to Lisp_Objects. This would work even if
11847 USE_LSB_TAG is defined and wide integers are used, which might
11848 happen in a future version of Emacs.
11849
3c9dfce6
CY
118502012-02-25 Chong Yidong <cyd@gnu.org>
11851
fa74b241
CY
11852 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11853 Doc fix.
11854
3c9dfce6
CY
11855 * xselect.c (Fx_selection_exists_p): Doc fix.
11856 (x_clipboard_manager_save_all): Print an informative message
11857 before saving to clipboard manager.
11858
9486df08
CY
118592012-02-24 Chong Yidong <cyd@gnu.org>
11860
11861 * keyboard.c (process_special_events): Handle all X selection
11862 requests in kbd_buffer, not just the next one (Bug#8869).
11863
f01d3321
CY
118642012-02-23 Chong Yidong <cyd@gnu.org>
11865
11866 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11867 call when setting menu-bar-lines and tool-bar-lines parameters.
11868 (unwind_create_frame_1): New helper function.
11869
11870 * window.c (inhibit_window_configuration_change_hook): New var.
11871 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 11872 (syms_of_window): Initialize it.
f01d3321 11873
86b847b6
CY
118742012-02-22 Chong Yidong <cyd@gnu.org>
11875
11876 * xterm.c (x_draw_image_relief): Add missing type check for
11877 Vtool_bar_button_margin (Bug#10743).
11878
a59225b1
CY
118792012-02-21 Chong Yidong <cyd@gnu.org>
11880
11881 * fileio.c (Vfile_name_handler_alist): Doc fix.
11882
11883 * buffer.c (Fget_file_buffer): Protect against invalid file
11884 handler return value.
11885
310f5bd4
PE
118862012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11887
cb3a28cc
PE
11888 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11889 when computing $valmask.
11890
310f5bd4
PE
11891 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11892 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11893 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11894 It's useless in that case, and it can cause problems on hosts
11895 that allocate halves of EMACS_INT values separately.
11896 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11897 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11898 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11899 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11900 it avoids undefined behavior on hosts where shifting right by more
11901 than the word width has undefined behavior.
11902
2375c96a
CY
119032012-02-19 Chong Yidong <cyd@gnu.org>
11904
11905 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11906 (Funhandled_file_name_directory, Ffile_name_as_directory)
11907 (Fdirectory_file_name, Fexpand_file_name)
11908 (Fsubstitute_in_file_name): Protect against invalid file handler
11909 return values (Bug#10845).
11910
3eb49e71
EZ
119112012-02-18 Eli Zaretskii <eliz@gnu.org>
11912
11913 * .gdbinit (pitx): Fix incorrect references to fields of the
11914 iterator stack.
11915
7b926f3f
CY
119162012-02-17 Chong Yidong <cyd@gnu.org>
11917
11918 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11919
11273115
PE
119202012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11921
11922 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11923 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11924
c3a70e2b
CY
119252012-02-15 Chong Yidong <cyd@gnu.org>
11926
11927 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11928 marked as special. Also, starting docstrings with * is obsolete.
11929
0ca43699
AS
119302012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11931
11932 * gnutls.c (emacs_gnutls_write): Fix last change.
11933
2e8f3c56
LI
119342012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11935
11936 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11937 send_process.
11938
af70074f
SM
119392012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11940
11941 * keymap.c (Fsingle_key_description): Handle char ranges.
11942
95986d52
CY
119432012-02-12 Chong Yidong <cyd@gnu.org>
11944
afd83bd1
CY
11945 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11946 as that creates a dangerous corner case.
11947
95986d52
CY
11948 * window.c (Fdelete_window_internal): Invalidate the mouse
11949 highlight (Bug#9904).
11950
bd7da63e
GM
119512012-02-12 Glenn Morris <rgm@gnu.org>
11952
11953 * xselect.c (Fx_own_selection_internal)
11954 (Fx_get_selection_internal, Fx_disown_selection_internal)
11955 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11956 * nsselect.m (Fx_own_selection_internal)
11957 (Fx_disown_selection_internal, Fx_selection_exists_p)
11958 (Fx_selection_owner_p, Fx_get_selection_internal):
11959 Sync docs and argument specs with the xselect.c versions.
11960
77abcbc2
LI
119612012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11962
11963 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11964
90b671e2
EZ
119652012-02-11 Eli Zaretskii <eliz@gnu.org>
11966
1c0ca0b7
EZ
11967 * w32select.c (Fx_selection_exists_p): Sync doc string and
11968 argument list with xselect.c. (Bug#10783)
11969
11970 * w16select.c (Fx_selection_exists_p): Sync doc string and
11971 argument list with xselect.c. (Bug#10783)
90b671e2 11972
49241268
GM
119732012-02-10 Glenn Morris <rgm@gnu.org>
11974
11975 * fns.c (Fsecure_hash): Doc fix.
11976
f998bbe7 119772012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
11978
11979 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11980
0992bd9c
CY
119812012-02-07 Chong Yidong <cyd@gnu.org>
11982
11983 * buffer.c (Fbuffer_local_variables)
11984 (buffer_lisp_local_variables): Handle unbound vars correctly;
11985 don't let Qunbound leak into Lisp.
11986
af008560
GM
119872012-02-07 Glenn Morris <rgm@gnu.org>
11988
dd605cc4
GM
11989 * image.c (Fimagemagick_types): Doc fix.
11990
af008560
GM
11991 * image.c (imagemagick-render-type): Change it from a lisp object
11992 to an integer. Move the doc here from the lisp manual.
11993 Treat all values not equal to 0 the same.
11994
1449fa1d
CY
119952012-02-06 Chong Yidong <cyd@gnu.org>
11996
11997 * doc.c (store_function_docstring): Avoid applying docstring of
11998 alias to base function (Bug#2603).
11999
3723ec07
AS
120002012-02-04 Andreas Schwab <schwab@linux-m68k.org>
12001
12002 * .gdbinit (pp1, pv1): Remove redundant defines.
12003 (pr): Use pp.
12004
79c1cc1e
CY
120052012-02-04 Chong Yidong <cyd@gnu.org>
12006
12007 * nsterm.m: Declare a global (Bug#10694).
12008
d7f29f8e
EZ
120092012-02-04 Eli Zaretskii <eliz@gnu.org>
12010
cae07000
SM
12011 * w32.c (get_emacs_configuration_options):
12012 Include --enable-checking, if specified, in the return value.
d7f29f8e 12013
3b95a6f9
MR
120142012-02-04 Martin Rudalics <rudalics@gmx.at>
12015
12016 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
12017 after rounding frame sizes. (Bug#9723)
12018
d6fa96a6
EZ
120192012-02-04 Eli Zaretskii <eliz@gnu.org>
12020
12021 * keyboard.c (adjust_point_for_property): Don't position point
12022 before BEGV. (Bug#10696)
12023
df0b2940
PE
120242012-02-03 Paul Eggert <eggert@cs.ucla.edu>
12025
12026 Handle overflow when computing char display width (Bug#9496).
12027 * character.c (char_width): Return EMACS_INT, not int.
12028 (char_width, c_string_width): Check for overflow when
12029 computing the width; this is possible now that individual
12030 characters can have unbounded width. Problem introduced
12031 by merge from Emacs 23 on 2012-01-19.
12032
6bee44d6
MA
120332012-02-02 Michael Albinus <michael.albinus@gmx.de>
12034
12035 * dbusbind.c (Fdbus_register_method): Mention the return value
12036 :ignore in the docstring.
12037
44f92739
GM
120382012-02-02 Glenn Morris <rgm@gnu.org>
12039
1b9f60cc
GM
12040 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
12041
44f92739
GM
12042 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12043 Unconditionally set to t. (Bug#10673)
12044 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12045 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
12046 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
12047
c5d3843c
KH
120482012-02-02 Kenichi Handa <handa@m17n.org>
12049
12050 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
12051 0, do not call append_composite_glyph.
12052
159462d4 120532012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
12054
12055 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
12056 NULL (Bug#6988).
12057 (x_produce_glyphs): If the component of a composition is a null
12058 string, set it->pixel_width to 1 to avoid zero-width glyph.
12059
78cef877
EZ
120602012-02-01 Eli Zaretskii <eliz@gnu.org>
12061
12062 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
12063 first 2 arguments are identical. This makes inserting large
12064 output from a subprocess an order of magnitude faster on
12065 MS-Windows, where all sbrk'ed memory is always contiguous.
12066
97897668
GM
120672012-01-31 Glenn Morris <rgm@gnu.org>
12068
12069 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 12070 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
12071 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
12072
31fd3586
GM
120732012-01-29 Glenn Morris <rgm@gnu.org>
12074
12075 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
12076
0e24a8b2
CY
120772012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
12078
12079 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
12080
cc0adcb0
CY
120812012-01-28 Chong Yidong <cyd@gnu.org>
12082
12083 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
12084
acc28cb9
CY
120852012-01-26 Chong Yidong <cyd@gnu.org>
12086
9c69cfb7
CY
12087 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
12088
acc28cb9
CY
12089 * search.c (Fsearch_forward, Fsearch_backward): Document negative
12090 repeat counts (Bug#10507).
12091
48da7392
GM
120922012-01-26 Glenn Morris <rgm@gnu.org>
12093
12094 * lread.c (syms_of_lread): Doc fix.
12095
14af5f7f
CY
120962012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
12097
12098 * coding.c (encode_designation_at_bol): Change return value to
12099 EMACS_INT.
12100
0b21c100
CY
121012012-01-25 Chong Yidong <cyd@gnu.org>
12102
12103 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
12104
3c2907f7
CY
121052012-01-21 Chong Yidong <cyd@gnu.org>
12106
12107 * floatfns.c (Fcopysign): Make the second argument non-optional,
12108 since nil is not allowed anyway.
12109
959ad23f
AS
121102012-01-21 Andreas Schwab <schwab@linux-m68k.org>
12111
12112 * process.c (read_process_output): Use p instead of XPROCESS (proc).
12113 (send_process): Likewise.
12114
34a02f46
MR
121152012-01-19 Martin Rudalics <rudalics@gmx.at>
12116
12117 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
12118 (Vwindow_persistent_parameters): Do not use Qstate.
12119 Rewrite doc-strings.
34a02f46 12120
1259009a 121212012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
12122
12123 * character.c (char_width): New function.
70d4fdf6
GM
12124 (Fchar_width, c_string_width, lisp_string_width):
12125 Use char_width (Bug#9496).
25ed9e61 12126
6a6ee00d
MR
121272012-01-16 Martin Rudalics <rudalics@gmx.at>
12128
12129 * window.c (Vwindow_persistent_parameters): New variable.
12130 (Fset_window_configuration, save_window_save): Handle persistent
12131 window parameters.
12132
c85efaf7
EZ
121332012-01-14 Eli Zaretskii <eliz@gnu.org>
12134
12135 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
12136 thrashing the stack of the thread. (Bug#9087)
12137
5944709e
PE
121382012-01-12 Paul Eggert <eggert@cs.ucla.edu>
12139
12140 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
12141
e71f5d99
EZ
121422012-01-11 Eli Zaretskii <eliz@gnu.org>
12143
12144 * xdisp.c (rows_from_pos_range): Handle the case where the
12145 highlight ends on a newline. (Bug#10464)
12146 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
12147 he end column for display of highlight that ends on a newline
12148 before a R2L line.
12149
ce316182
GM
121502012-01-11 Glenn Morris <rgm@gnu.org>
12151
12152 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
12153 from load-path also when installation-directory is nil. (Bug#10208)
12154
5b43da69
GM
121552012-01-10 Glenn Morris <rgm@gnu.org>
12156
74cc8ff9
GM
12157 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
12158
7d8d6e4e
GM
12159 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
12160 Update template values to be closer to their typical values these days.
5b43da69 12161
a0db8d43
EZ
121622012-01-09 Eli Zaretskii <eliz@gnu.org>
12163
12164 * xdisp.c (rows_from_pos_range): Accept additional argument
12165 DISP_STRING, and accept any glyph in a row whose object is that
12166 string as eligible for mouse highlight. Fixes mouse highlight of
12167 display strings from overlays. (Bug#10464)
12168
9a0115ab 121692012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 12170
b9110d6a 12171 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
12172 * fileio.c (auto_saving_dir_umask): New static var.
12173 (Fmake_directory_internal): Use it.
12174 (do_auto_save_make_dir): Set it, instead of invoking chmod after
12175 creating the directory. The old code temporarily assigns
12176 too-generous permissions to the directory.
12177 (do_auto_save_eh): Clear it.
b9110d6a 12178 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
12179 that the var is always cleared.
12180
6c1bd3f3
EZ
121812012-01-07 Eli Zaretskii <eliz@gnu.org>
12182
12183 * search.c (scan_buffer): Pass character positions to
12184 know_region_cache, not byte positions. (Bug#6540)
12185
069d2b50
L
121862012-01-07 LynX <_LynX@bk.ru> (tiny change)
12187
12188 * w32.c (sys_rename): Report EXDEV when rename of a directory
12189 fails because the target is on another logical disk. (Bug#10284)
12190
75bf0d33
DB
121912012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
12192
12193 * xterm.c (x_embed_request_focus): New function.
12194
12195 * xterm.h: Add prototype.
12196
12197 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
12198
1c6e5a32
GM
121992012-01-05 Glenn Morris <rgm@gnu.org>
12200
12201 * emacs.c (emacs_copyright): Update short copyright year to 2012.
12202
651e947e
EZ
122032012-01-01 Eli Zaretskii <eliz@gnu.org>
12204
12205 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
12206 Load gnutls_transport_set_lowat only if GnuTLS version is below
12207 2.11.1.
12208 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
12209 GnuTLS versions below 2.11.1.
12210
3778cdd8
AL
122112011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
12212
12213 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
12214 to the doc string advising against its use for altering the way
12215 windows are scrolled.
12216
0e5317f7
KH
122172011-12-28 Kenichi Handa <handa@m17n.org>
12218
12219 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
12220 coding-system ASCII compatible only when it does not produce BOM
12221 on encoding (Bug#10383).
12222
93d5ca1f
JD
122232011-12-26 Jan Djärv <jan.h.d@swipnet.se>
12224
12225 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
12226 can scroll.
12227 (create_and_show_popup_menu): Always use menu_position_func for
12228 Gtk3 (Bug#10361).
12229
ca22b785
AS
122302011-12-24 Andreas Schwab <schwab@linux-m68k.org>
12231
12232 * callint.c (Fcall_interactively): Don't truncate prompt string.
12233
d048e1e6
EZ
122342011-12-23 Eli Zaretskii <eliz@gnu.org>
12235
12236 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
12237 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 12238 resumed from there (after widening). (Bug#10360)
d048e1e6 12239
5ccaba1f
JD
122402011-12-22 Jan Djärv <jan.h.d@swipnet.se>
12241
12242 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
12243
204ee57f
JD
122442011-12-21 Jan Djärv <jan.h.d@swipnet.se>
12245
b81d40f0
JB
12246 * nsterm.m (x_free_frame_resources):
12247 Release f->output_data.ns->miniimage.
204ee57f
JD
12248 (ns_index_color): Fix indentation. Do not retain
12249 color_table->colors[i].
12250
12251 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
12252 before returning.
12253
12254 * nsfns.m (x_set_background_color): Assign return value from
12255 ns_index_color to face-background instead of NSColor*.
12256 (ns_implicitly_set_icon_type): Fix indentation.
12257 Change assignment in for loop to comparison.
12258
12259 * emacs.c (ns_pool): New variable.
12260 (main): Assign ns_pool.
12261 (Fkill_emacs): Call ns_release_autorelease_pool.
12262
12263 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
12264 autorelease fdesc, release fdAttrs and tdict.
12265 (ns_get_covering_families): Release charset.
12266 (ns_findfonts): Release NSFontDescriptor created with new.
12267 (ns_uni_to_glyphs): Fix indentation.
12268 (setString): Release attrStr before assigning new value.
12269
c803b2b7
JD
122702011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12271
678f4426
JD
12272 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
12273 and NS_IMPL_COCOA.
12274 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
12275 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
12276
cd394be1 122772011-12-18 David Reitter <reitter@cmu.edu>
678f4426 12278
5fecd5fc
JD
12279 * nsterm.m (ns_term_init): Subscribe for notifications
12280 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
12281 to method trackingNotification in EmacsMenu.
12282
12283 * nsmenu.m (trackingMenu): New variable.
3771cb17 12284 (trackingNotification): New method (from Aquamacs).
5fecd5fc 12285 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 12286 from Aquamacs (Bug#7030).
678f4426
JD
12287
122882011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 12289
c803b2b7
JD
12290 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
12291 (symbol_to_nsstring): Fix indentation.
12292 (ns_symbol_to_pb): New function.
cae07000
SM
12293 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
12294 (Fns_rotate_cut_buffers_internal): Remove.
12295 (Fns_store_selection_internal): Rename from
c803b2b7
JD
12296 Fns_store_cut_buffer_internal.
12297 (ns_get_foreign_selection, Fx_own_selection_internal)
12298 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
12299 (Fns_get_selection_internal, Fns_store_selection_internal):
12300 Use ns_symbol_to_pb and check if return value is nil.
12301 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
12302 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
12303 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
12304 renamed to Sns_store_selection_internal.
12305 (ns_handle_selection_request): Move code to Fx_own_selection_internal
12306 and remove this function.
12307 (ns_handle_selection_clear): Remove, never used.
12308 (Fx_own_selection_internal): Move code from ns_handle_selection_request
12309 here.
12310
e1b01a3a
KB
123112011-12-17 Ken Brown <kbrown@cornell.edu>
12312
12313 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
12314 GID is unknown (Bug#10257).
12315
2adb6e85
PE
123162011-12-17 Paul Eggert <eggert@cs.ucla.edu>
12317
12318 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
12319 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
12320 which caused a build failure on GNU/Linux IA-64. This problem was
12321 introduced by my 2011-10-07 patch.
12322
d1d7b339
JL
123232011-12-15 Juri Linkov <juri@jurta.org>
12324
12325 * image.c (imagemagick_error): New function. (Bug#10112)
12326 (imagemagick_load_image): Comment out `MagickSetResolution' call.
12327 Use `imagemagick_error' where ImageMagick functions return
12328 `MagickFalse'.
12329 (Fimagemagick_types): Add `Fnreverse' to return the list in the
12330 proper order.
12331
100d5755
KH
123322011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12333
12334 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
12335 fill background (Bug#8992).
12336
454592a6
MR
123372011-12-13 Martin Rudalics <rudalics@gmx.at>
12338
12339 * window.c (Vwindow_combination_resize)
12340 (Vwindow_combination_limit): Use t instead of non-nil in
12341 doc-strings.
61d4b438
MR
12342 (Vrecenter_redisplay): Add first sentence of doc-string on
12343 separate line.
53524d93 12344 (Frecenter): Fix doc-string typo.
454592a6 12345
3633e3aa
KH
123462011-12-11 Kenichi Handa <handa@m17n.org>
12347
12348 * coding.c (Funencodable_char_position): Pay attention to the
12349 buffer text relocation (Bug#9389).
12350
7b9d523a 123512011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 12352
7b9d523a
JD
12353 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
12354 gtk_init (Bug#10100).
12355
b73189c6
EZ
123562011-12-10 Eli Zaretskii <eliz@gnu.org>
12357
12358 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12359 IT->string is nil. (Bug#10263)
12360
f7dfe5d6
JD
123612011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12362
83faebb4
JD
12363 * nsterm.h (x_free_frame_resources): Declare.
12364
f7dfe5d6
JD
12365 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12366 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12367
12368 * nsterm.h (ns_get_defaults_value): Declare.
12369
12370 * nsterm.m (ns_default): Call ns_get_defaults_value.
12371
7cd4e72c
EZ
123722011-12-09 Eli Zaretskii <eliz@gnu.org>
12373
12374 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12375 (Bug#10170)
12376
b34d7317
YM
123772011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12378
12379 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12380 that where the value of an _OBJC_* symbol points to is in the .bss
12381 section (Bug#10240).
12382
76470ad1
KH
123832011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12384
12385 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 12386 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 12387
745fff94
KH
123882011-12-08 Kenichi Handa <handa@m17n.org>
12389
12390 * ftfont.c (get_adstyle_property): Fix previous change
12391 (Bug#10233).
12392
6e44397c
JB
123932011-12-07 Juanma Barranquero <lekktu@gmail.com>
12394
12395 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12396 dirs from the default value of EMACSLOADPATH (bug#10208).
12397
7efa6272
GM
123982011-12-07 Glenn Morris <rgm@gnu.org>
12399
12400 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12401 installation and source directories as well. (Bug#10208)
12402
f6fc4d87
CY
124032011-12-06 Chong Yidong <cyd@gnu.org>
12404
12405 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12406
2bf26180
GM
124072011-12-06 Glenn Morris <rgm@gnu.org>
12408
12409 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12410 as an error, not just -1. (Bug#10217)
12411
3a6ad4f0
CY
124122011-12-05 Chong Yidong <cyd@gnu.org>
12413
12414 * keyboard.c (process_special_events): New function.
12415 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12416
75a3b399
PE
124172011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12418
12419 * coding.c (encode_designation_at_bol): Don't use uninitialized
12420 local variable (Bug#9318).
12421
c3c9e25e
KH
124222011-12-05 Kenichi Handa <handa@m17n.org>
12423
12424 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12425 return Qnil (Bug#8046, Bug#10193).
12426
5eb05ea3
KH
124272011-12-05 Kenichi Handa <handa@m17n.org>
12428
12429 * coding.c (encode_designation_at_bol): New args charbuf_end and
12430 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
12431 (coding_set_source): Return how many bytes coding->source was
12432 relocated.
12433 (coding_set_destination): Return how many bytes
12434 coding->destination was relocated.
12435 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 12436 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
12437
124382011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12439
12440 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12441 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12442 macro (Bug#9318).
12443
124442011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12445
12446 The following changes are to fix Bug#9318.
12447
a79703f5 12448 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
12449 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12450 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 12451 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 12452
7dbda6df
JB
124532011-12-05 Juanma Barranquero <lekktu@gmail.com>
12454
12455 * lisp.h (process_quit_flag): Fix external declaration.
12456
6d5eb5b0
SM
124572011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12458
12459 Don't macro-inline non-performance-critical code.
12460 * eval.c (process_quit_flag): New function.
12461 * lisp.h (QUIT): Use it.
12462
a0c3fad0
JD
124632011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12464
12465 * nsfns.m (get_geometry_from_preferences): New function.
12466 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12467
6c07aac2
AS
124682011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12469
12470 * emacs.c (Qkill_emacs): Define.
12471 (syms_of_emacs): Initialize it.
12472 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12473 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
12474 (quit_throw_to_read_char): Add parameter `from_signal'.
12475 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
12476 * lisp.h (QUIT): Call Fkill_emacs if requested.
12477
c052ead4
JD
124782011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12479
12480 * widget.c (update_wm_hints): Return if wmshell is null.
12481 (widget_update_wm_size_hints): New function.
12482
12483 * widget.h (widget_update_wm_size_hints): Declare.
12484
12485 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12486 widget_update_wm_size_hints (Bug#10104).
12487
9e49252b
EZ
124882011-12-03 Eli Zaretskii <eliz@gnu.org>
12489
12490 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12491 before a newline, prepare the bidi iterator for consuming the
12492 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 12493 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 12494
02b16839
JL
124952011-12-02 Juri Linkov <juri@jurta.org>
12496
12497 * search.c (Fword_search_regexp): New Lisp function created from
12498 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12499 (Fword_search_backward, Fword_search_forward)
12500 (Fword_search_backward_lax, Fword_search_forward_lax):
12501 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12502 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12503
0068070e
SM
125042011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12505
12506 * fileio.c (Finsert_file_contents): Move after-change-function call
12507 to before the "handled:" label, since all "goto handled" appear in
12508 cases where the *-change-functions have already been properly called
12509 (bug#10117).
12510
3360a3fc
AS
125112011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12512
12513 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12514 waiting for input. (Bug#10169)
12515
73d6c093
EZ
125162011-11-30 Eli Zaretskii <eliz@gnu.org>
12517
12518 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12519 verifies glyph row's hash code--we have just reallocated the
12520 glyphs, so their contents can be complete garbage. (Bug#10164)
12521
febe6bea
JB
125222011-11-30 Juanma Barranquero <lekktu@gmail.com>
12523
12524 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12525
801a4313
EZ
125262011-11-30 Eli Zaretskii <eliz@gnu.org>
12527
12528 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12529 attributes are tested _before_ calling verify_row_hash, to protect
12530 against GCC re-ordering of the tests. (Bug#10164)
12531
2b56b87e
JD
125322011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12533
12534 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12535
12536 * xterm.c (handle_one_xevent): Only set async_visible and friends
12537 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 12538 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
12539 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12540
dbf31225
PE
125412011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12542
12543 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12544 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12545 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12546 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12547 All uses changed to use GCPRO1 etc.
12548 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12549 Revert to old implementation (i.e., before 2011-03-11).
12550
1305621b
YM
125512011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12552
12553 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12554 of scroll runs so as to avoid assigning disabled bogus rows and
12555 unnecessary graphics copy operations.
12556
8c9afb46
EZ
125572011-11-27 Eli Zaretskii <eliz@gnu.org>
12558
12559 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12560 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12561 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12562 (malloc, free, realloc, calloc): Redirect to e_* only when
12563 compiling Emacs.
12564
12565 * lisp.h (GCTYPEBITS): Move before first use.
12566 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12567 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12568 this macro definition.
12569
12570 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12571 _MSC_VER.
12572
54e9e3bf
JD
125732011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12574
6d5eb5b0
SM
12575 * gtkutil.c (xg_create_frame_widgets):
12576 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
12577 present with Gtk+ 2.0.
12578
83aca1cb
PE
125792011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12580
12581 * fileio.c (Finsert_file_contents): Undo previous change; see
12582 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12583
5b76caa4
PE
125842011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12585
12586 Rename locals to avoid shadowing.
12587 * fileio.c (Finsert_file_contents):
12588 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12589 * process.c (wait_reading_process_output):
12590 Rename inner 'proc' to 'p' to avoid shadowing.
12591 Indent for consistency with usual Emacs style.
12592
8c535114
EZ
125932011-11-25 Eli Zaretskii <eliz@gnu.org>
12594
12595 * xdisp.c (redisplay_window): If cursor row is not fully visible
12596 after recentering, and scroll-conservatively is set to a large
12597 number, scroll window by a few more lines to make the cursor fully
12598 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
12599 (start_display): Don't move to the next line if the display should
12600 start at a newline that is part of a display vector or an overlay
12601 string. (Bug#10119)
8c535114 12602
fa4fdb5c
JL
126032011-11-24 Juri Linkov <juri@jurta.org>
12604
12605 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12606 after the `MagickPingImage' call. (Bug#10112)
12607
90ec88df
CY
126082011-11-23 Chong Yidong <cyd@gnu.org>
12609
12610 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12611
56e2e794
MR
126122011-11-23 Martin Rudalics <rudalics@gmx.at>
12613
12614 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12615 making another buffer current. (Bug#10114)
12616
b6e64c41
GM
126172011-11-23 Glenn Morris <rgm@gnu.org>
12618
12619 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12620
6b21de18
CY
126212011-11-23 Chong Yidong <cyd@gnu.org>
12622
12623 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12624 using it (Bug#5984).
12625
b12cd789
EZ
126262011-11-22 Eli Zaretskii <eliz@gnu.org>
12627
12628 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12629 and header-lines, as they don't have one computed for them.
12630 (Bug#10098)
12631
12632 * .gdbinit (prow): Make displayed values more self-explaining.
12633 Add row's hash code.
12634
261b6fd4
LMI
126352011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12636
12637 * process.c (wait_reading_process_output): Fix asynchrounous
12638 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 12639 (wait_reading_process_output): Add comment and URL.
261b6fd4 12640
e7cfd277
JD
126412011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12642
12643 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12644
a9b9b7f5
CY
126452011-11-21 Chong Yidong <cyd@gnu.org>
12646
12647 * window.c (Fnext_window, Fprevious_window): Doc fix.
12648
b0d15b4f
SM
126492011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12650
12651 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12652
fe7a3057
JB
126532011-11-20 Juanma Barranquero <lekktu@gmail.com>
12654
12655 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12656
d2999b1a
MR
126572011-11-20 Martin Rudalics <rudalics@gmx.at>
12658
12659 * window.c (Fset_window_combination_limit): Rename argument
12660 STATUS to LIMIT.
12661 (Vwindow_combination_limit): Remove "status" from doc-string.
12662
d5ff9cd0
AS
126632011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12664
12665 * m/ibms390.h: Remove.
12666 * m/ibms390x.h: Don't include "ibms390.h".
12667
a5bb9bd3
SM
126682011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12669
12670 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12671 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12672
cd1181db
JB
126732011-11-20 Juanma Barranquero <lekktu@gmail.com>
12674
12675 * casetab.c (Fset_case_table):
12676 * charset.c (Fcharset_after): Fix typos.
12677
615a3b8d 126782011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 12679
17e845af
PE
12680 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12681 Otherwise, valgrind does not work on some platforms.
12682 Problem reported by Andreas Schwab in
6a0bf43d
PE
12683 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12684 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12685 is set, removing the need for VIRT_ADDRESS_VARIES.
12686 (PURE_P): Use a more-efficient implementation that needs just one
12687 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12688 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12689 to 4 (xorl, subq, cmpq, setbe).
12690 * alloc.c (pure): Always extern now, since that's the
12691 VIRT_ADDR_VARIES behavior.
12692 (PURE_POINTER_P): Use a single comparison, not two, for
12693 consistency with the new puresize.h.
12694 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12695 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12696 Remove VIRT_ADDR_VARIES no longer needed.
12697
f8fe6f96
EZ
126982011-11-19 Eli Zaretskii <eliz@gnu.org>
12699
12700 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12701 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12702 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12703 behave as if the cursor position were at the window margin.
12704
12705 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12706 and the cursor position is out of bounds, behave as if the cursor
12707 position were at the window margin. (Bug#10075)
12708
df05a53c
CY
127092011-11-18 Chong Yidong <cyd@gnu.org>
12710
12711 * window.c (Fwindow_combination_limit): Make first argument
12712 non-optional, since it is meaningless for live windows like the
12713 selected window.
61ccba97 12714
2071918e
DA
127152011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12716
12717 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12718
b50a28de
SM
127192011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12720
12721 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12722 (graft_intervals_into_buffer): Simplify.
12723
015137db
EZ
127242011-11-18 Eli Zaretskii <eliz@gnu.org>
12725
12726 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12727 hash values of the two rows.
12728 (copy_row_except_pointers): Preserve the used[] arrays and the
12729 hash values of the two rows. (Bug#10035)
68c95424 12730 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
12731
12732 * xdisp.c (row_hash): New function, body extracted from
12733 compute_line_metrics.
12734 (compute_line_metrics): Call row_hash, instead of computing the
12735 hash code inline.
12736
12737 * dispnew.c (verify_row_hash): Call row_hash for computing the
12738 hash code of a row, instead of duplicating code from xdisp.c.
12739
12740 * dispextern.h (row_hash): Add prototype.
12741
a2addb04
TH
127422011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12743
12744 * frame.c (delete_frame): Don't delete the terminal when the last
12745 X frame is closed if emacs is built with GTK toolkit.
12746
df85d315
JB
127472011-11-17 Juanma Barranquero <lekktu@gmail.com>
12748
12749 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12750
a0c2d0ae
MR
127512011-11-17 Martin Rudalics <rudalics@gmx.at>
12752
12753 * window.c (Vwindow_splits): Rename to
12754 Vwindow_combination_resize. Suggested by Juri Linkov.
12755 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12756 of Vwindow_splits.
12757
58179cce
JB
127582011-11-16 Juanma Barranquero <lekktu@gmail.com>
12759
7877f373
JB
12760 * nsfns.m (Fns_font_name):
12761 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 12762
b6f67890
MR
127632011-11-16 Martin Rudalics <rudalics@gmx.at>
12764
12765 * window.h (window): Rename slot "nest" to "combination_limit".
12766 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12767 (Fset_window_nest): Rename to Fset_window_combination_limit.
12768 (Vwindow_nest): Rename to Vwindow_combination_limit.
12769 (recombine_windows, make_parent_window, make_window)
12770 (Fsplit_window_internal, saved_window)
12771 (Fset_window_configuration, save_window_save): Rename all
12772 occurrences of window_nest to window_combination_limit.
12773
c7015153
JB
127742011-11-15 Juanma Barranquero <lekktu@gmail.com>
12775
12776 * image.c (imagemagick_load_image): Fix typo.
12777
322ad6ec
EZ
127782011-11-14 Eli Zaretskii <eliz@gnu.org>
12779
12780 * xdisp.c (display_line): Move the call to
12781 highlight_trailing_whitespace before the call to
12782 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
12783 faces of all the glyphs to compute ROW's hash value.
12784 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 12785
f067b8ec
JB
127862011-11-14 Juanma Barranquero <lekktu@gmail.com>
12787
12788 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12789 just return (bug#10044).
12790
1e5b2111
EZ
127912011-11-12 Eli Zaretskii <eliz@gnu.org>
12792
7ef3cbd5
EZ
12793 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12794 with user-defined heap size. Bump the default size of the temacs
12795 heap to 27MB, to avoid memory warning when running temacs.
12796 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12797
1e5b2111
EZ
12798 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12799 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
12800 (verify_row_hash) [XASSERTS]: New function.
12801 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12802 that the hash value of glyph rows is correct.
1e5b2111 12803
89d61221
MR
128042011-11-12 Martin Rudalics <rudalics@gmx.at>
12805
12806 * window.h (window): Remove splits slot.
12807 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12808 (Fdelete_other_windows_internal, make_parent_window)
12809 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12810 (Fset_window_configuration, save_window_save): Don't deal with
12811 split status of windows.
12812 (saved_window): Remove splits slot.
12813 (Vwindow_splits): Rewrite doc-string.
12814
97f18cc8
JD
128152011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12816
12817 * xfns.c (unwind_create_frame):
12818 * nsfns.m (unwind_create_frame):
12819 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12820 Vframe_list (Bug#9999).
12821
22a648b4
DA
128222011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12823
0b381c7e 12824 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 12825
659afede
KH
128262011-11-11 Kenichi Handa <handa@m17n.org>
12827
12828 * callproc.c (Fcall_process): Set the member dst_multibyte of
12829 process_coding.
12830
9ac0394b
KH
128312011-11-11 Johan Bockgård <bojohan@gnu.org>
12832
12833 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12834 avoid a crash (bug#9496).
12835
2fbdc249
CY
128362011-11-09 Chong Yidong <cyd@gnu.org>
12837
12838 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12839 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12840
ac6b1f81
PE
128412011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12842
12843 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12844
09db192c
PE
128452011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12846
12847 Avoid some portability problems by eschewing 'extern inline' functions.
12848 The trivial performance wins aren't worth the portability hassles; see
12849 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12850 et seq.
12851 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12852 (window_box_width, window_box_left, window_box_left_offset)
12853 (window_box_right, window_box_right_offset): Undo previous change,
12854 by removing the "extern"s.
12855 * intervals.c (adjust_intervals_for_insertion)
12856 (adjust_intervals_for_deletion): Undo previous change,
12857 making these static again.
12858 (offset_intervals, temp_set_point_both, temp_set_point)
12859 (copy_intervals_to_string): No longer inline.
12860 * xdisp.c (window_text_bottom_y, window_box_width)
12861 (window_box_height, window_box_left_offset)
12862 (window_box_right_offset, window_box_left, window_box_right)
12863 (window_box): No longer inline.
12864
105216ed
CY
128652011-11-08 Chong Yidong <cyd@gnu.org>
12866
12867 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
12868 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12869 Signal an error if not a live window.
105216ed
CY
12870 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12871 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12872
ae9e237f
JB
128732011-11-07 Juanma Barranquero <lekktu@gmail.com>
12874
12875 * lisp.h (syms_of_abbrev): Remove declaration.
12876 Reported by CHENG Gao <chenggao@royau.me>.
12877
c7aa8333
EZ
128782011-11-07 Eli Zaretskii <eliz@gnu.org>
12879
12880 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12881 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12882 of temacs in GUI mode.
12883
be7f5545
MR
128842011-11-07 Martin Rudalics <rudalics@gmx.at>
12885
12886 * window.h: Declare delete_all_child_windows instead of
12887 delete_all_subwindows.
12888 * window.c (Fwindow_nest, Fset_window_nest)
12889 (Fset_window_new_total, Fset_window_new_normal)
12890 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12891 (delete_all_subwindows): Rename to delete_all_child_windows.
12892 (Fdelete_other_windows_internal, Fset_window_configuration):
12893 Call delete_all_child_windows instead of delete_all_subwindows.
12894 * frame.c (delete_frame): Call delete_all_child_windows instead
12895 of delete_all_subwindows.
12896
ca78dc43
PE
128972011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12898
12899 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12900 This is also needed for porting to any host where GC_MARK_STACK is
12901 not GC_MAKE_GCPROS_NOOPS.
12902 (which_symbols): Use it.
12903
a0241d01
KH
129042011-11-07 Kenichi Handa <handa@m17n.org>
12905
12906 * coding.c (coding_set_destination): Check coding->src_pos only
12907 when coding->src_object is a buffer (bug#9910).
12908
12909 * process.c (send_process): Set the member src_multibyte of coding
12910 to 0 (bug#9911) when sending a unibyte text.
12911
12912 * callproc.c (Fcall_process): Set the member src_multibyte of
12913 process_coding to 0 (bug#9912).
12914
a64bfdfa 129152011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
12916
12917 * xmenu.c (cleanup_widget_value_tree): New function.
12918 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12919 calling free_menubar_widget_value_tree directly (Bug#9830).
12920
cb41b32a
PE
129212011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12922
12923 Fix some portability problems with 'inline'.
12924 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12925 (window_box_width, window_box_left, window_box_left_offset)
12926 (window_box_right, window_box_right_offset): Declare extern.
12927 Otherwise, these inline functions do not conform to C99 and
12928 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12929 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12930 * intervals.c (adjust_intervals_for_insertion)
12931 (adjust_intervals_for_deletion): Now extern, because otherwise the
12932 extern inline functions 'offset_intervals' couldn't refer to it.
12933 (static_offset_intervals): Remove.
12934 (offset_intervals): Rewrite using the old contents of
12935 static_offset_intervals. The old version didn't conform to C99
12936 because an extern inline function contained a reference to an
12937 identifier with static linkage.
12938
b7041366
AS
129392011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12940
12941 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12942 GC.
12943
88a37c4d
EZ
129442011-11-06 Eli Zaretskii <eliz@gnu.org>
12945
12946 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12947 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12948 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12949 return Qleft_to_right.
12950
49745b39
CY
129512011-11-06 Chong Yidong <cyd@gnu.org>
12952
12953 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12954 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12955 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12956 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12957 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12958 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12959 (Fwindow_vscroll): Doc fix.
12960 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12961 argument, since it makes no sense to pass a live window and for
12962 consistency with window-child.
12963
1f05cd82
CS
129642011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12965
12966 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12967 support MSVC.
12968
22610910
JR
129692011-11-05 Jason Rumney <jasonr@gnu.org>
12970
12971 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12972 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12973 fonts (Bug#6029).
12974 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12975 bitwise arithmetic preventing use of unicode-sip and non-truetype
12976 opentype fonts.
12977
a06776b2
EZ
129782011-11-05 Eli Zaretskii <eliz@gnu.org>
12979
3ad924ba
EZ
12980 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12981 "emacs"-only part.
12982
a06776b2
EZ
12983 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12984 initialization code to keep similarity to xfns.c after changes
12985 from 2011-11-05.
12986
c9e7db78
JD
129872011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12988
a97f8f3f
JD
12989 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12990 (unwind_create_frame): New function (Bug#9943).
12991 (Fx_create_frame): Restructure code to be more similar to the one in
12992 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12993 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12994 Move terminal->reference_count++ just before making the frame official
12995 (Bug#9943).
12996
12997 * nsterm.m (x_free_frame_resources): New function.
12998 (x_destroy_window): Move code to x_free_frame_resources.
12999
c9e7db78 13000 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
13001 (Fx_create_frame, x_create_tip_frame):
13002 Move terminal->reference_count++ just before making the frame
75f1671a 13003 official. Move initialization of image_cache_refcount and
c9e7db78
JD
13004 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
13005
a6fc3b5c
EZ
130062011-11-05 Eli Zaretskii <eliz@gnu.org>
13007
13008 Support MSVC build with newer versions of Visual Studio.
13009 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
13010 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
13011 nt/gmake.defs.
13012
13013 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
13014 which are not supported by MSVC.
13015 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
13016 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
13017 bitfields.
13018 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
13019 types in bitfields.
13020 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
13021
13022 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
13023
58179cce 130242011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
13025
13026 Support MSVC build with newer versions of Visual Studio.
13027 * w32.c: Don't include w32api.h for MSVC.
13028 (init_environment) [_MSC_VER]: Call sys_access, not _access.
13029
13030 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
13031 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
13032 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
13033 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
13034 e_* cousins.
13035 (alloca) [_MSC_VER]: Define to _alloca.
13036
13037 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
13038
13039 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
13040
a58c13ed
EZ
130412011-11-04 Eli Zaretskii <eliz@gnu.org>
13042
13043 * xdisp.c (note_mouse_highlight): If either of
13044 previous/next-single-property-change returns nil, treat that as
13045 the beginning or the end of the buffer. (Bug#9955)
13046
fe0b6370
JD
130472011-11-04 Jan Djärv <jan.h.d@swipnet.se>
13048
a58c13ed 13049 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
13050 label is not null (Bug#9951).
13051 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
13052 may be NULL.
13053
89bd5ee1
EZ
130542011-11-04 Eli Zaretskii <eliz@gnu.org>
13055
13056 * window.c (Fwindow_body_size): Mention in the doc string that the
13057 return value is in frame's canonical units. (Bug#9949)
13058
84c3edb9
EZ
130592011-11-03 Eli Zaretskii <eliz@gnu.org>
13060
4e2fb5c7
EZ
13061 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
13062
84c3edb9 13063 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 13064 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 13065 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 13066
bc17a887
EZ
130672011-11-01 Eli Zaretskii <eliz@gnu.org>
13068
13069 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
13070 Don't stop backward scan on the continuation glyph, even though
13071 its CHARPOS is positive.
6d5eb5b0
SM
13072 (mouse_face_from_buffer_pos, note_mouse_highlight):
13073 Rename cover_string to disp_string.
bc17a887 13074
4ee88440
MR
130752011-11-01 Martin Rudalics <rudalics@gmx.at>
13076
13077 * window.c (temp_output_buffer_show): Don't use
13078 Vtemp_buffer_show_specifiers.
13079 (Vtemp_buffer_show_specifiers): Remove unused variable.
13080
c2ff3c02
EZ
130812011-10-30 Eli Zaretskii <eliz@gnu.org>
13082
13083 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
13084 past the beginning of the current glyph matrix.
13085
58179cce 130862011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
13087
13088 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
13089 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
13090 HAVE_GTK3 (Bug#9869).
b77a6a7f 13091
3b574623
JD
13092 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
13093 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
13094
b77a6a7f
JD
13095 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
13096
13097 * xterm.c: Declare x_handle_net_wm_state to return int.
13098 (handle_one_xevent): Check if we are iconified but don't have
13099 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
13100 (get_current_wm_state): Return non-zero if not hidden,
13101 check for _NET_WM_STATE_HIDDEN (Bug#9893).
13102 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
13103 (x_handle_net_wm_state): Return what get_current_wm_state returns.
13104 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
13105
196e41e4
PE
131062011-10-29 Paul Eggert <eggert@cs.ucla.edu>
13107
13108 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
13109 so that this new function doesn't get optimized away by a
13110 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
13111
021f2e1a
AS
131122011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13113
13114 * frame.h (MOUSE_HL_INFO): Remove excess parens.
13115
8b058d44
EZ
131162011-10-29 Eli Zaretskii <eliz@gnu.org>
13117
13118 Fix the `xbytecode' command.
13119 * .gdbinit (xprintbytestr): New command.
b50a28de 13120 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
13121 (xbytecode): Print the byte-code string as well.
13122
4452fb80
EZ
131232011-10-29 Kim Storm <storm@cua.dk>
13124
8b058d44
EZ
13125 * alloc.c (which_symbols): New function.
13126
21b72067
AS
131272011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13128
13129 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
13130 line. (Bug#9903)
13131
83ed7b5c
GM
131322011-10-29 Glenn Morris <rgm@gnu.org>
13133
13134 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
13135 Not clear what it was for, and it causes various bugs. (Bug#9839)
13136
5a7a728b
EZ
131372011-10-28 Eli Zaretskii <eliz@gnu.org>
13138
13139 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
13140 possible random value that matches one of those tested as
13141 condition to clear the mouse face.
13142
d3d0842f
CY
131432011-10-28 Chong Yidong <cyd@gnu.org>
13144
13145 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
13146
31b39d13
DN
131472011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
13148
13149 * window.c (make_window): Initialize phys_cursor_on_p.
13150
9aba6043
SM
131512011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
13152
13153 * lisp.h (struct Lisp_Symbol): Update comments.
13154
c20992f4
JB
131552011-10-28 Juanma Barranquero <lekktu@gmail.com>
13156
13157 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
13158
db4f02f2
EZ
131592011-10-28 Eli Zaretskii <eliz@gnu.org>
13160
13161 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
13162 <oslsachem@gmail.com> for helping to debug this.
13163
13164 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
13165 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
13166 (g_b_init_get_glyph_outline_w): New static variables.
13167 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
13168 (GetGlyphOutlineW_Proc): New typedefs.
13169 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
13170 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
13171 New functions.
13172 (w32font_open_internal, compute_metrics):
13173 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
13174 instead of calling the "wide" APIs directly.
13175
13176 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
13177
13178 * w32.h (syms_of_w32font): Add prototype.
13179
87e68db4
JB
131802011-10-27 Juanma Barranquero <lekktu@gmail.com>
13181
13182 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
13183 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
13184 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
13185 (Fmove_to_window_line): Doc fix.
13186
435c1d67
CY
131872011-10-27 Chong Yidong <cyd@gnu.org>
13188
13189 * process.c (make_process): Set gnutls_state to NULL.
13190
13191 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
13192 non-NULL, regardless of GNUTLS_INITSTAGE.
13193 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
13194 an error. Set process slots as soon as we allocate them.
13195
13196 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
13197
9c6c6f49
CY
131982011-10-27 Chong Yidong <cyd@gnu.org>
13199
9aba6043
SM
13200 * gnutls.c (emacs_gnutls_deinit): New function.
13201 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
13202 (Fgnutls_deinit, Fgnutls_boot): Use it.
13203
13204 * process.c (make_process): Initialize GnuTLS credentials to NULL.
13205 (deactivate_process): Call emacs_gnutls_deinit.
13206
657d08d3
JB
132072011-10-27 Juanma Barranquero <lekktu@gmail.com>
13208
13209 * image.c (x_create_x_image_and_pixmap):
13210 * w32.c (sys_rename, w32_delayed_load):
13211 * w32font.c (fill_in_logfont):
13212 * w32reg.c (x_get_string_resource): Silence compiler warnings.
13213
5430d399
JB
132142011-10-26 Juanma Barranquero <lekktu@gmail.com>
13215
13216 * w32fns.c (w32_default_color_map): New function,
13217 extracted from Fw32_default_color_map.
a7ef684b 13218 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 13219
fe0055fa
PE
132202011-10-25 Paul Eggert <eggert@cs.ucla.edu>
13221
13222 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
13223
e6346438
SM
132242011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
13225
13226 * keyboard.c (test_undefined): New function (bug#9751).
13227 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
13228
e112cc37
ET
132292011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
13230
13231 * sysdep.c (init_sys_modes): Fix the check for the controlling
13232 terminal (Bug#6649).
13233
7b5d6677
EZ
132342011-10-20 Eli Zaretskii <eliz@gnu.org>
13235
13236 * dispextern.h (struct bidi_it): New member next_en_type.
13237
13238 * bidi.c (bidi_line_init): Initialize the next_en_type member.
13239 (bidi_resolve_explicit_1): When next_en_pos is valid for the
13240 current character, check also for next_en_type being WEAK_EN.
13241 (bidi_resolve_weak): Don't enter the expensive loop if the current
13242 position is before next_en_pos. Record the bidi type of the first
13243 non-ET, non-BN character we find, in addition to its position.
13244 (bidi_level_of_next_char): Invalidate next_en_type when
13245 next_en_pos is over-stepped.
13246
7da0b018
PE
132472011-10-20 Paul Eggert <eggert@cs.ucla.edu>
13248
13249 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
13250 * editfns.c: Rewrite current-time-zone so that it invokes
13251 the equivalent of (format-time-string "%Z") to get the time zone name.
13252 This fixes a bug when the time zone name contains characters that
13253 need converting from the system time locale to Emacs internal format.
13254 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
13255 that patch fixed format-time-string to do the conversion, but
13256 I forgot to fix current-time-zone.
13257 (format_time_string): New function, containing most of
13258 what Fformat_time_string used to contain.
13259 (Fformat_time_string): Rewrite in terms of format_time_string.
13260 This doesn't change this function's behavior.
13261 (current-time-zone): Rewrite to use format_time_string.
13262 This fixes the bug reported by Michael Schierl in
13263 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
13264 Jason Rumney's 2007-06-07 change worked around this bug, but
13265 didn't fix it.
13266 * systime.h (tzname, timezone): Remove no-longer-used declarations.
13267
8547b010
EZ
132682011-10-19 Eli Zaretskii <eliz@gnu.org>
13269
13270 * xdisp.c (start_display): If the character at POS is displayed
13271 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
13272 (try_window_reusing_current_matrix): If a line ends in a display
13273 vector or the next line starts in a display vector, continue
13274 redrawing the window even though the character position of
13275 start_row was reached.
8547b010
EZ
13276 (Bug#9771, part 2)
13277
4e948d15
CY
132782011-10-18 Chong Yidong <cyd@gnu.org>
13279
13280 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
13281 with nobreak-char-display too.
13282
4787455f
EZ
132832011-10-18 Eli Zaretskii <eliz@gnu.org>
13284
13285 Fix part 3 of bug#9771.
13286 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
13287 (bidi_resolve_neutral): Don't enter the expensive loop looking for
13288 non-neutral characters if the current character is a paragraph
13289 separator (a.k.a. Newline). This avoids running the same
13290 expensive loop twice, once when we consume the preceding newline
13291 and the other time when the line actually needs to be displayed.
13292 Avoid the loop when we see neutrals on the base embedding level
13293 following a character whose directionality is the same as the
13294 paragraph's. This avoids running the expensive loop when a line
13295 ends in a long sequence of neutrals, like control characters.
13296 Add assertion against STRONG_AL type. Slightly rearrange code
13297 that determines the type of a neutral given the first non-neutral
13298 that follows it.
13299 (bidi_level_of_next_char): Set next_en_pos to zero when
13300 invalidating its info.
13301
2c91f553
EZ
133022011-10-17 Eli Zaretskii <eliz@gnu.org>
13303
13304 * xdisp.c (push_display_prop): Determine whether to record string
13305 or buffer position by IT->string, not by IT->method. Allow
13306 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
13307 (move_it_vertically_backward): Don't look for character position
13308 immediately after the newline when in a continuation line.
13309 (Bug#9771, part 1)
2c91f553 13310
c7b08b0d
MR
133112011-10-15 Martin Rudalics <rudalics@gmx.at>
13312
13313 * window.c (coordinates_in_window): Rewrite and delabelize
13314 vertical border check. (Bug#5357) (Bug#9618)
13315
6b02f655
SM
133162011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
13317
13318 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
13319 errors in XSetWindowBorder (bug#9310).
13320
81d40c92
DA
133212011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
13322
13323 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
13324 avoid crash when xmalloc overrun checking is enabled.
13325
d4172c3b
EZ
133262011-10-13 Eli Zaretskii <eliz@gnu.org>
13327
13328 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
13329 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
13330 cursor motion with <left> and <right> arrow keys.
13331
13332 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
13333 some callers set that themselves.
13334
b00eea75
EZ
133352011-10-12 Eli Zaretskii <eliz@gnu.org>
13336
13337 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
13338 display string and the previous row comes from the same string and
13339 is empty. (Bug#9739) (Bug#9738)
13340
8fe012c4
SM
133412011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
13342
13343 * doc.c (get_doc_string): Encode file name (bug#9735).
13344
0074aef2
EZ
133452011-10-12 Eli Zaretskii <eliz@gnu.org>
13346
79beb178
EZ
13347 * bidi.c (bidi_level_of_next_char):
13348 * xdisp.c (get_visually_first_element): Remove old incorrect
13349 comments regarding the Unicode Line Separator character.
13350
0074aef2
EZ
13351 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
13352
6e4b3fbe
DA
133532011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
13354
13355 * alloc.c (Fgc_status): Do not access beyond zombies array
13356 boundary if nzombies > MAX_ZOMBIES.
13357 * alloc.c (dump_zombies): Add missing format specifier.
13358
0324f3af
PE
133592011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13360
b5525cac
PE
13361 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13362 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13363
0324f3af
PE
13364 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13365 Some packages use them to denote characters with modifiers.
13366
e9b5f888
AS
133672011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13368
13369 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13370 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13371 matching a pp-number. Rename parameter var to var1.
13372
127827c0
SM
133732011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13374
13375 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13376
c8fd3bd0
GM
133772011-10-08 Glenn Morris <rgm@gnu.org>
13378
13379 * callint.c (Fcall_interactively): Give a more explicit error for the
13380 'c' case with a non-character input. (Bug#8479)
13381
352ec8ff
EZ
133822011-10-08 Eli Zaretskii <eliz@gnu.org>
13383
03669ccb
EZ
13384 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13385 lines.
7061c986
EZ
13386 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13387 lines that are hscrolled on the left.
03669ccb 13388
352ec8ff
EZ
13389 * dispnew.c (buffer_posn_from_coords): Account for a possible
13390 presence of header-line. (Bug#4426)
13391
a66cfb1c
SM
133922011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13393
6b02f655
SM
13394 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13395 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 13396
7c5ee88e
PE
133972011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13398
13399 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13400 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13401 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13402 this makes Emacs dump core during garbage collection on rare
13403 occasions. sizeof is obviously inferior to offsetof here, so
13404 stick with offsetof.
13405 (GC_POINTER_ALIGNMENT): New macro.
13406 (mark_memory): Omit 3rd (offset) arg; caller changed.
13407 Don't assume EMACS_INT alignment is the same as pointer alignment.
13408
df1bbe5b
SM
134092011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13410
13411 * keyboard.c (read_key_sequence_remapped): New var.
13412 (read_key_sequence): Compute remapping in the right buffer.
13413 (command_loop_1): Use read_key_sequence's remapping directly.
13414
51553db6
SM
134152011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13416
32c1fffd
SM
13417 * dired.c (file_name_completion): Don't expand file name.
13418 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13419 before checking file name handler.
13420
51553db6
SM
13421 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13422 they've been requested explicitly (bug#9591).
13423
b6bd1599 134242011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
13425
13426 * keymap.c (Fsingle_key_description): Use make_specified_string
13427 instead of build_string to build string from push_key_description.
13428 (Bug#5193)
13429
f701dc2a
PE
134302011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13431
4222c55d
PE
13432 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13433 This fixes a Y2038 bug on 64-bit hosts.
13434 * buffer.c (reset_buffer):
13435 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13436 (Fclear_buffer_auto_save_failure):
13437 Use 0, not -1, to represent an unset failure time, since time_t
13438 might not be signed.
13439
f701dc2a
PE
13440 Remove dependency on glibc malloc internals.
13441 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13442 Move back here from lisp.h, but with their new implementations.
13443 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13444 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13445 * charset.c (charset_table_init): New static var.
13446 (syms_of_charset): Use it instead of xmalloc. This removes a
13447 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13448 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13449 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13450 Move back to alloc.c.
13451 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13452 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13453
9ceebf39
JD
134542011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13455
13456 * nsterm.m (windowDidResize): Call x_set_window_size only when
13457 ns_in_resize is true. Otherwise set pixelwidth/height and
13458 call change_frame_size (Bug#9628).
13459
cb993c58
PE
134602011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13461
3930c88b
PE
13462 Port --enable-checking=all to Fedora 14 x86-64.
13463 * charset.c (syms_of_charset): Also account for glibc malloc's
13464 internal overhead when calculating the initial malloc maximum.
13465
cb993c58
PE
13466 Port --enable-checking=all to Fedora 14 x86.
13467 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13468 Move to lisp.h.
13469 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13470 (overrun_check_realloc, overrun_check_free):
13471 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13472 That way, xmalloc returns a properly-aligned pointer even if
13473 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13474 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13475 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13476 into account when calculating the initial malloc maximum.
13477 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13478 Move here from alloc.c, so that charset.c can use it too.
13479 Properly align; the old code wasn't right for common 32-bit hosts
13480 when configured with --enable-checking=all.
13481 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13482 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13483
31bed486
EZ
134842011-09-29 Eli Zaretskii <eliz@gnu.org>
13485
04c70788 13486 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
13487 use EDOM.
13488
fbcaa2f3
EZ
134892011-09-28 Eli Zaretskii <eliz@gnu.org>
13490
13491 * xdisp.c (compute_display_string_end): If there's no display
13492 string at CHARPOS, return -1.
13493
13494 * bidi.c (bidi_fetch_char): When compute_display_string_end
13495 returns a negative value, treat the character as a normal
13496 character not covered by a display string. (Bug#9624)
13497
a239d4e9
JB
134982011-09-28 Juanma Barranquero <lekktu@gmail.com>
13499
13500 * lread.c (Fread_from_string): Fix typo in docstring.
13501
88652fd5
EZ
135022011-09-27 Eli Zaretskii <eliz@gnu.org>
13503
13504 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13505 newline, reseat the iterator instead of bidi-iterating there one
13506 character at a time. (Bug#9610)
32c1fffd
SM
13507 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13508 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 13509
ed497dd4
AS
135102011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13511
13512 * lread.c (readevalloop): Use correct code for NBSP.
13513 (read1): Likewise. (Bug#9608)
13514
b2bf61aa
MA
135152011-09-25 Michael Albinus <michael.albinus@gmx.de>
13516
13517 * dbusbind.c (Fdbus_register_signal): When service is not
13518 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13519
32bbb17c
GM
135202011-09-25 Glenn Morris <rgm@gnu.org>
13521
13522 * buffer.c (truncate-lines): Doc fix.
13523
94e0933e
CY
135242011-09-24 Chong Yidong <cyd@stupidchicken.com>
13525
13526 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13527 (Fset_window_next_buffers): Doc fix.
13528
cddde921
GM
135292011-09-24 Glenn Morris <rgm@gnu.org>
13530
13531 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13532
1260aef1
PE
135332011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13534
25b4bfa0
PE
13535 Fix minor problems found by static checking.
13536 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
13537 * indent.c (Fvertical_motion): Fix == vs = typo.
13538
e3cbd34b
EZ
135392011-09-24 Eli Zaretskii <eliz@gnu.org>
13540
a66cfb1c
SM
13541 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13542 Default value is now t. Doc fix.
6bf7006f 13543
e3cbd34b 13544 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 13545 logic when moving up, not only when moving down. Fix the
e3cbd34b 13546 confusing name and values of the it_overshoot_expected variable;
32c1fffd 13547 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
13548
13549 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13550 CHARPOS is covered by a display string which includes newlines.
13551 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13552 is covered by a display string with embedded newlines.
13553
a3de0cbd
MA
135542011-09-24 Michael Albinus <michael.albinus@gmx.de>
13555
13556 * dbusbind.c (Fdbus_register_signal): Add match rule to
13557 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
13558 (Fdbus_register_method, Vdbus_registered_objects_table):
13559 Fix docstring.
a3de0cbd 13560
b260039d
JM
135612011-09-24 Jim Meyering <meyering@redhat.com>
13562
32c1fffd 13563 do not ignore write error for any output size
b260039d
JM
13564 The previous change was incomplete.
13565 While it makes emacs --batch detect the vast majority of stdout
13566 write failures, errors were still ignored whenever the output size is
13567 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13568 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13569 && echo FAIL: ignored write error
13570 FAIL: ignored write error
13571 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13572 && echo FAIL: ignored write error
13573 FAIL: ignored write error
13574 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13575
8eca8a7c
AS
135762011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13577
13578 * emacs.c (Fkill_emacs): In noninteractive mode exit
13579 non-successfully if a write error occurred on stdout. (Bug#9574)
13580
3341db62
EZ
135812011-09-21 Eli Zaretskii <eliz@gnu.org>
13582
13583 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13584 the xassert test.
13585
13586 * dispextern.h (struct it): Update the comment documenting what
13587 can it->OBJECT be.
13588
8c203dbf
EZ
135892011-09-20 Eli Zaretskii <eliz@gnu.org>
13590
13591 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13592 a display string, extend search for cursor position to end of row.
13593 (find_row_edges): If the row ends in a newline from a display
13594 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13595 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
13596 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13597 non-empty line. Fixes confusing cursor motion with arrow keys at
13598 the beginning of a line that starts with whitespace.
8c203dbf 13599
a4824228
LMI
136002011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13601
13602 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13603 (bug#9493).
13604
33ed493b
CY
136052011-09-18 Chong Yidong <cyd@stupidchicken.com>
13606
13607 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13608 boolean (Bug#9154).
13609
56cd55c8
EZ
136102011-09-18 Eli Zaretskii <eliz@gnu.org>
13611
13612 * xdisp.c (display_line): Record maximum and minimum buffer
13613 positions even if no glyphs were produced (e.g., by a zero-width
13614 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13615 buffer positions that will be removed from the glyph row because
13616 they don't fit.
c02dcedf
EZ
13617 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13618 column is beyond frame width: don't subtract 1 "pixel" when
13619 computing width of the stretch.
3e62b7e0
EZ
13620 (reseat_at_next_visible_line_start): Undo the change made on
13621 2011-09-17 that saved paragraph information and restored it after
13622 the call to `reseat'. (Bug#9545)
56cd55c8 13623
5ed99d36 136242011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
13625
13626 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13627 and turn window cursor on if cleared (Bug#9415).
13628
5ed99d36 136292011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
13630
13631 * search.c (boyer_moore): Take unibyte characters from pattern
13632 literally. (Bug#9458)
13633
9bade7b2
EZ
136342011-09-18 Eli Zaretskii <eliz@gnu.org>
13635
13636 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13637
e5e9d610
PE
136382011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13639
87e4427a
PE
13640 Fix minor problem found by static checking.
13641 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13642 initialized, to pacify gcc -Wuninitialized.
13643
e5e9d610
PE
13644 * fileio.c: Report proper errno when syscall falls.
13645 (Finsert_file_contents): Save and restore errno,
13646 so that report_file_error outputs the correct diagnostic.
13647 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13648
a1674f0b
EZ
136492011-09-18 Eli Zaretskii <eliz@gnu.org>
13650
13651 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13652
fbfb6dd4
EZ
136532011-09-17 Eli Zaretskii <eliz@gnu.org>
13654
13655 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13656 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13657
bb187662
EZ
136582011-09-17 Eli Zaretskii <eliz@gnu.org>
13659
1137e8b8 13660 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 13661 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
13662
13663 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13664 (bidi_find_paragraph_start): Search back for paragraph beginning
13665 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13666 (bidi_move_to_visually_next): Only trigger paragraph-related
13667 computations when the last character is a newline or at EOB, not
13668 just any NEUTRAL_B. (Bug#9470)
13669
bb187662
EZ
13670 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13671 truncated lines if point is covered by a display string. (Bug#9524)
13672
2e621251
PE
136732011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13674
13675 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13676 (cons_to_x_long): New function.
13677 (lisp_data_to_selection_data): Use it. Correct the test for
13678 short-versus-long data; it was negated. Break out of vector
13679 loop, for efficiency, when a long datum is discovered.
13680
91a15bc6
SM
136812011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13682
13683 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13684
b41c3a35
EZ
136852011-09-16 Eli Zaretskii <eliz@gnu.org>
13686
13687 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13688 GCC PR/17406) by declaring this function with external scope.
13689
7812ba2d
PE
136902011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13691
13692 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13693 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13694
cf7edc2a
AS
136952011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13696
13697 * editfns.c (Fformat): Correctly handle text properties on "%%".
13698
bd01620e
EZ
136992011-09-15 Eli Zaretskii <eliz@gnu.org>
13700
13701 * xterm.c (x_draw_composite_glyph_string_foreground):
13702 * w32term.c (x_draw_composite_glyph_string_foreground):
13703 * term.c (encode_terminal_code):
13704 * composite.c (composition_update_it, get_composition_id):
13705 * xdisp.c (get_next_display_element)
13706 (fill_composite_glyph_string): Add comments about special meaning
13707 of TAB characters in a composition.
13708
a02719a3
PE
137092011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13710
13711 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
13712 This occurs when processing a multibyte format.
13713 Problem reported by Wolfgang Jenker.
a02719a3 13714
72589a3c
JB
137152011-09-15 Johan Bockgård <bojohan@gnu.org>
13716
13717 * xdisp.c (try_cursor_movement): Only check for exact match if
13718 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13719
1c14176c
PE
137202011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13721
13722 Remove unused external symbols.
13723 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13724 * xdisp.c (calc_pixel_width_or_height): Now static.
13725 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13726 * indent.c (check_display_width):
13727 * w32term.c: Fix comment to match code.
13728 * xterm.c, xterm.h (x_catching_errors): Remove.
13729
d2eea5b5
PE
137302011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13731
13732 * xselect.c: Use signed conversions more consistently (Bug#9498).
13733 (selection_data_to_lisp_data): Assume incoming selection data are
13734 signed integers, not unsigned. This is to be consistent with
13735 outgoing selection data, which was modified to use signed integers
13736 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13737 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13738 expects long, not unsigned long.
13739
46888499
EZ
137402011-09-14 Eli Zaretskii <eliz@gnu.org>
13741
13742 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13743 computation of loop end. Reported by Johan Bockgård
13744 <bojohan@gnu.org>.
13745
ef8ef9fb
CY
137462011-09-13 Chong Yidong <cyd@stupidchicken.com>
13747
13748 * frame.c (Fother_visible_frames_p): Function deleted.
13749
fa819fed
EZ
137502011-09-12 Eli Zaretskii <eliz@gnu.org>
13751
13752 * indent.c (compute_motion): Process display vector front to back
13753 rather than the other way around. (Bug#2496)
13754
2ba8e008
SM
137552011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13756
13757 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13758
20f53c69
CY
137592011-09-11 Chong Yidong <cyd@stupidchicken.com>
13760
13761 * minibuf.c (Fread_from_minibuffer): Doc fix.
13762
d562d7a4
EZ
137632011-09-11 Eli Zaretskii <eliz@gnu.org>
13764
13765 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13766 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13767
1c4d7f3d
LMI
137682011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13769
13770 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13771 value for non-existent files.
13772
b885bf36
EZ
137732011-09-11 Eli Zaretskii <eliz@gnu.org>
13774
13775 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13776 set its "size" to -1. This will set the modtime_size field of
13777 the corresponding buffer to -1, which is what
13778 verify-visited-file-modtime expects for files that do not exist.
13779 (Bug#9139)
13780
6612f0bf
PE
137812011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13782
13783 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13784 here ...
13785 * lisp.h: ... from here. push_key_description is no longer
13786 defined in keyboard.c, so its declaration should not be in
13787 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13788 logically belongs with push_key_description.
13789
dfb3f755
PE
137902011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13791
13792 * buffer.h: Include <sys/types.h> instead of <time.h>.
13793 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13794 Problem reported by Herbert J. Skuhra.
13795
3134906c
LMI
137962011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13797
13798 * xml.c (parse_region): Make the parsing work for
13799 non-comment-starting XML files again (bug#9144).
13800
8d903f4e
AS
138012011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13802
13803 * image.c (gif_load): Fix calculation of bottom and right corner.
13804 (Bug#9468)
13805
80ad64f4
EZ
138062011-09-10 Eli Zaretskii <eliz@gnu.org>
13807
13808 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13809 redisplay in small windows.
13810
208a048d
EZ
138112011-09-09 Eli Zaretskii <eliz@gnu.org>
13812
13813 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13814
9b1c252e
MR
138152011-09-08 Martin Rudalics <rudalics@gmx.at>
13816
13817 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13818 Operate on live windows only.
13819
2949f33b
JB
138202011-09-08 Juanma Barranquero <lekktu@gmail.com>
13821
13822 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13823
e08dcafd
EZ
138242011-09-07 Eli Zaretskii <eliz@gnu.org>
13825
13826 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13827 only under bidi iteration.
13828
115b96bd
JD
138292011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13830
13831 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13832
c8199d0f
PE
138332011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13834
13835 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13836 Without this fix, the command to link temacs failed due to an
13837 undefined symbol __builtin_isnan. This is because
13838 /usr/include/iso/math_c99.h #defines isnan(x) to
13839 __builtin_isnan(x), but the bundled gcc, which identifies itself
13840 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13841 a __builtin_isnan.
13842 * floatfns.c (isnan): #undef, and then #define to a clone of
13843 what's in data.c.
13844 (Fisnan): Always define, since it's always available now.
13845 (syms_of_floatfns): Always define isnan at the Lisp level.
13846
e39b275c 138472011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
13848
13849 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13850
b2db44d9 138512011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 13852
f4af5137 13853 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
13854 The previous code assumed that file offsets (off_t values) fit in
13855 EMACS_INT variables, which is not true on typical 32-bit hosts.
13856 The code messed up by falsely reporting buffer overflow in cases
13857 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13858 when "big" contains more than 2**29 bytes, even though this
13859 inserts just one byte and does not overflow the buffer.
13860 (Finsert_file_contents): Store file offsets as off_t
13861 values, not as EMACS_INT values. Check for overflow when
13862 converting between EMACS_INT and off_t. When checking for
13863 buffer overflow or for overlap, take the offsets into account.
13864 Don't use EMACS_INT for small values where int suffices.
13865 When checking for overlap, fix a typo: ZV was used where
13866 ZV_BYTE was intended.
13867 (Fwrite_region): Don't assume off_t fits into 'long'.
13868 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13869
ecfc0a49
MA
138702011-09-05 Michael Albinus <michael.albinus@gmx.de>
13871
13872 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13873
6511acf2 138742011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 13875
0999621a 13876 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
13877
13878 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 13879 (esprintf, exprintf, evxprintf): New functions.
62f19c19 13880 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 13881 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
13882 (modify_event_symbol): Do not assume that the length of
13883 name_alist_or_stem is safe to alloca and fits in int.
13884 (Fexecute_extended_command): Likewise for function name and binding.
13885 (Frecursion_depth): Wrap around reliably on integer overflow.
13886 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13887 since some callers pass EMACS_INT values.
13888 (Fsingle_key_description): Don't crash if symbol name contains more
13889 than MAX_ALLOCA bytes.
13890 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13891 (get_minibuffer): Arg is now EMACS_INT, not int.
13892 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 13893 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
13894 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13895
2be7d702
PE
13896 * dbusbind.c (signature_cat): New function.
13897 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
13898 Do not overrun buffer; instead, report string overflow.
13899
9d1df220
PE
13900 * dispnew.c (add_window_display_history): Don't overrun buffer.
13901 Truncate instead; this is OK since it's just a log.
13902
33ef5c64
PE
13903 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13904 even if the time zone offset is outlandishly large.
13905 Don't mishandle offset == INT_MIN.
13906
66c6fdd5
PE
13907 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13908 when creating daemon; the previous buffer-overflow check was incorrect.
13909
d749b01b
PE
13910 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13911 which has the guts of the old verror function.
13912
b5cd1905
PE
13913 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13914 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13915
6e1a67fb
PE
13916 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13917 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 13918 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 13919 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
13920 length of string rather than counting it via multiple sprintfs;
13921 that's simpler and more reliable.
c21721cc
PE
13922 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13923 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13924 sprintf, in case result does not fit in int.
13925
c57b67fc
PE
13926 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13927 (fontset_from_font): Print it.
13928
8a401434
PE
13929 * frame.c (tty_frame_count): Now printmax_t, not int.
13930 (make_terminal_frame, set_term_frame_name): Print it.
13931 (x_report_frame_params): In X, window IDs are unsigned long,
13932 not signed long, so print them as unsigned.
13933 (validate_x_resource_name): Check for implausibly long names,
13934 and don't assume name length fits in 'int'.
13935 (x_get_resource_string): Don't blindly alloca invocation name;
13936 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13937 not fit in int.
13938
6e1a67fb
PE
13939 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13940 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
13941 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13942
0df02bf3
PE
13943 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13944 Use esprintf, not sprintf, in case result does not fit in int.
13945
48e30793
PE
13946 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13947 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13948 it as a large positive number.
13949 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13950 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13951
a66ff6d8
PE
13952 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13953 in case result does not fit in int.
13954
aca216ff
PE
13955 * print.c (float_to_string): Detect width overflow more reliably.
13956 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13957 buffer overrun. Don't assume list length fits in 'int'. Treat
13958 print length of 0 as 0, not as infinity; to be consistent with other
13959 uses of print length in this function. Don't overflow print length
13960 index. Don't assume hash table size fits in 'long', or that
13961 vectorlike size fits in 'unsigned long'.
13962
31c286f7
PE
13963 * process.c (make_process): Use printmax_t, not int, to format
13964 process-name gensyms.
13965
55e5faa1
PE
13966 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13967
80f2e268
PE
13968 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13969 to avoid potential buffer overrun.
13970
670741ab
PE
13971 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13972 if X resource line is longer than 512 bytes.
13973
b7163a50
PE
13974 * xfns.c (x_window): Make sprintf buffer a bit bigger
13975 to avoid potential buffer overrun.
13976
ae58ff1f
PE
13977 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13978
c43c8a6a
PE
13979 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13980
3f8236f4
PE
139812011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13982
53e9fe90 13983 Integer overflow fixes for scrolling, etc.
6511acf2
PE
13984 Without these, Emacs silently mishandles large integers sometimes.
13985 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
13986 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13987
6511acf2
PE
13988 * xdisp.c (try_window_id): Check Emacs fixnum range before
13989 converting to 'int'.
806add1d 13990
6511acf2 13991 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
13992 Check that an Emacs fixnum is in range before assigning it to 'int'.
13993 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13994 values converted from Emacs fixnums.
13995 (Frecenter): Don't wrap around a line count if it is out of 'int'
13996 range; instead, treat it as an extreme value.
13997 (Fset_window_configuration, compare_window_configurations):
13998 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13999
6511acf2
PE
14000 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
14001 that can exceed INT_MAX. Check that EMACS_INT value is in range
14002 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
14003 (match_limit): Don't assume that a fixnum can fit in 'int'.
14004
6511acf2 14005 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
14006 exceed INT_MAX.
14007
6511acf2 14008 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
14009 (Fvertical_motion): Don't wrap around LINES values that don't fit
14010 in 'int'. Instead, treat them as extreme values. This is good
14011 enough for windows, which can't have more than INT_MAX lines anyway.
14012
fcb901a7
LMI
140132011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14014
0f2f6b6d
LMI
14015 * Require libxml/parser.h to avoid compilation warning.
14016
fcb901a7
LMI
14017 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
14018
14019 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
14020 since this reportedly can destroy thread storage.
14021
6e20a0d4
CY
140222011-08-30 Chong Yidong <cyd@stupidchicken.com>
14023
14024 * syntax.c (find_defun_start): Update all cache variables if
14025 exiting early (Bug#9401).
14026
148ae00e
EZ
140272011-08-30 Eli Zaretskii <eliz@gnu.org>
14028
f6cfbd8f
EZ
14029 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
14030
148ae00e
EZ
14031 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
14032 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
14033 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
14034
14035 * term.c (tty_append_glyph): New function.
14036 (produce_stretch_glyph): Static function and its prototype deleted.
14037
a66cfb1c
SM
14038 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
14039 Add prototypes.
148ae00e 14040
c4a07a4c
PE
140412011-08-29 Paul Eggert <eggert@cs.ucla.edu>
14042
14043 * image.c (parse_image_spec): Check for nonnegative, not for positive,
14044 when checking :margin (Bug#9390).
14045 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 14046 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
14047 so that the name doesn't mislead. All uses changed.
14048
6bc8cd65
JB
140492011-08-28 Johan Bockgård <bojohan@gnu.org>
14050
14051 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
14052 set_tty_hooks.
14053
dca4927e
EZ
140542011-08-27 Eli Zaretskii <eliz@gnu.org>
14055
14056 * xdisp.c (move_it_to): Don't bail out early when reaching
14057 position beyond to_charpos, if we are scanning backwards.
14058 (move_it_vertically_backward): When DY == 0, make sure we get to
14059 the first character in the line after the newline.
14060
f2cad773
PE
140612011-08-27 Paul Eggert <eggert@cs.ucla.edu>
14062
14063 * ccl.c: Improve and simplify overflow checking (Bug#9196).
14064 (ccl_driver): Do not generate an out-of-range pointer.
14065 (Fccl_execute_on_string): Remove unnecessary check for
14066 integer overflow, noted by Stefan Monnier in
14067 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
14068 Remove a FIXME that didn't need fixing.
14069 Simplify the newly-introduced buffer reallocation code.
14070
0cae2cdb
JB
140712011-08-27 Juanma Barranquero <lekktu@gmail.com>
14072
14073 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
14074
5fc295a4 140752011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 14076
70c60eb2 14077 Integer and memory overflow issues (Bug#9196).
726e0ab1 14078
d31850da
PE
14079 * doc.c (get_doc_string): Rework so that
14080 get_doc_string_buffer_size is the actual buffer size, rather than
14081 being 1 less than the actual buffer size; this makes xpalloc more
14082 convenient.
14083
a69fbedb
PE
14084 * image.c (x_allocate_bitmap_record, cache_image):
14085 * xselect.c (Fx_register_dnd_atom):
14086 Simplify previous changes by using xpalloc.
14087
fe5c5d37
PE
14088 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
14089 since either will do and ptrdiff_t is convenient with xpalloc.
14090
0065d054
PE
14091 * charset.c (charset_table_size)
14092 (struct charset_sort_data.priority): Now ptrdiff_t.
14093 (charset_compare): Don't overflow if priorities differ greatly.
14094 (Fsort_charsets): Don't assume list length fits in int.
14095 Check for size-calculation overflow when allocating sort data.
14096 (syms_of_charset): Allocate an initial charset table that is
14097 just under 64 KiB, to avoid problems with glibc malloc and mmap.
14098
14099 * cmds.c (internal_self_insert): Check for size-calculation overflow.
14100
14101 * composite.h (struct composition.glyph_len): Now int, not unsigned.
14102 The actual value is always <= INT_MAX, and leaving it unsigned made
14103 overflow checking harder.
14104
14105 * dispextern.h (struct glyph_matrix.rows_allocated)
14106 (struct face_cache.size): Now ptrdiff_t, for convenience in use
14107 with xpalloc. The values are still always <= INT_MAX.
14108
14109 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
14110
14111 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
14112 (SAFE_NALLOCA): New macro.
14113
14114 * region-cache.c (struct boundary.pos, find_cache_boundary)
14115 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
14116 (set_cache_region, invalidate_region_cache)
14117 (revalidate_region_cache, know_region_cache, region_cache_forward)
14118 (region_cache_backward, pp_cache):
14119 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
14120 so that ptrdiff_t * can be passed to xpalloc.
14121 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
14122 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
14123 (pp_cache): Don't assume cache_len fits in int.
14124 * region-cache.h: Adjust extern decls to match.
14125
14126 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
14127 EMACS_INT, since either will do, for xpalloc.
14128
14129 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
14130 (xnmalloc, xnrealloc, xpalloc): New functions.
14131
726e0ab1
PE
14132 * bidi.c (bidi_shelve_header_size): New constant.
14133 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
14134 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
14135
51f30bc5 14136 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
14137 * buffer.c (overlays_at, overlays_in, record_overlay_string)
14138 (overlay_strings):
14139 Don't update size of array until after memory allocation succeeds,
14140 because xmalloc/xrealloc may not return.
0065d054
PE
14141 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
14142 now that we have proper integer overflow checking.
14143 (record_overlay_string, overlay_strings): Catch overflows when
14144 calculating size of overlay_str_buf.
726e0ab1 14145
0065d054
PE
14146 * callproc.c (Fcall_process): Check for size overflow when
14147 calculating size of args2.
14148 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
14149 Normally we prefer signed values, but sticking with ptrdiff_t would
14150 require adding more-complicated checks.
726e0ab1
PE
14151
14152 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
14153 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
14154 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 14155 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
14156
14157 * character.c (Fstring): Check for size-calculation overflow.
14158
14159 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
14160 unnecessary integer overflow. Check for size overflow.
14161 (encode_coding_object): Don't update size until xmalloc succeeds.
14162
14163 * composite.c (get_composition_id): Check for overflow in glyph
14164 length calculations.
14165
14166 Integer and memory overflow fixes for display code.
14167 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
14168 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
14169 (scrolling_window): Check for overflow in size calculations.
14170 (line_draw_cost, realloc_glyph_pool, add_row_entry):
14171 Don't assume glyph table len fits in int.
14172 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
14173 (row_table_size): Now ptrdiff_t, not int.
14174 (scrolling_window): Avoid overflow in size calculations.
14175 Don't update size until allocation succeeds.
14176 * fns.c (concat): Check for overflow in size calculations.
14177 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
14178 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14179 (NEXT_ALMOST_PRIME_LIMIT): New constant.
14180
14181 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
14182 (get_doc_string): Check for size calculation overflow.
14183 Don't update size until allocation succeeds.
14184 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
14185 EMACS_INT, where ptrdiff_t will do.
14186 (Fsubstitute_command_keys): Check for string overflow.
14187
14188 * editfns.c (set_time_zone_rule): Don't assume environment length
14189 fits in int.
14190 (message_length): Now ptrdiff_t, not int.
14191 (Fmessage_box): Don't update size until allocation succeeds.
14192 Don't assume message length fits in int.
14193 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
14194
0065d054
PE
14195 * emacs.c (main): Do not reallocate argv, since there is a null at
14196 the end that can be overwritten, and this way there's no need to
14197 worry about size-calculation overflow.
14198 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
14199
14200 * eval.c (init_eval_once, grow_specpdl): Don't update size until
14201 alloc succeeds.
14202 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
14203
14204 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
14205 (x_set_scroll_bar_width, x_figure_window_size):
14206 Check for integer overflow.
14207 (x_set_alpha): Do not assume XINT fits in int.
14208
14209 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
14210 This is for the members text_lines, text_cols, total_lines, total_cols,
14211 where the system imposes an 'int' limit.
14212
14213 * fringe.c (Fdefine_fringe_bitmap):
14214 Don't update size until alloc works.
14215
14216 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
14217 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
14218
14219 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
14220 Check for size-calculation overflow.
14221 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
14222 do, as we prefer signed integers.
14223 (id_to_widget.max_size, id_to_widget.used)
14224 (xg_store_widget_in_map, xg_remove_widget_from_map)
14225 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
14226 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
14227 Use and return ptrdiff_t, not int.
14228 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
14229 * gtkutil.h: Change prototypes to match the above.
14230
14231 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
14232 are duplicate now that they've been promoted to lisp.h.
14233 (x_allocate_bitmap_record, x_alloc_image_color)
14234 (make_image_cache, cache_image, xpm_load):
14235 Don't update size until alloc is done.
14236 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
14237 (x_detect_edges):
3256efce 14238 Check for size calculation overflow.
726e0ab1
PE
14239 (ct_colors_allocated_max): New constant.
14240 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
14241 overflow.
3256efce 14242
726e0ab1
PE
14243 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
14244 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
14245 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
14246 Use ptrdiff_t, not int, to count maps.
14247 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
14248 calculations. Don't update size until allocation succeeds.
14249 Redo calculations to avoid overflow.
726e0ab1
PE
14250 * keyboard.h: Change prototypes to match the above.
14251
14252 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
14253 to count maps.
14254 (current_minor_maps): Check for size calculation overflow.
14255 * keymap.h: Change prototypes to match the above.
14256
14257 * lread.c (read1, init_obarray): Don't update size until alloc done.
14258
14259 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
14260 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
14261
726e0ab1
PE
14262 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
14263 Now ptrdiff_t, not int.
14264 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
14265 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
14266
14267 * process.c (Fnetwork_interface_list): Check for overflow
14268 in size calculation.
14269
14270 * region-cache.c (move_cache_gap): Check for size calculation overflow.
14271
14272 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
14273 overflow. Don't bother calling xmalloc when xrealloc will do.
14274
14275 * search.c (Freplace_match): Check for size calculation overflow.
14276 (Fset_match_data): Don't assume list lengths fit in 'int'.
14277
14278 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
14279 for command line length. Do not attempt to address one before the
14280 beginning of an array, as that's not portable.
14281
14282 * term.c (max_frame_lines): Remove; unused.
14283 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
14284 not int.
14285 (encode_terminal_code, calculate_costs): Check for size
14286 calculation overflow.
14287 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
14288 table lengths and related sizes. Don't update size until alloc
14289 done. Redo calculations to avoid overflow.
14290 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
14291
14292 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
14293 subtracting pointers.
14294 (gobble_line): Check for overflow more carefully. Don't update size
14295 until alloc done.
14296
14297 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
14298 Don't update size until alloc done.
14299 Redo size calculations to avoid overflow.
14300 Check for size calculation overflow.
0065d054 14301 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
14302
14303 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
14304 Use ptrdiff_t, not int, for sizes.
14305 (store_mode_line_noprop_char): Don't update size until alloc done.
14306
0065d054
PE
14307 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
14308 Use ptrdiff_t, not int, for sizes.
14309 (Finternal_make_lisp_face, cache_face):
14310 Check for size calculation overflow.
14311 (cache_face): Treat size calculation overflows as if they were
14312 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
14313
14314 * xfns.c (x_encode_text, x_set_name_internal)
14315 (Fx_change_window_property): Use ptrdiff_t, not int, to count
14316 sizes, since they can exceed INT_MAX in size. Check for size
14317 calculation overflow.
14318
0065d054
PE
14319 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
14320 (xg_select): Check for size calculation overflow.
726e0ab1
PE
14321 Don't update size until alloc done.
14322
0065d054 14323 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 14324 as sprintf is limited to int lengths.
1d526e2f 14325
252c5ee1
PE
14326 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
14327 (X_LONG_MIN): New macros.
864d7ce7
PE
14328 Use them to make the following changes clearer.
14329 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
14330 This change doesn't affect the value now, but it may help remind
14331 future maintainers not to raise the value too much later.
14332 (SELECTION_QUANTUM): Remove, replacing with ...
14333 (selection_quantum): ... new function, which avoids overflow.
14334 All uses changed.
14335 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
14336 assumption that selection length fits in 'int'.
14337 (x_reply_selection_request, x_handle_selection_request)
14338 (x_get_window_property, receive_incremental_selection)
14339 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
14340 (lisp_data_to_selection_data, clean_local_selection_data):
14341 Use ptrdiff_t, not int, to record length of selection.
14342 (x_reply_selection_request, x_get_window_property)
14343 (receive_incremental_selection, x_property_data_to_lisp):
14344 Redo calculations to avoid overflow.
14345 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 14346 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
14347 something.
14348 (x_get_window_property, receive_incremental_selection)
14349 (lisp_data_to_selection_data, x_property_data_to_lisp):
14350 Check for size-calculation overflow.
14351 (x_get_window_property, receive_incremental_selection)
14352 (lisp_data_to_selection_data, Fx_register_dnd_atom):
14353 Don't store size until memory allocation succeeds.
14354 (x_get_window_property): Plug memory leak on memory exhaustion.
14355 Don't double-block input; malloc is safe here. Don't assume 2**34
14356 - 4 fits in unsigned long. Add an xassert to check
14357 XGetWindowProperty overflow. Be more careful about overflow
14358 calculations, and distinguish size from memory overflow better.
14359 (receive_incremental_selection): When tracing, don't assume
14360 unsigned int is less than INT_MAX.
14361 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14362 harmful) conversions of unsigned short to int.
14363 (lisp_data_to_selection_data): Don't assume that integers
14364 in the range -65535 through -1 fit in an X unsigned short.
14365 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14366 result parameters unless successful. Rely on cons_to_unsigned
14367 to report problems with elements; the old code wasn't right anyway.
14368 (x_check_property_data): Check for int overflow; we cannot use
14369 a wider type due to X limits.
14370 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14371
726e0ab1 14372 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 14373
0065d054
PE
14374 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14375 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
14376 (x_color_cells): Don't store size until memory allocation succeeds.
14377 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 14378 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
14379 (x_term_init): Don't assume length fits in int (sprintf is limited
14380 to int size).
bc18e09d 14381
ebfa62c0
PE
14382 Use ptrdiff_t for composition IDs.
14383 * character.c (lisp_string_width):
14384 * composite.c (composition_table_size, n_compositions)
14385 (get_composition_id, composition_gstring_from_id):
14386 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14387 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14388 * window.c (Frecenter):
14389 Use ptrdiff_t, not int, for composition IDs.
14390 * composite.c (get_composition_id): Check for integer overflow.
14391 * composite.h: Adjust prototypes to match the above changes.
14392
d3411f89
PE
14393 Use ptrdiff_t for hash table indexes.
14394 * category.c (hash_get_category_set):
14395 * ccl.c (ccl_driver):
14396 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14397 * coding.c (coding_system_charset_list, detect_coding_system):
14398 * coding.h (struct coding_system.id):
14399 * composite.c (get_composition_id, gstring_lookup_cache):
14400 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14401 * image.c (xpm_get_color_table_h):
14402 * lisp.h (hash_lookup, hash_put):
14403 * minibuf.c (Ftest_completion):
14404 Use ptrdiff_t for hash table indexes, not int (which is too
14405 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14406 32-bit --with-wide-int hosts).
14407
e097a6fa
PE
14408 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14409 Add a FIXME comment about memory leaks.
14410 (syms_of_charset): Don't assume xmalloc returns.
14411
5637687f
PE
14412 Don't assume that stated character widths fit in int.
14413 * character.c (Fchar_width, c_string_width, lisp_string_width):
14414 * character.h (CHAR_WIDTH):
14415 * indent.c (MULTIBYTE_BYTES_WIDTH):
14416 Use sanitize_char_width to avoid undefined and/or bad behavior
14417 with outlandish widths.
a66cfb1c 14418 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
14419 now that we have two such functions. All uses changed.
14420 (sanitize_char_width): New inline function.
14421
a2271ba2
PE
14422 Don't assume that tab-width fits in int.
14423 * character.h (sanitize_width): New inline function.
14424 (SANE_TAB_WIDTH): New macro.
14425 (ASCII_CHAR_WIDTH): Use it.
14426 * indent.c (sane_tab_width): Remove. All uses replaced by
14427 SANE_TAB_WIDTH (current_buffer).
14428 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14429
18c52557
PE
14430 * fileio.c: Integer overflow issues with file modes.
14431 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14432
caeeedc1
PE
14433 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14434 Remove unreachable code.
14435 (read_hex, load_charset_map_from_file): Check for integer overflow.
14436
6df6ae42 14437 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
14438 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14439 (x_send_scroll_bar_event): Likewise. Check that the size does not
14440 exceed limits imposed by XClientMessageEvent, as well as the usual
14441 ptrdiff_t and size_t limits.
14442
b13995db
PE
14443 * keyboard.c: Overflow, signedness and related fixes.
14444 (make_lispy_movement): Use same integer type in forward decl
14445 that is used in the definition.
14446 (read_key_sequence, keyremap_step):
14447 Change bufsize argument back to int, undoing my 2011-03-30 change.
14448 We prefer signed types, and int is wide enough here.
14449 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14450 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14451 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14452 length, not size_t. Use ptrdiff_t for index, not int.
14453 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14454 possibility of integer overflow.
14455
13464394
PE
14456 Overflow, signedness and related fixes for images.
14457
14458 * dispextern.h (struct it.stack[0].u.image.image_id)
14459 (struct_it.image_id, struct image.id, struct image_cache.size)
14460 (struct image_cache.used, struct image_cache.ref_count):
14461 * gtkutil.c (update_frame_tool_bar):
14462 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14463 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14464 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14465 * nsmenu.m (update_frame_tool_bar):
14466 * xdisp.c (calc_pixel_width_or_height):
14467 * xfns.c (image_cache_refcount):
14468 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14469 on typical 64-bit hosts.
14470
14471 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14472 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14473 Omit unnecessary casts to int.
14474 (parse_image_spec): Check that integers fall into 'int' range
14475 when the callers expect that.
14476 (image_ascent): Redo ascent calculation to avoid int overflow.
14477 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14478 (lookup_image): Remove unnecessary tests.
14479 (xbm_image_p): Locals are now of int, not EMACS_INT,
14480 since parse_image_check makes sure they fit into int.
14481 (png_load, gif_load, svg_load_image):
14482 Prefer int to unsigned where either will do.
14483 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
14484 old tiff_error_handler and tiff_warning_handler.
14485 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
14486 stack buffer overflows. It uses only the features of vsnprintf
14487 that are common to both POSIX and native Microsoft.
14488 (tiff_error_handler, tiff_warning_handler): Use it.
14489 (tiff_load, gif_load, imagemagick_load_image):
14490 Don't assume :index value fits in 'int'.
14491 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14492 (imagemagick_load_image): Check that crop parameters fit into
14493 the integer types that MagickCropImage accepts. Don't assume
14494 Vimagemagick_render_type has a nonnegative value. Don't assume
14495 size_t fits in 'long'.
14496 (gs_load): Use printmax_t to print the widest integers possible.
14497 Check for integer overflow when computing image height and width.
14498
c11821d4
EZ
144992011-08-26 Eli Zaretskii <eliz@gnu.org>
14500
14501 * xdisp.c (redisplay_window): Don't force window start if point
14502 will be invisible in the resulting window. (Bug#9324)
14503
0c95fcf7
EZ
145042011-08-25 Eli Zaretskii <eliz@gnu.org>
14505
14506 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14507 the display spec is of the form `(space ...)'.
14508 (handle_display_spec): Return the value returned by
14509 handle_single_display_spec, not just 1 or zero.
14510 (handle_single_display_spec): If the display spec is of the form
14511 `(space ...)', and specifies display in the text area, return 2
14512 rather than 1.
fee65a97 14513 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
14514 accurately, and prefer exact match for point under bidi.
14515 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
14516
14517 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14518 into disp_prop; all users changed.
14519
14520 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14521 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14522 for the text covered by the display property.
14523
e4ed06f1
CY
145242011-08-25 Chong Yidong <cyd@stupidchicken.com>
14525
14526 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14527 Change return value to nil.
14528 (Frecord_buffer): Delete unused function.
14529
f67cdd7f
EZ
145302011-08-24 Eli Zaretskii <eliz@gnu.org>
14531
5980d4c6
EZ
14532 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14533 buffers, return left-to-right.
8610fe8b
EZ
14534 (set_cursor_from_row): Consider candidate row a win if its glyph
14535 represents a newline and point is on that newline. Fixes cursor
14536 positioning on the newline at EOL of R2L text within L2R
14537 paragraph, and vice versa.
14538 (try_cursor_movement): Check continued rows, in addition to
14539 continuation rows. Fixes unwarranted scroll when point enters a
14540 continued line of R2L text within an L2R paragraph, or vice versa.
14541 (cursor_row_p): Consider the case of point being equal to
14542 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14543 from the end of a short line to the beginning of a continued line
14544 of R2L text within L2R paragraph.
14545 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14546 composed characters.
5980d4c6 14547
f67cdd7f
EZ
14548 * bidi.c (bidi_check_type): Use xassert.
14549 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14550 members.
14551
bca633fb
EZ
145522011-08-23 Eli Zaretskii <eliz@gnu.org>
14553
14554 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14555 a character.
14556
4a5885a7
CY
145572011-08-23 Chong Yidong <cyd@stupidchicken.com>
14558
14559 * nsfont.m (ns_otf_to_script): Fix typo.
14560
0902a04e
KH
145612011-08-22 Kenichi Handa <handa@m17n.org>
14562
14563 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14564 extra slot even if the purpose is char-code-property-table.
14565
1a2e6670
EZ
145662011-08-23 Eli Zaretskii <eliz@gnu.org>
14567
8ddde651
EZ
14568 * xdisp.c (redisplay_window): When computing centering_position,
14569 account for the height of the header line. (Bug#8874)
14570
425cc014
EZ
14571 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14572 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14573 candidate is selected by the mouse, and that candidate has a
14574 composed character under the mouse.
14575
1a2e6670
EZ
14576 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14577 coordinates reported by pos-visible-in-window-p for a composed
14578 character in column zero.
14579
8b76d6f8
SM
145802011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14581
14582 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14583
dac347dd
EZ
145842011-08-22 Eli Zaretskii <eliz@gnu.org>
14585
14586 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14587 consider it a hit if to_charpos is anywhere in the range of the
14588 composed buffer positions.
14589
e013fb34
CY
145902011-08-22 Chong Yidong <cyd@stupidchicken.com>
14591
14592 * image.c (gif_load): Don't assume that each subimage has the same
14593 dimensions as the base image. Handle disposal method that is
14594 "undefined" by the gif spec (Bug#9335).
14595
bd1ba3e8
CY
145962011-08-20 Chong Yidong <cyd@stupidchicken.com>
14597
14598 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 14599 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 14600
54a1215b
EZ
146012011-08-19 Eli Zaretskii <eliz@gnu.org>
14602
823564e5
EZ
14603 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14604 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14605 from an Org mode buffer to a Speedbar frame.
14606
54a1215b
EZ
14607 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14608 a composition, take its buffer position from IT->cmp_it.charpos.
14609 Fixes cursor positioning at the beginning of a line that begins
14610 with a composed character.
14611
9778ebcc
EZ
146122011-08-18 Eli Zaretskii <eliz@gnu.org>
14613
0be6ee06
EZ
14614 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14615 character bidirectional type, use STRONG_L instead. Fixes crashes
14616 in a buffer produced by `describe-categories'.
14617
9778ebcc
EZ
14618 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14619 members before the level stack, so they would be saved and
14620 restored when copying iterator state. Fixes incorrect reordering
14621 around TABs covered by display properties.
14622
156bffbe
AS
146232011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14624
6b02f655 14625 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 14626
72ad093b
CY
146272011-08-17 Chong Yidong <cyd@stupidchicken.com>
14628
14629 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
14630 (internal_condition_case_2, internal_condition_case_n):
14631 Remove unnecessary aborts (Bug#9081).
72ad093b 14632
35774242
EZ
146332011-08-17 Eli Zaretskii <eliz@gnu.org>
14634
14635 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14636 has no `load' handler, try opening the file locally. (Bug#9311)
14637
db76dd85
KB
146382011-08-16 Ken Brown <kbrown@cornell.edu>
14639
14640 * gmalloc.c: Expand comment.
14641
b215eee5
EZ
146422011-08-16 Eli Zaretskii <eliz@gnu.org>
14643
14644 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14645 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14646
a4579d33
KB
146472011-08-16 Ken Brown <kbrown@cornell.edu>
14648
14649 Fix memory allocation problems in Cygwin build (Bug#9273).
14650
14651 * unexcw.c ( __malloc_initialized): Declare external variable.
14652 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14653
8b76d6f8
SM
14654 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14655 New variables.
a4579d33
KB
14656 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14657 dumped emacs.
14658 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14659 in the static heap.
14660 [CYGWIN] (special_realloc): New function.
14661 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14662 requests to realloc storage in the static heap.
14663
3ebec551
PE
146642011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14665
14666 * bidi.c (bidi_initialize): Remove unused local.
14667
9fd8be00
EZ
146682011-08-15 Eli Zaretskii <eliz@gnu.org>
14669
6b02f655
SM
14670 * bidimirror.h:
14671 * biditype.h: Remove file.
14672 * makefile.w32-in ($(BLD)/bidi.$(O)):
14673 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
14674
14675 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14676
14677 * chartab.c: Improve commentary for the uniprop_table API.
14678
32413314
EZ
14679 * bidi.c (bidi_paragraph_init): Support zero value of
14680 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
14681 (bidi_initialize): Use uniprop_table instead of including
14682 biditype.h and bidimirror.h.
32413314 14683
9fd8be00
EZ
14684 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14685 coordinates of the iterator when restoring from ppos_it.
14686 (Bug#9296)
14687
5cf2b69b
KH
146882011-08-14 Kenichi Handa <handa@m17n.org>
14689
14690 * process.c (create_process): Call setup_process_coding_systems
72ad093b 14691 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 14692
daf17d00
EZ
146932011-08-14 Eli Zaretskii <eliz@gnu.org>
14694
14695 * xdisp.c (move_it_in_display_line_to): Don't invoke
14696 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14697 ppos_it. Fixes vertical cursor motion when line beginning is
14698 covered by an image. (Bug#9296)
14699
08e3161a
JD
147002011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14701
14702 * nsterm.h (ns_run_ascript): Declare.
14703 (NSAPP_DATA2_RUNASSCRIPT): Define.
14704
14705 * nsfns.m (as_script, as_result, as_status): New static variables.
14706 (ns_run_ascript): New function.
5e617bc2 14707 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
14708 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14709 the event loop. Get status from as_status (Bug#7276).
14710
14711 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14712 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14713 the event loop (Bug#7276).
14714
a3720aa2
AS
147152011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14716
14717 * gnutls.c (QCgnutls_bootprop_priority)
14718 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14719 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14720 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14721 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14722 (QCgnutls_bootprop_verify_hostname_error)
14723 (QCgnutls_bootprop_callbacks_verify): Rename from
14724 Qgnutls_bootprop_..., all uses changed.
14725
14726 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14727 uses changed.
14728
0a0d27fb
PE
147292011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14730
19d5c50c
PE
14731 * xfaces.c (Qframe_set_background_mode): Now static.
14732 * dispextern.h (Qframe_set_background_mode): Remove decl.
14733
0a0d27fb
PE
14734 * process.c (Fnetwork_interface_info): Declare local only if needed.
14735
377538cb
JD
147362011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14737
14738 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14739 (Fnetwork_interface_list): Allocate in increments of bytes instead
14740 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14741 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14742 sockaddr.
14743 (struct ifflag_def): notrailers is smart on OSX.
14744 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14745 Get hardware address with getifaddrs if available.
14746
08fff70c
EZ
147472011-08-12 Eli Zaretskii <eliz@gnu.org>
14748
14749 * xdisp.c (iterate_out_of_display_property): xassert that
14750 IT->position is set to within IT->object's boundaries. Break from
14751 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
14752 when IT->position is set up wrongly due to some bug.
14753 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
14754 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14755 entry. Force push_it to save on the stack the current
14756 buffer/string position, to be restored by pop_it. Fix flags in
14757 the iterator structure wrt the object coming from a display
14758 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14759 properties. (Bug#9284)
14760
7be1c708 147612011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 14762
7be1c708
CY
14763 * fontset.c (fontset_get_font_group): Add proper type checks.
14764 (Bug#9172)
aac0c6e3 14765
7be1c708 147662011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 14767
7be1c708
CY
14768 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14769 and LC_VERSION_MIN_MACOSX.
14770 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14771 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 14772
97bb72a6
EZ
147732011-08-08 Eli Zaretskii <eliz@gnu.org>
14774
14775 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
14776 no-display-properties-and-no-overlays under bidi display.
14777 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 14778 properties and overlays.
97bb72a6 14779
d5617611
CY
147802011-08-08 Chong Yidong <cyd@stupidchicken.com>
14781
37e11a63
CY
14782 * editfns.c (Fset_time_zone_rule): Document relationship with the
14783 setenv function.
14784
d5617611
CY
14785 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14786 the font entity extracted from the cache (Bug#8109).
14787
58872834
CY
147882011-08-07 Chong Yidong <cyd@stupidchicken.com>
14789
14790 * composite.c (autocmp_chars): Don't reset point. That is done by
14791 restore_point_unwind (Bug#5984).
14792
75bfc667
JL
147932011-08-07 Juri Linkov <juri@jurta.org>
14794
14795 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14796 to show the arg `TIME' instead of `TIMEVAL'.
14797
d1410150
EZ
147982011-08-06 Eli Zaretskii <eliz@gnu.org>
14799
14800 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14801 display property strides EOL and includes a newline, as in
14802 longlines-mode. (Bug#9254)
75b771e4
EZ
14803 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14804 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
14805
14806 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14807 is non-zero, even if the data buffer is NULL. Fixes a crash in
14808 vertical-motion with longlines-mode. (Bug#9254)
14809
35928349
EZ
148102011-08-05 Eli Zaretskii <eliz@gnu.org>
14811
ec7cc85b
EZ
14812 * bidi.c <bidi_cache_total_alloc>: Now static.
14813 (bidi_initialize): Initialize bidi_cache_total_alloc.
14814
8b76d6f8 14815 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
14816 cache. (Bug#9221)
14817
14818 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14819 amount allocated this far in `bidi_cache_total_alloc'.
14820 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14821 non-zero, only free the data buffer without restoring the cache
14822 contents. All callers changed.
14823
14824 * dispextern.h (bidi_unshelve_cache): Update prototype.
14825
14826 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14827 (move_it_in_display_line, move_it_to)
14828 (move_it_vertically_backward, move_it_by_lines): Replace the call
14829 to xfree to an equivalent call to bidi_unshelve_cache.
14830 (move_it_in_display_line_to): Fix logic of returning
412b6358 14831 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 14832
e2e2423b
EZ
148332011-08-05 Eli Zaretskii <eliz@gnu.org>
14834
14835 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14836 came from a string character with a `cursor' property. (Bug#9229)
14837
ae9e757a
JD
148382011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14839
14840 * Makefile.in (LIB_PTHREAD): New variable.
14841 (LIBES): Add LIB_PTHREAD (Bug#9216).
14842
14843 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14844 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14845
213bd7f2
AS
148462011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14847
6b02f655 14848 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 14849
99aaf75f
JD
148502011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14851
14852 * xterm.c (x_find_topmost_parent): New function.
14853 (x_set_frame_alpha): Find topmost parent window with
14854 x_find_topmost_parent and set the property there also (bug#9181).
14855 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14856
c74e9d86
PE
148572011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14858
14859 * callproc.c (Fcall_process): Avoid vfork clobbering
14860 the local vars buffer, coding_systems, current_dir.
14861
640c8776
SM
148622011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14863
14864 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14865
f26d0e4c
PE
148662011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14867
8a10d76c
PE
14868 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14869 so that it is not optimized away.
14870
f26d0e4c
PE
14871 * xdisp.c (compute_display_string_pos): Remove unused local.
14872
55439c61
EZ
148732011-08-02 Eli Zaretskii <eliz@gnu.org>
14874
14875 Fix slow cursor motion and scrolling in large buffers with
14876 selective display, like Org Mode buffers. (Bug#9218)
14877
14878 * dispextern.h (struct bidi_it): New member disp_prop_p.
14879
14880 * xdisp.c: Remove one-slot cache of display string positions.
14881 (compute_display_string_pos): Accept an additional argument
5e617bc2 14882 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
14883 for a display string or property. If found, set DISP_PROP_P
14884 non-zero.
14885
14886 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
14887 DISP_PROP_P, and pass it to compute_display_string_pos.
14888 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
14889 non-zero. All callers of bidi_fetch_char changed.
14890
fb33fa43
SM
148912011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14892
14893 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14894
b099e063
DM
148952010-12-03 Don March <don@ohspite.net>
14896
14897 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14898 last character M-[char] is translated to ESC [char] (bug#7541).
14899
5cc7f7af
KH
149002011-08-02 Kenichi Handa <handa@m17n.org>
14901
d0fffa3f 14902 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
14903
14904 * chartab.c (uniprop_table): Make it non-static.
14905
525d5e6e
EZ
149062011-08-01 Eli Zaretskii <eliz@gnu.org>
14907
14908 * xdisp.c (forward_to_next_line_start): Accept additional argument
14909 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14910 on the newline.
14911 (reseat_at_next_visible_line_start): Use the bidi iterator state
14912 returned by forward_to_next_line_start to restore the state of
14913 it->bidi_it after backing up to previous newline. (Bug#9212)
14914
31011111
AS
149152011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14916
14917 * regex.c (re_comp): Protoize.
14918 (re_exec): Fix return type.
14919 (regexec): Fix type of `ret'. (Bug#9203)
14920
476371c4
PE
149212011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14922
e5d76069
PE
14923 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14924 This is needed if max-image-size is a floating-point number.
14925
9a79b20c
AS
149262011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14927
14928 * print.c (print_object): Print empty symbol as ##.
14929
14930 * lread.c (read1): Read ## as empty symbol.
14931
d8c2fa78
AA
149322011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14933
14934 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14935 setting frame foreground color (Bug#9175).
14936 (x_set_background_color): Likewise.
14937
ffe57a7a
AA
14938 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14939 contents (Bug#9176).
14940 (EmacsTooltip -init): Remove bezels and add shadows to
14941 tooltip windows.
14942
bf3492a5
AA
14943 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14944 or scroll bar (Bug#8470).
14945
d55e9c53
AA
14946 * nsfont.m (nsfont_open): Remove assignment to voffset and
14947 unnecessary vars hshink, expand, hd, full_height, min_height.
14948 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14949
14950 * nsterm.h (nsfont_info): Remove voffset field.
14951
d8c2fa78 149522011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
14953
14954 Implement strike-through and overline on NextStep (Bug#8863).
14955
14956 * nsfont.m (nsfont_open): Use underline position provided by font,
14957 instead of hard-coded value of 2.
14958 (nsfont_draw): Call ns_draw_text_decoration instead.
14959
14960 * nsterm.h: Add declaration for ns_draw_text_decoration.
14961
14962 * nsterm.m (ns_draw_text_decoration): New function for drawing
14963 underline, overline, and strike-through.
14964 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14965 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 14966 accommodate underlining, etc.
4843aac3 14967
4cc60b9b
EZ
149682011-07-28 Eli Zaretskii <eliz@gnu.org>
14969
bc7ece87
EZ
14970 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14971 default.
4cc60b9b 14972
476371c4
PE
149732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14974
66606eea
PE
14975 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14976 Without this fix, if a signal arrives just after memory fills up,
14977 'malloc' might be invoked reentrantly.
14978
476371c4
PE
14979 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14980 In other words, assume that every image size is allowed, on non-X
14981 hosts. This assumption is probably wrong, but it lets Emacs compile.
14982
f3fcc40d
AS
149832011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14984
14985 * regex.c (re_iswctype): Convert return values to boolean.
14986
350c992f
EZ
149872011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14988
14989 * xdisp.c (compute_display_string_pos): Don't use cached display
14990 string position if the buffer had its restriction changed.
14991 (Bug#9184)
14992
5266b4bb
PE
149932011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14994
14995 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14996
2573a837 149972011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 14998
41f55ccd 14999 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 15000
39e378da
PE
15001 * bidi.c: Integer size and overflow fixes.
15002 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
15003 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
15004 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15005 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
15006 (bidi_find_other_level_edge):
15007 Use ptrdiff_t instead of EMACS_INT where either will do.
15008 This works better on 32-bit hosts configured --with-wide-int.
15009 (bidi_cache_ensure_space): Check for size-calculation overflow.
15010 Use % rather than repeated addition, for better worst-case speed.
15011 Don't set bidi_cache_size until after xrealloc returns, because it
15012 might not return.
15013 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
15014 (bidi_cache_ensure_space): Also check that the bidi cache size
15015 does not exceed that of the largest Lisp string or buffer. See Eli
15016 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 15017
5e927815
PE
15018 * alloc.c (__malloc_size_t): Remove.
15019 All uses replaced by size_t. See Andreas Schwab's note
15020 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
15021
ca4aa935
PE
15022 * image.c: Improve checking for integer overflow.
15023 (check_image_size): Assume that f is nonnull, since
15024 it is always nonnull in practice. This is one less thing to
15025 worry about when checking for integer overflow later.
15026 (x_check_image_size): New function, which checks for integer
15027 overflow issues inside X.
15028 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
15029 This removes the need for a memory_full check.
15030 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
15031 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
15032 (xbm_read_bitmap_data): Change locals back to 'int', since
15033 their values must fit in 'int'.
15034 (xpm_load_image, png_load, tiff_load):
15035 Invoke x_create_x_image_and_pixmap earlier,
15036 to avoid much needless work if the image is too large.
15037 (tiff_load): Treat overly large images as if
15038 x_create_x_image_and_pixmap failed, not as malloc failures.
15039 (gs_load): Use x_check_image_size.
15040
5f8f9cc2
PE
15041 * gtkutil.c: Omit integer casts.
15042 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
15043 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
15044
5adf60bc
PE
15045 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
15046
c8907a93
PE
15047 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
15048 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
15049 would wrongly return t on a 64-bit host.
15050
e3c25c68
PE
15051 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
15052 The plain *_OVERFLOW macros run afoul of GCC bug 49705
15053 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
15054 and therefore cause GCC to emit a bogus diagnostic in some cases.
15055
3f791afe
PE
15056 * image.c: Integer signedness and overflow and related fixes.
15057 This is not an exhaustive set of fixes, but it's time to
15058 record what I've got.
15059 (lookup_pixel_color, check_image_size): Remove redundant decls.
15060 (check_image_size): Don't assume that arbitrary EMACS_INT values
15061 fit in 'int', or that arbitrary 'double' values fit in 'int'.
15062 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
15063 (tiff_load, imagemagick_load_image):
15064 Check for overflow in size calculations.
15065 (x_create_x_image_and_pixmap): Remove unnecessary test for
15066 xmalloc returning NULL; that can't happen.
15067 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
15068 (xpm_color_bucket): Use better integer hashing function.
15069 (xpm_cache_color): Don't possibly over-allocate memory.
15070 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
15071 (gif_memory_source):
15072 Use ptrdiff_t, not int or size_t, to record sizes.
15073 (png_load): Don't assume values greater than 2**31 fit in 'int'.
15074 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
15075 either works, as we prefer signed integers.
15076 (tiff_read_from_memory, tiff_write_from_memory):
15077 Return tsize_t, not size_t, since that's what the TIFF API wants.
15078 (tiff_read_from_memory): Don't fail simply because the read would
15079 go past EOF; instead, return a short read.
15080 (tiff_load): Omit no-longer-needed casts.
15081 (Fimagemagick_types): Don't assume size fits into 'int'.
15082
3cc5a532
PE
15083 Improve hashing quality when configured --with-wide-int.
15084 * fns.c (hash_string): New function, taken from sxhash_string.
15085 Do not discard information about ASCII character case; this
15086 discarding is no longer needed.
15087 (sxhash-string): Use it. Change sig to match it. Caller changed.
15088 * lisp.h: Declare it.
15089 * lread.c (hash_string): Remove, since we now use fns.c's version.
15090 The fns.c version returns a wider integer if --with-wide-int is
15091 specified, so this should help the quality of the hashing a bit.
15092
b312a492
PE
15093 * emacs.c: Integer overflow minor fix.
15094 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
15095 Define only if GNU_LINUX.
15096 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
15097
dfd153ae
PE
15098 * dispnew.c: Integer signedness and overflow fixes.
15099 Remove unnecessary forward decls, that were a maintenance hassle.
15100 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
15101 All uses changed.
15102 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
15103 (scrolling_window): Use ptrdiff_t, not int, for byte count.
15104 (prepare_desired_row, line_draw_cost):
15105 Use int, not unsigned, where either works.
15106 (save_current_matrix, restore_current_matrix):
15107 Use ptrdiff_t, not size_t, where either works.
15108 (init_display): Check for overflow more accurately, and without
15109 relying on undefined behavior.
15110
a81d11a3
PE
15111 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
15112 Remove, replacing with the new symbols in lisp.h. All uses changed.
15113 * fileio.c (make_temp_name):
15114 * filelock.c (lock_file_1, lock_file):
15115 * xdisp.c (message_dolog):
15116 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
15117 Use pMd etc. instead.
15118 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
15119 replacing the pWIDE etc. symbols removed from editfns.c.
15120
3300e6fd
PE
15121 * keyboard.h (num_input_events): Now uintmax_t.
15122 This is (very slightly) less likely to mess up due to wraparound.
15123 All uses changed.
15124
fd05c7e9
PE
15125 * buffer.c: Integer signedness fixes.
15126 (alloc_buffer_text, enlarge_buffer_text):
15127 Use ptrdiff_t rather than size_t when either will do, as we prefer
15128 signed integers.
15129
903fe15d
PE
15130 * alloc.c: Integer signedness and overflow fixes.
15131 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
15132 (__malloc_size_t): Default to size_t, not to int.
15133 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
15134 (Fgarbage_collect, mark_object_loop_halt, mark_object):
15135 Prefer ptrdiff_t to size_t when either would do, as we prefer
15136 signed integers.
15137 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
15138 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
15139 Now const. Initialize with values that are in range even if char
15140 is signed.
15141 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
15142 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
15143 These functions do the right thing with sizes > 2**32.
15144 (check_depth): Now ptrdiff_t, not int.
15145 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
15146 Adjust to new way of storing sizes. Check for size overflow bugs
15147 in rest of code.
15148 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
15149 slightly wrong anyway, as it missed one instance of
15150 XMALLOC_OVERRUN_CHECK_OVERHEAD.
15151 (refill_memory_reserve): Omit needless cast to size_t.
15152 (mark_object_loop_halt): Mark as externally visible.
15153
ac82cc6a
PE
15154 * xselect.c: Integer signedness and overflow fixes.
15155 (Fx_register_dnd_atom, x_handle_dnd_message):
15156 Use ptrdiff_t, not size_t, since we prefer signed.
15157 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
15158 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
15159 x_dnd_atoms_size and x_dnd_atoms_length.
15160
c2d1e36d
PE
15161 * doprnt.c: Prefer signed to unsigned when either works.
15162 * eval.c (verror):
15163 * doprnt.c (doprnt):
15164 * lisp.h (doprnt):
15165 * xdisp.c (vmessage):
15166 Use ptrdiff_t, not size_t, when using or implementing doprnt,
15167 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
15168 prefer signed arithmetic to avoid comparison confusion.
15169 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
15170 but is a bit tricky.
15171
0e926e56
PE
15172 Assume freestanding C89 headers, string.h, stdlib.h.
15173 * data.c, doprnt.c, floatfns.c, print.c:
15174 Include float.h unconditionally.
15175 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
15176 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
15177 * regex.c: Likewise for stddef.h, string.h.
15178 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
15179 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
15180 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
15181 (STDC_HEADERS): Remove obsolete defines.
15182 * sysdep.c: Include limits.h unconditionally.
15183
9cfdb3ec
PE
15184 Assume support for memcmp, memcpy, memmove, memset.
15185 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
15186 * regex.c (memcmp, memcpy):
15187 Remove; we assume C89 now.
15188
15189 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
15190 (__malloc_safe_bcopy): Remove; no longer needed.
15191
cf950e6b 15192 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
15193 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
15194 well either way, and we prefer signed to unsigned.
15195
dbf38e02
LMI
151962011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
15197
15198 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
15199 closes the connection while we're reading (bug#9182).
15200
d6f0886c 152012011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 15202
d6f0886c
JD
15203 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
15204 are specified (Bug#9168).
24e0f6b1 15205
2eb1f9e6
PE
152062011-07-25 Paul Eggert <eggert@cs.ucla.edu>
15207
15208 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
15209 Found by GCC static checking and --with-wide-int on a 32-bit host.
15210
22381272 152112011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
15212
15213 * xdisp.c (compute_display_string_pos): Fix logic of caching
15214 previous display string position. Initialize cached_prev_pos to
15215 -1. Fixes slow-down at the beginning of a buffer.
15216
f25e39b4
EZ
152172011-07-24 Eli Zaretskii <eliz@gnu.org>
15218
15219 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
15220 for attrs[LFACE_FONTSET_INDEX].
15221
04c4b52e
PE
152222011-07-23 Paul Eggert <eggert@cs.ucla.edu>
15223
15224 * xml.c (parse_region): Remove unused local
15225 that was recently introduced.
15226
c1734fbd
EZ
152272011-07-23 Eli Zaretskii <eliz@gnu.org>
15228
be18c5a5
EZ
15229 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
15230 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
15231
c1734fbd
EZ
15232 * xdisp.c (move_it_in_display_line_to): Record the best matching
15233 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
15234 exit if none of the characters scanned was an exact match.
15235 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
15236 when exact match is impossible due to invisible text, and the
15237 lines are truncated.
15238
a258d627
JD
152392011-07-23 Jan Djärv <jan.h.d@swipnet.se>
15240
15241 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
15242 for OSX >= 10.7.
15243
b6d5a689
EZ
152442011-07-22 Eli Zaretskii <eliz@gnu.org>
15245
0f74f785
EZ
15246 Fix a significant slow-down of cursor motion with C-n, C-p,
15247 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
15248 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 15249 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
15250 (next_element_from_buffer): Call compute_stop_pos_backwards to
15251 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
15252 base_level_stop.
15253 (reseat): Don't look for prev_stop, as that could mean a very long
15254 run.
15255 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
15256 <cached_disp_overlay_modiff>: Cache for last found display string
15257 position.
551918c1 15258 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
15259 about the same buffer in the same area of character positions, and
15260 the buffer wasn't changed since the time the display string
15261 position was cached.
551918c1 15262
b2d0c91a
EZ
152632011-07-22 Eli Zaretskii <eliz@gnu.org>
15264
15265 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
15266 is an integer, which is important for empty lines. (Bug#9149)
15267
043604ee
CY
152682011-07-22 Chong Yidong <cyd@stupidchicken.com>
15269
15270 * frame.c (Fmodify_frame_parameters): In tty case, update the
15271 default face if necessary (Bug#4238).
15272
da4adb04
CY
152732011-07-21 Chong Yidong <cyd@stupidchicken.com>
15274
15275 * editfns.c (Fstring_to_char): No need to explain what a character
15276 is in the docstring (Bug#6576).
15277
9abd0532
LMI
152782011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15279
15280 * xml.c (parse_region): Make sure we always return a tree.
15281
36881d16
HK
152822011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
15283
15284 * xml.c (parse_region): If a document contains only comments,
15285 return that, too.
15286
1e98674d
LMI
152872011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15288
15289 * xml.c (make_dom): Return comments, too.
15290
590bd467
PE
152912011-07-19 Paul Eggert <eggert@cs.ucla.edu>
15292
15293 Port to OpenBSD.
15294 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
15295 and the surrounding thread.
15296 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
15297 rather than fgets, and retry after EINTR. Otherwise, 'emacs
15298 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
15299 timer goes off.
15300 * s/openbsd.h (BROKEN_SIGIO): Define.
15301 * unexelf.c (unexec) [__OpenBSD__]:
15302 Don't update the .mdebug section of the Alpha COFF symbol table.
15303
f41628b2
LMI
153042011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15305
15306 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
15307 (bug#8460).
15308
b59b67c5
PE
153092011-07-18 Paul Eggert <eggert@cs.ucla.edu>
15310
15e3a074
PE
15311 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
15312 This fixes some race conditions on the permissions of any newly
15313 created file.
15314
41bed37d
PE
15315 * alloc.c (valid_pointer_p): Use pipe, not open.
15316 This fixes some permissions issues when debugging.
15317
b59b67c5
PE
15318 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
15319 If fchown fails to set both uid and gid, try to set just gid,
15320 as that is sometimes allowed. Adjust the file's mode to eliminate
15321 setuid or setgid bits that are inappropriate if fchown fails.
15322
925a6be7
SM
153232011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
15324
15325 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
15326 to compare Lisp_Objects.
15327 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
15328 global_gnutls_log_level, don't mistake it for a Lisp_Object.
15329 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
15330
52968808
AS
153312011-07-17 Andreas Schwab <schwab@linux-m68k.org>
15332
0a6a104b
AS
15333 * lread.c (read_integer): Unread even EOF character.
15334 (read1): Likewise. Properly record start position of symbol.
15335
52968808
AS
15336 * lread.c (read1): Read `#:' as empty uninterned symbol if no
15337 symbol character follows.
15338
9e381cdd
PE
153392011-07-17 Paul Eggert <eggert@cs.ucla.edu>
15340
15341 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
15342 This works around a problem with the previous change to Fcopy_file.
15343 Recent glibc declares fchown with __attribute__((warn_unused_result)),
15344 and without this change, GCC might complain about discarding
15345 fchown's return value.
15346
b5641435
JB
153472011-07-16 Juanma Barranquero <lekktu@gmail.com>
15348
15349 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
15350
a8031457
PE
153512011-07-16 Paul Eggert <eggert@cs.ucla.edu>
15352
15353 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
15354
dd889327
LMI
153552011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
15356
750c33f7
LMI
15357 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15358 it's used from the C level.
15359
dd889327
LMI
15360 * process.c: Use the same condition for POLL_FOR_INPUT in both
15361 keyboard.c and process.c (bug#1858).
15362
87e86684
LM
153632011-07-09 Lawrence Mitchell <wence@gmx.li>
15364
15365 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15366 (Fgnutls_boot): Use it.
15367
64348f40
AS
153682011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15369
15370 * doc.c (Fsubstitute_command_keys): Revert last change.
15371
1d698799
LMI
153722011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15373
f863868c
LMI
15374 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15375 quotes the next character, and doesn't affect other longer
15376 sequences (bug#8935).
15377
1d698799
LMI
15378 * lread.c (syms_of_lread): Clarify that is isn't only
15379 `eval-buffer' and `eval-defun' that's affected by
15380 `lexical-binding' (bug#8460).
15381
aa4b6df6
EZ
153822011-07-15 Eli Zaretskii <eliz@gnu.org>
15383
15384 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 15385 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 15386
5d856da6
PE
153872011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15388
ad6042bb
PE
15389 Fix minor problems found by static checking.
15390 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15391 (elsz): Now a signed constant, not a size_t var. We prefer signed
15392 types to unsigned, to avoid integer comparison confusion. Without
15393 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15394 "cannot optimize loop, the loop counter may overflow", a symptom
15395 of the confusion.
f00bbb22 15396 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
15397 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15398
6468f31c
LMI
153992011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15400
49080b10
LMI
15401 * search.c (Fre_search_backward): Mention `case-fold-search' in
15402 all the re_search_* functions (bug#8138).
15403
6468f31c
LMI
15404 * keyboard.c (Fopen_dribble_file): Document when the file is
15405 closed (bug#8056).
15406
c965adc5
EZ
154072011-07-14 Eli Zaretskii <eliz@gnu.org>
15408
df9733bf
EZ
15409 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15410 bidi_cache_idx.
15411
0bb23927
EZ
15412 Support bidi reordering of display and overlay strings.
15413 * xdisp.c (compute_display_string_pos)
15414 (compute_display_string_end): Accept additional argument STRING.
15415 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15416 (reseat_to_string): Initialize bidi_it->string.s and
15417 bidi_it->string.schars.
15418 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
15419 NULL (avoids a crash in bidi_paragraph_init).
15420 Initialize itb.string.lstring.
0bb23927
EZ
15421 (init_iterator): Call bidi_init_it only of a valid
15422 buffer position was specified. Initialize paragraph_embedding to
15423 L2R.
15424 (reseat_to_string): Initialize the bidi iterator.
15425 (display_string): If we need to ignore text properties of
15426 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15427 original value of -1 will not work with bidi.)
15428 (compute_display_string_pos): First arg is now struct
15429 `text_pos *'; all callers changed. Support display properties on
15430 Lisp strings.
15431 (compute_display_string_end): Support display properties on Lisp
15432 strings.
15433 (init_iterator, reseat_1, reseat_to_string): Initialize the
15434 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15435 when iterating on a string not from display properties).
640c8776
SM
15436 (compute_display_string_pos, compute_display_string_end):
15437 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
15438 arrow keys.
15439 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
15440 base_level_stop; instead, set base_level_stop to BEGV.
15441 Fixes crashes in vertical-motion.
0bb23927
EZ
15442 (next_element_from_buffer): Improve commentary for when
15443 the iterator is before prev_stop.
15444 (init_iterator): Initialize bidi_p from the default value of
15445 bidi-display-reordering, not from buffer-local value. Use the
15446 buffer-local value only if initializing for buffer iteration.
15447 (handle_invisible_prop): Support invisible properties on strings
15448 that are being bidi-reordered.
15449 (set_iterator_to_next): Support bidi reordering of C strings and
15450 Lisp strings.
15451 (next_element_from_string): Support bidi reordering of Lisp
15452 strings.
15453 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
15454 (display_string): Support display of R2L glyph rows.
15455 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
15456 (init_iterator): Don't initialize it->bidi_p for strings
15457 here.
15458 (reseat_to_string): Initialize it->bidi_p for strings here.
15459 (next_element_from_string, next_element_from_c_string)
15460 (next_element_from_buffer): Add xassert's for correspondence
15461 between IT's object being iterated and it->bidi_it.string
15462 structure.
15463 (face_before_or_after_it_pos): Support bidi iteration.
15464 (next_element_from_c_string): Handle the case of the first string
15465 character that is not the first one in the visual order.
15466 (get_visually_first_element): New function, refactored from common
15467 parts of next_element_from_buffer, next_element_from_string, and
15468 next_element_from_c_string.
15469 (tool_bar_lines_needed, redisplay_tool_bar)
15470 (display_menu_bar): Force left-to-right direction. Add a FIXME
15471 comment for making that be controlled by a user option.
15472 (push_it, pop_it): Save and restore the state of the
15473 bidi iterator. Save and restore the bidi_p flag.
15474 (pop_it): Iterate out of display property for string iteration as
15475 well.
15476 (iterate_out_of_display_property): Support iteration over strings.
15477 (handle_single_display_spec): Set up it->bidi_it for iteration
15478 over a display string, and call bidi_init_it.
15479 (handle_single_display_spec, next_overlay_string)
15480 (get_overlay_strings_1, push_display_prop): Set up the bidi
15481 iterator for displaying display or overlay strings.
15482 (forward_to_next_line_start): Don't use the shortcut if
15483 bidi-iterating.
15484 (back_to_previous_visible_line_start): If handle_display_prop
15485 pushed the iterator stack, restore the internal state of the bidi
15486 iterator by calling bidi_pop_it same number of times.
15487 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15488 and we are bidi-iterating, don't decrement the iterator position;
15489 instead, set the first_elt flag in the bidi iterator, to produce
15490 the same effect.
15491 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15492 (push_display_prop): xassert that we are iterating a buffer.
15493 (push_it, pop_it): Save and restore paragraph_embedding member.
15494 (handle_single_display_spec, next_overlay_string)
15495 (get_overlay_strings_1, reseat_1, reseat_to_string)
15496 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15497 correctly. Don't assume unibyte strings are not bidi-reordered.
15498 (compute_display_string_pos)
15499 (compute_display_string_end): Fix handling the case of C string.
15500 (push_it, pop_it): Save and restore from_disp_prop_p.
15501 (handle_single_display_spec, push_display_prop): Set the
15502 from_disp_prop_p flag.
15503 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15504 (pop_it): Call iterate_out_of_display_property only if we are
15505 popping after iteration over a string that came from a display
15506 property. Fix a typo in popping stretch info. Add an assertion
15507 for verifying that the iterator position is in sync with the bidi
15508 iterator.
15509 (handle_single_display_spec, get_overlay_strings_1)
15510 (push_display_prop): Fix initialization of paragraph direction for
15511 string when that of the parent object is not yet determined.
15512 (reseat_1): Call bidi_init_it to resync the bidi
15513 iterator with IT's position. (Bug#7616)
15514 (find_row_edges): If ROW->start.pos gives position
15515 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15516 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15517 Reset the from_disp_prop_p flag.
15518 (SAVE_IT, RESTORE_IT): New macros.
15519 (pos_visible_p, face_before_or_after_it_pos)
15520 (back_to_previous_visible_line_start)
15521 (move_it_in_display_line_to, move_it_in_display_line)
15522 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15523 (try_scrolling, redisplay_window, display_line): Use them when
15524 saving a temporary copy of the iterator and restoring it back.
15525 (back_to_previous_visible_line_start, reseat_1)
15526 (init_iterator): Empty the bidi cache "stack".
15527 (move_it_in_display_line_to): If iterator ended up at
15528 EOL, but we never saw any buffer positions smaller than
15529 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15530 motion in bidi-reordered lines.
15531 (move_it_in_display_line_to): Record prev_method and prev_pos
15532 immediately before the call to set_iterator_to_next. Fixes cursor
15533 motion in bidi-reordered lines with stretch glyphs and strings
15534 displayed in margins. (Bug#8133) (Bug#8867)
15535 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15536 TO_CHARPOS.
640c8776
SM
15537 (pos_visible_p): Support positions in bidi-reordered lines.
15538 Save and restore bidi cache.
0bb23927
EZ
15539
15540 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15541 (bidi_paragraph_info): Delete unused struct.
15542 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15543 (bidi_cache_start): New variable.
15544 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15545 to zero.
15546 (bidi_cache_fetch_state, bidi_cache_search)
15547 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15548 (bidi_cache_find, bidi_peek_at_next_level)
15549 (bidi_level_of_next_char, bidi_find_other_level_edge)
15550 (bidi_move_to_visually_next): Compare cache index with
15551 bidi_cache_start rather than with zero.
15552 (bidi_fetch_char): Accept new argument STRING; all callers
15553 changed. Support iteration over a string. Support strings with
15554 display properties. Support unibyte strings. Fix the type of
15555 `len' according to what STRING_CHAR_AND_LENGTH expects.
15556 (bidi_paragraph_init, bidi_resolve_explicit_1)
15557 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
15558 (bidi_level_of_next_char, bidi_move_to_visually_next):
15559 Support iteration over a string.
0bb23927
EZ
15560 (bidi_set_sor_type, bidi_resolve_explicit_1)
15561 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15562 can now be zero (for strings); special values 0 and -1 were
15563 changed to -1 and -2, respectively.
15564 (bidi_char_at_pos): New function.
15565 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15566 Call it instead of FETCH_MULTIBYTE_CHAR.
15567 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15568 initialized to valid values.
15569 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15570 values.
15571 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15572 the test for valid cached positions. Fix the logic for looking up
15573 the sentinel state in the cache. GCPRO the Lisp string we are
15574 iterating.
15575 (bidi_push_it, bidi_pop_it): New functions.
15576 (bidi_initialize): Initialize the bidi cache start stack pointer.
15577 (bidi_cache_ensure_space): New function, refactored from part of
15578 bidi_cache_iterator_state. Don't assume the required size is just
15579 one BIDI_CACHE_CHUNK away.
15580 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15581 (bidi_count_bytes, bidi_char_at_pos): New functions.
15582 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15583 always valid if bidi_cache_idx is valid.
15584 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15585 is valid if it's going to be used.
15586 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15587 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
15588 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15589 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
15590 (bidi_find_other_level_edge, bidi_cache_start_stack):
15591 All variables related to cache indices are now EMACS_INT.
c965adc5 15592
0bb23927
EZ
15593 * dispextern.h (struct bidi_string_data): New structure.
15594 (struct bidi_it): New member `string'. Make flag members be 1-bit
15595 fields, and put them last in the struct.
640c8776
SM
15596 (compute_display_string_pos, compute_display_string_end):
15597 Update prototypes.
0bb23927
EZ
15598 (bidi_push_it, bidi_pop_it): Add prototypes.
15599 (struct iterator_stack_entry): New members bidi_p,
15600 paragraph_embedding, and from_disp_prop_p.
15601 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
15602 (bidi_shelve_cache, bidi_unshelve_cache):
15603 Declare prototypes.
0bb23927
EZ
15604
15605 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15606 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15607 and vector-like objects.
15608
15609 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15610 cache around display iteration.
15611
15612 * window.c (Fwindow_end, window_scroll_pixel_based)
15613 (displayed_window_lines, Frecenter): Save and restore the bidi
15614 cache around display iteration.
15615
3bbd2265
LMI
156162011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15617
15618 * editfns.c (Fdelete_region): Clarify the use of the named
15619 parameters (bug#6788).
15620
adc47434
MR
156212011-07-14 Martin Rudalics <rudalics@gmx.at>
15622
15623 * indent.c (Fvertical_motion): Set and restore w->pointm when
15624 saving and restoring the window's buffer (Bug#9006).
15625
837c31f8
LMI
156262011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15627
15628 * editfns.c (Fstring_to_char): Clarify just what is returned
15629 (bug#6576). Text by Eli Zaretskii.
15630
ac389d0c
JB
156312011-07-13 Juanma Barranquero <lekktu@gmail.com>
15632
15633 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15634
0be0ce47
EZ
156352011-07-13 Eli Zaretskii <eliz@gnu.org>
15636
15637 * buffer.c (mmap_find): Fix a typo.
15638
cd18e7e3
JB
156392011-07-13 Johan Bockgård <bojohan@gnu.org>
15640
15641 Fix execution of x selection hooks.
15642 * xselect.c (Qx_lost_selection_functions)
15643 (Qx_sent_selection_functions): New vars.
15644 (syms_of_xselect): DEFSYM them.
15645 (x_handle_selection_request): Pass Qx_sent_selection_functions
15646 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15647 (x_handle_selection_clear,x_clear_frame_selections):
15648 Pass Qx_lost_selection_functions rather than
15649 Vx_lost_selection_functions to Frun_hook_with_args.
15650
47ea7f44
PE
156512011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15652
ac389d0c 15653 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
15654 The old code sometimes used this field without initializing it.
15655
47ea7f44
PE
15656 * alloc.c (gc_sweep): Don't read past end of array.
15657 In theory, the old code could also have corrupted Emacs internals,
15658 though it'd be very unlikely.
15659
bc985c87
AS
156602011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15661
15662 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 15663 argument. (Bug#4026)
bc985c87 15664
0cf34688
LMI
156652011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15666
b3dadd76
LMI
15667 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15668 key" (bug#4257).
15669
0cf34688
LMI
15670 * window.c (Fset_window_start): Doc fix (bug#4199).
15671 (Fset_window_hscroll): Ditto.
15672
270768cd
PE
156732011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15674
077e3dda 15675 Fix minor new problems caught by GCC 4.6.1.
270768cd 15676 * term.c (init_tty): Remove unused local.
490011a6 15677 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 15678 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 15679 not used otherwise.
270768cd 15680
b1f58454
CY
156812011-07-12 Chong Yidong <cyd@stupidchicken.com>
15682
15683 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15684
22b9578d
LMI
156852011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15686
6e70ab07
LMI
15687 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15688 are the mini-buffer and the echo area (bug#3320).
15689
22b9578d
LMI
15690 * term.c (init_tty): Remove support for supdup, c10 and perq
15691 terminals, which are no longer supported (bug#1482).
15692
8974cc9f
JB
156932011-07-10 Johan Bockgård <bojohan@gnu.org>
15694
15695 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15696
a560d974
JD
156972011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15698
15699 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15700 for non-popups (Bug#3642).
15701
1dae0f0a
AS
157022011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15703
268c2c36 15704 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 15705 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
15706 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15707 * cm.c (losecursor): Likewise.
1dae0f0a
AS
15708 * data.c (fmod): Likewise.
15709 * dispnew.c (swap_glyphs_in_rows): Likewise.
15710 * emacs.c (memory_warning_signal): Likewise.
15711 * floatfns.c (float_error): Likewise.
15712 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15713 (otf_open, font_otf_capability, generate_otf_features)
15714 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15715 Likewise.
15716 * image.c (pbm_read_file): Likewise.
15717 * indent.c (string_display_width): Likewise.
15718 * intervals.c (check_for_interval, search_for_interval)
15719 (inc_interval_count, count_intervals, root_interval)
15720 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15721 * lread.c (defalias): Likewise.
268c2c36 15722 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
15723 * regex.c (set_image_of_range_1, set_image_of_range)
15724 (regex_grow_registers): Likewise.
15725 * sysdep.c (strerror): Likewise.
15726 * termcap.c (valid_filename_p, tprint, main): Likewise.
15727 * tparam.c (main): Likewise.
15728 * unexhp9k800.c (run_time_remap, save_data_space)
15729 (update_file_ptrs, read_header, write_header, calculate_checksum)
15730 (copy_file, copy_rest, display_header): Likewise.
15731 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15732 Likewise.
15733 * xdisp.c (check_it): Likewise.
15734 * xfaces.c (register_color, unregister_color, unregister_colors):
15735 Likewise.
15736 * xfns.c (print_fontset_result): Likewise.
15737 * xrdb.c (member, fatal, main): Likewise.
15738
99033785
PE
157392011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15740
15741 Fix minor problems found by static checking (Bug#9031).
15742 * chartab.c (char_table_set_range, map_sub_char_table):
15743 Remove unused locals.
15744 (uniprop_table): Now static.
15745 * composite.c (_work_char): Remove unused static var.
15746
9cb2ac56
JB
157472011-07-09 Juanma Barranquero <lekktu@gmail.com>
15748
15749 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15750
f25661f0
JD
157512011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15752
15753 * gtkutil.c (qttip_cb): Remove code without function.
15754
8278c4fe
EZ
157552011-07-09 Eli Zaretskii <eliz@gnu.org>
15756
15757 * w32.c (pthread_sigmask): New stub.
15758
1692ae2d 157592011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 15760
8a6ebd58 15761 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
15762 sigprocmask is portable only for single-threaded applications, and
15763 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
15764 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15765 (LIBES): Use it.
15766 * callproc.c (Fcall_process):
15767 * process.c (create_process):
15768 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15769 Use pthread_sigmask, not sigprocmask.
123403e4 15770
1b854618
JD
157712011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15772
15773 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15774 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15775 wrong (Bug#8591).
15776
3fe4b549
JD
157772011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15778
0ce7e563
JD
15779 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15780 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15781 (xg_hide_tooltip): Fix comment.
15782
3fe4b549
JD
15783 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15784 in registerServicesMenuSendTypes.
15785 (validRequestorForSendType): Don't check ns_return_types.
15786
15787 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15788 ns_return_type.
15789
5df75e47
JR
157902011-07-08 Jason Rumney <jasonr@gnu.org>
15791
22610910
JR
15792 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15793 SH_SHOW for hidden windows (Bug#5482).
15794
5df75e47
JR
15795 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15796 frame struct members of non-existent frames (Bug#6284).
15797
699c10bd
JD
157982011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15799
4393663b
JD
15800 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15801 variable firstTime not needed on OSX >= 10.6.
15802 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15803 >= 10.5. Use setKnobProportion, setDoubleValue.
15804
15805 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15806 (MAC_OS_X_VERSION_10_5): Define if not defined.
15807 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15808 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15809 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15810
15811 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 15812 cString and lossyCString on OSX >= 10.4.
4393663b 15813
58179cce 15814 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
15815 sizeToFit on OSX >= 10.2.
15816
15817 * nsimage.m (allocInitFromFile): Don't use deprecated method
15818 bestRepresentationForDevice on OSX >= 10.6.
15819
15820 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15821 to avoid warning.
15822
15823 * emacs.c: Declare unexec_init_emacs_zone.
15824
a63e0781
JD
15825 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15826
699c10bd
JD
15827 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15828
15829 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15830 on svcsMenu (Bug#8842).
15831
15832 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15833 ns_return_types.
15834 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15835
15836 * nsterm.m (QUTF8_STRING): Declare.
15837 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15838 (validRequestorForSendType): Return type is (id).
15839 Change indexOfObjectIdenticalTo to indexOfObject.
15840 Check if we have local selection before returning self (Bug#8842).
15841 (writeSelectionToPasteboard): Put local selection into paste board
15842 if we have a local selection (Bug#8842).
15843 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15844
15845 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15846 (ns_get_local_selection): Declare.
15847
54e10184
LMI
158482011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15849
9888ff71
LMI
15850 * keymap.c (describe_map_tree): Don't insert a double newline at
15851 the end of the buffer (bug#1169) and return whether we inserted
15852 something.
15853
54e10184
LMI
15854 * callint.c (Fcall_interactively): Change "reading args" to
15855 "providing args" to try to clarify what it does (bug#1010).
15856
15fa4783
KH
158572011-07-07 Kenichi Handa <handa@m17n.org>
15858
15859 * composite.c (composition_compute_stop_pos): Ignore a static
15860 composition starting before CHARPOS (Bug#8915).
15861
15862 * xdisp.c (handle_composition_prop): Likewise.
15863
a8815b00
EZ
158642011-07-07 Eli Zaretskii <eliz@gnu.org>
15865
15866 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15867 (Bug#9015)
15868
ef7b981d 158692011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
15870
15871 * character.h (unicode_category_t): New enum type.
15872
15873 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15874 (Qchar_code_property_table): New variable.
15875 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15876 (UNIPROP_COMPRESSED_FORM_P): New macros.
15877 (char_table_ascii): Uncompress the compressed values.
15878 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15879 Uncompress the compressed values.
ac389d0c 15880 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
15881 (char_table_ref_and_range): Uncompress the compressed values.
15882 (sub_char_table_set): New arg is_uniprop. Callers changed.
15883 Uncompress the compressed values.
15884 (sub_char_table_set_range): Args changed. Callers changed.
15885 (char_table_set_range): Adjuted for the above change.
15886 (map_sub_char_table): Delete args default_val and parent. Add arg
15887 top. Give decoded values to a Lisp function.
640c8776 15888 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
15889 values to a Lisp function. Gcpro more variables.
15890 (uniprop_table_uncompress)
15891 (uniprop_decode_value_run_length): New functions.
15892 (uniprop_decoder, uniprop_decoder_count): New variables.
15893 (uniprop_get_decoder, uniprop_encode_value_character)
15894 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15895 New functions.
15896 (uniprop_encoder, uniprop_encoder_count): New variables.
15897 (uniprop_get_encoder, uniprop_table)
15898 (Funicode_property_table_internal, Fget_unicode_property_internal)
15899 (Fput_unicode_property_internal): New functions.
15900 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15901 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 15902 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
15903 char-code-property-alist.
15904
640c8776 15905 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
15906 Vunicode_category_table.
15907
640c8776 15908 * font.c (font_range): Adjust for the change of
c805dec0
KH
15909 Vunicode_category_table.
15910
76b397fb
DN
159112011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15912
15913 * m/iris4d.h: Remove file, move contents ...
15914 * s/irix6-5.h: ... here.
15915
22b4128e
PE
159162011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15917
15918 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
15919 * alloc.c (mark_buffer):
15920 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15921 (clone_per_buffer_values): Don't assume that
22b4128e
PE
15922 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15923 This isn't true in general, and it's particularly not true
15924 if Emacs is configured with --with-wide-int.
15925 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15926 New macros, used in the buffer.c change.
15927
869795d6
JD
159282011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15929
15930 * xsettings.c: Use both GConf and GSettings if both are available.
15931 (store_config_changed_event): Add comment.
15932 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15933 (store_tool_bar_style_changed): New functions.
5e617bc2 15934 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
15935 (struct xsettings): Move font inside HAVE_XFT.
15936 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 15937 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 15938 Move inside HAVE_XFT.
640c8776 15939 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
15940 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15941 also.
15942 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 15943 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 15944 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
15945 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15946 (parse_settings): Move check for font inside HAVE_XFT.
15947 (read_settings, apply_xft_settings): Add comment.
15948 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15949 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15950 call store_font_name_changed.
15951 (xft_settings_event): Add comment.
15952 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15953 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15954 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15955 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15956 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
15957 (xsettings_get_system_font, xsettings_get_system_normal_font):
15958 Add comment.
869795d6 15959
d8ed26bd
PE
159602011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15961
15962 Random fixes. E.g., (random) never returned negative values.
15963 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15964 subseconds part to the entropy, as that's a bit more random.
15965 Prefer signed to unsigned, since the signedness doesn't matter and
15966 in general we prefer signed. When given a limit, use a
15967 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15968 latter isn't right if USE_2_TAGS_FOR_INTS.
15969 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15970 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15971
cabf1cac
SM
159722011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15973
15974 * textprop.c (text_property_stickiness):
15975 Obey Vtext_property_default_nonsticky.
15976 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15977 * w32fns.c (syms_of_w32fns):
15978 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15979
6e9b2be9
PE
159802011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15981
15982 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15983 This is more efficient than Ffile_directory_p and avoids a minor race.
15984
90186c68
LMI
159852011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15986
7c301272
LMI
15987 * buffer.c (Foverlay_put): Say what the return value is
15988 (bug#7835).
15989
c4f2d8d4
LMI
15990 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15991 is a directory before asking whether to use the file name
15992 (bug#7564).
ad637907
LMI
15993 (barf_or_query_if_file_exists): Make the "File is a directory"
15994 error be more correct.
c4f2d8d4 15995
90186c68
LMI
15996 * fns.c (Frequire): Remove the mention of the .gz files, since
15997 that's installation-specific, but keep the mention of
15998 `get-load-suffixes'.
15999
da64016e
PE
160002011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16001
16002 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
16003 Report string overflow if the output is too long.
16004
7d47b580
JB
160052011-07-04 Juanma Barranquero <lekktu@gmail.com>
16006
a555cb87
JB
16007 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
16008 (syms_of_gnutls): Remove duplicate DEFSYM for
16009 Qgnutls_bootprop_verify_hostname_error, an error for
16010 Qgnutls_bootprop_verify_error (which is no longer used).
16011
7d47b580
JB
16012 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
16013 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
16014 Also (re)move comments that are misplaced or no longer relevant.
16015
1e49bfab
LMI
160162011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16017
16018 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
16019
1485f4c0
CY
160202011-07-03 Chong Yidong <cyd@stupidchicken.com>
16021
16022 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
16023 and background color parameters if they have been changed.
16024
a9ab721e
LMI
160252011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16026
16027 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
16028
cf7cff57
PE
160292011-07-03 Paul Eggert <eggert@cs.ucla.edu>
16030
2e13213d
PE
16031 * xsettings.c (SYSTEM_FONT): Define only when used.
16032 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
16033
cf7cff57
PE
16034 * keymap.c (access_keymap_1): Now static.
16035
7a8e04f7
CY
160362011-07-02 Chong Yidong <cyd@stupidchicken.com>
16037
16038 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
16039 leave any prefix arg for the up event (Bug#1586).
16040
61352f62
LMI
160412011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
16042
69bb1ef7
LMI
16043 * lread.c (syms_of_lread): Mention single symbols defined by
16044 `defvar' or `defconst' (bug#7154).
16045
61352f62 16046 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 16047 (Frequire): Mention get-load-suffixes.
61352f62 16048
28545e04
MR
160492011-07-02 Martin Rudalics <rudalics@gmx.at>
16050
16051 * window.h (window): Remove clone_number slot.
16052 * window.c (Fwindow_clone_number, Fset_window_clone_number):
16053 Remove.
16054 (make_parent_window, make_window, saved_window)
16055 (Fset_window_configuration, save_window_save): Don't deal with
16056 clone numbers.
16057 * buffer.c (Qclone_number): Remove declaration.
16058 (sort_overlays, overlay_strings): Don't deal with clone numbers.
16059
3349e122
SM
160602011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
16061
16062 Add multiple inheritance to keymaps.
16063 * keymap.c (Fmake_composed_keymap): New function.
16064 (Fset_keymap_parent): Simplify.
16065 (fix_submap_inheritance): Remove.
16066 (access_keymap_1): New function extracted from access_keymap to handle
16067 embedded parents and handle lists of maps.
16068 (access_keymap): Use it.
16069 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
16070 (Fcopy_keymap): Handle embedded parents.
16071 (Fcommand_remapping, define_as_prefix): Simplify.
16072 (Fkey_binding): Simplify.
16073 (syms_of_keymap): Move minibuffer-local-completion-map,
16074 minibuffer-local-filename-completion-map,
16075 minibuffer-local-must-match-map, and
16076 minibuffer-local-filename-must-match-map to Elisp.
16077 (syms_of_keymap): Defsubr make-composed-keymap.
16078 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
16079 (parse_menu_item): Trivial simplification.
16080
3279eb87
GM
160812011-07-01 Glenn Morris <rgm@gnu.org>
16082
16083 * Makefile.in (SETTINGS_LIBS): Fix typo.
16084
39cb9e56 160852011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
16086
16087 * coding.c (Fencode_coding_string): Record the last coding system
16088 used, as the function doc string says (bug#8738).
16089
0949d2b6
JD
160902011-07-01 Jan Djärv <jan.h.d@swipnet.se>
16091
16092 * xsettings.c (store_monospaced_changed): Take new font as arg and
16093 check for change against current_mono_font.
16094 (EMACS_TYPE_SETTINGS): Remove this and related defines.
16095 (emacs_settings_constructor, emacs_settings_get_property)
16096 (emacs_settings_set_property, emacs_settings_class_init)
16097 (emacs_settings_init, gsettings_obj): Remove.
16098 (something_changedCB): New function for HAVE_GSETTINGS.
16099 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
16100 with value as argument.
16101 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
16102 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 16103 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
16104 "changed".
16105
16106 * xgselect.c: Add defined (HAVE_GSETTINGS).
16107 (xgselect_initialize): Ditto.
16108
16109 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
16110 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
16111 xg_select.
16112
bbc6b304
PE
161132011-07-01 Paul Eggert <eggert@cs.ucla.edu>
16114
16115 * eval.c (struct backtrace): Simplify and port the data structure.
16116 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
16117 signed bit field, as this assumption is not portable and it makes
16118 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
16119 "char debug_on_exit : 1" as this is not portable either; instead,
16120 use the portable "unsigned int debug_on_exit : 1". Remove unused
16121 member evalargs. Remove obsolete comments about cc bombing out.
16122
9851bfc5
JD
161232011-06-30 Jan Djärv <jan.h.d@swipnet.se>
16124
51bb811f 16125 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
16126 Let HAVE_GSETTINGS override HAVE_GCONF.
16127 (store_monospaced_changed): New function.
16128 (EMACS_SETTINGS): A new type derived from GObject to handle
16129 GSettings notifications.
16130 (emacs_settings_constructor, emacs_settings_get_property)
16131 (emacs_settings_set_property, emacs_settings_class_init):
16132 New functions.
16133 (gsettings_client, gsettings_obj): New variables.
16134 (GSETTINGS_SCHEMA): New define.
16135 (something_changedCB): Call store_monospaced_changed.
16136 (init_gsettings): New function.
16137 (xsettings_initialize): Call init_gsettings.
16138 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
16139 to NULL.
16140
640c8776 16141 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
16142 GCONF_CFLAGS/LIBS.
16143
5386012d
MR
161442011-06-29 Martin Rudalics <rudalics@gmx.at>
16145
16146 * window.c (resize_root_window, grow_mini_window)
16147 (shrink_mini_window): Rename Qresize_root_window to
16148 Qwindow_resize_root_window and Qresize_root_window_vertically to
16149 Qwindow_resize_root_window_vertically.
16150
f13e0b08
PE
161512011-06-28 Paul Eggert <eggert@cs.ucla.edu>
16152
16153 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
16154
94515237
JB
161552011-06-27 Juanma Barranquero <lekktu@gmail.com>
16156
16157 * makefile.w32-in: Redesign dependencies so they reflect more
16158 clearly which files are directly included by each source file,
16159 and not through other includes.
16160
e43b6e43
MR
161612011-06-27 Martin Rudalics <rudalics@gmx.at>
16162
16163 * buffer.c (Qclone_number): Declare static and DEFSYM it.
16164 (sort_overlays, overlay_strings): When an overlay's clone number
16165 matches the window's clone number process the overlay even if
16166 the overlay's window property doesn't match the current window.
16167
d68443dc
MR
16168 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
16169 (Fwindow_hchild): Rename to Fwindow_left_child.
16170 (Fwindow_next): Rename to Fwindow_next_sibling.
16171 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
16172 (resize_window_check): Rename to window_resize_check.
16173 (resize_window_apply): Rename to window_resize_apply.
16174 (Fresize_window_apply): Rename to Fwindow_resize_apply.
16175 (Fdelete_other_windows_internal, resize_frame_windows)
16176 (Fsplit_window_internal, Fdelete_window_internal)
16177 (grow_mini_window, shrink_mini_window)
16178 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 16179
c7e73be5
JD
161802011-06-26 Jan Djärv <jan.h.d@swipnet.se>
16181
16182 * emacsgtkfixed.h: State that this is only used with Gtk+3.
16183 (emacs_fixed_set_min_size): Remove.
16184 (emacs_fixed_new): Take frame as argument.
16185
16186 * emacsgtkfixed.c: State that this is only used with Gtk+3.
16187 (_EmacsFixedPrivate): Remove minwidth/height.
16188 Add struct frame *f.
16189 (emacs_fixed_init): Initialize priv->f.
16190 (get_parent_class, emacs_fixed_set_min_size): Remove.
16191 (emacs_fixed_new): Set priv->f to argument.
16192 (emacs_fixed_get_preferred_width)
16193 (emacs_fixed_get_preferred_height): Use min_width/height from
16194 frames size_hint to set minimum and natural (Bug#8919).
16195 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
16196 and use min_width/height from frames size_hint to set
16197 min_width/height (Bug#8919).
16198
16199 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
16200 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
16201 Fix indentation.
c7e73be5 16202
cf99dcf8
EZ
162032011-06-26 Eli Zaretskii <eliz@gnu.org>
16204
16205 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
16206 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
16207 called at ZV.
16208
029529ac
CY
162092011-06-26 Chong Yidong <cyd@stupidchicken.com>
16210
16211 * process.c (wait_reading_process_output): Bypass select if
16212 waiting for a cell while ignoring keyboard input, and input is
16213 pending. Suggested by Jan Djärv (Bug#8869).
16214
7a7ef429
PE
162152011-06-25 Paul Eggert <eggert@cs.ucla.edu>
16216
16217 Use gnulib's dup2 module instead of rolling our own.
16218 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
16219
11fdef7d 162202011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
16221
16222 * dispnew.c (scrolling_window): Before scrolling, turn off a
16223 mouse-highlight in the window being scrolled.
16224
cd3520a4
JB
162252011-06-24 Juanma Barranquero <lekktu@gmail.com>
16226
16227 Move DEFSYM to lisp.h and use everywhere.
16228
16229 * character.h (DEFSYM): Move declaration...
16230 * lisp.h (DEFSYM): ...here.
16231
16232 * gnutls.c:
16233 * minibuf.c:
16234 * w32menu.c:
16235 * w32proc.c:
16236 * w32select.c: Don't include character.h.
16237
16238 * alloc.c (syms_of_alloc):
16239 * buffer.c (syms_of_buffer):
16240 * bytecode.c (syms_of_bytecode):
16241 * callint.c (syms_of_callint):
16242 * casefiddle.c (syms_of_casefiddle):
16243 * casetab.c (init_casetab_once):
16244 * category.c (init_category_once, syms_of_category):
16245 * ccl.c (syms_of_ccl):
16246 * cmds.c (syms_of_cmds):
16247 * composite.c (syms_of_composite):
16248 * dbusbind.c (syms_of_dbusbind):
16249 * dired.c (syms_of_dired):
16250 * dispnew.c (syms_of_display):
16251 * doc.c (syms_of_doc):
16252 * editfns.c (syms_of_editfns):
16253 * emacs.c (syms_of_emacs):
16254 * eval.c (syms_of_eval):
16255 * fileio.c (syms_of_fileio):
16256 * fns.c (syms_of_fns):
16257 * frame.c (syms_of_frame):
16258 * fringe.c (syms_of_fringe):
16259 * insdel.c (syms_of_insdel):
16260 * keymap.c (syms_of_keymap):
16261 * lread.c (init_obarray, syms_of_lread):
16262 * macros.c (syms_of_macros):
16263 * msdos.c (syms_of_msdos):
16264 * print.c (syms_of_print):
16265 * process.c (syms_of_process):
16266 * search.c (syms_of_search):
16267 * sound.c (syms_of_sound):
16268 * syntax.c (init_syntax_once, syms_of_syntax):
16269 * terminal.c (syms_of_terminal):
16270 * textprop.c (syms_of_textprop):
16271 * undo.c (syms_of_undo):
16272 * w32.c (globals_of_w32):
16273 * window.c (syms_of_window):
16274 * xdisp.c (syms_of_xdisp):
16275 * xfaces.c (syms_of_xfaces):
16276 * xfns.c (syms_of_xfns):
16277 * xmenu.c (syms_of_xmenu):
16278 * xsettings.c (syms_of_xsettings):
16279 * xterm.c (syms_of_xterm): Use DEFSYM.
16280
4228cf16
TZ
162812011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
16282
cd3520a4 16283 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 16284
7fcccf1e
PE
162852011-06-23 Paul Eggert <eggert@cs.ucla.edu>
16286
7efb4e0e
PE
16287 Integer and buffer overflow fixes (Bug#8873).
16288
ff5844ad
PE
16289 * print.c (printchar, strout): Check for string overflow.
16290 (PRINTPREPARE, printchar, strout):
16291 Don't set size unless allocation succeeds.
16292
90532f02
PE
16293 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
16294 for sizes. Check for string overflow more accurately.
16295 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
16296
6d84508d
PE
16297 * macros.c: Integer and buffer overflow fixes.
16298 * keyboard.h (struct keyboard.kbd_macro_bufsize):
16299 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
16300 Use ptrdiff_t, not int, for sizes.
16301 Don't increment bufsize until after realloc succeeds.
16302 Check for size-calculation overflow.
16303 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
16304
437b2cb4
PE
16305 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
16306
8b9ac8b4
PE
16307 * lread.c: Integer overflow fixes.
16308 (read_integer): Radix is now EMACS_INT, not int,
16309 to improve quality of diagnostics for out-of-range radices.
16310 Calculate buffer size correctly for out-of-range radices.
16311 (read1): Check for integer overflow in radices, and in
16312 read-circle numbers.
82cb60d3
PE
16313 (read_escape): Avoid int overflow.
16314 (Fload, openp, read_buffer_size, read1)
16315 (substitute_object_recurse, read_vector, read_list, map_obarray):
16316 Use ptrdiff_t, not int, for sizes.
16317 (read1): Use EMACS_INT, not int, for sizes.
20270765 16318 Check for size overflow.
8b9ac8b4 16319
7fcccf1e
PE
16320 * image.c (cache_image): Check for size arithmetic overflow.
16321
bfbbd7e7
PE
16322 * lread.c: Integer overflow issues.
16323 (saved_doc_string_size, saved_doc_string_length)
16324 (prev_saved_doc_string_size, prev_saved_doc_string_length):
16325 Now ptrdiff_t, not int.
16326 (read1): Don't assume doc string length fits in int. Check for
16327 out-of-range doc string lengths.
16328 (read_list): Don't assume file position fits in int.
39019e54 16329 (read_escape): Check for hex character overflow.
bfbbd7e7 16330
4e323265
LL
163312011-06-22 Leo Liu <sdl.web@gmail.com>
16332
16333 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
16334 Move to minibuffer.el.
16335
85fece3e
PE
163362011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16337
20b84ce9 16338 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
16339 The following patches are for when GLYPH_DEBUG && !XASSERT.
16340 * dispextern.h (trace_redisplay_p, dump_glyph_string):
16341 * dispnew.c (flush_stdout):
16342 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
16343 Mark as externally visible.
16344 * dispnew.c (check_window_matrix_pointers): Now static.
16345 * dispnew.c (window_to_frame_vpos):
16346 * xfns.c (unwind_create_frame):
16347 * xterm.c (x_check_font): Remove unused local.
16348 * scroll.c (CHECK_BOUNDS):
16349 * xfaces.c (cache_fache): Rename local to avoid shadowing.
16350 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
16351 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
16352 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
16353 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
16354 Now static.
16355 (debug_method_add): Use va_list and vsprintf rather than relying
16356 on undefined behavior with wrong number of arguments.
16357 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16358 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16359 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16360 since we're not interested in debugging glyphs with old libraries.
16361 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16362 GCC 4.6.0's static checking.
16363
0766b489
PE
163642011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16365
31fd4b32
PE
16366 Integer overflow and signedness fixes (Bug#8873).
16367 A few related buffer overrun fixes, too.
16368
b79e8648
PE
16369 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16370
0766b489
PE
16371 * dispextern.h (struct face.stipple):
16372 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16373 (x_bitmap_mask, x_allocate_bitmap_record)
16374 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16375 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16376 (x_create_bitmap_from_xpm_data):
16377 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16378 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16379 (.bitmaps_last):
16380 * xfaces.c (load_pixmap):
16381 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16382 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16383 (.bitmaps_last, struct x_output.icon_bitmap):
16384 Use ptrdiff_t, not int, for bitmap indexes.
16385 (x_allocate_bitmap_record): Check for size overflow.
16386 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16387
b081724f
PE
16388 Use ptrdiff_t, not int, for overlay counts.
16389 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16390 * editfns.c (overlays_around, get_pos_property):
16391 * textprop.c (get_char_property_and_overlay):
16392 * xdisp.c (next_overlay_change, note_mouse_highlight):
16393 * xfaces.c (face_at_buffer_position):
21514da7
PE
16394 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16395 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16396 (Fnext_overlay_change, Fprevious_overlay_change)
16397 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 16398 Use ptrdiff_t, not int, for sizes.
21514da7 16399 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 16400
3de73e5e
PE
16401 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16402
2606c57b
PE
16403 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16404 (x_session_initialize): Do not assume string length fits in int.
16405
aaafe47a
PE
16406 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16407 This is unlikely, but can occur if DPI is outlandish.
16408
2674ddc8 16409 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
16410 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16411
28154962
PE
16412 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16413 * xrdb.c (magic_file_p, search_magic_path):
16414 Omit last arg SUFFIX; it was always 0. All callers changed.
16415 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16416
7de51af5
PE
16417 * xfont.c (xfont_match): Avoid need for strlen.
16418
25ed6cc3
PE
16419 * xfns.c: Don't assume strlen fits in int.
16420 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16421
4eab31dd
PE
16422 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16423 not unsigned long, as we prefer signed integers. All callers changed.
16424 Detect integer overflow in repeat count.
16425 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 16426 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 16427
171e2a58
PE
16428 * termcap.c: Don't assume sizes fit in int and never overflow.
16429 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16430 (gobble_line): Check for size-calculation overflow.
16431
ad39faca 16432 * minibuf.c (Fread_buffer):
6e5bb2dc 16433 * lread.c (intern, intern_c_string):
74ca2eb3
PE
16434 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16435 Don't assume string length fits in int.
16436
52c61c22 16437 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
16438 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16439
b5b8c9e5
PE
16440 * font.c: Don't assume string length fits in int.
16441 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16442 Use ptrdiff_t, not int.
ccd6111c
PE
16443 (font_intern_prop): Don't assume string length fits in int.
16444 Don't assume integer property fits in fixnum.
16445 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 16446
882f0d81 16447 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 16448 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
16449 Reformulate so as not to need the command string.
16450 Invoke gzip -cd rather than gunzip, as it's more portable.
16451 (lock_info_type, lock_file_1, lock_file):
16452 Don't assume pid_t and time_t fit in unsigned long.
16453 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16454 (current_lock_owner): Prefer signed type for sizes.
16455 Use memcpy, not strncpy, where memcpy is what is really wanted.
16456 Don't assume (via atoi) that time_t and pid_t fit in int.
16457 Check for time_t and/or pid_t out of range, e.g., via a network share.
16458 Don't alloca where an auto var works fine.
16459
93f4cf88
PE
16460 * fileio.c: Fix some integer overflow issues.
16461 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16462 Don't assume string length fits in int.
16463 (directory_file_name): Don't assume string length fits in long.
16464 (make_temp_name): Don't assume pid fits in int, or that its print
16465 length is less than 20.
16466
f3e92b69
PE
16467 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16468
1bfdaf10
PE
16469 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16470
35016e9a
PE
16471 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16472
3d1e65a1
PE
16473 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16474 We prefer signed integers, even for size calculations.
16475
0b963a93
PE
16476 * emacs.c: Don't assume string length fits in 'int'.
16477 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16478 (main): Don't invoke strlen when not needed.
16479
573f4b54
PE
16480 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16481 (XD_DEBUG_MESSAGE): Don't waste a byte.
16482
989f33ba
PE
16483 * callproc.c (getenv_internal_1, getenv_internal)
16484 (Fgetenv_internal):
965d34eb
PE
16485 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16486
e4d29b33
PE
16487 * lread.c (invalid_syntax): Omit length argument.
16488 All uses changed. This doesn't fix a bug, but it simplifies the
16489 code away from its former Hollerith-constant appearance, and it's
16490 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 16491 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 16492
eb49b136
PE
16493 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16494 This didn't break anything, but it didn't help either.
16495 It's confusing to put a bogus integer in a place where the actual
16496 value does not matter.
9f62aeb1 16497 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 16498 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 16499
15375a22
PE
16500 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16501 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16502 implementation.
b61cc01c
PE
16503 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16504 We prefer signed types, and the value cannot exceed the EMACS_INT
16505 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
16506 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16507 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16508 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 16509
53b2623d
PE
16510 * indent.c (sane_tab_width): New function.
16511 (current_column, scan_for_column, Findent_to, position_indentation)
16512 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 16513 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 16514
51cab52b 16515 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 16516
f2ed8a70
PE
16517 * lisp.h (lint_assume): New macro.
16518 * composite.c (composition_gstring_put_cache):
16519 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16520
abe80cc6
PE
16521 * editfns.c, insdel.c:
16522 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 16523
b02c740e
PE
16524 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16525
ebc96716
PE
16526 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16527
b4e50fa0 16528 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 16529 Use much-faster test for byte-length change.
311d5d7c 16530 Don't assume string byte-length fits in 'int'.
a4cf38e4 16531 Check that character arg fits in 'int'.
85461888 16532 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 16533
c0c1ee9f
PE
16534 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16535
a498d7f4
PE
16536 * fns.c (concat): Catch string overflow earlier.
16537 Do not rely on integer wraparound.
16538
51cab52b
PE
16539 * dispextern.h (struct it.overlay_strings_charpos)
16540 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
16541 * xdisp.c (forward_to_next_line_start)
16542 (back_to_previous_visible_line_start)
16543 (reseat_at_next_visible_line_start, next_element_from_buffer):
16544 Don't arbitrarily truncate the value of 'selective' to int.
16545
76031fad
PE
16546 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16547
5eb55db9
PE
16548 * composite.c: Don't truncate sizes to 'int'.
16549 (composition_gstring_p, composition_reseat_it)
16550 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
16551 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16552 not EMACS_UINT, for indexes.
5eb55db9 16553
0703a717
PE
16554 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16555
d6202519
PE
16556 * buffer.c: Include <verify.h>.
16557 (struct sortvec.priority, struct sortstr.priority):
8961a454 16558 Now EMACS_INT, not int.
c20998a7 16559 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
16560 (struct sortstr.size, record_overlay_string)
16561 (struct sortstrlist.size, struct sortlist.used):
16562 Don't truncate size to int.
16563 (record_overlay_string): Check for size-calculation overflow.
d6202519 16564 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 16565
d5a19415
JM
165662011-06-22 Jim Meyering <meyering@redhat.com>
16567
029529ac 16568 Don't leak an XBM-image-sized buffer
d5a19415
JM
16569 * image.c (xbm_load): Free the image buffer after using it.
16570
a9041e6c
PE
165712011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16572
16573 Port to Sun C.
16574 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16575 that Sun C diagnosed.
16576 * fns.c (secure_hash): Fix pointer signedness issue.
16577 * intervals.c (static_offset_intervals): New function.
16578 (offset_intervals): Use it.
16579
7f3f739f
LL
165802011-06-21 Leo Liu <sdl.web@gmail.com>
16581
16582 * deps.mk (fns.o):
16583 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16584 sha512.h.
16585
16586 * fns.c (secure_hash): Rename from crypto_hash_function and change
16587 the first arg to accept symbols.
5b66d427 16588 (Fsecure_hash): New primitive.
7f3f739f
LL
16589 (syms_of_fns): New symbols.
16590
76147d94
DD
165912011-06-20 Deniz Dogan <deniz@dogan.se>
16592
16593 * process.c (Fset_process_buffer): Clarify return value in
16594 docstring.
16595
7d7d0045
CY
165962011-06-18 Chong Yidong <cyd@stupidchicken.com>
16597
16598 * dispnew.c (add_window_display_history): Use BVAR.
16599
16600 * xdisp.c (debug_method_add): Use BVAR.
16601 (check_window_end, dump_glyph_matrix, dump_glyph)
16602 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16603
16604 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16605 Likewise.
16606
16607 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16608 check till after the cache is created in init_frame_faces.
16609
ff2bc410
SM
166102011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16611
16612 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16613
28177add
PE
166142011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16615
dd3482fe
PE
16616 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16617 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16618 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16619
393d71f3 16620 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
16621 * fileio.c (Finsert_file_contents):
16622 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16623 Remove the old (too-loose) buffer overflow checks.
16624 They weren't needed, since make_gap checks for buffer overflow.
16625 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16626 The old code merely checked for Emacs fixnum overflow, and relied
16627 on undefined (wraparound) behavior. The new code avoids undefined
16628 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16629
2e6813b0 16630 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
16631 Tune. Don't use wider integers than needed. Don't use alloca.
16632 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 16633
599a9e4f
PE
16634 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16635
99561444
PE
16636 * insdel.c, lisp.h (buffer_overflow): New function.
16637 (insert_from_buffer_1, replace_range, replace_range_2):
16638 * insdel.c (make_gap_larger):
16639 * editfns.c (Finsert_char):
16640 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16641
28177add
PE
16642 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16643
e69dafad
PE
166442011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16645
4baa020d 16646 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 16647
b1c46f02
PE
16648 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16649 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16650
e69dafad
PE
16651 * fileio.c: Don't assume EMACS_INT fits in off_t.
16652 (emacs_lseek): New static function.
16653 (Finsert_file_contents, Fwrite_region): Use it.
16654 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16655
566684ea
PE
16656 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16657
e6966cd6
PE
16658 * fns.c: Don't overflow int when computing a list length.
16659 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16660 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16661 truncation on 64-bit hosts. Check for QUIT every
16662 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16663 faster and is responsive enough.
16664 (Flength): Report an error instead of overflowing an integer.
16665 (Fsafe_length): Return a float if the value is not representable
16666 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 16667 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 16668 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 16669
dd0b0efb
PE
16670 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16671 (header_size, word_size): New constants.
16672 (allocate_vectorlike): Don't check size overflow here.
16673 (allocate_vector): Check it here instead, since this is the only
16674 caller of allocate_vectorlike that could cause overflow.
16675 Check that the new vector's length is representable as a fixnum.
16676
86fe5cfe
PE
16677 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16678 The previous code was bogus. For example, next_almost_prime (32)
16679 returned 39, which is undesirable as it is a multiple of 3; and
16680 next_almost_prime (24) returned 25, which is a multiple of 5 so
16681 why was the code bothering to check for multiples of 7?
16682
80e88859
PE
16683 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16684
4a2f0ad6
PE
16685 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16686
f66c7cf8
PE
16687 Variadic C functions now count arguments with ptrdiff_t.
16688 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16689 Back then I didn't know that the Emacs coding style prefers signed int.
16690 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
16691 were being counted with int, which may truncate counts on 64-bit
16692 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
16693 * lisp.h (struct Lisp_Subr.function.aMANY)
16694 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16695 Arg counts are now ptrdiff_t, not size_t.
16696 All variadic functions and their callers changed accordingly.
16697 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16698 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16699 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16700 * callint.c (Fcall_interactively): Check arg count for overflow,
16701 to avoid potential buffer overrun. Use signed char, not 'int',
16702 for 'varies' array, so that we needn't bother to check its size
16703 calculation for overflow.
16704 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16705 * eval.c (apply_lambda):
16706 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16707 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16708 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16709
a1759b76
PE
16710 * callint.c (Fcall_interactively): Don't use index var as event count.
16711
d96be9fc
PE
16712 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16713 * mem-limits.h (SIZE): Remove; no longer used.
16714
a690a978 16715 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 16716
578c21e6
PE
16717 Remove unnecessary casts.
16718 * xterm.c (x_term_init):
16719 * xfns.c (x_set_border_pixel):
16720 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16721 These aren't needed now that we assume ANSI C.
16722
96f53c6c
PE
16723 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16724 It's more likely to cause problems (due to unsigned overflow)
16725 than to cure them.
16726
83c77d31
PE
16727 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16728
ee2079f1
PE
16729 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16730
6da65536
PE
16731 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16732
7147c4a4
PE
16733 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16734
193e32d9
PE
16735 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16736
e5533da6
PE
16737 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16738
9910e595
PE
16739 GLYPH_CODE_FACE returns EMACS_INT, not int.
16740 * dispextern.h (merge_faces):
16741 * xfaces.c (merge_faces):
01103c44
PE
16742 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16743 Don't assume EMACS_INT fits in int.
9910e595 16744
2638320e
PE
16745 * character.h (CHAR_VALID_P): Remove unused parameter.
16746 * fontset.c, lisp.h, xdisp.c: All uses changed.
16747
045eb8d9
PE
16748 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16749
c1f134b5
PE
16750 * fns.c (concat): Minor tuning based on overflow analysis.
16751 This doesn't fix any bugs. Use int to hold character, instead
16752 of constantly refetching from Emacs object. Use XFASTINT, not
16753 XINT, for value known to be a character. Don't bother comparing
16754 a single byte to 0400, as it's always less.
16755
395fcb93 16756 * floatfns.c (Fexpt):
327eeec8
PE
16757 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16758
abbd3d23
PE
16759 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16760 for characters.
16761
684a03ef
PE
16762 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16763
0fed43f3
PE
16764 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16765 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16766 incorrectly succeed when S was a string, because 4294967386 was
16767 truncated before it was used.
16768
8fd02eb7
PE
16769 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16770 Otherwise, an out-of-range integer could cause undefined behavior
16771 on a 64-bit host.
16772
f8c86b69
PE
16773 * composite.c: Use int, not EMACS_INT, for characters.
16774 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16775 EMACS_INT, for values that are known to be in character range.
16776 This doesn't fix any bugs but is the usual style inside Emacs and
16777 may generate better code on 32-bit machines.
16778
34206dd2
PE
16779 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16780 This is for reasons similar to the recent CHAR_STRING fix.
16781 * charset.c (Fencode_char): Check that character arg is actually
16782 a character. Pass an int to ENCODE_CHAR.
16783 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16784 wider than 'int', as a compile-time check to prevent future regressions
16785 in this area.
16786
c5958d4c 16787 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
16788
16789 Make sure a 64-bit char is never passed to CHAR_STRING.
16790 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16791 by silently ignoring the top 32 bits, allowing some values
16792 that were far too large to be valid characters.
16793 * character.h: Include <verify.h>.
16794 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16795 arguments are no wider than unsigned, as a compile-time check
16796 to prevent future regressions in this area.
16797 * data.c (Faset):
01103c44 16798 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
16799 (Fsubst_char_in_region):
16800 * fns.c (concat):
16801 * xdisp.c (decode_mode_spec_coding):
16802 Adjust to CHAR_STRING's new requirement.
16803 * editfns.c (Finsert_char, Fsubst_char_in_region):
16804 * fns.c (concat): Check that character args are actually
16805 characters. Without this test, these functions did the wrong
16806 thing with wildly out-of-range values on 64-bit hosts.
16807
d37ca623
PE
16808 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16809 These casts should not be needed on 32-bit hosts, either.
16810 * keyboard.c (read_char):
16811 * lread.c (Fload): Remove casts to unsigned.
16812
ea204efb
PE
16813 * lisp.h (UNSIGNED_CMP): New macro.
16814 This fixes comparison bugs on 64-bit hosts.
16815 (ASCII_CHAR_P): Use it.
16816 * casefiddle.c (casify_object):
01103c44 16817 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
16818 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16819 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16820 * dispextern.h (FACE_FROM_ID):
16821 * keyboard.c (read_char): Use UNSIGNED_CMP.
16822
41cb286c
PE
16823 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16824 not to EMACS_INT, to avoid GCC warning.
16825
4a1b9832
PE
16826 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16827
55daad71
PE
16828 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16829 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16830 isn't needed on 32-bit machines.
8f95c75c 16831
01103c44
PE
16832 * buffer.c (Fgenerate_new_buffer_name):
16833 Use EMACS_INT for count, not int.
0ceccced 16834 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
16835
16836 * data.c (Qcompiled_function): Now static.
16837
c6f072e7
PE
16838 * window.c (window_body_lines): Now static.
16839
20ce5912
PE
16840 * image.c (gif_load): Rename local to avoid shadowing.
16841
9c4c5f81
PE
16842 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16843 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16844 * alloc.c (make_save_value): Integer argument is now of type
16845 ptrdiff_t, not int.
16846 (mark_object): Use ptrdiff_t, not int.
16847 * lisp.h (pD): New macro.
16848 * print.c (print_object): Use it.
16849
c0c5c8ae
PE
16850 * alloc.c: Use EMACS_INT, not int, to count objects.
16851 (total_conses, total_markers, total_symbols, total_vector_size)
16852 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
16853 (total_free_floats, total_floats, total_free_intervals)
16854 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
16855 Now EMACS_INT, not int. All uses changed.
16856 (Fgarbage_collect): Compute overall total using a double, so that
16857 integer overflow is less likely to be a problem. Check for overflow
16858 when converting back to an integer.
5a25e253
PE
16859 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16860 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16861 These were 'int' variables that could overflow on 64-bit hosts;
16862 they were never used, so remove them instead of repairing them.
211a0b2a 16863 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
16864 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16865 Previously, this ceilinged at INT_MAX, but that doesn't work on
16866 64-bit machines.
e46bb31a 16867 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 16868
c78baabf 16869 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 16870 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
16871 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16872 when a (possibly-narrower) signed value would do just as well.
16873 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 16874
c9d624c6
PE
16875 * alloc.c: Catch some string size overflows that we were missing.
16876 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16877 for convenience in STRING_BYTES_MAX.
16878 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16879 The definition here is exact; the one in lisp.h was approximate.
16880 (allocate_string_data): Check for string overflow. This catches
16881 some instances we weren't catching before. Also, it catches
16882 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16883 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16884 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 16885
c9d624c6
PE
16886 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16887 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 16888 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 16889
353032ce
PE
16890 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16891
2bccce07
PE
16892 * alloc.c (Fmake_string): Check for out-of-range init.
16893
0ac30604
SM
168942011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16895
16896 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16897
c195f2de
JD
168982011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16899
16900 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16901 xg_get_default_scrollbar_width.
16902
16903 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16904 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16905 (style_changed_cb): Call update_theme_scrollbar_width and call
16906 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16907 all frames (Bug#8505).
16908 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16909 Call gtk_window_set_resizable if HAVE_GTK3.
16910 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16911 and height if HAVE_GTK3 (Bug#8505).
16912 (scroll_bar_width_for_theme): New variable.
16913 (update_theme_scrollbar_width): New function.
16914 (xg_get_default_scrollbar_width): Move code to
16915 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16916 (xg_initialize): Call update_theme_scrollbar_width.
16917
16918 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16919
16920 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16921
e10ac9f1
MR
169222011-06-12 Martin Rudalics <rudalics@gmx.at>
16923
16924 * frame.c (make_frame): Call other_buffer_safely instead of
16925 other_buffer.
16926
16927 * window.c (temp_output_buffer_show): Call display_buffer with
16928 second argument Vtemp_buffer_show_specifiers and reset latter
16929 immediately after the call.
16930 (Vtemp_buffer_show_specifiers): New variable.
16931 (auto_window_vscroll_p, next_screen_context_lines)
16932 (Vscroll_preserve_screen_position): Remove leading asterisks from
16933 doc-strings.
16934
2d3c217e 169352011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 16936
7b7f97e8 16937 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
16938 * buffer.c (Qclone_number): Remove for now, as it's unused.
16939 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16940 (record_buffer): Remove unused local.
16941 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16942 (set_frame_buffer_list): Remove; unused.
16943 * frame.h (other_visible_frames): Remove decl.
16944 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16945 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16946 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16947 if HAVE_GPM.
16948 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16949 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16950 Define only if HAVE_GPM.
16951 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16952 (update_hints_inhibit): Remove; never set. All uses removed.
16953 * widgetprv.h (emacsFrameClassRec): Remove decl.
16954 * window.c (delete_deletable_window): Now returns void, since it
16955 wasn't returning anything.
16956 (compare_window_configurations): Remove unused locals.
16957 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16958 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
16959 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16960 the same widths as pointers. This follows up on the 2011-05-06 patch.
16961 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16962 * xterm.h: Likewise.
16963 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16964
1384b89e
JB
169652011-06-12 Juanma Barranquero <lekktu@gmail.com>
16966
16967 * makefile.w32-in: Update dependencies.
16968 (LISP_H): Add lib/intprops.h.
16969
1100a63c
CY
169702011-06-11 Chong Yidong <cyd@stupidchicken.com>
16971
16972 * image.c (gif_load): Add animation frame delay to the metadata.
16973 (syms_of_image): Use DEFSYM. New symbol `delay'.
16974
6198ccd0
MR
169752011-06-11 Martin Rudalics <rudalics@gmx.at>
16976
16977 * window.c (delete_deletable_window): Re-add.
16978 (Fset_window_configuration): Rewrite to handle dead buffers and
16979 consequently deletable windows.
16980 (window_tree, Fwindow_tree): Remove. Supply functionality in
16981 window.el.
16982 (compare_window_configurations): Simplify code.
16983
b6e3633c
AS
169842011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16985
1ab0dee5
AS
16986 * image.c (imagemagick_load_image): Fix type mismatch.
16987 (Fimagemagick_types): Likewise.
16988
b6e3633c
AS
16989 * window.h (replace_buffer_in_windows): Declare.
16990
9397e56f
MR
169912011-06-11 Martin Rudalics <rudalics@gmx.at>
16992
16993 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16994 Qclone_number. Remove external declaration of Qdelete_window.
16995 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16996 code.
640c8776
SM
16997 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16998 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
16999 (Fother_buffer): Rewrite doc-string. Major rewrite for new
17000 buffer list implementation.
17001 (other_buffer_safely): New function.
17002 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
17003 calls to replace_buffer_in_windows and
17004 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
17005 if allowed.
17006 (record_buffer): Inhibit quitting and rewrite using quittable
17007 functions. Run Qbuffer_list_update_hook if allowed.
17008 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
17009 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
17010 Move switch-to-buffer to window.el.
9397e56f
MR
17011 (bury-buffer): Move to window.el.
17012 (Vbuffer_list_update_hook): New variable.
17013
17014 * lisp.h (other_buffer_safely): Add prototype in buffer.c
17015 section.
17016
17017 * window.h (resize_frame_windows): Move up in code.
17018 (Fwindow_frame): Remove EXFUN.
17019 (replace_buffer_in_all_windows): Remove prototype.
17020 (replace_buffer_in_windows_safely): Add prototype.
17021
17022 * window.c: Declare Qdelete_window static again. Move down
17023 declaration of select_count.
17024 (Fnext_window, Fprevious_window): Rewrite doc-strings.
17025 (Fother_window): Move to window.el.
17026 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
17027 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
17028 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
17029 window.el.
17030 (replace_buffer_in_windows): Implement by calling
17031 Qreplace_buffer_in_windows.
17032 (replace_buffer_in_all_windows): Remove with some functionality
17033 moved into replace_buffer_in_windows_safely.
17034 (replace_buffer_in_windows_safely): New function.
17035 (select_window_norecord, select_frame_norecord): Move in front
17036 of run_window_configuration_change_hook. Remove now obsolete
17037 declarations.
640c8776
SM
17038 (Fset_window_buffer): Rewrite doc-string.
17039 Call Qrecord_window_buffer.
9397e56f
MR
17040 (keys_of_window): Move binding for other-window to window.el.
17041
b50691aa
CY
170422011-06-11 Chong Yidong <cyd@stupidchicken.com>
17043
17044 * dispextern.h (struct image): Replace data member, whose int_val
17045 and ptr_val fields were not used by anything, with a single
17046 lisp_val object.
17047
17048 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
17049 (gif_clear_image, gif_load, imagemagick_load_image)
17050 (gs_clear_image, gs_load): Callers changed.
17051
3f754b86
PE
170522011-06-10 Paul Eggert <eggert@cs.ucla.edu>
17053
cca69397
PE
17054 * buffer.h: Include <time.h>, for time_t.
17055 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
17056
109e28d0
PE
17057 Fix minor problems found by static checking.
17058
60737f02
PE
17059 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
17060
4b66faf3
PE
17061 Make identifiers static if they are not used in other modules.
17062 * data.c (Qcompiled_function, Qframe, Qvector):
17063 * image.c (QimageMagick, Qsvg):
17064 * minibuf.c (Qmetadata):
17065 * window.c (resize_window_check, resize_root_window): Now static.
17066 * window.h (resize_window_check, resize_root_window): Remove decls.
17067
109e28d0
PE
17068 * window.c (window_deletion_count, delete_deletable_window):
17069 Remove; unused.
46a4ce9e
PE
17070 (window_body_lines): Now static.
17071 (Fdelete_other_windows_internal): Mark vars as initialized.
17072 Make sure 'resize_failed' is initialized.
17073 (run_window_configuration_change_hook): Rename local to avoid shadowing.
17074 (resize_window_apply): Remove unused local.
17075 * window.h (delete_deletable_window): Remove decl.
17076
109e28d0 17077 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
17078 (imagemagick_load_image): Fix pointer signedness problem by changing
17079 last arg from unsigned char * to char *. All uses changed.
17080 Also, fix a local for similar reasons.
17081 Remove unused locals. Remove locals to avoid shadowing.
17082 (fn_rsvg_handle_free): Remove; unused.
17083 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 17084 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 17085
3f754b86
PE
17086 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
17087
2547adb1
CY
170882011-06-10 Chong Yidong <cyd@stupidchicken.com>
17089
17090 * image.c (gif_load): Fix omitted cast error introduced by
17091 2011-06-06 change.
17092
2c8e37d4
MR
170932011-06-10 Martin Rudalics <rudalics@gmx.at>
17094
17095 * window.h (resize_proportionally, orig_total_lines)
17096 (orig_top_line): Remove from window structure.
17097 (set_window_height, set_window_width, change_window_heights)
17098 (Fdelete_window): Remove prototypes.
17099 (resize_frame_windows): Remove duplicate declaration.
17100
440a42e3
EZ
171012011-06-10 Eli Zaretskii <eliz@gnu.org>
17102
17103 * window.h (resize_frame_windows, resize_window_check)
17104 (delete_deletable_window, resize_root_window)
17105 (resize_frame_windows): Declare prototypes.
17106
17107 * window.c (resize_window_apply): Make definition be "static" to
17108 match the prototype.
17109
562dd5e9
MR
171102011-06-10 Martin Rudalics <rudalics@gmx.at>
17111
17112 * window.c: Remove declarations of Qwindow_size_fixed,
17113 window_min_size_1, window_min_size_2, window_min_size,
17114 size_window, window_fixed_size_p, enlarge_window, delete_window.
17115 Remove static from declaration of Qdelete_window, it's
17116 temporarily needed by Fbury_buffer.
17117 (replace_window): Don't assign orig_top_line and
17118 orig_total_lines.
17119 (Fdelete_window, delete_window): Remove. Window deletion is
17120 handled by window.el.
640c8776
SM
17121 (window_loop): Remove DELETE_OTHER_WINDOWS case.
17122 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
17123 (Fdelete_other_windows): Remove. Deleting other windows is
17124 handled by window.el.
17125 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
17126 handled in window.el.
17127 (window_min_size_2, window_min_size_1, window_min_size): Remove.
17128 Window minimum sizes are handled in window.el.
17129 (shrink_windows, size_window, set_window_height)
17130 (set_window_width, change_window_heights, window_height)
17131 (window_width, CURBEG, CURSIZE, enlarge_window)
17132 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
17133 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
17134 handled in window.el.
17135 (make_dummy_parent): Rename to make_parent_window and give it a
17136 second argument horflag.
17137 (make_window): Don't set resize_proportionally any more.
17138 (Fsplit_window): Remove. Windows are split in window.el.
17139 (save_restore_action, save_restore_orig_size)
17140 (shrink_window_lowest_first, save_restore_orig_size): Remove.
17141 Resize mini windows in window.el.
17142 (grow_mini_window, shrink_mini_window): Implement by calling
17143 Qresize_root_window_vertically, resize_window_check and
17144 resize_window_apply.
640c8776
SM
17145 (saved_window, Fset_window_configuration, save_window_save):
17146 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
17147 resize_proportionally.
17148 (window_min_height, window_min_width): Move to window.el.
17149 (keys_of_window): Move bindings for delete-other-windows,
17150 split-window, delete-window and enlarge-window to window.el.
17151
17152 * buffer.c: Temporarily extern Qdelete_window.
17153 (Fbury_buffer): Temporarily call Qdelete_window instead of
17154 Fdelete_window (Fbury_buffer will move to window.el soon).
17155
17156 * frame.c (set_menu_bar_lines_1): Remove code handling
17157 orig_top_line and orig_total_lines.
17158
17159 * dispnew.c (adjust_frame_glyphs_initially): Don't use
17160 set_window_height but set heights directly.
17161 (change_frame_size_1): Use resize_frame_windows.
17162
17163 * xdisp.c (init_xdisp): Don't use set_window_height but set
17164 heights directly.
17165
640c8776
SM
17166 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
17167 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
17168 run_window_configuration_change_hook.
17169
17170 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
17171 instead of change_window_heights and run
17172 run_window_configuration_change_hook.
17173
1a13852e
MR
171742011-06-09 Martin Rudalics <rudalics@gmx.at>
17175
17176 * window.c (replace_window): Rename second argument REPLACEMENT to
17177 NEW. New third argument SETFLAG. Rewrite.
17178 (delete_window, make_dummy_parent): Call replace_window with
17179 third argument 1.
17180 (window_list_1): Move down in code.
17181 (run_window_configuration_change_hook): Move set_buffer part
17182 before select_frame_norecord part in order to unwind correctly.
17183 Rename count1 to count.
17184 (recombine_windows, delete_deletable_window, resize_root_window)
17185 (Fdelete_other_windows_internal)
17186 (Frun_window_configuration_change_hook, make_parent_window)
17187 (resize_window_check, resize_window_apply, Fresize_window_apply)
17188 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
17189 (Fdelete_window_internal, Fresize_mini_window_internal):
17190 New functions.
1a13852e
MR
17191 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
17192
f3d1777e
MR
171932011-06-08 Martin Rudalics <rudalics@gmx.at>
17194
496e208e
MR
17195 * window.h (window): Add some new members to window structure -
17196 normal_lines, normal_cols, new_total, new_normal, clone_number,
17197 splits, nest, prev_buffers, next_buffers.
17198 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 17199 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 17200
f3d1777e
MR
17201 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
17202 Remove.
496e208e
MR
17203 (make_dummy_parent): Set new members of windows structure.
17204 (make_window): Move down in code. Handle new members of window
17205 structure.
17206 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
17207 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
17208 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
17209 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
17210 (Fset_window_next_buffers, Fset_window_clone_number):
17211 New functions.
496e208e
MR
17212 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
17213 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
17214 Doc-string fixes.
17215 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
17216 Argument WINDOW can be now internal window too.
17217 (Fwindow_use_time): Move up in code.
17218 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
17219 Rewrite doc-string.
17220 (Fset_window_configuration, saved_window)
17221 (Fcurrent_window_configuration, save_window_save): Handle new
17222 members of window structure.
b9e809c2
MR
17223 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
17224 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
17225 (syms_of_window): New Lisp objects Qrecord_window_buffer,
17226 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
17227 Qget_mru_window, Qresize_root_window,
17228 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
17229 Qauto_buffer_name; staticpro them.
f3d1777e 17230
abde8f8c
MR
172312011-06-07 Martin Rudalics <rudalics@gmx.at>
17232
17233 * window.c (Fwindow_total_size, Fwindow_left_column)
17234 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
17235 (Fwindow_list_1): New functions.
17236 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
17237 (Fwindow_width, Fscroll_left, Fscroll_right):
17238 Use window_body_cols instead of window_box_text_cols.
17239 (delete_window, Fset_window_configuration):
17240 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
17241 (delete_all_subwindows): Take a window as argument and not a
17242 structure. Rewrite.
190b47e6
MR
17243 (window_loop): Remove handling of GET_LRU_WINDOW and
17244 GET_LARGEST_WINDOW.
17245 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
17246
17247 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
17248 window_box_text_cols. delete_all_subwindows now takes a
17249 Lisp_Object as argument.
abde8f8c 17250
640c8776
SM
17251 * indent.c (compute_motion, Fcompute_motion):
17252 Use window_body_cols instead of window_box_text_cols.
abde8f8c 17253
fa8a67e6
MR
17254 * frame.c (delete_frame): Call delete_all_subwindows with root
17255 window as argument.
17256
a54e3482
DC
172572011-06-07 Daniel Colascione <dan.colascione@gmail.com>
17258
17259 * fns.c (Fputhash): Document return value.
17260
60002bf5
CY
172612011-06-06 Chong Yidong <cyd@stupidchicken.com>
17262
17263 * image.c (gif_load): Implement gif89a spec "no disposal" method.
17264
0c671da6 172652011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 17266
b862a52a 17267 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 17268
be44ca6c
PE
17269 Check for overflow when converting integer to cons and back.
17270 * charset.c (Fdefine_charset_internal, Fdecode_char):
17271 Use cons_to_unsigned to catch overflow.
17272 (Fencode_char): Use INTEGER_TO_CONS.
17273 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
17274 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
17275 * data.c (long_to_cons, cons_to_long): Remove.
17276 (cons_to_unsigned, cons_to_signed): New functions.
17277 These signal an error for invalid or out-of-range values.
17278 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
17279 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
17280 * font.c (Ffont_variation_glyphs):
17281 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
17282 * lisp.h: Include <intprops.h>.
17283 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
17284 (cons_to_signed, cons_to_unsigned): New decls.
17285 (long_to_cons, cons_to_long): Remove decls.
17286 * undo.c (record_first_change): Use INTEGER_TO_CONS.
17287 (Fprimitive_undo): Use CONS_TO_INTEGER.
17288 * xfns.c (Fx_window_property): Likewise.
17289 * xselect.c: Include <limits.h>.
17290 (x_own_selection, selection_data_to_lisp_data):
17291 Use INTEGER_TO_CONS.
17292 (x_handle_selection_request, x_handle_selection_clear)
17293 (x_get_foreign_selection, Fx_disown_selection_internal)
17294 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
17295 (lisp_data_to_selection_data): Use cons_to_unsigned.
17296 (x_fill_property_data): Use cons_to_signed.
17297 Report values out of range.
17298
d1f3d2af
PE
17299 Check for buffer and string overflow more precisely.
17300 * buffer.h (BUF_BYTES_MAX): New macro.
17301 * lisp.h (STRING_BYTES_MAX): New macro.
17302 * alloc.c (Fmake_string):
17303 * character.c (string_escape_byte8):
17304 * coding.c (coding_alloc_by_realloc):
17305 * doprnt.c (doprnt):
17306 * editfns.c (Fformat):
17307 * eval.c (verror):
17308 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
17309 since they may not be the same number.
17310 * editfns.c (Finsert_char):
17311 * fileio.c (Finsert_file_contents):
17312 Likewise for BUF_BYTES_MAX.
17313
dd52fcea
PE
17314 * image.c: Use ptrdiff_t, not int, for sizes.
17315 (slurp_file): Switch from int to ptrdiff_t.
17316 All uses changed.
17317 (slurp_file): Check that file size fits in both size_t (for
17318 malloc) and ptrdiff_t (for sanity and safety).
17319
7f9bbdbb
PE
17320 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
17321 if b->modtime has its maximal value.
17322
dfe18f82
PE
17323 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
17324
84acfcf0
PE
17325 Don't assume time_t can fit into int.
17326 * buffer.h (struct buffer.modtime): Now time_t, not int.
17327 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
17328 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
17329
ccd9a01a
PE
17330 Minor fixes for signed vs unsigned integers.
17331 * character.h (MAYBE_UNIFY_CHAR):
17332 * charset.c (maybe_unify_char):
17333 * keyboard.c (read_char, reorder_modifiers):
17334 XINT -> XFASTINT, since the integer must be nonnegative.
17335 * ftfont.c (ftfont_spec_pattern):
17336 * keymap.c (access_keymap, silly_event_symbol_error):
17337 XUINT -> XFASTINT, since the integer must be nonnegative.
17338 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
17339 since it makes no difference and we prefer signed.
17340 * keyboard.c (record_char): Use XUINT when all the neighbors do.
17341 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
17342 nonnegative.
17343
d6d100dd
SM
173442011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
17345
17346 * window.h (Fwindow_frame): Declare.
17347
2b6148e4
PE
173482011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17349
17350 * alloc.c: Simplify handling of large-request failures (Bug#8800).
17351 (SPARE_MEMORY): Always define.
17352 (LARGE_REQUEST): Remove.
17353 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
17354
f230ecc9
MR
173552011-06-06 Martin Rudalics <rudalics@gmx.at>
17356
727e958e
MR
17357 * lisp.h: Move EXFUNS for Fframe_root_window,
17358 Fframe_first_window and Fset_frame_selected_window to window.h.
17359
17360 * window.h: Move EXFUNS for Fframe_root_window,
17361 Fframe_first_window and Fset_frame_selected_window here from
17362 lisp.h.
17363
17364 * frame.c (Fwindow_frame, Fframe_first_window)
17365 (Fframe_root_window, Fframe_selected_window)
17366 (Fset_frame_selected_window): Move to window.c.
17367 (Factive_minibuffer_window): Move to minibuf.c.
17368 (Fother_visible_frames_p): New function.
17369
17370 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17371
f230ecc9
MR
17372 * window.c (decode_window, decode_any_window): Move up in code.
17373 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17374 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
17375 (Fwindow_buffer): Move up and rewrite doc-string.
17376 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17377 (Fwindow_prev): New functions.
727e958e
MR
17378 (Fwindow_frame): Move here from frame.c. Accept any window as
17379 argument.
17380 (Fframe_root_window, Fframe_first_window)
17381 (Fframe_selected_window): Move here from frame.c. Accept frame
17382 or arbitrary window as argument. Update doc-strings.
17383 (Fminibuffer_window): Move up in code.
17384 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
17385 (Fset_frame_selected_window): Move here from frame.c.
17386 Marginal rewrite.
727e958e
MR
17387 (Fselected_window, select_window, Fselect_window): Move up in
17388 code. Minor doc-string fixes.
f230ecc9 17389
4d09bcf6
PE
173902011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17391
17392 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17393 Do not assume that spare memory exists; that assumption is valid
17394 only if SYSTEM_MALLOC.
17395 (LARGE_REQUEST): New macro, so that the issue of large requests
17396 is separated from the issue of spare memory.
17397
810928a2
AS
173982011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17399
172418ad
AS
17400 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17401 format. (Bug#8806)
17402
43f862f7
AS
17403 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17404
810928a2
AS
17405 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17406 before statements.
17407
a059fe24
JD
174082011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17409
17410 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17411
17412 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17413
17414 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17415 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17416
989bf368
JB
174172011-06-05 Juanma Barranquero <lekktu@gmail.com>
17418
17419 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17420
4b80f674
CY
174212011-06-04 Chong Yidong <cyd@stupidchicken.com>
17422
17423 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17424 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
17425 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17426 New error handlers.
4b80f674
CY
17427 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17428 Obey Vx_select_enable_clipboard_manager. Catch errors in
17429 x_clipboard_manager_save (Bug#8779).
17430 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 17431 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 17432
99a33b77 174332011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
17434
17435 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17436
99a33b77 174372011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
17438
17439 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17440 in the current matrix if keep_current_p is non-zero.
17441
8264569d
EZ
174422011-06-04 Eli Zaretskii <eliz@gnu.org>
17443
17444 * bidi.c (bidi_level_of_next_char): Fix last change.
17445
57f97249
EZ
174462011-06-03 Eli Zaretskii <eliz@gnu.org>
17447
fec2107c 17448 Support bidi reordering of text covered by display properties.
57f97249 17449
fec2107c
EZ
17450 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17451 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17452 (bidi_cache_search, bidi_cache_iterator_state)
17453 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
17454 (bidi_level_of_next_char, bidi_move_to_visually_next):
17455 Support character positions inside a run of characters covered by a
fec2107c
EZ
17456 display string.
17457 (bidi_paragraph_init, bidi_resolve_explicit_1)
17458 (bidi_level_of_next_char): Call bidi_fetch_char and
17459 bidi_fetch_char_advance instead of FETCH_CHAR and
17460 FETCH_CHAR_ADVANCE.
17461 (bidi_init_it): Initialize new members.
17462 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17463 definitions.
17464 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17465 instead of using explicit *_CHAR codes.
d6d100dd
SM
17466 (bidi_resolve_explicit, bidi_resolve_weak):
17467 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
17468 bidirectional text is supported only in multibyte buffers.
17469 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17470 it to initialize the frame_window_p member of struct bidi_it.
17471 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17472 (bidi_resolve_explicit, bidi_resolve_weak)
17473 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17474 bidi_it->nchars is non-positive.
17475 (bidi_level_of_next_char): Don't try to lookup the cache for the
17476 next/previous character if nothing is cached there yet, or if we
17477 were just reseat()'ed to a new position.
c40e2fb2 17478
0e14fe90
EZ
17479 * xdisp.c (set_cursor_from_row): Set start and stop points
17480 according to the row's direction when priming the loop that looks
17481 for the glyph on which to display cursor.
17482 (single_display_spec_intangible_p): Function deleted.
17483 (display_prop_intangible_p): Reimplement to call
17484 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
17485 Accept 3 additional arguments needed by handle_display_spec.
17486 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
17487 values: lists, `(when COND...)' forms, etc.
17488 (single_display_spec_string_p): Support property values that are
17489 lists with the argument STRING its top-level element.
17490 (display_prop_string_p): Fix the condition for processing a
17491 property that is a list to be consistent with handle_display_spec.
fec2107c 17492 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
17493 last portion of handle_display_prop.
17494 (compute_display_string_pos): Accept additional argument
17495 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17496 value of a `display' property is a "replacing spec".
17497 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17498 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17499 the display property, but just return a value indicating whether
17500 the display property will replace the characters it covers.
17501 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17502 frame_window_p members of struct bidi_it.
d6d100dd
SM
17503 (compute_display_string_pos, compute_display_string_end):
17504 New functions.
fec2107c
EZ
17505 (push_it): Accept second argument POSITION, where pop_it should
17506 jump to continue iteration.
17507 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 17508
fec2107c
EZ
17509 * keyboard.c (adjust_point_for_property): Adjust the call to
17510 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
17511
17512 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
17513 (bidi_init_it): Update prototypes.
17514 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
17515 (compute_display_string_pos, compute_display_string_end):
17516 Declare prototypes.
fec2107c
EZ
17517 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17518 EMACS_INT.
fc6f18ce 17519
40087514 175202011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 17521
57f53182
PE
17522 Malloc failure behavior now depends on size of allocation.
17523 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17524 * lisp.h: Change signatures accordingly.
17525 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17526 All callers changed. (Bug#8762)
17527
17528 * gnutls.c: Use Emacs's memory allocators.
17529 Without this change, the gnutls library would invoke malloc etc.
17530 directly, which causes problems on non-SYNC_INPUT hosts, and which
17531 runs afoul of improving memory_full behavior. (Bug#8761)
17532 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17533 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17534 xfree instead of the default malloc, realloc, free.
17535 (Fgnutls_boot): No need to check for memory allocation failure,
17536 since xmalloc does that for us.
17537
ac32cd99 17538 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
17539 * category.c (hash_get_category_set):
17540 * ccl.c (ccl_driver):
17541 * charset.c (Fdefine_charset_internal):
17542 * charset.h (struct charset.hash_index):
17543 * composite.c (get_composition_id, gstring_lookup_cache)
17544 (composition_gstring_put_cache):
17545 * composite.h (struct composition.hash_index):
17546 * dispextern.h (struct image.hash):
17547 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17548 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17549 (hashfn_equal, hashfn_user_defined, make_hash_table)
17550 (maybe_resize_hash_table, hash_lookup, hash_put)
17551 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17552 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17553 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17554 * image.c (make_image, search_image_cache, lookup_image)
17555 (xpm_put_color_table_h):
17556 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 17557 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 17558 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 17559 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
17560 * alloc.c (allocate_vectorlike):
17561 Check for overflow in vector size calculations.
17562 * ccl.c (ccl_driver):
17563 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
17564 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17565 need to be updated by these changes.
40087514
PE
17566 * fns.c (make_hash_table, maybe_resize_hash_table):
17567 Check for integer overflow with large hash tables.
0de4bb68
PE
17568 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17569 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17570 (SXHASH_REDUCE): New macro.
17571 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17572 Use it instead of discarding useful hash info with large hash values.
17573 (sxhash_float): New function.
17574 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17575 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
17576 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17577 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
17578 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17579 Adjust signatures to match updated version of code.
17580 (consing_since_gc): Now EMACS_INT, since a single hash table can
17581 use more than INT_MAX bytes.
17582
698d32e2
DN
175832011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17584
17585 Make it possible to build with GCC-4.6+ -O2 -flto.
17586
17587 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17588
fd6fa53f
SM
175892011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17590
17591 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17592 Call minibuffer-inactive-mode.
17593
864db017
JB
175942011-05-31 Juanma Barranquero <lekktu@gmail.com>
17595
17596 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17597 Update dependencies.
17598
2ad0baf4
DN
175992011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17600
17601 * data.c (init_data): Remove code for UTS, this system is not
17602 supported anymore.
17603
4fcc2638
DN
176042011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17605
17606 Don't force ./temacs to start in terminal mode.
17607
17608 * frame.c (make_initial_frame): Initialize faces in all cases, not
17609 only when CANNOT_DUMP is defined.
17610 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17611
c56e0fd5
DN
176122011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17613
17614 * dispnew.c (add_window_display_history): Use const for the string
17615 pointer. Remove declaration, not needed.
17616
333d54da 176172011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 17618
55d4c1b2 17619 Use 'inline', not 'INLINE'.
333d54da 17620 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
17621 * alloc.c, fontset.c (INLINE): Remove.
17622 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17623 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17624 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17625 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17626 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17627
738db178
DN
176282011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17629
17630 Make it possible to run ./temacs.
17631
17632 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17633 syms_of_callproc does the same thing. Remove test for
17634 "initialized", do it in the caller.
17635 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17636
620c53a6
SM
176372011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17638
17639 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17640 (read_minibuf): Use get_minibuffer.
17641 (syms_of_minibuf): Use DEFSYM.
17642 (Qmetadata): New var.
17643 * data.c (Qbuffer): Don't make it static.
17644 (syms_of_data): Use DEFSYM.
17645
e003a292
PE
176462011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17647
17648 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17649 (CCL_CODE_MIN): New macro.
17650
ed008a6d
PE
176512011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17652
3687c2ef
PE
17653 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17654
ed008a6d
PE
17655 * eval.c (Qdebug): Now static.
17656 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17657 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17658 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17659
d66c4c7c
CY
176602011-05-29 Chong Yidong <cyd@stupidchicken.com>
17661
17662 * image.c: Various fixes to ImageMagick code comments.
17663 (Fimagemagick_types): Doc fix.
17664
5fbc2025
PE
176652011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17666
0196f88a
PE
17667 Minor fixes prompted by GCC 4.6.0 warnings.
17668
17669 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17670
5fbc2025
PE
17671 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17672 (x_clipboard_manager_save_all): Move extern decl to ...
17673 * xterm.h: ... here, so that it can be checked for consistency.
17674
1dd3c2d9
CY
176752011-05-29 Chong Yidong <cyd@stupidchicken.com>
17676
17677 * xselect.c (x_clipboard_manager_save_frame)
17678 (x_clipboard_manager_save_all): New functions.
17679 (Fx_clipboard_manager_save): Lisp function deleted.
17680
17681 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17682 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17683
17684 * xterm.h: Update prototype.
17685
5ba6571d
WX
176862011-05-28 William Xu <william.xwl@gmail.com>
17687
17688 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17689 exiting (Bug#8239).
17690
3eaff834
JM
176912011-05-28 Jim Meyering <meyering@redhat.com>
17692
e1900994 17693 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
17694 * fns.c (to_uchar): Define.
17695 (crypto_hash_function): Use it to convert some newly-signed
17696 variables to unsigned, to avoid sign-extension bugs. For example,
17697 without this change, (md5 "truc") would evaluate to
17698 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17699 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 17700 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 17701
0f6990a7
PE
177022011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17703
17704 Integer overflow fixes.
c8a9ca5a 17705
08686060
PE
17706 * dbusbind.c: Serial number integer overflow fixes.
17707 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
17708 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17709 to hold a serial number that is too large for a fixnum.
17710 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17711 Check for serial numbers out of range. Decode any serial number
59568bf0 17712 that was so large that it became a float. (Bug#8722)
08686060 17713
2d1fc3c7
PE
17714 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17715 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17716 Use XFASTINT rather than XUINT when numbers are nonnegative.
17717 (xd_append_arg, Fdbus_method_return_internal):
17718 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17719 arguments, check that Lisp number is nonnegative, rather than
59568bf0 17720 silently wrapping negative numbers around. (Bug#8722)
30217ff0 17721 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 17722 (Bug#8722)
2d1fc3c7 17723
c8a9ca5a
PE
17724 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17725
519e1d69
PE
17726 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17727
6df6ae42 17728 ccl: Add integer overflow checks.
30569699
PE
17729 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17730 (IN_INT_RANGE): New macros.
17731 (ccl_driver): Use them to check for integer overflow when
17732 decoding a CCL program. Many of the new checks are whether XINT (x)
17733 fits in int; it doesn't always, on 64-bit hosts. The new version
17734 doesn't catch all possible integer overflows, but it's an
847044ea 17735 improvement. (Bug#8719)
30569699 17736
c11285dc
PE
17737 * alloc.c (make_event_array): Use XINT, not XUINT.
17738 There's no need for unsigned here.
17739
fdccd48e
PE
17740 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17741 This follows up to the 2011-05-06 change that substituted uintptr_t
17742 for EMACS_INT. This case wasn't caught back then.
17743
37910ab2
PE
17744 Rework Fformat to avoid integer overflow issues.
17745 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17746 now (part of C89). Include <verify.h>.
17747 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17748 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17749 (Fformat): Avoid the prepass trying to compute sizes; it was only
17750 approximate and thus did not catch overflow reliably. Instead, walk
17751 through the format just once, formatting and computing sizes as we go,
17752 checking for integer overflow at every step, and allocating a larger
17753 buffer as needed. Keep track separately whether the format is
17754 multibyte. Keep only the most-recently calculated precision, rather
17755 than them all. Record whether each argument has been converted to
17756 string. Use EMACS_INT, not int, for byte and char and arg counts.
17757 Support field widths and precisions larger than INT_MAX. Avoid
17758 sprintf's undefined behavior with conversion specifications such as %#d
17759 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17760 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17761 formatting out-of-range floating point numbers with int
9173deec 17762 formats. (Bug#8668)
37910ab2 17763
2e6578fb
PE
17764 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17765
0ae6bdee
PE
17766 * data.c: Avoid integer truncation in expressions involving floats.
17767 * data.c: Include <intprops.h>.
17768 (arith_driver): When there's an integer overflow in an expression
17769 involving floating point, convert the integers to floating point
17770 so that the resulting value does not suffer from catastrophic
17771 integer truncation. For example, on a 64-bit host (* 4
17772 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17773 Do not rely on undefined behavior after integer overflow.
17774
de883a70
PE
17775 merge count_size_as_multibyte, parse_str_to_multibyte
17776 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 17777 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
17778 Check for integer overflow.
17779 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17780 since it's now a duplicate of the other. This is more of
17781 a character than a buffer op, so better that it's in character.c.
17782 * fns.c, print.c: Adjust to above changes.
17783
2ff916cb
PE
177842011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17785
17786 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17787
f1b54466
PE
177882011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17789
fb1ac845
PE
17790 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17791 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17792 (x_clipboard_manager_save): Now static.
17793 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17794
f1b54466
PE
17795 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17796 (crypto_hash_function): Now static.
17797 Fix pointer signedness problems. Avoid unnecessary initializations.
17798
a9f737ee
CY
177992011-05-27 Chong Yidong <cyd@stupidchicken.com>
17800
17801 * termhooks.h (Vselection_alist): Make it terminal-local.
17802
17803 * terminal.c (create_terminal): Initialize it.
17804
17805 * xselect.c: Support for clipboard managers.
17806 (Vselection_alist): Move to termhooks.h as terminal-local var.
17807 (LOCAL_SELECTION): New macro.
17808 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17809 (symbol_to_x_atom): Remove gratuitous arg.
17810 (x_handle_selection_request, lisp_data_to_selection_data)
17811 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
17812 (x_own_selection, x_get_local_selection, x_convert_selection):
17813 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
17814 (some_frame_on_display): Delete unused function.
17815 (Fx_own_selection_internal, Fx_get_selection_internal)
17816 (Fx_disown_selection_internal, Fx_selection_owner_p)
17817 (Fx_selection_exists_p): New optional frame arg.
17818 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17819 (x_handle_selection_clear): Don't treat other terminals with the
17820 same keyboard specially. Use the terminal-local Vselection_alist.
17821 (x_clear_frame_selections): Use Frun_hook_with_args.
17822
17823 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17824
17825 * xterm.h: Add support for those atoms.
17826
e067f0c1
CY
178272011-05-26 Chong Yidong <cyd@stupidchicken.com>
17828
17829 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17830 (converted_selections, conversion_fail_tag): New global variables.
17831 (x_selection_request_lisp_error): Free the above.
17832 (x_get_local_selection): Remove unnecessary code.
17833 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
17834 of converted selections stored in converted_selections.
17835 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
17836 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17837 (x_convert_selection): New function.
17838 (x_handle_selection_event): Simplify.
17839 (x_get_foreign_selection): Don't ignore incoming requests while
17840 waiting for an answer; this will fail when we implement
17841 SAVE_TARGETS, and seems unnecessary anyway.
17842 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17843 (Vx_sent_selection_functions): Doc fix.
17844
0f4aebc0
LL
178452011-05-26 Leo Liu <sdl.web@gmail.com>
17846
17847 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17848
e61124cd
YM
178492011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17850
17851 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17852
17853 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17854 for fringe update if it has periodic bitmap.
ac389d0c 17855 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
17856 and fringe_bitmap_periodic_p.
17857
17858 * fringe.c (get_fringe_bitmap_data): New function.
17859 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17860 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17861 row. Mark glyph row for fringe update if periodicity changed.
17862
17863 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17864 for fringe update unless it has periodic bitmap.
17865
f16d9837
KH
178662011-05-25 Kenichi Handa <handa@m17n.org>
17867
17868 * xdisp.c (get_next_display_element): Set correct it->face_id for
17869 a static composition.
17870
e1b90ef6
LL
178712011-05-24 Leo Liu <sdl.web@gmail.com>
17872
17873 * deps.mk (fns.o):
17874 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17875
17876 * fns.c (crypto_hash_function, Fsha1): New function.
17877 (Fmd5): Use crypto_hash_function.
17878 (syms_of_fns): Add Ssha1.
17879
7400048f
PE
178802011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17881
17882 * gnutls.c: Remove unused macros.
17883 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17884 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17885 Remove macros that are defined and never used.
17886 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17887
abb71cf4
CY
178882011-05-22 Chong Yidong <cyd@stupidchicken.com>
17889
17890 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17891 (Fx_get_selection_internal): Minor cleanup.
17892 (Fx_own_selection_internal): Rename arguments for consistency with
17893 select.el.
17894
6307db39
PE
178952011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17896
17897 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17898
f3d4e0a4
CY
178992011-05-22 Chong Yidong <cyd@stupidchicken.com>
17900
17901 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17902
4d8ade89
YM
179032011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17904
17905 * dispnew.c (scrolling_window): Don't exclude the case that the
17906 last enabled row in the desired matrix touches the bottom boundary.
17907
32078c8d
GM
179082011-05-21 Glenn Morris <rgm@gnu.org>
17909
17910 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
17911 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17912 and add some more files.
32078c8d 17913
7285dc67
EZ
179142011-05-20 Eli Zaretskii <eliz@gnu.org>
17915
17916 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17917 report_file_error introduced by the change from 2011-05-07.
17918
89d1bd22
PE
179192011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17920
17921 * systime.h (Time): Define only if emacs is defined.
17922 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17923 where the include path doesn't have X11/X.h by default. See
17924 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17925
cd394be1 179262011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
17927
17928 * composite.c (find_automatic_composition): Fix previous change.
17929
b9704ad9
GM
179302011-05-20 Glenn Morris <rgm@gnu.org>
17931
17932 * lisp.mk: New file, split from Makefile.in.
17933 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17934 (shortlisp): Remove.
17935 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17936
4a720484
GM
179372011-05-19 Glenn Morris <rgm@gnu.org>
17938
17939 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17940 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17941 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17942 (lisp): Set the order to that of loadup.el.
17943 (shortlisp): Make it a copy of $lisp.
17944 (SOME_MACHINE_LISP): Remove.
17945 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17946 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17947
a28d4396
KH
179482011-05-18 Kenichi Handa <handa@m17n.org>
17949
17950 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17951 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17952 (find_automatic_composition): Mostly rewrite for efficiency.
17953
a2b1fa8e
JB
179542011-05-18 Juanma Barranquero <lekktu@gmail.com>
17955
17956 * makefile.w32-in: Update dependencies.
17957
8e1f5610
CS
179582011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17959
17960 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 17961 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 17962
7025ee00 179632011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 17964
cdfa6eab
PE
17965 Fix some integer overflow issues, such as string length overflow.
17966
06d6db33
PE
17967 * insdel.c (count_size_as_multibyte): Check for string overflow.
17968
2b4560a8
PE
17969 * character.c (lisp_string_width): Check for string overflow.
17970 Use EMACS_INT, not int, for string indexes and lengths; in
17971 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17972 the resulting string length overflows an EMACS_INT; instead,
17973 report a string overflow if no precision given. When checking for
17974 precision exhaustion, use a check that cannot possibly have
17975 integer overflow. (Bug#8675)
17976 * character.h (lisp_string_width): Adjust to new signature.
17977
cb93f9be
PE
17978 * alloc.c (string_overflow): New function.
17979 (Fmake_string): Use it. This doesn't change behavior, but saves
17980 a few bytes and will simplify future changes.
17981 * character.c (string_escape_byte8): Likewise.
17982 * lisp.h (string_overflow): New decl.
17983
1a1f3366
PE
17984 Fixups, following up to the user-interface timestamp change.
17985 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17986 for UI timestamps, instead of unsigned long.
9fbd6841
PE
17987 * msdos.c (mouse_get_pos): Likewise.
17988 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
17989 * w32gui.h (Time): Define by including "systime.h" rather than by
17990 declaring it ourselves. (Bug#8664)
17991
d4e3e4d3
PE
17992 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17993 * image.c (clear_image_cache): Likewise.
17994
f6a24d19
PE
17995 * term.c (term_mouse_position): Don't assume time_t wraparound.
17996
08dc5ae6
PE
17997 Be more systematic about user-interface timestamps.
17998 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
17999 and sometimes 'EMACS_UINT', to represent these timestamps.
18000 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
18001 This makes the code easier to follow, and makes it easier to catch
18002 integer overflow bugs such as Bug#8664.
18003 * frame.c (Fmouse_position, Fmouse_pixel_position):
18004 Use Time, not unsigned long, for user-interface timestamps.
18005 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
18006 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
18007 * keyboard.h (last_event_timestamp): Likewise.
18008 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
18009 * menu.h (xmenu_show): Likewise.
18010 * term.c (term_mouse_position): Likewise.
18011 * termhooks.h (struct input_event.timestamp): Likewise.
18012 (struct terminal.mouse_position_hook): Likewise.
18013 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
18014 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
18015 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
18016 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
18017 what it was before.
18018 * menu.h, termhooks.h: Include "systime.h", for Time.
18019
8e55734a
PE
18020 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
18021 Don't assume that the difference between two unsigned long values
18022 can fit into an integer. At this point, we know button_down_time
18023 <= event->timestamp, so the difference must be nonnegative, so
18024 there's no need to cast the result if double-click-time is
18025 nonnegative, as it should be; check that it's nonnegative, just in
18026 case. This bug is triggered when events are more than 2**31 ms
86db42d2 18027 apart (about 25 days). (Bug#8664)
8e55734a 18028
841f1b75 18029 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 18030 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 18031
3e26f69c
PE
18032 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
18033 that always fit in int. Use a sentinel instead of a counter, to
18034 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
18035 * frame.h (struct frame): Use int for menu_bar_items_used
18036 instead of EMACS_INT, since it always fits in int.
3e26f69c 18037
5cc152c0
PE
18038 * menu.c (grow_menu_items): Check for int overflow.
18039
d89eb65e
PE
18040 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
18041
5235bd3e
PE
18042 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
18043 Before, the code was not consistent. These values cannot exceed
18044 2**31 - 1 so there's no need to make them unsigned.
18045 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
18046 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
18047 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
18048 as modifiers.
18049 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
18050
bc827e23
PE
18051 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
18052 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
18053 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
18054 presumably because the widths might not match.
18055
78eb494e
PE
18056 * window.c (size_window): Avoid needless test at loop start.
18057
04f2d78b
CB
180582011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
18059
18060 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
18061
d2fc7e3d 180622011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
18063
18064 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
18065
d2fc7e3d 180662011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
18067
18068 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
18069 `width' to `bar_area_x' and `bar_area_width', respectively.
18070 (x_scroll_run): Take account of fringe background extension.
18071
04f2d78b
CB
18072 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
18073 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
18074 `bar_area_width', respectively.
18075 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
18076 background extension.
18077
79b70037
GM
180782011-05-10 Jim Meyering <meyering@redhat.com>
18079
18080 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
18081
2f142cc5
JB
180822011-05-10 Juanma Barranquero <lekktu@gmail.com>
18083
18084 * image.c (Finit_image_library): Return t for built-in image types,
18085 like pbm and xbm. (Bug#8640)
18086
57679c86
AS
180872011-05-09 Andreas Schwab <schwab@linux-m68k.org>
18088
18089 * w32menu.c (set_frame_menubar): Fix submenu allocation.
18090
888c9e86
EZ
180912011-05-07 Eli Zaretskii <eliz@gnu.org>
18092
b0512a1d
EZ
18093 * w32console.c (Fset_screen_color): Doc fix.
18094 (Fget_screen_color): New function.
18095 (syms_of_ntterm): Defsubr it.
18096
7285dc67
EZ
18097 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
18098 unlink the temporary file if Fcall_process didn't create it in the
18099 first place.
18100 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
18101 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
18102 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
18103 cue to call_process_cleanup not to close that handle.
18104
4d3fcc8e
BK
181052011-05-07 Ben Key <bkey76@gmail.com>
18106
18107 * makefile.w32-in: The bootstrap-temacs rule now makes use of
18108 one of two shell specific rules, either bootstrap-temacs-CMD or
18109 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
18110 to the previous implementation of the bootstrap-temacs rule.
18111 The bootstrap-temacs-CMD rule is similar to the previous
18112 implementation of the bootstrap-temacs rule except that it
18113 makes use of the ESC_CFLAGS variable instead of the CFLAGS
18114 variable.
18115
18116 These changes, along with some changes to nt/configure.bat,
18117 nt/gmake.defs, and nt/nmake.defs, are required to extend my
18118 earlier fix to add support for --cflags and --ldflags options
18119 that include quotes so that it works whether make uses cmd or
18120 sh as the shell.
18121
b4289b64
MA
181222011-05-06 Michael Albinus <michael.albinus@gmx.de>
18123
18124 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
18125 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
18126 is a constant.
18127 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
18128 a string. Handle both cases.
18129 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
18130 (Fdbus_register_method): Use Qinvalid_function.
18131
af4c0e28
JB
181322011-05-06 Juanma Barranquero <lekktu@gmail.com>
18133
18134 * makefile.w32-in: Update dependencies.
18135 (LISP_H): Add inttypes.h and stdin.h.
18136 (PROCESS_H): Add unistd.h.
18137
c51453d9
EZ
181382011-05-06 Eli Zaretskii <eliz@gnu.org>
18139
18140 * lread.c: Include limits.h (fixes the MS-Windows build broken by
18141 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
18142
8ff0ac3c 181432011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 18144
4c4b566b
PE
18145 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
18146
aab2b9b5
PE
18147 * term.c (vfatal): Remove stray call to va_end.
18148 It's not needed and the C Standard doesn't allow it here anyway.
18149
c378da0b
PE
18150 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
18151 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
18152
288b08c7
PE
18153 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
18154 bytes.
18155
e3601888
PE
18156 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
18157
db6c0e74
PE
18158 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18159
dd5963ea
PE
18160 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
18161
88c9450f
PE
18162 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
18163
2f9442b8
PE
18164 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
18165
c032b5f8
PE
18166 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
18167 * charset.c (Fdefine_charset_internal): Don't initialize
18168 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 18169 32-bit int (Bug#8600).
a108c10b
PE
18170
18171 * lread.c (read_integer): Be more consistent with string-to-number.
18172 Use string_to_number to do the actual conversion; this avoids
18173 rounding errors and fixes some other screwups. Without this fix,
18174 for example, #x1fffffffffffffff was misread as -2305843009213693952.
18175 (digit_to_number): Move earlier, for benefit of read_integer.
18176 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 18177 not a digit in any supported base. (Bug#8602)
a108c10b 18178
ad5f9eea
PE
18179 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
18180
aec1708a
PE
18181 * dispnew.c (scrolling_window): Return 1 if we scrolled,
18182 to match comment at start of function. This also removes a
18183 GCC warning about overflow in a 32+64-bit port.
18184
47be4ab5
PE
18185 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
18186
371cac43
PE
18187 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
18188 Reported by Stefan Monnier in
18189 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
18190 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18191 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 18192
d01a7826
PE
18193 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
18194 (EMACS_UINTPTR): Likewise, with uintptr_t.
18195
7fd47d5c
PE
18196 * lisp.h: Prefer 64-bit EMACS_INT if available.
18197 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
18198 on 32-bit hosts that have 64-bit int, so that they can access
18199 large files.
122b0c86
PE
18200 However, temporarily disable this change unless the temporary
18201 symbol WIDE_EMACS_INT is defined.
7fd47d5c 18202
8727937b
PE
18203 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
18204
8ac068ac
PE
18205 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
18206 This removes an assumption that EMACS_INT and long are the same
18207 width as pointers. The assumption is true for Emacs porting targets
18208 now, but we want to make other targets possible.
18209 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
18210 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
18211 In the rest of the code, change types of integers that hold casted
18212 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
18213 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
18214 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
18215 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
18216 No need to cast type when ORing.
18217 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
18218 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
18219 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
18220 assume EMACS_INT is the same width as char *.
18221 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
18222 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
18223 Remove no-longer-needed casts.
18224 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
18225 (xg_tool_bar_help_callback, xg_make_tool_item):
18226 Use EMACS_INTPTR to hold an integer
18227 that will be cast to void *; this can avoid a GCC warning
18228 if EMACS_INT is not the same width as void *.
18229 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
18230 * xdisp.c (display_echo_area_1, resize_mini_window_1):
18231 (current_message_1, set_message_1):
18232 Use a local to convert to proper width without a cast.
18233 * xmenu.c (dialog_selection_callback): Likewise.
18234
ede49d71
PE
18235 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
18236 Also, don't assume VALBITS / RAND_BITS is less than 5,
18237 and don't rely on undefined behavior when shifting a 1 left into
18238 the sign bit.
18239 * lisp.h (get_random): Change signature to match.
18240
2f30ecd0
PE
18241 * lread.c (hash_string): Use size_t, not int, for hash computation.
18242 Normally we prefer signed values; but hashing is special, because
18243 it's better to use unsigned division on hash table sizes so that
18244 the remainder is nonnegative. Also, size_t is the natural width
18245 for hashing into memory. The previous code used 'int', which doesn't
18246 retain enough info to hash well into very large tables.
18247 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
18248
2a866e7b
PE
18249 * dbusbind.c: Don't possibly lose pointer info when converting.
18250 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18251 Use XPNTR rather than XHASH, so that the high-order bits of
18252 the pointer aren't lost when converting through void *.
18253
51639eac
PE
18254 * eval.c (Fautoload): Don't double-shift a pointer.
18255
92394119
PE
18256 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
18257
dbdb9a7c
JB
182582011-05-06 Juanma Barranquero <lekktu@gmail.com>
18259
18260 * gnutls.c (DEF_GNUTLS_FN):
18261 * image.c (DEF_IMGLIB_FN): Make function pointers static.
18262
db7a0b4f
AS
182632011-05-05 Andreas Schwab <schwab@linux-m68k.org>
18264
18265 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
18266 marker. (Bug#8610)
18267
cd394be1 182682011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
18269
18270 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
18271 New version that can reserve upto 2GB of heap space.
18272
f7ff1b0f 182732011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
18274
18275 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
18276
639c109b
TZ
182772011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
18278
18279 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
18280 `gnutls_certificate_set_x509_key_file'.
18281
d2127135
JB
182822011-05-05 Juanma Barranquero <lekktu@gmail.com>
18283
18284 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
18285 Update dependencies.
18286
e968f4f3
JB
182872011-05-04 Juanma Barranquero <lekktu@gmail.com>
18288
18289 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
18290 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
18291 Remove unused parameter `fildes'.
18292 * process.c (read_process_output, send_process): Don't pass it.
18293
84d358f0
JB
182942011-05-04 Juanma Barranquero <lekktu@gmail.com>
18295
18296 Fix previous change: the library cache is defined in w32.c.
18297 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
18298 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
18299
0898ca10
JB
183002011-05-04 Juanma Barranquero <lekktu@gmail.com>
18301
18302 Implement dynamic loading of GnuTLS on Windows.
18303
18304 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
18305 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
18306 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18307 Declare.
18308
18309 * gnutls.c (Qgnutls_dll): Define.
18310 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
18311 (gnutls_*): Declare function pointers.
18312 (init_gnutls_functions): New function to initialize function pointers.
18313 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
18314 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
18315 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18316 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
18317 (emacs_gnutls_write, emacs_gnutls_read)
18318 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
18319 (Fgnutls_available_p): New function.
18320 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
18321 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
18322 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
18323
18324 * image.c: Include w32.h.
18325 (Vimage_type_cache): Delete.
18326 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
18327 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
18328 (w32_delayed_load): Move to w32.c.
18329
18330 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
18331
18332 * w32.c (QCloaded_from, Vlibrary_cache): Define.
18333 (w32_delayed_load): Move from image.c. When loading a library, record
18334 its filename in the :loaded-from property of the library id.
18335 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
18336 Initialize and staticpro them.
18337 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
18338
18339 * process.c: Include lisp.h before w32.h, not after.
18340 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
18341 instead of gnutls_record_check_pending.
18342
18343 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
18344
ff4de4aa
TZ
183452011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
18346
18347 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
18348 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
18349 as passed in.
18350
abe95abb
JD
183512011-05-03 Jan Djärv <jan.h.d@swipnet.se>
18352
18353 * xterm.c (x_set_frame_alpha): Do not set property on anything
18354 else than FRAME_X_OUTER_WINDOW (Bug#8608).
18355
e16e55d4
JB
183562011-05-02 Juanma Barranquero <lekktu@gmail.com>
18357
18358 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18359
bafcf6a5
JB
183602011-05-02 Juanma Barranquero <lekktu@gmail.com>
18361
18362 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18363 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18364 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18365 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18366 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18367 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18368 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18369 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18370 (Qgnutls_bootprop_callbacks_verify): Make static.
18371
e7a6747f
AS
183722011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18373
19ed11ba
AS
18374 * callproc.c: Indentation fixup.
18375
e7a6747f 18376 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
18377 (wait_for_termination, interruptible_wait_for_termination):
18378 Move after wait_for_termination_1.
e7a6747f 18379
1ef14cb4
LMI
183802011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18381
18382 * sysdep.c (interruptible_wait_for_termination): New function
18383 which is like wait_for_termination, but allows keyboard
18384 interruptions.
18385
18386 * callproc.c (Fcall_process): Add (:file "file") as an option for
18387 the STDOUT buffer.
18388 (Fcall_process_region): Ditto.
18389
330d880c
EZ
183902011-04-30 Eli Zaretskii <eliz@gnu.org>
18391
8db90b73
EZ
18392 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18393 rather than `XVECTOR (FOO)->size'.
18394
330d880c
EZ
18395 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18396 inttypes.h, as a gnulib replacement is used if it not available in
18397 system headers.
18398
15cbd324
EZ
183992011-04-21 Eli Zaretskii <eliz@gnu.org>
18400
18401 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18402 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18403 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18404
18405 * coding.c (coding_alloc_by_realloc): Error out if destination
18406 will grow beyond MOST_POSITIVE_FIXNUM.
18407 (decode_coding_emacs_mule): Abort if there isn't enough place in
18408 charbuf for the composition carryover bytes. Reserve an extra
18409 space for up to 2 characters produced in a loop.
18410 (decode_coding_iso_2022): Abort if there isn't enough place in
18411 charbuf for the composition carryover bytes.
18412
184132011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 18414
ae940cca
EZ
18415 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18416 aborting when %lld or %lll format is passed.
18417 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18418 %llo or %llx format is passed. (Bug#8545)
18419
03ab8921
EZ
18420 * window.c (window_scroll_line_based): Use a marker instead of
18421 simple variables to record original value of point. (Bug#7952)
18422
afda1437
EZ
18423 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18424 produced by %s or %c overflows available buffer space. (Bug#8545)
18425
f76dee0c
PE
184262011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18427
18428 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 18429 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 18430
fdc5744d
JB
184312011-04-28 Juanma Barranquero <lekktu@gmail.com>
18432
18433 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18434
638f053a
JB
184352011-04-28 Juanma Barranquero <lekktu@gmail.com>
18436
18437 * keyboard.c (Qdelayed_warnings_hook): Define.
18438 (command_loop_1): Run `delayed-warnings-hook'
18439 if Vdelayed_warnings_list is non-nil.
18440 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18441 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18442
d178f871
EZ
184432011-04-28 Eli Zaretskii <eliz@gnu.org>
18444
18445 * doprnt.c (doprnt): Don't return value smaller than the buffer
18446 size if the message was truncated. (Bug#8545).
18447
b124fd93
JB
184482011-04-28 Juanma Barranquero <lekktu@gmail.com>
18449
18450 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18451 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18452
e810457d
PE
184532011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18454
18455 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18456
ea51cceb
JB
184572011-04-27 Juanma Barranquero <lekktu@gmail.com>
18458
18459 * makefile.w32-in: Update dependencies.
18460
94dcfacf
EZ
184612011-04-27 Eli Zaretskii <eliz@gnu.org>
18462
18463 Improve `doprnt' and its usage. (Bug#8545)
18464 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18465 `format_end'. Remove support for %l as a conversion specifier.
18466 Don't use xrealloc. Improve diagnostics when the %l size modifier
18467 is used. Update the commentary.
18468
18469 * eval.c (verror): Simplify calculation of size_t.
18470
18471 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18472 messages.
18473
f61f41d7
PE
184742011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18475
18476 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18477 change.
18478
96fb4434
PE
184792011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18480
18481 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18482 This makes this file independent of the recent pseudovector change.
18483
671875da 184842011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 18485
69e9b5a3
PE
18486 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18487
b5f869a7 18488 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 18489 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 18490 Remove unused local.
c8926152 18491 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 18492
841a1577 18493 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
18494 GCC 4.6.0 optimizes based on type-based alias analysis.
18495 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
18496 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18497 != &v->size, and therefore "v->size = 1; b->size = 2; return
18498 v->size;" must therefore return 1. This assumption is incorrect
18499 for Emacs, since it type-puns struct Lisp_Vector * with many other
18500 types. To fix this problem, this patch adds a new type struct
f904488f 18501 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
18502 and pseudovectors, and helps optimizing compilers not get fooled
18503 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18504 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
18505 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18506 the size member.
eab3844f
PE
18507 (XSETPVECTYPE): Rewrite in terms of new macro.
18508 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18509 This is a bit clearer, and further avoids the possibility of
18510 undesirable aliasing.
18511 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 18512 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
18513 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18514 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
18515 (ASIZE): Now uses header.size rather than size.
18516 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
18517 to avoid the hassle of writing XVECTOR (foo)->header.size.
18518 (struct vectorlike_header): New type.
eab3844f
PE
18519 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18520 object, to help avoid aliasing.
18521 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18522 (SUBRP): Likewise, since Lisp_Subr is a special case.
18523 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18524 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18525 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 18526 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
18527 changed to be "header.size" and "header.next".
18528 * buffer.h (struct buffer): Likewise.
18529 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18530 * frame.h (struct frame): Likewise.
18531 * process.h (struct Lisp_Process): Likewise.
18532 * termhooks.h (struct terminal): Likewise.
18533 * window.c (struct save_window_data, struct saved_window): Likewise.
18534 * window.h (struct window): Likewise.
18535 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18536 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18537 * buffer.c (init_buffer_once): Likewise.
18538 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18539 special case.
18540 * process.c (Fformat_network_address): Use local var for size,
18541 for brevity.
18542
0df1eac5
PE
18543 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18544
847ab9d1 18545 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
18546 * data.c (atof): Remove decl; no longer used or needed.
18547 (digit_to_number): Move to lread.c.
18548 (Fstring_to_number): Use new string_to_number function, to be
18549 consistent with how the Lisp reader treats infinities and NaNs.
18550 Do not assume that floating-point numbers represent EMACS_INT
18551 without losing information; this is not true on most 64-bit hosts.
18552 Avoid double-rounding errors, by insisting on integers when
18553 parsing non-base-10 numbers, as the documentation specifies.
18554 * lisp.h (string_to_number): New decl, replacing ...
18555 (isfloat_string): Remove.
bc0a5c13 18556 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 18557 (read1): Do not accept +. and -. as integers; this
452f4150
PE
18558 appears to have been a coding error. Similarly, do not accept
18559 strings like +-1e0 as floating point numbers. Do not report
18560 overflow for integer overflows unless the base is not 10 which
18561 means we have no simple and reliable way to continue.
18562 Break out the floating-point parsing into a new
18563 function string_to_number, so that Fstring_to_number parses
18564 floating point numbers consistently with the Lisp reader.
04f2d78b 18565 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
18566 (E_CHAR, EXP_INT): Remove, replacing with ...
18567 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18568 (string_to_number): New function, replacing isfloat_string.
18569 This function checks for valid syntax and produces the resulting
18570 Lisp float number too. Rework it so that string-to-number
bc0a5c13 18571 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
18572 so that overflow for non-base-10 numbers is reported only when
18573 there's no portable and simple way to convert to floating point.
452f4150 18574
67769ffc
PE
18575 * textprop.c (set_text_properties_1): Rewrite for clarity,
18576 and to avoid GCC warning about integer overflow.
18577
c20db43f
PE
18578 * intervals.h (struct interval): Use EMACS_INT for members
18579 where EMACS_UINT might cause problems. See
18580 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18581 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18582 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18583 All uses changed.
37aa2f85
PE
18584 (offset_intervals): Tell GCC not to worry about length overflow
18585 when negating a negative length.
c20db43f 18586
2538aa2f
PE
18587 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18588 (overrun_check_free): Likewise.
18589
f2d3008d
PE
18590 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18591 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18592 word size.
18593
ec8df744
PE
18594 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18595 (gnutls_make_error): Rename local to avoid shadowing.
18596 (gnutls_emacs_global_deinit): ifdef out; not used.
18597 (Fgnutls_boot): Use const for pointer to readonly storage.
18598 Comment out unused local. Fix pointer signedness problems.
18599
640ee02d
PE
18600 * lread.c (openp): Don't stuff size_t into an 'int'.
18601 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18602 about possible signed overflow.
18603
6048fb2a
PE
18604 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18605 (GDK_KEY_g): Don't define if already defined.
18606 (xg_prepare_tooltip): Avoid pointer signedness problem.
18607 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18608
fa3c87e1
PE
18609 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18610 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18611
2172544b
PE
18612 * xfns.c (Fx_window_property): Simplify a bit,
18613 to make a bit faster and to avoid GCC 4.6.0 warning.
18614 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18615
9b821a21
PE
18616 * fns.c (internal_equal): Don't assume size_t fits in int.
18617
3c616cfa
PE
18618 * alloc.c (compact_small_strings): Tighten assertion a little.
18619
c2982e87
PE
18620 Replace pEd with more-general pI, and fix some printf arg casts.
18621 * lisp.h (pI): New macro, generalizing old pEd macro to other
18622 conversion specifiers. For example, use "...%"pI"d..." rather
18623 than "...%"pEd"...".
18624 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 18625 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
18626 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18627 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18628 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18629 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18630 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18631 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18632 64-bit hosts.
18633 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18634 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18635 * print.c (safe_debug_print, print_object): Likewise.
18636 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18637 to int.
6f04d126
PE
18638 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18639 avoiding the 0 flag, which is not portable.
c2982e87
PE
18640 * process.c (Fmake_network_process): Use pI to avoid cast.
18641 * region-cache.c (pp_cache): Likewise.
18642 * xdisp.c (decode_mode_spec): Likewise.
18643 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18644 behavior on 64-bit hosts with printf arg.
6f04d126 18645 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
18646 (x_stop_queuing_selection_requests): Likewise.
18647 (x_get_window_property): Don't truncate byte count to an 'int'
18648 when tracing.
0b432f21 18649
5e073ec7
PE
18650 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18651 here, since it parses constructs like leading '-' and spaces,
18652 which are not wanted; and it overflows with large numbers.
18653 Instead, simply match F[0-9]+, which is what is wanted anyway.
18654
36372bf9
PE
18655 * alloc.c: Remove unportable assumptions about struct layout.
18656 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18657 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18658 (allocate_vectorlike, make_pure_vector): Use the new macros,
18659 plus offsetof, to remove unportable assumptions about struct layout.
18660 These assumptions hold on all porting targets that I know of, but
18661 they are not guaranteed, they're easy to remove, and removing them
18662 makes further changes easier.
18663
0b432f21
PE
18664 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18665 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
18666 (string_overrun_cookie): Now const. Use initializers that
18667 don't formally overflow signed char, to avoid warnings.
000098c1
PE
18668 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18669 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
18670 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18671 multiple of sizeof (EMACS_INT); it need not be, if
18672 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 18673 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 18674
895009e1
JB
186752011-04-26 Juanma Barranquero <lekktu@gmail.com>
18676
18677 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18678
6a7a1b0b
TZ
186792011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18680
18681 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 18682 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
18683 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18684
841a1577 186852011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
18686
18687 * lisp.h (Qdebug): List symbol.
895009e1 18688 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
18689 * keyboard.c (debug-on-event): New variable.
18690 (handle_user_signal): Break into debugger when debug-on-event
18691 matches the current signal symbol.
18692
f2d3ba6f
DN
186932011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18694
18695 * alloc.c (check_sblock, check_string_bytes)
18696 (check_string_free_list): Convert to standard C.
18697
42ce4c63
TZ
186982011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18699
18700 * w32.c (emacs_gnutls_push): Fix typo.
18701
825cd63c
EZ
187022011-04-25 Eli Zaretskii <eliz@gnu.org>
18703
fb11d64d
EZ
18704 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18705 "cast to pointer from integer of different size".
18706
825cd63c
EZ
18707 Improve doprnt and its use in verror. (Bug#8545)
18708 * doprnt.c (doprnt): Document the set of format control sequences
18709 supported by the function. Use SAFE_ALLOCA instead of always
18710 using `alloca'.
18711
18712 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18713 is one byte too soon. Don't use xrealloc; instead xfree and
18714 xmalloc anew.
18715
e061a11b
TZ
187162011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18717
18718 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18719 callbacks stage.
18720
18721 * gnutls.c: Renamed global_initialized to
18722 gnutls_global_initialized. Added internals for the
18723 :verify-hostname-error, :verify-error, and :verify-flags
18724 parameters of `gnutls-boot' and documented those parameters in the
18725 docstring. Start callback support.
9173deec
JB
18726 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18727 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18728 on error. Return error code.
e061a11b
TZ
18729 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18730 (emacs_gnutls_read): Likewise.
18731 (Fgnutls_boot): Return handshake error code.
18732 (emacs_gnutls_handle_error): New function.
18733 (wsaerror_to_errno): Likewise.
18734
18735 * w32.h (emacs_gnutls_pull): Add prototype.
18736 (emacs_gnutls_push): Likewise.
18737
18738 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18739 (emacs_gnutls_push): Likewise.
18740
187412011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18742
18743 * process.c (wait_reading_process_output): Check if GnuTLS
18744 buffered some data internally if no FDs are set for TLS
18745 connections.
18746
18747 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18748 (LIBS): Link to USER_LIBS.
18749 ($(BLD)/gnutls.$(0)): New target.
18750
fa6996bc
EZ
187512011-04-24 Eli Zaretskii <eliz@gnu.org>
18752
eb35682e
EZ
18753 * xdisp.c (handle_single_display_spec): Rename the
18754 display_replaced_before_p argument into display_replaced_p, to
18755 make it consistent with the commentary. Fix typos in the
18756 commentary.
18757
e2ad650c
EZ
18758 * textprop.c (syms_of_textprop): Remove dead code.
18759 (copy_text_properties): Delete obsolete commentary about an
18760 interface that was deleted long ago. Fix typos in the description
18761 of arguments.
18762
1b2de274
EZ
18763 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18764 to changes in oldXMenu/XMenu.h from 2011-04-16.
18765 <menu_help_message, prev_menu_help_message>: Constify.
18766 (IT_menu_make_room): menu->help_text is now `const char **';
18767 adjust.
18768
18769 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18770 to changes in oldXMenu/XMenu.h from 2011-04-16.
18771 (struct XMenu): Declare `help_text' `const char **'.
18772
18773 * xfaces.c <Qunspecified>: Make extern again.
18774
18775 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 18776 required by POSIX.
1b2de274 18777
762b15be
EZ
18778 * doc.c (get_doc_string): Improve the format passed to `error'.
18779
18780 * doprnt.c (doprnt): Improve commentary.
18781
18782 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18783
18784 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18785 them with etags.
18786
f1052e5d
EZ
18787 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18788 changes in globals.h immediately force recompilation.
762b15be
EZ
18789 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18790 $(CURDIR)/s/ms-w32.h.
18791 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 18792
fa6996bc
EZ
18793 * character.c (Fchar_direction): Function deleted.
18794 (syms_of_character): Don't defsubr it.
18795 <char-direction-table>: Deleted.
18796
e6c3da20
EZ
187972011-04-23 Eli Zaretskii <eliz@gnu.org>
18798
18799 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18800 * doprnt.c: Include limits.h.
18801 (SIZE_MAX): New macro.
04f2d78b
CB
18802 (doprnt): Return a size_t value. 2nd arg is now size_t.
18803 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
18804 Improve overflow protection. Support `l' modifier for integer
18805 conversions. Support %l conversion. Don't assume an EMACS_INT
18806 argument for integer conversions and for %c.
18807
18808 * lisp.h (doprnt): Restore prototype.
18809
18810 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18811 $(SRC)/character.h.
18812
18813 * Makefile.in (base_obj): Add back doprnt.o.
18814
18815 * deps.mk (doprnt.o): Add back prerequisites.
18816 (callint.o): Depend on character.h.
18817
18818 * eval.c (internal_lisp_condition_case): Include the handler
18819 representation in the error message.
18820 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18821 when breaking from the loop.
18822
18823 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18824
18825 * callint.c (Fcall_interactively): When displaying error message
18826 about invalid control letter, pass the character's codepoint, not
18827 a pointer to its multibyte form. Improve display of the character
18828 in octal and display also its hex code.
18829
18830 * character.c (char_string): Use %x to display the (unsigned)
18831 codepoint of an invalid character, to avoid displaying a bogus
18832 negative value.
18833
18834 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18835 `error', not SYMBOL_NAME itself.
18836
18837 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18838 character arguments to `error'.
18839
18840 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18841 to `error' in error message about FINAL_CHAR argument. Make sure
18842 FINAL_CHAR is a character, and use %c when it is passed as
18843 argument to `error'.
18844
4ffd0d6b 188452011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
18846
18847 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18848
18849 * w32.c: Include <time.h>.
18850 (sys_localtime): New function.
18851
4ffd0d6b 188522011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
18853
18854 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18855
4ffd0d6b 18856 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 18857
4ffd0d6b 188582011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 18859
4ffd0d6b
GM
18860 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18861 zombies (Bug#8467).
aac0c6e3 18862
04c56954
EZ
188632011-04-19 Eli Zaretskii <eliz@gnu.org>
18864
18865 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18866 gl_state.e_property when gl_state.object is Qt.
18867
18868 * insdel.c (make_gap_larger): Remove limitation of buffer size
18869 to <= INT_MAX.
18870
16a43933
CY
188712011-04-18 Chong Yidong <cyd@stupidchicken.com>
18872
18873 * xdisp.c (lookup_glyphless_char_display)
18874 (produce_glyphless_glyph): Handle cons cell entry in
18875 glyphless-char-display.
18876 (Vglyphless_char_display): Document it.
18877
18878 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18879 glyphless-char-display.
18880
4581706e
CY
188812011-04-17 Chong Yidong <cyd@stupidchicken.com>
18882
18883 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18884
18885 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18886
18887 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18888 definition for no-X builds.
18889
4887c6e2 188902011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 18891
fd35b6f9
PE
18892 Static checks with GCC 4.6.0 and non-default toolkits.
18893
5c1ccb01
PE
18894 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18895
006c5daa
PE
18896 * process.c (keyboard_bit_set): Define only if SIGIO.
18897 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18898 (send_process): Repair possible setjmp clobbering.
18899
efc736d3
PE
18900 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18901
4e2fe2e6
PE
18902 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18903
f97334a2
PE
18904 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18905
4e75f29d
PE
18906 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18907 Define only if needed.
18908
90efadd1
PE
18909 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18910 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 18911 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 18912
3c647824
PE
18913 * dispextern.h (struct redisplay_interface): Rename param
18914 to avoid shadowing.
e264f262 18915 * termhooks.h (struct terminal): Likewise.
761383f4 18916 * xterm.c (xembed_send_message): Likewise.
3c647824 18917
b58c5c4a
PE
18918 * insdel.c (make_gap_smaller): Define only if
18919 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18920
cad59032
PE
18921 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18922 it.
18923
c339dc2e
PE
18924 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18925 so that we aren't warned about unused symbols.
18926
91a3e27b
PE
18927 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18928
399c71d3 18929 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 18930
8ffc96f5
PE
18931 * xfns.c (x_real_positions): Mark locals as initialized.
18932
eef9bc79
PE
18933 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18934
098db9dd
PE
18935 * xterm.c: Fix problems found by static analysis with other toolkits.
18936 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
18937 (x_dispatch_event): Declare static if USE_GTK, and
18938 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 18939 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 18940 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
18941 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18942 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 18943
eb18f6cc
PE
18944 * xmenu.c (menu_help_callback): Pointer type fixes.
18945 Use const pointers when pointing at readonly data. Avoid pointer
18946 signedness clashes.
18947 (FALSE): Remove unused macro.
18948 (update_frame_menubar): Remove unused decl.
18949
1fe72bf8
PE
18950 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18951
60d9e1db
PE
18952 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18953 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18954 (single_menu_item): Rename local to avoid shadowing.
18955
39261c26
PE
18956 * keyboard.c (make_lispy_event): Remove unused local var.
18957
018c5e19
PE
18958 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18959 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18960
63d2b86e
PE
18961 * bitmaps: Change bitmaps from unsigned char back to the X11
18962 compatible char. Avoid the old compiler warnings about
18963 out-of-range initializers by using, for example, '\xab' rather
18964 than 0xab.
18965
aefd87e1
PE
18966 * xgselect.c (xgselect_initialize): Check vs interface
18967 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18968
bf501fb9
PE
18969 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18970
e9829fdf
PE
18971 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18972 to read-only memory.
18973
1086c095
PE
18974 * fns.c (vector): Remove; this old hack is no longer needed.
18975
2baccd04 18976 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 18977 Remove unused var.
dde42981 18978 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 18979
72391843 18980 * xrdb.c (x_load_resources): Omit unused local.
3565b346 18981
436c16df 18982 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 18983 (x_window): Rename locals to avoid shadowing.
dc5ddd85 18984 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 18985
92bb796d 18986 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 18987 (x_term_init): Remove local to avoid shadowing.
92bb796d 18988
764430a3 18989 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
18990
18991 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18992 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18993
d1dfb56c
EZ
189942011-04-16 Eli Zaretskii <eliz@gnu.org>
18995
c4354cb4
EZ
18996 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18997
d1dfb56c
EZ
18998 Fix regex.c, syntax.c and friends for buffers > 2GB.
18999 * syntax.h (struct gl_state_s): Declare character position members
19000 EMACS_INT.
19001
19002 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
19003
04f2d78b
CB
19004 * textprop.c (verify_interval_modification, interval_of):
19005 Declare arguments EMACS_INT.
d1dfb56c
EZ
19006
19007 * intervals.c (adjust_intervals_for_insertion): Declare arguments
19008 EMACS_INT.
19009
19010 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
19011
19012 * indent.c (Fvertical_motion): Local variable it_start is now
19013 EMACS_INT.
19014
19015 * regex.c (re_match, re_match_2, re_match_2_internal)
19016 (bcmp_translate, regcomp, regexec, print_double_string)
19017 (group_in_compile_stack, re_search, re_search_2, regex_compile)
19018 (re_compile_pattern, re_exec): Declare arguments and local
19019 variables `size_t' and `ssize_t' and return values `regoff_t', as
19020 appropriate.
19021 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
19022 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
19023 <compile_stack_type>: `size' and `avail' are now `size_t'.
19024
19025 * regex.h <regoff_t>: Use ssize_t, not int.
19026 (re_search, re_search_2, re_match, re_match_2): Arguments that
19027 specify buffer/string position and length are now ssize_t and
19028 size_t. Return type is regoff_t.
19029
613052cd
BK
190302011-04-16 Ben Key <bkey76@gmail.com>
19031
19032 * nsfont.m: Fixed bugs in ns_get_family and
19033 ns_descriptor_to_entity that were caused by using free to
19034 deallocate memory blocks that were allocated by xmalloc (via
19035 xstrdup). This caused Emacs to crash when compiled with
19036 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
19037 --enable-checking=xmallocoverrun). xfree is now used to
19038 deallocate these memory blocks.
19039
4170f62f 190402011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 19041
71b41406
PE
19042 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
19043
9587a89d
PE
19044 emacs_write: Accept and return EMACS_INT for sizes.
19045 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
19046 et seq.
19047 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
19048 Accept and return EMACS_INT.
19049 (emacs_gnutls_write): Return the number of bytes written on
19050 partial writes.
19051 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
19052 (emacs_read, emacs_write): Remove check for negative size, as the
19053 Emacs source code has been audited now.
9587a89d
PE
19054 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
19055 (emacs_read, emacs_write): Use it.
273a5f82
PE
19056 * process.c (send_process): Adjust to the new signatures of
19057 emacs_write and emacs_gnutls_write. Do not attempt to store
19058 a byte offset into an 'int'; it might overflow.
9587a89d 19059 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 19060
3e047f51
PE
19061 * sound.c: Don't assume sizes fit in 'int'.
19062 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 19063 Return EMACS_INT, not int.
3e047f51 19064 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
19065 Accept EMACS_INT, not int.
19066 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
19067 record read return values.
19068
cc39a9db
BK
190692011-04-15 Ben Key <bkey76@gmail.com>
19070
c9d0ec6d
JB
19071 * keyboard.c (Qundefined): Don't declare static since it is used
19072 in nsfns.m.
19073 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
19074 static since they are used in nsfont.m.
cc39a9db 19075
6c60eb9f
SM
190762011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
19077
19078 * process.c (Qprocessp): Don't declare static.
19079 * lisp.h (Qprocessp): Declare again.
19080
7990b61a
JB
190812011-04-15 Juanma Barranquero <lekktu@gmail.com>
19082
19083 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
19084
5d4cb038
PE
190852011-04-14 Paul Eggert <eggert@cs.ucla.edu>
19086
8bd7b830 19087 Improve C-level modularity by making more things 'static'.
cd64ea1d 19088
e3b27b31
PE
19089 Don't publish debugger-only interfaces to other modules.
19090 * lisp.h (safe_debug_print, debug_output_compilation_hack):
19091 (verify_bytepos, count_markers): Move decls to the only modules
19092 that need them.
19093 * region-cache.h (pp_cache): Likewise.
19094 * window.h (check_all_windows): Likewise.
19095 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
19096
5d4cb038
PE
19097 * sysdep.c (croak): Now static, if
19098 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
19099 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
19100
19101 * alloc.c (refill_memory_reserve): Now static if
19102 !defined REL_ALLOC || defined SYSTEM_MALLOC.
19103 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 19104
e87b6180
PE
19105 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
19106 Define only if USE_LUCID.
19107
ac64929e
PE
19108 * xrdb.c (x_customization_string, x_rm_string): Now static.
19109
6f37259d
PE
19110 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
19111 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
19112
1683e3ab
PE
19113 * xdisp.c (draw_row_with_mouse_face): Now static.
19114 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
19115
de9c2632
PE
19116 * window.h (check_all_windows): Mark externally visible.
19117
2b96acb7
PE
19118 * window.c (window_deletion_count): Now static.
19119
19120 * undo.c: Make symbols static if they're not exported.
19121 (last_undo_buffer, last_boundary_position, pending_boundary):
19122 Now static.
19123
50436f33
PE
19124 * textprop.c (interval_insert_behind_hooks): Now static.
19125 (interval_insert_in_front_hooks): Likewise.
19126
64520e5c
PE
19127 * term.c: Make symbols static if they're not exported.
19128 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
19129 (max_frame_lines, tty_set_terminal_modes):
19130 (tty_reset_terminal_modes, tty_turn_off_highlight):
19131 (get_tty_terminal): Now static.
19132 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
19133 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 19134 HAVE_WINDOW_SYSTEM.
64520e5c
PE
19135 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
19136 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
19137
1fa53021
PE
19138 * sysdep.c: Make symbols static if they're not exported.
19139 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
19140 Now static.
19141 (sigprocmask_set, full_mask): Remove; unused.
19142 (wait_debugging): Mark as visible.
19143 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
19144 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
19145
d4b43b22
PE
19146 * syntax.c (syntax_temp): Define only if !__GNUC__.
19147
b7c513d0
PE
19148 * sound.c (current_sound_device, current_sound): Now static.
19149
989b29ad
PE
19150 * search.c (searchbufs, searchbuf_head): Now static.
19151
13a55a78
PE
19152 * scroll.c (scroll_cost): Remove; unused.
19153 * dispextern.h (scroll_cost): Remove decl.
19154
de68a1fc
PE
19155 * region-cache.h (pp_cache): Mark as externally visible.
19156
40ccffa6
PE
19157 * process.c: Make symbols static if they're not exported.
19158 (process_tick, update_tick, create_process, chan_process):
19159 (Vprocess_alist, proc_buffered_char, datagram_access):
19160 (fd_callback_data, send_process_frame, process_sent_to): Now static.
19161 (deactivate_process): Mark defn as static, as well as decl.
19162 * lisp.h (create_process): Remove decl.
19163 * process.h (chan_process, Vprocess_alist): Remove decls.
19164
ad64fc97
PE
19165 * print.c: Make symbols static if they're not exported.
19166 (print_depth, new_backquote_output, being_printed, print_buffer):
19167 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
19168 (print_interval, print_number_index, initial_stderr_stream):
19169 Now static.
19170 * lisp.h (Fprinc): Remove decl.
19171 (debug_output_compilation_hack): Mark as externally visible.
19172
adddb265
PE
19173 * sysdep.c (croak): Move decl from here to syssignal.h.
19174 * syssignal.h (croak): Put it here, so the API can be checked when
19175 'croak' is called from dissociate_if_controlling_tty.
19176
1717ede2
PE
19177 * minibuf.c: Make symbols static if they're not exported.
19178 (minibuf_save_list, choose_minibuf_frame): Now static.
19179 * lisp.h (choose_minibuf_frame): Remove decl.
19180
fa5fb2bc
PE
19181 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
19182
1e3890d1
PE
19183 * lread.c: Make symbols static if they're not exported.
19184 (read_objects, initial_obarray, oblookup_last_bucket_number):
19185 Now static.
19186 (make_symbol): Remove; unused.
19187 * lisp.h (initial_obarray, make_symbol): Remove decls.
19188
8a1414fa
PE
19189 * keyboard.c: Make symbols static if they're not exported.
19190 (single_kboard, recent_keys_index, total_keys, recent_keys):
19191 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
19192 (this_single_command_key_start, echoing, last_auto_save):
19193 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
19194 (command_loop, echo_now, keyboard_init_hook, help_char_p):
19195 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
19196 (Vlispy_mouse_stem, double_click_count):
19197 Now static.
19198 (force_auto_save_soon): Define only if SIGDANGER.
19199 (ignore_mouse_drag_p): Now static if
19200 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
19201 (print_help): Remove; unused.
19202 (stop_character, last_timer_event): Mark as externally visible.
19203 * keyboard.h (ignore_mouse_drag_p): Declare only if
19204 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
19205 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
19206 * lisp.h (echoing): Remove decl.
19207 (force_auto_save_soon): Declare only if SIGDANGER.
19208 * xdisp.c (redisplay_window): Simplify code, to make it more
19209 obvious that ignore_mouse_drag_p is not accessed if !defined
19210 USE_GTK && !defined HAVE_NS.
19211
93ea6e8f
PE
19212 * intervals.c: Make symbols static if they're not exported.
19213 (merge_properties_sticky, merge_interval_right, delete_interval):
19214 Now static.
19215 * intervals.h (merge_interval_right, delete_interval): Remove decls.
19216
77382fcc
PE
19217 * insdel.c: Make symbols static if they're not exported.
19218 However, leave prepare_to_modify_buffer alone. It's never
19219 called from outside this function, but that appears to be a bug.
19220 (combine_after_change_list, combine_after_change_buffer):
4889fc82 19221 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
19222 (adjust_after_replace_noundo): Remove; unused.
19223 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 19224 (signal_before_change): Remove decls.
77382fcc 19225
9306c32e
PE
19226 * indent.c (val_compute_motion, val_vmotion): Now static.
19227
cd44d2eb
PE
19228 * image.c: Make symbols static if they're not exported.
19229 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
19230 if USE_GTK.
19231 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
19232 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
19233
ad9a7a06
PE
19234 * fringe.c (standard_bitmaps): Now static.
19235 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
19236
81626931
PE
19237 * frame.c: Make symbols static if they're not exported.
19238 (x_report_frame_params, make_terminal_frame): Now static.
19239 (get_frame_param): Now static, unless HAVE_NS.
19240 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
19241 (x_get_resource_string): Remove; not used.
19242 * frame.h (make_terminal_frame, x_report_frame_params):
19243 (x_get_resource_string); Remove decls.
19244 (x_fullscreen_adjust): Declare only if WINDOWSNT.
19245 * lisp.h (get_frame_param): Declare only if HAVE_NS.
19246
239f9db9
PE
19247 * font.c, fontset.c: Make symbols static if they're not exported.
19248 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
19249 (FACE_SUITABLE_FOR_CHAR_P): Use it.
19250 * font.c (font_close_object): Now static.
19251 * font.h (font_close_object): Remove.
19252 * fontset.c (FONTSET_OBJLIST): Remove.
19253 (free_realized_fontset) #if-0 the body, which does nothing.
19254 (face_suitable_for_char_p): #if-0, as it's never called.
19255 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
19256 * xfaces.c (face_at_string_position):
19257 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
19258 since 0 is always ASCII.
19259
dfcf3579
PE
19260 * fns.c (weak_hash_tables): Now static.
19261
5045092b
PE
19262 * fileio.c: Make symbols static if they're not exported.
19263 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
19264 (Vwrite_region_annotation_buffers): Now static.
19265
57a96f5c
PE
19266 * eval.c: Make symbols static if they're not exported.
19267 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
19268 * lisp.h (backtrace_list): Remove decl.
19269
35f08c38
PE
19270 * emacs.c: Make symbols static if they're not exported.
19271 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
19272 (fatal_error_code, fatal_error_signal_hook, standard_args):
19273 Now static.
19274 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
19275 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
19276 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
19277 * lisp.h (fatal_error_signal_hook): Remove decl.
19278 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
19279
f44bd759
PE
19280 * editfns.c: Move a (normally-unused) function to its only use.
19281 * editfns.c, lisp.h (get_operating_system_release): Remove.
19282 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
19283 worth the hassle of breaking this out.
19284
b532497d
PE
19285 * xterm.c: Make symbols static if they're not exported.
19286 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
19287 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
19288 (x_destroy_window, x_delete_display):
19289 Now static.
19290 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
19291 (x_mouse_leave): Remove; unused.
19292 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
19293 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
19294 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
19295 Remove decls.
19296 (x_mouse_leave): Declare only if WINDOWSNT.
19297 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
19298 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
19299 USE_X_TOOLKIT.
19300
1675728f
PE
19301 * ftxfont.c: Make symbols static if they're not exported.
19302 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
19303 HAVE_FREETYPE.
19304 * font.h (ftxfont_driver): Likewise.
19305
e4cebfca
PE
19306 * xfns.c: Make symbols static if they're not exported.
19307 (x_last_font_name, x_display_info_for_name):
19308 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
19309 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
19310 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
19311 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
19312 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
19313 (last_show_tip_args): Now static.
19314 (xic_defaut_fontset, xic_create_fontsetname): Define only if
19315 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
19316 (x_screen_planes): Remove; unused.
19317 * dispextern.h (x_screen_planes): Remove decl.
19318
5bf46f05
PE
19319 * dispnew.c: Make symbols static if they're not exported.
19320 * dispextern.h (redraw_garbaged_frames, scrolling):
19321 (increment_row_positions): Remove.
19322 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
19323 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
19324 Now static.
19325 (redraw_garbaged_frames): Remove; unused.
19326
435f4c28
PE
19327 * xfaces.c: Make symbols static if they're not exported.
19328 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
19329 Remove decls.
19330 * xterm.h (defined_color): Remove decls.
19331 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
19332 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
19333 (menu_face_changed_default, defined_color, free_realized_face):
19334 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
19335 (ascii_face_of_lisp_face): Remove; unused.
19336
8524aef3
PE
19337 * xdisp.c: Make symbols static if they're not exported.
19338 * dispextern.h (scratch_glyph_row, window_box_edges):
19339 (glyph_to_pixel_coords, set_cursor_from_row):
19340 (get_next_display_element, set_iterator_to_next):
19341 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
19342 (show_mouse_face): Remove decls
19343 * frame.h (message_buf_print): Likewise.
19344 * lisp.h (pop_message, set_message, check_point_in_composition):
19345 Likewise.
19346 * xterm.h (set_vertical_scroll_bar): Likewise.
19347 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
19348 (message_buf_print, scratch_glyph_row, displayed_buffer):
19349 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
19350 (get_next_display_element, show_mouse_face, window_box_edges):
19351 (frame_to_window_pixel_xy, check_point_in_composition):
19352 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
19353 (glyph_to_pixel_coords): Remove; unused.
19354
16390cd2
PE
19355 * dired.c (file_name_completion): Now static.
19356
19357 * dbusbind.c (xd_in_read_queued_messages): Now static.
19358
a25f4dfa
PE
19359 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19360 * data.c (circular_list_error): Remove.
19361
14a9c8df
PE
19362 * commands.h (last_point_position, last_point_position_buffer):
19363 (last_point_position_window): Remove decls.
19364 * keyboard.c: Make these variables static.
19365
04f2d78b
CB
19366 * coding.h (coding, code_convert_region, encode_coding_gap):
19367 Remove decls.
74ab6df5
PE
19368 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19369 (iso_code_class, detect_coding, code_convert_region): Now static.
19370 (encode_coding_gap): Remove; unused.
19371
38dfbee1
PE
19372 * chartab.c (chartab_chars, chartab_bits): Now static.
19373
a2cb4e63
PE
19374 * charset.h (charset_iso_8859_1): Remove decl.
19375 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19376 Now static.
19377
127198fd
PE
19378 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19379 * ccl.c (Vccl_program_table): Now static.
19380 (check_ccl_update): Remove; unused.
19381
d85b608f
PE
19382 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19383 * category.h: ... from here.
19384 * category.c (check_category_table, set_category_set): Now static.
19385
31cd66f3
PE
19386 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19387 * lisp.h: Remove these decls.
19388
c358e587
PE
19389 * buffer.c (buffer_count): Remove unused var.
19390
e78aecca
PE
19391 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19392 so that it's not optimized away.
19393 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19394 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19395 exported only to the debugger.
19396
e192d7d3 19397 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 19398 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 19399
92470028
PE
19400 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19401 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19402 was inaccessible from Lisp.
19403 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19404 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19405
244ed907
PE
19406 alloc.c: Import and export fewer symbols, and remove unused items.
19407 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19408 is defined.
19409 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19410 it's not optimized away by whole-program optimization.
19411 (message_enable_multibyte, free_misc): Remove.
19412 (catchlist, handlerlist, mark_backtrace):
19413 Declare only if BYTE_MARK_STACK.
19414 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19415 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19416 (message_enable_multibyte): Remove decl.
19417 (free_misc, interval_free_list, float_block, float_block_index):
19418 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19419 (cons_free_list, last_marked_index):
19420 Now static.
19421 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19422 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19423 (mark_backtrace): Define only if BYTE_MARK_STACK.
19424 * xdisp.c (message_enable_multibyte): Now static.
19425
61c2b50e 19426 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
19427 This makes it easier for human readers (and static analyzers)
19428 to see whether these variables are used from other modules.
19429 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19430 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19431 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19432 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19433 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19434 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19435 * xmenu.c, xselect.c:
19436 Declare Q* vars static if they are not used in other modules.
19437 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19438 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19439 Remove decls of unexported vars.
19440 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19441
95c82688
PE
19442 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19443
16a97296
PE
19444 Make Emacs functions such as Fatom 'static' by default.
19445 This makes it easier for human readers (and static analyzers)
19446 to see whether these functions can be called from other modules.
19447 DEFUN now defines a static function. To make the function external
19448 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
19449 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19450 (Finit_image_library):
16a97296
PE
19451 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19452 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19453 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19454 Remove decls, since these functions are now static.
19455 (Funintern, Fget_internal_run_time): New decls, since these functions
19456 were already external.
95c82688 19457
16a97296
PE
19458 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19459 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19460 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19461 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19462 * keyboard.c, keymap.c, lread.c:
19463 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19464 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19465 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19466 Mark functions with DEFUE instead of DEFUN,
19467 if they are used in other modules.
19468 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19469 decls for now-static functions.
19470 * buffer.h (Fdelete_overlay): Remove decl.
19471 * callproc.c (Fgetenv_internal): Mark as internal.
19472 * composite.c (Fremove_list_of_text_properties): Remove decl.
19473 (Fcomposition_get_gstring): New forward static decl.
19474 * composite.h (Fcomposite_get_gstring): Remove decl.
19475 * dired.c (Ffile_attributes): New forward static decl.
19476 * doc.c (Fdocumntation_property): New forward static decl.
19477 * eval.c (Ffetch_bytecode): New forward static decl.
19478 (Funintern): Remove extern decl; now in .h file where it belongs.
19479 * fileio.c (Fmake_symbolic_link): New forward static decl.
19480 * image.c (Finit_image_library): New forward static decl.
19481 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19482 * intervals.h (Fprevious_property_change):
19483 (Fremove_list_of_text_properties): Remove decls.
19484 * keyboard.c (Fthis_command_keys): Remove decl.
19485 (Fcommand_execute): New forward static decl.
19486 * keymap.c (Flookup_key): New forward static decl.
19487 (Fcopy_keymap): Now static.
19488 * keymap.h (Flookup_key): Remove decl.
19489 * process.c (Fget_process): New forward static decl.
19490 (Fprocess_datagram_address): Mark as internal.
19491 * syntax.c (Fsyntax_table_p): New forward static decl.
19492 (skip_chars): Remove duplicate decl.
19493 * textprop.c (Fprevious_property_change): New forward static decl.
19494 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19495 Now internal.
19496 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19497 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19498
785bbd42
PE
19499 * editfns.c (Fformat): Remove unreachable code.
19500
8b913b57
AS
195012011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19502
19503 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19504 change. (Bug#8496)
19505
a6744a35
EZ
195062011-04-13 Eli Zaretskii <eliz@gnu.org>
19507
19508 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19509 when at ZV. (Bug#8487)
19510
e7974947
AS
195112011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19512
baad03f0
AS
19513 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19514 (Bug#8437)
19515 * keyboard.c (parse_tool_bar_item): Likewise.
19516 * sound.c (sound_cleanup, alsa_close): Likewise.
19517 * termcap.c (tgetent): Likewise.
19518 * xfns.c (x_default_font_parameter): Likewise.
19519 * xsettings.c (read_and_apply_settings): Likewise.
19520
e7974947
AS
19521 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19522 (overrun_check_free): Protoize.
19523
28272684
PE
195242011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19525
19526 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19527 since callers should never pass a negative size.
19528 Change the signature to match that of plain 'read' and 'write'; see
19529 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19530 * lisp.h: Update prototypes of emacs_write and emacs_read.
19531
11997c76
EZ
195322011-04-11 Eli Zaretskii <eliz@gnu.org>
19533
19534 * xdisp.c (redisplay_window): Don't try to determine the character
19535 position of the scroll margin if the window start point w->startp
e896f03c 19536 is outside the buffer's accessible region. (Bug#8468)
11997c76 19537
8a2cbd72
EZ
195382011-04-10 Eli Zaretskii <eliz@gnu.org>
19539
19540 Fix write-region and its subroutines for buffers > 2GB.
19541 * fileio.c (a_write, e_write): Modify declaration of arguments and
19542 local variables to support buffers larger than 2GB.
19543 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19544
19545 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19546 argument, local variables, and return value.
19547
19548 * lisp.h: Update prototypes of emacs_write and emacs_read.
19549
19550 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19551
4073e537 195522011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 19553
1ebfdcb6
PE
19554 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19555
b2ded58d
PE
19556 Fix more problems found by GCC 4.6.0's static checks.
19557
7d66342c
PE
19558 * xdisp.c (vmessage): Use a better test for character truncation.
19559
bbf47d44
PE
19560 * charset.c (load_charset_map): <, not <=, for optimization,
19561 and to avoid potential problems with integer overflow.
9248994d 19562 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 19563 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 19564 * editfns.c (Fformat): Likewise.
1e69125e 19565 * syntax.c (skip_chars): Likewise.
3befa583 19566
e3019616
PE
19567 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19568 This also lets GCC 4.6.0 generate slightly better loop code.
19569
becfa255
PE
19570 * callint.c (Fcall_interactively): <, not <=, for optimization.
19571 (Fcall_interactively): Count the number of arguments produced,
19572 not the number of arguments given. This is simpler and lets GCC
19573 4.6.0 generate slightly better code.
19574
dae0cd48
PE
19575 * ftfont.c: Distingish more carefully between FcChar8 and char.
19576 The previous code passed unsigned char * to a functions like
19577 strlen and xstrcasecmp that expect char *, which does not
19578 conform to the C standard.
19579 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19580 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19581 char * when the C standard requires it.
19582
76032d70
PE
19583 * keyboard.c (read_char): Remove unused var.
19584
eb3f1cc8
PE
19585 * eval.c: Port to Windows vsnprintf (Bug#8435).
19586 Include <limits.h>.
19587 (SIZE_MAX): Define if the headers do not.
19588 (verror): Do not give up if vsnprintf returns a negative count.
19589 Instead, grow the buffer. This ports to Windows vsnprintf, which
19590 does not conform to C99. Problem reported by Eli Zaretskii.
19591 Also, simplify the allocation scheme, by avoiding the need for
19592 calling realloc, and removing the ALLOCATED variable.
19593
70476b54
PE
19594 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19595
12020a9e
PE
19596 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19597 But keep the doprint source code for now, as we might revamp it
19598 and use it again (Bug#8435).
ea6c7ae6
PE
19599 * lisp.h (doprnt): Remove.
19600 * Makefile.in (base_obj): Remove doprnt.o.
19601 * deps.mk (doprnt.o): Remove.
19602
5fdb398c
PE
19603 error: Print 32- and 64-bit integers portably (Bug#8435).
19604 Without this change, on typical 64-bit hosts error ("...%d...", N)
19605 was used to print both 32- and 64-bit integers N, which relied on
19606 undefined behavior.
61bdb816 19607 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
19608 * lisp.h (error, verror): Mark as printf-like functions.
19609 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19610 Report overflow in size calculations when allocating printf buffer.
19611 Do not truncate output string at its first null byte.
19612 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19613 Truncate the output at a character boundary, since vsnprintf does not
19614 do that.
19615 * charset.c (check_iso_charset_parameter): Convert internal
19616 character to string before calling 'error', since %c now has the
19617 printf meaning.
19618 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19619 overflow when computing char to be passed to 'error'. Do not
19620 pass Lisp_Object to 'error'; pass the integer instead.
19621 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19622 formatted with plain %d.
19623
b189fa66
PE
19624 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19625
bff87ef0
PE
19626 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19627
7e2cac20
PE
19628 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19629
ce4d90b5
PE
19630 * xterm.c (x_catch_errors): Remove duplicate declaration.
19631
266c9547
PE
19632 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19633
79c49ad2
PE
19634 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19635
368f4090
JM
196362011-04-10 Jim Meyering <meyering@redhat.com>
19637
19638 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19639 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19640 return ssize_t not "int", and use size_t as the buffer length.
19641 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19642 * gnutls.h: Update declarations.
19643 * process.c (read_process_output): Use ssize_t, to match.
19644 (send_process): Likewise.
19645
a32d4040
CY
196462011-04-09 Chong Yidong <cyd@stupidchicken.com>
19647
19648 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19649
8546720e 196502011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 19651
04f2d78b
CB
19652 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19653 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 19654
8546720e
GM
19655 * xterm.c (handle_one_xevent):
19656 * xmenu.c (create_and_show_popup_menu):
19657 * xselect.c (x_decline_selection_request)
19658 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 19659
0a2f5c1a 196602011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
19661
19662 Fix some uses of `int' instead of EMACS_INT.
19663 * search.c (string_match_1, fast_string_match)
19664 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19665 (scan_buffer, find_next_newline_no_quit)
19666 (find_before_next_newline, search_command, Freplace_match)
19667 (Fmatch_data): Make some `int' variables be EMACS_INT.
19668
19669 * xdisp.c (display_count_lines): 3rd argument and return value now
19670 EMACS_INT. All callers changed.
19671 (pint2hrstr): Last argument is now EMACS_INT.
19672
19673 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19674 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19675 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19676 (decode_coding_utf_16, decode_coding_emacs_mule)
19677 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19678 (decode_coding_ccl, decode_coding_charset)
19679 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19680 (decode_coding_iso_2022, decode_coding_emacs_mule)
19681 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19682 <char_offset, last_offset>: Declare EMACS_INT.
19683 (encode_coding_utf_8, encode_coding_utf_16)
19684 (encode_coding_emacs_mule, encode_invocation_designation)
19685 (encode_designation_at_bol, encode_coding_iso_2022)
19686 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19687 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19688 Declare EMACS_INT.
19689 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19690 (encode_invocation_designation): Last argument P_NCHARS is now
19691 EMACS_INT.
19692 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19693 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19694
19695 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19696 All users changed.
19697
19698 * ccl.c (Fccl_execute_on_string): Declare some variables
19699 EMACS_INT.
19700
8546720e 197012011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
19702
19703 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19704
4e19a977
CS
197052011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19706
19707 * process.c (Fformat_network_address): Doc fix.
19708
87302331
R
197092011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19710
ee7683eb 19711 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 19712
cbb59342
CY
197132011-04-08 Chong Yidong <cyd@stupidchicken.com>
19714
19715 * keyboard.c (read_char): Call Lisp function help-form-show,
19716 instead of using internal_with_output_to_temp_buffer.
19717 (Qhelp_form_show): New var.
e0d38eeb 19718 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
19719
19720 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19721
19722 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19723
e67a13ab
CY
197242011-04-06 Chong Yidong <cyd@stupidchicken.com>
19725
04f2d78b
CB
19726 * process.c (Flist_processes): Remove to Lisp.
19727 (list_processes_1): Delete.
e67a13ab 19728
973f782d
EZ
197292011-04-06 Eli Zaretskii <eliz@gnu.org>
19730
7c106b1e
EZ
19731 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19732
973f782d
EZ
19733 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19734
41cf7d1a 197352011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 19736
ca23cc88
PE
19737 Fix more problems found by GCC 4.6.0's static checks.
19738
f390e2d5
PE
19739 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19740
42eea0d0
PE
19741 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19742
b69769da 19743 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 19744
f9541e84
PE
19745 * xdisp.c (vmessage): Mark as a printf-like function.
19746
13841b55
PE
19747 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19748
c136c10f
PE
19749 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19750
5e2d4a30
PE
19751 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19752 printf-like functions.
19753 (tiff_load): Add casts to remove these marks before passing them
19754 to system-supplied API.
19755
583f48b9
PE
19756 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19757
b25d760e
PE
19758 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19759 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
19760 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19761 directly, rather than having caller test rule sign. This avoids
19762 some unnecessary tests.
19763 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19764 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19765 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 19766
bc7b6697 19767 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 19768 (xfont_open): Avoid unnecessary tests.
bc7b6697 19769
27ccc379
PE
19770 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19771
dcd5c89a
PE
19772 * composite.h, composite.c (composition_gstring_put_cache):
19773 Use EMACS_INT, not int, for length.
19774
b13a45c6
PE
19775 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19776 breaking out part of COMPOSITION_DECODE_RULE.
19777 (COMPOSITION_DECODE_RULE): Use it.
19778 * composite.c (get_composition_id): Remove unused local vars,
19779 by using the new macro.
19780
1e792e4d
PE
19781 * textprop.c (set_text_properties_1): Change while to do-while,
19782 since the condition is always true at first.
19783
dc6c6455 19784 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
19785 (interval_deletion_adjustment): Return unsigned value.
19786 All uses changed.
dc6c6455 19787
aba7731a
PE
19788 * process.c (list_processes_1, create_pty, read_process_output):
19789 (exec_sentinel): Remove vars that were set but not used.
afd4052b 19790 (create_pty): Remove unnecessary "volatile"s.
bc57d757 19791 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 19792 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 19793 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 19794
fdfc4bf3
PE
19795 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19796
fca8fe46 19797 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 19798 (update_syntax_table): Use unsigned instead of int.
fca8fe46 19799
06a0259a 19800 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 19801 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 19802 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 19803
e7b9e80f
PE
19804 * print.c (print_error_message): Avoid int overflow.
19805
56201685
PE
19806 * font.c (font_list_entities): Redo for clarity,
19807 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19808
78834453 19809 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 19810 (font_score): Avoid potential overflow in diff calculation.
78834453 19811
0bc0b309 19812 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 19813 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 19814
e610eaca
PE
19815 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19816
b895abce
PE
19817 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19818 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19819 can always succeed if overflow has undefined behavior.
19820
1f1d9321 19821 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 19822 (wordify): Omit three unnecessary tests.
1f1d9321 19823
c59478bc
PE
19824 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19825 All callers changed. This avoids the need for an unused var.
19826
79b73827
PE
19827 * casefiddle.c (casify_region): Remove var that is set but not used.
19828
a4db5dfe
PE
19829 * dired.c (file_name_completion): Remove var that is set but not used.
19830
43aae36e
PE
19831 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19832
2a47c44d 19833 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 19834 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 19835
a37c69bf
PE
19836 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19837 Check for integer overflow on size calculations.
19838
328ab8e7
PE
19839 * buffer.c (Fprevious_overlay_change): Remove var that is set
19840 but not used.
19841
e5a2a5cb
PE
19842 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19843 Remove vars that are set but not used.
8d84a6eb 19844 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 19845 (timer_check_2): Mark vars as initialized.
e5a2a5cb 19846
a60e5f68
PE
19847 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19848
f661cb61 19849 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 19850 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 19851
f0397f5a
PE
19852 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19853 that are set but not used.
19854
8664db06 19855 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 19856 if XCreateBitmapFromData fails (Bug#8410).
8664db06 19857
6abdaa4a
PE
19858 * xselect.c (x_get_local_selection, x_handle_property_notify):
19859 Remove vars that are set but not used.
19860
0ce7538d 19861 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 19862 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 19863
9ae848fc
PE
19864 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19865 Remove var that is set but not used.
0b918413
PE
19866 (scroll_bar_windows_size): Now size_t, not int.
19867 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19868 Check for overflow.
9ae848fc 19869
a5a62657
PE
19870 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19871 (map_tty_color) [!defined MSDOS]: Likewise.
19872
5c5cdd39
PE
19873 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19874
66ebf983
PE
19875 * coding.c: Remove vars that are set but not used.
19876 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19877 All callers changed.
19878 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19879 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19880 (decode_coding_charset): Remove vars that are set but not used.
19881
1be4d761
PE
19882 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19883 that is set but not used.
19884
47553fa8
PE
19885 * print.c (print_object): Remove var that is set but not used.
19886
1f7196bf 19887 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
19888 The gnulib version avoids calling malloc in the usual case,
19889 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19890 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19891 * filelock.c (current_lock_owner): Likewise.
19892 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19893 * sysdep.c: Include allocator.h, careadlinkat.h.
19894 (emacs_no_realloc_allocator): New static constant.
19895 (emacs_readlink): New function.
fdb61804
PE
19896 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19897 ../lib/careadlinkat.h.
d1fdcab7 19898
f84c17c7
SM
198992011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19900
19901 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19902 first non-nil return value).
19903
ef3862ad
JD
199042011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19905
19906 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19907 if not defined (Bug#8403).
19908
376a7006
JB
199092011-04-02 Juanma Barranquero <lekktu@gmail.com>
19910
19911 * xdisp.c (display_count_lines): Remove parameter `start',
19912 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19913 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19914 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19915 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19916 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19917 and thereabouts. All callers changed.
19918 (get_per_char_metric): Remove parameter `f', unused since
19919 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19920
6ca3801d
JM
199212011-04-02 Jim Meyering <meyering@redhat.com>
19922
19923 do not dereference NULL upon failed strdup
19924 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19925 (ns_get_family): Likewise.
19926
d8e2b5ba
JB
199272011-04-02 Juanma Barranquero <lekktu@gmail.com>
19928
19929 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19930
8c74fcbd
JD
199312011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19932
19933 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19934 later (Bug#8403).
19935
7200d79c
SM
199362011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19937
03408648 19938 Add lexical binding.
7200d79c 19939
03408648
SM
19940 * window.c (Ftemp_output_buffer_show): New fun.
19941 (Fsave_window_excursion):
19942 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19943
19944 * lread.c (lisp_file_lexically_bound_p): New function.
19945 (Fload): Bind Qlexical_binding.
19946 (readevalloop): Remove `evalfun' arg.
19947 Bind Qinternal_interpreter_environment.
19948 (Feval_buffer): Bind Qlexical_binding.
19949 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19950 Mark as dynamic.
19951 (syms_of_lread): Declare `lexical-binding'.
19952
19953 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19954
19955 * keyboard.c (eval_dyn): New fun.
19956 (menu_item_eval_property): Use it.
ca105506
SM
19957
19958 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 19959
03408648
SM
19960 * fns.c (concat, mapcar1): Accept byte-code-functions.
19961
19962 * eval.c (Fsetq): Handle lexical vars.
19963 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19964 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19965 (FletX, Flet): Obey lexical binding.
19966 (Fcommandp): Handle closures.
19967 (Feval): New `lexical' arg.
19968 (eval_sub): New function extracted from Feval. Use it almost
19969 everywhere where Feval was used. Look up vars in lexical env.
19970 Handle closures.
19971 (Ffunctionp): Move from subr.el.
19972 (Ffuncall): Handle closures.
19973 (apply_lambda): Remove `eval_flags'.
19974 (funcall_lambda): Handle closures and new byte-code-functions.
19975 (Fspecial_variable_p): New function.
19976 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19977 but without exporting it to Lisp.
23aba0ea 19978
23aba0ea 19979 * doc.c (Fdocumentation, store_function_docstring):
03408648 19980 * data.c (Finteractive_form): Handle closures.
23aba0ea 19981
03408648
SM
19982 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19983 interactive spec.
ba83908c 19984
04f2d78b
CB
19985 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19986 New byte-codes.
03408648
SM
19987 (exec_byte_code): New function extracted from Fbyte_code to handle new
19988 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 19989
03408648 19990 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 19991
03408648 19992 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 19993
e2abce01
JB
199942011-03-31 Juanma Barranquero <lekktu@gmail.com>
19995
19996 * xdisp.c (redisplay_internal): Fix prototype.
19997
63696a73 199982011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 19999
63696a73 20000 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
20001 (try_scrolling): Use it when setting scroll_limit.
20002 Limit scrolling to 100 screen lines.
63696a73
EZ
20003 (redisplay_window): Even when falling back on "recentering",
20004 position point in the window according to scroll-conservatively,
20005 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
20006
20007 (try_scrolling): When point is above the window, allow searching
20008 as far as scroll_max, or one screenful, to compute vertical
20009 distance from PT to the scroll margin position. This prevents
20010 try_scrolling from unnecessarily failing when
20011 scroll-conservatively is set to a value slightly larger than the
20012 window height. Clean up the case of PT below the margin at bottom
20013 of window: scroll_max can no longer be INT_MAX. When aggressive
20014 scrolling is in use, don't let point enter the opposite scroll
20015 margin as result of the scroll.
20016 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
20017 threshold of 100 lines for never-recentering scrolling.
20018
e4cc2dfc
JB
200192011-03-31 Juanma Barranquero <lekktu@gmail.com>
20020
20021 * dispextern.h (move_it_by_lines):
20022 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
20023 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
20024 (message_log_check_duplicate): Remove parameters `prev_bol' and
20025 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20026 (redisplay_internal): Remove parameter `preserve_echo_area',
20027 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
20028
20029 * indent.c (Fvertical_motion):
20030 * window.c (window_scroll_pixel_based, Frecenter):
20031 Don't pass `need_y_p' to `move_it_by_lines'.
20032
1c470562
SM
200332011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
20034
44f230aa
SM
20035 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
20036 steal a few bits to be more compact.
20037 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
20038 Remove unneeded casts.
20039
1c470562
SM
20040 * bytecode.c (Fbyte_code): CAR and CDR can GC.
20041
888adce9
ZK
200422011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
20043
20044 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
20045 binding" message (bug#7967).
20046
f838ed7b
PE
200472011-03-30 Paul Eggert <eggert@cs.ucla.edu>
20048
77861b95
PE
20049 Fix more problems found by GCC 4.6.0's static checks.
20050
de6dbc14
PE
20051 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
20052 Remove unused local var.
20053
f838ed7b
PE
20054 * editfns.c (Fmessage_box): Remove unused local var.
20055
792c7b2b
PE
20056 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
20057 (note_mode_line_or_margin_highlight, note_mouse_highlight):
20058 Omit unused local vars.
c499e557 20059 * window.c (shrink_windows): Omit unused local var.
b01a1c29 20060 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
20061 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
20062 Omit unused local var.
20063
ba0165e1
PE
20064 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
20065 Don't assume string length fits in int.
32ad8845 20066 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 20067 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 20068
3c59b4c9
PE
20069 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
20070 instead of alloca (Bug#8344).
20071
a3eed478 20072 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 20073 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 20074
eb4d412d
PE
20075 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
20076
1658b401
PE
20077 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
20078 concerns.
20079
20080 * term.c (produce_glyphless_glyph): Remove unnecessary test.
20081
20082 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 20083
9a2c6e05
PE
20084 * keyboard.c (syms_of_keyboard): Use the same style as later
20085 in this function when indexing through an array. This also
20086 works around GCC bug 48267.
20087
03d0a109
PE
20088 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
20089
44f730c8
PE
20090 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
20091
fe75f926
PE
20092 * chartab.c (sub_char_table_ref_and_range): Redo for slight
20093 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
20094
ffa8c828
PE
20095 * keyboard.c, keyboard.h (num_input_events): Now size_t.
20096 This avoids undefined behavior on integer overflow, and is a bit
20097 more convenient anyway since it is compared to a size_t variable.
20098
c5101a77
PE
20099 Variadic C functions now count arguments with size_t, not int.
20100 This avoids an unnecessary limitation on 64-bit machines, which
20101 caused (substring ...) to crash on large vectors (Bug#8344).
20102 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
20103 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 20104 All variadic functions and their callers changed accordingly.
c5101a77
PE
20105 (struct gcpro.nvars): Now size_t, not int. All uses changed.
20106 * data.c (arith_driver, float_arith_driver): Likewise.
20107 * editfns.c (general_insert_function): Likewise.
20108 * eval.c (struct backtrace.nargs, interactive_p)
20109 (internal_condition_case_n, run_hook_with_args, apply_lambda)
20110 (funcall_lambda, mark_backtrace): Likewise.
20111 * fns.c (concat): Likewise.
20112 * frame.c (x_set_frame_parameters): Likewise.
20113 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
20114 0 if not found, not -1. All callers changed.
20115
dd3f25f7
PE
20116 * alloc.c (garbage_collect): Don't assume stack size fits in int.
20117 (stack_copy_size): Now size_t, not int.
20118 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
20119
461c2ab9
JB
201202011-03-28 Juanma Barranquero <lekktu@gmail.com>
20121
20122 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
20123 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20124 All callers changed.
20125
20126 * lisp.h (multibyte_char_to_unibyte):
20127 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
20128 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20129 * character.h (CHAR_TO_BYTE8):
20130 * cmds.c (internal_self_insert):
20131 * editfns.c (general_insert_function):
20132 * keymap.c (push_key_description):
20133 * search.c (Freplace_match):
20134 * xdisp.c (message_dolog, set_message_1): All callers changed.
20135
f6d62986
SM
201362011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
20137
20138 * keyboard.c (safe_run_hook_funcall): New function.
20139 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
20140 don't set the hook to nil, but remove the offending function instead.
20141 (Qcommand_hook_internal): Remove, unused.
20142 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
20143 Vcommand_hook_internal.
20144
20145 * eval.c (enum run_hooks_condition): Remove.
20146 (funcall_nil, funcall_not): New functions.
20147 (run_hook_with_args): Call each function through a `funcall' argument.
20148 Remove `cond' argument, now redundant.
20149 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
20150 (Frun_hook_with_args_until_failure): Adjust accordingly.
20151 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
20152
1db5b1ad
JB
201532011-03-28 Juanma Barranquero <lekktu@gmail.com>
20154
20155 * dispextern.h (string_buffer_position): Remove declaration.
20156
20157 * print.c (strout): Remove parameter `multibyte', unused since
20158 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
20159
20160 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
20161 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
20162 All callers changed.
20163
20164 * w32.c (_wsa_errlist): Use braces for struct initializers.
20165
20166 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
20167 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
20168 All callers changed.
20169 (string_buffer_position): Likewise. Also, make static (it's never
20170 used outside xdisp.c).
20171 (cursor_row_p): Remove parameter `w', unused since
20172 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
20173 (decode_mode_spec): Remove parameter `precision', introduced during
20174 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
20175 All callers changed.
20176
5ffb62aa
JD
201772011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20178
20179 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
20180
461c2ab9 201812011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
20182
20183 * nsterm.m (ns_menu_bar_is_hidden): New variable.
20184 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
20185 (ns_update_auto_hide_menu_bar): New functions.
20186 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
20187 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
20188 ns_constrain_all_frames.
20189 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
20190 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
20191
5c380ffb
JD
201922011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20193
20194 * nsmenu.m (runDialogAt): Remove argument to timer_check.
20195
9af30bdf
GM
201962011-03-27 Glenn Morris <rgm@gnu.org>
20197
20198 * syssignal.h: Replace RETSIGTYPE with void.
20199 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
20200 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
20201 Replace SIGTYPE with void everywhere.
20202 * s/usg5-4-common.h (SIGTYPE): Remove definition.
20203 * s/template.h (SIGTYPE): Remove commented out definition.
20204
e2abce01
JB
202052011-03-26 Eli Zaretskii <eliz@gnu.org>
20206
20207 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
20208 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
20209
f868cd8a
JB
202102011-03-26 Juanma Barranquero <lekktu@gmail.com>
20211
59eb0929
JB
20212 * w32.c (read_unc_volume): Use parameter `henum', instead of
20213 global variable `wget_enum_handle'.
20214
20215 * keymap.c (describe_vector): Remove parameters `indices' and
20216 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
20217 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
20218
f868cd8a
JB
20219 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
20220
20221 * keyboard.c (timer_check): Remove parameter `do_it_now',
20222 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
20223 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
20224 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
20225
20226 * keyboard.c (read_char):
20227 * w32menu.c (w32_menu_display_help):
20228 * xmenu.c (show_help_event, menu_help_callback):
20229 Adjust calls to `show_help_echo'.
20230
20231 * gtkutil.c (xg_maybe_add_timer):
20232 * keyboard.c (readable_events):
20233 * process.c (wait_reading_process_output):
20234 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
20235
20236 * insdel.c (adjust_markers_gap_motion):
20237 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
20238 (gap_left, gap_right): Don't call it.
20239
2ecf6fdb
CY
202402011-03-25 Chong Yidong <cyd@stupidchicken.com>
20241
20242 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
20243 incurred during fontification.
20244
6b1f9ba4
JB
202452011-03-25 Juanma Barranquero <lekktu@gmail.com>
20246
20247 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
20248 (DEFVAR_PER_BUFFER): Don't pass it.
20249
20250 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
20251 (scrolling_window): Don't pass it.
20252
0f4a96b5
JB
202532011-03-25 Juanma Barranquero <lekktu@gmail.com>
20254
20255 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
20256
20257 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
20258 and `suffix'.
20259 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
20260 of variables specific to SELinux and computation of `encoded_absname'.
20261
20262 * image.c (XPutPixel): Remove unused variable `height'.
20263
20264 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
20265
20266 * unexw32.c (get_section_info): Remove unused variable `section'.
20267
20268 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
20269 (system_process_attributes): Remove unused variable `sess'.
20270 (sys_read): Remove unused variable `err'.
20271
20272 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
20273 (w32_wnd_proc): Remove unused variable `isdead'.
20274 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
20275 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
20276 (x_create_tip_frame): Remove unused variable `tem'.
20277
20278 * w32inevt.c (w32_console_read_socket):
20279 Remove unused variable `no_events'.
20280
20281 * w32term.c (x_draw_composite_glyph_string_foreground):
20282 Remove unused variable `width'.
20283
1149507c
JB
202842011-03-24 Juanma Barranquero <lekktu@gmail.com>
20285
20286 * w32term.c (x_set_glyph_string_clipping):
20287 Don't pass uninitialized region to CombineRgn.
20288
9c88f339
JB
202892011-03-23 Juanma Barranquero <lekktu@gmail.com>
20290
20291 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
20292 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
20293 (Fx_close_connection): Remove unused variable `i'.
20294
20295 * w32font.c (w32font_draw): Return number of glyphs.
20296 (w32font_open_internal): Remove unused variable `i'.
20297 (w32font_driver): Add missing initializer.
20298
20299 * w32menu.c (utf8to16): Remove unused variable `utf16'.
20300 (fill_in_menu): Remove unused variable `items_added'.
20301
20302 * w32term.c (last_mouse_press_frame): Remove static global variable.
20303 (w32_clip_to_row): Remove unused variable `f'.
20304 (x_delete_terminal): Remove unused variable `i'.
20305
20306 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
20307 (NOTHING): Remove unused static global variable.
20308 (uniscribe_check_otf): Remove unused variable `table'.
20309 (uniscribe_font_driver): Add missing initializers.
20310
dee091a3
JD
203112011-03-23 Julien Danjou <julien@danjou.info>
20312
20313 * term.c (Fsuspend_tty, Fresume_tty):
20314 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
20315 * window.c (temp_output_buffer_show):
20316 * insdel.c (signal_before_change):
20317 * frame.c (Fhandle_switch_frame):
20318 * fileio.c (Fdo_auto_save):
20319 * emacs.c (Fkill_emacs):
20320 * editfns.c (save_excursion_restore):
20321 * cmds.c (internal_self_insert):
20322 * callint.c (Fcall_interactively):
20323 * buffer.c (Fkill_all_local_variables):
20324 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
20325 Use Frun_hooks.
0f4a96b5 20326 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 20327 unconditionally since it does the check itself.
dee091a3 20328
2c520ab5 203292011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 20330
c9c49752
PE
20331 Fix more problems found by GCC 4.5.2's static checks.
20332
8abc3f12
PE
20333 * coding.c (encode_coding_raw_text): Avoid unnecessary test
20334 the first time through the loop, since we know p0 < p1 then.
20335 This also avoids a gcc -Wstrict-overflow warning.
20336
a2d26660
PE
20337 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
20338 leading to a memory leak, possible in functions like
20339 load_charset_map_from_file that can allocate an unbounded number
b12ef411 20340 of objects (Bug#8318).
a2d26660 20341
916c72e9
PE
20342 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
20343 that could (at least in theory) be that large.
20344
19ab8a18
PE
20345 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
20346 This is less likely to overflow, and avoids undefined behavior if
20347 overflow does occur. All callers changed. Use strtoul to scan
20348 for the unsigned long integer.
b7cbbd6f
PE
20349 (pint2hrstr): Simplify and tune code slightly.
20350 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 20351
f0641eff
PE
20352 * scroll.c (do_scrolling): Work around GCC bug 48228.
20353 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
20354
7f650bb9
PE
20355 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
20356 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
20357 (validate_x_resource_name): Simplify count usage.
20358 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 20359
37dd57d1
PE
20360 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20361 fail (Bug#8306).
81e56e61 20362
699979fc 20363 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 20364
401bf9b4
PE
20365 * process.c (Fmake_network_process): Use socklen_t, not int,
20366 where POSIX says socklen_t is required in portable programs.
20367 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 20368 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
20369 (Fmake_network_process, server_accept_connection):
20370 (wait_reading_process_output, read_process_output):
20371 Likewise.
20372
b93aacde
PE
20373 * process.c: Rename or move locals to avoid shadowing.
20374 (list_processes_1, Fmake_network_process):
20375 (read_process_output_error_handler, exec_sentinel_error_handler):
20376 Rename or move locals.
4dc343ee 20377 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 20378 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 20379 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 20380 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 20381 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 20382
af8a867c 20383 Make tparam.h and terminfo.c consistent.
44f230aa
SM
20384 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20385 Include tparam.h instead, since it declares them.
af8a867c
PE
20386 * cm.h (PC): Remove extern decl; tparam.h now does this.
20387 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20388 * terminfo.c: Include tparam.h, to check interfaces.
20389 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20390 (tparam): Adjust signature to match interface in tparam.h;
20391 this removes some undefined behavior. Check that outstring and len
20392 are zero, which they always are with Emacs.
20393 * tparam.h (PC, BC, UP): New extern decls.
20394
0248044d 20395 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 20396 (xftfont_open): Rename locals to avoid shadowing.
0248044d 20397
8ff096c1 20398 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
20399 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20400 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 20401 (ftfont_list): Remove unused local.
49eaafba
PE
20402 (get_adstyle_property, ftfont_pattern_entity):
20403 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20404 Rename locals to avoid shadowing.
8ff096c1 20405
e2be39f6
PE
20406 * xfont.c (xfont_list_family): Mark var as initialized.
20407
c9735e30
PE
20408 * xml.c (make_dom): Now static.
20409
8f5201ae
PE
20410 * composite.c (composition_compute_stop_pos): Rename local to
20411 avoid shadowing.
b246f932
PE
20412 (composition_reseat_it): Remove unused locals.
20413 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 20414 (composition_update_it): Mark var as initialized.
11b61122
PE
20415 (find_automatic_composition): Mark vars as initialized,
20416 with a FIXME (Bug#8290).
8f5201ae 20417
760fbc2c
PE
20418 character.h: Rename locals to avoid shadowing.
20419 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20420 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20421 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20422 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20423 to avoid shadowing.
20424
ff08eb85
PE
20425 * textprop.c (property_change_between_p): Remove; unused.
20426
fc7bf025
PE
20427 * intervals.c (interval_start_pos): Now static.
20428
235d7abc
PE
20429 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20430
44f230aa
SM
20431 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20432 Rename locals to avoid shadowing.
3e7d6594 20433
50060332
PE
20434 * sound.c (wav_play, au_play, Fplay_sound_internal):
20435 Fix pointer signedness.
d01f234b 20436 (alsa_choose_format): Remove unused local var.
c83b8872
PE
20437 (wav_play): Initialize a variable to 0, to prevent undefined
20438 behavior (Bug#8278).
50060332 20439
c4fc4e30
PE
20440 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20441
918436ed
PE
20442 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20443
c939f91b
PE
20444 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20445 clobbering (Bug#8298).
b9c7f648
PE
20446 * sysdep.c (sys_subshell): Likewise.
20447 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 20448
6bd8c144
PE
20449 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20450 This should get cleaned up, so that child_setup has the
20451 same signature on all platforms.
20452
7710357c 20453 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 20454 (relocate_fd): Rename locals to avoid shadowing.
7710357c 20455
c59da222
CY
204562011-03-22 Chong Yidong <cyd@stupidchicken.com>
20457
20458 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20459 not to be necessary, and produces flickering.
20460
66b87493
GM
204612011-03-20 Glenn Morris <rgm@gnu.org>
20462
20463 * config.in: Remove file.
20464
45b6f6d5
JB
204652011-03-20 Juanma Barranquero <lekktu@gmail.com>
20466
20467 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20468 are now in src/globals.h.
20469 (syms_of_minibuf): Remove spurious & from previous change.
20470
cd394be1 204712011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
20472
20473 * minibuf.c (completing-read-function): New variable.
20474 (completing-read-default): Rename from completing-read.
20475 (completing-read): Call completing-read-function.
20476
b14e3e21
CY
204772011-03-19 Juanma Barranquero <lekktu@gmail.com>
20478
20479 * xfaces.c (Fx_load_color_file):
20480 Read color file from absolute filename (bug#8250).
20481
f2b726e6
JB
204822011-03-19 Juanma Barranquero <lekktu@gmail.com>
20483
20484 * makefile.w32-in: Update dependencies.
20485
09f6ff02
EZ
204862011-03-17 Eli Zaretskii <eliz@gnu.org>
20487
20488 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20489
29a6015a
PE
204902011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20491
a3a6c54e
PE
20492 Fix more problems found by GCC 4.5.2's static checks.
20493
b766f867
PE
20494 * process.c (make_serial_process_unwind, send_process_trap):
20495 (sigchld_handler): Now static.
20496
be02381c
PE
20497 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20498 That way, the code declares only the vars that it needs.
20499 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20500 * s/cygwin.h (PTY_ITERATION): Likewise.
20501 * s/darwin.h (PTY_ITERATION): Likewise.
20502 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20503
57048744
PE
20504 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20505 * process.c (allocate_pty): Don't declare stb unless it's needed.
20506
7914961c 20507 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
20508 (CONSTANTLIM): Remove; unused.
20509 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20510 Define only if needed.
7914961c 20511
b3967b18
PE
20512 * unexelf.c (unexec): Name an expression,
20513 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
20514 Use a different way to cause a compilation error if anyone uses
20515 n rather than nn, a way that does not involve shadowing.
73366a00 20516 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 20517
29a6015a
PE
20518 * deps.mk (unexalpha.o): Remove; unused.
20519
43cfc33e 20520 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 20521 * unexec.h: New file.
ce701a33
PE
20522 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20523 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20524 Depend on unexec.h.
20525 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20526 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20527 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 20528 Change as necessary to match prototype in unexec.h.
ce701a33 20529
01f44d5a
PE
20530 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20531 shadowing.
4f63c6bb 20532 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 20533
a6670b0b
PE
20534 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20535 Rename locals to avoid shadowing.
20536
cef2010d 20537 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 20538 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 20539
d4d7173a
PE
20540 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20541
f08b802a
PE
20542 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20543 warning when compiling print.c.
20544
3ddb0639
PE
20545 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20546 instead of using an uninitialized var.
5ad03b97 20547 (font_sort_entities): Mark var as initialized.
3ddb0639 20548
170a2692
PE
20549 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20550
e663c700
PE
20551 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20552 pointers to constants.
89bc529a 20553 (font_parse_fcname): Remove unused vars.
7b81e2d0 20554 (font_delete_unmatched): Now static.
ea838e10 20555 (font_get_spec): Remove; unused.
13a547c6
PE
20556 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20557 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20558 Rename or move locals to avoid shadowing.
e663c700 20559
2a80c887 20560 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 20561 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 20562
1384fa33 20563 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 20564 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 20565
8b2c52e9
PE
20566 * alloc.c (mark_backtrace): Move decl from here ...
20567 * lisp.h: ... to here, so that it can be checked.
20568
475545b5 20569 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 20570 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
20571 (lisp_indirect_variable): Name an expression,
20572 to avoid gcc -Wbad-function-cast warning.
1faed8ae 20573 (Fdefvar): Rename locals to avoid shadowing.
475545b5 20574
b1349114 20575 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 20576 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 20577 Use const pointer when appropriate.
b1349114 20578
a2928364
PE
20579 * lisp.h (get_system_name, get_operating_system_release):
20580 Move decls here, to check interfaces.
20581 * process.c (get_operating_system_release): Move decl to lisp.h.
20582 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
20583 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20584 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20585 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
20586 (Fformat_time_string, Fencode_time, Finsert_char):
20587 (Ftranslate_region_internal, Fformat):
20588 Rename or remove local vars to avoid shadowing.
9710023e 20589 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 20590
a415e694
PE
20591 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20592 avoid shadowing.
20593
8ef4622d
PE
20594 * lisp.h (eassert): Check that the argument compiles, even if
20595 ENABLE_CHECKING is not defined.
20596
946f9a5b
PE
20597 * data.c (Findirect_variable): Name an expression, to avoid
20598 gcc -Wbad-function-cast warning.
112396d6 20599 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 20600 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
20601 (Fmake_variable_buffer_local, Fmake_local_variable):
20602 Mark variables as initialized.
52746918 20603 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 20604
e5aab7e7 20605 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
20606 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20607 Rename locals to avoid shadowing.
dff45157
PE
20608 (mark_stack): Move local variables into the #ifdef region where
20609 they're used.
7bc26fdb
PE
20610 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20611 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20612 needed otherwise.
20613 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20614 (GC_STRING_CHARS): Remove; not used.
d40d4be1 20615 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 20616
e5aab7e7
PE
20617 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20618 avoids undefined behavior in theory.
20619
4da60324
PE
20620 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20621
88043301
PE
20622 Use functions, not macros, for up- and down-casing (Bug#8254).
20623 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20624 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20625 to use the following functions instead of these macros.
20626 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20627 EMACS_INT, since callers assume the returned value fits in int.
20628 (upcase1): Likewise, for UPCASE_TABLE.
20629 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 20630 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 20631 the race-condition problem in the old DOWNCASE.
88043301 20632
19ed5445
PE
20633 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20634 Rename locals to avoid shadowing.
20635 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
20636 (regex_compile, re_search_2, re_match_2_internal):
20637 Remove unused local vars.
952db0d7
PE
20638 (FREE_VAR): Rewrite so as not to use empty "else",
20639 which gcc can warn about.
da053e48 20640 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
20641 (RETALLOC_IF): Define only if needed.
20642 (WORDCHAR_P): Likewise. This one is never needed, but is used
20643 only in a comment talking about a compiler bug, so put inside
20644 the #if 0 of that comment.
20645 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20646 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20647 Remove; unused.
19ed5445 20648
1f3561e4 20649 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
20650 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20651 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 20652
ded6f8f7
PE
20653 * search.c (simple_search): Remove unused var.
20654
dbd37a95
PE
20655 * dired.c (compile_pattern): Move decl from here ...
20656 * lisp.h: ... to here, so that it can be checked.
20657 (struct re_registers): New forward decl.
20658
7e47afad
PE
20659 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20660
85f24f61
PE
20661 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20662 All uses changed.
20663 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20664 Rename locals to avoid shadowing.
5671df8f 20665 (Fvertical_motion): Mark locals as initialized.
85f24f61 20666
181aa2be 20667 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 20668 (casify_region): Mark local as initialized.
181aa2be 20669
930d429c
PE
20670 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20671
7082eac6
PE
20672 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20673 New macros, so that the caller can use some names other than
20674 gcpro1, gcpro2, etc.
20675 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20676 of the new macros.
20677 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20678 argument, for consistency with GCPRO2_VAR, etc: it is now the
20679 prefix of the variable, not the variable itself. All uses
20680 changed.
38b2c076
PE
20681 * dired.c (directory_files_internal, file_name_completion):
20682 Rename locals to avoid shadowing.
20683
15206ed9
PE
20684 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20685 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20686 dired.c's scmp function, had undefined behavior.
20687 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20688 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20689 * buffer.h: ... to here, because these macros use current_buffer,
20690 and the new implementation with inline functions needs to have
20691 current_buffer in scope now, rather than later when the macros
20692 are used.
20693 (downcase, upcase1): New static inline functions.
20694 (DOWNCASE, UPCASE1): Reimplement using these functions.
20695 This avoids undefined behavior in expressions like
20696 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20697 from race conditions in accessing the global variables
20698 case_temp1 and case_temp2.
20699 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20700 * lisp.h (case_temp1, case_temp2): Remove their decls.
20701 * character.h (ASCII_CHAR_P): Move from here ...
20702 * lisp.h: ... to here, so that the inline functions mentioned
20703 above can use them.
20704
4a6bea26
PE
20705 * dired.c (directory_files_internal_unwind): Now static.
20706
f14b7e14
PE
20707 * fileio.c (file_name_as_directory, directory_file_name):
20708 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20709 Now static.
2893f146
PE
20710 (file_name_as_directory): Use const pointers when appropriate.
20711 (Fexpand_file_name): Likewise. In particular, newdir might
20712 point at constant storage, so make it a const pointer.
fd4ead52 20713 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
20714 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20715 signedness issues.
f839df0c
PE
20716 (Fset_file_times, Finsert_file_contents, auto_save_error):
20717 Rename locals to avoid shadowing.
f14b7e14 20718
5716756e 20719 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
20720 (Ftry_completion, Fall_completions): Rename or remove locals
20721 to avoid shadowing.
5716756e 20722
b4c3046a
PE
20723 * marker.c (bytepos_to_charpos): Remove; unused.
20724
b45db522
PE
20725 * lisp.h (verify_bytepos, count_markers): New decls,
20726 so that gcc does not warn that these functions aren't declared.
20727
85876d07
PE
20728 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20729 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 20730 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 20731 (copy_text): Remove unused local var.
85876d07 20732
03d78a21 20733 * filelock.c (within_one_second): Now static.
b3dd38ab 20734 (lock_file_1): Rename local to avoid shadowing.
03d78a21 20735
5df8f01b
PE
20736 * buffer.c (fix_overlays_before): Mark locals as initialized.
20737 (fix_start_end_in_overlays): Likewise. This function should be
20738 simplified by using pointers-to-pointers, but that's a different
20739 matter.
b1d876f1 20740 (switch_to_buffer_1): Now static.
8f54f30a
PE
20741 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20742 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 20743
a70072c9 20744 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 20745 Fix pointer signedness issue.
edced198
PE
20746 (sys_subshell): Mark local as volatile if checking for lint,
20747 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 20748 (MAXPATHLEN): Define only if needed.
a70072c9 20749
a0977c44
PE
20750 * process.c (serial_open, serial_configure): Move decls from here ...
20751 * systty.h: ... to here, so that they can be checked.
20752
a884fdcc
PE
20753 * fns.c (get_random, seed_random): Move extern decls from here ...
20754 * lisp.h: ... to here, so that they can be checked.
20755
604efe86 20756 * sysdep.c (reset_io): Now static.
b8950c94 20757 (wait_for_termination_signal): Remove; unused.
604efe86 20758
38fc62d9
PE
20759 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20760 (copy_keymap_item, append_key, push_text_char_description):
20761 Now static.
1004a21a 20762 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 20763 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
20764 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20765 (describe_map_tree):
20766 Rename locals to avoid shadowing.
38fc62d9 20767
2f2650da
PE
20768 * keyboard.c: Declare functions static if they are not used elsewhere.
20769 (echo_char, echo_dash, cmd_error, top_level_2):
20770 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
20771 (read_char, kbd_buffer_get_event, make_lispy_position):
20772 (make_lispy_event, make_lispy_movement, apply_modifiers):
20773 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20774 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20775 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 20776 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 20777 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 20778
a053e86c 20779 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
20780 (mark_kboards): Move decl here ...
20781 * alloc.c (mark_kboards): ... from here.
a053e86c 20782
4752793e
PE
20783 * lisp.h (force_auto_save_soon): New decl.
20784
74f10ca7 20785 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
20786 (DEFINE_DUMMY_FUNCTION): New macro.
20787 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20788 Use it.
c03cd23f
PE
20789 (main): Add casts to avoid warnings
20790 if GCC considers string literals to be constants.
74f10ca7 20791
022e70d4
PE
20792 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20793
59d6fe83
PE
20794 * dbusbind.c: Pointer signedness fixes.
20795 (xd_signature, xd_append_arg, xd_initialize):
20796 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20797 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20798 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20799 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20800
78320123
PE
20801 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20802 if GCC considers string literals to be constants.
49cebcca 20803 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 20804
35ac2a97
SM
208052011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20806
fb103ca9
SM
20807 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20808 (print_preprocess, print_object): New macro to fix last change.
20809
35ac2a97
SM
20810 * print.c (print_preprocess): Don't forget font objects.
20811
62973b41
JB
208122011-03-16 Juanma Barranquero <lekktu@gmail.com>
20813
20814 * emacs.c (USAGE3): Doc fixes.
20815
0e48bb22
AS
208162011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20817
20818 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20819 structure.
20820
7684e57b
JB
208212011-03-14 Juanma Barranquero <lekktu@gmail.com>
20822
20823 * lisp.h (VWindow_system, Qfile_name_history):
20824 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20825 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20826 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20827
20828 * w32select.c: Don't #include "keyboard.h".
c96bbc66 20829 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
20830
20831 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20832 * w32console.c (detect_input_pending, read_input_pending)
20833 (encode_terminal_code):
20834 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20835 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20836 (w32_system_caret_y, Qfile_name_history):
20837 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20838 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20839 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20840 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20841 * w32proc.c (Qlocal, report_file_error):
20842 * w32term.c (Vwindow_system, updating_frame):
20843 * w32uniscribe.c (initialized, uniscribe_font_driver):
20844 Remove unneeded extern declarations.
20845
2aa46d6c
CY
208462011-03-14 Chong Yidong <cyd@stupidchicken.com>
20847
c96bbc66 20848 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 20849
cffc6f3b
CY
208502011-03-13 Chong Yidong <cyd@stupidchicken.com>
20851
20852 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20853 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20854 These macros can no longer be used for assignment.
20855
44f230aa
SM
20856 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20857 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
20858 (record_buffer_markers, fetch_buffer_markers): New functions for
20859 recording and fetching special buffer markers.
20860 (set_buffer_internal_1, set_buffer_temp): Use them.
20861
20862 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20863
20864 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20865
20866 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20867 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20868
20869 * xdisp.c (hscroll_window_tree):
20870 (reconsider_clip_changes): Use PT instead of BUF_PT.
20871
d251f04b
EZ
208722011-03-13 Eli Zaretskii <eliz@gnu.org>
20873
20874 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20875 $(EMACS_ROOT)/lib/intprops.h.
20876
f0c77cd1
PE
208772011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20878
3eca4629
PE
20879 Fix more problems found by GCC 4.5.2's static checks.
20880
7c86ee98
PE
20881 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20882 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
20883 (xg_free_frame_widgets): Make it clear that a local variable is
20884 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
20885 (gdk_window_get_screen): Make it clear that this macro is needed
20886 only if USE_GTK_TOOLTIP.
1e5524e7
PE
20887 (int_gtk_range_get_value): New function, which avoids a diagnostic
20888 from gcc -Wbad-function-cast.
20889 (xg_set_toolkit_scroll_bar_thumb): Use it.
20890 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20891 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
20892 (get_utf8_string, xg_get_file_with_chooser):
20893 Rename locals to avoid shadowing.
20894 (create_dialog): Move locals to avoid shadowing.
7c86ee98 20895
41729b81
PE
20896 * xgselect.c (xg_select): Remove unused var.
20897
f0c77cd1
PE
20898 * image.c (four_corners_best): Mark locals as initialized.
20899 (gif_load): Initialize transparent_p to zero (Bug#8238).
20900 Mark another local as initialized.
ec6cf4c6 20901 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 20902
ce0ad53d 20903 * image.c (clear_image_cache): Now static.
d5d5a617 20904 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 20905 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
20906 (x_edge_detection): Remove unnecessary cast that
20907 gcc -Wbad-function-cast diagnoses.
2037898d 20908 (gif_load): Fix pointer signedness.
6ae141d6
PE
20909 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20910 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 20911
33383987 209122011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 20913
d32df629
PE
20914 Improve quality of tests for time stamp overflow.
20915 For example, without this patch (encode-time 0 0 0 1 1
20916 1152921504606846976) returns the obviously-bogus value (-948597
20917 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20918 reports time overflow. See
20919 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
20920 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20921 * editfns.c: Include limits.h and intprops.h.
20922 (TIME_T_MIN, TIME_T_MAX): New macros.
20923 (time_overflow): Move earlier, to before first use.
20924 (hi_time, lo_time): New functions, for an accurate test for
20925 out-of-range times.
20926 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20927 (Fget_internal_run_time): Don't assume time_t fits in int.
20928 (make_time): Use list2 instead of Fcons twice.
20929 (Fdecode_time): More accurate test for out-of-range times.
20930 (check_tm_member): New function.
20931 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
20932 (lisp_time_argument): Don't rely on undefined left-shift and
20933 right-shift behavior when checking for time stamp overflow.
8be6f318 20934
fe31d94c
PE
20935 * editfns.c (time_overflow): New function, refactoring common code.
20936 (Fformat_time_string, Fdecode_time, Fencode_time):
20937 (Fcurrent_time_string): Use it.
20938
8be6f318
PE
20939 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20940 * dired.c (make_time): Move to ...
20941 * editfns.c (make_time): ... here.
20942 * systime.h: Note the move.
20943
09d9db2c 209442011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 20945
126bc0dc
YM
20946 * fringe.c (update_window_fringes): Remove unused variables.
20947
c47cbdfd
YM
20948 * unexmacosx.c (copy_data_segment): Also copy __got section.
20949 (Bug#8223)
20950
7ac80be9
EZ
209512011-03-12 Eli Zaretskii <eliz@gnu.org>
20952
c96bbc66 20953 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
20954 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20955 Constify `char *' arguments and their references according to
20956 prototypes in tparam.h.
20957
ecb0f94d 20958 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 20959
7ac80be9
EZ
20960 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20961 Adapt all references accordingly.
20962
20963 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20964
ef1fd07e
TT
209652011-03-11 Tom Tromey <tromey@redhat.com>
20966
20967 * buffer.c (syms_of_buffer): Remove obsolete comment.
20968
7ef4b50c
EZ
209692011-03-11 Eli Zaretskii <eliz@gnu.org>
20970
20971 * termhooks.h (encode_terminal_code): Declare prototype.
20972
20973 * msdos.c (encode_terminal_code): Don't declare prototype.
20974
20975 * term.c (encode_terminal_code): Now external again, used by
20976 w32console.c and msdos.c.
20977
44f230aa
SM
20978 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20979 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 20980
4b1ec863 209812011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 20982
1714f52b 20983 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 20984
4b1ec863
PE
20985 * fringe.c (update_window_fringes): Mark locals as initialized
20986 (Bug#8227).
20987 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 20988
524c7aa6
PE
20989 * alloc.c (mark_fringe_data): Move decl from here ...
20990 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20991 to check its interface.
20992 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20993
a5c0af81 20994 * fontset.c (free_realized_fontset): Now static.
7519b8cd 20995 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 20996 (fontset_font): Mark local as initialized.
a9a06e0b 20997 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 20998
b4716021
PE
20999 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
21000
811e9bac 21001 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 21002 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
21003 (x_own_selection, Fx_disown_selection_internal): Rename locals
21004 to avoid shadowing.
21005 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 21006
7e3ab302
PE
21007 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
21008 so that the caller can use some name other than gcpro1.
21009 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
21010 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21011 (Fx_backspace_delete_keys_p):
21012 Use them to avoid shadowing, and rename vars to avoid shadowing.
21013 (x_decode_color, x_set_name, x_window): Now static.
6b437900 21014 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 21015 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
21016 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
21017 Remove unused locals.
7e3ab302
PE
21018 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21019 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
21020 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
21021 macros.
f78faa98 21022
e2b13473
PE
21023 * xterm.h (x_mouse_leave): New decl.
21024
77f23912
PE
21025 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
21026 Remove unused functions.
cdf4ba58
PE
21027 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
21028 (x_calc_absolute_position): Now static.
7411c686 21029 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 21030 Don't declare local "event" unless it's used.
ed7bf3a5
PE
21031 (x_iconify_frame, x_free_frame_resources): Don't declare locals
21032 unless they are used.
38d0b34a
PE
21033 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
21034 (x_fatal_error_signal): Remove; not used.
a6067996
PE
21035 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
21036 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
21037 (x_error_catcher, x_connection_closed, x_error_handler):
21038 (x_error_quitter, xembed_send_message, x_iconify_frame):
21039 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 21040 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 21041 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 21042
44f230aa
SM
21043 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
21044 Rename or move locals to avoid shadowing.
6b463e58 21045 (tty_defined_color, merge_face_heights): Now static.
5967d051 21046 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
21047 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
21048 does not deduce is never used uninitialized.
73719eba
PE
21049 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
21050 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 21051
426994c3 21052 * terminal.c (store_terminal_param): Now static.
5489860b 21053
032f1620 21054 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 21055 (set_frame_menubar): Remove unused local.
d4323972 21056 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
21057 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
21058 since they might point to immutable storage.
281585b0
PE
21059 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
21060 since it's unused otherwise.
032f1620 21061
367c19e5 21062 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 21063 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
21064 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
21065 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 21066 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
21067 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
21068 does not deduce are never used uninitialized.
70739cbe 21069
07b48fa9
PE
21070 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
21071
8868a238 21072 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
21073 * window.c (window_loop, size_window):
21074 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 21075
7e5cf297 21076 * window.c (display_buffer): Now static.
d6550a9f
PE
21077 (size_window): Mark variables that gcc -Wuninitialized
21078 does not deduce are never used uninitialized.
a586633d
PE
21079 * window.h (check_all_windows): New decl, to forestall
21080 gcc -Wmissing-prototypes diagnostic.
5b555da1 21081 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 21082
f6095868
PE
21083 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
21084 shadowing.
21085 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
21086 Include <limits.h>.
21087 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
21088 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
21089 (load_charset_map): Mark variables that gcc -Wuninitialized
21090 does not deduce are never used uninitialized.
53df7c11 21091 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 21092
f38b440c
PE
21093 * coding.c (coding_set_source, coding_set_destination):
21094 Use "else { /* comment */ }" rather than "else /* comment */;"
21095 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
21096 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
21097 a block, when the outer 'i' will do.
21098 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
21099 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
21100 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
21101 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
21102 (Fdecode_sjis_char, Fdefine_coding_system_internal):
21103 Rename locals to avoid shadowing.
21104 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
21105 * coding.c (emacs_mule_char, encode_invocation_designation):
21106 Now static, since they're not used elsewhere.
413bb2db 21107 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 21108 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
21109 (decode_coding_emacs_mule): Mark variables that gcc
21110 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
21111 (detect_coding_iso_2022): Initialize a local variable that might
21112 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 21113 this initialization is needed. (Bug#8211)
5f58e762
PE
21114 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
21115 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
21116 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
21117 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
21118 Remove unused macros.
f38b440c 21119
232b38b9 21120 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 21121 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 21122 * character.c (string_count_byte8): Likewise.
232b38b9 21123
fb90da1b
PE
21124 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
21125 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
21126
fb93dbc2
PE
21127 * chartab.c (copy_sub_char_table): Now static, since it's not used
21128 elsewhere.
5c156ace
PE
21129 (sub_char_table_ref_and_range, char_table_ref_and_range):
21130 Rename locals to avoid shadowing.
bbcd0949 21131 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 21132
7d3b3862 21133 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 21134 (BIDI_BOB): Remove unused macro.
7d3b3862 21135
6be7d3da
PE
21136 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
21137 deduce are never used uninitialized.
c2ed9c8b 21138 * term.c (encode_terminal_code): Likewise.
6be7d3da 21139
75f8807f 21140 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 21141
50938595
PE
21142 * tparam.h: New file.
21143 * term.c, tparam.h: Include it.
21144 * deps.mk (term.o, tparam.o): Depend on tparam.h.
21145 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
21146 Move these decls to tparam.h, and make them agree with what
21147 is actually in tparam.c. The previous trick of using incompatible
21148 decls in different modules does not conform to the C standard.
21149 All callers of tparam changed to use tparam's actual API.
21150 * tparam.c (tparam1, tparam, tgoto):
21151 Use const pointers where appropriate.
21152
fbceeba2
PE
21153 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
21154 * cm.h (struct cm): Likewise.
21155 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
21156 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
21157 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
21158 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
21159 (turn_on_face, init_tty): Likewise.
21160 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 21161
7f3f1250
PE
21162 * term.c (term_mouse_position): Rename local to avoid shadowing.
21163
e6ca6543
PE
21164 * alloc.c (mark_ttys): Move decl from here ...
21165 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
21166
c40f8d15
AS
211672011-03-11 Andreas Schwab <schwab@linux-m68k.org>
21168
21169 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
21170
cfe0661d
JB
211712011-03-09 Juanma Barranquero <lekktu@gmail.com>
21172
21173 * search.c (compile_pattern_1): Remove argument regp, unused since
21174 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
21175 (compile_pattern): Don't pass it.
21176
0afb4571
J
211772011-03-08 Jan Djärv <jan.h.d@swipnet.se>
21178
21179 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
21180 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
21181 for ! HAVE_GTK3.
21182 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
21183
21184 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
21185
21186 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
21187 gdk_window_get_screen, gdk_window_get_geometry,
21188 gdk_x11_window_lookup_for_display and GDK_KEY_g.
21189 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
21190 (xg_get_pixbuf_from_pixmap): New function.
21191 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
21192 to Pixmap, take frame as parameter, remove GdkColormap parameter.
21193 Call xg_get_pixbuf_from_pixmap instead of
21194 gdk_pixbuf_get_from_drawable.
21195 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
21196 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
21197 (xg_check_special_colors): Use GtkStyleContext and its functions
21198 for HAVE_GTK3.
21199 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
21200 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
21201 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
21202 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
21203 Call gtk_widget_get_preferred_size.
0afb4571
J
21204 (xg_frame_resized): gdk_window_get_geometry only takes 5
21205 parameters.
44f230aa
SM
21206 (xg_win_to_widget, xg_event_is_for_menubar):
21207 Call gdk_x11_window_lookup_for_display.
0afb4571
J
21208 (xg_set_widget_bg): New function.
21209 (delete_cb): New function.
895009e1 21210 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 21211 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
21212 (xg_set_background_color): Call xg_set_widget_bg.
21213 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
21214 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
21215 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
21216 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
21217 if ! HAVE_GTK3.
21218 (update_frame_tool_bar): Call gtk_widget_hide.
21219 (xg_initialize): Use GDK_KEY_g.
21220
21221 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
21222 if ! HAVE_GTK3
21223 (x_session_initialize): Call gdk_x11_set_sm_client_id.
21224
21225 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
21226 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
21227 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
21228
1c2cc4ef
JB
212292011-03-08 Juanma Barranquero <lekktu@gmail.com>
21230
21231 * w32xfns.c (select_palette): Check success of RealizePalette against
21232 GDI_ERROR, not zero.
21233
33383987 21234See ChangeLog.11 for earlier changes.
aac0c6e3
MR
21235
21236;; Local Variables:
21237;; coding: utf-8
aac0c6e3
MR
21238;; End:
21239
2f097256 21240 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
21241
21242 This file is part of GNU Emacs.
21243
21244 GNU Emacs is free software: you can redistribute it and/or modify
21245 it under the terms of the GNU General Public License as published by
21246 the Free Software Foundation, either version 3 of the License, or
21247 (at your option) any later version.
21248
21249 GNU Emacs is distributed in the hope that it will be useful,
21250 but WITHOUT ANY WARRANTY; without even the implied warranty of
21251 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21252 GNU General Public License for more details.
21253
21254 You should have received a copy of the GNU General Public License
21255 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.