* net/tramp-adb.el (tramp-adb-maybe-open-connection): Handle errors
[bpt/emacs.git] / src / ChangeLog
CommitLineData
84cc1ab6
PE
12012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * coding.c (Qmac): Now static.
4
5a1d858b
JD
52012-12-30 Jan Djärv <jan.h.d@swipnet.se>
6
7 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
8 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
9 handlebox_widget. Set toolbar_in_hbox to false/true, set
10 toolbar_is_packed to true.
11 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
12 (update_frame_tool_bar): Check toolbar_is_packed for packing.
13 Show all on TOOLBAR_TOP_WIDGET.
14 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
15 by TOOLBAR_TOP_WIDGET.
16 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
17 Check toolbar_is_packed.
8b745d92
JD
18 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
19 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
20 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
21 false.
22 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
23 (xg_update_menubar): Update title only if
24 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
25 (xg_update_submenu): Skip tearoff only if
26 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
27 (xg_initialize): Initialize xg_detached_menus only if
28 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
29
30 * xterm.h (struct x_output): Surround handlebox_widget with
31 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
32 toolbar_in_hbox is bool.
33
d5e5e7b4 342012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
35
36 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
37 (LIBS_GNUSTEP): Define.
38 (LIBES): Add $(LIBS_GNUSTEP).
39 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
40
d5e5e7b4 412012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
42
43 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
44 continuation glyph on a TTY with an indication of an empty line.
45 (Bug#13277)
46
e7ae8039
EZ
472012-12-29 Eli Zaretskii <eliz@gnu.org>
48
ccad023b
EZ
49 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
50 file's SELinux context or ACLs successfully set, nil otherwise.
51 (Bug#13298)
8d23a331 52 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 53
e7ae8039
EZ
54 * w32proc.c (reader_thread): Avoid passing NULL handles to
55 SetEvent and WaitForSingleObject.
56
7456e13f
PE
572012-12-28 Paul Eggert <eggert@cs.ucla.edu>
58
59 Port EXTERNALLY_VISIBLE to Clang 3.2.
60 * conf_post.h (__has_attribute): New macro.
61 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
62
1ab0c851
GM
632012-12-27 Glenn Morris <rgm@gnu.org>
64
65 * cygw32.c (Fcygwin_convert_file_name_to_windows)
66 (Fcygwin_convert_file_name_from_windows): Doc fixes.
67
82e2a1f0 682012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80
EZ
69
70 * fileio.c (file_name_as_directory, directory_file_name): Accept
71 an additional argument MULTIBYTE to indicate whether the input C
72 came from a multibyte or a unibyte Lisp string; all callers
73 adjusted. Don't assume the input string is always multibyte.
74 (Bug#13262)
75 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
76 don't ENCODE_FILE them, and return a unibyte string if the input
77 was unibyte.
78 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
79 don't assume the input strings will always be multibyte. If the
80 input strings are multibyte, decode strings obtained from C
81 library functions.
82
8847a0de
DA
832012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
84
85 * lisp.h (toplevel): Add two notices to the comment about
86 defining a new Lisp data type.
6cda572a
DA
87 * print.c (print_object): If Lisp_Save_Value object's pointer
88 is the address of a memory area containing Lisp_Objects, try
89 to print them.
90 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 91
4b298d5a
DA
922012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
93
94 * keyboard.c (record_asynch_buffer_change): Initialize an event
95 only if it's really needed.
96 * frame.h (enum output_method): Remove output_mac member since
97 it's a leftover from the deleted code.
98 * frame.c (Fframep): Adjust user here ...
99 * terminal.c (Fterminal_live_p): ... and here.
100 * coding.c (Qmac): Now here because it's only used to denote
101 end-of-line encoding type.
102 (syms_of_coding): DEFSYM it.
103 * frame.h (Qmac): Remove duplicated declaration.
104
12384b01
PE
1052012-12-26 Paul Eggert <eggert@cs.ucla.edu>
106
107 * window.c (select_window_1): Now static, since it's used only here.
108
f1665bdc
EZ
1092012-12-25 Eli Zaretskii <eliz@gnu.org>
110
111 * window.c (window_body_cols): Subtract display margins from the
112 window body width on TTYs as well. See
113 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
114 for the original report.
115
9a0d4f34
DA
1162012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
117
118 * xdisp.c (redisplay_window): Remove inner local variable
119 because the outer shadowed one has the same meaning.
cd78d9b1
DA
120 * xterm.h (struct x_output): Remove toolbar_detached member since it's
121 set but never used.
122 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
123 (xg_create_tool_bar): Adjust users.
9a0d4f34 124
f9e7c67e
DA
1252012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
126
127 * buffer.h (BUF_COMPACT): New macro to follow the common style.
128 * buffer.c (Fget_buffer_create): Use it to set compact field of
129 struct buffer_text to avoid accessing an uninitialized value
130 when compact_buffer is called for the first time.
131 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
132 (Fset_buffer_modified_p): Use buffer_window_count to check
133 whether the buffer is displayed in some window.
134 * xdisp.c (message_dolog): Likewise.
f9e7c67e 135
299614f3
EZ
1362012-12-23 Eli Zaretskii <eliz@gnu.org>
137
40ff07a5
EZ
138 * w32.c (acl_set_file): If setting the file security descriptor
139 fails, and the new DACL is identical to the existing one, silently
140 return success. This fixes problems for users backing up their
141 own files without having the necessary privileges for setting
142 security descriptors.
143
299614f3
EZ
144 * w32proc.c (reader_thread): Do not index fd_info[] with negative
145 values.
146 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
147 after WaitForSingleObject returns normally. This expedites reader
148 thread shutdown when delete_child triggers it.
149 (reap_subprocess): More accurate commentary for why we call
150 delete_child only when cp->fd is negative.
151
152 * w32.c (sys_close): Do not call delete_child on a subprocess
153 whose handle is not yet closed. Instead, set its file descriptor
154 to a negative value, so that reap_subprocess will call
155 delete_child on that subprocess when its SIGCHLD arrives. This
156 avoids closing handles used for communications between sys_select
157 and reader_thread, which doesn't give sys_select a chance to
158 notice that the process exited and invoke the SIGCHLD handler for
159 it.
160
cf162aee
JD
1612012-12-23 Jan Djärv <jan.h.d@swipnet.se>
162
163 * nsfns.m (Fns_do_applescript): Run event loop until script has
164 been executed (Bug#12969).
165 (ns_run_ascript): Chech as_script for nil, set to nil after
166 executing script.
167
94900bfe
MR
1682012-12-22 Martin Rudalics <rudalics@gmx.at>
169
170 * window.c (Fselect_window): Reword doc-string (Bug#13248).
171
b2faf49c
EZ
1722012-12-22 Eli Zaretskii <eliz@gnu.org>
173
174 * w32term.c (w32fullscreen_hook): New function.
175 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
176
7efa3fb3
EZ
1772012-12-21 Eli Zaretskii <eliz@gnu.org>
178
bb085aed
EZ
179 * fileio.c (Finsert_file_contents): Doc fix.
180
7efa3fb3
EZ
181 * w32proc.c (new_child, delete_child, find_child_pid): For a
182 subprocess, consider its slot being in use as long as its process
183 handle (procinfo.hProcess) is not NULL. This avoids reusing the
184 slot when a new process is started immediately after killing
185 another one, without waiting enough time for the first process to
186 be reaped and resources allocated for it be orderly freed.
187 (Bug#13086)
188 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
189
c1f02afa
CY
1902012-12-21 Chong Yidong <cyd@gnu.org>
191
192 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
193
5bec25eb
CY
194 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
195
a4b0cca1 1962012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
197
198 * w32.c (get_name_and_id): Always pass NULL as the first argument
199 of lookup_account_sid. Avoids crashes with UNC file names that
200 refer to DFS domains, not to specific machine names. (Bug#12621)
201 Remove now unused argument FNAME; all callers changed.
202 (get_file_owner_and_group): Remove now unused argument FNAME; all
203 callers changed.
204
34b4b7eb
CY
2052012-12-21 Chong Yidong <cyd@gnu.org>
206
207 * editfns.c (Finsert_char): Since read-char-by-name now signals an
208 error for invalid chars, don't check for a nil return value.
209
13002885
DA
2102012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
211
212 Avoid calls to CHAR_TO_BYTE if byte position is known.
213 * editfns.c (make_buffer_string_both): Use move_gap_both.
214 (Fbuffer_string): Use make_buffer_string_both.
215 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
216 Adjust comment.
217 (buf_bytepos_to_charpos): Likewise.
218 (charpos_to_bytepos): Remove.
219 * fileio.c (Finsert_file_contents): Use move_gap_both.
220 * search.c (Freplace_match): Likewise.
9a0d4f34 221 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
222 names for byte positions.
223 * lisp.h (charpos_to_bytepos): Remove prototype.
224 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
225 * insdel.c (move_gap): Likewise.
226
99e9311c
PE
2272012-12-20 Paul Eggert <eggert@cs.ucla.edu>
228
229 * xdisp.c (redisplay_internal): Remove now-unused local.
230
e02230bf
SM
2312012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
232
233 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
234 (redisplay_internal): Don't bother selecting the frame to get the
235 proper value of frame-local variables.
236
1687fb14
DA
2372012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
238
239 * textprop.c (set_text_properties_1): Do not allow NULL interval.
240 Rename 4th argument since it may be buffer or string. Adjust comment.
241 * intervals.c (graft_intervals_info_buffer): Find an interval here.
242
a2f07cd2
DA
2432012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
244
245 * coding.c (Fdetect_coding_region): Do not check start and end with
246 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
247 (code_convert_region): Likewise.
248
474d441e
EZ
2492012-12-18 Eli Zaretskii <eliz@gnu.org>
250
251 * w32.c (acl_get_file, acl_set_file): Run the file name through
252 map_w32_filename, and resolve any symlinks in the file name, like
253 Posix platforms do.
254 (acl_set_file): Call revert_to_self, if any privileges were
255 enabled.
256
8725c076
JB
2572012-12-17 Juanma Barranquero <lekktu@gmail.com>
258
259 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
260 ($(BLD)/w32.$(O)): Update dependencies.
261
1e101a4b
SM
2622012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
263
264 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
265 propagate redisplay's scrolling (if any) to the right window.
266 (redisplay_internal): Use ensure_selected_frame.
267 (display_mode_lines): Complete last fix.
268 * window.c (select_window_1): New func, extracted from select_window.
269 (select_window): Use it.
270 * window.h (select_window_1): Declare.
271
66447e07
EZ
2722012-12-17 Eli Zaretskii <eliz@gnu.org>
273
274 Emulate Posix ACL APIs on MS-Windows.
275 * w32.c: Include sddl.h and sys/acl.h.
276 (SDDL_REVISION_1): Define if not already defined.
277 (g_b_init_get_security_descriptor_dacl)
278 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
279 (g_b_init_is_valid_security_descriptor)
280 (g_b_init_set_file_security): New static flags.
281 (globals_of_w32): Initialize them to zero.
282 (SetFileSecurity_Name): New string constant.
283 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
284 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
285 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
286 (IsValidSecurityDescriptor_Proc): New typedefs.
287 (get_file_security, get_security_descriptor_owner)
288 (get_security_descriptor_group): Set errno to ENOTSUP.
289 (set_file_security, get_security_descriptor_dacl)
290 (is_valid_security_descriptor, convert_sd_to_sddl)
291 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
292 (acl_free, acl_get_file, acl_set_file): New functions.
293
294 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
295
207a7ef0
PE
2962012-12-17 Paul Eggert <eggert@cs.ucla.edu>
297
298 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
299 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
300 for some of that bug's symptoms can now cause Emacs to abort.
301 Remove the workaround.
302 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
303 The bug that caused SIGCHLD to get lost has been fixed, and the
304 workaround for it can now cause Emacs to abort.
305
17fdfc15
PE
3062012-12-16 Paul Eggert <eggert@cs.ucla.edu>
307
308 * sysdep.c (emacs_abort): Bump backtrace size to 40.
309 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
310 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
311
7c3d167f
RF
3122012-12-16 Romain Francoise <romain@orebokech.com>
313
314 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
315 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 316 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
317 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
318
319 * Makefile.in (LIBACL_LIBS): New macro.
320 (LIBES): Use it.
321
7d80ea23
PE
3222012-12-15 Paul Eggert <eggert@cs.ucla.edu>
323
324 * fileio.c (internal_delete_file): Use bool for boolean.
325
b0728617
EZ
3262012-12-15 Eli Zaretskii <eliz@gnu.org>
327
328 Fix bug #13079 on MS-Windows with temp files not being deleted.
329 * w32.h (_child_process): New members input_file and
330 pending_deletion.
331 (register_child): First argument is now pid_t.
332 (record_infile, record_pending_deletion): New prototypes.
333
334 * w32proc.c (new_child): Initialize input_file and
335 pending_deletion members of the child.
336 (delete_child): Delete the child's temporary input file, if any,
337 that is pending deletion.
338 (register_child): First argument is now pid_t.
339 (record_infile, record_pending_deletion): New functions.
340 (reap_subprocess): Fix a typo in DebPrint string.
341 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
342
343 * fileio.c (internal_delete_file): Return an int again: non-zero
344 if delete-file succeeds, zero otherwise.
345
346 * lisp.h (internal_delete_file): Adjust prototype.
347
348 * callproc.c (Fcall_process): Don't overwrite infile with result
349 of DECODE_FILE.
350 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
351 asynchronous subprocess, record the name of the input file name,
352 if any.
353 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
354 delete the file, record it as pending deletion when the subprocess
355 exits.
356
7e90af26
EZ
3572012-12-14 Eli Zaretskii <eliz@gnu.org>
358
359 * editfns.c [HAVE_PWD_H]: Include grp.h.
360
361 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
362
97976f9f
PE
3632012-12-14 Paul Eggert <eggert@cs.ucla.edu>
364
365 Fix permissions bugs with setgid directories etc. (Bug#13125)
366 * dired.c (Ffile_attributes): Return t as the 9th attribute,
367 to mark it as a placeholder. The old value was often wrong.
368 The only user of this attribute has been changed to use
369 file-ownership-preserved-p instead, with its new group arg.
370 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
371
26ec1f49
SM
3722012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
373
ad966fe7
SM
374 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
375 Keep selected_window and selected_frame in sync.
26ec1f49 376
5c207910
EZ
3772012-12-14 Eli Zaretskii <eliz@gnu.org>
378
379 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
380 try to get accurate owner and group information from NT file
381 security APIs. This is to make most callers of 'stat' and
382 'lstat', which don't need that information, much faster.
383
26ec1f49
SM
384 * dired.c (Ffile_attributes) [WINDOWSNT]:
385 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
386 owner and group information from 'lstat'.
387
893f52d8
PE
3882012-12-13 Paul Eggert <eggert@cs.ucla.edu>
389
4c95c9a5
PE
390 * fileio.c (Finsert_file_contents): Don't put tail into head area,
391 as that confuses set-auto-coding, so insist on the head-read
392 returning the full 1024 bytes. Let lseek compute the tail offset;
393 less work for us. Do not ignore I/O errors when reading the tail.
394
893f52d8
PE
395 * xdisp.c: Minor style fixes.
396 (init_iterator): Hoist assignment out of if-expression.
397 (markpos_of_region): Callers now test for sign, not for -1.
398
40d1e434
DA
3992012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
400
401 Minor redisplay optimization when the region length is zero.
402 * xdisp.c (markpos_of_region): New function.
403 (init_iterator): Do not highlight the region of zero length.
404 (redisplay_window): Check whether the region is of non-zero length.
405 (try_cursor_movement): Allow if the region length is zero.
406 (try_window_reusing_current_matrix, try_window_id): Likewise.
407
727f9739 4082012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
409
410 * search.c (search_buffer): Check the inverse translations of each
411 character in pattern when the buffer being searched is unibyte.
412 (Bug#13084)
413
727f9739 4142012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
415
416 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
417 files, fixing a regression from 24.2.
645c6a30 418 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 419
d20704ef
PE
4202012-12-13 Paul Eggert <eggert@cs.ucla.edu>
421
422 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
423 fstat shouldn't fail, and if it does fail copy-file should not proceed.
424 Remove unnecessary S_ISLNK test, as (contra the comments) this
425 function can't copy symlinks. Improve quality of error message
426 when attempting to copy files that are neither regular files nor
427 directories.
428
2dd61a9b
DA
4292012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
430
431 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
432 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
433 * window.c (Frecenter):
434 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
435 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
436
cc98b684
DC
4372012-12-12 Daniel Colascione <dancol@dancol.org>
438
1e101a4b 439 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
440 the dumped Emacs is not a sparse file, greatly improving Cygwin
441 "make bootstrap" performance.
442
38e791fd
MA
4432012-12-11 Michael Albinus <michael.albinus@gmx.de>
444
445 * inotify.c (inotify_callback): Generate an Emacs event for every
446 incoming inotify event.
447
f9d1448f
EZ
4482012-12-11 Eli Zaretskii <eliz@gnu.org>
449
450 * xdisp.c (handle_face_prop): Fix logic of computing
451 it->start_of_box_run_p.
452 (append_space_for_newline): If the glyph row is R2L, reset the
453 iterator's end_of_box_run_p flag before prepending the space glyph.
454 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
455 iterator's start_of_box_run_p flag before prepending the stretch.
456 (append_glyph, produce_image_glyph, append_composite_glyph)
457 (append_stretch_glyph, append_glyphless_glyph): Reverse the
458 left_box_line_p and right_box_line_p flags of the glyph for R2L
459 glyph rows. (Bug#13011)
460
c6afe371
DA
4612012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
462
463 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
464 if changed buffer is not shown in a window.
465 * insdel.c (prepare_to_modify_buffer): Likewise.
466 * window.c (replace_buffer_in_windows_safely): Do nothing
467 if buffer is not shown in a window.
468 (Fforce_window_update): Likewise if string or buffer argument
469 is passed.
470
1b47babd
EZ
4712012-12-11 Eli Zaretskii <eliz@gnu.org>
472
473 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
474 encoded_file_name, which is what it is.
475
4c1acb95
DA
4762012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
477
478 Consistently use marker_position and marker_byte_position.
479 * fringe.c (Ffringe_bitmaps_at_pos):
480 * indent.c (Fvertical_motion):
481 * insdel.c (prepare_to_modify_buffer):
482 * keyboard.c (make_lispy_position):
483 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
484 (window_scroll_pixel_based, displayed_window_lines)
485 (Fset_window_configuration):
486 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
487 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
488 Replace direct access to marker fields with calls
489 to marker_position and/or marker_byte_position.
490
0eeb69fe
JB
4912012-12-11 Juanma Barranquero <lekktu@gmail.com>
492
493 * makefile.w32-in (SIG2STR_H): New macro.
494 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
495 ($(BLD)/w32notify.$(O)): Update dependencies.
496
1cf1bbd5
DC
4972012-12-10 Daniel Colascione <dancol@dancol.org>
498
8db4b52f
DC
499 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
500 Windows file notification functionality unless WINDOWSNT.
501
1cf1bbd5
DC
502 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
503 declarations.
504
505 * w32fns.c (cache_system_info): Initialize the global hinst
506 variable here so various initialization calls DTRT.
507
1e101a4b 508 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
509 (hinst): Remove unneeded extern declaration.
510 (_start): Remove initialization of above variables; remove
511 initialization of hinst, as cache_system_info now does that.
512
513 * emacs.c (main): Call cache_system_info early in startup; we
514 previously weren't calling it in Cygwin builds.
515
26ec1f49
SM
516 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
517 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
518 and link it to Emacs.
519
98a07056
DA
5202012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
521
522 Per-buffer window counters.
523 * buffer.h (struct buffer): New member window_count.
524 (buffer_window_count): New function.
525 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
526 Initialize window_count.
527 (Fkill_buffer): Verify window_count for the buffer being killed.
528 (modify_overlay): Do not force redisplay if buffer is not shown
529 in any window.
530 (init_buffer_once): Initialize window_count for buffer_defaults
531 and buffer_local_symbols.
532 * window.h (buffer_shared): Remove declaration.
533 (wset_buffer): Convert from inline ...
534 * window.c (wset_buffer): ... to an ordinary function.
535 (adjust_window_count): New function.
536 (make_parent_window): Use it.
537 * xdisp.c (buffer_shared): Remove.
538 (redisplay_internal, redisplay_window): Adjust users.
539 (buffer_shared_and_changed): Use per-buffer window counter.
540
2b8c9064
EZ
5412012-12-10 Eli Zaretskii <eliz@gnu.org>
542
543 Support for filesystem notifications on MS-Windows.
544 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
545 and this is a TTY frame, signal the caller that keyboard input is
546 available.
547
548 * w32xfns.c (drain_message_queue): Now returns an int: an
549 indication whether any WM_EMACS_FILENOTIFY messages were found in
550 the queue.
551
552 * w32inevt.c (handle_file_notifications): New function.
553 (w32_console_read_socket): Call it to process file notifications.
554
555 * w32console.c (initialize_w32_display): Record the main thread ID
556 in dwMainThreadId.
557
558 * deps.mk (inotify.o): New dependency list.
559
560 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
561
562 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
563 (WM_EMACS_END): Bump value by 1.
564 (notification_buffer_in_use, file_notifications)
565 (notifications_size, notifications_desc): Declare.
566 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
567 Add prototypes.
568
569 * w32term.c (lispy_file_action, queue_notifications): New functions.
570 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
571 <Qrenamed_to>: New symbols.
572 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
573
574 * w32notify.c: New file, implements file event notifications for
575 MS-Windows.
576
577 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
578 by posting it to the w32_read_socket queue.
579
1e101a4b 580 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
581
582 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
583 (GLOBAL_SOURCES): Add w32notify.c
584 ($(BLD)/w32notify.$(O)): New set of dependencies.
585
586 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
587
1e101a4b
SM
588 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
589 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
590 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
591 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
592 w32notify-handle-event by default.
593
594 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
595 syms_of_w32notify.
596
81606b10
RS
5972012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
598
2b8c9064 599 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 600 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
601
602 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
603
604 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
605 (syms_of_keyboard): DEFSYM it.
606 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
607 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
608 Qfile_inotify events.
609 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
610 special-event-map to inotify-handle-event.
611
612 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
613
614 * Makefile.in (base_obj): Add inotify.o.
615
616 * inotify.c: New file.
617
265c2fbf 6182012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
619
620 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
621
265c2fbf 6222012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
623
624 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
625 DWORD_PTR, for compatibility with 64-bit builds.
626
a06ae17d 627 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
628 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
629 (system_process_attributes): Use SIZE_T rather than DWORD, for
630 compatibility with 64-bit builds.
631
265c2fbf 6322012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
633
634 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
635
265c2fbf 6362012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
637
638 * indent.c (Fvertical_motion): If a display string will be
639 displayed on the left or the right margin, don't consider it as a
640 factor in cursor positioning. (Bug#13108)
641
265c2fbf 6422012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
643
644 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
645
5f460827
PE
6462012-12-10 Paul Eggert <eggert@cs.ucla.edu>
647
648 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
649 for string length.
650
a16e75cd
EZ
6512012-12-08 Eli Zaretskii <eliz@gnu.org>
652
653 * w32.c (unsetenv): Return 0 if the input string is too long.
654
5745a7df
PE
6552012-12-08 Paul Eggert <eggert@cs.ucla.edu>
656
657 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
658 * alloc.c (xputenv): New function.
659 * dbusbind.c (Fdbus_init_bus):
660 * emacs.c (main):
661 * xterm.c (x_term_init):
662 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
663 * editfns.c (initial_tz): Move static var decl up.
664 (tzvalbuf_in_environ): New static var.
665 (init_editfns): Initialize these two static vars.
666 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
667 Save old TZ value on stack, if it's small.
668 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
669 instead, use xputenv+unsetenv to set and restore TZ.
670 (environbuf): Remove static var. All uses removed.
671 (Fset_time_zone_rule): Do not save TZ and environ;
672 no longer needed here.
673 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
674 Move to inside set_time_zone_rule; they don't need file scope any more.
675 (set_time_zone_rule): Maintain the TZ=value string separately.
676 (syms_of_editfns): Don't initialize initial_tz;
677 init_editfns now does it.
678 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
679 * lisp.h (xputenv): New decl.
680
c56efa40
FP
6812012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
682
683 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
684
75ceee05
EZ
6852012-12-08 Eli Zaretskii <eliz@gnu.org>
686
687 * w32.c (unsetenv, sys_putenv): New functions.
688
1b6dbfeb
CY
6892012-12-08 Chong Yidong <cyd@gnu.org>
690
691 * editfns.c (Finsert_char): Make the error message more
692 informative (Bug#12992).
693
d983a10b
PE
6942012-12-08 Paul Eggert <eggert@cs.ucla.edu>
695
7be78020
PE
696 Simplify get_lim_data.
697 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
698 Remove USG and vlimit methods; no longer used these days.
699 Add #error catchall just in case.
700
d983a10b
PE
701 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
702 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
703 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
704 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
705 (deleted_pid_list, Fdelete_process, create_process)
706 (record_child_status_change, handle_child_signal, deliver_child_signal)
707 (init_process_emacs, syms_of_process):
708 Assume SIGCHLD is defined.
709 (parse_signal): Remove. All uses removed.
710 (abbr_to_signal): New static function.
711 (Fsignal_process): Use it to convert signal names to ints.
712 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
713 kill (getpgrp (), ...).
714 (emacs_sigaction_init): Assume SIGCHLD is defined.
715 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
716 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
717 * syssignal.h (EMACS_KILLPG): Remove.
718 All uses replaced by 'kill' with a negative pid.
719 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
720 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
721
9cdde1e2
PE
7222012-12-07 Paul Eggert <eggert@cs.ucla.edu>
723
724 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
725 This will cause a production Emacs to dump core instead of
726 infinite-looping.
727
822995f8
DA
7282012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
729
730 * frame.c (make_frame): Do not set window's buffer to t.
731 * window.c (Fsplit_window_internal): Likewise. Previously it was
732 used to indicate that the window is being set up. Now we use
733 set_window_buffer for all new windows, so the condition in ...
734 (Fset_window_buffer): ... is always true and can be removed.
735
ed08365b
DA
7362012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
737
738 Convenient macro to check whether the buffer is hidden.
739 * buffer.h (BUFFER_HIDDEN_P): New macro.
740 * frame.c (make_frame): Use it. Adjust comment.
741 * buffer.c (candidate_buffer): New function.
742 (Fother_buffer, other_buffer_safely): Use it.
743
e86f5134
EZ
7442012-12-06 Eli Zaretskii <eliz@gnu.org>
745
746 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
747 if the child process is still running. Instead, exit the wait
748 loop and return zero. (Bug#13086)
749
1700db3c
DA
7502012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
751
752 * frame.h (x_char_width, x_char_height): Remove prototypes.
753 * w32term.h (x_char_width, x_char_height): Likewise.
754 * xfns.c (x_char_width, x_char_height): Remove.
755 * w32fns.c (x_char_width, x_char_height): Likewise.
756 * nsfns.c (x_char_width, x_char_height): Likewise.
757 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
758 all window frames.
759 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
760 * keyboard.c (command_loop_1): Remove prototype.
761 (command_loop_2, top_level_1): Add static to match prototype.
762
35fb8050
PE
7632012-12-06 Paul Eggert <eggert@cs.ucla.edu>
764
765 Fix a recently-introduced delete-process race condition.
766 * callproc.c, process.h (record_kill_process):
767 New function, containing part of the old call_process_kill.
768 (call_process_kill): Use it.
769 This does not change call_process_kill's behavior.
770 * process.c (Fdelete_process): Use record_kill_process to fix a
771 race condition that could cause Emacs to lose track of a child.
772
565212e5
DA
7732012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
774
775 Avoid code duplication between prev_frame and next_frame.
776 * frame.c (candidate_frame): New function. Add comment.
777 (prev_frame, next_frame): Use it. Adjust comment.
778
d8ad4d3f 7792012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
780
781 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
782 fails, signal an error instead of continuing with an empty
783 string. (Bug#13079)
7c2fcf9b
EZ
784 Encode expanded temp file pattern before passing it to mkstemp or
785 mktemp.
d3cefd13 786
2e7cddd3
EZ
787 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
788 Encode the file name before passing it to dostounix_filename, in
789 case it will downcase it (under w32-downcase-file-names).
790 (Bug#12933)
791
644d3f0d
PE
7922012-12-05 Paul Eggert <eggert@cs.ucla.edu>
793
794 Minor call-process cleanups.
795 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
796 at the same time as other platforms, to simplify analysis.
797 No need for fd0_volatile since we have synch_process_fd.
798 Avoid needless emacs_close; arg is always negative.
799
396376f1
AS
8002012-12-04 Andreas Schwab <schwab@linux-m68k.org>
801
802 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
803 processes.
804
350f51ad
DA
8052012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
806
807 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
808 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
809 and mouse_face_hidden members to a bitfields.
810 * frame.h (struct frame): Remove set-but-not-used space_width member.
811 (FRAME_SPACE_WIDTH): Remove.
812 * nsterm.m, w32term.c, xterm.c: Adjust users.
813 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
814 member. Adjust users. Convert term_initted, delete_in_insert_mode,
815 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
816 members to a bitfields.
817
bc9dbce6
PE
8182012-12-03 Paul Eggert <eggert@cs.ucla.edu>
819
bb5f74ee
PE
820 Don't let call-process be a zombie factory (Bug#12980).
821 Fixing this bug required some cleanup of the signal-handling code.
822 As a side effect, this change also fixes a longstanding rare race
823 condition whereby Emacs could mistakenly kill unrelated processes,
824 and it fixes a bug where a second C-g does not kill a recalcitrant
825 synchronous process in GNU/Linux and similar platforms.
826 The patch should also fix the last vestiges of Bug#9488,
827 a bug which has mostly been fixed on the trunk by other changes.
828 * callproc.c, process.h (synch_process_alive, synch_process_death)
829 (synch_process_termsig, sync_process_retcode):
830 Remove. All uses removed, to simplify analysis and so that
831 less consing is done inside critical sections.
832 * callproc.c (call_process_exited): Remove. All uses replaced
833 with !synch_process_pid.
834 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
835 These take the role of what used to be in unwind-protect arg.
836 All uses changed.
837 (block_child_signal, unblock_child_signal):
838 New functions, to avoid races that could kill innocent-victim processes.
839 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
840 (call_process_kill): Record killed processes as deleted, so that
841 zombies do not clutter up the system. Do this inside a critical
842 section, to avoid a race that would allow the clutter.
843 (call_process_cleanup): Fix code so that the second C-g works again
844 on common platforms such as GNU/Linux.
845 (Fcall_process): Create the child process in a critical section,
846 to fix a race condition. If creating an asynchronous process,
847 record it as deleted so that zombies do not clutter up the system.
848 Do unwind-protect for WINDOWSNT too, as that's simpler in the
849 light of these changes. Omit unnecessary call to emacs_close
850 before failure, as the unwind-protect code does that.
851 * callproc.c (call_process_cleanup):
852 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
853 * process.c (record_deleted_pid): New function, containing
854 code refactored out of Fdelete_process.
855 (Fdelete_process): Use it.
856 (process_status_retrieved): Remove. All callers changed to use
857 child_status_change.
858 (record_child_status_change): Remove, folding its contents into ...
859 (handle_child_signal): ... this signal handler. Now, this
860 function is purely a handler for SIGCHLD, and is not called after
861 a synchronous waitpid returns; the synchronous code is moved to
862 wait_for_termination. There is no need to worry about reaping
863 more than one child now.
864 * sysdep.c (get_child_status, child_status_changed): New functions.
865 (wait_for_termination): Now takes int * status and bool
866 interruptible arguments, too. Do not record child status change;
867 that's now the caller's responsibility. All callers changed.
868 Reimplement in terms of get_child_status.
869 (wait_for_termination_1, interruptible_wait_for_termination):
870 Remove. All callers changed to use wait_for_termination.
871 * syswait.h: Include <stdbool.h>, for bool.
872 (record_child_status_change, interruptible_wait_for_termination):
873 Remove decls.
874 (record_deleted_pid, child_status_changed): New decls.
875 (wait_for_termination): Adjust to API changes noted above.
876
bc9dbce6
PE
877 * bytecode.c, lisp.h (Qbytecode): Remove.
878 No longer needed after 2012-11-20 interactive-p changes.
879
3cf3c607
EZ
8802012-12-03 Eli Zaretskii <eliz@gnu.org>
881
882 * xdisp.c (redisplay_window): If the cursor is visible, but inside
883 the scroll margin, move point outside the margin. (Bug#13055)
884
005c8d13
JD
8852012-12-03 Jan Djärv <jan.h.d@swipnet.se>
886
887 * gtkutil.c (my_log_handler): New function.
888 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
889
20edc1c9
DA
8902012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
891
892 * lisp.h (modify_region): Rename to...
893 (modify_region_1): ...new prototype.
894 * textprop.c (modify_region): Now static. Adjust users.
895 * insdel.c (modify_region): Rename to...
896 (modify_region_1): ...new function to work with current buffer.
897 Adjust comment and users. Use true and false for booleans.
898
62c2e5ed
DA
8992012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
900
901 * alloc.c (free_save_value): New function.
902 (safe_alloca_unwind): Use it.
903 * lisp.h (free_save_value): New prototype.
904 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
905 Add comment.
906 (save_excursion_restore): Adjust to match saved data structure.
907 Use free_save_value to offload some work from GC. Drop obsolete
908 #if 0 code.
909
c5bc2d1d 9102012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
911
912 * fileio.c (Vauto_save_list_file_name): Doc fix.
913
c5bc2d1d 9142012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
915
916 * w32fns.c: Remove prototype of atof.
1e101a4b 917 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 918 builds.
1e101a4b 919 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
920
921 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
922 with 64-bit builds.
923
924 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
925 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
926 defined.
927
c5bc2d1d 9282012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 929
a9de9f0c 930 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 931
21e54a94
PE
9322012-12-02 Paul Eggert <eggert@cs.ucla.edu>
933
2dd2e622
PE
934 Fix xpalloc confusion after memory is exhausted.
935 * alloc.c (xpalloc): Comment fix.
936 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
937 and signals an error, do not clear charset_table_size, as
938 charset_table is still valid.
939 * doprnt.c (evxprintf): Clear *BUF after freeing it.
940
21e54a94
PE
941 Use execve to avoid need to munge environ (Bug#13054).
942 * callproc.c (Fcall_process):
943 * process.c (create_process):
944 Don't save and restore environ; no longer needed.
945 * callproc.c (child_setup):
946 Use execve, not execvp, to preserve environ.
947
3e5490f7
PE
9482012-12-01 Paul Eggert <eggert@cs.ucla.edu>
949
950 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
951
75b4f59c
YM
9522012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
953
954 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
955 display for sliced images (Bug#10500).
956
957 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
958
f8aff4c6
JB
9592012-11-30 Juanma Barranquero <lekktu@gmail.com>
960
961 * doc.c (Fdocumentation): Re-add handling of function-documentation,
962 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
963
3940b924
DA
9642012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
965
966 * xdisp.c (window_outdated): Remove eassert since it hits
967 some suspicious corner cases (see Bug#13007 and Bug#13012).
968 (mode_line_update_needed): New function.
969 (redisplay_internal, redisplay_window): Use it.
970 (ensure_selected_frame): New function.
971 (redisplay_internal, unwind_redisplay): Use it.
972 (redisplay_internal): Move comment about buffer_shared...
973 (buffer_shared_and_changed): ...near to its real use.
974
4a9204fe
PE
9752012-11-29 Paul Eggert <eggert@cs.ucla.edu>
976
977 * callproc.c (Fcall_process): Don't misreport vfork failure.
978
60aeceb8
PE
9792012-11-28 Paul Eggert <eggert@cs.ucla.edu>
980
981 * callproc.c (Fcall_process): Fix vfork portability problems.
982 Do not assume that fd[0], count, filefd, and save_environ survive
983 vfork. Fix bug whereby wrong errno value could be reported for
984 pipe failure. Some minor cleanups, too, as follows. Move buf and
985 bufsize to the context where they're needed. Change new_argv to
986 be of type char **, as this is more convenient and avoids casts.
987 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
988 Now local constants, not macros.
989
00dc3ead
KH
9902012-11-18 Kenichi Handa <handa@gnu.org>
991
992 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
993 for the variable "f".
994
e1bf05c1
KH
9952012-11-13 Kenichi Handa <handa@gnu.org>
996
997 * font.c (font_unparse_xlfd): Exclude special characters from the
998 generating XLFD name.
999
22626a85
PE
10002012-11-27 Paul Eggert <eggert@cs.ucla.edu>
1001
350e0088
PE
1002 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
1003 * dired.c (stat_uname, stat_gname):
1004 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
1005
22626a85
PE
1006 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
1007 * dired.c (directory_files_internal, file_name_completion):
1008 Assume EAGAIN and EINTR are defined.
350e0088 1009
22626a85
PE
1010 * fileio.c (Fcopy_file): Assume EISDIR is defined.
1011 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
1012 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
1013 * lread.c (readbyte_from_file): Assume EINTR is defined.
1014 * process.c (wait_reading_process_output, send_process) [subprocesses]:
1015 Assume EIO and EAGAIN are defined.
1016 * unexcoff.c (write_segment): Assume EFAULT is defined.
1017
5c9cf0a3 10182012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
1019
1020 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
1021 (Bug#11964)
1022
22294a56
EZ
1023 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
1024 highlighting on the frame was cleared. Prevents assertion
1025 violations when repeatedly clicking on the "Top" link of the
1026 "bread-crumbs" in Info buffers.
1027
5fbab051
PE
10282012-11-25 Paul Eggert <eggert@cs.ucla.edu>
1029
1030 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
1031
bcd77a2b
KB
10322012-11-24 Ken Brown <kbrown@cornell.edu>
1033
1034 * keyboard.c (HAVE_MOUSE):
1035 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
1036 were always defined.
1037
d125ca15 10382012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 1039
24becea4
EZ
1040 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
1041 between bpos_covered and bpos_max. This fixes cursor display when
1042 several display strings follow each other.
1043
8654a41b
EZ
1044 * .gdbinit (pgx): If the glyph's object is a string, display the
1045 pointer to string data, rather than the value of the string object
1046 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
1047
cb5867b1
EZ
1048 * indent.c (Fvertical_motion): If the starting position is covered
1049 by a display string, return to one position before that, to avoid
1050 overshooting it inside move_it_to. (Bug#12930)
1051
f418b22e
DA
10522012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
1053
1054 * frame.h (struct frame): Remove display_preempted member
1055 since all users are dead long ago.
1056 * nsterm.h (struct x_output): Use the only dummy member.
1057 * w32menu.c (pending_menu_activation): Remove since not
1058 really used.
1059 (set_frame_menubar): Adjust user.
1060 * w32term.h (struct x_output): Drop outdated #if 0 code.
1061 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
1062 asked_for_visible and menubar_active members.
1063 Drop unused pending_menu_activation member.
f418b22e
DA
1064 * xterm.h (struct x_output): Drop outdated #if 0 code.
1065 Use bitfields for explicit_parent, asked_for_visible,
1066 has_been_visible and net_wm_state_hidden_seen members.
1067
a879f0ea
EZ
10682012-11-23 Eli Zaretskii <eliz@gnu.org>
1069
1070 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
1071 of a literal "/". (Bug#12955)
1072 (gl-stamp): Invoke fc.exe directly, not through cmd.
1073
95ef7787
PE
10742012-11-23 Paul Eggert <eggert@cs.ucla.edu>
1075
1076 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
1077 * dired.c: Assume HAVE_DIRENT_H.
1078 (NAMLEN): Remove, replacing with ...
1079 (dirent_namelen): New function. All uses changed. Use the GNU macro
1080 _D_EXACT_NAMELEN if available, as it's faster than strlen.
1081 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
1082 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
1083 * makefile.w32-in (DIR_H): Remove. All uses replaced with
1084 $(NT_INC)/dirent.h.
1085 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
1086 * ndir.h: Rename to ../nt/inc/dirent.h.
1087 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
1088 Do not include <dirent.h>; no longer needed.
1089 * w32.c: Include <dirent.h> rather than "ndir.h".
1090
12645ae6
CY
10912012-11-23 Chong Yidong <cyd@gnu.org>
1092
1093 * xftfont.c (xftfont_open): Remove duplicate assignment.
1094
5c747675
DA
10952012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1096
1097 * alloc.c (Fgarbage_collect): Unblock input after clearing
1098 gc_in_progress to avoid note_mouse_highlight glitch with GC.
1099 * frame.h (FRAME_MOUSE_UPDATE): New macro.
1100 * msdos.c (IT_frame_up_to_date): Use it here...
1101 * w32term.c (w32_frame_up_to_date): ...here...
1102 * xterm.c (XTframe_up_to_date): ...and here...
1103 * nsterm.m (ns_frame_up_to_date): ...but not here.
1104 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
1105 Adjust users.
1106 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
1107 Do not check whether GC is in progress.
1108
6ceeb5f1
DA
11092012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
1110
1111 * xdisp.c (window_buffer_changed): New function.
1112 (update_menu_bar, update_tool_bar): Use it to
1113 simplify large 'if' statements.
1114 (redisplay_internal): Generalize commonly used
1115 'tail' and 'frame' local variables.
1116
ec84768f
EZ
11172012-11-22 Eli Zaretskii <eliz@gnu.org>
1118
1119 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
1120 with Windows system header.
1121
9239d970
PE
11222012-11-21 Paul Eggert <eggert@cs.ucla.edu>
1123
1124 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
1125 * alloc.c: Assume unistd.h exists.
1126 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
1127 * sysdep.c (get_current_dir_name): Assume getcwd exists.
1128 (getwd) [USG]: Remove; no longer needed.
1129 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
1130 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
1131 * w32.h (getcwd): Remove decl.
1132
954bba56
SM
11332012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
1134
1135 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
1136 Make it set selected_window as well.
1137 (update_tool_bar): Use it.
1138
6ef2e5ef 11392012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
1140
1141 * emacs.c (main): Set the G_SLICE environment variable for all
1142 Cygwin builds, not just GTK builds. See
1143 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
1144
6ef2e5ef 11452012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
1146
1147 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1148 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
1149 Define for the MSVC compiler.
1150
6ef2e5ef 1151 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
1152
1153 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
1154 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
1155 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
1156 dostounix_filename assumes it gets a unibyte string.
1157 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
1158 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
1159
eadf1faa
SM
11602012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1161
1162 Conflate Qnil and Qunbound for `symbol-function'.
1163 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
1164 * lread.c (init_obarray): Set `function' fields to Qnil.
1165 * eval.c (Fcommandp): Ignore Qunbound.
1166 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
1167 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
1168 Test NILP rather than Qunbound.
1169 (Ffmakunbound): Set to Qnil.
1170 (Fsymbol_function): Never signal an error.
1171 (Finteractive_form): Ignore Qunbound.
1172
b83fdfa9
PE
11732012-11-20 Paul Eggert <eggert@cs.ucla.edu>
1174
1175 * eval.c (interactive_p): Remove no-longer-used decl.
1176
952580c5
DA
11772012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
1178
1179 * xdisp.c (buffer_shared): Adjust comment.
1180 (buffer_shared_and_changed): New function.
1181 (prepare_menu_bars, redisplay_internal): Use it to
1182 decide whether all windows or frames should be updated.
ea6de9b1
DA
1183 (window_outdated): New function.
1184 (text_outside_line_unchanged_p, redisplay_window): Use it.
1185 (redisplay_internal): Likewise. Fix indentation.
952580c5 1186
23ba2705
SM
11872012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1188
1189 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
1190 (syms_of_eval): Remove corresponding defsubr.
1191 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
1192
6e9f7997
DC
11932012-11-19 Daniel Colascione <dancol@dancol.org>
1194
1195 * w32fns.c (Fx_file_dialog):
1196 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
1197 cygwin_convert_file_name*.
1198
1199 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
1200 Rename cygwin_convert_path* to cygwin_convert_file_name*.
1201
552a1590
PE
12022012-11-18 Paul Eggert <eggert@cs.ucla.edu>
1203
1204 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
1205
2ac9538d 12062012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
1207
1208 * w32select.c: Include w32common.h before w32term.h, so that
1209 windows.h gets included before w32term.h uses some of its
1210 features, see below.
1211
23ba2705
SM
1212 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
1213 New typedefs.
1214 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
1215 New prototypes.
d8715cdf
EZ
1216 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
1217
2ac9538d 12182012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
1219
1220 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
1221 (ns_select): Return at once if events are held (Bug#12834).
1222
2ac9538d 12232012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 1224
1225 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
1226 Needed following 2012-10-20 change. (Bug#12902)
1227
c1f7ba3a
JB
12282012-11-18 Juanma Barranquero <lekktu@gmail.com>
1229
1230 * w32proc.c (waitpid): Remove unused label get_result.
1231
a75ce9d3
JB
12322012-11-17 Juanma Barranquero <lekktu@gmail.com>
1233
1234 * makefile.w32-in (SYSWAIT_H): New macro.
1235 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
1236 ($(BLD)/sysdep.$(O)): Update dependencies.
1237
49cdacda
PE
12382012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1239
1240 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
1241 * callproc.c (relocate_fd): Assume F_DUPFD.
1242 * emacs.c, term.c (O_RDWR): Remove.
1243 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
1244 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
1245 * nsterm.m: Assume <fcntl.h> exists.
1246 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
1247 (create_pty, Fmake_network_process, server_accept_connection)
1248 (wait_reading_process_output, init_process_emacs):
1249 Assume O_NONBLOCK.
1250 (wait_reading_process_output): Put in a special case for WINDOWSNT
1251 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
1252 It's not clear this is needed, but it's a more-conservative change.
1253 (create_process): Assume FD_CLOEXEC.
1254 (create_process, create_pty): Assume O_NOCTTY.
1255 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
1256 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
1257 Omit if not DOS_NT, since F_GETFL is not defined there.
1258 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
1259 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
1260 (O_NOCTTY): Remove.
1261 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
1262 lack it, since gnulib guarantees this.
1263 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
1264
22bae83f
EZ
12652012-11-17 Eli Zaretskii <eliz@gnu.org>
1266
6ad30855
EZ
1267 * w32.c (faccessat): Pretend that directories have the execute bit
1268 set. Emacs expects that, e.g., in files.el:cd-absolute.
1269
22bae83f
EZ
1270 * w32proc.c (create_child): Don't clip the PID of the child
1271 process to fit into an Emacs integer, as this is no longer a
1272 restriction.
1273 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
1274 reaping only the process specified by PID argument, if that is
1275 positive. Use PID instead of dead_child to know which process to
1276 reap. Wait for the child to die only if WNOHANG is not in
1277 OPTIONS.
1278 (sys_select): Don't set dead_child.
1279
1280 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
1281 as it is no longer needed.
1282
1283 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
1284 no longer needed.
1285 (record_child_status_change): Remove the setting of
1286 record_at_most_one_child for the !WNOHANG case.
1287
a631d0e0
PE
12882012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1289
1290 Fix problems in ns port found by static checking.
1291 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
1292 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
1293 not to process group.
1294 (ns_select): Use emacs_write, not write, as that's more robust
1295 in the presence of signals.
1296 (fd_handler:): Check for read errors.
1297
d56f2e49
GM
12982012-11-16 Glenn Morris <rgm@gnu.org>
1299
1300 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
1301
96e05507 13022012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
1303
1304 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
1305
96e05507 13062012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
1307
1308 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
1309 use the same value of thread handle.
1310 (start_timer_thread): If the timer thread exited (due to error),
1311 clean up by closing the two handles it used. Duplicate the caller
1312 thread's handle here, so it gets duplicated only once, when
1313 launching the timer thread. Set priority of the timer thread, not
1314 the caller thread.
1315 (getitimer): Don't duplicate the caller thread's handle here.
1316 (Bug#12832)
1317
96e05507 13182012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
1319
1320 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
1321 called (Bug#12834).
1322
3d082a26
PE
13232012-11-16 Paul Eggert <eggert@cs.ucla.edu>
1324
1325 Remove no-longer-used pty_max_bytes variable.
1326 * process.c (pty_max_bytes): Remove; unused.
1327 (send_process): Do not set it.
1328
b72c161c
JB
13292012-11-15 Juanma Barranquero <lekktu@gmail.com>
1330
1331 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
1332 Update dependencies.
1333
bf20ea80
PE
13342012-11-15 Paul Eggert <eggert@cs.ucla.edu>
1335
1336 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
1337 This follows up on the 2012-09-29 patch that removed indirection
1338 for the 'function' field. Reported by Sergey Vinokurov in
1339 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
1340
14f20728
EZ
13412012-11-14 Eli Zaretskii <eliz@gnu.org>
1342
1343 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
1344 different name, as the MS runtime does not have such a function,
1345 and probably never will.) All callers changed. Ignore DIRFD
1346 value if PATH is an absolute file name, to match Posix spec
1347 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
1348 symlinks.
1349
77731919
DA
13502012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
1351
1352 * xdisp.c (echo_area_display, redisplay_internal):
1353 Omit redundant check whether frame_garbaged is set.
1354
73dcdb9f
PE
13552012-11-14 Paul Eggert <eggert@cs.ucla.edu>
1356
1357 Use faccessat, not access, when checking file permissions (Bug#12632).
1358 This fixes a bug that has been present in Emacs since its creation.
1359 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
1360 which must set some sort of record. (Torek's bug report was against
1361 a predecessor of GNU Emacs, but GNU Emacs happened to have the
1362 same common flaw.) See Torek's Usenet posting
1363 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
1364 Posted: Fri Apr 8 14:18:56 1983.
1365 * Makefile.in (LIB_EACCESS): New macro.
1366 (LIBES): Use it.
1367 * callproc.c (init_callproc):
1368 * charset.c (init_charset):
1369 * fileio.c (check_existing, check_executable, check_writable)
1370 (Ffile_readable_p):
1371 * lread.c (openp, load_path_check):
1372 * process.c (allocate_pty):
1373 * xrdb.c (file_p):
1374 Use effective UID when checking permissions, not real UID.
1375 * callproc.c (init_callproc):
1376 * charset.c (init_charset):
1377 * lread.c (load_path_check, init_lread):
1378 Test whether directories are accessible, not merely whether they exist.
1379 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
1380 * fileio.c (check_existing, check_executable, check_writable)
1381 (Ffile_readable_p):
1382 Use symbolic names instead of integers for the flags, as they're
1383 portable now.
1384 (check_writable): New arg AMODE. All uses changed.
1385 Set errno on failure.
1386 (Ffile_readable_p): Use faccessat, not stat + open + close.
1387 (Ffile_writable_p): No need to call check_existing + check_writable.
1388 Just call check_writable and then look at errno. This saves a syscall.
1389 dir should never be nil; replace an unnecessary runtime check
1390 with an eassert. When checking the parent directory of a nonexistent
1391 file, check that the directory is searchable as well as writable, as
1392 we can't create files in unsearchable directories.
1393 (file_directory_p): New function, which uses 'stat' on most platforms
1394 but faccessat with D_OK (for efficiency) if WINDOWSNT.
1395 (Ffile_directory_p, Fset_file_times): Use it.
1396 (file_accessible_directory_p): New function, which uses a single
1397 syscall for efficiency.
1398 (Ffile_accessible_directory_p): Use it.
1399 * xrdb.c (file_p): Use file_directory_p.
1400 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
1401 * lread.c (openp): When opening a file, use fstat rather than
1402 stat, as that avoids a permissions race. When not opening a file,
1403 use file_directory_p rather than stat.
1404 (dir_warning): First arg is now a usage string, not a format.
1405 Use errno. All uses changed.
1406 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1407 that merely introduced a race.
1408 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1409 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1410 and similarly for the other O_* flags.
1411 * w32.c (sys_faccessat): Rename from sys_access and switch to
1412 faccessat's API. All uses changed.
1413 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1414 (magic_db): Rename from magic_file_p.
1415 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1416 char *, so that we don't have to test for file existence
1417 separately from opening the file for reading. This removes a race
1418 fixes a permission-checking problem, and simplifies the code.
1419 All uses changed.
1420 (file_p): Remove; no longer needed.
1421
2a14f83b
DA
14222012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1423
1424 Omit glyphs initialization at startup.
1425 * dispnew.c (glyphs_initialized_initially_p): Remove.
1426 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1427 (Fredraw_frame): Move actual code from here...
c7085245 1428 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
1429 (Fredraw_display): Use redraw_frame.
1430 * xdisp.c (clear_garbaged_frames): Likewise.
1431
f78ee6af 14322012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
1433
1434 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1435 passed to pint2str and pint2hrstr to be at most the size of the
1436 frame's decode_mode_spec_buffer. This avoids crashes with very
1437 large values of FIELD_WIDTH argument to decode_mode_spec.
1438 (Bug#12867)
1439
b95a9c0c
PE
14402012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1441
1442 Fix a race with verify-visited-file-modtime (Bug#12863).
1443 Since at least 1991 Emacs has ignored an mtime difference of no
1444 more than one second, but my guess is that this was to work around
1445 file system bugs that were fixed long ago. Since the race is
1446 causing problems now, let's remove that code.
1447 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1448 whose time stamp is off by no more than a second. Insist that the
1449 file time stamps match exactly.
1450
be49ba74
DA
14512012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1452
1453 * frame.h (struct frame): Convert external_tool_bar member to
1454 1-bit unsigned bitfield.
1455 * termhooks.h (struct terminal): Remove mouse_moved member since
1456 all users are long dead. Adjust comment on mouse_position_hook.
1457
5b04e9f9
DA
14582012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1459
1460 Simplify by using FOR_EACH_FRAME here and there.
1461 * frame.c (next_frame, prev_frame, other_visible_frames)
1462 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1463 * w32term.c (x_window_to_scroll_bar): Likewise.
1464 * window.c (window_list): Likewise.
1465 * xdisp.c (x_consider_frame_title): Likewise.
1466 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1467 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1468 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1469 * xmenu.c (menubar_id_to_frame): Likewise.
1470 * xselect.c (frame_for_x_selection): Likewise.
1471 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1472 (x_window_to_menu_bar): Likewise.
1473 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1474
76ae24d7
PE
14752012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1476
12cc4337
PE
1477 * data.c (Qdefalias_fset_function): Now static.
1478
76ae24d7
PE
1479 Another tweak to vectorlike_header change.
1480 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1481 Remove, and replace all uses with ...
1482 (next_in_free_list, set_next_in_free_list):
1483 New functions, which respect C's aliasing rules better.
1484
1479c557
PE
14852012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1486
1487 * window.c (list4i): Rename from 'quad'. All uses changed.
1488 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1489
11235c03
JB
14902012-11-11 Juanma Barranquero <lekktu@gmail.com>
1491
1492 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1493 warning about mixing declarations and code in ISO C90.
1494
6baf66d5 14952012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
1496
1497 * window.c (Fsplit_window_internal): Set combination limit of
1498 new parent window to t iff Vwindow_combination_limit is t;
1499 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 1500 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 1501
6baf66d5 15022012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
1503
1504 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1505 amount when the scroll margins are too large. When scrolling
1506 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
1507 scroll margin within a reasonable number of screen lines.
1508 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
1509 point is positioned many lines beyond the window top/bottom.
1510 (Bug#12811)
1511
508f51f5
EZ
1512 * ralloc.c (relinquish): If real_morecore fails to return memory
1513 to the system, don't crash; instead, leave the last heap
1514 unchanged and return. (Bug#12774)
1515
32e5c58c
SM
15162012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1517
1518 * lisp.h (AUTOLOADP): New macro.
1519 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1520 * data.c (Ffset): Remove special ad-advice-info handling.
1521 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1522 (Fsubr_arity): CSE.
1523 (Finteractive_form): Simplify.
1524 (Fquo): Don't insist on having at least 2 arguments.
1525 (Qdefalias_fset_function): New var.
1526
719b0aa5
JD
15272012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1528
4ab15c3e
JD
1529 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1530
719b0aa5
JD
1531 * nsfont.m (Qcondensed, Qexpanded): New variables.
1532 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1533 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1534
535cc8e9
DA
15352012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1536
1537 Fix recently introduced crash on MS-Windows (Bug#12839).
1538 * w32term.h (struct scroll_bar): Use convenient header.
1539 (SCROLL_BAR_VEC_SIZE): Remove.
1540 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1541
7d377c48
DA
15422012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1543
1544 Tweak last vectorlike_header change.
1545 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1546 vectorlike object on the free list. This is introduced to avoid
1547 some (but not all) pointer casting and aliasing problems, see
1548 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1549 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1550 objects.
1551 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1552
7ad27466
JD
15532012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1554
32e5c58c 1555 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
1556 been removed, so remove them here also.
1557
57618ecf
SM
15582012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1559
1560 * doc.c (Fdocumentation): Handle new property
1561 dynamic-docstring-function to replace the old ad-advice-info.
1562
53371430
PE
15632012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1564
1565 * fns.c (Qeql, hashtest_eq): Now static.
1566
61ddb1b9
SM
15672012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1568
1569 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1570 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1571 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1572 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1573
04a2d0d3
PE
15742012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1575
1576 Use same hash function for hashfn_profiler as for hash_string etc.
1577 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1578 * lisp.h (sxhash_combine): New inline function, with the contents
1579 of the old SXHASH_COMBINE.
1580 * profiler.c (hashfn_profiler): Use it, instead of having a
1581 special hash function containing a comparison that always yields 1.
1582
de5ef41a
SM
15832012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1584
1585 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1586 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1587 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1588 Remove unused vars.
1589
a23c4171
JD
15902012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1591
1592 * image.c (xpm_make_color_table_h): Fix compiler error because
1593 make_hash_table changed.
1594
074d7bb0
JD
15952012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1596
1597 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1598
b7432bb2
SM
15992012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1600
1601 Use ad-hoc comparison function for the profiler's hash-tables.
1602 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1603 (make_log): Use them.
1604 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1605 call Fequal any more.
1606 (Ffunction_equal): New function.
1607 (cmpfn_profiler, hashfn_profiler): New functions.
1608 (syms_of_profiler): Initialize them.
1609 * lisp.h (struct hash_table_test): New struct.
1610 (struct Lisp_Hash_Table): Use it.
1611 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1612 * fns.c (make_hash_table): Take a struct to describe the test.
1613 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1614 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1615 (hash_lookup, hash_remove_from_table): Move assertion checking of
1616 hashfn result here. Check hash-equality before calling cmpfn.
1617 (Fmake_hash_table): Adjust call to make_hash_table.
1618 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1619 (syms_of_fns): Initialize them.
1620 * emacs.c (main): Move syms_of_fns earlier.
1621 * xterm.c (syms_of_xterm):
1622 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1623 * print.c (print_object): Adjust to new hash-table struct.
1624 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1625
88002743
EZ
16262012-11-08 Eli Zaretskii <eliz@gnu.org>
1627
1628 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1629 value of w32-scroll-lock-modifier is neither nil nor one of the
1630 known key modifiers. (Bug#12806)
1631
914adc42
DA
16322012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1633
1634 Shrink struct vectorlike_header to the only size field.
1635 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1636 Adjust comment.
1637 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1638 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1639 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1640 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1641 information from the vector header. Adjust comment.
1642 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1643 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1644 layout.
1645 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1646 (struct vectorlike_header): Remove next member. Adjust comment.
1647 (struct Lisp_Subr): Add convenient header. Adjust comment.
1648 (allocate_pseudovector): Adjust prototype.
1649 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1650 (sweep_string, lisp_malloc): Remove useless prototypes.
1651 (enum mem_type): Adjust comment.
1652 (NEXT_IN_FREE_LIST): New macro.
1653 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1654 (Fmake_bool_vector): Likewise.
1655 (struct large_vector): New type to represent allocation unit for
1656 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1657 (large_vectors): Change type to struct large_vector.
1658 (allocate_vector_from_block): Simplify.
1659 (PSEUDOVECTOR_NBYTES): Replace with...
1660 (vector_nbytes): ...new function. Adjust users.
1661 (sweep_vectors): Adjust processing of large vectors.
1662 (allocate_vectorlike): Likewise.
1663 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1664 Add easserts. Adjust XSETPVECTYPESIZE usage.
1665 (allocate_buffer): Use BUFFER_PVEC_INIT.
1666 (live_vector_p): Adjust to match large vector.
1667 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1668 * buffer.h (struct buffer): Add next member.
1669 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1670 New macros.
1671 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1672 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1673 (copy_hash_table): Adjust to match vector header change.
1674 * lread.c (defsubr): Use XSETPVECTYPE.
1675 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1676 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1677 (xvecsize): New command.
1678
c66f21ea
DA
16792012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1680
1681 * keyboard.c (event_to_kboard): Do not dereference
1682 frame_or_window field of SELECTION_REQUEST_EVENT
1683 and SELECTION_CLEAR_EVENT events (Bug#12814).
1684 * xterm.h (struct selection_input_event): Adjust comment.
1685
eb147960
EZ
16862012-11-07 Eli Zaretskii <eliz@gnu.org>
1687
dab72075
EZ
1688 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1689 such as Scroll Lock, if the respective keys are treated as
1690 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 1691 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 1692
5890e400
DA
16932012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1694
1695 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1696
b6b3b294
PE
16972012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1698
1699 Restore some duplicate definitions (Bug#12814).
1700 This undoes part of the 2012-11-03 changes. Some people build
1701 with plain -g rather than with -g3, and they need the duplicate
1702 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1703 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1704 Define as macros, as well as as enums or as constants.
1705
e770aad5
JD
17062012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1707
1708 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1709 to keypad keys (Bug#12816).
1710
68f8f1c0
PE
17112012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1712
1713 Minor adjustments of recently-changed frame functions.
1714 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1715 known to be a frame (we're in the FRAMEP branch).
1716 * lisp.h (Qframep): Remove decl. frame.h declares this.
1717 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1718 since they're meant for Lisp fixnum values.
1719
72f94d4b
DA
17202012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1721
1722 * window.c (Fwindow_combination_limit): Revert to the only
1723 required argument and adjust docstring as suggested in
1724 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1725 by Martin Rudalics <rudalics@gmx.at>.
1726
d9f07150
DA
17272012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1728
1729 Widely used frame validity and checking functions.
1730 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1731 * frame.c (decode_live_frame, decode_any_frame): New functions.
1732 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1733 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1734 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1735 (Fframe_pointer_visible_p): Use decode_any_frame.
1736 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1737 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1738 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1739 (Fframe_focus): Likewise. Allow zero number of arguments.
1740 Adjust docstring.
1741 (frame_buffer_list, frame_buffer_predicate): Remove.
1742 * lisp.h (frame_buffer_predicate): Remove prototype.
1743 * buffer.c (Fother_buffer): Use decode_any_frame.
1744 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1745 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1746 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1747 (Fclose_font, Ffont_info): Use decode_live_frame.
1748 * fontset.c (check_fontset_name): Likewise.
1749 * terminal.c (Fframe_terminal): Likewise.
1750 * w32fns.c (check_x_frame): Likewise.
1751 * window.c (Fminibuffer_window, Fwindow_at)
1752 (Fcurrent_window_configuration): Likewise.
1753 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1754 Likewise. Allow zero number of arguments. Adjust docstring.
1755 * dispnew.c (Fredraw_frame): Likewise.
1756 * xfaces.c (frame_or_selected_frame): Remove.
1757 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1758 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1759 (Fframe_face_alist): Use decode_live_frame.
1760 * xfns.c (check_x_frame): Likewise.
1761
89bc0592
DA
17622012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1763
1764 * window.c (quad): New function.
1765 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1766 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1767 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1768 (Fwindow_line_height): Use it.
1769 (Fwindow_fringes): Use list3.
1770 (Fwindow_scroll_bars): Use list4.
1771 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1772 (Fwindow_combination_limit): Allow zero number of arguments.
1773
c8e3a9c3
EZ
17742012-11-05 Eli Zaretskii <eliz@gnu.org>
1775
1776 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1777
8e2417bf 1778 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 1779 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 1780 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 1781
209c6a58
CY
17822012-11-05 Chong Yidong <cyd@gnu.org>
1783
1784 * process.c (wait_reading_process_output): Revert previous change.
1785
8148369c
PE
17862012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1787
dd0333b6
PE
1788 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1789 This removes code that has been obsolete since around 1990.
1790 * callproc.c (Fcall_process):
1791 * emacs.c (main):
1792 * process.c (create_process):
1793 * term.c (dissociate_if_controlling_tty):
1794 Assume setsid exists.
1795 * callproc.c (child_setup): Assume setpgid exists and behaves as
1796 per POSIX.1-1988 or later.
1797 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1798 * emacs.c (shut_down_emacs):
1799 * sysdep.c (sys_suspend, init_foreground_group):
1800 Assume getpgrp behaves as per POSIX.1-1998 or later.
1801 * msdos.c (setpgrp): Remove.
1802 (tcgetpgrp, setpgid, setsid): New functions.
1803 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1804 * term.c (no_controlling_tty): Remove; unused.
1805 * w32proc.c (setpgrp): Remove.
1806 (setsid, tcgetpgrp): New functions.
1807
8148369c
PE
1808 Simplify by assuming __fpending.
1809 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1810 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1811 Do not assume that __fpending's result fits in int.
1812
76abf5e5
PE
18132012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1814
06b63c9b
PE
1815 Remove EMACS_OUTQSIZE+sleep hack.
1816 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
1817 than 2400 bps, which throttled Emacs by having it sleep.
1818 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
1819 was added, and anyway those old terminals are long dead.
1820 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1821 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1822
76abf5e5
PE
1823 Fix data-loss with --version (Bug#9574).
1824 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1825 as we can't assume that emacs_strerror is initialized, and strerror
1826 is good enough here.
1827 (main): Invoke atexit earlier, to catch earlier instances of
1828 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1829
8f31e74b
MM
18302012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1831
1832 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1833 (keyDown): Remap keypad keys to X11 virtual key codes.
1834
0d879dca
PE
18352012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1836
7ccfb720
PE
1837 Fix data-loss with --batch (Bug#9574).
1838 * emacs.c: Include <close-stream.h>.
1839 (close_output_streams): New function.
1840 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1841 and handles errors appropriately.
1842 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1843 does that now.
1844
0b3d4a47
PE
1845 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1846 The symptom is a diagnostic "GLib-WARNING **: In call to
1847 g_spawn_sync(), exit status of a child process was requested but
1848 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1849 waitpid(), so exit status can't be returned." The diagnostic
1850 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1851 The real bug is a race condition between Emacs and glib: Emacs
1852 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1853 so that glib can't find it. Work around the bug by invoking
1854 waitpid only on subprocesses that Emacs itself creates.
1855 * process.c (create_process, record_child_status_change):
1856 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
1857 know the pid rather than having the callee infer it.
1858 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
1859 (create_process): Set new 'alive' member if child is created.
1860 (process_status_retrieved): New function.
1861 (record_child_status_change): Use it.
1862 Accept negative 1st argument, which means to wait for the
1863 processes that Emacs already knows about. Move special-case code
1864 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1865 processes that have already been waited for, by testing and
1866 clearing new 'alive' member.
1867 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1868 now does this internally.
1869 (handle_child_signal): Let record_child_status_change do all
1870 the work, since we do not want to reap all exited child processes,
1871 only the child processes that Emacs itself created.
1872 * process.h (Lisp_Process): New boolean member 'alive'.
1873
0d879dca
PE
1874 Omit duplicate definitions no longer needed with gcc -g3.
1875 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1876 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1877 Define only as macros. There's no longer any need to also define
1878 these symbols as enums or as constants, since we now assume
1879 gcc -g3 when debugging.
1880
3478f4b5
EZ
18812012-11-03 Eli Zaretskii <eliz@gnu.org>
1882
1883 * lisp.mk: Adjust comments to the fact that term/internal is now
1884 loaded from loadup.el.
1885
1886 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1887 (msdos_fatal_signal): New function.
1888 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1889 its argument list.
1890
1891 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1892 for GCC versions before 4.
1893 (emacs_raise): Define to call msdos_fatal_signal.
1894
1895 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1896 iterator when starting in the middle of a display or overlay
1897 string. (Bug#12745)
1898
85fabcb7
CY
18992012-11-03 Chong Yidong <cyd@gnu.org>
1900
1901 * process.c (wait_reading_process_output): Clean up the last
1902 change.
1903
893cc455
CY
19042012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1905
1906 * process.c (wait_reading_process_output): Avoid a race condition
1907 with SIGIO delivery (Bug#11536).
1908
0f7b074f
CY
19092012-11-03 Chong Yidong <cyd@gnu.org>
1910
1911 * buffer.c (cursor_type): Untabify docstring.
1912
3737fee7
DA
19132012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1914
1915 * frame.h (struct frame): Drop can_have_scroll_bars member
1916 which is meaningless for a long time. Adjust comments.
1917 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1918 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1919
b6a9e8b1
DA
19202012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1921
1922 * window.c (decode_next_window_args): Update window arg after
1923 calling decode_live_window and so fix crash reported at
1924 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1925 by Juanma Barranquero <lekktu@gmail.com>.
1926 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1927 * font.c (Ffont_at): Likewise.
1928
600d4768
JD
19292012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1930
1931 * widget.c (resize_cb): New function.
1932 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1933 (EmacsFrameResize): Check if all is up to date before changing frame
1934 size.
1935
1005b4b9
EZ
19362012-11-02 Eli Zaretskii <eliz@gnu.org>
1937
1938 Implement backtrace output for fatal errors on MS-Windows.
1939 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1940 (BACKTRACE_LIMIT_MAX): New macro.
1941 (w32_backtrace): New function.
1942 (emacs_abort): Use w32_backtrace when the user chooses not to
1943 attach a debugger. Update the text of the abort dialog.
1944
b9e9df47
DA
19452012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1946
1947 Window-related stuff cleanup here and there.
1948 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1949 Use decode_any_window.
1950 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1951 * xdisp.c (Fformat_mode_line): Likewise.
1952 * font.c (Ffont_at): Use decode_live_window.
1953 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1954 * window.c (decode_next_window_args): Likewise.
1955 (decode_any_window): Remove static.
1956 * window.h (decode_any_window): Add prototype.
1957 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1958 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1959 respectively.
1960
2b371ff7
DA
19612012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1962
1963 Remove pad from struct input_event.
1964 * termhooks.h (struct input_event): Remove padding field.
1965 Adjust comment.
1966 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1967 member is never cons for a long time. Adjust comment.
1968 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1969 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1970 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1971 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1972
7e8b50d9
EZ
19732012-11-01 Eli Zaretskii <eliz@gnu.org>
1974
1975 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1976
322aea6d
PE
19772012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1978
1979 Fix crash when using Emacs as commit editor for git (Bug#12697).
1980 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1981 and it is configured in conf_post.h.
1982 (Fcall_process): Don't invoke both setsid and setpgid; the former
1983 is enough, if it exists.
1984 * callproc.c (Fcall_process, child_setup):
1985 * process.c (create_process): Use setpgid.
1986 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1987 for the real thing.
1988 * dispnew.c (init_display): Initialize the foreground group
1989 if we are running a tty display.
1990 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1991 * lisp.h (init_foreground_group): New decl.
1992 * sysdep.c (inherited_pgroup): New static var.
1993 (init_foreground_group, tcsetpgrp_without_stopping)
1994 (narrow_foreground_group, widen_foreground_group): New functions.
1995 (init_sys_modes): Narrow foreground group.
1996 (reset_sys_modes): Widen foreground group.
1997
220cb2bd
MA
19982012-10-31 Michael Albinus <michael.albinus@gmx.de>
1999
2000 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
2001
218e997a
MR
20022012-10-31 Martin Rudalics <rudalics@gmx.at>
2003
2004 * minibuf.c (read_minibuf): Restore current buffer since
2005 choose_minibuf_frame calling Fset_frame_selected_window may
2006 change it (Bug#12766).
2007
02615da0
JD
20082012-10-30 Jan Djärv <jan.h.d@swipnet.se>
2009
2010 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
2011
aee5b18e
KH
20122012-10-30 Kenichi Handa <handa@gnu.org>
2013
2014 * font.c (Ffont_at): If WINDOW is specified and it is not
2015 displaying the current buffer, signal an error.
2016
ba116008
DC
20172012-10-29 Daniel Colascione <dancol@dancol.org>
2018
de5ef41a
SM
2019 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
2020 In preparation for fixing bug#12739, move these functions from
ba116008
DC
2021 here...
2022
2023 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
2024 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
2025 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 2026
640bf8ad
EZ
20272012-10-28 Eli Zaretskii <eliz@gnu.org>
2028
2029 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
2030 (timer_loop, getitimer, setitimer): Use it instead of
2031 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
2032 'clock'.
2033 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
2034 literal 10000.
2035
64ccff5f
JD
20362012-10-28 Jan Djärv <jan.h.d@swipnet.se>
2037
2038 * nsterm.m (NO_APPDEFINED_DATA): New define.
2039 (last_appdefined_event_data): New variable
2040 (last_appdefined_event): Remove.
2041 (ns_select): Initialize t from last_appdefined_event_data instead
2042 of [last_appdefined_event data1].
2043 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
2044 remove last_appdefined_event (Bug#12698).
2045
e483264c
SM
20462012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2047
2048 * frame.c (x_set_font): Catch internal error.
2049
6c16c13e
EZ
20502012-10-27 Eli Zaretskii <eliz@gnu.org>
2051
e483264c
SM
2052 Avoid overflow in w32 implementation of interval timers.
2053 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
2054 actually executes.
2055 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
2056 'volatile ULONGLONG' types. All the other data which was
2057 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
2058 (GetThreadTimes_Proc): New typedef.
2059 (w32_get_timer_time): New function, returns a suitable time value
2060 for the timer.
2061 (timer_loop): Enter critical section when accessing ULONGLONG
2062 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
2063 atomic. Call 'w32_get_timer_time' instead of 'clock'.
2064 Remove unused variable.
6c16c13e
EZ
2065 (init_timers): Initialize s_pfn_Get_Thread_Times.
2066 (start_timer_thread): Don't assign itimer->caller_thread here.
2067 (getitimer): Assign itimer->caller_thread here.
2068 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 2069 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 2070
ccc83f50
EZ
20712012-10-26 Eli Zaretskii <eliz@gnu.org>
2072
2073 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
2074 mouse movement events if the menu bar is active. This avoids
2075 producing a busy "hour-glass" cursor by Windows if the mouse
2076 pointer is positioned over a tooltip shown for some menu item.
2077
69deda53
PE
20782012-10-25 Paul Eggert <eggert@cs.ucla.edu>
2079
2080 Don't assume process IDs fit in int.
2081 * emacs.c (shut_down_emacs) [!DOS_NT]:
2082 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
2083 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
2084 Use pid_t, not int, to store process IDs, as 'int'
2085 is not wide enough on a few platforms (e.g., AIX and IRIX).
2086
7e70a152
KH
20872012-10-23 Kenichi Handa <handa@gnu.org>
2088
2089 The following change is to make face-font-rescale-alist work
2090 correctly for non-ASCII fonts.
2091
2092 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
2093 (font_open_for_lface): Handle Vface_font_rescale_alist.
2094
49238e7f
CY
20952012-10-23 Chong Yidong <cyd@gnu.org>
2096
2097 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
2098
5ec86886
JD
20992012-10-21 Jan Djärv <jan.h.d@swipnet.se>
2100
ef446959
JD
2101 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
2102 for screen font.
2103 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
2104
5ec86886
JD
2105 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
2106 event (Bug#12681).
2107
ee7a418d
GM
21082012-10-21 Glenn Morris <rgm@gnu.org>
2109
2110 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
2111
4973679b
PE
21122012-10-20 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 Port to OpenBSD 5.1.
2115 * frame.c (Fmouse_position, Fmouse_pixel_position):
2116 * xdisp.c (produce_stretch_glyph):
2117 Declare local vars only when they're needed.
2118 This is clearer and avoids a warning on OpenBSD about unused vars.
2119 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
2120 This is safer, and avoids OpenBSD warnings about unused vars.
2121 * keyboard.c (record_menu_key): Remove unnecessary decl.
2122 (poll_timer): Define only if POLL_FOR_INPUT is defined.
2123 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
2124 as our definition clashes with OpenBSD's.
2125 * xfaces.c (load_face_colors, check_lface_attrs)
2126 (get_lface_attributes_no_remap, get_lface_attributes)
2127 (lface_fully_specified_p, x_supports_face_attributes_p)
2128 (tty_supports_face_attributes_p, face_fontset, realize_face)
2129 (realize_x_face, realize_tty_face):
2130 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
2131 merely Lisp_Object *. This is more informative and avoids
2132 a warning on OpenBSD about accessing beyond an object's size.
2133
c664f463
CY
21342012-10-20 Chong Yidong <cyd@gnu.org>
2135
2136 * lread.c (Fload): Doc fix (Bug#12592).
2137
6ec83f92 21382012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
2139
2140 * font.c (Ffont_at): Fix previous change.
2141
d2824928
EZ
21422012-10-19 Eli Zaretskii <eliz@gnu.org>
2143
e483264c
SM
2144 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
2145 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
2146 for the reasons.
2147
d2824928
EZ
2148 * alloc.c (NSTATICS): Decrease to 0x800.
2149
f60d391f
SM
21502012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2151
4a0e1924 2152 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
2153 error (bug#12677).
2154
1a9327d5
JD
21552012-10-18 Jan Djärv <jan.h.d@swipnet.se>
2156
2157 * nsterm.m (ns_select): Check writefds before call to
2158 FD_ISSET (Bug#12668).
2159
14145a1e
DC
21602012-10-18 Daniel Colascione <dancol@dancol.org>
2161
2162 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
2163 (staticpro): If we run out of staticpro slots, die with an
2164 informative error instead of just calling emacs_abort.
2165
1f76f6f5
MR
21662012-10-18 Martin Rudalics <rudalics@gmx.at>
2167
2168 Fix two flaws reported by Dmitry Antipov.
2169 * window.c (Ftemp_output_buffer_show): Remove.
2170 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
2171 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
2172
fcf14875
EZ
21732012-10-17 Eli Zaretskii <eliz@gnu.org>
2174
1f76f6f5
MR
2175 * makefile.w32-in ($(BLD)/w32.$(O)):
2176 ($(BLD)/vm-limit.$(O)):
2177 ($(BLD)/term.$(O)):
2178 ($(BLD)/unexw32.$(O)):
2179 ($(BLD)/fileio.$(O)):
a68089e4
EZ
2180 ($(BLD)/dispnew.$(O)): Update dependencies.
2181
2182 * w32term.h (w32_initialize_display_info, initialize_w32_display):
2183 Add prototypes.
2184
2185 * w32proc.c: Include ctype.h.
2186
2187 * w32.h (init_environment, check_windows_init_file)
2188 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
2189 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
2190 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
2191 (sys_link): Add prototypes.
2192
2193 * w32.c: Include w32select.h.
2194 (sys_access, e_malloc, sys_select): Add prototypes.
2195 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
2196
2197 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
2198
2199 * unexw32.c: Include lisp.h and w32.h.
2200
2201 * term.c [WINDOWSNT]: Include w32term.h.
2202
2203 * process.c [WINDOWSNT]: Add prototype of sys_select.
2204
2205 * fileio.c [WINDOWSNT]: Include w32.h.
2206
2207 * dispnew.c [WINDOWSNT]: Include w32.h.
2208
fcf14875
EZ
2209 * cygw32.c (Fcygwin_convert_path_to_windows)
2210 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
2211 Lisp_Object values. (Bug#12661)
2212
2213 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
2214 to Lisp_Object. (Bug#12661)
2215
fe0b1ec4
KH
22162012-10-17 Kenichi Handa <handa@gnu.org>
2217
2218 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
2219 invalidate.
2220
d556ebf9
DA
22212012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2222
2223 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 2224 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 2225
f0863a54
DA
22262012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2227
2228 Do not verify indirection counters of killed buffers (Bug#12579).
2229 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
2230 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
2231
12fbe755
DA
22322012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2233
2234 * alloc.c (Fmake_byte_code): Fix typo in comment.
2235 * print.c (print_interval): Define as static to match prototype.
2236 * indent.c (disptab_matches_widthtab, recompute_width_table):
2237 Convert to eassert.
2238
61655b89
DA
22392012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2240
2241 * editfns.c (get_system_name): Remove.
2242 * lisp.h (get_system_name): Remove prototype.
2243 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
2244 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
2245
9520f2f2
DC
22462012-10-15 Daniel Colascione <dancol@dancol.org>
2247
2248 * dbusbind.c: Add comment explaining reason for previous change.
2249
dca778d5
MR
22502012-10-15 Martin Rudalics <rudalics@gmx.at>
2251
2252 * window.c (Fwindow_end): Rewrite check whether cached position
2253 can be used (Bug#12600).
2254 (resize_frame_windows, grow_mini_window, shrink_mini_window):
2255 Set windows_or_buffers_changed.
2256
3e0341b0
DC
22572012-10-15 Daniel Colascione <dancol@dancol.org>
2258
2259 * dbusbind.c: Fix cygw32 build break when compiling with dbus
2260 enabled by undefining the symbol "interface", which the platform
2261 headers define to something incompatible.
2262
33d4113c
DC
22632012-10-14 Daniel Colascione <dancol@dancol.org>
2264
2265 * image.c (init_tiff_functions, init_imagemagick_functions)
2266 (init_svg_functions): Fix cygw32 build break by using these
2267 functions only when WINDOWSNT _and_ HAVE_NTGUI.
2268
a36fb15e
JD
22692012-10-14 Jan Djärv <jan.h.d@swipnet.se>
2270
2271 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
2272
537f336d
JD
22732012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2274
2275 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
2276
0ba06a77
KH
22772012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
2278
2279 * coding.c (detect_coding): Set coding->id before calling
2280 this->detector.
2281
ce2fe65a
AS
22822012-10-13 Andreas Schwab <schwab@linux-m68k.org>
2283
2284 * fileio.c: Formatting fixes.
2285
d6453ce4
PE
22862012-10-13 Paul Eggert <eggert@cs.ucla.edu>
2287
2288 Fix some stat-related races.
2289 * fileio.c (Fwrite_region): Avoid race condition if a file is
2290 removed or renamed by some other process immediately after Emacs
2291 writes it but before Emacs stats it. Do not assume that stat (or
2292 fstat) succeeds.
2293 * image.c (slurp_file): Resolve the file name with fopen + fstat
2294 rather than stat + fopen.
2295 (pbm_read_file) [0]: Remove unused code with stat race.
2296 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
2297 Remove ineffective code with stat race.
2298
06485aa8
SM
22992012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2300
2301 * doc.c (get_doc_string): Don't signal an error if the file is missing.
2302
167e3640
JD
23032012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2304
2305 * nsterm.m (hold_event_q): New static variable.
2306 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
2307 ! q_event_ptr.
2308 (hold_event): New function.
2309 (ns_read_socket): If hold_event_q have events, store them and
2310 return (Bug#12384).
2311 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
2312 is zero (Bug#12384).
2313
c40239df
JB
23142012-10-12 Juanma Barranquero <lekktu@gmail.com>
2315
2316 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
2317
bb385a92
EZ
23182012-10-12 Eli Zaretskii <eliz@gnu.org>
2319
2a9f1099
EZ
2320 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2321
bb385a92
EZ
2322 * fileio.c (check_existing): New function.
2323 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
2324 instead of calling 'stat', when what's needed is to check whether
2325 a file exists. This avoids expensive system calls on MS-Windows.
2326 (Bug#12587)
2327
8599b23a 2328 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
2329
2330 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
2331 determine whether a file exists and is not a directory.
2332
2333 * lisp.h (check_existing): Add prototype.
2334
2b9c2e68
JD
23352012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2336
2337 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
2338
81749a23
GM
23392012-10-12 Glenn Morris <rgm@gnu.org>
2340
2341 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
2342
5253a5fd
SM
23432012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2344
389a94a5
SM
2345 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
2346
5253a5fd
SM
2347 * eval.c (Fautoload): Remember previous autoload status in load-history.
2348
7cded46f
PE
23492012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2350
2351 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
2352 * lread.c (load_each_byte, new_backquote_flag, readchar)
2353 (read_filtered_event, lisp_file_lexically_bound_p)
2354 (safe_to_load_version, Fload, complete_filename_p, openp)
2355 (build_load_history, readevalloop, read_escape, read1)
2356 (string_to_number, read_vector, read_list):
2357 * macros.c (Fstart_kbd_macro):
2358 * marker.c (CONSIDER):
2359 * menu.c (parse_single_submenu, digest_single_submenu)
2360 (find_and_return_menu_selection, Fx_popup_menu):
2361 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
2362 (Ftry_completion):
2363 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
2364 (ns_menu_show):
2365 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
2366 (xmenu_show, xdialog_show):
2367 Use bool for booleans.
2368 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
2369 as it's not a predicate. All uses changed. Omit unnecessary
2370 buffer termination.
2371
549c3414
DA
23722012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2373
2374 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
2375 (save_excursion_restore): Do not restore mark if it was not saved.
2376
e85aafe7
PE
23772012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2378
fd2f90cf
PE
2379 * marker.c (cached_modiff): EMACS_INT, not int.
2380
c1af190b
PE
2381 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
2382 instead of having a wrong decl.
e85aafe7
PE
2383 * nsmenu.m (waiting_for_input): Remove wrong decl.
2384
e738ca56
PE
23852012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2386
9fa1de30
PE
2387 keyboard.c, keymap.c: Use bool for booleans.
2388 * dispnew.c (sit_for): Distinguish between 3-way display_option
2389 and boolean do_display.
2390 * keyboard.c (single_kboard, this_command_key_count_reset)
2391 (waiting_for_input, echoing, immediate_quit, input_pending)
2392 (interrupt_input, interrupts_deferred, pop_kboard)
2393 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
2394 (command_loop_1, adjust_point_for_property)
2395 (safe_run_hooks_error, input_polling_used, read_char):
2396 (help_char_p, readable_events, kbd_buffer_events_waiting)
2397 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
2398 (lucid_event_type_list_p, get_input_pending):
2399 (gobble_input, menu_separator_name_p, menu_bar_item)
2400 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
2401 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
2402 (keyremap_step, test_undefined, read_key_sequence)
2403 (detect_input_pending, detect_input_pending_ignore_squeezables)
2404 (detect_input_pending_run_timers, requeued_events_pending_p)
2405 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2406 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2407 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2408 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2409 (accessible_keymaps_1, Fkey_description, push_key_description):
2410 (shadow_lookup, struct where_is_internal_data)
2411 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2412 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2413 (describe_map, describe_vector):
2414 * menu.c (single_menu_item):
2415 * nsmenu.m (ns_update_menubar):
2416 * process.c (wait_reading_process_output):
2417 * search.c (scan_buffer, scan_newline):
2418 Use bool for boolean.
2419 * keyboard.c (timers_run, swallow_events)
2420 (detect_input_pending_run_timers):
2421 * process.c (wait_reading_process_output):
2422 Use unsigned for counter where wraparound-on-overflow is desired,
2423 since unsigned is guaranteed to have that behavior and signed is not.
2424 (read_char): Use ptrdiff_t for string length.
2425 (get_input_pending): Remove first argument, since it was always
2426 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2427 and behave as if it had that value. Return new value of
2428 input_pending. All callers changed.
2429 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2430 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2431 a string length.
2432 * keymap.c (push_key_description): Omit last arg, which was always 1.
2433 All callers changed.
2434
e738ca56
PE
2435 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2436
29f21cdf
JB
24372012-10-10 Juanma Barranquero <lekktu@gmail.com>
2438
2439 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2440 ($(BLD)/term.$(O)): Update dependencies.
2441
6aea7528
DA
24422012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2443
2444 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2445 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2446 initializer for PVEC_NORMAL_VECTOR.
2447
5f3f57be
PE
24482012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2449
2450 Clean out old termopts cruft.
2451 * termopts.h (flow_control, meta_key): Remove unused decls.
2452 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2453 Don't include termopts.h.
2454
3e98c68e
DA
24552012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2456
2457 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2458
77e344e5
PE
24592012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 * commands.h (immediate_quit): Remove duplicate decl.
2462
5683d7cd
JD
24632012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2464
2465 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2466 caching.
2467 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 2468 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 2469
cf5fc6db
EZ
24702012-10-09 Eli Zaretskii <eliz@gnu.org>
2471
b15736e6
EZ
2472 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2473 match what GetLastError returns. Explain why the function is
2474 needed.
2475
cf5fc6db
EZ
2476 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2477 'is_tooltip_frame', to avoid confusion with its global namesake.
2478
f99714ce
DC
24792012-10-08 Daniel Colascione <dancol@dancol.org>
2480
2481 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
2482 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2483 build that caused Emacs to display the hourglass cursor forever.
f99714ce 2484
fd59cb29
GM
2485 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2486 which is broken under remote desktop, calculate the number of
2487 colors available for a display based on the display's number of
2488 planes and number of bits per pixel per plane. (bug#10397).
2489
62c480c9 24902012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 2491
62c480c9
JD
2492 * nsfont.m (Vfonts_in_cache): New variable.
2493 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2494 are used. Add cached fonts to Vfonts_in_cache.
2495 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2496
607446ba
JB
24972012-10-08 Juanma Barranquero <lekktu@gmail.com>
2498
fd5125ad
JB
2499 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2500 in nt/config.nt.
46979e0b
JB
2501 (FONT_H): Define after FRAME_H.
2502 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2503 Update dependencies.
fd5125ad 2504
607446ba
JB
2505 * w32term.c: Remove leftover declaration of keyboard_codepage.
2506
b6f4e300
EZ
25072012-10-08 Eli Zaretskii <eliz@gnu.org>
2508
c54ebba4
EZ
2509 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2510 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2511 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2512 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
2513 ($(BLD)/unexw32.$(O)):
2514 ($(BLD)/w32.$(O)):
2515 ($(BLD)/w32console.$(O)):
2516 ($(BLD)/w32fns.$(O)):
2517 ($(BLD)/w32heap.$(O)):
2518 ($(BLD)/w32menu.$(O)):
15c720a3 2519 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 2520
b6f4e300
EZ
2521 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2522 'const char *'.
2523 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2524
501199a3
DC
25252012-10-08 Daniel Colascione <dancol@dancol.org>
2526
2527 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2528 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2529 accidental message numbering hole. Change other messages to
2530 match.
2531
2532 * w32select.h (HAVE_W32SELECT): Remove.
2533
2534 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 2535 w32common.h instead of w32heap.h.
501199a3
DC
2536
2537 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2538 (get_allocation_unit, get_processor_type, get_w32_major_version)
2539 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2540 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2541 (OS_NT, os_subtype, cache_system_info): Move declarations to
2542 w32common.
2543
2544 * w32heap.c: Include w32common.h.
2545 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
2546 (w32_minor_version, w32_build_number, w32_subtype):
2547 Remove duplicate definitions.
501199a3
DC
2548
2549 * w32fns.c: Include w32common.h; include w32heap.h only in
2550 WINDOWSNT.
2551
2552 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2553 Use `report_file_error' instead of `error' in order to better
2554 inform users of what went wrong. Increase NTGUI_UNICODE file
2555 dialog box file name length to 32k, the maximum allowed by the NT
2556 kernel.
2557
2558 * w32common.h: New file.
2559 (ROUND_UP, ROUND_DOWN, get_page_size)
2560 (get_allocation_unit, get_processor_type, get_w32_major_version)
2561 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2562 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2563 (OS_NT, os_subtype, cache_system_info): Move here.
2564
2565 * unexw32.c, unexcw.c: Include w32common.h.
2566
2567 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2568 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2569 to call syms_of_w32select.
2570
2571 * cygw32.h: Remove obsolete EXFUN declarations.
2572
2573 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2574
2575 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2576 of w32inevt.o from SOME_MACHINE_OBJECTS.
2577
93aa5c81
DC
25782012-10-08 Daniel Colascione <dancol@dancol.org>
2579
2580 * image.c: Permanent fix for JPEG compilation issue --- limit
2581 jpeglib `boolean' redefinition to Cygwin builds.
2582
d424f3d8
EZ
25832012-10-08 Eli Zaretskii <eliz@gnu.org>
2584
8ee4c6ce
EZ
2585 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2586
d424f3d8
EZ
2587 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2588 Cygwin.
2589
e08348a0
DC
25902012-10-08 Daniel Colascione <dancol@dancol.org>
2591
2592 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2593 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2594 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2595 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2596 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2597 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2598 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2599 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2600 now a supported configuration.
2601
2602 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 2603 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
2604
2605 * conf_post.h:
2606 (_DebPrint) declare tracing facility for W32 debugging. We need
2607 to unify tracing later.
2608
2609 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2610 unconditional use of W32 Unicode functions. Cygwin runs only on
2611 100% Unicode operating systems.
2612
2613 * cygw32.c: New file. Define Cygwin-specific facilities.
2614 (Fcygwin_convert_path_to_windows)
2615 (Fcygwin_convert_path_from_windows): New user functions for
2616 accessing Cygwin path-munging routines.
2617
2618 * cygw32.h: New file.
2619 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2620 UTF-16LE strings temporarily inside non-Lisp-visible string
2621 objects.
2622
2623 (w32_strerror): Just what it says on the tin.
2624
2625 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2626 also run for Cygwin; both systems have the same problem with using
2627 GUI facilities in a forked child. Also call syms_of_cygw32,
2628 syms_of_w32select in correct places.
2629
2630 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2631 needs fork-then-exec for daemon launching.
2632
2633 * font.h: Include frame.h.
2634
2635 * image.c: Use the image library cache machinery only when we're
2636 compiling for native WINDOWSNT; Cygwin can use shared libraries
2637 like any other Unixlike system.
2638
2639 * keyboard.c: Clarify a comment regarding the input loop.
2640
2641 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2642 functions directly instead of trying to detect at runtime that our
2643 host operating system supports them. We make this change for two
2644 reasons: Cygwin lacks support for the multibyte character
2645 conversion functions used by the legacy menu code, and Cygwin
2646 never needs to rely on non-Unicode APIs.
2647
2648 * unexw32.c (hinst): Declare extern.
2649
2650 * w32.c: Change header order;
2651 (w32_strerror): Move to w32fns.c because we need it for
2652 non-WINDOWSNT builds.
2653
2654 * w32.h: Add #error macro to make sure we don't include w32.h for
2655 Cygwin builds. Remove w32select declarations.
2656
2657 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 2658 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
2659
2660 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2661 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2662 POSIXy alternative.
2663 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2664 (w32_major_version, w32_minor_version, w32_build_number)
2665 (os_subtype, sound_type): Define here
2666 (w32_defined_color): Make color parameter const for consistency
2667 with other _defined_color functions.
2668 (w32_createwindow): Unconditionally call w32_init_class instead of
2669 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2670 through the code is complex and unnecessary because class
2671 registration is practically free.
2672 (w32_name_of_message): New EMACSDEBUG-only function.
2673 (Fset_message_beep): Move here
2674 (Fx_open_connection): Require that the display name for Windows be
2675 "w32" for consistency, emacsclient disambiguation, and maybe, one
2676 day, multi-window-system support.
2677 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2678 Cygwin files for W32 GUI facilities, since these clearly don't
2679 expect Cygwin names.
2680 (_DebPrint): Define.
2681 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2682 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2683 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2684 (w32_last_error): Remove.
2685
2686 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2687
2688 * w32heap.c (syspage_mask): Declare here.
2689 (cache_system_info): Remove.
2690
2691 * w32inevt.c (faked_key): Define globally, not statically.
2692 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2693 (w32_console_toggle_lock_key): Move to w32fns.c.
2694
2695 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2696
2697 * w32proc.c (_DebPrint): Move to w32fns.c.
2698 * w32select.c: Include string.h, stdio.h for Cygwin.
2699 * w32select.h: New File.
2700
2701 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2702 get_osfhandle.
2703 (w32_message_fd): New variable. Under Cygwin, holds the file
2704 descriptor the system used to tell us about pending thread
2705 messages.
2706
2707 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2708 that prevented compilation under non-WINDOWSNT systems.
2709
2710 (w32_initialize): Open /dev/windows and assign it to
2711 w32_message_fd. Provide w32 feature.
2712
2713 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2714 (WM_EMACS_INPUT_READY): add.
2715 (prepend_msg, w32_message_fd): Declare globally.
2716
2717 * w32xfns.c:
2718 (keyboard_handle): Use only when WINDOWSNT.
2719 (notify_msg_ready): New function. Posts a message to the main
2720 thread's message queue under CYGWIN, which wakes up the main
2721 thread from select(2) by making the /dev/windows file descriptor
2722 ready. Under WINDOWSNT, it sets an event the same way the old
2723 code did.
2724
2725 (post, prepend_msg): Actually call notify_msg_ready instead of
2726 setting the input event directly.
2727
98daa893
EZ
27282012-10-07 Eli Zaretskii <eliz@gnu.org>
2729
2730 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2731 but it still has blocs in it, don't return it to the system,
2732 instead of aborting. (Bug#12402)
2733
3bc0a2f7
JD
27342012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2735
8ad5b73b 2736 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 2737
335f5ae4
JD
2738 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2739 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
2740 (syms_of_nsterm): Remove comment about Panther and above for
2741 ns-antialias-text.
335f5ae4
JD
2742 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2743 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2744 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2745
2746 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2747 MAC_OS_X_VERSION_10_4.
2748
8ad5b73b
JD
2749 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2750 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
2751
2752 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2753
2754 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2755 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2756
3bc0a2f7
JD
2757 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2758 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
2759 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2760 Remove ns_in_resize check.
3bc0a2f7
JD
2761 (ns_clear_frame_area): Remove resize handle code.
2762
2763 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
2764 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2765 Remove ns_in_resize check.
3bc0a2f7 2766
c622b48f
PE
27672012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2768
2769 Improve sys_siglist detection.
2770 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2771 defined as a macro, as is done in Solaris.
2772 (sys_siglist_entries): New macro.
2773 (save_strsignal): Use it.
2774 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2775 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2776
04fafa46
JD
27772012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2778
2779 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2780 fullscreen/Fullscreen.
2781
2782 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2783 tobar_height is new.
2784
2785 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2786 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2787 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2788 (windowDidResize:): Check for correct window if old style fullscreen.
2789 Capitalize word in comment. Remove incorrect comment.
2790 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2791 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2792 error in drawing background.
1f9f395d 2793 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
2794 Set toolbar values to zero, save old height in tobar_height.
2795 Restore tool bar height when leaving fullscreen.
2796 (canBecomeMainWindow): New function.
2797
c6e21c03
PE
27982012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2799
2800 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2801
0d9f584b
EZ
28022012-10-05 Eli Zaretskii <eliz@gnu.org>
2803
a65fbb5f
EZ
2804 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2805
0d9f584b 2806 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
2807 that time stamps of directories could also be changed.
2808 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
2809 FILE_WRITE_ATTRIBUTES access rights.
2810
2811 * fileio.c (Fset_file_times): Special-case ignoring errors for
2812 directories only on MSDOS, not on MS-Windows.
2813
e8757f09 28142012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
2815
2816 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2817
7604f298
EZ
28182012-10-04 Eli Zaretskii <eliz@gnu.org>
2819
2820 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2821 see whether CreateFile failed.
2822
88d69b7d
PE
28232012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2824
2825 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2826 to avoid similar races.
2827 * keyboard.c (pending_signals): Now bool, not int.
2828
7509f454
PE
2829 Port timers to OpenBSD, plus check for timer failures.
2830 OpenBSD problem reported by Han Boetes.
2831 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2832 and/or setitimer.
2833 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2834 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2835 like OpenBSD, which has timer_settime but does not declare it.
2836 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2837 whether to use itimerspec-related primitives. All uses of
2838 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2839
a3c5c0c5
PE
28402012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2841
2842 * profiler.c (handle_profiler_signal): Fix a malloc race
2843 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2844
914e743b
JD
28452012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2846
2847 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2848
d8ab37a8
EZ
28492012-10-02 Eli Zaretskii <eliz@gnu.org>
2850
2851 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2852 consistent with the change in return value of 'safe_strsignal'.
2853
b3ecad33
PE
28542012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2855
0a99eee1
PE
2856 Prefer plain 'static' to 'static inline' (Bug#12541).
2857 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2858 (bidi_set_sor_type, bidi_push_embedding_level)
2859 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2860 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2861 (bidi_cache_search, bidi_cache_ensure_space)
2862 (bidi_cache_iterator_state, bidi_cache_find)
2863 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2864 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2865 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2866 Now 'static', not 'static inline'.
2867
b3ecad33
PE
2868 Count overruns when profiling; change units to ns.
2869 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2870 Give extra weight to samples after overruns, to attempt to count
2871 the time more accurately.
2872 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2873 the underlying primitives nominally do ns.
2874 (Fprofiler_cpu_start): Document the change. Mention that
2875 the sampling intervals are only approximate.
2876
090cf9db
SM
28772012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2878
2879 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2880
2881 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2882 case for the special 0 coding-system.
2883
2884 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2885 (Fmake_overlay): Remove redundant tests.
64edc777 2886 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 2887
81550bf4
JB
28882012-10-02 Juanma Barranquero <lekktu@gmail.com>
2889
2890 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2891 Update dependencies.
2892
aa1ba90e
PE
28932012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2894
2895 Fix a malloc race condition involving strsignal.
2896 A signal can arrive in the middle of a malloc, and Emacs's signal
2897 handler can invoke strsignal, which can invoke malloc, which is
2898 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2899 Fix it by altering the signal handler so that it does not invoke
2900 strsignal.
2901 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2902 * process.c (status_message): Use const pointer, in case strsignal
2903 is #defined to safe_strsignal.
2904 * sysdep.c (sys_siglist, init_signals): Always define and
2905 initialize a substitute sys_siglist if the system does not define
2906 one, even if HAVE_STRSIGNAL.
2907 (safe_strsignal): Rename from strsignal. Always define,
2908 using sys_siglist. Return a const pointer.
2909 * syssignal.h (safe_strsignal): New decl.
2910 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2911
ace917bd
EZ
29122012-10-01 Eli Zaretskii <eliz@gnu.org>
2913
2914 * w32proc.c (timer_loop): Fix code that waits for timer
2915 expiration, to avoid high CPU usage.
2916
9eb71b9c
SM
29172012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2918
2919 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2920 (sweep_weak_table): Remove redundant prototypes.
2921
b3317662
FP
29222012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2923
2924 * emacs.c: Move the inclusion of TERM_HEADER after including
2925 windows.h on WINDOWSNT. This avoids compilation problems with
2926 MSVC.
2927
f0e5f225
EZ
29282012-10-01 Eli Zaretskii <eliz@gnu.org>
2929
2d7d1608
EZ
2930 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2931 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2932 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2933 as the previous version used 'void *'.
2934
2935 * ralloc.c (ROUNDUP): Fix last change.
2936 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2937 'size_t'.
2938
f0e5f225
EZ
2939 * w32proc.c <disable_itimers>: New static flag.
2940 (init_timers): Initialize it to zero, after creating the critical
2941 sections used by the timer threads.
2942 (term_timers): Set to 1 before deleting the critical sections.
2943 (getitimer, setitimer): If disable_itimers is non-zero, return an
2944 error indication without doing anything. Reported by Fabrice
2945 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
2946 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2947 return results.
2948 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2949 support timers.
f0e5f225
EZ
2950
2951 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2952 term_ntproc after all the other bookkeeping, to get timers working
2953 as long as possible.
2954
82ef37c1
PE
29552012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2956
b3a4c387
PE
2957 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2958 Suggested by Juri Linkov in
2959 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2960
b0ab8123
PE
2961 Prefer plain 'static' to 'static inline' (Bug#12541).
2962 With static functions, modern compilers inline pretty well by
2963 themselves; advice from programmers often hurts as much as it helps.
2964 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2965 this change shrinks the text size of the Emacs executable by 1.1%
2966 without affecting CPU significantly in my benchmark.
2967 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2968 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2969 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2970 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2971 (bset_auto_fill_function, bset_auto_save_file_format)
2972 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2973 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2974 (bset_cache_long_line_scans, bset_case_fold_search)
2975 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2976 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2977 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2978 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2979 (bset_header_line_format, bset_indicate_buffer_boundaries)
2980 (bset_indicate_empty_lines, bset_invisibility_spec)
2981 (bset_left_fringe_width, bset_major_mode, bset_mark)
2982 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2983 (bset_name, bset_overwrite_mode, bset_pt_marker)
2984 (bset_right_fringe_width, bset_save_length)
2985 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2986 (bset_scroll_up_aggressively, bset_selective_display)
2987 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2988 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2989 (set_buffer_overlays_after):
2990 * category.c (bset_category_table):
2991 * charset.c (read_hex):
2992 * coding.c (produce_composition, produce_charset)
2993 (handle_composition_annotation, handle_charset_annotation)
2994 (char_encodable_p):
2995 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2996 (assign_row, set_frame_matrix_frame, make_current)
2997 (add_row_entry):
2998 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2999 * fns.c (maybe_resize_hash_table):
3000 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
3001 * gmalloc.c (register_heapinfo):
3002 * image.c (lookup_image_type):
3003 * intervals.c (set_interval_object, set_interval_left)
3004 (set_interval_right, copy_interval_parent, rotate_right)
3005 (rotate_left, balance_possible_root_interval):
3006 * keyboard.c (kset_echo_string, kset_kbd_queue)
3007 (kset_keyboard_translate_table, kset_last_prefix_arg)
3008 (kset_last_repeatable_command, kset_local_function_key_map)
3009 (kset_overriding_terminal_local_map, kset_real_last_command)
3010 (kset_system_key_syms, clear_event, set_prop):
3011 * lread.c (digit_to_number):
3012 * marker.c (attach_marker, live_buffer, set_marker_internal):
3013 * nsterm.m (ns_compute_glyph_string_overhangs):
3014 * process.c (pset_buffer, pset_command)
3015 (pset_decode_coding_system, pset_decoding_buf)
3016 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
3017 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
3018 (pset_status, pset_tty_name, pset_type, pset_write_queue):
3019 * syntax.c (bset_syntax_table, dec_bytepos):
3020 * terminal.c (tset_param_alist):
3021 * textprop.c (interval_has_some_properties)
3022 (interval_has_some_properties_list):
3023 * window.c (wset_combination_limit, wset_dedicated)
3024 (wset_display_table, wset_hchild, wset_left_fringe_width)
3025 (wset_left_margin_cols, wset_new_normal, wset_new_total)
3026 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3027 (wset_right_fringe_width, wset_right_margin_cols)
3028 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
3029 (wset_vertical_scroll_bar_type, wset_window_parameters):
3030 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3031 (wset_column_number_displayed, wset_region_showing)
3032 (window_box_edges, run_window_scroll_functions)
3033 (append_glyph_string_lists, prepend_glyph_string_lists)
3034 (append_glyph_string, set_glyph_string_background_width)
3035 (append_glyph, append_composite_glyph)
3036 (take_vertical_position_into_account):
3037 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
3038 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
3039 (lface_hash, lface_same_font_attributes_p, lookup_face):
3040 * xml.c (libxml2_loaded_p):
3041 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
3042 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
3043 Now 'static', not 'static inline'.
3044
05584c31
PE
3045 * bidi.c: Tune.
3046 (bidi_copy_it): Do the whole copy with a single memcpy.
3047 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
3048
86ec63ba
PE
3049 Revert the FOLLOW-SYMLINKS change for file-attributes.
3050 Doing it right would require several changes to Tramp, and there's
3051 not enough time to get that tested before the freeze today.
3052 * dired.c (directory_files_internal, Ffile_attributes):
3053 Undo last change.
3054
82ef37c1
PE
3055 * frame.c (x_report_frame_params): Port better to wider ints.
3056 Do not assume that EMACS_UINT is the same width as uprintmax_t,
3057 or that pointers can be printed in 15 decimal digits.
3058 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
3059
62aba0d4
FP
30602012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
3061
3062 Support x64 build on MS-Windows.
3063 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
3064 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
3065 compatibility with x64.
5e4daaf3 3066 (x_get_focus_frame): Add prototype.
62aba0d4
FP
3067
3068 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
3069 defining an XRectangle structure.
3070
3071 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
3072 arithmetics for compatibility with x64.
3073
3074 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
3075 compatibility with x64.
3076
3077 * w32heap.h: Adjust prototypes and declarations.
3078
3079 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
3080 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
3081 DWORD, long, and unsigned long, for compatibility with x64.
3082 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
3083 (sbrk): Argument is now of type ptrdiff_t.
3084
3085 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
3086 less than 0x0500.
3087 (w32_msg_pump): Use WPARAM type for 'result'.
3088
3089 * w32.c (init_environment, get_emacs_configuration): Support AMD64
3090 architecture.
3091 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
3092 compatibility with x64.
3093
3094 * vm-limit.c (lim_data): Now size_t.
3095 (check_memory_limits): Adjust prototypes of real_morecore and
3096 __morecore to receive argument of type ptrdiff_t. Use size_t for
3097 five_percent and data_size.
3098
3099 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
3100 variables, for compatibility with x64.
3101 (rva_to_section, offset_to_section, relocate_offset)
3102 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
3103 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
3104 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
3105 for compatibility with x64.
3106
3107 * sysdep.c (STDERR_FILENO): Define if not already defined.
3108
3109 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
3110 (__morecore): Argument type is now ptrdiff_t.
3111 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
3112 (relinquish): Use ptrdiff_t type for 'excess'.
3113 (r_alloc_sbrk): Argument type is now ptrdiff_t.
3114
3115 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
3116 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
3117 instead of a literal number.
3118
3119 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
3120 (min): Define only if not already defined.
3121
3122 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
3123 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
3124 hosts.
3125
3126 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
3127 'bitmaps' is a pointer.
3128
3129 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
3130
3131 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
3132
e7a2937b
PE
31332012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3134
3135 file-attributes has a new optional arg FOLLOW-SYMLINKS.
3136 * dired.c (directory_files_internal, Ffile_attributes):
3137 New arg follow_symlinks. All uses changed.
3138
b43d62ae
SM
31392012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
3140
3141 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
3142
c06c382a
EZ
31432012-09-30 Eli Zaretskii <eliz@gnu.org>
3144
3145 Support atimers and CPU profiler via profile.c on MS-Windows.
3146 * w32proc.c (sig_mask, crit_sig): New static variables.
3147 (sys_signal): Support SIGALRM and SIGPROF.
3148 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 3149 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
3150 sigfillset, and sigprocmask are no longer no-ops.
3151 (sigismember): New function.
3152 (struct itimer_data): New definition.
3153 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
3154 (crit_prof): New static variables.
3155 (MAX_SINGLE_SLEEP): New definition.
3156 (timer_loop, stop_timer_thread, term_timers, init_timers)
3157 (start_timer_thread, getitimer, setitimer): New functions.
3158 (alarm): No longer a no-op, calls setitimer.
3159
3160 * w32.c (term_ntproc): Call term_timers.
3161 (init_ntproc): Make sure all signals are unblocked at startup, to
3162 erase any traces of dumping. Call init_timers.
3163
3164 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
3165 Windows-specific code to display the hourglass mouse pointer is no
3166 longer used.
3167 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
3168 to hourglass timer expiration.
3169 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
3170 Remove, no longer used.
b43d62ae
SM
3171 (w32_note_current_window, show_hourglass, hide_hourglass):
3172 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
3173 window systems.
3174 (syms_of_w32fns): Don't initialize hourglass_timer.
3175
3176 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
3177 WINDOWSNT as well.
3178 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
3179
3180 * w32.h (init_timers, term_timers): Add prototypes.
3181
95402d5f
KH
31822012-09-30 Kenichi Handa <handa@gnu.org>
3183
3184 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
3185 to the buffer relocation which may be caused by ccl_driver.
3186
dd946752
JD
31872012-09-30 Jan Djärv <jan.h.d@swipnet.se>
3188
d7e642cc
JD
3189 * xfns.c (Fx_file_dialog): Update comment.
3190
3191 * w32fns.c (Fx_file_dialog): Update comment.
3192
3193 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
3194 Initialize panel name field if OSX >= 10.6.
3195
3196 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
3197
dd946752
JD
3198 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
3199
3200 * nsterm.m (NEW_STYLE_FS): New define.
3201 (ns_fullscreen_hook, windowWillEnterFullScreen)
3202 (windowDidEnterFullScreen, windowWillExitFullScreen)
3203 (windowDidExitFullScreen, toggleFullScreen, handleFS)
3204 (setFSValue): New functions.
3205 (EmacsFSWindow): New implementation.
3206 (canBecomeKeyWindow): New function for EmacsFSWindow.
3207 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
3208 (dealloc): Release nonfs_window if in fullscreen.
3209 (updateFrameSize:): Call windowDidMove to update top/left.
3210 (windowWillResize:toSize:): Check if frame is still maximized.
3211 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
3212 next_maximized, maximized_width, maximized_height and nonfs_window.
3213 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
3214 tbar_height.
3215 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 3216 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
3217
3218 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
3219 (EmacsView): Add variables for fullscreen.
3220 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
3221 (EmacsFSWindow): New interface for fullscreen.
3222
427730eb
JB
32232012-09-30 Juanma Barranquero <lekktu@gmail.com>
3224
3225 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3226
48de8b12
CY
32272012-09-30 Chong Yidong <cyd@gnu.org>
3228
3229 * fns.c (Frandom): Doc fix.
3230
5938d519
MR
32312012-09-30 Martin Rudalics <rudalics@gmx.at>
3232
3233 * window.c (Vwindow_combination_limit): New default value.
3234 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
3235
cb5b0266
PE
32362012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3237
3238 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
3239 Suggested by Eli Zaretskii in
3240 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
3241
84f72efd
EZ
32422012-09-30 Eli Zaretskii <eliz@gnu.org>
3243
3244 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
3245 HAVE_TIMER_SETTIME is defined.
3246
9d4dcdc9
PE
32472012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3248
d89460ed
PE
3249 Profiler improvements: more-accurate timers, overflow checks.
3250 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
3251 signal.h, setjmp.h. Include systime.h instead.
3252 (saturated_add): New function.
3253 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
3254 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
3255 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
3256 New static vars.
84f72efd 3257 (enum profiler_cpu_running): New enum.
d89460ed
PE
3258 (profiler_cpu_running): Now of that enum type, not bool.
3259 All uses changed to store the new value.
3260 (handle_profiler_signal): Rename from sigprof_handler_1,
3261 for consistency with other handlers. Do not check whether
3262 cpu_log is a hash-table if garbage collecting, since it
3263 doesn't matter in that case.
3264 (deliver_profiler_signal): Rename from sigprof_handler,
3265 for consistency with other handlers.
3266 (setup_cpu_timer): New function, with much of what used to be in
3267 Fprofiler_cpu_start. Check for out-of-range argument.
3268 Prefer timer_settime if available, and prefer
3269 thread cputime clocks, then process cputime clocks, then
3270 monotonic clocks, to the old realtime clock. Use make_timeval
3271 to round more-correctly when falling back to setitimer.
3272 (Fprofiler_cpu_start): Use it.
3273 (Fprofiler_cpu_stop): Prefer timer_settime if available.
3274 Don't assume that passing NULL as the 2nd argument of setitimer
3275 is the same as passing a pointer to all-zero storage.
3276 Ignore SIGPROF afterwards.
3277 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
3278 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
3279 non-fatal signal handlers. Ignore SIGPROF on startup.
3280 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
3281 in profiler.c, since sysdep.c now uses it.
3282
9d4dcdc9
PE
3283 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
3284 Suggested by Eli Zaretskii in
3285 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3286
8e5691a0
JB
32872012-09-29 Juanma Barranquero <lekktu@gmail.com>
3288
3289 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3290
e7c1b6ef
SM
32912012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
3292
3293 * lisp.h (struct backtrace): Remove indirection for `function' field.
3294 * xdisp.c (redisplay_internal):
3295 * profiler.c (record_backtrace, sigprof_handler_1):
3296 * alloc.c (Fgarbage_collect):
3297 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
3298 (Fbacktrace_frame): Adjust accordingly.
3299
e61d39cd 33002012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
3301
3302 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
3303 (Frun_hook_with_args_until_failure): Doc fixes.
3304
404043ea
EZ
33052012-09-28 Eli Zaretskii <eliz@gnu.org>
3306
3307 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
3308 Qautomatic_redisplay and change the symbol name. All users changed.
3309
704d3f45
TM
33102012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
3311
3312 * profiler.c (sigprof_handler): Fix race condition.
3313
757140ff
GM
33142012-09-28 Glenn Morris <rgm@gnu.org>
3315
3316 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
3317
a615a3ae
PE
33182012-09-27 Paul Eggert <eggert@cs.ucla.edu>
3319
3320 Check more robustly for timer_settime.
89d17fd0
PE
3321 * Makefile.in (LIB_TIMER_TIME): New macro.
3322 (LIBES): Add it.
a615a3ae
PE
3323 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
3324 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
3325 call timer_settime.
3326
3670daf7
TM
33272012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3328
3329 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
3330
6a586b7f
JB
33312012-09-26 Juanma Barranquero <lekktu@gmail.com>
3332
3333 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3334
41c8bfcf
PE
33352012-09-26 Paul Eggert <eggert@cs.ucla.edu>
3336
3337 * character.h (MAYBE_UNIFY_CHAR): Remove.
3338 * charset.c, charset.h (maybe_unify_char): Now static.
3339 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
3340 Since this stuff is now private to charset.c, there's no need for
3341 a public macro and no need to inline by hand.
3342
3a880af4
SM
33432012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3344 Stefan Monnier <monnier@iro.umontreal.ca>
3345 Juanma Barranquero <lekktu@gmail.com>
611b7507 3346
3a880af4
SM
3347 * profiler.c: New file.
3348 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
3349 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
3350 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
3351 * emacs.c (main): Call syms_of_profiler.
3352 * alloc.c (Qautomatic_gc): New constant.
3353 (MALLOC_PROBE): New macro.
3354 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
3355 (total_bytes_of_live_objects): New function.
3356 (Fgarbage_collect): Use it. Record itself in backtrace_list.
3357 Call malloc_probe for the memory profiler.
3358 (syms_of_alloc): Define Qautomatic_gc.
3359 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
3360 race condition.
3361 (struct backtrace): Move definition...
3362 * lisp.h (struct backtrace): ..here.
3363 (Qautomatic_gc, profiler_memory_running): Declare vars.
3364 (malloc_probe, syms_of_profiler): Declare functions.
3365 * xdisp.c (Qautomatic_redisplay): New constant.
3366 (redisplay_internal): Record itself in backtrace_list.
3367 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 3368
5938d519 33692012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
33702012-09-25 Juanma Barranquero <lekktu@gmail.com>
3371
3372 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
3373
e26fd2e4
PE
33742012-09-25 Paul Eggert <eggert@cs.ucla.edu>
3375
3376 Prefer POSIX timers if available.
3377 They avoid a race if the timer is too close to the current time.
3378 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
3379 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 3380 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 3381
eedec3ee
EZ
33822012-09-25 Eli Zaretskii <eliz@gnu.org>
3383
3384 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
3385 CHAR_STRING_ADVANCE.
3386 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
3387 STRING_CHAR_ADVANCE.
3388
aa15c6bb
JB
33892012-09-25 Juanma Barranquero <lekktu@gmail.com>
3390
3391 Move Vlibrary_cache to emacs.c and reset before dumping.
3392
3393 * lisp.h (reset_image_types): Declare.
3394 [WINDOWSNT] (Vlibrary_cache): Declare.
3395
3396 * image.c (reset_image_types): New function.
3397
3398 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
3399 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
3400 (Fdump_emacs): Reset Vlibrary_cache and image_types.
3401
3402 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
3403 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3404
3405 * w32.h (Vlibrary_cache): Do not declare.
3406
54d629be
EZ
34072012-09-25 Eli Zaretskii <eliz@gnu.org>
3408
16b22fef
EZ
3409 * w32proc.c (sys_signal): Handle all signals defined by the
3410 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3411 handlers for signals supported by Windows. Don't override
3412 term_ntproc as the handler for SIGABRT.
3413 (sigaction): Rewrite to call sys_signal instead of duplicating its
3414 code.
3415 (sys_kill): Improve commentary.
3416
3417 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3418 consistency with a signature of a signal handler. All callers
3419 changed.
3420 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3421 install term_ntproc as a signal handler for SIGABRT, as that
3422 should be done by the dumped Emacs.
3423
3424 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3425
3426 * w32select.c (term_w32select): Protect against repeated
3427 invocation by setting clipboard_owner to NULL after calling
3428 DestroyWindow.
3429
3430 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3431 and term_ntproc to their modified signatures.
3432
54d629be
EZ
3433 * character.c (char_string, string_char): Remove calls to
3434 MAYBE_UNIFY_CHAR. See the discussion starting at
3435 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3436 for the details.
3437
59f7af81
CY
34382012-09-25 Chong Yidong <cyd@gnu.org>
3439
3440 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3441
22e8cf4a
SM
34422012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3443
3444 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3445 when encountering an unknown bytecode.
3446
578098f3
PE
34472012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3448
3449 image.c, indent.c: Use bool for booleans.
3450 * dispextern.h (struct image_type): Members valid_p, load, init
3451 now return bool, not int. All uses changed.
3452 * image.c: Omit unnecessary static decls.
3453 (x_create_bitmap_mask, x_build_heuristic_mask):
3454 Return void, not int, since callers don't care about the return value.
3455 (x_create_bitmap_mask, define_image_type, valid_image_p)
3456 (struct image_keyword, parse_image_spec, image_spec_value)
3457 (check_image_size, image_background)
3458 (image_background_transparent, x_clear_image_1)
3459 (postprocess_image, lookup_image, x_check_image_size)
3460 (x_create_x_image_and_pixmap, xbm_image_p)
3461 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3462 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3463 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3464 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3465 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3466 (png_image_p, init_png_functions, png_load_body, png_load)
3467 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3468 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3469 (init_gif_functions, gif_load, imagemagick_image_p)
3470 (imagemagick_load_image, imagemagick_load, svg_image_p)
3471 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3472 (gs_load):
3473 * nsimage.m (ns_load_image):
3474 * nsterm.m (ns_defined_color):
3475 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3476 * xfns.c (x_defined_color):
3477 * xterm.c (x_alloc_lighter_color_for_widget)
3478 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3479 (x_alloc_lighter_color):
3480 * indent.c (disptab_matches_widthtab, current_column)
3481 (scan_for_column, string_display_width, indented_beyond_p)
3482 (compute_motion, vmotion, Fvertical_motion):
3483 Use bool for booleans.
3484
a5f2b6ec
CY
34852012-09-24 Chong Yidong <cyd@gnu.org>
3486
3487 * chartab.c (Fset_char_table_default): Obsolete function removed.
3488
18e27ea8
PE
34892012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3490
afea8a8a
PE
3491 Move pid_t related decls out of lisp.h.
3492 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3493 (interruptible_wait_for_termination):
3494 Move these decls from lisp.h to syswait.h, since they use pid_t.
3495 Needed on FreeBSD; see Herbert J. Skuhra in
3496 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3497 * callproc.c: Include syswait.h.
3498
18e27ea8
PE
3499 gnutls.c, gtkutil.c: Use bool for boolean.
3500 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3501 (emacs_gnutls_handle_error):
3502 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3503 (xg_hide_tooltip, xg_create_frame_widgets)
3504 (create_dialog, xg_uses_old_file_dialog)
3505 (xg_get_file_with_chooser, xg_get_file_with_selection)
3506 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3507 (xg_item_label_same_p, xg_update_menubar)
3508 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3509 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3510 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3511 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3512 (update_frame_tool_bar, free_frame_tool_bar):
3513 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3514 * nsmenu.m (ns_update_menubar):
3515 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3516 * xfns.c (Fx_show_tip) [USE_GTK]:
3517 Use bool for boolean.
3518 * gtkutil.c (xg_update_frame_menubar):
3519 * xmenu.c (update_frame_menubar):
3520 Return void, not int, since caller ignores return value.
3521 * gtkutil.c (xg_change_toolbar_position):
3522 Return void, not 1.
3523
af0e9f75
JB
35242012-09-23 Juanma Barranquero <lekktu@gmail.com>
3525
3526 * makefile.w32-in (BLOCKINPUT_H): Remove.
3527 (SYSSIGNAL_H): New macro.
3528 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3529 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3530 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3531 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3532 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3533 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3534 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3535 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3536 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3537 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3538 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3539 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3540 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3541 ($(BLD)/w32xfns.$(O)): Update dependencies.
3542
5101529e
EZ
35432012-09-23 Eli Zaretskii <eliz@gnu.org>
3544
3545 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3546 fatal_error_backtrace.
3547
3548 * w32proc.c (sys_kill): Undo last change: don't do anything when
3549 invoked to deliver SIGABRT to our own process. This is now
3550 handled by emacs_raise.
3551
2c3ee0ad
JB
35522012-09-23 Juanma Barranquero <lekktu@gmail.com>
3553
3554 * w32term.c (w32_read_socket): Remove leftover reference to
3555 interrupt_input_pending.
3556
62a1d661
PE
35572012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3558
3559 Do not use SA_NODEFER.
3560 Problem reported by Dani Moncayo in
3561 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3562 * alloc.c (die):
3563 * sysdep.c (emacs_abort): Do not reset signal handler.
3564 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3565 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3566 wanted even on POSIXish hosts, and it doesn't work on Windows.
3567
a0942b9a
JD
35682012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3569
3570 * xterm.c (x_term_init): Call fixup_locale before and after calling
3571 gtk_init (Bug#12392).
3572
d07ff9db
CY
35732012-09-23 Chong Yidong <cyd@gnu.org>
3574
3575 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3576 Vdynamic_library_alist.
3577
3578 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3579 (Fgnutls_available_p): Caller changed.
3580
3581 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3582 (Flibxml_parse_xml_region): Likewise.
3583
3584 * dispextern.h (struct image_type): Remove arg from init function.
3585
3586 * image.c (Finit_image_library, lookup_image_type)
3587 (define_image_type): Remove now-unneeded second arg.
3588 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3589 (init_tiff_functions, init_gif_functions, init_svg_functions):
3590 Arglist and w32_delayed_load calling convention changed.
3591 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 3592 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 3593
4d7e6e51
PE
35942012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3595
3596 Simplify and avoid signal-handling races (Bug#12471).
3597 * alloc.c (die):
3598 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3599 Avoid recursive loop if there's a fatal error in the function itself.
3600 * atimer.c (pending_atimers):
3601 * blockinput.h: Don't include "atimer.h"; no longer needed.
3602 (interrupt_input_pending): Remove. All uses removed.
3603 pending_signals now counts both atimers and ordinary interrupts.
3604 This is less racy than having three separate pending-signal flags.
3605 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3606 (input_blocked_p):
3607 Rename from their upper-case counterparts BLOCK_INPUT,
3608 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3609 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3610 This makes it easier to access volatile variables more accurately.
3611 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3612 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3613 that's more reliable if the code is buggy and sets
3614 interrupt_input_blocked to a negative value. All uses changed.
3615 * atimer.c (deliver_alarm_signal):
3616 Remove. No need to deliver this to the parent; any thread can
3617 handle this signal now. All uses replaced by underlying handler.
3618 * atimer.c (turn_on_atimers):
3619 * dispnew.c (handle_window_change_signal):
3620 * emacs.c (handle_danger_signal):
3621 * keyboard.c (kbd_buffer_get_event):
3622 Don't reestablish signal handler; not needed with sigaction.
3623 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3624 (UNBLOCK_INPUT_TO):
3625 Rework to avoid unnecessary accesses to volatile variables.
3626 (UNBLOCK_INPUT_TO): Now a function.
3627 (totally_unblock_input, unblock_input): New decls.
3628 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3629 (init_data): Remove. Necessary stuff now done in init_signal.
3630 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3631 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3632 (fatal_error_code): Remove; no longer needed.
3633 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3634 it doesn't always backtrace. All uses changed. No need to reset
3635 signal to default, since sigaction and/or die does that for us now.
3636 Use emacs_raise (FOO), not kill (getpid (), FOO).
3637 (main): Check more-accurately whether we're dumping.
3638 Move fatal-error setup to sysdep.c
3639 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3640 * gtkutil.c (xg_get_file_name, xg_get_font):
3641 Remove no-longer-needed signal-mask manipulation.
3642 * keyboard.c, process.c (POLL_FOR_INPUT):
3643 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3644 * keyboard.c (read_avail_input): Remove.
3645 All uses replaced by gobble_input.
3646 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3647 (kbd_buffer_store_event_hold, gobble_input):
3648 (record_asynch_buffer_change) [USABLE_SIGIO]:
3649 (store_user_signal_events):
3650 No need to mess with signal mask.
3651 (gobble_input): If blocking input and there are terminals, simply
3652 set pending_signals to 1 and return. All hooks changed to not
3653 worry about whether input is blocked.
3654 (process_pending_signals): Clear pending_signals before processing
3655 them, in case a signal comes in while we're processing.
3656 By convention callers now test pending_signals before calling us.
3657 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3658 New functions, to support changes to blockinput.h.
3659 (handle_input_available_signal): Now extern.
3660 (reinvoke_input_signal): Remove. All uses replaced by
3661 handle_async_input.
3662 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
3663 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3664 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
3665 Clear sigmask reliably, even if Fsignal returns, which it can.
3666 Omit unnecessary accesses to volatile var.
3667 (quit_throw_to_read_char): No need to restore sigmask.
3668 * keyboard.c (gobble_input, handle_user_signal):
3669 * process.c (wait_reading_process_output):
3670 Call signal-handling code rather than killing ourselves.
3671 * lisp.h: Include <float.h>, for...
3672 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3673 (pending_signals): Now volatile.
3674 (syms_of_data): Now const if IEEE floating point.
3675 (handle_input_available_signal) [USABLE_SIGIO]:
3676 (terminate_due_to_signal, record_child_status_change): New decls.
3677 * process.c (create_process): Avoid disaster if memory is exhausted
3678 while we're processing a vfork, by tightening the critical section
3679 around the vfork.
3680 (send_process_frame, process_sent_to, handle_pipe_signal)
3681 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3682 ignores SIGPIPE.
3683 (send_process): No need for setjmp/longjmp any more, since the
3684 SIGPIPE stuff is now gone. Instead, report an error if errno
3685 is EPIPE.
3686 (record_child_status_change): Now extern. PID and W are now args.
3687 Return void, not bool. All callers changed.
3688 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3689 Remove. All uses removed. This bug should be fixed now in a
3690 different way.
3691 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3692 and record the child status change directly. This avoids the
3693 need to futz with the signal mask.
3694 (process_fatal_action): Move here from emacs.c.
3695 (emacs_sigaction_flags): New function, containing
3696 much of what used to be in emacs_sigaction_init.
3697 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3698 caught by emacs, to make races less likely.
3699 (deliver_process_signal): Rename from handle_on_main_thread.
3700 All uses changed.
3701 (BACKTRACE_LIMIT_MAX): Now at top level.
3702 (thread_backtrace_buffer, threadback_backtrace_pointers):
3703 New static vars.
3704 (deliver_thread_signal, deliver_fatal_thread_signal):
3705 New functions, for more-accurate delivery of thread-specific signals.
3706 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3707 (deliver_arith_signal): Handle in this thread, not
3708 in the main thread, since it's triggered by this thread.
3709 (maybe_fatal_sig): New function.
3710 (init_signals): New arg DUMPING so that we can be more accurate
3711 about whether we're dumping. Caller changed.
3712 Treat thread-specific signals differently from process-general signals.
3713 Block all signals while handling fatal error; that's safer.
3714 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3715 on IEEE hosts.
3716 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3717 Ignore SIGPIPE unless batch.
3718 (emacs_backtrace): Output backtrace for the appropriate thread,
3719 which is not necessarily the main thread.
3720 * syssignal.h: Include <stdbool.h>.
3721 (emacs_raise): New macro.
3722 * xterm.c (x_connection_signal): Remove; no longer needed
3723 now that we use sigaction.
3724 (x_connection_closed): No need to mess with sigmask now.
3725 (x_initialize): No need to reset SIGPIPE handler here, since
3726 init_signals does this for us now.
3727
8f4635e9
JD
37282012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3729
3730 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 3731 background rect may be larger (Bug#12245).
8f4635e9 3732
3296976d
CY
37332012-09-23 Chong Yidong <cyd@gnu.org>
3734
3735 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3736
d41e491e
PE
37372012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3738
3739 * .gdbinit: Just stop at fatal_error_backtrace.
3740 See Stefan Monnier's request in
3741 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3742 Remove no-longer-used query of system type.
3743
c88b867f
CY
37442012-09-22 Chong Yidong <cyd@gnu.org>
3745
3746 * search.c (Freplace_match): Doc fix (Bug#12325).
3747
3748 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3749
3750 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3751 (Fline_end_position): Doc fix.
3752
3753 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3754
bb4d86b4
CY
37552012-09-22 Chong Yidong <cyd@gnu.org>
3756
3757 * dispextern.h (struct image_type): Add new slot, storing a type
3758 initialization function.
3759
3760 * image.c (define_image_type): Call the image initializer function
3761 if it is defined. Arguments and return value changed.
3762 (valid_image_p, make_image): Callers changed.
3763 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
3764 (gif_type, imagemagick_type, svg_type, gs_type):
3765 Add initialization functions.
bb4d86b4
CY
3766 (Finit_image_library): Call lookup_image_type.
3767 (CHECK_LIB_AVAILABLE): Macro deleted.
3768 (lookup_image_type): Call define_image_type here, rather than via
3769 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3770 (syms_of_image): Move define_image_type calls for xbm_type and
3771 pbm_type to lookup_image_type.
3772
df9685f3
EZ
37732012-09-22 Eli Zaretskii <eliz@gnu.org>
3774
3775 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3776 'idle_timers' from here ...
3777 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3778 lists, to avoid infloops when the timer does something stupid,
3779 like reinvoke itself with the same or smaller time-out.
3780 (Bug#12447)
3781
8e17c9ba
MR
37822012-09-22 Martin Rudalics <rudalics@gmx.at>
3783
3784 * window.c (Fsplit_window_internal): Handle only Qt value of
3785 Vwindow_combination_limit separately.
3786 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
3787 (Vwindow_combination_limit): New default value.
3788 Rewrite doc-string.
8e17c9ba 3789
589bd69b
EZ
37902012-09-22 Eli Zaretskii <eliz@gnu.org>
3791
3792 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3793 the new overlay string. (Bug#10159)
3794
01108e3f
PE
37952012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3796
3797 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3798 or that fprintf is async-signal-safe. POSIX doesn't require
3799 either assumption.
3800
82f8cd94
CY
38012012-09-22 Chong Yidong <cyd@gnu.org>
3802
3803 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3804 (Bug#8207).
3805
3cccbd87
KH
38062012-09-22 Kenichi Handa <handa@gnu.org>
3807
3808 * composite.c (composition_reseat_it): Handle the case that a
3809 grapheme cluster is not covered by a single font (Bug#12352).
3810
09c01941
CY
38112012-09-21 Chong Yidong <cyd@gnu.org>
3812
3813 * image.c (define_image_type): Avoid adding duplicate types to
3814 image_types (Bug#12463). Suggested by Jörg Walter.
3815
acfa068f 38162012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
3817
3818 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3819 (print_load_command_name): Add case LC_DATA_IN_CODE.
3820 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3821
acfa068f 38222012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
3823
3824 * eval.c (Frun_hook_with_args_until_success)
3825 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3826
acfa068f 38272012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
3828
3829 * fileio.c (Ffile_selinux_context): Only call freecon when
3830 lgetfilecon succeeded.
3831 (Fset_file_selinux_context): Likewise. (Bug#12444)
3832
acfa068f 38332012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
3834
3835 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3836 reordering, locate the cursor by calling set_cursor_from_row; if
3837 that fails, clear the desired glyph matrix before returning a
3838 failure indication to the caller. Fixes leaving garbled display
3839 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
3840 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3841 scrolling through multibyte text.
aa36e4d2 3842
e99f70c8
SM
38432012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3844
3845 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3846 calling mark_vectorlike since that's the one that marks the window.
3847 (mark_discard_killed_buffers): Mark the final cdr.
3848 * window.h (struct window): Move prev/next_buffers to the
3849 non-standard fields.
3850 * window.c (make_window): Initialize prev/next_buffers manually.
3851
f75beb47
PE
38522012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3853
3854 Omit unused arg EXPECTED from socket hooks.
3855 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3856 * nsterm.m (ns_term_init):
3857 * termhooks.h (struct terminal.read_socket_hook):
3858 * w32inevt.c (w32_console_read_socket):
3859 * w32term.c (w32_read_socket):
3860 * xterm.c (XTread_socket):
3861 Omit unused arg EXPECTED. All callers changed.
3862 (store_user_signal_events): Return void, not int, since callers no
3863 longer care about the return value. All uses changed.
3864
b019b76a
JB
38652012-09-20 Juanma Barranquero <lekktu@gmail.com>
3866
3867 * w32gui.h (XParseGeometry): Do not declare.
3868
05642592
PE
38692012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3870
e4bce92a 3871 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 3872 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
3873 <http://bugs.gnu.org/12471#8> (last line).
3874
05642592
PE
3875 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3876 (XParseGeometry): Now static. Substitute extremal values for
3877 values that are out of range.
3878
e543ae91
JD
38792012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3880
3881 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3882
3883 * nsfns.m (XParseGeometry): Remove.
3884 (Fx_create_frame): Call x_set_offset to correctly interpret
3885 top_pos in geometry.
3886
3a880af4 3887 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
3888 (Fx_parse_geometry): If there is a space in string, call
3889 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3890
45ba16c7
EZ
38912012-09-17 Eli Zaretskii <eliz@gnu.org>
3892
c8b9f1bc
EZ
3893 * search.c (scan_buffer): Use character positions in calls to
3894 region_cache_forward and region_cache_backward, not byte
3895 positions. (Bug#12196)
3896
b4c932a2
EZ
3897 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3898 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3899
45ba16c7
EZ
3900 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3901 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3902 emacs_blocked_malloc, now deleted.
3903
eeceac93
PE
39042012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3905
3906 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3907 The workaround was for improving performance on Solaris 2.4, but
3908 is getting in the way now. Emacs will still work if someone is
3909 still running Solaris 2.4 in a museum somewhere; Sun dropped
3910 support for Solaris 2.4 in 2003.
3911 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3912 * process.c (create_process) [HAVE_WORKING_VFORK]:
3913 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3914 since Emacs no longer uses vfork on that platform.
3915
78f83752
GM
39162012-09-17 Glenn Morris <rgm@gnu.org>
3917
3918 * emacs.c: Use COPYRIGHT.
3919
634b8cac
PE
39202012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3921
0caaedb1
PE
3922 Remove configure's --without-sync-input option (Bug#12450).
3923 When auditing signal-handling in preparation for cleaning it up,
3924 I found that SYNC_INPUT has race conditions and would be a real
3925 pain to fix. Since it's an undocumented and deprecated
3926 configure-time option, now seems like a good time to remove it.
3927 Also see <http://bugs.gnu.org/11080#16>.
3928 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3929 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3930 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3931 (malloc_hysteresis):
3932 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3933 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3934 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3935 (dont_register_blocks, bytes_used_when_reconsidered)
3936 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3937 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3938 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 3939 Remove. All uses removed.
0caaedb1
PE
3940 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3941 implementation, one that depends on whether the new macro
3942 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3943 is defined.
3944 * atimer.c (run_timers, handle_alarm_signal):
3945 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3946 (handle_async_input, process_pending_signals)
3947 (handle_input_available_signal, init_keyboard):
3948 * nsterm.m (ns_read_socket):
3949 * process.c (wait_reading_process_output):
3950 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3951 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3952 (emacs_write):
3953 * xterm.c (XTread_socket):
3954 Assume SYNC_INPUT.
3955 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3956 * eval.c (handling_signal): Remove. All uses removed.
3957 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3958 All uses replaced with the SYNC_INPUT version.
3959 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3960 Remove decls.
3961 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3962 Now static.
3963
634b8cac
PE
3964 * font.c (Ffont_shape_gstring): Remove unused local.
3965
83da1b55
GM
39662012-09-16 Glenn Morris <rgm@gnu.org>
3967
518650a5
GM
3968 * Makefile.in (clean): No longer run nextstep's clean.
3969
83da1b55
GM
3970 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3971 (ns_frag): Remove.
3972 (ns-app): Move here from ns.mk, and simplify.
3973 (clean): Simplify nextstep entry.
3974 * ns.mk: Remove file.
3975
85a43e2e
KH
39762012-09-17 Kenichi Handa <handa@gnu.org>
3977
3978 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3979 not covert the last few charactes.
3980
ba13e616 39812012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
3982
3983 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3984 here, but just check the validity of glyphs in the glyph-string.
3985
a8c729af
MR
39862012-09-16 Martin Rudalics <rudalics@gmx.at>
3987
3a880af4
SM
3988 * window.c (Fwindow_parameter, Fset_window_parameter):
3989 Accept any window as argument (Bug#12452).
a8c729af 3990
c077c059
JD
39912012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3992
3993 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3994 to ns_term_init to avoid memory leak.
3995
3996 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3997 explicit retain/release.
3998 (ns_term_init): Only allow one display. Initialize outerpool and
3999 ns_*_types.
4000
39a57ad0
PE
40012012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4002
4003 Port _setjmp fix to POSIXish hosts as well as Microsoft.
4004 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
4005 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
4006 the Microsoft problem in a different way, by altering ../nt/config.nt.
4007
7105c8cb
EZ
40082012-09-15 Eli Zaretskii <eliz@gnu.org>
4009
4010 * w32xfns.c:
4011 * w32uniscribe.c:
4012 * w32term.c:
4013 * w32select.c:
4014 * w32reg.c:
4015 * w32proc.c:
4016 * w32menu.c:
4017 * w32inevt.c:
4018 * w32heap.c:
4019 * w32font.c:
4020 * w32fns.c:
4021 * w32console.c:
4022 * w32.c:
4023 * w16select.c: Remove inclusion of setjmp.h, as it is now included
4024 by lisp.h. This completes removal of setjmp.h inclusion
4025 erroneously announced in the previous commit. (Bug#12446)
4026
4027 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
4028 more accurate.
4029
4030 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
4031 not defined as a macro. The latter happens on MS-Windows.
4032 (Bug#12446)
4033
0328b6de
PE
40342012-09-15 Paul Eggert <eggert@cs.ucla.edu>
4035
4036 Port better to POSIX hosts lacking _setjmp (Bug#12446).
4037 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 4038 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
4039 only reason for the instance was because "lisp.h" was included.
4040 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
4041 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
4042 and _longjmp with the new symbols. Emacs already uses _setjmp if
4043 available, so this change affects only POSIXish hosts that have
4044 sigsetjmp but not _setjmp, such as some versions of Solaris and
4045 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
4046 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
4047 (png_load_body) [HAVE_PNG]:
4048 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
4049 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
4050 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
4051 since PNG requires jmp_buf. This is the only exception to the
4052 general rule that we now use sys_setjmp and sys_longjmp.
4053 This exception is OK since this code does not change the signal
4054 mask or longjmp out of a signal handler.
4055
2af03429
PE
40562012-09-14 Paul Eggert <eggert@cs.ucla.edu>
4057
4058 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
4059 Include "syssignal.h", for 'main_thread'.
4060
2f294edf
DA
40612012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
4062
4063 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
4064 * insdel.c (replace_range, replace_range_2):
4065 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
4066 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
4067 Remove redundant check before calling offset_intervals.
4068
6b533e9c
MR
40692012-09-14 Martin Rudalics <rudalics@gmx.at>
4070
4071 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
4072 current buffer (Bug#12387).
4073
2a7931e3
JB
40742012-09-14 Juanma Barranquero <lekktu@gmail.com>
4075
4076 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
4077
c18e885b
PE
40782012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4079
4080 Use a more backwards-compatible timer format (Bug#12430).
4081 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
4082 vector element, not from the 4th, since PSECS is now at the end.
4083 (Fcurrent_idle_time): Doc fix.
4084
d59a1afb
DA
40852012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
4086
4087 Function to mark objects and remove killed buffers at once.
4088 * alloc.c (discard_killed_buffers): Rename to ...
4089 (mark_discard_killed buffers) ... new name. Add marking
4090 of remaining objects. Fix comment. Adjust users.
4091 (mark_object): Do not touch frame buffer lists here.
4092 * frame.c (delete_frame): Reset frame buffer lists here.
4093
5f0cb45a
PE
40942012-09-13 Paul Eggert <eggert@cs.ucla.edu>
4095
8ea47e3a
PE
4096 Better workaround for GNOME bug when --enable-gcc-warnings.
4097 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
4098 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
4099 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
4100
4a4bbad2
PE
4101 Simplify SIGIO usage (Bug#12408).
4102 The code that dealt with SIGIO was crufty and confusing, e.g., it
4103 played tricks like "#undef SIGIO" but these tricks were not used
4104 consistently. Simplify mostly by not #undeffing standard symbols,
4105 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
4106 or not as we please) rather than "defined SIGIO" (standard symbol
4107 that we probably shouldn't #undef).
4108 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
4109 Modules that need it can include it.
4110 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
4111 * dispextern.h (ignore_sigio): New decl.
4112 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
4113 unconditionally, since it's now a no-op if !USABLE_SIGIO.
4114 * emacs.c (shut_down_emacs):
4115 * keyboard.c (kbd_buffer_store_event_hold):
4116 Use ignore_sigio rather than invoking 'signal' directly.
4117 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
4118 for FIONREAD.
4119 (FIONREAD, SIGIO): Do not #undef.
4120 (tty_read_avail_input): Use #error rather than a syntax error.
4121 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
4122 for I_PIPE, used by SETUP_SLAVE_PTY.
4123 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
4124 * sysdep.c (croak): Remove; no longer needed. This bit of
4125 temporary code, with Fred N. Fish's comment that it's temporary,
4126 has been in Emacs since at least 1992!
4127 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
4128 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
4129 * syssignal.h (croak): Remove decl.
4130 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
4131 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
4132 now that we're termios-only.
4133 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
4134 * term.c (dissociate_if_controlling_tty): Use #error rather than
4135 a run-time error.
4136
5f0cb45a
PE
4137 Work around GCC and GNOME bugs when --enable-gcc-warnings.
4138 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
4139 to work around GNOME bug 683906.
4140 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
4141 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
4142 This works around GCC bug 54561.
4143
40bce90b
PE
41442012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4145
4146 More fixes for 'volatile' and setjmp/longjmp.
4147 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
4148 * image.c (struct png_load_context) [HAVE_PNG]: New type.
4149 (png_load_body) [HAVE_PNG]:
4150 (jpeg_load_body) [HAVE_JPEG]:
4151 New function, with most of the old parent function's body.
4152 (png_load) [HAVE_PNG]:
4153 (jpeg_load) [HAVE_JPEG]:
4154 Invoke the new function, to avoid longjmp munging our locals.
4155 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
4156 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
4157 longjmp is passed 2, as the C standard doesn't guarantee this.
4158 Instead, store the failure code into mgr->failure_code.
4159
bfeae2cf
SM
41602012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4161
4162 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
4163 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
4164 (syms_of_keyboard): Remove support for unread-command-char.
4165
8099e36b
EZ
41662012-09-12 Eli Zaretskii <eliz@gnu.org>
4167
4168 * w32proc.c (sys_kill): If PID is our process ID and the signal is
4169 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
4170 violation. (Bug#12426)
4171
92547ff9
PE
41722012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4173
4174 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
4175
45b82ad0
SM
41762012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4177
4178 * eval.c: Add `inhibit-debugger'.
4179 (Qinhibit_debugger): New symbol.
4180 (call_debugger): Bind it instead of Qdebug_on_error.
4181 (maybe_call_debugger): Test Vinhibit_debugger.
4182 (syms_of_eval): Define inhibit-debugger.
4183 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
4184 (syms_of_xdisp): Remove inhibit-debug-on-message.
4185
5779a1dc
PE
41862012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4187
50f2e553
PE
4188 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
4189 If a nonvolatile local variable is written before a _longjmp to
4190 the frame containing the variable, and is read after the _longjmp,
4191 the value read is indeterminate. Some local variables of type
4192 'struct handler' and 'struct catchtag' are used in this way, so
4193 mark each of their slots as volatile if the slot can be set before
4194 _longjmp and read afterwards.
4195 * lisp.h (struct handler): var and chosen_clause are now volatile.
4196 (struct catchtag): val, next, and pdlcount are now volatile.
4197
ae1d87e2
PE
4198 * bidi.c (bidi_push_it, bidi_pop_it):
4199 * fns.c (copy_hash_table):
4200 * image.c (define_image_type):
4201 * keyboard.c (kbd_buffer_store_event_hold):
4202 * process.c (Fprocess_send_eof):
4203 * xfaces.c (x_create_gc) [HAVE_NS]:
4204 * xgselect.c (xg_select):
4205 Prefer assignment to memcpy when either will do.
4206
5779a1dc
PE
4207 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
4208 Use pointer-to-a-pointer to simplify and avoid a NILP check each
4209 time an item is removed. No need to mark this function 'inline';
4210 the compiler knows better than we do.
4211
c4c9756b
JD
42122012-09-11 Jan Djärv <jan.h.d@swipnet.se>
4213
4214 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
4215 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
4216 to change_frame_size (Bug#12388).
4217 (windowDidResize:): Pass YES to updateFrameSize.
4218
4219 * nsterm.h: Add delay parameter to updateFrameSize.
4220
d73e321c
DA
42212012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4222
4223 Discard killed buffers from deleted window and frame objects.
4224 This reduces an amount of references to killed buffers and
4225 helps GC to reclaim them faster.
4226 * alloc.c (discard_killed_buffers): New function.
4227 (mark_object): Use it for deleted windows and frames.
4228 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 4229 or deleted frame, restore its global binding.
d73e321c
DA
4230 * data.c (swap_in_global_binding): Add GC notice.
4231 (swap_in_symval_forwarding): Use convenient set_blv_where.
4232 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
4233 * window.h: ... to here.
4234
e578f381
DA
42352012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4236
4237 Convenient macro to check whether the buffer is live.
4238 * buffer.h (BUFFER_LIVE_P): New macro.
4239 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
4240 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
4241
3057e615
YM
42422012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4243
4244 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
4245 composition cases (Bug#12364).
4246
4247 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
4248 overhang of succeeding glyphs overlapping box cursor.
4249
4250 * w32term.c (x_draw_glyph_string): Likewise.
4251
6fda35f2
PE
42522012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4253
c990426a
PE
4254 Simplify, document, and port floating-point (Bug#12381).
4255 The porting part of this patch fixes bugs on non-IEEE platforms
4256 with frexp, ldexp, logb.
4257 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
4258 Now static.
4259 * floatfns.c: Simplify discussion of functions that Emacs doesn't
4260 support, by removing commented-out code and briefly listing the
4261 C89 functions excluded. The commented-out stuff was confusing
4262 maintenance, e.g., we thought we needed cbrt but it was commented out.
4263 (logb): Remove decl; no longer needed.
4264 (isfinite): New macro, if not already supplied.
4265 (isnan): Don't replace any existing macro.
4266 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
4267 are present on all C89 platforms.
4268 (Ffrexp): Do not special-case zero, as frexp does the right thing
4269 for that case.
4270 (Flogb): Do not use logb, as it doesn't have the desired meaning
4271 on hosts that use non-base-2 floating point. Instead, stick with
4272 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
4273 frexp, to avoid getting an unspecified result.
4274
6fda35f2
PE
4275 * xdisp.c (Qinhibit_debug_on_message): Now static.
4276
16130a58
JD
42772012-09-10 Jan Djärv <jan.h.d@swipnet.se>
4278
4279 * nsterm.m (ns_update_begin): Set clip path to whole view by using
4280 NSBezierPath (Bug#12131).
4281
d105a573
CY
42822012-09-10 Chong Yidong <cyd@gnu.org>
4283
4284 * fns.c (Fdelq, Fdelete): Doc fix.
4285
ff55dfe8
PE
42862012-09-10 Paul Eggert <eggert@cs.ucla.edu>
4287
4288 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
4289 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
4290
e7032e7c
SM
42912012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
4292
4293 * lisp.h (make_lisp_ptr): New macro to replace XSET.
4294 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
4295 Use it.
4296
e9957956
EZ
42972012-09-09 Eli Zaretskii <eliz@gnu.org>
4298
aba05ce9
EZ
4299 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
4300 left fringe if the window has a left margin. This avoids leaving
4301 traces of the cursor because its leftmost pixel is not drawn over.
4302
e9957956
EZ
4303 * dispnew.c (update_window_line): When the left margin area of a
4304 screen line is updated, set the redraw_fringe_bitmaps_p flag of
4305 that screen line. (Bug#12277)
4306
f6196b87
PE
43072012-09-09 Paul Eggert <eggert@cs.ucla.edu>
4308
4309 Assume C89 or later for math functions (Bug#12381).
4310 This simplifies the code, and makes it a bit smaller and faster,
4311 and (most important) makes it easier to clean up signal handling
4312 since we can stop worring about floating-point exceptions in
4313 library code. That was a problem before C89, but the problem
4314 went away many years ago on all practical Emacs targets.
4315 * data.c, image.c, lread.c, print.c:
4316 Don't include <math.h>; no longer needed.
4317 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
4318 might be autoconfigured, as that never happens.
4319 * data.c (fmod):
4320 * doprnt.c (DBL_MAX_10_EXP):
4321 * print.c (DBL_DIG):
4322 Remove. C89 or later always defines these.
4323 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
4324 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
4325 (arith_error, domain_error, domain_error2):
4326 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
4327 no longer needed -- we simply return what C returns. All uses removed.
4328 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
4329 the wrapped code.
4330 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
4331 Remove. All uses expanded, as these macros are no longer used
4332 more than once and are now more trouble than they're worth.
4333 (Ftan): Use tan, not sin / cos.
4334 (Flogb): Assume C89 frexp.
4335 (fmod_float): Assume C89 fmod.
4336 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
4337 (init_floatfns): Remove. All uses removed.
4338
9d7f1863
JD
43392012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4340
4341 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4342 compositeToPoint for OSX < 10.6 (Bug#12390).
4343
eabf0404
PE
43442012-09-08 Paul Eggert <eggert@cs.ucla.edu>
4345
4346 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4347 This produces more-accurate results.
4348
0b3b1d23
JD
43492012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4350
4351 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
4352 changes (Bug#12088).
4353
6dcef6ec
CY
43542012-09-08 Chong Yidong <cyd@gnu.org>
4355
4356 * syntax.c (Fstring_to_syntax): Doc fix.
4357
aa7d57c5
JD
43582012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4359
4360 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
4361 in the internal border.
4362 (x_set_window_size): Remove static variables and their usage.
4363 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
4364 (ns_after_update_window_line, ns_draw_fringe_bitmap):
4365 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
4366 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
4367 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
4368 (ns_fix_rect_ibw): Remove.
4369 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
4370 (ns_dumpglyphs_box_or_relief): Ditto.
4371 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
4372 adjustment.
4373 (ns_dumpglyphs_image): Ditto.
fc0c31f8 4374 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
4375 border adjustment.
4376 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
4377 their usage. Add fringe_extended_p and its use as in other terms.
4378 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
4379 scroll bar was removed.
4380 (updateFrameSize): New function.
4381 (windowDidResize): Move code to updateFrameSize and call it.
4382
4383 * nsterm.h (EmacsView): Add updateFrameSize.
4384
1a5432bc
CY
43852012-09-07 Chong Yidong <cyd@gnu.org>
4386
b4f5313e
CY
4387 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
4388
1a5432bc
CY
4389 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4390
1a4f1e9b
PE
43912012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4392
4393 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
4394 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
4395 Problem introduced when merging patches. Noted by Eli Zaretskii in
4396 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
4397 * floatfns.c: Comment fix.
4398 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
4399 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
4400 and anyway the declaration is harmless even if SIGDANGER is not defined.
4401 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
4402 defined BROKEN_FIONREAD). systty.h formerly did this, but other
4403 source files not surprisingly expected syssignal.h to define, or
4404 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4405 Include <sys/ioctl.h>, for FIONREAD.
4406 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4407 This eliminates a problem whereby other files mysteriously had
4408 to include "syssignal.h" before including "systty.h" if they
4409 wanted to use "#ifdef SIGIO".
4410
bc8000ff
EZ
44112012-09-07 Eli Zaretskii <eliz@gnu.org>
4412
3e6d6928
EZ
4413 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4414
4415 * w32.c (sigemptyset): Empty the set.
4416 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4417
bc8000ff
EZ
4418 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4419
b4fa72f2
DA
44202012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4421
4422 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4423 (mark_object): Likewise for frame objects.
4424
30730c93
PE
44252012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4426
4427 * syssignal.h (handle_on_main_thread): Always declare,
4428 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4429 This ports to platforms without HAVE_PTHREAD.
4430
2fe28299
PE
44312012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4432
4433 Signal-handler cleanup (Bug#12327).
4434 Emacs's signal handlers were written in the old 4.2BSD style with
4435 sigblock and sigmask and so forth, and this led to some
4436 inefficiencies and confusion. Rewrite these to use
4437 pthread_sigmask etc. without copying signal sets around. Also,
4438 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4439 'signal', and instead use functions that do not attempt to take
4440 over the system name space. This patch causes Emacs's text
4441 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4442 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4443 Do not include <signal.h> or "syssignal.h", as these
4444 modules do not use signals.
4445 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4446 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4447 Do not include <signal.h>, as "syssignal.h" does that for us now.
4448 * atimer.c (sigmask_atimers): New function.
4449 (block_atimers, unblock_atimers): New functions,
4450 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4451 All uses replaced.
4452 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4453 no longer needed here.
4454 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 4455 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
4456 * sysdep.c (struct save_signal): New member 'action', replacing
4457 old member 'handler'.
4458 (save_signal_handlers, restore_signal_handlers):
4459 Use sigaction instead of 'signal' to save and restore.
4460 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4461 New function. All users of 'signal' modified to use set_sighandler
4462 if they're writeonly, and to use sys_signal if they're read+write.
4463 (emacs_sigaction_init, forwarded_signal): New functions.
4464 (sys_signal): Remove. All uses replaced by calls to sigaction
4465 and emacs_sigaction_init, or by direct calls to 'signal'.
4466 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4467 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4468 all uses replaced by pthread_sigmask etc. calls.
4469 * syssignal.h: Include <signal.h>.
4470 (emacs_sigaction_init, forwarded_signal): New decls.
4471 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4472 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4473 (sigmask, sys_sigmask): Remove; no longer needed.
4474 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4475 (sigblock, sigunblock, sigfree):
4476 (sigsetmask) [!defined sigsetmask]:
4477 Remove. All uses replaced by pthread_sigmask.
4478 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4479 no longer need to be replaced, and its typical old uses
4480 are now done via emacs_sigaction_init and sigaction.
4481 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4482 (sys_sigdel): Remove; unused.
4483 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4484
0216c128
EZ
44852012-09-06 Eli Zaretskii <eliz@gnu.org>
4486
4487 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4488 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4489
c752cfa9
DA
44902012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4491
4492 Explicitly mark buffer_defaults and buffer_local_symbols.
4493 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4494 mark_local_symbols here.
4495 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4496 since special buffers aren't marked here any more.
4497 (allocate_buffer): Chain new buffer with all_buffers here...
4498 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4499 not here.
4500 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4501 (syms_of_buffer): Remove staticpro of the above.
4502 (init_buffer_once): Set names for buffer_defaults and
4503 buffer_local_symbols.
4504
a864ef14
PE
45052012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4506
4507 Use bool for booleans in font-related modules.
4508 * font.c (font_intern_prop, font_style_to_value)
4509 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4510 (generate_otf_features, font_check_otf_features, font_check_otf)
4511 (font_match_p, font_list_entities, font_at):
4512 * fontset.c (fontset_id_valid_p, reorder_font_vector
4513 (fontset_find_font, Fset_fontset_font)
4514 (face_suitable_for_char_p) [0]:
4515 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4516 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4517 (m17n_flt_initialized, ftfont_shape_by_flt):
4518 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4519 * nsfont.m (nsfont_draw):
4520 * w32font.c (w32font_draw):
4521 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4522 Use bool for booleans.
4523 * font.h: Adjust to above API changes.
4524 (struct font, struct font_driver, struct font_driver_list):
4525 Use bool for booleans.
4526 (struct font): Remove useless member encoding_type.
4527 All users removed.
4528 * fontset.c, xftfont.c: Omit unnecessary static decls.
4529
0699fc18
DA
45302012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4531
4532 * alloc.c (mark_object): Revert window marking code
4533 since it's unsafe for the Fset_window_configuration.
4534
20ef56db
PE
45352012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4536
2fe28299 4537 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
4538 Be more systematic about preserving errno whenever a signal
4539 handler returns, even if it's not in the main thread. Do this by
4540 renaming signal handlers to distinguish between signal delivery
4541 and signal handling. All uses changed.
4542 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4543 * data.c (deliver_arith_signal): Rename from arith_error.
4544 * dispnew.c (deliver_window_change_signal): Rename from
4545 window_change_signal.
4546 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4547 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4548 * keyboard.c (deliver_input_available_signal): Rename from
4549 input_available_signal.
4550 (deliver_user_signal): Rename from handle_user_signal.
4551 (deliver_interrupt_signal): Rename from interrupt_signal.
4552 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4553 (deliver_child_signal): Rename from sigchld_handler.
4554 * atimer.c (handle_alarm_signal):
4555 * data.c (handle_arith_signal):
4556 * dispnew.c (handle_window_change_signal):
4557 * emacs.c (handle_fatal_signal, handle_danger_signal):
4558 * keyboard.c (handle_input_available_signal):
4559 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4560 * process.c (handle_pipe_signal, handle_child_signal):
4561 New functions, with the actual signal-handling code taken from the
4562 original respective signal handlers, sans the sporadic attempts to
4563 preserve errno, since that's now done by handle_on_main_thread.
4564 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4565 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4566 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4567 Move to sysdep.c.
4568 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4569 Move initialization of main_thread to sysdep.c's init_signals.
4570 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4571 our usage, and simplifies the mainline code.
4572 (record_child_status_change): New static function, as a helper
4573 for handle_child_signal, and with most of the old child handler's
4574 contents.
4575 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4576 (handle_child_signal): Use the above.
4577 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4578 Moved here from emacs.c.
4579 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4580 code moved here from emacs.c's main function.
4581 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
4582 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4583 This lets callers save and restore errno properly.
20ef56db 4584
e3ccf108
DA
45852012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4586
4587 Remove redundant or unused things here and there.
4588 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4589 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4590 * editfns.c (Fcompare_buffer_substrings): Likewise.
4591 * frame.h (struct terminal, struct font_driver_list):
4592 Remove redundant declarations.
4593 * window.h (Qleft, Qright): Likewise.
4594
697e1e39
DA
45952012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4596
4597 Do not mark objects from deleted buffers, windows and frames.
4598 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4599 (mark_object): Likewise for windows and frames.
4600
c1ca42ca
DA
46012012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4602
4603 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4604 buffer_defaults and buffer_local_symbols as valid objects.
4605 Return special value to denote them.
4606
014d93be
PE
46072012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4608
f75d7a91
PE
4609 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4610 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4611 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4612 (file_name_absolute_p, Fsubstitute_in_file_name):
4613 (check_executable, check_writable, Ffile_accessible_directory_p)
4614 (Fset_file_selinux_context, Fdefault_file_modes)
4615 (Finsert_file_contents, choose_write_coding_system)
4616 (Fwrite_region, build_annotations, a_write, e_write)
4617 (Fdo_auto_save):
4618 * filelock.c (boot_time_initialized, get_boot_time)
4619 (get_boot_time_1, lock_file_1, within_one_second):
4620 * floatfns.c (in_float):
4621 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4622 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4623 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4624 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4625 * window.c (compare_window_configurations):
4626 Use bool for booleans.
4627 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4628 (Fdefault_file_modes): Now mode_t, not int, for modes.
4629 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4630 (internal_delete_file): Now returns void, not a (boolean) int,
4631 since nobody was looking at the return value.
4632 * lisp.h, window.h: Adjust to above API changes.
4633
014d93be
PE
4634 * xdisp.c (set_message): Simplify and reindent last change.
4635
776f29e1
JB
46362012-09-05 Juanma Barranquero <lekktu@gmail.com>
4637
4638 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4639
7f7e0167
LI
46402012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4641
4642 * eval.c (call_debugger): Make the function non-static so that we
4643 can call it from set_message.
4644
4645 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4646 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4647
cf29dd84
PE
46482012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4649
4650 Give more-useful info on a fatal error (Bug#12328).
4651 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4652 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4653 of doing the work ourselves.
4654 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4655 do most of the work.
4656 (fatal_error_backtrace): New function, taken from the guts
4657 of the old fatal_error_signal, but with a new option to output
4658 a backtrace.
4659 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4660 info about the signal than just its number.
4661 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4662 * sysdep.c: Include <execinfo.h>
4663 (emacs_backtrace): New function, taken partly from the previous
4664 code of the 'die' function.
4665 (emacs_abort): Call fatal_error_backtrace rather than abort.
4666
972debf2
SM
46672012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4668
4669 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4670 eager (load-time) macro-expansion.
4671 * lisp.mk (lisp): Add macroexp.
4672
1088b922
PE
46732012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 Simplify redefinition of 'abort' (Bug#12316).
4676 Do not try to redefine the 'abort' function. Instead, redo
4677 the code so that it calls 'emacs_abort' rather than 'abort'.
4678 This removes the need for the NO_ABORT configure-time macro
4679 and makes it easier to change the abort code to do a backtrace.
4680 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4681 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4682 Remove; sysdep.c's emacs_abort now takes its place.
4683 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4684 'abort' changed to use 'emacs_abort'.
4685 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4686 (abort) [!defined abort]: Rename to ...
4687 (emacs_abort): ... new name.
4688 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4689 the place of the old 'abort' in emacs.c.
4690 * w32.c, w32fns.c (abort): Do not #undef.
4691 * w32.c (emacs_abort): Rename from w32_abort.
4692
30934d33
EZ
46932012-09-04 Eli Zaretskii <eliz@gnu.org>
4694
4695 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4696 offsets[j].dv, since the y axis of the screen coordinates points
4697 down, while the y axis of the font definition coordinates points
4698 up. This fixes display of Arabic diacritics such as KASRA and
4699 KASRATAN. (Bug#11860)
4700
af26b72c
PE
47012012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4702
4703 Be more systematic about _setjmp vs setjmp.
4704 * alloc.c (test_setjmp, mark_stack):
4705 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4706 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4707 (png_load, my_error_exit, jpeg_load):
4708 * process.c (send_process_trap, send_process):
4709 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4710 The underscored versions are up to 30x faster on some hosts.
4711 Formerly, the code used setjmp+longjmp sometimes and
4712 _setjmp+_longjmp at other times, with no particular reason to
4713 prefer setjmp+longjmp.
4714
26d4541d
PE
47152012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4716
d42f4f0f 4717 Fix minor problem found by static checking.
26d4541d 4718 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 4719
c5e28e39
MR
47202012-09-03 Martin Rudalics <rudalics@gmx.at>
4721
4722 * buffer.c (Fdelete_all_overlays): New function.
4723
3eab3ca9
CY
47242012-09-03 Chong Yidong <cyd@gnu.org>
4725
4726 * gtkutil.c: Add extern decl for Qxft.
4727
c04889f8
PE
47282012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4729
1882aa38
PE
4730 * emacs.c, eval.c: Use bool for boolean.
4731 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4732 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4733 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4734 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4735 (main, decode_env_path, Fdaemon_initialized):
4736 * eval.c (call_debugger, Finteractive_p, interactive_p):
4737 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4738 (maybe_call_debugger, Fbacktrace):
4739 * process.c (read_process_output, exec_sentinel):
4740 Use bool for booleans.
4741 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4742 All callers changed.
4743 * eval.c (interactive_p): Omit always-true boolean argument
4744 EXCLUDE_SUBRS_P. All callers changed.
4745 * dispextern.h, lisp.h: Reflect above API changes.
4746 * firstfile.c (dummy): Use the address of 'main', whose signature
4747 won't change, instead of the address of 'initialize', whose
4748 signature just changed from int to bool.
4749 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4750 * msdos.c (fatal_error_in_progress): ... from here.
4751 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4752 of incrementing it.
4753 (redisplay_internal, unwind_redisplay): Simply clear
4754 REDISPLAYING_P when unwinding, instead of saving its previous,
4755 always-false value and then restoring it.
4756
a411ac43
PE
4757 Clean up some extern decls.
4758 Mostly, this hoists extern decls out of .c files and into .h files.
4759 That way, we're more likely to catch errors if the interfaces change.
4760 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4761 declare xg_mark_data.
4762 * dispextern.h (x_frame_parm_handlers):
4763 * font.h (Qxft):
4764 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4765 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4766 (Qultra_bold, Qoblique, Qitalic):
4767 Move extern decl here from .c file.
4768 * alloc.c (xg_mark_data) [USE_GTK]:
4769 * doc.c (Qclosure):
4770 * eval.c (Qlexical_binding):
4771 * fns.c (time) [!HAVE_UNISTD_H]:
4772 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4773 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4774 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4775 * lread.c (Qinternal_interpreter_environment):
4776 * minibuf.c (Qbuffer):
4777 * process.c (QCfamily, QCfilter):
4778 * widget.c (free_frame_faces):
4779 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4780 * xfont.c (x_clear_errors):
4781 * xterm.c (x_frame_parm_handlers):
4782 Remove now-redundant extern decls.
4783 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4784 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4785 Now static.
4786 * xfaces.c: Remove unnecessary static decls.
4787 * xterm.c (updating_frame): Remove decl of nonexistent object.
4788
c04889f8
PE
4789 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4790 when building globals.h, as the objects that are not built on
4791 this host are not needed to compile C files on this host.
4792
8b339673
JD
47932012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4794
4795 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4796
4797 * frame.h: Add missing prototype for x_wm_set_size_hint.
4798
a08d4ba7
PE
47992012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4800
4801 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4802 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4803 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4804 (Fsubstitute_command_keys):
4805 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4806 (save_excursion_save, save_excursion_restore)
4807 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4808 (format_time_string, general_insert_function)
4809 (make_buffer_string, make_buffer_string_both)
4810 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4811 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4812 (copy_text, insert_1, insert_1_both, insert_from_string)
4813 (insert_from_string_before_markers, insert_from_string_1)
4814 (insert_from_buffer, insert_from_buffer_1, replace_range)
4815 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4816 (del_range_2, modify_region):
4817 * intervals.c (intervals_equal, balance_possible_root_interval)
4818 (adjust_intervals_for_insertion, merge_properties_sticky)
4819 (graft_intervals_into_buffer, lookup_char_property)
4820 (adjust_for_invis_intang, set_point_both)
4821 (get_property_and_range, compare_string_intervals)
4822 (set_intervals_multibyte_1, set_intervals_multibyte):
4823 * keyboard.c (decode_timer):
4824 Use bool for boolean.
4825 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4826 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4827
48c948de
CY
48282012-09-02 Chong Yidong <cyd@gnu.org>
4829
4830 * keymap.c (push_key_description): Print M-TAB as C-M-i
4831 (Bug#11758).
4832
6c49a40b
JB
48332012-09-02 Juanma Barranquero <lekktu@gmail.com>
4834
4835 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4836 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4837 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4838 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4839 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4840 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4841 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4842
4dfbd238
EZ
48432012-09-01 Eli Zaretskii <eliz@gnu.org>
4844
7e510e28
EZ
4845 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4846 more than one grapheme cluster passed to the shaper: compute the
4847 offset adjustment values separately for each cluster. (Bug#11860)
4848
4dfbd238
EZ
4849 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4850 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4851 about implicit conversions from integer to pointer.
4852
86571ae0
DC
48532012-09-01 Daniel Colascione <dancol@dancol.org>
4854
4855 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4856 system used too early.
4857
0e23ef9d
PE
48582012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4859
4860 Better seed support for (random).
4861 * emacs.c (main): Call init_random.
4862 * fns.c (Frandom): Set the seed from a string argument, if given.
4863 Remove long-obsolete Gentzel cruft.
4864 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4865 (init_random): New function.
4866
17a2cbbd
DC
48672012-09-01 Daniel Colascione <dancol@dancol.org>
4868
4869 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4870 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4871 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4872 x_wm_set_size_hint, x_query_colors, x_real_positions,
4873 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4874 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4875 all of which have been moved to common code.
4876
4877 * xfaces.c: Include TERM_HEADER instead of listing all possible
4878 window-system headers.
4879
4880 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4881 to match header.
4882
4883 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4884 directly accessing frame internals.
4885
f18cbb28 4886 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
4887 globals_of_w32font.
4888
4889 * process.c: Include TERM_HEADER instead of listing all possible
4890 window-system headers.
4891
3a880af4
SM
4892 * nsterm.h: Remove declarations now in frame.h.
4893 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
4894
4895 * menu.c: Include TERM_HEADER instead of listing all possible
4896 window-system headers.
4897
4898 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4899 window system.
4900
4901 * keyboard.c: Include TERM_HEADER instead of listing all possible
4902 window-system headers.
4903
4904 * image.c: Include TERM_HEADER instead of listing all possible
4905 window-system headers. Declare Vlibrary_cache when compiling for
4906 Windows.
4907
4908 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4909 window system declarations.
4910
4911 * frame.h: Move common functions here: set_frame_menubar,
4912 x_set_window_size, x_sync, x_get_focus_frame,
4913 x_set_mouse_position, x_set_mouse_pixel_position,
4914 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4915 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4916 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4917 x_activate_menubar, x_real_positions, x_bitmap_icon,
4918 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4919 and x_query_colors.
4920
4921 * frame.c: Include TERM_HEADER instead of listing all possible
4922 window-system headers.
4923
4924 * font.c: Include TERM_HEADER instead of listing all possible
4925 window-system headers.
4926
4927 * emacs.c: Include TERM_HEADER.
4928
f18cbb28
EZ
4929 * dispnew.c: Include TERM_HEADER instead of listing all possible
4930 window-system headers.
17a2cbbd 4931
f18cbb28 4932 * ccl.h: Include character.h.
17a2cbbd
DC
4933
4934 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4935 the current window system; include in list of objects to link into
4936 Emacs.
4937
c650a5de
DA
49382012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4939
4940 Remove mark_ttys function and fix tty_display_info initialization.
4941 * lisp.h (mark_ttys): Remove prototype.
4942 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4943 to mark_ttys because all possible values of 'top_frame' slot are
4944 the frames which are reachable from Vframe_list.
4945 * term.c (mark_ttys): Remove.
4946 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4947
4e0f6479
DA
49482012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4949
4950 Change struct frame bitfields from unsigned char to unsigned.
4951 * frame.h (struct frame): Change type of 'display_preempted',
4952 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4953 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4954 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4955 bitfields from unsigned char to unsigned.
4956
8b96a52c
DA
49572012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4958
4959 Remove unused member of struct x_output and struct w32_output.
4960 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4961 * w32term.h (struct w32_output): Likewise.
4962
b4444c8a
JD
49632012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4964
4965 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4966 does not become zero (Bug#12234).
4967
b98521db
PE
49682012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4969
4970 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4971 for GCC 4.7.1 x86-64.
4972
31d02438
GM
49732012-08-30 Glenn Morris <rgm@gnu.org>
4974
4975 * lread.c (init_lread): For out-of-tree builds, only add the
4976 source directory's site-lisp dir to the load-path if it exists,
4977 consistent with in-tree builds. (Bug#12302)
4978
7f8941d8
JD
49792012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4980
4981 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 4982 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
4983 (windowShouldClose:): Set window_closed.
4984 (dealloc): New member, free button_values.
fc0c31f8
JB
4985 (process_dialog:): Make member function. Remove window argument,
4986 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
4987 in button_values.
4988 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 4989 with tag. Remove return self, declare return value as void.
7f8941d8
JD
4990 (addString:row:): Remove return self, declare return value as void.
4991 (addSplit): Remove return self, declare return value as void.
4992 (clicked:): Remove return self, declare return value as void.
fc0c31f8 4993 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
4994 (initFromContents:isQuestion:): Adjust call to process_dialog.
4995 Code formatting change.
4996 (timeout_handler:): Set timer_fired to YES.
4997 (runDialogAt:): Set timer_fired to NO.
4998 Handle click on close button as quit.
4999
5000 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
5001 Add window_closed and button_values. Add void as return value for
5002 add(Button|String|Split). addButton takes int instead of Lisp_Object.
5003 Add process_dialog as new member.
5004
eada0861 50052012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 5006
eada0861
GM
5007 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
5008 is not one of the heaps we manage. (Bug#12242)
5009
50102012-08-28 Glenn Morris <rgm@gnu.org>
5011
5012 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
5013
457294dd
MR
50142012-08-28 Martin Rudalics <rudalics@gmx.at>
5015
5016 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
5017 auto-buffer-name window parameter. Install revision of reverted
5018 fix.
457294dd 5019
4f2daf31
DA
50202012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5021
5022 Do not allow to set major mode for a dead buffer.
5023 * buffer.c (Fset_buffer_major_mode): Signal an error
5024 if the buffer is dead.
5025 (Fother_buffer, other_buffer_safely): Remove redundant
5026 nested declaration.
5027
66322887
DA
50282012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5029
5030 Always use set_buffer_if_live to restore original buffer at unwind.
5031 * buffer.h (record_unwind_current_buffer): New function.
5032 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
5033 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
5034 * undo.c, window.c: Adjust users.
5035 * buffer.c (set_buffer_if_live): Fix comment.
5036
a3d794a1
DA
50372012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
5038
5039 Fix usage of set_buffer_internal.
5040 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
5041 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
5042 * coding.c (decode_coding): Omit redundant test.
5043 * fileio.c (decide_coding_unwind): Likewise.
5044 * fns.c (secure_hash): Likewise.
5045 * insdel.c (modify_region): Likewise.
5046 * keyboard.c (command_loop_1): Likewise.
5047 * print.c (PRINTFINISH): Likewise.
5048 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
5049
59ea14cd
PE
50502012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5051
5052 * dispnew.c: Use bool for boolean.
5053 (frame_garbaged, display_completed, delayed_size_change)
5054 (fonts_changed_p, add_window_display_history)
5055 (add_frame_display_history, verify_row_hash)
5056 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
5057 (row_equal_p, realloc_glyph_pool)
5058 (allocate_matrices_for_frame_redisplay)
5059 (showing_window_margins_p)
5060 (adjust_frame_glyphs_for_frame_redisplay)
5061 (build_frame_matrix_from_leaf_window, make_current)
5062 (mirrored_line_dance, mirror_line_dance, update_frame)
5063 (update_window_tree, update_single_window)
5064 (check_current_matrix_flags, update_window, update_text_area)
5065 (update_window_line, set_window_update_flags, scrolling_window)
5066 (update_frame_1, scrolling, buffer_posn_from_coords)
5067 (do_pending_window_change, change_frame_size)
5068 (change_frame_size_1, sit_for):
5069 Use bool for boolean.
5070 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
5071 and remove last int (actually boolean) argument, which was always 0.
5072 All callers changed.
5073 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
5074 * dispextern.h (struct composition_it): Use bool for boolean.
5075 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
5076 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
5077 * dired.c (file_name_completion):
5078 Use bool for boolean. (This was missed in an earlier change.)
5079
95072a94
MR
50802012-08-27 Martin Rudalics <rudalics@gmx.at>
5081
5082 * window.c (Fset_window_configuration): Revert first part of
5083 last change.
5084
0f19feff
JD
50852012-08-27 Jan Djärv <jan.h.d@swipnet.se>
5086
5087 * nsterm.h (NSPanel): New class variable dialog_return.
5088
3a880af4
SM
5089 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
5090 Initialize dialog_return.
0f19feff
JD
5091 (windowShouldClose:): Use stop instead of stopModalWithCode.
5092 (clicked:): Ditto, and also set dialog_return (Bug#12258).
5093 (timeout_handler:): Use stop instead of abortModal. Send a dummy
5094 event.
5095 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
5096 modal loop returns.
5097
f10fe38f
PE
50982012-08-27 Paul Eggert <eggert@cs.ucla.edu>
5099
de1339b0
PE
5100 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
5101 * composite.c (find_composition, composition_gstring_p)
5102 (composition_reseat_it, find_automatic_composition):
5103 * data.c (let_shadows_buffer_binding_p)
5104 (let_shadows_global_binding_p, set_internal, make_blv)
5105 (Fmake_variable_buffer_local, Fmake_local_variable)
5106 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
5107 (cons_to_signed, arith_driver):
5108 * dbusbind.c (xd_in_read_queued_messages):
5109 * dired.c (directory_files_internal, file_name_completion):
5110 Use bool for booleans.
5111 * dired.c (file_name_completion):
5112 * process.h (fd_callback):
5113 Omit int (actually boolean) argument. It wasn't being used.
5114 All uses changed.
5115 * composite.h, lisp.h: Reflect above API changes.
5116
f10fe38f
PE
5117 * cmds.c, coding.c: Use bool for booleans.
5118 * cmds.c (move_point, Fself_insert_command):
5119 * coding.h (struct composition status, struct coding_system):
5120 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
5121 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
5122 (emacs_mule_char, decode_coding_emacs_mule)
5123 (encode_coding_emacs_mule, detect_coding_iso_2022)
5124 (decode_coding_iso_2022, encode_invocation_designation)
5125 (encode_designation_at_bol, encode_coding_iso_2022)
5126 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
5127 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
5128 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
5129 (encode_coding_raw_text, detect_coding_charset)
5130 (decode_coding_charset, encode_coding_charset, detect_eol)
5131 (detect_coding, get_translation_table, produce_chars)
5132 (consume_chars, reused_workbuf_in_use)
5133 (make_conversion_work_buffer, code_conversion_save)
5134 (decode_coding_object, encode_coding_object)
5135 (detect_coding_system, char_encodable_p)
5136 (Funencodable_char_position, code_convert_region)
5137 (code_convert_string, code_convert_string_norecord)
5138 (Fset_coding_system_priority):
5139 * fileio.c (Finsert_file_contents):
5140 Use bool for booleans.
5141 * coding.h, lisp.h: Reflect above API changes.
5142 * coding.c: Remove unnecessary static function decls.
5143 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
5144 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
5145 not a boolean 'int', since callers never look at the return value.
5146 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
5147 * coding.h (decoding_buffer_size, encoding_buffer_size)
5148 (emacs_mule_string_char): Remove unused extern decls.
5149 (struct iso_2022_spec, struct coding_system):
5150 Use 'unsigned int : 1' for boolean fields, since there's more than one.
5151 (struct emacs_mule_spec): Remove unused field 'full_support'.
5152 All initializations removed.
5153 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
5154
5474c384
DA
51552012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5156
f10fe38f 5157 Fix spare memory change (Bug#12286).
5474c384
DA
5158 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
5159 (valid_lisp_object_p): Likewise.
5160
c4b6914d
MR
51612012-08-27 Martin Rudalics <rudalics@gmx.at>
5162
5163 * window.c (Fset_window_configuration): Record any window's old
5164 buffer if it's replaced (see Bug#8789). If the new current
5165 buffer doesn't appear in the selected window, go to its old
5166 point (Bug#12208).
5167
35aaa1ea
DA
51682012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5169
5170 Special MEM_TYPE_SPARE to denote reserved memory.
5171 * alloc.c (enum mem_type): New memory type.
5172 (refill_memory_reserve): Use new type for spare memory.
5173 This prevents live_cons_p and live_string_p from incorrect
5174 detection of uninitialized objects from spare memory as live.
5175
6af64513
PE
51762012-08-26 Paul Eggert <eggert@cs.ucla.edu>
5177
8b2e00a3
PE
5178 Spelling fixes.
5179 * Makefile.in (.PHONY): versioclean -> versionclean.
5180
b52d6985
PE
5181 Remove unused external symbols.
5182 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
5183 * window.c (Qwindow_valid_p, decode_valid_window):
5184 Now static, not extern.
5185 * data.c (Qinterval): Remove; unused.
5186 (syms_of_data): Do not define 'interval'.
5187 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
5188 * window.h (decode_valid_window):
5189 Remove decls.
5190
d5172d4f
PE
5191 * character.c, charset.c, chartab.c: Use bool for booleans.
5192 * character.c (lisp_string_width, string_count_byte8)
5193 (string_escape_byte8):
5194 * charset.c (charset_map_loaded, load_charset_map, read_hex):
5195 (load_charset_map_from_file, map_charset_chars)
5196 (Fdefine_charset_internal, define_charset_internal)
5197 (Fdeclare_equiv_charset, find_charsets_in_text)
5198 (Ffind_charset_region, char_charset, Fiso_charset):
5199 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
5200 (sub_char_table_set, sub_char_table_set_range)
5201 (char_table_set_range, optimize_sub_char_table)
5202 (map_sub_char_table):
5203 Use bool for boolean.
5204 * character.c (str_to_unibyte): Omit last boolean argument; it was
5205 always 0. All callers changed.
5206 * character.h, charset.h: Adjust to match previous changes.
5207 * character.h (char_printable_p): Remove decl of nonexistent function.
5208 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
5209 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
5210 are all boolean, so make them single-bit bitfields.
5211
6af64513
PE
5212 * lisp.h (ASET): Remove attempt to detect side effects.
5213 It was meant to be temporary and it often doesn't work,
5214 because when IDX has side effects the behavior of IDX==IDX
5215 is undefined. See Stefan Monnier in
5216 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
5217
e1f29348
BR
52182012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5219
5220 * lisp.h (functionp): New function (extracted from Ffunctionp).
5221 (FUNCTIONP): Use it.
5222 * eval.c (Ffunctionp): Use it.
5223
17c05d74
PE
52242012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5225
0f46bc75
PE
5226 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
5227 as that's faster and simpler than static storage. Don't bother
5228 with the g_main_context_query overhead if g_main_context_pending
5229 says no events are pending.
5230 (gfds, gfds_size): Remove these static vars.
5231 (xgselect_initialize): Remove; no longer needed.
5232 All uses and decls removed.
5233
ee4c0f69
PE
5234 * emacs.c (fatal_error_signal_hook): Remove.
5235 All uses removed. This leftover from old code was always 0.
5236
17c05d74
PE
5237 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
5238 * casefiddle.c (casify_object, casify_region):
5239 * casetab.c (set_case_table):
5240 * category.c, category.h (word_boundary_p):
5241 * category.h (CHAR_HAS_CATEGORY):
5242 Use bool for booleans, instead of int.
5243
391ceac5
EZ
52442012-08-25 Eli Zaretskii <eliz@gnu.org>
5245
5246 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
5247
2f221583
PE
52482012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5249
f4a681b0
PE
5250 On assertion failure, print backtrace if available.
5251 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
5252 (die) [ENABLE_CHECKING]: Print a backtrace if available.
5253 * Makefile.in (LIB_EXECINFO): New macro.
5254 (LIBES): Use it.
5255
2f221583
PE
5256 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
5257 * bytecode.c (exec_byte_code):
5258 * callint.c (check_mark, Fcall_interactively):
5259 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
5260 (getenv_internal, sync_process_alive, call_process_exited):
5261 * lisp.h (USE_SAFE_ALLOCA):
5262 Use bool for booleans, instead of int.
5263 * lisp.h, process.h: Adjust prototypes to match above changes.
5264 * callint.c (Fcall_interactively): Don't assume the mark's
5265 offset fits in 'int'.
5266
37ef52bb
PE
52672012-08-24 Paul Eggert <eggert@cs.ucla.edu>
5268
5269 * buffer.c, buffer.h: Use bool for boolean.
5270 * buffer.c (reset_buffer_local_variables)
5271 (buffer_lisp_local_variables, Fset_buffer_modified_p)
5272 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
5273 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
5274 (overlay_touches_p, overlay_strings, Foverlay_put)
5275 (report_overlay_modification, call_overlay_mod_hooks):
5276 (mmap_enlarge, mmap_set_vars):
5277 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
5278 Use bool for booleans, instead of int.
5279 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
5280 since the 1-or-0 return value is always ignored anyway.
5281 (mmap_initialized_p):
5282 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
5283 * buffer.h, lisp.h: Adjust prototypes to match above changes.
5284
2cc21167
PE
52852012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5286
5287 * bidi.c: Use bool for boolean.
5288 This is a bit more readable, and makes the text segment of bidi.o
5289 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
5290 Presumably it's faster too.
5291 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
5292 Now bool.
5293 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5294 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
5295 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
5296 (bidi_explicit_dir_char, bidi_level_of_next_char)
5297 (bidi_find_other_level_edge, bidi_move_to_visually_next):
5298 Use bool for booleans, instead of int.
5299 * dispextern.h (bidi_init_it, bidi_paragraph_init)
5300 (bidi_unshelve_cache): Adjust decls to match code.
5301
7db4ddf4
MR
53022012-08-23 Martin Rudalics <rudalics@gmx.at>
5303
5304 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
5305 argument.
5306
b1bb8011
PE
53072012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5308
5309 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
5310 * atimer.h: Include <stdbool.h>.
5311
ff687885
DN
53122012-08-22 Dan Nicolaescu <dann@gnu.org>
5313
5314 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
5315 compile time tests instead of run time tests on systems that do
5316 not use them.
5317 (FRAME_MAC_P): Remove leftover from deleted code.
5318 * frame.c (syms_of_frame): Remove leftover from deleted code.
5319
4ce7a138
JD
53202012-08-22 Jan Djärv <jan.h.d@swipnet.se>
5321
5322 * nsterm.m (insertText:): Don't clear modifiers if code is space.
5323
d733ec6d
PE
53242012-08-22 Paul Eggert <eggert@cs.ucla.edu>
5325
5326 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
5327 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 5328 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
5329 (fontset_add): Return void, for FONTSET_ADD.
5330
d0d2d26f
PE
53312012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5332
fce31d69
PE
5333 * alloc.c: Use bool for booleans.
5334 (gc_in_progress, abort_on_gc)
5335 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5336 (dont_register_blocks) [GC_MALLOC_CHECK]:
5337 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
5338 (check_string_bytes, make_specified_string, memory_full)
5339 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
5340 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
5341 (mark_stack, valid_pointer_p, make_pure_string)
5342 (Fgarbage_collect, survives_gc_p, gc_sweep):
5343 Use bool for booleans, instead of int.
5344 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5345 Remove unused local.
5346 * alloc.c (PURE_POINTER_P):
5347 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
5348 * editfns.c (Fformat):
5349 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
5350 (Fdo_auto_save):
5351 * fns.c (sweep_weak_table):
5352 * lisp.h (suppress_checking, push_message, survives_gc_p)
5353 (make_pure_string, gc_in_progress, abort_on_gc):
5354 * lread.c (readchar, read1):
5355 * print.c (Fprin1_to_string):
5356 * xdisp.c (push_message):
5357 Use bool for booleans affected directly or indirectly by
5358 alloc.c's changes.
5359
d0d2d26f
PE
5360 Make recently-introduced setters macros.
5361 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5362 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
5363 (set_fontset_default, set_fontset_fallback): Rename from their
5364 upper-case counterparts, and make them functions rather than macros.
5365 This is more consistent with the other recently-introduced setters.
5366 These don't need to be inline, since they're local.
5367
d18e2bb6
JD
53682012-08-21 Jan Djärv <jan.h.d@swipnet.se>
5369
5370 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
5371 the loop (Bug#12247).
5372
1b9d9d16
PE
53732012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5374
5375 * lisp.h (vcopy): Use memcpy rather than our own loop.
5376 This fixes a performance regression introduced by the recent
5377 addition of vcopy. This means 'vcopy' will need to be modified
5378 for a copying collector, but that's OK. Also, tighten the
5379 checking in the assertion.
5380
b2f09701
EZ
53812012-08-21 Eli Zaretskii <eliz@gnu.org>
5382
5383 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
5384 components for RTL text (Bug#11860). Adjust X-OFFSET of each
5385 non-base glyph for the width of the base character, according to
e1f29348
BR
5386 what x_draw_composite_glyph_string_foreground expects.
5387 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
5388 expectations, to produce correct width of the composed character.
5389 Reverse the sign of the DU offset produced by ScriptPlace.
5390
9b994fed
PE
53912012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5392
5393 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
5394
086ca913
DA
53952012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5396
5397 Avoid direct writes to contents member of struct Lisp_Vector.
5398 * lisp.h (vcopy): New function to copy data into vector.
5399 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
5400 * fns.c (Ffillarray): Use ASET.
5401 * keyboard.c (timer_check_2): Use AREF and ASET.
5402 (append_tool_bar_item, Frecent_keys): Use vcopy.
5403 * lread.c (read_vector): Use ASET.
5404 * msdos.c (Frecent_doskeys): Use vcopy.
5405 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5406 (Finternal_merge_in_global_face): Use ASET and vcopy.
5407 * xfont.c (xfont_list_pattern): Likewise.
5408
5481664a
MR
54092012-08-21 Martin Rudalics <rudalics@gmx.at>
5410
5411 * window.c (Fwindow_point): For the selected window always return
5412 the position of its buffer's point.
5413 (Fset_window_point): For the selected window always go in its
5414 buffer to the specified position.
5415
6d470bdd
DA
54162012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5417
5418 Setter macros for fontsets.
5419 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5420 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5421 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5422 Adjust users.
5423
24564fe1
GM
54242012-08-20 Glenn Morris <rgm@gnu.org>
5425
5426 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5427 Don't assume that `ln -f' works.
5428
0a05a035
EZ
54292012-08-20 Eli Zaretskii <eliz@gnu.org>
5430
5431 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5432 and later about non-assignments with no effect. See discussion at
5433 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5434 details.
5435
e46f2325
DA
54362012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5437
5438 Inline setter functions for Lisp_Objects slots of struct specbinding.
5439 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5440 Adjust users.
5441
734fbd86
MR
54422012-08-20 Martin Rudalics <rudalics@gmx.at>
5443
5444 * window.c (select_window): Always make selected window's buffer
5445 current.
5446
f1a95992
DA
54472012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5448
5449 Use AREF and ASET for docstrings of category tables.
5450 * category.h (CATEGORY_DOCSTRING): Use AREF.
5451 (SET_CATEGORY_DOCSTRING): Use ASET.
5452 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5453
e83064be
DA
54542012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5455
5456 Inline setter functions for hash table members.
5457 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5458 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5459 (set_hash_key_and_value, set_hash_index, set_hash_next)
5460 (set_hash_hash): New functions.
5461 * charset.c, fns.c: Adjust users.
5462
4ce60d2e
DA
54632012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5464
5465 Inline getter and setter functions for per-buffer values.
5466 * buffer.h (per_buffer_default, set_per_buffer_default)
5467 (per_buffer_value, set_per_buffer_value): New functions.
5468 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5469 * buffer.c, data.c: Adjust users.
5470
c06c9690
JB
54712012-08-20 Juanma Barranquero <lekktu@gmail.com>
5472
5473 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5474
32bd4250
PE
54752012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5476
bad03192 5477 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
5478 as gnulib does this if the system doesn't.
5479 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
5480 Remove declaration. MS-Windows declares it on stdlib.h which is
5481 included by conf_post.h.
b69a6d22
PE
5482 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5483 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5484 * vm-limit.c: Include <unistd.h>, for 'environ'.
5485
22d7feb2
PE
5486 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5487 (start_of_data): Remove decl; mem-limits.h provides it.
5488
32bd4250
PE
5489 * xdisp.c (handle_invisible_prop): Make it a bit faster
5490 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5491
450809af
CY
54922012-08-19 Chong Yidong <cyd@gnu.org>
5493
5494 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5495 ends (Bug#3874).
5496
9e677988
AS
54972012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5498
6b1319ce
AS
5499 * .gdbinit: Use call instead of set when calling a function in the
5500 inferior.
5501
9e677988
AS
5502 * data.c (set_internal): Don't use set_blv_found.
5503 (Fkill_local_variable): Likewise.
5504
d7191076
AA
55052012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5506
5507 * nsfont.m (ns_ascii_average_width): Ensure the string
5508 ascii_printable is initialized with a null-terminated character
5509 array. Otherwise, it can contain undesired extra characters.
5510
e757f1c6
PE
55112012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5512
5513 port new setting code to Sun C 5.8 2005/10/13
5514 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5515 Return void, not Lisp_Object. Otherwise, the compiler
5516 complains about (A?B:C) where B is void and C is Lisp_Object
5517 when compiling CHAR_TABLE_SET, due to the recent change to
5518 the API of sub_char_table_set_contents.
5519
a999ce26
CY
55202012-08-18 Chong Yidong <cyd@gnu.org>
5521
5522 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5523 for the string case (Bug#3874).
5524
3f22b86f
PE
55252012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5526
39eb03f1
PE
5527 * buffer.h (BSET): Remove (Bug#12215).
5528 Replace all uses with calls to new setter functions.
5529 (bset_bidi_paragraph_direction, bset_case_canon_table)
5530 (bset_case_eqv_table, bset_directory, bset_display_count)
5531 (bset_display_time, bset_downcase_table)
5532 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5533 (bset_last_selected_window, bset_local_var_alist)
5534 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5535 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5536 (bset_width_table):
5537 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5538 (bset_auto_fill_function, bset_auto_save_file_format)
5539 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5540 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5541 (bset_cache_long_line_scans, bset_case_fold_search)
5542 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5543 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5544 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5545 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5546 (bset_header_line_format, bset_indicate_buffer_boundaries)
5547 (bset_indicate_empty_lines, bset_invisibility_spec)
5548 (bset_left_fringe_width, bset_major_mode, bset_mark)
5549 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5550 (bset_name, bset_overwrite_mode, bset_pt_marker)
5551 (bset_right_fringe_width, bset_save_length)
5552 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5553 (bset_scroll_up_aggressively, bset_selective_display)
5554 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5555 (bset_word_wrap, bset_zv_marker):
5556 * category.c (bset_category_table):
5557 * syntax.c (bset_syntax_table):
5558 New setter functions.
5559
6a09a33b
PE
5560 * process.h (PSET): Remove (Bug#12215).
5561 Replace all uses with calls to new setter functions.
5562 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5563 (PROCESS_INLINE): New macro.
5564 (pset_childp): New setter function.
5565 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5566 * process.c (PROCESS_INLINE):
5567 Define to EXTERN_INLINE, so that the corresponding functions
5568 are compiled into code.
5569 (pset_buffer, pset_command, pset_decode_coding_system)
5570 (pset_decoding_buf, pset_encode_coding_system)
5571 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5572 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5573 (pset_type, pset_write_queue): New setter functions.
5574
e8c17b81
PE
5575 * window.h (WSET): Remove (Bug#12215).
5576 Replace all uses with calls to new setter functions.
5577 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5578 (WINDOW_INLINE): New macro.
5579 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5580 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5581 (wset_total_lines, wset_vertical_scroll_bar)
5582 (wset_window_end_pos, wset_window_end_valid)
5583 (wset_window_end_vpos): New setter functions.
5584 * window.c (WINDOW_INLINE):
5585 Define to EXTERN_INLINE, so that the corresponding functions
5586 are compiled into code.
5587 (wset_combination_limit, wset_dedicated, wset_display_table)
5588 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5589 (wset_new_normal, wset_new_total, wset_next_buffers)
5590 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5591 (wset_prev_buffers, wset_right_fringe_width)
5592 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5593 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5594 (wset_window_parameters):
5595 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5596 (wset_column_number_displayed, wset_region_showing):
5597 New setter functions.
5598
3f22b86f
PE
5599 * termhooks.h (TSET): Remove (Bug#12215).
5600 Replace all uses with calls to new setter functions.
5601 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5602 (TERMHOOKS_INLINE): New macro.
5603 (tset_charset_list, tset_selection_alist): New setter functions.
5604 * terminal.c (TERMHOOKS_INLINE):
5605 Define to EXTERN_INLINE, so that the corresponding functions
5606 are compiled into code.
5607 (tset_param_alist): New setter function.
5608
742af32f
PE
56092012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5610
15dbb4d6
PE
5611 * keyboard.h (KSET): Remove (Bug#12215).
5612 Replace all uses with calls to new setter functions.
5613 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5614 (KEYBOARD_INLINE): New macro.
5615 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5616 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5617 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5618 New setter functions.
5619 * keyboard.c (KEYBOARD_INLINE):
5620 Define to EXTERN_INLINE, so that the corresponding functions
5621 are compiled into code.
5622 (kset_echo_string, kset_kbd_queue)
5623 (kset_keyboard_translate_table, kset_last_prefix_arg)
5624 (kset_last_repeatable_command, kset_local_function_key_map)
5625 (kset_overriding_terminal_local_map, kset_real_last_command)
5626 (kset_system_key_syms): New setter functions.
5627
f00af5b1
PE
5628 * frame.h (FSET): Remove (Bug#12215).
5629 Replace all uses with calls to new setter functions.
5630 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5631 (FRAME_INLINE): New macro.
5632 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5633 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5634 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5635 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5636 (fset_param_alist, fset_root_window, fset_scroll_bars)
5637 (fset_selected_window, fset_title, fset_tool_bar_items)
5638 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5639 * frame.c (FRAME_INLINE):
5640 Define to EXTERN_INLINE, so that the corresponding functions
5641 are compiled into code.
5642 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5643
0c94c8d6
PE
5644 A few more naming-convention fixes for getters and setters.
5645 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5646 and rename from buffer_overlays_set_before.
5647 (set_buffer_overlays_after): Move here from buffer.h, and rename
5648 from buffer_overlays_set_after.
5649 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5650 All uses changed.
5651 (set_buffer_intervals): Rename from buffer_set_intervals.
5652 * intervals.c (set_interval_object): Move here from intervals.h,
5653 and rename from interval_set_object.
5654 (set_interval_left): Move here from intervals.h, and rename from
5655 interval_set_left.
5656 (set_interval_right): Move here from intervals.h, and rename from
5657 interval_set_right.
5658 (copy_interval_parent): Move here from intervals.h, and rename from
5659 interval_copy_parent.
5660 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5661 (set_interval_plist): Rename from interval_set_plist.
5662 Return void, not Lisp_Object, since no caller uses the result.
5663 * lisp.h (string_intervals): Rename from string_get_intervals.
5664 (set_string_intervals): Rename from string_set_intervals.
5665
34dabdb7
PE
5666 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5667 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 5668 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
5669 All uses changed. See the end of
5670 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5671
742af32f
PE
5672 * lisp.h (CSET): Remove (Bug#12215).
5673 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5674 (set_char_table_purpose): New functions,
5675 replacing CSET. All uses changed. For example, replace
5676 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 5677 "set_char_table_parent (char_table, parent);".
742af32f
PE
5678 The old version was confusing because it used the same name
5679 'parent' for two different things.
5680
a04e2c62
DA
56812012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5682
5683 Functions to get and set Lisp_Object fields of buffer-local variables.
5684 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5685 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5686 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5687 * data.c, eval.c, frame.c: Adjust users.
5688
383dcbf9
CY
56892012-08-17 Chong Yidong <cyd@gnu.org>
5690
5691 * xfaces.c (merge_face_vectors): If the target font specfies a
5692 font spec, make the font's attributes take precedence over
5693 directly-specified attributes.
5694 (merge_face_ref): Recognize :font.
5695
44386687
DA
56962012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5697
5698 Do not use memcpy for copying intervals.
5699 * intervals.c (reproduce_interval): New function.
5700 (reproduce_tree, reproduce_tree_obj): Use it.
5701 (reproduce_tree_obj): Remove prototype.
5702
927c7216
PE
57032012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5704
5705 * lisp.h (duration_to_sec_usec): Remove unused decl.
5706
93044f7b
AA
57072012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5708
5709 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5710 to an allocated instance of NSString, not to the class itself.
5711
9851e4a5
JB
57122012-08-17 Juanma Barranquero <lekktu@gmail.com>
5713
5714 * makefile.w32-in (C_CTYPE_H): New macro.
5715 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5716 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5717 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5718
620f13b0
PE
57192012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5720
5721 Use ASCII tests for character types.
5722 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5723 * xfns.c, xterm.c:
5724 Don't include <ctype.h>; was not needed.
5725 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5726 * sysdep.c, xfaces.c:
5727 Include <c-ctype.h> instead of <ctype.h>.
5728 * nsterm.m: Include <c-ctype.h>.
5729 * charset.c (read_hex):
5730 * doc.c (Fsnarf_documentation):
5731 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5732 (DRIVE_LETTER) [DOS_NT]:
5733 (Ffile_name_directory, Fexpand_file_name)
5734 (Fsubstitute_in_file_name):
5735 * font.c (font_parse_xlfd, font_parse_fcname):
5736 * frame.c (x_set_font_backend):
5737 * gtkutil.c (xg_get_font):
5738 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5739 * nsimage.m (hexchar):
5740 * nsterm.m (ns_xlfd_to_fontname):
5741 * sysdep.c (system_process_attributes):
5742 * xfaces.c (hash_string_case_insensitive):
5743 Use C-locale tests instead of locale-specific tests for character
5744 types, since we want the ASCII interpretation here, not the
5745 interpretation suitable for whatever happens to be the current locale.
5746
52162052
MR
57472012-08-16 Martin Rudalics <rudalics@gmx.at>
5748
5749 Consistently check windows for validity/liveness
5750 (Bug#11984, Bug#12025, Bug#12026).
5751 * lisp.h (CHECK_VALID_WINDOW): New macro.
5752 * window.c (decode_window): Rename to decode_live_window.
5753 (decode_valid_window, Fwindow_valid_p): New functions.
5754 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5755 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5756 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5757 (Fwindow_prev_sibling, Fwindow_combination_limit)
5758 (Fset_window_combination_limit, Fwindow_use_time)
5759 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5760 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5761 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5762 (Fwindow_hscroll, Fset_window_hscroll)
5763 (Fwindow_redisplay_end_trigger)
5764 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5765 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5766 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5767 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5768 (Fwindow_end, Fset_window_point, Fset_window_start)
5769 (Fpos_visible_in_window_p, Fwindow_line_height)
5770 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5771 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5772 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5773 (Fset_window_parameter, Fwindow_display_table)
5774 (Fset_window_display_table, Fdelete_other_windows_internal)
5775 (Fset_window_buffer, Fset_window_new_total)
5776 (Fset_window_new_normal, Fdelete_window_internal)
5777 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5778 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5779 (Fwindow_scroll_bars): Check whether argument window is a valid or
5780 live window. Update doc-strings.
5781 (syms_of_window): New symbol Qwindow_valid_p.
5782 * keyboard.c (Fposn_at_x_y): Check whether argument
5783 frame_or_window denotes a valid window.
5784
2751c80f
DA
57852012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5786
5787 Fix previous char table change.
5788 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5789 * chartab.c (optimize_sub_char_table): Likewise.
5790
032a42c8
CY
57912012-08-16 Chong Yidong <cyd@gnu.org>
5792
a2d19368
CY
5793 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5794
032a42c8
CY
5795 * xfont.c (xfont_open):
5796 * xftfont.c (xftfont_open): Set the font's max_width field.
5797
5798 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5799 min_width to space_width and average_width to the average over
5800 printable ASCII characters.
5801 (ns_char_width): Code cleanup.
5802 (ns_ascii_average_width): New utility function.
5803
5804 * font.h (struct font): Update comments.
5805
a098c930
DA
58062012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5807
032a42c8 5808 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
5809 * lisp.h (CSET): New macro.
5810 (char_table_set_extras, char_table_set_contents)
5811 (sub_char_table_set_contents): New function.
5812 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5813 * syntax.c: Adjust users.
5814
8be3a09c
SM
58152012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5816
5817 * eval.c (eval_sub): Bind lexical-binding.
5818 * lread.c (Qlexical_binding): Make non-static.
5819
ac4845a6
JD
58202012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5821
ddee6515
JD
5822 * nsmenu.m (popupSession): Remove.
5823 (pop_down_menu): Remove endModalSession.
5824 (timeout_handler:): New method.
5825 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5826 Call runModalForWindow. Check timer_fired when it returns.
5827 If not set, cancel timer and break out of loop.
5828 Otherwise loop again, with a new timeout.
5829
5830 * nsterm.m: Include fcntl.h if present.
5831 (fd_entry, t_readfds, inNsSelect): Remove.
5832 (select_writefds, select_valid, select_timeout, selfds)
5833 (select_mutex, apploopnr): Add.
5834 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5835 Otherwise call kbd_buffer_store_event.
5836 (ns_send_appdefined): Remove release of fd_entry.
5837 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5838 Increment and decrement apploopnr.
5839 (ns_select): If no file descriptors, just do a NSTimer.
5840 Otherwise copy read/write masks and start select thread (fd_handler).
5841 Start main loop and wait for application defined event.
5842 Inform select thread to stop selecting after main loop is exited.
5843 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 5844 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
5845 (fd_handler:): Loop forever, wait for info from the main thread
5846 to either start or stop selecting. When select returns, send
5847 and appdefined event.
5848 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5849 If not call kbd_buffer_store_event.
5850
5851 * nsterm.h (EmacsApp): fd_handler takes id argument.
5852 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5853
ac4845a6
JD
5854 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5855
eb424fe3
EZ
58562012-08-15 Eli Zaretskii <eliz@gnu.org>
5857
5858 * region-cache.c (move_cache_gap): Update gap_len using the actual
5859 growth of the boundaries array. Do not change cache_len.
5860 (Bug#12196)
5861
4e6a86c6
DA
58622012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5863
5864 Generalize and cleanup font subsystem checks.
5865 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
5866 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5867 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 5868
5bf192ca
DA
58692012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5870
5871 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5872
f2045622
CY
58732012-08-15 Chong Yidong <cyd@gnu.org>
5874
8be3a09c
SM
5875 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5876 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5877 extract the font descriptor instead of just the font name.
5878 In that case, return a font spec instead of a string.
f2045622
CY
5879 (x_last_font_name): Move to this file from xfns.c.
5880
5881 * xfns.c (Fx_select_font): The return value can also be a font
5882 spec. Move x_last_font_name management to gtkutil.c.
5883
5884 * xfaces.c: Make font weight and style symbols non-static.
5885
7f6feb56
SM
58862012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5887
5888 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5889 (bug#12117).
5890
fecbd8ff
SM
58912012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5892
5893 * alloc.c (Fgarbage_collect): Use plural form consistently.
5894
9b8d5165
EZ
58952012-08-14 Eli Zaretskii <eliz@gnu.org>
5896
5897 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5898 iteration through the command loop. Fixes a problem whereby mouse
5899 movements are ignored until the first mouse click.
5900
f5d9e83a
PE
59012012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5902
5903 Use bool, not int, for Lisp booleans.
5904 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5905 makes Emacs a bit smaller and presumably a bit faster.
5906 * lisp.h: Include <stdbool.h>.
5907 (struct Lisp_Boolfwd, defvar_bool):
5908 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5909 * regex.c [!emacs]: Include <stdbool.h>.
5910 (false, true): Remove; <stdbool.h> does this for us now.
5911
55802e4a
CY
59122012-08-14 Chong Yidong <cyd@gnu.org>
5913
4abcdac8
CY
5914 * character.c (Fcharacterp): Doc fix (Bug#12076).
5915
5916 * data.c (Findirect_variable): Doc fix (Bug#11040).
5917
55802e4a
CY
5918 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5919
5920 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 5921 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 5922
8e99d072
BR
59232012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5924
5925 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5926 (bug#12022).
5927
08908aca
MR
59282012-08-14 Martin Rudalics <rudalics@gmx.at>
5929
5930 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5931 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5932 * minibuf.c (choose_minibuf_frame, read_minibuf):
5933 * w32fns.c (x_create_tip_frame):
5934 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5935 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5936
56120d6f
PE
59372012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5938
5939 * intervals.c (offset_intervals): Remove obsolete comment.
5940
67b77c0b
AS
59412012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5942
5943 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5944
f48b82fd
GR
59452012-08-14 Gergely Risko <gergely@risko.hu>
5946
5947 * coding.c (decode_coding): Record buffer modification before
5948 disabling undo_list (Bug#11773).
5949
fd318b54
DA
59502012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5951
5952 Revert and cleanup some recent overlay changes.
5953 * buffer.h (enum overlay_type): Remove.
5954 (buffer_get_overlays, buffer_set_overlays): Likewise.
5955 (buffer_set_overlays_before, buffer_set_overlays_after):
5956 New function. Adjust users.
5957 (unchain_both): Add eassert.
5958
41a62dd9
DA
59592012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5960
5961 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5962
5884c324
PE
59632012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5964
5965 * gtkutil.c (xg_mark_data): Don't assume C99.
5966
ca06f160
JD
59672012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5968
5969 * gtkutil.c (xg_frame_tb_info): New struct.
5970 (TB_INFO_KEY): New define.
5971 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5972 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5973 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5974 if not present.
5975 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 5976 is up to date. Otherwise store new data.
ca06f160
JD
5977 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5978
7864a3f7
DA
59792012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5980
5981 Use KSET for write access to Lisp_Object members of struct kboard.
5982 * keyboard.h (KSET): New macro.
5983 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5984 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5985 * xterm.c: Adjust users.
5986
4c31be61
DA
59872012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5988
5989 Use BSET for write access to Lisp_Object members of struct buffer.
5990 * buffer.h (BSET): New macro.
5991 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5992 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5993 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5994 * window.c, xdisp.c, xfns.c: Adjust users.
5995
14ae4239
BT
59962012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5997
5998 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5999
32bcadb4
JD
60002012-08-11 Jan Djärv <jan.h.d@swipnet.se>
6001
3d29b2ce 6002 * nsterm.m (not_in_argv): New function.
fc0c31f8 6003 (application:openFile, application:openTempFile:):
3d29b2ce
JD
6004 (application:openFileWithoutUI:, application:openFiles:): Open file
6005 if not_in_argv returns non-zero (bug#12171).
6006
32bcadb4 6007 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
6008 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
6009 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
6010 (xg_get_font_name): Use those functions/macros here.
6011 Reported by Frans Oilinki <moilinki@gmail.com>.
6012
9ff9402d 60132012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
6014
6015 * unexmacosx.c (copy_data_segment): Copy initialized data in
6016 statically linked libraries from input file rather than memory.
6017
db74a5fc
YM
6018 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
6019 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
6020 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
6021
25e65510
GM
60222012-08-10 Glenn Morris <rgm@gnu.org>
6023
6024 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
6025 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
6026
7961135c
DA
60272012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6028
6029 Fix last change to allow compilation with low optimization levels.
6030 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
6031 Reported by Jan Djärv <jan.h.d@swipnet.se>.
6032
42b3a444
DA
60332012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6034
6035 Use common inline syntax in intervals.h.
6036 * intervals.h (INTERVALS_INLINE): New macro.
6037 Change all users from LISP_INLINE.
6038
9fb0c957
DA
60392012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6040
6041 Define Qnone once for all platforms.
6042 * frame.c (Qnone): Define here.
6043 (syms_of_frame): DEFSYM it.
6044 * lisp.h (Qnone): New declaration.
6045 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
6046 * xfns.c: Remove duplication. Adjust users.
6047
65e8ee52
DA
60482012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
6049
6050 Remove unused macros from intervals.h.
6051 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
6052 * intervals.c: Adjust comment.
6053
9b855fd6
EZ
60542012-08-10 Eli Zaretskii <eliz@gnu.org>
6055
6056 * w32fns.c <w32_unicode_gui>: New static variable.
6057 (globals_of_w32fns): Initialize it according to os_subtype.
6058 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
6059 testing os_subtype.
6060
39cb9e56 60612012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
6062 Eli Zaretskii <eliz@gnu.org>
6063
6064 Fix bug #10299 with Unicode characters sent by customized
6065 keyboards created by MSKLC.
6066 * w32fns.c (INIT_WINDOW_CLASS): New macro.
6067 (w32_init_class): Use it to initialize the Emacs class with either
6068 ANSI or Unicode API calls.
6069 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
6070 later.
6071 (w32_wnd_proc): If the character code sent by WM_CHAR or
6072 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
6073 original message. Call DefWindowProcW on NT and later.
6074
9374581a
GM
60752012-08-10 Glenn Morris <rgm@gnu.org>
6076
4b94e8cf
GM
6077 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
6078
9374581a
GM
6079 * lisp.h (DIRECTORY_SEP): Let configure set it.
6080
a2752828
DA
60812012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
6082
6083 Use TSET for write access to Lisp_Object slots of struct terminal.
6084 * termhooks.h (TSET): New macro.
6085 * coding.c, terminal.c, xselect.c: Adjust users.
6086
cc92c454
SM
60872012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
6088
6089 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
6090 the failing expression, include them in the error message.
6091 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
6092 * lisp.h (internal_condition_case_n): Update declaration.
6093
4cb3e6b3
DA
60942012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6095
6096 Inline functions to examine and change buffer overlays.
6097 * buffer.c (unchain_both): New function.
6098 * buffer.h (buffer_get_overlays, buffer_set_overlays):
6099 (buffer_has_overlays): New function.
6100 (enum overlay_type): New enum.
6101 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
6102 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
6103
8707c1e5
DA
61042012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6105
6106 Inline functions to examine and change buffer intervals.
6107 * alloc.c (mark_interval_tree): Remove.
6108 (MARK_INTERVAL_TREE): Simplify.
6109 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
6110 * intervals.c (buffer_balance_intervals): New function.
6111 (graft_intervals_into_buffer): Adjust indentation.
6112 (set_intervals_multibyte): Simplify.
6113 * buffer.h (BUF_INTERVALS): Remove.
6114 (buffer_get_intervals, buffer_set_intervals): New function.
6115 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
6116 * intervals.c, textprop.c: Adjust users.
6117
ad8c997f
DA
61182012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6119
6120 Inline functions to examine and change string intervals.
6121 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
6122 (string_get_intervals, string_set_intervals): New function.
6123 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6124 * lread.c, print.c, textprop.c: Adjust users.
6125
32ac3a6b
GM
61262012-08-08 Glenn Morris <rgm@gnu.org>
6127
6128 * lisp.mk (lisp): Remove language/persian.elc.
6129
77c7bcb1
DA
61302012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6131
6132 Cleanup intervals.
6133 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
6134 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
6135 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
6136 Adjust comment. Move under #if 0.
77c7bcb1
DA
6137 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
6138 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
6139
9c08a8d4
DA
61402012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6141
6142 Check total length of intervals with eassert.
6143 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
6144 * intervals.c: Change all users to eassert.
6145
26d16b35
EZ
61462012-08-07 Eli Zaretskii <eliz@gnu.org>
6147
14ae4239
BT
6148 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
6149 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
6150 INTERNAL_FIELD in Lisp_Cons.
6151
c644523b
DA
61522012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6153
6154 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
6155 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
6156 name since all xname users are fixed long time ago. Do not
6157 use INTERNAL_FIELD.
6158 (set_symbol_name, set_symbol_function, set_symbol_plist):
6159 (set_symbol_next, set_overlay_plist): New function.
6160 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
6161 (struct Lisp_Overlay): Likewise.
6162 (CVAR, MVAR, SVAR): Remove.
6163 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
6164 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
6165 * xterm.c: Adjust users.
6166 * .gdbinit: Change to use name field of struct Lisp_Symbol
6167 where appropriate.
6168
6a3d20cc
DA
61692012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6170
6171 Basic functions to set Lisp_Object and pointer slots of intervals.
6172 * intervals.h (interval_set_parent, interval_set_object):
6173 (interval_set_left, interval_set_right, interval_set_plist):
6174 (interval_copy_parent): New function.
6175 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
6176 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
6177 Adjust indentation.
6a3d20cc
DA
6178 (INTERVAL_SIZE): Remove. Adjust users.
6179 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
6180
4d2b044c
DA
61812012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6182
6183 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
6184 * process.h (PGET): Remove.
6185 (struct Lisp_Process): Do not use INTERNAL_FIELD.
6186 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6187
d3d50620
DA
61882012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6189
6190 Drop WGET and revert read access to Lisp_Objects slots of struct window.
6191 * window.h (WGET): Remove.
6192 (struct window): Do not use INTERNAL_FIELD.
6193 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6194 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6195 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6196 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6197 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6198 Adjust users.
6199
d10a51dc
CY
62002012-08-07 Chong Yidong <cyd@gnu.org>
6201
6202 * window.c (Fwindow_edges, Fwindow_pixel_edges)
6203 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
6204 (Fdelete_window_internal): Signal an error if the window is not on
6205 a live frame (Bug#12025).
6206
e69b0960
DA
62072012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6208
6209 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
6210 * frame.h (FGET): Remove.
6211 (struct frame): Do not use INTERNAL_FIELD.
6212 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6213 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6214 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6215 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6216
25a20a3a
JB
62172012-08-06 Juanma Barranquero <lekktu@gmail.com>
6218
6219 * w32.c: Silence compiler warnings.
6220 (map_w32_filename): Remove unused variable `is_fat'.
6221 (chase_symlinks): Add parentheses around expression.
6222
1c6f11f4
GM
62232012-08-06 Glenn Morris <rgm@gnu.org>
6224
1db4583a
GM
6225 * sysdep.c: Respect BROKEN_GETWD.
6226
1c6f11f4
GM
6227 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
6228 Let configure handle it.
6229 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
6230
2b90362b
DA
62312012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6232
6233 Use GCALIGNMENT where appropriate.
6234 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
6235 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
6236 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
6237
5f50daf2
EZ
62382012-08-06 Eli Zaretskii <eliz@gnu.org>
6239
14ae4239
BT
6240 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
6241 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 6242
cbcc7007
SM
62432012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
6244
6245 * buffer.h (struct buffer): Revert `indirections' to a simple int;
6246 that should be sufficient for everyone.
6247
4d365fa4
JD
62482012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6249
6250 * keyboard.c (timer_check_2): Add break so timer_check returns next
6251 timeout.
6252
dd86bd82
DA
62532012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6254
6255 Fix Windows build errors introduced after converting to WGET and WSET.
6256 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
6257 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6258
054e1668
JD
62592012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6260
6261 * nsterm.m (ns_frame_rehighlight): Use FSET.
6262
6263 * nsmenu.m (ns_update_menubar): Use FSET.
6264
21238f11
DA
62652012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6266
6267 Separate read and write access to Lisp_Object slots of Lisp_Process.
6268 * process.h (PGET, PSET): New macros similar to AREF and ASET.
6269 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6270
077288cf
DA
62712012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6272
6273 Separate read and write access to Lisp_Object slots of struct window.
6274 * window.h (WGET, WSET): New macros similar to AREF and ASET.
6275 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6276 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6277 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6278 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6279 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6280 Adjust users.
6281
71688bd7
DA
62822012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6283
6284 Fix Windows build errors introduced after converting to FGET and FSET.
6285 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
6286 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
6287 (w32_judge_scroll_bars): Change to use FSET.
6288 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6289
f99bac93
DA
62902012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6291
6292 Fix replacement typo.
6293 * window.c (replace_window): Set root_window instead of
6294 selected_window. This fixes a total window subsystem
6295 malfunction reported by Bastien Guerry <bzg@gnu.org>.
6296
8c2a0f2d
GM
62972012-08-06 Glenn Morris <rgm@gnu.org>
6298
6299 * lisp.mk (lisp): Add language/persian.elc.
6300
edd74c35
DA
63012012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6302
6303 Separate read and write access to Lisp_Object slots of struct frame.
6304 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
6305 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6306 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6307 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6308 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6309
8671676c
AS
63102012-08-05 Andreas Schwab <schwab@linux-m68k.org>
6311
6312 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
6313
663e2b3f
DA
63142012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
6315
6316 Generalize common compile-time constants.
6317 * lisp.h (header_size, bool_header_size, word_size): Now here.
6318 (struct Lisp_Vector): Add comment.
6319 (struct Lisp_Bool_Vector): Move up to define handy constants.
6320 (VECSIZE, PSEUDOVECSIZE): Simplify.
6321 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
6322 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
6323 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
6324 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
6325 * xfont.c, xmenu.c: Use word_size where appropriate.
6326
d32e47af
LM
63272012-08-05 Lawrence Mitchell <wence@gmx.li>
6328
6329 * search.c (Freplace_match): Treat \? in the replacement text
6330 literally (Bug#8161).
6331
e5d9c0d1
CY
63322012-08-05 Chong Yidong <cyd@gnu.org>
6333
6334 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
6335 * frame.c (Vdelete_frame_functions):
6336 * emacs.c (Vkill_emacs_hook): Doc fix.
6337
8da0576b
EZ
63382012-08-04 Eli Zaretskii <eliz@gnu.org>
6339
6340 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
6341 --with-x-toolkit=no builds.
6342 Reported by Carsten Mattner <carstenmattner@gmail.com>.
6343
02676e5d
CY
63442012-08-04 Chong Yidong <cyd@gnu.org>
6345
6346 * syntax.c (Fmodify_syntax_entry): Doc fix.
6347
97147da9
EZ
63482012-08-04 Eli Zaretskii <eliz@gnu.org>
6349
76151e2c
EZ
6350 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
6351 * w32.c (init_environment): Change the default values of many
6352 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
6353 them into environment when they were not already defined.
6354 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 6355 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
6356 (check_windows_init_file): Now external, not static.
6357 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
6358 called when Vload_path is already set up.
6359
6360 * w32.h (check_windows_init_file): Add prototype.
6361
6362 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
6363 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
6364 compatibility with Posix platforms.
6365 (main): Move the call to check_windows_init_file to here from
6366 w32.c.
6367 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
6368 any, in the DEFALT argument into the root of the Emacs build or
6369 installation tree, as appropriate.
6370
6371 * callproc.c (init_callproc_1): Call decode_env_path instead of
6372 doing its equivalent by hand.
6373 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
6374 the code that sets Vexec_path run on MS-Windows.
6375
6376 * lread.c (init_lread): Add comments to #ifdef's.
6377
97147da9
EZ
6378 * msdos.c (dos_set_window_size, IT_update_begin)
6379 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
6380 instead of direct references.
6381
185ee146
PE
63822012-08-04 Paul Eggert <eggert@cs.ucla.edu>
6383
6384 Export DEFAULT_REHASH_* to GDB.
6385 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
6386 Now constants, not macros.
6387
8834c57a
PE
63882012-08-03 Paul Eggert <eggert@cs.ucla.edu>
6389
98c6f1e3
PE
6390 Remove unnecessary casts involving pointers.
6391 These casts are no longer needed now that we assume C89 or later,
6392 since they involve casting to or from void *.
6393 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
6394 (make_pure_float, make_pure_vector):
6395 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
6396 * macros.c (Fstart_kbd_macro):
6397 * menu.c (find_and_return_menu_selection):
6398 * minibuf.c (read_minibuf_noninteractive):
6399 * sysdep.c (closedir):
6400 * xdisp.c (x_produce_glyphs):
6401 * xfaces.c (compare_fonts_by_sort_order):
6402 * xfns.c (x_real_positions, select_visual):
6403 * xselect.c (x_stop_queuing_selection_requests)
6404 (x_get_window_property, x_get_window_property_as_lisp_data):
6405 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6406 Remove unnecessary pointer casts.
6407 * alloc.c (record_xmalloc): New function.
6408 * lisp.h (record_xmalloc): New decl.
6409 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6410 more like a function. This is because the pointer cast is not
6411 needed. All uses changed.
6412 * print.c (print_string, print_error_message): Avoid length recalc.
6413
8834c57a
PE
6414 Improve fix for macroexp crash with debugging (Bug#12118).
6415 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6416 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6417 not supposed to be invoked from the garbage collector.
6418 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6419 (gc_aset): New function, which is like ASET but can be
6420 used in the garbage collector.
6421 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6422 (set_hash_index): Use it instead of ASET.
6423
6dad7178
EZ
64242012-08-03 Eli Zaretskii <eliz@gnu.org>
6425
6426 Support symlinks on latest versions of MS-Windows.
6427 * w32.c: Include winioctl.h and aclapi.h.
6428 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6429 (revert_to_self): Forward declarations of static functions.
6430 <static BOOL g_b_init_get_security_info>:
6431 <g_b_init_create_symbolic_link>: New static flags.
6432 (globals_of_w32): Initialize them to zero.
6433 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6434 (map_w32_filename): Improve commentary. Simplify switch.
6435 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6436 headers (most versions of MinGW w32api don't).
6437 (get_security_info, create_symbolic_link)
6438 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6439 New functions.
6440 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6441 in the argument file name.
6442 (sys_access): Call unc_volume_file_attributes only if
6443 GetFileAttributes fails with network-related error codes.
6444 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6445 have the required privileges.
14ae4239 6446 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
6447 get_file_security_desc.
6448 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
6449 with addition of handling of symlinks and support for 'lstat'.
6450 If possible, get file's attributes and security information by
6dad7178
EZ
6451 handle, not by name. Produce S_IFLNK bit for symlinks, when
6452 called from 'lstat'.
6453 (stat, lstat): New functions, call 'stat_worker'.
6454 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6455 symlinks when the underlying filesystem supports them.
6456
f162bcc3
PE
64572012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6458
79ea6c20
PE
6459 Fix macroexp crash on Windows with debugging (Bug#12118).
6460 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6461 checking subscripts; problem introduced with the recent
6462 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6463 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6464 since it's used in non-static inline functions now.
6465
c0ce93fd
PE
6466 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6467 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 6468
f162bcc3
PE
6469 Use C99-style 'extern inline' if available.
6470 * buffer.h (BUFFER_INLINE):
6471 * category.h (CATEGORY_INLINE):
6472 * character.h (CHARACTER_INLINE):
6473 * charset.h (CHARSET_INLINE):
6474 * composite.h (COMPOSITE_INLINE):
6475 * dispextern.h (DISPEXTERN_INLINE):
6476 * lisp.h (LISP_INLINE):
6477 * systime.h (SYSTIME_INLINE):
6478 New macro, replacing 'static inline' in this header.
6479 * buffer.h, category.h, character.h, charset.h, composite.h:
6480 * dispextern.h, lisp.h, systime.h:
6481 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6482 * alloc.c (LISP_INLINE):
6483 * buffer.c (BUFFER_INLINE):
6484 * category.c (CATEGORY_INLINE):
6485 * character.c (CHARACTER_INLINE):
6486 * charset.c (CHARSET_INLINE):
6487 * composite.c (COMPOSITE_INLINE):
6488 * dispnew.c (DISPEXTERN_INLINE):
6489 * sysdep.c (SYSTIME_INLINE):
6490 Define to EXTERN_INLINE, so that the corresponding functions
6491 are compiled into code.
6492 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6493 (INLINE_HEADER_END): New macros.
6494 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6495 since it's used in non-static inline functions now.
a8333d03 6496 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 6497
837b365b
GM
64982012-08-02 Glenn Morris <rgm@gnu.org>
6499
d66b744d
GM
6500 * s/: Remove empty directory.
6501
837b365b
GM
6502 * s/ms-w32.h: Move to ../nt/inc.
6503 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6504 Update for new ms-w32.h location.
6505
13294f95
PE
65062012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6507
6508 Port to Solaris 8.
6509 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6510
90df0db3
GM
65112012-08-02 Glenn Morris <rgm@gnu.org>
6512
6513 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6514 hard-coding the path separator.
6515
4939150c
PE
65162012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6517
6518 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6519 This how ASET and AREF are supposed to work, and makes
6520 it easier to think about future improvements. See
6521 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6522 * charset.h (set_charset_attr): New function.
6523 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6524 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6525 (aref_addr): New function. All uses of &AREF(...) changed.
6526 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6527 (set_hash_index): New functions. All lvalue-style uses of
6528 HASH_KEY etc. changed.
6529 * keyboard.c (set_prop): New function. All lvalue-style uses
6530 of PROP changed.
6531
947b2afd
AA
65322012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6533
6534 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6535 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 6536 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
6537 * nsfns.m (ns_set_name_as_filename): Likewise.
6538 * nsmenu.m (ns_update_menubar): Likewise.
6539 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6540
4f5d0325
EZ
65412012-08-01 Eli Zaretskii <eliz@gnu.org>
6542
2008beae
EZ
6543 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6544 Adapt to latest changes in field names of the corresponding Lisp
288479f6 6545 objects.
2008beae 6546
4f5d0325
EZ
6547 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6548
fe3cc771
GM
65492012-08-01 Glenn Morris <rgm@gnu.org>
6550
6551 * s/msdos.h: Remove file.
6552 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6553 * Makefile.in (S_FILE): Remove.
6554 (config_h): Remove S_FILE.
6555
c90acc54
JB
65562012-08-01 Juanma Barranquero <lekktu@gmail.com>
6557
6558 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6559 Remove; moved to nt/config.nt.
6560
d8a05828
DA
65612012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6562
6563 Use INTERNAL_FIELD for conses and overlays.
6564 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6565 Remove obsolete comment.
6566 (MVAR): New macro.
6567 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6568 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6569
8271d590
DA
65702012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6571
6572 Use INTERNAL_FIELD for symbols.
6573 * lisp.h (SVAR): New macro. Adjust users.
6574 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6575 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6576
3193acd2
DA
65772012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6578
6579 Use INTERNAL_FIELD for processes.
6580 * process.h (PVAR): New macro. Adjust style.
6581 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6582 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6583
3a45383a
DA
65842012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6585
6586 Use INTERNAL_FIELD for windows.
6587 * window.h (WVAR): New macro.
6588 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6589 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6590 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6591 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6592 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6593 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6594
c1dbc63c
PE
65952012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6596
6597 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6598
5c0c0e8a
GM
65992012-08-01 Glenn Morris <rgm@gnu.org>
6600
6601 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6602 Move to configure.ac.
6603
552a99b4
JB
66042012-08-01 Juanma Barranquero <lekktu@gmail.com>
6605
6606 * makefile.w32-in (CONFIG_H): Update dependencies.
6607 (CONF_POST_H): New macro.
6608
6609 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6610
8d8e2dfe
GM
66112012-07-31 Glenn Morris <rgm@gnu.org>
6612
bc96620a
GM
6613 * Makefile.in (S_FILE): No longer set by configure.
6614
476b1b2d
GM
6615 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6616 is available.
6617 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6618
b2c7a106
GM
6619 * process.h (NULL_DEVICE):
6620 * emacs.c (SEPCHAR):
6621 * editfns.c (USER_FULL_NAME): Let configure set them.
6622
d53d062a
GM
6623 * s/README, s/template.h: Remove files.
6624
4515017f
GM
6625 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6626
8d8e2dfe
GM
6627 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6628 Move to configure.ac.
6629
5b20b3cc
EZ
66302012-07-31 Eli Zaretskii <eliz@gnu.org>
6631
1e0afd9a
EZ
6632 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6633 resulting renaming of 'struct frame' members.
6634
5b20b3cc
EZ
6635 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6636
6637 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6638 after introduction of FVAR.
6639
f1310128
JD
66402012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6641
79e721e0
JD
6642 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6643
6644 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6645 instead of compositeToPoint.
6646 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6647
8d7c7eed 6648 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 6649
e34f7f79
DA
66502012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6651
6652 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6653 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 6654 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
6655 (BVAR): Change to use INTERNAL_FIELD.
6656 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6657 (KVAR): Change to use INTERNAL_FIELD.
6658 * frame.h (FVAR): New macro.
6659 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
6660 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6661 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6662 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
6663 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6664
c09bfb2f
DA
66652012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6666
6667 Miscellaneous fixes for non-default X toolkits.
6668 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6669 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6670 Move under #ifdef USE_LUCID.
6671 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6672 definition and usage to avoid warnings.
6673
14c114ae
JD
66742012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6675
6676 * nsterm.m (openFiles): Fix previous checkin.
6677
3bd21e82
PE
66782012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6679
6680 * indent.c (compute_motion): Remove unused local.
6681
c1529ded
GM
66822012-07-31 Glenn Morris <rgm@gnu.org>
6683
400d5621
GM
6684 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6685
268e2432
GM
6686 * conf_post.h [USG5_4]:
6687 Move remaining contents of s/usg5-4-common.h here.
6688 * s/usg5-4-common.h: Remove file.
6689
7552f3ee
GM
6690 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6691 * s/irix6-5.h: Remove file.
6692
6a381852
GM
6693 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6694 * s/darwin.h: Remove file.
6695
c1529ded
GM
6696 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6697 * s/hpux10-20.h: Remove file, which is now empty.
6698
b429a4ee
GM
66992012-07-30 Glenn Morris <rgm@gnu.org>
6700
6701 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6702 * Makefile.in (config_h): Add conf_post.h.
6703 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6704
adff3182
JD
67052012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6706
6707 * nsterm.m (ns_do_open_file): New variable.
b9031d69 6708 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
6709 (openFile, openTempFile, openFileWithoutUI, openFiles):
6710 Open files only if ns_do_open_file.
adff3182 6711
c32af1e4
PE
67122012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6713
7393bcbb
PE
6714 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6715 This no-op macro hasn't been needed for many years.
6716 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6717
c32af1e4
PE
6718 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6719 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6720 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6721 gdb_make_enums_visible.
6722 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6723 (DIRECTORY_SEP): Now a constant, not a macro.
6724
302fc036
EZ
67252012-07-30 Eli Zaretskii <eliz@gnu.org>
6726
6727 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6728 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6729
6730 * w32term.c <w32_keyboard_codepage>: Renamed from
6731 keyboard_codepage and now external. All users changed.
6732
6733 * w32term.h: Add declaration of w32_keyboard_codepage.
6734
6735 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6736 the codepage to translate keys to Unicode. If this argument is
6737 -1, use the value returned by GetConsoleCP. All callers changed.
6738
88fb40b4
PE
67392012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6740
0aee6912
PE
6741 Update .PHONY listings in makefiles.
6742 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6743 bootstrap-clean, distclean, maintainer-clean, versioclean,
6744 extraclean, frc.
6745
88fb40b4
PE
6746 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6747 This is a bit clearer. Fix some commentary typos.
6748
0a763bd1
GM
67492012-07-30 Glenn Morris <rgm@gnu.org>
6750
32bac6d6
GM
6751 * s/netbsd.h: Let configure include signal.h if needed.
6752 Remove file, which is now empty.
6753
b65e7c46
GM
6754 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6755 Let configure set them.
6756 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6757 No more need to undefine.
0a763bd1 6758
169304bd
AS
67592012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6760
6761 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6762 non-single-byte char when adding meta modifier. (Bug#12090)
6763
6cd7a139
DA
67642012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6765
6766 Convert safe_call to use variable number of arguments.
6767 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6768 (safe_call2): Fix comment.
6769 * lisp.h (safe_call): Adjust prototype.
6770 * coding.c (encode_coding_object): Change to use safe_call2.
6771 * xfaces.c (merge_face_heights): Change to use safe_call1.
6772
d34d6ffc
GM
67732012-07-30 Glenn Morris <rgm@gnu.org>
6774
7b8a48e4 6775 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 6776 does that unconditionally. Remove file, which is now empty.
7b8a48e4 6777
d34d6ffc
GM
6778 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6779 Remove empty files.
6780
03a660a6
PE
67812012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 Export to GDB most of lisp.h's remaining object-like macros.
6784 * lisp.h (min, max): Move earlier, because they're used earlier now.
6785 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6786 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6787 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6788 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6789 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6790 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6791 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6792 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6793 Now constants, for GDB. They need not be macros.
6794 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6795 Now constants, for GDB, as well as macros, for static initializers.
6796 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6797 Move to after the definition of struct Lisp_Char_Table,
6798 since the former now needs that type defined.
6799 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6800 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6801 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6802 New enums, for gdb_make_enums_visible.
6803 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 6804 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
6805 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6806 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6807 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6808 enum maxargs, enum MAX_ALLOCA.
6809 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6810 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6811 no longer needed, now that they are done in lisp.h.
6812
e499d0ee
DA
68132012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6814
6815 Cleanup string bytes checking.
6816 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6817 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6818 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6819 (check_sblock, compact_small_strings): Simplify.
6820
d5040d2d
PE
68212012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6824 These macros are confusing and no longer need to be defined, as
6825 the enum values now suffice. All uses replaced with definiens.
6826 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6827
7f259ae6
JB
68282012-07-29 Juanma Barranquero <lekktu@gmail.com>
6829
6830 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6831 ($(BLD)/w32console.$(O)): Update dependencies.
6832
7e63e0c3
DA
68332012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6834
6835 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6836 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6837 time. Adjust users.
6838 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6839
ffd817eb
JD
68402012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6841
6842 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6843 setting sitelisp (Bug#12010).
6844
417a7a0e
EZ
68452012-07-29 Eli Zaretskii <eliz@gnu.org>
6846
14ae4239 6847 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
6848
6849 * w32heap.c (cache_system_info):
6850 * w32.c (sys_rename):
6851 * w32proc.c (find_child_console, sys_kill): All users changed.
6852
387d4d92
PE
68532012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6854
6855 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6856
55a6cca6
EZ
68572012-07-29 Eli Zaretskii <eliz@gnu.org>
6858
6859 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6860
dbcf001c
DA
68612012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6862
6863 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
6864 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6865 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 6866
e2688e4a
DA
68672012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6868
6869 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6870 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6871 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6872 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6873 (replace_range, replace_range_2, del_range_2): Change to eassert.
6874 * marker.c (byte_char_debug_check): Adjust style.
6875
b46a6a83
PE
68762012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6877
6878 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6879 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6880 long-ago-commented-out code that talks about "WIN32".
6881 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6882 All uses changed.
6883
e32a5799
PE
68842012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6885
6886 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6887 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6888 Simplify by using alignof.
6889 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6890 * lisp.h: Include <stdalign.h>.
6891 (GCALIGNMENT): New macro and constant.
6892 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6893 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6894 (stdalign): New macro, if not already defined.
6895
df81cd29
EZ
68962012-07-28 Eli Zaretskii <eliz@gnu.org>
6897
01bd1b0d
EZ
6898 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6899 * w32inevt.c: Include w32inevt.h.
6900 (w32_read_console_input): New inline function, calls either
6901 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6902 w32_console_unicode_input.
6903 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6904 (w32_kbd_patch_key, key_event): Use the codepage returned by
6905 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6906 (key_event): use uChar.UnicodeChar only if
6907 w32_console_unicode_input is non-zero.
6908
6909 * w32console.c: Include w32heap.h.
6910 <w32_console_unicode_input>: New global variable.
6911 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6912 family of Windows, zero otherwise.
6913
6914 * w32inevt.h: Declare w32_console_unicode_input.
6915
df81cd29
EZ
6916 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6917 --without-x. (Bug#11742)
6918
c20fdd9e
PE
69192012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6920
6921 Adjust GDB to reflect pvec_type changes (Bug#12036).
6922 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
6923 2012-07-04 changes to pseudovector representation.
6924 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 6925
32770973 69262012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
6927
6928 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6929 bus address.
6930 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6931
3438fe21
EZ
69322012-07-27 Eli Zaretskii <eliz@gnu.org>
6933
bcfbc9de
EZ
6934 * alloc.c (listn): Fix the order the arguments are consed onto the
6935 list.
6936
3438fe21
EZ
6937 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6938 enumeration constants, as PURE and HEAP are too general, and clash
6939 with other headers and sources, such as gmalloc.c and the
6940 MS-Windows system headers. All users changed.
6941
eeaea515
DA
69422012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6943
6944 Revert last save_excursion_save and save_excursion_restore changes.
6945 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6946 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6947
073c88c2
DA
69482012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6949
6950 Fix recently-introduced typos in Windows port.
6951 Reported by Martin Rudalics <rudalics@gmx.at>.
6952 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 6953 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 6954
4706125e
PE
69552012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6956
6957 Improve GDB symbol export (Bug#12036).
6958 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6959 arms of an 'if', not using conditional expressions; otherwise GDB
6960 complains about the types in the unevaluated arm when the argument
6961 is an integer literal.
6962 (xgetint): Simplify expression.
6963 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6964 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6965 Zaretskii in <http://bugs.gnu.org/12036#13>.
6966 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6967 needed now that we have gdb_make_enums_visible.
6968 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6969 (enum enum_USE_LSB_TAG):
6970 New enum types, packaging up enums that need to be exported to GDB.
6971
694b6c97
DA
69722012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6973
6974 Utility function to make a list from specified amount of objects.
6975 * lisp.h (enum constype): New datatype.
6976 (listn): New prototype.
6977 * alloc.c (listn): New function.
6978 (Fmemory_use_count, syms_of_alloc): Use it.
6979 * buffer.c (syms_of_buffer): Likewise.
6980 * callint.c (syms_of_callint): Likewise.
6981 * charset.c (define_charset_internal): Likewise.
6982 * coding.c (syms_of_coding): Likewise.
6983 * keymap.c (syms_of_keymap): Likewise.
6984 * search.c (syms_of_search): Likewise.
6985 * syntax.c (syms_of_syntax): Likewise.
6986 * w32.c (init_environment): Likewise.
6987 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6988 * xdisp.c (syms_of_xdisp): Likewise.
6989 * xfns.c (syms_of_xfns): Likewise.
6990
6195f384
DA
69912012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6992
6993 Fast save_excursion_save and save_excursion_restore.
6994 * lisp.h (struct Lisp_Excursion): New data type.
6995 (PVEC_EXCURSION): New pseudovector type.
6996 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6997 to deal with it. Adjust comments.
6998 (init_marker, attach_marker): New prototype.
6999 (unchain_marker): Adjust prototype.
7000 * marker.c (attach_marker): Change to global.
7001 (init_marker): New function.
7002 * alloc.c (Fmake_marker, build_marker): Use it.
7003 (build_marker): More easserts.
7004 (mark_object): Handle struct Lisp_Excursion.
7005 * editfns.c (save_excursion_save, save_excursion_restore):
7006 Reimplement to use struct Lisp_Excursion. Add comments.
7007
5eceb8fb
PE
70082012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7009
7010 Fix export of symbols to GDB (Bug#12036).
7011 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
7012 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
7013 emacs.c, as this is a more-suitable home. Had this been done earlier
7014 the fix for 12036 would have avoided some of the problems noted in
7015 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
7016 would have been more obvious.
562157c8
PE
7017 * emacs.c: Do not include <verify.h>; no longer needed.
7018 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
7019 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
7020 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7021 Remove; now done in lisp.h.
7022 * lisp.h (PUBLISH_TO_GDB): New macro.
7023 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
7024 (DATA_SEG_BITS): Use it.
7025 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
7026 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
7027 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
7028 not be usable in #if. This simplifies things.
7029
d6749401
JB
70302012-07-26 Juanma Barranquero <lekktu@gmail.com>
7031
7032 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
7033
1781b9e9
PE
70342012-07-26 Paul Eggert <eggert@cs.ucla.edu>
7035
d89518db 7036 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
7037 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
7038 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
7039 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
7040 Adjust to changes in lisp.h and emacs.c, by using
7041 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
7042 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
7043 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
7044 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
7045 instead of gdb_valbits.
7046 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
7047 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
7048 instead of gdb_array_mark_flag.
7049 (xboolvector): Get size from $->size, not $->header.size.
7050 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
7051 (xreload, hook-run, hookpost-run): Remove.
7052 * emacs.c: Include <verify.h>.
7053 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
7054 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
7055 Remove.
7056 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
7057 (gdb_USE_LSB_TAG): New enum constants.
7058 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
7059 Also define these as enum constants, so they're visible to GDB.
7060 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
7061 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
7062 as constants, so they're visible to GDB.
7063 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
7064 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
7065 Now enum constants, not macros, so they're visible to GDB.
7066 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
7067 more convenient now. All uses changed.
7068 (VALMASK) [USE_LSB_TAG]: Also define in this case.
7069 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
7070
3628596a
DA
70712012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
7072
7073 Explicitly free restriction data that are not needed anymore.
7074 * editfns.c (save_restriction_restore): Free restriction data.
7075
7abaf5cc
SM
70762012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
7077
7078 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
7079 add argument, tune behavior, and adjust all callers.
7080
71f88e00
PE
70812012-07-25 Paul Eggert <eggert@cs.ucla.edu>
7082
7083 Use typedef for EMACS_INT, EMACS_UINT.
7084 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
7085 than macros. This simplifies debugging in the usual case, since
7086 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
7087 and it allows expressions involving EMACS_INT casts.
7088 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
7089
57ec3034
JD
70902012-07-25 Jan Djärv <jan.h.d@swipnet.se>
7091
7092 * nsterm.m (ns_read_socket): Return early if there is a modal
7093 window (Bug#12043).
7094
8137e7b3
MR
70952012-07-25 Martin Rudalics <rudalics@gmx.at>
7096
7097 * frame.c (Fredirect_frame_focus): In doc-string don't mention
7098 that FOCUS-FRAME can be omitted.
7099
04e9897c
DA
71002012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
7101
7102 Adjust buffer text indirection counters at the end of Fkill_buffer.
7103 * buffer.c (Fkill_buffer): Adjust indirection counters when the
7104 buffer is definitely dead. This should really fix an issue reported
7105 by Christoph Scholtes again. (Bug#12007).
7106 (init_buffer_once): Initialize indirection counters of
7107 buffer_defaults and buffer_local_symbols (for sanity and safety).
7108
8a0484e1
EZ
71092012-07-24 Eli Zaretskii <eliz@gnu.org>
7110
7111 * xdisp.c (init_iterator): Don't compute dimensions of truncation
7112 and continuation glyphs on tooltip frames, leave them at zero.
7113 Avoids continued lines in tooltips. (Bug#11832)
7114
fa691a83
DA
71152012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
7116
7117 Simplify copy_overlay.
04e9897c 7118 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
7119 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
7120
436bc8e0
EZ
71212012-07-23 Eli Zaretskii <eliz@gnu.org>
7122
7123 * print.c (print_object): Don't crash when a frame's name is nil
7124 or invalid. (Bug#12025)
7125
7126 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
7127 it signals an error when a tooltip frame is being created.
7128
d7a7fda3
DA
71292012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
7130
7131 Cleanup miscellaneous objects allocation and initialization.
7132 * alloc.c (allocate_misc): Change to static. Add argument to
7133 specify the subtype. Adjust comment and users.
7134 (build_overlay): New function.
7135 * buffer.c (copy_overlays, Fmake_overlay): Use it.
7136 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
7137 (allocate_misc): Remove prototype.
7138 (build_overlay): Add prototype.
7139
71402012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
7141
7142 Swap buffer text indirection counters in Fbuffer_swap_text.
7143 * buffer.c (Fbuffer_swap_text): Swap indirections too.
7144 This avoids crash reported by Christoph Scholtes at
7145 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
7146
9d7fa573
JD
71472012-07-22 Jan Djärv <jan.h.d@swipnet.se>
7148
7149 * nsmenu.m (Popdown_data): New struct.
7150 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
7151 free Popdown_data.
7152 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
7153 (initWithContentRect): Make imgView and contentView non-static
7154 and autorelease them. Also autorelease img and matrix (Bug#12005).
7155 (dealloc): Remove (Bug#12005).
7156
0dd6d66d
DA
71572012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7158
7159 Adjust consing_since_gc when objects are explicitly freed.
7160 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
7161 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
7162 (free_cons, free_misc): Subtract object size from consing_since_gc.
7163
d36d71df
DA
71642012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7165
7166 Simplify and cleanup markers positioning code.
7167 * marker.c (attach_marker): More useful eassert.
7168 (live_buffer, set_marker_internal): New function.
7169 (Fset_marker, set_marker_restricted): Use set_marker_internal.
7170 (set_marker_both, set_marker_restricted_both): Use live_buffer.
7171
fb9ea40f
PE
71722012-07-22 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
7175 as it's limited by the amount of memory, not by INT_MAX.
7176
2d5c5f7d
EZ
71772012-07-21 Eli Zaretskii <eliz@gnu.org>
7178
07fb592e
EZ
7179 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
7180 in special-event-map. See the discussion at
7181 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
7182 for the reasons.
7183
37a9eac8 7184 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
7185 info.dwItemData. Fixes crashes on 64-bit Windows.
7186 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 7187
c4328746
JD
71882012-07-21 Jan Djärv <jan.h.d@swipnet.se>
7189
fc0c31f8 7190 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 7191 (conversationIdentifier): Return value is NSInteger.
784051c4 7192 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 7193
6e5d1c12
CY
71942012-07-21 Chong Yidong <cyd@gnu.org>
7195
7196 * window.c (decode_any_window): Signal an error if the window is
7197 on a dead frame (Bug#11984).
7198
9928463d
DA
71992012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7200
7201 Add indirection counting to speed up Fkill_buffer.
7202 * buffer.h (struct buffer): New member.
7203 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
7204 (Fmake_indirect_buffer): Set indirection counter to -1, increment
7205 base buffer indirection counter.
7206 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
7207 (Fkill_buffer): Adjust indirection counters as needed, don't walk
7208 through buffer list if indirection counter is 0.
7209
f8643a6b
DA
72102012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7211
7212 Extend the value returned by Fgarbage_collect with heap statistics.
7213 * alloc.c (Qheap): New symbol.
7214 (syms_of_alloc): DEFSYM it.
7215 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
7216 (Fmemory_free): Remove.
7217 (syms_of_alloc): Don't defsubr it.
7218 * buffer.c (Fcompact_buffer): Remove.
7219 (syms_of_buffer): Don't defsubr it.
7220
dac616ff
DA
72212012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7222
7223 Make maybe_gc inline.
7224 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
7225 * lisp.h (consing_since_gc, gc_relative_threshold)
7226 (memory_full_cons_threshold): Revert declaration.
7227 (maybe_gc): Remove prototype, define as inline.
7228 * alloc.c: Remove old commented-out code.
7229 (consing_since_gc, gc_relative_threshold)
7230 (memory_full_cons_threshold): Revert to global.
7231 (maybe_gc): Remove.
7232
d7ea76b4
DA
72332012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7234
7235 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
7236 * lisp.h (build_unibyte_string): New function.
7237 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
7238 * sysdep.c, w32fns.c, xfns.c: Use it.
7239 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
7240 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
7241 Adjust users accordingly.
7242 * font.h (font_open_by_name): Adjust prototype.
7243
765e61e3
DA
72442012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7245
7246 Cleanup calls to Fgarbage_collect.
7247 * lisp.h (maybe_gc): New prototype.
7248 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7249 Remove declarations.
7250 * alloc.c (maybe_gc): New function.
7251 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7252 Make them static.
7253 * bytecode.c (MAYBE_GC): Use maybe_gc.
7254 * eval.c (eval_sub, Ffuncall): Likewise.
7255 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
7256 to avoid dependency from auto-save feature.
7257
52b852c7
PE
72582012-07-19 Paul Eggert <eggert@cs.ucla.edu>
7259
7260 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
7261 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
7262 'for_each_per_buffer_object_at'.
7263 All uses changed. It's better to use upper-case for macros that
7264 cannot be implemented as functions, to give the reader a clue
7265 that they're special.
7266
5db81e33
SM
72672012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7268
7269 * alloc.c (Fgarbage_collect): Tweak docstring.
7270
5b835e1d
DA
72712012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7272
7273 Tweak the value returned from Fgarbage_collect again.
7274 * alloc.c (Fgarbage_collect): New return value, as confirmed in
7275 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
7276 Adjust documentation.
7277 (total_vector_bytes): Rename to total_vector_slots, adjust
7278 accounting.
7279 (total_free_vector_bytes): Rename to total_free_vector_slots,
7280 adjust accounting.
7281 (Qstring_bytes, Qvector_slots): New symbols.
7282 (syms_of_alloc): DEFSYM them.
7283
9cd47b72
DA
72842012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7285
7286 Buffer compaction primitive which may be used from Lisp.
7287 * buffer.c (compact_buffer, Fcompact_buffer): New function.
7288 (syms_of_buffer): Register Fcompact_buffer.
7289 * alloc.c (Fgarbage_collect): Use compact_buffer.
7290 * buffer.h (compact_buffer): New prototype.
7291 (struct buffer_text): New member.
7292
d17337e5
DA
72932012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7294
7295 New macro to iterate over all buffers, miscellaneous cleanups.
7296 * lisp.h (all_buffers): Remove declaration.
7297 * buffer.h (all_buffers): Add declaration, with comment.
7298 (for_each_buffer): New macro.
7299 * alloc.c (Fgarbage_collect, mark_object): Use it.
7300 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
7301 (init_buffer): Likewise.
7302 * data.c (Fset_default): Likewise.
7303 * coding.c (code_conversion_restore): Remove redundant check
7304 for dead buffer.
7305 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
7306
60cfd278
AS
73072012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7308
7309 Fix bug that created negative-length intervals.
7310 * intervals.c (merge_interval_right, merge_interval_left):
7311 Do not zero out this interval if it is absorbed by its children,
7312 as this interval's total length doesn't change in that case. See
7313 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
7314
d06714cb
PE
73152012-07-18 Paul Eggert <eggert@cs.ucla.edu>
7316
83713154
PE
7317 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
7318 when invoking (make-bool-vector N t) and N is a positive
7319 multiple of 8 -- the last 8 bits were mistakenly cleared.
7320
d06714cb
PE
7321 Remove some struct layout assumptions in bool vectors.
7322 * alloc.c (bool_header_size): New constant.
7323 (header_size, word_size): Move earlier, as they're now used earlier.
7324 Use 'word_size' in a few more places, where it's appropriate.
7325 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
7326 padding before the data member of a bool vector.
7327 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
7328 than doing the check by hand with an abort ().
7329
464d5a5e
SM
73302012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7331
5fbc0409
SM
7332 * eval.c (Fdefvar): Don't check constants since we only set the var if
7333 it's not yet defined anyway (bug#11904).
7334
464d5a5e
SM
7335 * lisp.h (last_undo_boundary): Declare new var.
7336 * keyboard.c (command_loop_1): Set it.
7337 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
7338 were auto-added by the command loop (bug#11774).
7339
8dc2e44a
AS
73402012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7341
7342 * w32font.c (Qsymbol): Remove local definition.
7343 (syms_of_w32font): Don't DEFSYM it.
7344
169925ec
DA
73452012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7346
7347 Fix sweep_vectors to handle large bool vectors correctly.
7348 * alloc.c (sweep_vectors): Account total_vector_bytes for
7349 bool vectors larger than VBLOCK_BYTES_MAX.
7350
5fbfb018
CY
73512012-07-18 Chong Yidong <cyd@gnu.org>
7352
7353 * frame.c (x_set_frame_parameters): Revert bogus change introduced
7354 in 2012-05-25 commit by Paul Eggert (Bug#11738).
7355
3ab6e069
DA
73562012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7357
7358 Return more descriptive data from Fgarbage_collect.
7359 Suggested by Stefan Monnier in
7360 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
7361 * alloc.c (bounded_number): New function.
7362 (total_buffers, total_vectors): New variable.
7363 (total_string_size): Rename to total_string_bytes, adjust users.
7364 (total_vector_size): Rename to total_vector_bytes, adjust users.
7365 (sweep_vectors): Account total_vectors and total_vector_bytes.
7366 (Fgarbage_collect): New return value. Adjust documentation.
7367 (gc_sweep): Account total_buffers.
7368 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
7369 (VECTOR_SIZE): Remove.
7370 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
7371 (Qinterval, Qmisc): New symbols.
7372 (syms_of_data): Initialize them.
7373 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
7374 (Qcons, Qbuffer): New declarations.
7375
6d02fe5b
PE
73762012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7377
7378 * alloc.c (Fmemory_free): Account for memory-free's own storage.
7379 Round up, not down. Improve doc.
7380
b7ffe040
DA
73812012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7382
7383 Restore old code in allocate_string_data to avoid Faset breakage.
7384 Reported by Julien Danjou <julien@danjou.info> in
7385 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
7386 * alloc.c (allocate_string_data): Restore old code with minor
7387 adjustments, fix comment to explain this subtle issue.
7388
4dc7c8d5
SM
73892012-07-17 Eli Zaretskii <eliz@gnu.org>
7390
7391 Remove FILE_SYSTEM_CASE.
7392 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
7393
7394 * fileio.c (FILE_SYSTEM_CASE): Don't define.
7395 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
7396 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
7397 call-process-region passes it through expand-file-name.
7398
7399 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
7400
74012012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7402
7403 Fix crash when creating indirect buffer (Bug#11917)
7404 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7405 Don't handle unbound variables specially if non-zero.
7406 (Fbuffer_local_variables): Pass zero.
7407 (clone_per_buffer_values): Pass non-zero.
7408
74092012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7410
7411 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7412 to make the loop interruptible.
7413
74142012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7415
7416 * gnutls.c (emacs_gnutls_handshake): Only retry if
7417 GNUTLS_E_INTERRUPTED.
7418
cce7fefc
DA
74192012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7420
7421 Cleanup and convert miscellaneous checks to eassert.
7422 * alloc.c (mark_interval): Fix comment, partially rephrase
7423 old comment from intervals.h (see below).
7424 * intervals.c (find_interval, adjust_intervals_for_insertion)
7425 (delete_interval, adjust_intervals_for_deletion)
7426 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7427 Convert to eassert.
7428 (adjust_intervals_for_insertion, make_new_interval):
7429 Remove obsolete and unused code.
7430 * intervals.h (struct interval): Remove obsolete comment.
7431 * textprotp.c (erase_properties): Remove unused code.
7432 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7433 (Fremove_list_of_text_properties): Convert to eassert.
7434
9ea10cc3
CY
74352012-07-17 Chong Yidong <cyd@gnu.org>
7436
7437 * editfns.c (Finsert_char): Doc fix.
7438
3900d5de
DA
74392012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7440
7441 Fix previous change to make Fmemory_free always accurate.
7442 * alloc.c (make_interval): Update total_free_intervals.
7443 (make_float): Likewise for total_free_floats.
7444 (free_cons, Fcons): Likewise for total_free_conses.
7445 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7446 Likewise for total_free_vector_bytes.
7447 (Fmake_symbol): Likewise for total_free_symbols.
7448 (bytes_free): Remove.
7449
7098646f
DA
74502012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7451
7452 Simple free memory accounting feature.
7453 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7454 (sweep_vectors): Accumulate size of free vectors.
7455 (Fgarbage_collect): Setup bytes_free.
7456 (Fmemory_free): New function.
7457 (syms_of_alloc): Register it.
7458
22657b40
DA
74592012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7460
7461 Cleanup overlays checking.
7462 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7463 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7464 eassert and OVERLAYP.
7465 (sort_overlays): Change to use OVERLAYP.
7466
ddfc8813
RK
74672012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7468
7469 * editfns.c (Finsert_char): Make it interactive, and make the
7470 second arg optional. Copy interactive spec and docstring from
7471 ucs-insert.
7472
7c26cf3c
PE
74732012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7474
7475 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7476 Unlike the other wrapped functions, fabs has an unspecified
7477 effect on errno.
7478
5d127af9
JD
74792012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7480
7481 * nsterm.m (keyDown): Interpret flags without left/right bits
7482 as the left key (Bug#11670).
7483
6a0dd1d7
DA
74842012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7485
7486 Remove empty and useless init functions.
7487 * lisp.h (init_character_once, init_fns, init_image)
7488 (init_filelock, init_sound): Remove prototype.
7489 * character.c (init_character_once): Remove.
7490 * filelock.c (init_filelock): Likewise.
7491 * fns.c (init_fns): Likewise.
7492 * image.c (init_image): Likewise.
7493 * sound.c (init_sound): Likewise.
7494 * emacs.c (main): Adjust accordingly.
7495
7a6136fd
DA
74962012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7497
7498 * gtkutil.h: Tiny cleanups.
7499 (use_old_gtk_file_dialog): Remove useless declaration.
7500 (xg_uses_old_file_dialog): Add suggested const attribute.
7501
ce811ad9
EZ
75022012-07-15 Eli Zaretskii <eliz@gnu.org>
7503
7504 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7505 (bidi_paragraph_init): Use it to limit search forward for a strong
7506 directional character in abnormally large paragraphs full of
7507 neutral or weak characters. (Bug#11943)
7508
c9adfeaa
SF
75092012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7510
7511 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7512 the toolbar (Bug#9451).
7513 (xg_make_tool_item): Give the widget event box a transparent
7514 background.
7515
fff62aa9
DA
75162012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7517
7518 Cleanup basic allocation variables and functions.
7519 * alloc.c (ignore_warnings, init_intervals, init_float)
7520 (init_cons, init_symbol, init_marker): Remove.
7521 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7522 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7523 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7524 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7525 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7526 (staticidx, init_alloc_once, init_strings, free_ablock):
7527 Remove redundant initialization.
7528 * fns.c (init_weak_hash_tables): Remove.
7529 * lisp.h (init_weak_hash_tables): Remove prototype.
7530
9730daca
DA
75312012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7532
7533 Use zero_vector where appropriate.
7534 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7535 accordingly.
7536 * lisp.h (zero_vector): New declaration.
7537 * font.c (null_vector): Remove.
7538 (syms_of_font): Remove initialization and staticpro.
7539 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7540 * keymap.c (Faccessible_keymaps): Likewise.
7541
2e2d2a13
LL
75422012-07-15 Leo Liu <sdl.web@gmail.com>
7543
7544 * fringe.c: Fix typo in comments.
7545
cd276f6e
LL
75462012-07-14 Leo Liu <sdl.web@gmail.com>
7547
7548 * fringe.c: Add a new bitmap exclamation-mark.
7549
5a1131d9
EZ
75502012-07-14 Eli Zaretskii <eliz@gnu.org>
7551
7552 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7553
7554 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7555 (HAVE_MENUS): Don't define, defined by editing config.in with
7556 msdos/sed2v2.inp.
7557 (GMALLOC_INHIBIT_VALLOC): Don't define.
7558 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7559
22e983b7
JB
75602012-07-14 Juanma Barranquero <lekktu@gmail.com>
7561
7562 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7563
5b3f250f
GM
75642012-07-14 Glenn Morris <rgm@gnu.org>
7565
7566 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7567 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7568 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7569
33d63ff4
GM
75702012-07-13 Glenn Morris <rgm@gnu.org>
7571
5b633342
GM
7572 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7573
33d63ff4
GM
7574 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7575 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7576
b55b9f85
JD
75772012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7578
0dc8cf50
JD
7579 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7580 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7581 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7582 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7583 where appropriate.
7584 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7585 as boolean expression.
7586 (x_set_window_size): Remove unused variable toolbar.
7587 (ns_get_color_default, ns_mod_to_lisp): Remove.
7588 (ns_mouse_position): Remove unused variables xchar and ychar.
7589 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7590 (ns_set_vertical_scroll_bar): Remove unused variable count.
7591 (ns_delete_terminal): Remove unused variable i.
7592 (ns_term_init): Remove unused variables r, g and b.
7593 (mouseDown): Remove unused variable window.
7594 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7595 (initFrameFromEmacs): Remove unused variable vbextra.
7596 (mouseEntered): Remove unused variables p and dpyinfo.
7597 (mouseExited): Remove unused variables p and r.
7598 (ns_define_frame_cursor, ns_clear_frame_area)
7599 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7600 (menuDown): Assign [sender tag] to variable and cast the variable.
7601
7602 * nsterm.h (menuDown): Add id as type to argument sender.
7603 (ns_display_info_for_name): Add Lisp_Object argument.
7604 (ns_term_init): Add Lisp_Object argument.
7605 (ns_map_event_to_object): Add void argument.
7606 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7607 prototype with arguments and only declare if __OBJC__.
7608 (nxatoms_of_nsselect): Add void argument.
7609 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7610 (ns_alloc_autorelease_pool): Add void argument.
7611 (ns_release_autorelease_pool): Add void* argument.
7612 (ns_get_defaults_value): Add const char* argument.
7613
7614 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7615 (initFromContents): Use SSDATA where appropriate.
7616 (ns_update_menubar): Add braces to ambigous if-else.
7617 (initWithTitle): Put () around assignment in if statement.
7618 (ns_menu_show): Remove unused variables window and keymap.
7619 (update_frame_tool_bar): Remove unused variable selected_p.
7620 (initWithContentRect): Remove unused variable this_cmd_name.
7621
7622 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7623 appropriate.
7624 (setXBMColor): Remove unused variable len.
7625 (setPixmapData): Put () around assignment in loop statement.
7626
7627 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7628 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7629 where appropriate.
7630 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7631 around assignment in loop statement.
7632 (nsfont_open): Remove unused variable i.
7633 (nsfont_open): Remove unused variable len.
7634 (nsfont_draw): Remove unused variable cs.
7635
7636 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7637 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7638 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7639 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7640 (Fns_font_name, Fns_perform_service)
7641 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7642 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7643 (ns_set_name): Remove unused variable view.
7644 (x_set_menu_bar_lines): Remove unused variable olines.
7645 (x_set_tool_bar_lines): Remove unused variable root_window.
7646 (Fns_list_colors): Put () around assignment in while statement.
7647 (Fns_perform_service): Remove unused variable len.
7648 (Fns_display_usable_bounds): Remove unused variable top.
7649 (syms_of_nsfns): Remove unused variable i.
7650
b55b9f85
JD
7651 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7652 memcpy (Bug#11907).
7653
ed9265fc 76542012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
7655
7656 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7657 and free it with DestroyExceptionInfo (Bug#11558).
7658
ef099b57
JB
76592012-07-13 Juanma Barranquero <lekktu@gmail.com>
7660
7661 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7662 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7663 Set here, not in nt/config.nt.
7664
ea814a5d
EZ
76652012-07-13 Eli Zaretskii <eliz@gnu.org>
7666
7667 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7668 cursor overflow into the last glyph on display line when the right
7669 fringe is off. (Bug#11832)
7670
1a952767
PE
76712012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7672
7673 * xdisp.c (produce_special_glyphs): Now static.
7674 * dispextern.h (produce_special_glyphs): Remove decl.
7675
983188fd
GM
76762012-07-13 Glenn Morris <rgm@gnu.org>
7677
8d7c7eed 7678 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
7679 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7680
983188fd
GM
7681 * s/usg5-4-common.h (USG, USG5):
7682 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7683 * s/sol2-6.h (SOLARIS2):
7684 * s/irix6-5.h (IRIX6_5):
7685 * s/hpux10-20.h (USG, USG5, HPUX):
7686 * s/gnu-linux.h (USG, GNU_LINUX):
7687 * s/freebsd.h (BSD_SYSTEM):
7688 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7689 * s/cygwin.h (CYGWIN):
7690 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7691 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7692
d1e68667 76932012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
7694
7695 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 7696
6de0e799
GM
76972012-07-13 Glenn Morris <rgm@gnu.org>
7698
739ae010
GM
7699 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7700
dbee5793
GM
7701 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7702
6de0e799
GM
7703 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7704 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7705
b82da769
GM
77062012-07-12 Glenn Morris <rgm@gnu.org>
7707
4fae5a7a 7708 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
7709
7710 * process.c (init_process_emacs): Rename from init_process.
7711 The old name is also the name of a Mach system call.
7712 * lisp.h, emacs.c: Update for this name change.
7713 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7714 longer needed.
7715
5a979817
EZ
77162012-07-12 Eli Zaretskii <eliz@gnu.org>
7717
7718 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7719 memmove call that removes glyphs covered by the left truncation
7720 glyph. Improve commentary.
7721 (display_line): Fix display of continuation glyphs on GUI frames
7722 when the right fringe is turned off and variable-size fonts are
7723 used in the window. Move the code that appends a stretch glyph to
7724 produce_special_glyphs, so that it could be used for truncation
7725 and continuation glyphs alike.
7726 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7727 glyph of a suitably computed width, to align the special glyphs at
7728 the window margin. Code moved from display_line. (Bug#11832)
7729
3e91a053
GM
77302012-07-12 Glenn Morris <rgm@gnu.org>
7731
ba9e4b84
GM
7732 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7733
7734 * s/gnu-linux.h, s/hpux10-20.h:
7735 Do not unconditionally define HAVE_XRMSETDATABASE.
7736
3e91a053
GM
7737 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7738
b300b1f4
PE
77392012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7740
7741 Fix typos that broke OS X build.
7742 Reported by Randal L. Schwartz in
7743 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7744 * nsterm.m (ns_timeout): Add missing local decl.
7745 (ns_get_color): snprintf -> sprintf, to fix typo.
7746
6e777848
GM
77472012-07-12 Glenn Morris <rgm@gnu.org>
7748
3f922c37
GM
7749 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7750 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7751 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7752 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7753
0ab7b23a
GM
7754 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7755 Move PTY_OPEN to configure.
7756
6e777848
GM
7757 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7758 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7759 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7760
4a7edc24
DA
77612012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7762
7763 Use empty_unibyte_string where applicable.
7764 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7765 * lread.c (read1): Likewise.
7766 * xsettings.c (syms_of_xsettings): Likewise.
7767
308aab79
GM
77682012-07-12 Glenn Morris <rgm@gnu.org>
7769
42bd1719
GM
7770 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7771 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
7772 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7773 * s/hpux10-20.h (RUN_TIME_REMAP):
7774 * s/bsd-common.h (TABDLY): Move to configure.
7775
7776 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7777
7778 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7779
ea0bbd17 7780 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 7781 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
7782
7783 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 7784
308aab79
GM
7785 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7786 * s/template.h: Move NARROWPROTO to configure.
7787
ee1cf5cf
GM
77882012-07-11 Glenn Morris <rgm@gnu.org>
7789
30fe9bf4
GM
7790 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7791 unused since 2011-01-17 change to systty.h.
7792
ee1cf5cf
GM
7793 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7794 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7795 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7796
63e47e07
PE
77972012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7798
7799 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7800
c43fb4c3
GM
78012012-07-11 Glenn Morris <rgm@gnu.org>
7802
7803 * s/darwin.h, s/gnu-linux.h, s/template.h:
7804 Move INTERRUPT_INPUT to configure.
7805
e8df9267
DA
78062012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7807
7808 Minor adjustments to interning code.
7809 * lisp.h (intern, intern_c_string): Redefine as static inline
7810 wrappers for intern_1 and intern_c_string_1, respectively.
7811 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
7812 * lread.c (intern_1, intern_c_string_1, oblookup):
7813 Simplify Vobarray checking.
e8df9267
DA
7814 * font.c (font_intern_prop): Likewise. Adjust comment.
7815 * w32font.c (intern_font_name): Likewise.
7816
34348bd4
AS
78172012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7818
d96a1e0c
AS
7819 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7820
34348bd4
AS
7821 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7822 of Fcar/Fcdr if possible.
7823 * font.c (check_otf_features): Likewise.
7824 * fontset.c (Fnew_fontset): Likewise.
7825 * gnutls.c (Fgnutls_boot): Likewise.
7826 * minibuf.c (read_minibuf): Likewise.
7827 * msdos.c (IT_set_frame_parameters): Likewise.
7828 * xmenu.c (Fx_popup_dialog): Likewise.
7829 * w32menu.c (Fx_popup_dialog): Likewise.
7830
c8add24e
GM
78312012-07-11 Glenn Morris <rgm@gnu.org>
7832
4b575b3c
GM
7833 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7834 since nothing has defined it on these platforms.
7835
09f4e3b0
GM
7836 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7837 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7838
172bedef
GM
7839 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7840 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7841 Move CLASH_DETECTION to configure.
7842
249685df
GM
7843 * s/gnu.h: Remove file, which is now empty.
7844
c8add24e
GM
7845 * s/gnu.h, s/gnu-linux.h:
7846 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7847
b41253a3
JW
78482012-07-11 John Wiegley <johnw@newartisans.com>
7849
7850 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7851 function attribute, so we only use it if it exists in the
7852 compiler.
7853
d923b542
DA
78542012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7855
7856 Avoid call to strlen in fast_c_string_match_ignore_case.
7857 * search.c (fast_c_string_match_ignore_case): Change to use
7858 length argument. Adjust users accordingly.
7859 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7860
5ebbef1d
PE
78612012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7862
bb352260
PE
7863 Assume mkdir, rmdir.
7864 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7865 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7866
57054ddd
PE
7867 Assume rename.
7868 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7869
b747d3f7
PE
7870 Assume perror.
7871 * s/hpux10-20.h (HAVE_PERROR): Remove.
7872 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7873 Remove dummy definition, as this problem was obsolete long ago.
7874
5ebbef1d
PE
7875 Assume strerror.
7876 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7877
984e7f30
DA
78782012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7879
7880 Avoid calls to strlen in font processing functions.
7881 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
7882 (font_open_by_name): Change to use length argument.
7883 Adjust users accordingly.
d923b542
DA
7884 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7885 Adjust prototypes.
7886 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7887 Change to return ptrdiff_t.
984e7f30
DA
7888 (xfont_list_pattern, xfont_match): Use length returned by
7889 xfont_decode_coding_xlfd.
7890 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7891
20e94fdd
GM
78922012-07-11 Glenn Morris <rgm@gnu.org>
7893
9d596af3
GM
7894 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7895 Move DONT_REOPEN_PTY to configure.
7896
20e94fdd
GM
7897 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7898 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7899
e99a530f
PE
79002012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7901
22ffb973
PE
7902 Remove "#define unix" that is no longer needed (Bug#11905).
7903 * s/aix4-2.h (unix): Remove; no longer needed.
7904
e9a9ae03
PE
7905 EMACS_TIME simplification (Bug#11875).
7906 This replaces macros (which typically do not work in GDB)
7907 with functions, typedefs and enums, making the code easier to debug.
7908 The functional style also makes code easier to read and maintain.
7909 * systime.h: Include <sys/time.h> on all hosts, not just if
7910 WINDOWSNT, since 'struct timeval' is needed in general.
7911 (EMACS_TIME): Now a typedef, not a macro.
7912 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7913 not macros.
7914 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7915 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7916 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7917 (EMACS_TIME_LE): Now functions, not macros.
7918 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7919 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7920 which are not functions. All uses rewritten to use:
7921 (make_emacs_time): New function.
7922 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7923 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7924 not functions. All uses rewritten to use the following, respectively:
7925 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7926 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 7927 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
7928 * fileio.c (Fcopy_file):
7929 * xterm.c (XTflash): Get the current time closer to when it's used.
7930 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7931
ffacb126
PE
7932 * bytecode.c (targets): Suppress -Woverride-init warnings.
7933
e99a530f
PE
7934 Simplify by avoiding confusing use of strncpy etc.
7935 * doc.c (Fsnarf_documentation):
7936 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7937 * frame.c (Fmake_terminal_frame):
7938 * gtkutil.c (get_utf8_string):
7939 * lread.c (openp):
7940 * nsmenu.m (ns_update_menubar):
7941 * regex.c (regerror):
7942 Prefer memcpy to strncpy and strncat when either will do.
7943 * fileio.c (Fsubstitute_in_file_name):
7944 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7945 (menu_separator_name_p):
7946 * nsmenu.m (ns_update_menubar):
7947 Prefer memcmp to strncmp when either will do.
7948 * nsterm.m: Include <ftoastr.h>.
7949 (ns_get_color):
7950 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7951 Prefer snprintf to strncpy.
7952 * nsterm.m (ns_term_init):
7953 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7954 * nsterm.m (ns_term_init):
7955 Avoid the need for strncpy, by using build_string or
7956 make_unibyte_string directly. Use dtoastr, not snprintf.
7957 * process.c (Fmake_network_process): Diagnose service names that
7958 are too long, rather than silently truncating them or creating
7959 non-null-terminated names.
7960 (Fnetwork_interface_info): Likewise, for interface names.
7961 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7962 Prefer sprintf to strncat.
7963 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7964 Prefer vsnprintf to vsprintf + strncpy.
7965
c59592b3
GM
79662012-07-10 Glenn Morris <rgm@gnu.org>
7967
7968 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7969 Clarify fallback case.
7970
7d7bbefd
DA
79712012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7972
7973 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7974 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7975 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 7976 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
7977 where argument type is known to be a Lisp_Cons.
7978
3a4c8000
TT
79792012-07-10 Tom Tromey <tromey@redhat.com>
7980
7981 * bytecode.c (BYTE_CODE_THREADED): New macro.
7982 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7983 (enum byte_code_op): New type.
7984 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7985 (exec_byte_code): Use them. Use token threading when applicable.
7986
2a0213a6
DA
79872012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7988
7989 Optimize pure C strings initialization.
7990 * lisp.h (make_pure_string): Fix prototype.
7991 (build_pure_c_string): New function, defined as static inline. This
7992 provides a better opportunity to optimize away calls to strlen when
7993 the function is called with compile-time constant argument.
7994 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7995 argument, adjust users accordingly. Use build_pure_c_string where
7996 appropriate.
7997 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7998 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7999 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
8000
cb1caeaf
DA
80012012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8002
8003 Avoid calls to strlen in miscellaneous functions.
8004 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
8005 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
8006 * lread.c (openp): Likewise.
8007
c293e30c
DA
80082012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
8009
8010 Avoid calls to strlen in path processing functions.
8011 * fileio.c (file_name_as_directory): Add comment. Change to add
8012 srclen argument and return the length of result. Adjust users
8013 accordingly.
8014 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
8015 swap 1st and 2nd arguments to obey the common convention.
8016 Adjust users accordingly.
c293e30c
DA
8017 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
8018
9e059e3f
GM
80192012-07-10 Glenn Morris <rgm@gnu.org>
8020
d02eb359
GM
8021 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
8022 Move PENDING_OUTPUT_COUNT definition to configure.
8023
882cf227
GM
8024 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
8025 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
8026 * s/gnu.h (DATA_START): Move definitions to configure.
8027
af6e839f
GM
8028 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
8029 We include usg5-4-common.h, which defines them both.
8030
40289a12
GM
8031 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
8032 O_RDONLY already includes it).
8033
9e059e3f
GM
8034 Stop ns builds setting the EMACSLOADPATH environment variable.
8035 * nsterm.m (ns_load_path): Rename from ns_init_paths.
8036 Now it does not set EMACSLOADPATH, just returns the load-path string.
8037 * nsterm.h: Update accordingly.
8038 * lread.c [HAVE_NS]: Include nsterm.h.
8039 (init_lread) [HAVE_NS]: Use ns_load_path.
8040 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
8041
7c4e8ec0
GM
80422012-07-09 Glenn Morris <rgm@gnu.org>
8043
d4f600ff
GM
8044 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
8045 since the included bsd-common.h does so.
8046
cbb31951
GM
8047 Stop ns builds setting the EMACSPATH environment variable.
8048 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
8049 (ns_init_paths): Do not set EMACSPATH.
8050 * nsterm.h (ns_exec_path): Add it.
8051 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
8052 Use ns_exec_path.
8053
7c4e8ec0
GM
8054 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
8055
26bccfae
PE
80562012-07-09 Paul Eggert <eggert@cs.ucla.edu>
8057
a0bee46f
PE
8058 * process.c (wait_reading_process_output): 'waitchannels' was unset
8059 when read_kbd || !NILP (wait_for_cell); fix this.
8060
5994c183
PE
8061 Add GCC-style 'const' attribute to functions that can use it.
8062 * character.h (char_resolve_modifier_mask):
8063 * keyboard.h (make_ctrl_char):
8064 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
8065 (init_character_once, next_almost_prime, init_fns, init_image)
8066 (flush_pending_output, init_sound):
8067 * mem-limits.h (start_of_data):
8068 * menu.h (finish_menu_items):
8069 Add ATTRIBUTE_CONST.
8070 * emacs.c (DEFINE_DUMMY_FUNCTION):
8071 Declare the dummy function with ATTRIBUTE_CONST.
8072 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
8073 Add decls with ATTRIBUTE_CONST.
8074
26bccfae
PE
8075 Minor improvements to make_formatted_string.
8076 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
8077 where int is good enough, as vsprintf returns an int.
8078 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
8079
a8290ec3
DA
80802012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8081
8082 Use make_formatted_string to avoid double length calculation.
8083 * lisp.h (make_formatted_string): New prototype.
8084 * alloc.c (make_formatted_string): New function.
8085 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 8086 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
8087 * editfns.c (Fcurrent_time_zone): Likewise.
8088 * filelock.c (get_boot_time): Likewise.
8089 * frame.c (make_terminal_frame, set_term_frame_name)
8090 (x_report_frame_params): Likewise.
8091 * image.c (gs_load): Likewise.
8092 * minibuf.c (get_minibuffer): Likewise.
8093 * msdos.c (dos_set_window_size): Likewise.
8094 * process.c (make_process): Likewise.
8095 * xdisp.c (ensure_echo_area_buffers): Likewise.
8096 * xsettings.c (apply_xft_settings): Likewise.
8097
d01ba2f1
GM
80982012-07-09 Glenn Morris <rgm@gnu.org>
8099
8100 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
8101 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
8102 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
8103 * nsterm.h (ns_etc_directory): Add it.
8104 * callproc.c [HAVE_NS]: Include nsterm.h.
8105 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
8106
f1f924b6
DA
81072012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
8108
8109 Move marker debugging code under MARKER_DEBUG.
8110 * marker.c (MARKER_DEBUG): Move marker debugging code under
8111 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
8112 for bootstrap with --enable-checking (~3x slowdown reported
8113 by Juanma Barranquero <lekktu@gmail.com>).
8114 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
8115
ab531b66
PE
81162012-07-08 Paul Eggert <eggert@cs.ucla.edu>
8117
8118 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
8119 See <http://bugs.gnu.org/11825#29>.
8120
c4b3bc8a
EZ
81212012-07-08 Eli Zaretskii <eliz@gnu.org>
8122
8123 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
8124 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
8125 (display_line): Add commentary about displaying truncation glyphs
8126 on GUI frames.
8127 (produce_special_glyphs): Move here from term.c.
8128
8129 * term.c (produce_special_glyphs): Move to xdisp.c.
8130
8131 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
8132 section.
c4b3bc8a 8133
b676b881
AS
81342012-07-07 Andreas Schwab <schwab@linux-m68k.org>
8135
f17c5273
AS
8136 * xdisp.c (display_line): Avoid warning about implicit declaration
8137 of FRAME_FONT.
8138
298819b9
AS
8139 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
8140
b676b881
AS
8141 * lisp.h: Remove empty conditional.
8142
6045c4fd
PE
81432012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8144
b3350bf9
PE
8145 * lread.c (load_path_check): Now static.
8146
6045c4fd
PE
8147 Fix some minor --with-ns problems found by static checking.
8148 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
8149 (x_set_font) [!HAVE_X_WINDOWS]:
8150 * image.c (xpm_load_image) [HAVE_NS]:
8151 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
8152 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
8153 Remove unused local.
8154 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
8155 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
8156 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
8157 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
8158 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
8159 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
8160 Fix pointer signedness problem.
8161 * xfaces.c (FRAME_X_FONT_TABLE):
8162 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
8163
929e7845
GM
81642012-07-07 Glenn Morris <rgm@gnu.org>
8165
8166 * lread.c (load_path_check): New function, split from init_lread.
8167 (init_lread): Reorganize. Motivation:
8168 If EMACSLOADPATH is set, check/warn about that rather than the
8169 defaults, which we are not going to use. Hence we can remove
8170 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
8171 Don't warn if site-lisp directories are missing.
8172 If not installed, start from a blank load-path, since
8173 PATH_LOADSEARCH refers to the eventual installation directories.
8174
58dd0aa4
EZ
81752012-07-07 Eli Zaretskii <eliz@gnu.org>
8176
8177 Support truncation and continuation glyphs on GUI frames, when
8178 fringes are disabled. (Bug#11832)
8179 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
8180 continuation glyphs even if on GUI frames.
8181 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
8182 or both, are absent.
8183 (start_display, move_it_in_display_line_to): Handle the case of a
8184 GUI frame without a fringe to display continuation or truncation
8185 glyphs.
8186 (insert_left_trunc_glyphs): Support GUI frames: make sure
8187 truncation glyphs overwrite enough glyphs from the current line to
8188 have sufficient space in pixels.
8189 (display_line): Support truncation and continuation glyphs on GUI
8190 frames. If some spare pixels are left on the line after inserting
8191 the truncation glyphs, fill that space with a stretch glyph of a
8192 suitably computed width.
8193
8194 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
8195 produce_glyphs, to support GUI sessions.
8196
31571fd7
PE
81972012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8198
5a16b9bc
PE
8199 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
8200
f3047c75
PE
8201 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
8202
31571fd7
PE
8203 Do not require float-time's arg to fit in time_t (Bug#11825).
8204 This works better on hosts where time_t is unsigned, and where
8205 float-time is applied to the (negative) difference between two times.
8206 * editfns.c (decode_time_components): Last arg is now double *,
8207 not int *, and means to store all the result as a double, without
8208 worrying about whether the seconds part fits in time_t.
8209 All callers changed.
8210 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
8211 All callers changed.
8212 (Ffloat_time): Do not fail merely because the specified time falls
8213 outside of time_t range.
8214
4516fbef
GM
82152012-07-07 Glenn Morris <rgm@gnu.org>
8216
8217 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
8218 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
8219 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
8220
07adc2c6
JB
82212012-07-07 Juanma Barranquero <lekktu@gmail.com>
8222
8223 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
8224 Update dependencies.
8225
8226 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
8227
fd573f31
PE
82282012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8229
fee5959d
PE
8230 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
8231 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
8232 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
8233 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
8234 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
8235 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
8236
fd573f31
PE
8237 * xfont.c (compare_font_names): Redo to omit the need for casts.
8238
ddadbc0e
AS
82392012-07-06 Andreas Schwab <schwab@linux-m68k.org>
8240
fca8d6b6
AS
8241 * xfns.c (Fx_change_window_property): Doc fix.
8242 * w32fns.c (Fx_change_window_property): Doc fix.
8243
ddadbc0e
AS
8244 * w32fns.c (Fx_window_property): Accept the same arguments as the
8245 X Windows version. Doc fix.
8246 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
8247
ed9265fc 82482012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
8249 Eli Zaretskii <eliz@gnu.org>
8250
8251 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
8252 Windows-specific code from nt/config.nt moved here.
8253 Obsolete settings removed.
8254
216ee680
PE
82552012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8256
8257 * process.c: Avoid unnecessary calls to gettime.
8258 (wait_reading_process_output): Don't get the time of day
8259 when gobbling data immediately and not waiting, as there's no need
8260 for it in that case. This removes a FIXME.
8261
bdd091e4
JD
82622012-07-06 Jan Djärv <jan.h.d@swipnet.se>
8263
8264 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
8265 is defined (Bug#11768).
8266
9d44f8ce
DA
82672012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8268
8269 Fix marker debugging code.
8270 * marker.c (byte_char_debug_check): Do not perform the check
8271 if buffer is not multibyte.
090bd7cb
JB
8272 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8273 Call byte_char_debug_check with correct arguments.
9d44f8ce 8274
90fc4786
DA
82752012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8276
8277 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
8278 * marker.c (byte_char_debug_check, count_markers):
8279 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
8280 (byte_debug_flag): Remove.
8281 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8282 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
8283
7b7ae965
DA
82842012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8285
4e57b342
DA
8286 Avoid code repetition in marker-related functions.
8287 * marker.c (attach_marker): New function.
8288 (Fset_marker, set_marker_restricted, set_marker_both)
8289 (set_marker_restricted_both): Use it.
8290 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
8291 Consistently rename charno to charpos.
8292 (marker_position): Add eassert.
8293 (marker_byte_position): Convert to eassert.
8294
82952012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8296
8297 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 8298 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 8299 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 8300
657924ff
DA
83012012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8302
8303 Introduce fast path for the widely used marker operation.
8304 * alloc.c (build_marker): New function.
8305 * lisp.h (build_marker): New prototype.
8306 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
8307 * composite.c (autocmp_chars): Likewise.
8308 * editfns.c (buildmark): Remove.
8309 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
8310 (save_restriction_save): Use build_marker.
8311 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
8312 * window.c (save_window_save): Likewise.
8313
041a49a6
DA
83142012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8315
8316 Do not use Fdelete_overlay in delete_all_overlays
8317 to avoid redundant calls to unchain_overlay.
8318 * buffer.c (drop_overlay): New function.
8319 (delete_all_overlays, Fdelete_overlay): Use it.
8320 * minibuf.c (get_minibuffer): Fix comment.
8321
7dca65a4
PE
83222012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8323
8324 Port to OpenBSD 5.1 amd64.
8325 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
8326 This is needed for OpenBSD, and should be harmless on all BSD systems.
8327 Also, include <sys/sysctl.h>, as it should be available on all
8328 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8329 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
8330 use p_pid member, not kp_proc.pid.
8331
8eb876e2
GM
83322012-07-06 Glenn Morris <rgm@gnu.org>
8333
8334 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
8335
38182d90
PE
83362012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8337
8338 More xmalloc and related cleanup.
8339 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
8340 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
8341 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
8342 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
8343 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
8344 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
8345 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
8346 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
8347 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
8348 * xterm.c:
8349 Omit needless casts involving void * pointers and allocation.
8350 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
8351 as the former is more robust if P's type is changed.
8352 Prefer xzalloc to xmalloc + memset 0.
8353 Simplify malloc-or-realloc to realloc.
8354 Don't worry about xmalloc returning a null pointer.
8355 Prefer xstrdup to xmalloc + strcpy.
8356 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
8357 growing it.
8358 * keyboard.c (apply_modifiers_uncached): Prefer local array to
8359 alloca of a constant.
8360
6dd5a677
EZ
83612012-07-05 Eli Zaretskii <eliz@gnu.org>
8362
8363 * xdisp.c (display_line): Fix horizontal pixel coordinates when
8364 hscroll is larger than the line width. Fixes long and futile
8365 looping inside extend_face_to_end_of_line (on a TTY) producing
8366 glyphs that are not needed and thrown away.
8367
6b312f0f
DA
83682012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8369
8370 * marker.c (set_marker_restricted_both): Simplify by using
8371 clip_to_bounds.
8372
f520ef9b
PE
83732012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8374
8375 * editfns.c (region_limit): Simplify by using clip_to_bounds.
8376
383b7c95
JD
83772012-07-05 Jan Djärv <jan.h.d@swipnet.se>
8378
8379 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
8380 not defined (Bug#11768).
8381 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
8382 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
8383 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
8384 followed by gtk_box_set_homogeneous (Bug#11768).
8385 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
8386 (update_theme_scrollbar_width, xg_create_scroll_bar):
8387 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
8388 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
8389 (is_box_type): New function (Bug#11768).
8390 (xg_tool_item_stale_p): Call is_box_type.
5293d758 8391 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
8392 with default display (Bug#11768).
8393
d6e7bf45
EZ
83942012-07-05 Eli Zaretskii <eliz@gnu.org>
8395
8396 * xdisp.c (window_hscroll_limited): New function.
8397 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
8398 coordinates when window's hscroll is set to insanely large
8399 values. (Bug#11857)
8400
431391ec
JB
84012012-07-05 Juanma Barranquero <lekktu@gmail.com>
8402
8403 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8404 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8405
23f86fce
DA
84062012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8407
8408 Cleanup xmalloc.
8409 * lisp.h (xzalloc): New prototype. Omit needless casts.
8410 * alloc.c (xzalloc): New function. Omit needless casts.
8411 * charset.c: Omit needless casts. Convert all calls to
8412 xmalloc with following memset to xzalloc.
8413 * dispnew.c: Likewise.
8414 * fringe.c: Likewise.
8415 * image.c: Likewise.
8416 * sound.c: Likewise.
8417 * term.c: Likewise.
8418 * w32fns.c: Likewise.
8419 * w32font.c: Likewise.
8420 * w32term.c: Likewise.
8421 * xfaces.c: Likewise.
8422 * xfns.c: Likewise.
8423 * xterm.c: Likewise.
8424 * atimer.c: Omit needless casts.
8425 * buffer.c: Likewise.
8426 * callproc.c: Likewise.
8427 * ccl.c: Likewise.
8428 * coding.c: Likewise.
8429 * composite.c: Likewise.
8430 * doc.c: Likewise.
8431 * doprnt.c: Likewise.
8432 * editfns.c: Likewise.
8433 * emacs.c: Likewise.
8434 * eval.c: Likewise.
8435 * filelock.c: Likewise.
8436 * fns.c: Likewise.
8437 * gtkutil.c: Likewise.
8438 * keyboard.c: Likewise.
8439 * lisp.h: Likewise.
8440 * lread.c: Likewise.
8441 * minibuf.c: Likewise.
8442 * msdos.c: Likewise.
8443 * print.c: Likewise.
8444 * process.c: Likewise.
8445 * region-cache.c: Likewise.
8446 * search.c: Likewise.
8447 * sysdep.c: Likewise.
8448 * termcap.c: Likewise.
8449 * terminal.c: Likewise.
8450 * tparam.c: Likewise.
8451 * w16select.c: Likewise.
8452 * w32.c: Likewise.
8453 * w32reg.c: Likewise.
8454 * w32select.c: Likewise.
8455 * w32uniscribe.c: Likewise.
8456 * widget.c: Likewise.
8457 * xdisp.c: Likewise.
8458 * xmenu.c: Likewise.
8459 * xrdb.c: Likewise.
8460 * xselect.c: Likewise.
8461
0497dc44
PE
84622012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8463
8464 * fileio.c (time_error_value): Check the right error number.
8465 Problem reported by Troels Nielsen in
8466 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8467
356e7178
PE
84682012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8469
4e71fd89
PE
8470 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8471 This should be fixed in a better way; see Eli Zaretskii in
8472 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8473 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8474
f0941253
PE
8475 * fileio.c (time_error_value): Rename from special_mtime.
8476 The old name's problems were noted by Eli Zaretskii in
8477 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8478
065c9eb4
PE
8479 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8480 This variable's comment says Emacs needs at least one GDB-visible
8481 symbol of type enum pvec_type, to work around GDB problems.
8482 The symbol's value doesn't matter.
8483
356e7178
PE
8484 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8485 that causes compilation to fail on pre-C99 compilers.
8486
ed9265fc 84872012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
8488
8489 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8490 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8491
3884d954
DA
84922012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8493
d209e2fb 8494 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
8495 headers for buffer_defaults and buffer_local_symbols.
8496 Reported by Juanma Barranquero <lekktu@gmail.com>.
8497
ee28be33
SM
84982012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8499
8500 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8501 * lisp.h (enum pvec_type): Use fewer bits.
8502 (PSEUDOVECTOR_SIZE_BITS): New constant.
8503 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8504 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8505 change in pvec_type.
8506 (PSEUDOVECTOR_TYPEP): New macro.
8507 (TYPED_PSEUDOVECTORP): Use it.
8508 * fns.c (internal_equal): Adapt code to extract pvectype.
8509 * emacs.c (gdb_pvec_type): Update type.
8510 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8511 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8512 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8513 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8514 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8515 abusing vector->header.next.nbytes.
8516 (live_vector_p): Use PVEC_TYPE.
8517 (mark_object): Adapt code to extract pvectype. Use switch.
8518
c7f2cd7f
PE
85192012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8520
8521 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8522 Tighten new eassert a bit.
8523
8ce70ed2
DA
85242012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8525
8526 Fix compilation with --enable-gcc-warnings and -O1
8527 optimization level.
8528 * doprnt.c (doprnt): Change type of tem to int, initialize
8529 to avoid compiler warning. Add eassert.
8530 * search.c (simple_search): Initialize match_byte to avoid
8531 compiler warning. Add eassert.
8532
dea7f1e5
PE
85332012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8534
24a212eb
PE
8535 Avoid weird behavior with large horizontal scrolls.
8536 Without this change, for example, large hscroll values would
8537 mess up Emacs's display on Fedora 15 x86, presumably due to
8538 overflows in int calculations in the display code.
8539 Also, if buffers had long lines, Emacs would freeze.
8540 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8541 (set_window_hscroll): New function, containing the old guts of
8542 Fset_window_hscroll. Return the clipped value.
8543 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8544 This avoids the need to check against PTRDIFF_MAX.
8545
dea7f1e5
PE
8546 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8547
76046526
DA
85482012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8549
8550 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8551
39adff0d
PE
85522012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8553
63807d47
PE
8554 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8555 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8556 since GCC 4.4.6 issues a bogus warning for them.
8557
39adff0d
PE
8558 Fix bugs in file timestamp newness comparisons.
8559 * fileio.c (Ffile_newer_than_file_p):
8560 * lread.c (Fload): Use full timestamp resolution of files,
8561 not just the 1-second resolution, so that files that are only
8562 slightly newer still count as newer.
8563 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8564 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8565
dbeed9a6
PE
85662012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8567
8568 * fileio.c: Improve handling of file time marker. (Bug#11852)
8569 (special_mtime): New function.
8570 (Finsert_file_contents, Fverify_visited_file_modtime):
8571 Use it to set special mtime values consistently.
8572
636334d6
AS
85732012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8574
8575 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8576 marker for non-existing file. (Bug#11852)
8577
e2017fe2
GM
85782012-07-03 Glenn Morris <rgm@gnu.org>
8579
8580 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8581 and did not make it into globals.h).
8582
404dbd37
TT
85832012-07-03 Tom Tromey <tromey@redhat.com>
8584
8585 * window.c (Fset_window_margins, Fset_window_fringes)
8586 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8587 * textprop.c (Fprevious_property_change): No longer static.
8588 * syntax.c (Fsyntax_table_p): No longer static.
8589 * process.c (Fget_process, Fprocess_datagram_address): No longer
8590 static.
8591 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8592 * keyboard.c (Fcommand_execute): No longer static.
8593 Remove EXFUN.
8594 * insdel.c (Fcombine_after_change_execute): No longer static.
8595 * image.c (Finit_image_library): No longer static.
8596 * fileio.c (Fmake_symbolic_link): No longer static.
8597 * eval.c (Ffetch_bytecode): No longer static.
8598 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
8599 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8600 No longer static.
404dbd37
TT
8601 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8602 static.
8603 * dired.c (Ffile_attributes): No longer static.
8604 * composite.c (Fcomposition_get_gstring): No longer static.
8605 * callproc.c (Fgetenv_internal): No longer static.
8606
8607 * ccl.h: Remove EXFUNs.
8608 * buffer.h: Remove EXFUNs.
8609 * dispextern.h: Remove EXFUNs.
8610 * intervals.h: Remove EXFUNs.
8611 * fontset.h: Remove EXFUN.
8612 * font.h: Remove EXFUNs.
8613 * dosfns.c (system_process_attributes): Remove EXFUN.
8614 * keymap.h: Remove EXFUNs.
8615 * lisp.h: Remove EXFUNs.
8616 * w32term.h: Remove EXFUNs.
8617 * window.h: Remove EXFUNs.
8618 * xsettings.h: Remove EXFUN.
8619 * xterm.h: Remove EXFUN.
8620
8e4fd1e1
GM
86212012-07-03 Glenn Morris <rgm@gnu.org>
8622
8623 * lisp.h (Frandom): Make it visible to C.
8624 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8625 buffer for invisible buffers. (Bug#1229)
8626
ca95b3eb
DA
86272012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8628
8629 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8630 values which aren't power of 2.
14ae4239 8631 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 8632 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
8633 accordingly.
8634
7555c33f
SM
86352012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8636
8637 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8638
8639 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8640
d12e8f5a
DA
86412012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8642
8643 * alloc.c (allocate_vector_block): Remove redundant
8644 calls to mallopt if DOUG_LEA_MALLOC is defined.
8645 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8646 avoid calls to mallopt if zero_vector is returned.
8647
296094c3
DA
86482012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8649
8650 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8651 is enabled, avoid dereferencing NULL current_sblock if
8652 running undumped.
8653
36429c89
DA
86542012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8655
8656 Cleanup basic buffer management.
8657 * buffer.h (struct buffer): Change layout to use generic vector
8658 marking code. Fix some comments. Change type of 'clip_changed'
8659 to bitfield. Remove unused #ifndef old.
8660 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8661 (GET_OVERLAYS_AT): Fix indentation.
8662 (for_each_per_buffer_object_at): New macro.
8663 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8664 (Fbuffer_local_variables): Use it.
8665 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8666 * alloc.c (allocate_buffer): Adjust to match new layout of
8667 struct buffer. Fix comment.
8668 (mark_overlay): New function.
8669 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8670 Lisp area of struct buffer.
8671 (mark_object): Use it. Adjust marking of misc objects
8672 and related comments.
8673
3b3e4cac
PE
86742012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8675
8676 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8677 wrapper that is not needed because the wrapped code is a no-op (zero
8678 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8679 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8680
cf5c0175
DA
86812012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8682
8683 * alloc.c (mark_buffer): Simplify. Remove prototype.
8684 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 8685 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
8686 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8687 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 8688
ca26824c
GM
86892012-06-30 Glenn Morris <rgm@gnu.org>
8690
2e4c5312
GM
8691 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8692
ca26824c
GM
8693 * epaths.in (PATH_SITELOADSEARCH): New.
8694 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8695 This is rather than relying on --enable-locallisppath elements
8696 having "site-lisp" in their names. (Bug#10208#25, 11658)
8697
0d23c240
EZ
86982012-06-30 Eli Zaretskii <eliz@gnu.org>
8699
c9240d7a
EZ
8700 * w32proc.c (sys_select): Accept and ignore one more argument.
8701
8702 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8703
0d23c240 8704 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 8705 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
8706
8707 * sysdep.c: Don't include dos.h and dosfns.h.
8708
8709 * process.c (sys_select):
8710 * msdos.c (sys_select): Accept one more argument and ignore it.
8711
8712 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8713 adapt data types and code to that.
8714
8715 * dosfns.c:
8716 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8717 which clashes with the gnulib function of the same name.
8718
af5a5a98
AS
87192012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8720
c5e4379c
AS
8721 * font.c (font_style_to_value, font_style_symbolic)
8722 (font_prop_validate_style): Add type checks for values in
8723 font_style_table.
8724
af5a5a98
AS
8725 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8726 argument.
8727 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8728 uses.
8729
8d38f461
EZ
87302012-06-29 Eli Zaretskii <eliz@gnu.org>
8731
2e5a6631
EZ
8732 * xdisp.c (try_window_id): Undo last change.
8733
8d38f461
EZ
8734 * w32.c (getwd): Adjust commentary about startup_dir.
8735 (init_environment): Always call sys_access, even in non-MSVC
8736 builds. Don't chdir to the directory of the Emacs executable.
8737 This undoes code from 1997 which was justified by the need to
8738 "avoid conflicts when removing and renaming directories". But its
8739 downside was that every relative file name was being interpreted
8740 relative to the directory of the Emacs executable, which can never
8741 be TRT. In particular, it broke sys_access when called with
8742 relative file names.
8743 (sys_access): Map GetLastError to errno.
8744
2af3565e
DA
87452012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8746
8747 * window.h (struct window): Change type of 'fringes_outside_margins'
8748 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 8749 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
8750 Adjust comment.
8751 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8752 to ptrdiff_t.
8753
c8d3a25c 87542012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 8755
c8d3a25c
GM
8756 * gnutls.c (emacs_gnutls_handshake):
8757 Add QUIT to make the loop interruptible.
57570cd3 8758
c8d3a25c 87592012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 8760
c8d3a25c
GM
8761 * charset.c (init_charset): Make lack of etc/charsets fatal.
8762
3e984ee8
DA
87632012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8764
8765 * editfns.c (region_limit): Fix type mismatch.
8766
ef884f23
DA
87672012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8770 undefined. Convert from xassert to eassert.
8771 * nsmenu.m: Convert from xassert to eassert.
8772 * nsterm.m: Likewise.
8773
7d7e0027
SM
87742012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8775
8776 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8777
aa754e6a
PE
87782012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8779
8780 Avoid integer overflow on scroll-left and scroll-right.
8781 * window.c (HSCROLL_MAX): New macro.
8782 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8783 overflow when requested scroll falls outside ptrdiff_t range.
8784
80b00b08
DA
87852012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8786
8787 * window.h (struct window): Change type of 'hscroll',
8788 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8789 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8790 Adjust users accordingly.
8791 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8792 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8793 from EMACS_INT to ptrdiff_t.
8794 (make_window): Omit redundant initialization.
8795
62b2bcf6
JB
87962012-06-28 Juanma Barranquero <lekktu@gmail.com>
8797
8798 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8799
45942c7d
DA
88002012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8801
8802 * window.h (struct window): Change type of 'use_time' and
8803 'sequence_number' from Lisp_Object to int.
8804 * frame.c (make_frame): Adjust users accordingly.
8805 * print.c (print_object): Likewise.
8806 * window.c (select_window, Fwindow_use_time, make_parent_window)
8807 (make_window): Likewise.
8808
e509cfa6
DA
88092012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8810
8811 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8812 enabled with --enable-checking=[all,glyphs] configure option.
8813 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8814 adjust comments accordingly.
8815 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8816 undefined, adjust comments accordingly.
8817 * image.c: Likewise.
8818 * scroll.c: Likewise.
8819 * w32fns.c: Likewise.
8820 * w32term.c: Likewise.
8821 * xdisp.c: Likewise.
8822 * xfaces.c: Likewise.
8823 * xfns.c: Likewise.
8824 * xterm.c: Likewise.
8825
a54e2c05
DA
88262012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8827
8828 Generalize run-time debugging checks.
8829 * dispextern.h (XASSERTS): Remove.
8830 * fontset.c (xassert): Remove.
8831 Convert from xassert to eassert.
8832 * alloc.c: Convert from xassert to eassert.
8833 * bidi.c: Likewise.
8834 * dispnew.c: Likewise.
8835 * fns.c: Likewise.
8836 * fringe.c: Likewise.
8837 * ftfont.c: Likewise.
8838 * gtkutil.c: Likewise.
8839 * image.c: Likewise.
8840 * keyboard.c: Likewise.
8841 * menu.c: Likewise.
8842 * process.c: Likewise.
8843 * scroll.c: Likewise.
8844 * sound.c: Likewise.
8845 * term.c: Likewise.
8846 * w32console.c: Likewise.
8847 * w32fns.c: Likewise.
8848 * w32term.c: Likewise.
8849 * window.c: Likewise.
8850 * xdisp.c: Likewise.
8851 * xfaces.c: Likewise.
8852 * xfns.c: Likewise.
8853 * xselect.c: Likewise.
8854 * xterm.c: Likewise.
8855
1ec4b7b2
SM
88562012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8857
8858 * fns.c (maybe_resize_hash_table): Output message when growing the
8859 purify-hashtable.
8860
2014308a
DA
88612012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8862
8863 * alloc.c (allocate_string_data): Remove dead code.
8864 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8865 avoid GCC warning about unused macro.
8866
246155eb
DA
88672012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8868
8869 * alloc.c (allocate_string): Omit intervals initialization.
8870 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8871 as in make_pure_string and make_pure_c_string.
8872
43184b7b
DA
88732012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8874
d209e2fb 8875 * alloc.c (allocate_string): Fix last change.
43184b7b 8876
3fe6dd74
DA
88772012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8878
d209e2fb 8879 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
8880 to memset, add explicit initialization where appropriate.
8881
1ba6038a
GM
88822012-06-27 Glenn Morris <rgm@gnu.org>
8883
8884 * lisp.mk (lisp): Remove paths.elc.
8885
c89926a5
CY
88862012-06-27 Chong Yidong <cyd@gnu.org>
8887
8888 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8889
ed6b3510
JW
88902012-06-26 John Wiegley <johnw@newartisans.com>
8891
1ec4b7b2 8892 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
8893 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8894
ed6b3510
JW
8895 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8896 when building with Clang.
8897
8edd4a2b
SM
88982012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8899
8900 * eval.c (Fapply): Allow calling it with a single argument.
8901
f6f62d1b
EZ
89022012-06-26 Eli Zaretskii <eliz@gnu.org>
8903
8904 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8905 _stricmp and _strnicmp.
8906 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8907
62efea5e
DA
89082012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8909
8910 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8911 allocated window.
8912 (allocate_process): Likewise for new process.
8edd4a2b 8913 (allocate_terminal): Change to use offsetof.
62efea5e
DA
8914 (allocate_frame): Likewise.
8915 * frame.c (make_frame): Omit redundant initialization.
8916 * window.c (make_parent_window): Use memset.
8917 (make_window): Omit redundant initialization.
8918 * process.c (make_process): Omit redundant initialization.
8919 * terminal.c (create_terminal): Likewise.
8920
42997f4d
DA
89212012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8922
8923 * term.c (delete_tty): Remove redundant call to memset.
8924
1130ecfc
DA
89252012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8926
8927 * alloc.c: Remove build_string.
8928 * lisp.h: Define build_string as static inline. This provides
8929 a better opportunity to optimize away calls to strlen when the
8930 function is called with compile-time constant argument.
8931 * image.c (imagemagick_error): Convert to build_string.
8932 * w32proc.c (sys_spawnve): Likewise.
8933 * xterm.c (x_term_init): Likewise.
8934
cf38a720
PE
89352012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8936
99027bdd
PE
8937 Use sprintf return value instead of invoking strlen on result.
8938 In the old days this wasn't portable, since some sprintf
8939 implementations returned char *. But they died out years ago and
8940 Emacs already assumes sprintf returns int.
8941 Similarly for float_to_string.
8942 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8943 * ccl.c (ccl_driver):
8944 * character.c (string_escape_byte8):
8945 * data.c (Fnumber_to_string):
8946 * doprnt.c (doprnt):
8947 * print.c (print_object):
8948 * xdisp.c (message_dolog):
8949 * xfns.c (syms_of_xfns):
8950 Use sprintf or float_to_string result to avoid need to call strlen.
8951 * data.c (Fnumber_to_string):
8952 Use make_unibyte_string, since the string must be ASCII.
8953 * lisp.h, print.c (float_to_string): Now returns int length.
8954 * term.c (produce_glyphless_glyph):
8955 Use sprintf result rather than recomputing it.
8956
cf38a720
PE
8957 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8958 * Makefile.in (ALL_CFLAGS):
8959 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8960 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8961
3511c784
DA
89622012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8963
0a08eb21 8964 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
8965 strcasecmp if available.
8966 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8967
fb7da12e
AS
89682012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8969
8970 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8971 Avoid comma operator.
8972 * menu.c (push_submenu_start, push_submenu_end)
8973 (push_left_right_boundary, push_menu_pane): Likewise.
8974 * msdos.c (dos_rawgetc): Likewise.
8975
afa2ffd8
DA
89762012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8977
8978 * xfns.c (xic_create_fontsetname): Remove redundant calls
8979 to memset.
8980
b3b4476b
PE
89812012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8982
4495ff38
PE
8983 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8984 sprintf already null-terminates its output.
8985
b3b4476b
PE
8986 * xfns.c (x_window): Remove redundant cast.
8987
b00876c9
DA
89882012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8989
8990 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8991 `const char *' to `char *' to avoid compiler warning.
8992
d188e26b
PE
89932012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8994
885d1d74
PE
8995 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8996 instead of truncating it to 63 (admittedly a generous limit).
8997
d188e26b
PE
8998 * process.c: Fix spelling and caps in comments.
8999
e2f560b1
DN
90002012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
9001
e86db54b 9002 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
9003 * sysdep.c (setpgrp): Remove definition, not used in this file.
9004
7583a3a1
JB
90052012-06-24 Juanma Barranquero <lekktu@gmail.com>
9006
9007 * makefile.w32-in: Update dependencies.
9008
696056c2
EZ
90092012-06-24 Eli Zaretskii <eliz@gnu.org>
9010
9011 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
9012 (SYSTIME_H): Add nt/inc/sys/time.h.
9013
9014 * systime.h [WINDOWSNT]: Include sys/time.h.
9015
9016 * s/ms-w32.h (struct timespec): Definition moved from
9017 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
9018
845ca893
PE
90192012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9020
9021 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
9022 * buffer.h (buffer_slot_type_mismatch):
9023 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9024 * eval.c (unwind_to_catch):
9025 * image.c (my_png_error, my_error_exit):
9026 * keyboard.c (quit_throw_to_read_char, user_error)
9027 (Fexit_recursive_edit, Fabort_recursive_edit):
9028 * lisp.h (die, args_out_of_range, args_out_of_range_3)
9029 (wrong_type_argument, buffer_overflow, __executable_start)
9030 (memory_full, buffer_memory_full, string_overflow, Fthrow)
9031 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
9032 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
9033 (fatal):
9034 (child_setup) [!DOS_NT]:
9035 * lread.c (end_of_file_error, invalid_syntax):
9036 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
9037 * puresize.h (pure_write_error):
9038 * search.c (matcher_overflow):
9039 * sound.c (sound_perror, alsa_sound_perror):
9040 * sysdep.c, syssignal.h (croak):
9041 * term.c (maybe_fatal, vfatal):
9042 * textprop.c (text_read_only):
9043 * undo.c (user_error):
9044 * unexmacosx.c (unexec_error):
9045 * xterm.c (x_ins_del_lines, x_delete_glyphs):
9046 Use _Noreturn rather than NO_RETURN.
9047 No need for separate decl merely because of _Noreturn.
9048 * sound.c (sound_warning, parse_sound):
9049 Remove unnecessary forward decls.
9050
f1dd8073
PE
90512012-06-24 Paul Eggert <eggert@cs.ucla.edu>
9052
9053 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
9054 * lisp.h (WAIT_READING_MAX): New macro.
9055 * dispnew.c (Fsleep_for, sit_for):
9056 * keyboard.c (kbd_buffer_get_event):
9057 * process.c (Faccept_process_output):
9058 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
9059 This improves on the previous patch, which introduced a bug
9060 when time_t is unsigned and as wide as intmax_t.
9061 See <http://bugs.gnu.org/9000#51>.
9062
b82c1755
EZ
90632012-06-23 Eli Zaretskii <eliz@gnu.org>
9064
9065 * dispnew.c (sit_for, Fsleep_for):
9066 * keyboard.c (kbd_buffer_get_event):
9067 * process.c (Faccept_process_output): Avoid compiler warnings when
9068 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
9069
ca300656
JB
90702012-06-23 Juanma Barranquero <lekktu@gmail.com>
9071
049ec95b
JB
9072 * makefile.w32-in: Update dependencies.
9073
ca300656
JB
9074 * w32.c (ltime): Add return type and declare static.
9075 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
9076
db7b8d06
PE
90772012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9078
9079 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
9080 Privately reported by Herbert J. Skuhra.
9081 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
9082 All uses changed.
9083 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
9084 not make_lisp_timeval, when the argument is of type EMACS_TIME.
9085
0bd8297f
EZ
90862012-06-23 Eli Zaretskii <eliz@gnu.org>
9087
96512555
EZ
9088 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
9089 last argument of make_unibyte_string.
9090
0bd8297f
EZ
9091 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
9092 language ID in the event parameters.
9093
9094 * w32term.c (w32_read_socket): Put the new keyboard codepage into
9095 event.code, not the obscure "character set ID".
9096
63def6b6
CY
90972012-06-23 Chong Yidong <cyd@gnu.org>
9098
9099 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
9100
e8a02204
EZ
91012012-06-23 Eli Zaretskii <eliz@gnu.org>
9102
388cdec0
EZ
9103 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
9104 * w32.c (fdutimens): New function.
9105
9106 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
9107
9108 * s/ms-w32.h (pselect): Redirect to sys_select.
9109
9110 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
9111
e8a02204
EZ
9112 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
9113 in the logic of incrementing and decrementing the value of
9114 use_relocatable_buffers.
9115
d054f3fb
PE
91162012-06-23 Paul Eggert <eggert@cs.ucla.edu>
9117
9118 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
9119 Privately reported by Herbert J. Skuhra.
9120 [__FreeBSD__]: Remove "*/" typo after "#include".
9121 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
9122 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
9123 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
9124 Don't assume EMACS_TIME and struct timeval are the same type.
9125
d35af63c
PE
91262012-06-22 Paul Eggert <eggert@cs.ucla.edu>
9127
9128 Support higher-resolution time stamps (Bug#9000).
9129 The time stamps are only nanosecond-resolution at the C level,
9130 since that's the best that any real-world system supports now.
9131 But they are picosecond-resolution at the Lisp level, as that's
9132 easy, and leaves room for future OS improvements.
9133
9134 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
9135 (LIBES): Use it.
9136
9137 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
9138 Don't get current time unless it's needed.
9139
9140 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
9141 now provides it if it's absent.
9142 (start_atimer): Port to higher-res time stamps.
9143 Check for time stamp overflow. Don't get current time more
9144 often than is needed.
9145
9146 * buffer.h (struct buffer): Buffer modtime now has high resolution.
9147 Include systime.h, not time.h.
9148 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
9149
9150 * dired.c: Include stat-time.h.
9151 (Ffile-attributes): File times now have higher resolution.
9152
9153 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
9154 (struct image): Timestamp now has higher resolution.
9155
9156 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
9157 has at least microseconds now. All uses removed.
9158 (update_frame, update_single_window, update_window, update_frame_1)
9159 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 9160 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
9161
9162 * editfns.c (time_overflow): Now extern.
9163 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
9164 (float-time, Fformat_time_string, Fcurrent_time_string)
9165 (Fcurrent_time_zone): Accept and generate higher-resolution
9166 time stamps.
9167 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
9168 (decode_time_components, lisp_seconds_argument): New functions.
9169 (make_time): Now static.
9170 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
9171 Report an error if the time is invalid, rather than having the caller
9172 do that.
9173
9174 * fileio.c: Include <stat-time.h>
9175 (Fcopy_file): Copy higher-resolution time stamps.
9176 Prefer to set the time stamp via a file descriptor if that works.
9177 (Fset_file_times, Finsert_file_contents, Fwrite_region)
9178 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
9179 (Fvisited_file_modtime, Fset_visited_file_modtime):
9180 Support higher-resolution time stamps.
9181
9182 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
9183
9184 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
9185
9186 * image.c (prepare_image_for_display, clear_image_cache)
9187 (lookup_image): Port to higer-resolution time stamps.
9188
9189 * keyboard.c (start_polling, bind_polling_period):
9190 Check for time stamp overflow.
9191 (read_char, kbd_buffer_get_event, timer_start_idle)
9192 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
9193 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
9194 Port to higher-resolution time stamps. Do not assume time_t is signed.
9195 (decode_timer): New function. Timers are now vectors of length 9,
9196 not 8, to accommodate the picosecond component.
9197 (timer_check_2): Use it.
9198
9199 * nsterm.m (select_timeout, timeval_subtract): Remove.
9200 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
9201 as they're a bit more accurate and handle overflow better.
9202 (ns_select): Change prototype to be compatible with pselect.
9203 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
9204 * nsterm.h (ns_select): Adjust prototype.
9205
9206 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
9207 us-resolution time stamps.
9208 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
9209
9210 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
9211
9212 * lisp.h (time_overflow): New decl.
9213 (wait_reading_process_output): First arg is now intmax_t, not int,
9214 to accommodate larger waits.
9215
9216 * process.h (struct Lisp_Process.read_output_delay):
9217 Now counts nanoseconds, not microseconds.
9218 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
9219 EMACS_HAS_USECS.
9220 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
9221 (wait_reading_process_output):
9222 Port to ns-resolution time stamps.
9223 (Faccept_process_output, wait_reading_process_output):
9224 Check for time stamp overflow. Do not assume time_t is signed.
9225 (select_wrapper): Remove; we now use pselect.
9226 (Fprocess_attributes): Now generates ns-resolution time stamps.
9227
9228 * sysdep.c: Include utimens.h. Don't include utime.h
9229 or worry about struct utimbuf; gnulib does that for us now.
9230 (gettimeofday): Remove; gnulib provides a substitute.
9231 (make_timeval): New function.
9232 (set_file_times): Now sets ns-resolution time stamps.
9233 New arg FD; all uses changed.
9234 (time_from_jiffies, ltime_from_jiffies, get_up_time)
9235 (system_process_attributes):
9236 Now returns ns-resolution time stamp. All uses changed.
9237 Check for time stamp overflow.
9238
9239 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
9240 provides a substitute now.
9241
9242 * systime.h: Include timespec.h rather than sys/time.h and time.h,
9243 since it guarantees struct timespec.
9244 (EMACS_TIME): Now struct timespec, so that we can support
9245 ns-resolution time stamps.
9246 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
9247 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
9248 (EMACS_USECS): Remove.
9249 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
9250 so multiply the arg by 1000 before storing it.
9251 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
9252 New macros.
9253 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
9254 Port to ns-resolution time stamps.
9255 (EMACS_TIME_NEG_P): Remove; replaced by....
9256 (EMACS_TIME_SIGN): New macro.
9257 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
9258 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
9259 (set_file_times, make_time, lisp_time_argument): Adjust signature.
9260 (make_timeval, make_lisp_time, decode_time_components): New decls.
9261 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
9262 that it mishandled time_t overflow. You can't compare by subtracting!
9263 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
9264 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
9265
9266 * term.c: Include <sys/time.h>.
9267 (timeval_to_Time): New function, for proper overflow wraparound.
9268 (term_mouse_position, term_mouse_click): Use it.
9269
9270 * undo.c (record_first_change): Support higher-resolution time stamps
9271 in the undo buffer.
9272 (Fprimitive_undo): Use them when restoring time stamps.
9273
9274 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
9275 (w32_get_internal_run_time):
9276 Port to higher-resolution Emacs time stamps.
9277 (ltime): Now accepts single 64-bit integer, as that's more convenient
9278 for callers.
9279
9280 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
9281
9282 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
9283 for compatibility with pselect. Support ns-resolution time stamps.
9284
9285 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
9286
9287 * xselect.c (wait_for_property_change, x_get_foreign_selection):
9288 Check for time stamp overflow, and support ns-resolution time stamps.
9289
9290 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
9291 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
9292 (timeval_subtract): Remove; no longer needed.
9293 (XTflash, XTring_bell, x_wait_for_event):
9294 Port to ns-resolution time stamps. Don't assume time_t is signed.
9295
b6a92dfe
CY
92962012-06-22 Chong Yidong <cyd@gnu.org>
9297
9298 * xdisp.c (x_consider_frame_title): Revert last change.
9299
d251c37c
EZ
93002012-06-22 Eli Zaretskii <eliz@gnu.org>
9301
9302 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
9303 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
9304 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
9305 staticidx goes up to 1597 out of 1600 = 0x640.)
9306
f10deafb
PE
93072012-06-20 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
9310 Otherwise, the umask might be mistakenly 0 while handling input signals.
9311
ec6de1e2
SM
93122012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
9313
9314 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
9315
28be1ada
DA
93162012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
9317
9318 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
9319 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
9320 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
9321 access to `contents' member of Lisp_Vector objects with AREF and ASET
9322 where appropriate.
9323
c6bf3022
CY
93242012-06-19 Chong Yidong <cyd@gnu.org>
9325
9326 * frame.c (delete_frame): When selecting a frame on a different
9327 text terminal, do not alter the terminal's top-frame.
9328
9329 * xdisp.c (format_mode_line_unwind_data): Record the target
9330 frame's selected window and its terminal's top-frame.
9331 (unwind_format_mode_line): Restore them.
9332 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
9333 Callers changed.
9334 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
9335 since tty frames can be explicitly named.
9336 (prepare_menu_bars): Likewise.
9337
9338 * term.c (Ftty_top_frame): New function.
9339
defd4196
PE
93402012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9341
9342 Port byte-code-meter to modern targets.
9343 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
9344 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 9345 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
9346 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
9347 (METER_1, METER_2): Simplify.
9348
1053a871
SM
93492012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
9350
9351 * data.c (Fdefalias): Return `symbol' (bug#11686).
9352
b7e8d081
MR
93532012-06-18 Martin Rudalics <rudalics@gmx.at>
9354
9355 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
9356 gets killed during executing of this function (Bug#11665).
9357 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
9358 (Vkill_buffer_query_functions): In doc-string say that functions
9359 run by this hook should not change the current buffer.
9360
7ea2b339
PE
93612012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9362
9363 Fix recently-introduced process.c problems found by static checking.
9364 * process.c (write_queue_push, write_queue_pop, send_process):
9365 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
9366 (write_queue_pop): Fix pointer signedness problem.
9367 (send_process): Remove unused local.
9368
96a313a1
CY
93692012-06-17 Chong Yidong <cyd@gnu.org>
9370
9371 * xdisp.c (redisplay_internal): No need to redisplay terminal
9372 frames that are not on top.
9373
20ca2e94
TN
93742012-06-17 Troels Nielsen <bn.troels@gmail.com>
9375
9376 * process.c (make_process): Initialize write_queue.
9377 (write_queue_push, write_queue_pop): New functions.
9378 (send_process): Use them to maintain correct ordering of process
9379 writes (Bug#10815).
9380
9a900ca9
PE
93812012-06-17 Paul Eggert <eggert@cs.ucla.edu>
9382
310fbfa8
PE
9383 * lisp.h (eassert): Assume C89 or later.
9384 This removes the need for CHECK.
9385 (CHECK): Remove. Its comments about always evaluating its
9386 argument were confusing, as 'eassert' typically does not evaluate
9387 its argument.
9388
27bb1ca4
PE
9389 * coding.c (produce_chars): Use ptrdiff_t, not int.
9390
9a900ca9
PE
9391 * xterm.c (x_draw_underwave): Check for integer overflow.
9392 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
9393
41b7f8bc 93942012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
9395
9396 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
9397 referenced (Bug#11583).
9398
9b0e3eba
AA
93992012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
9400
9401 Implement wave-style variant of underlining.
9402 * dispextern.h (face_underline_type): New enum.
9403 (face): Add field for underline type.
9404 * nsterm.m (ns_draw_underwave): New function.
9405 (ns_draw_text_decoration): Use it.
9406 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9407 New functions.
9408 (x_draw_glyph_string): Use them.
9409 * xfaces.c (Qline, Qwave): New Lisp objects.
9410 (check_lface_attrs, merge_face_ref)
1053a871
SM
9411 (Finternal_set_lisp_face_attribute, realize_x_face):
9412 Handle wave-style underline face attributes.
9b0e3eba
AA
9413 * xterm.c (x_draw_underwave): New function.
9414 (x_draw_glyph_string): Use it.
9415
0fb52f11
JB
94162012-06-16 Juanma Barranquero <lekktu@gmail.com>
9417
9418 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9419 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9420 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9421 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9422 ($(BLD)/w32select.$(O)): Update dependencies.
9423
e5560ff7
AS
94242012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9425
9426 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9427 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9428 * character.c (_fetch_multibyte_char_p): Remove.
9429 * alloc.c: Include "character.h" before "buffer.h".
9430 * bidi.c: Likewise.
9431 * buffer.c: Likewise.
9432 * bytecode.c: Likewise.
9433 * callint.c: Likewise.
9434 * callproc.c: Likewise.
9435 * casefiddle.c: Likewise.
9436 * casetab.c: Likewise.
9437 * category.c: Likewise.
9438 * cmds.c: Likewise.
9439 * coding.c: Likewise.
9440 * composite.c: Likewise.
9441 * dired.c: Likewise.
9442 * dispnew.c: Likewise.
9443 * doc.c: Likewise.
9444 * dosfns.c: Likewise.
9445 * editfns.c: Likewise.
9446 * emacs.c: Likewise.
9447 * fileio.c: Likewise.
9448 * filelock.c: Likewise.
9449 * font.c: Likewise.
9450 * fontset.c: Likewise.
9451 * fringe.c: Likewise.
9452 * indent.c: Likewise.
9453 * insdel.c: Likewise.
9454 * intervals.c: Likewise.
9455 * keyboard.c: Likewise.
9456 * keymap.c: Likewise.
9457 * lread.c: Likewise.
9458 * macros.c: Likewise.
9459 * marker.c: Likewise.
9460 * minibuf.c: Likewise.
9461 * nsfns.m: Likewise.
9462 * nsmenu.m: Likewise.
9463 * print.c: Likewise.
9464 * process.c: Likewise.
9465 * regex.c: Likewise.
9466 * region-cache.c: Likewise.
9467 * search.c: Likewise.
9468 * syntax.c: Likewise.
9469 * term.c: Likewise.
9470 * textprop.c: Likewise.
9471 * undo.c: Likewise.
9472 * unexsol.c: Likewise.
9473 * w16select.c: Likewise.
9474 * w32fns.c: Likewise.
9475 * w32menu.c: Likewise.
9476 * window.c: Likewise.
9477 * xdisp.c: Likewise.
9478 * xfns.c: Likewise.
9479 * xmenu.c: Likewise.
9480 * xml.c: Likewise.
9481 * xselect.c: Likewise.
9482
2f07e6af
EZ
94832012-06-16 Eli Zaretskii <eliz@gnu.org>
9484
1053a871
SM
9485 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9486 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 9487 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
9488 row.
9489 (handle_face_prop): Use chunk-relative overlay string index when
9490 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
9491 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9492 the rightmost. (Bug#11720)
2f07e6af 9493
29b83cec
AS
94942012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9495
9496 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9497 (CATEGORY_MEMBER): Enforce 1/0 value.
9498 * category.c (_temp_category_set): Remove.
9499
4c5501e9
EZ
95002012-06-16 Eli Zaretskii <eliz@gnu.org>
9501
9502 * window.c (Fdelete_other_windows_internal)
9503 (Fdelete_window_internal): Don't access frame's mouse highlight
9504 info of the initial frame. (Bug#11677)
9505
2b570124
PE
95062012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9507
e93864f9
PE
9508 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9509 Assume USE_2_TAGS_FOR_INTS.
9510 (xreload): Adjust $tagmask width to match recent lisp.h change.
9511
2b570124
PE
9512 Simplify lisp.h in minor ways that should not affect code.
9513 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9514 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9515 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9516 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9517 (INTTYPEBITS): New macro, for clarity.
9518 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
9519 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9520 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
9521 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9522 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9523
81755f69
JB
95242012-06-13 Juanma Barranquero <lekktu@gmail.com>
9525
9526 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9527
16192a57
GM
95282012-06-13 Glenn Morris <rgm@gnu.org>
9529
9530 * s/bsd-common.h (BSD4_3):
9531 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9532
646b5f55
AS
95332012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9534
9535 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9536 instead of union.
9537 (XLI, XIL): Define.
1053a871
SM
9538 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9539 Use them.
9540 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 9541 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 9542 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
9543 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9544 * frame.c (delete_frame): Remove outdated comment.
9545 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9546 USE_LISP_UNION_TYPE.
9547 (Fw32_unregister_hot_key): Likewise.
9548 (Fw32_toggle_lock_key): Likewise.
9549 * w32menu.c (add_menu_item): Likewise.
9550 (w32_menu_display_help): Use XIL instead of checking
9551 USE_LISP_UNION_TYPE.
9552 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9553 (init_heap): Likewise.
9554 * w32term.c (w32_read_socket): Update comment.
9555
1d3823c9
GM
95562012-06-13 Glenn Morris <rgm@gnu.org>
9557
c62ff706
GM
9558 * s/usg5-4-common.h, src/s/unixware.h:
9559 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9560
1d3823c9
GM
9561 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9562
bfe3e0a2
PE
95632012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9564
9565 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9566 * alloc.c (make_number) [!defined make_number]:
9567 Remove, as lisp.h always defines this now.
9568 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9569 (roundup_size): Verify that it is a power of 2.
9570 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9571 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9572 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9573 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9574 USE_LSB_TAG now is always defined to be either 0 or 1.
9575 All uses changed.
9576 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9577 code works fine either way, and efficiency is not a concern here,
9578 as the union type is for debugging, not for production.
9579 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9580 Use an inline function on all platforms when using the union type,
9581 since this is simpler and 'static inline' can be used portably
9582 within Emacs now.
9583 (LISP_INITIALLY_ZERO): New macro.
9584 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9585 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9586
45fa9c0f
GM
95872012-06-12 Glenn Morris <rgm@gnu.org>
9588
b4492cba
GM
9589 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9590
9591 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 9592
45fa9c0f
GM
9593 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9594 Move BROKEN_SIGIO to configure.
9595
9596 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9597 Move NO_TERMIO to configure.
9598
0e25d334
CY
95992012-06-12 Chong Yidong <cyd@gnu.org>
9600
9601 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9602 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9603 MagickExportImagePixels is undefined.
9604
43682bb6
PE
96052012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 * image.c (imagemagick_load_image): Remove unused label.
9608
a9be7d2b
GM
96092012-06-11 Glenn Morris <rgm@gnu.org>
9610
9611 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9612 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9613 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9614 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9615
3017f87f
SM
96162012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9617
9618 * alloc.c (make_byte_code): New function.
9619 (Fmake_byte_code): Use it. Don't purify here.
9620 * lread.c (read1): Use it as well to avoid extra allocation.
9621
1b9b4cf4
CY
96222012-06-11 Chong Yidong <cyd@gnu.org>
9623
9624 * image.c (imagemagick_load_image): Implement transparency.
9625
95988fcf
AS
96262012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9627
9628 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9629 account for preceding backslashes. (Bug#11663)
9630
cd4eb164
CY
96312012-06-09 Chong Yidong <cyd@gnu.org>
9632
9633 * term.c: Support italics in capable terminals (Bug#9652).
9634 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9635 (turn_on_face): Output using TS_enter_italic_mode if available.
9636 Don't handle unused blinking and alt-charset cases.
9637 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9638 and tty_alt_charset_p cases.
9639 (tty_capable_p, init_tty): Support italics.
9640
9641 * termchar.h (struct tty_display_info): Add field for italics.
9642 Remove unused blink field.
9643
9644 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9645 Handle slant.
9646
9647 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9648 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9649 tty_alt_charset_p. Add tty_italic_p.
9650
ff88beb8
MA
96512012-06-09 Michael Albinus <michael.albinus@gmx.de>
9652
9653 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9654 dbus_type_is_basic if available.
9655 (xd_extract_signed, xd_extract_unsigned): Rename from
9656 extract_signed and extract_unsigned, respectively. Adapt callers.
9657
44286096
CY
96582012-06-09 Chong Yidong <cyd@gnu.org>
9659
1682701f
CY
9660 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9661
44286096
CY
9662 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9663 case (Bug#9752).
9664
d86feb17
PE
96652012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9666
9667 * xdisp.c (vmessage): Treat frame message as multibyte.
9668 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9669 would generate the diagnostic "Making \302\247 buffer-local while
9670 let-bound!".
9671
d5c20fe8
EZ
96722012-06-08 Eli Zaretskii <eliz@gnu.org>
9673
9674 * dispnew.c (showing_window_margins_p): Undo last change, which
9675 was done due to an inadvertent commit.
9676 (adjust_frame_glyphs_for_frame_redisplay): Do call
9677 showing_window_margins_p.
9678
513749ee
SM
96792012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9680
9681 * eval.c (Fmake_var_non_special): New primitive.
9682 (syms_of_eval): Defsubr it.
9683 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9684
d4a8f5c1
JB
96852012-06-08 Juanma Barranquero <lekktu@gmail.com>
9686
9687 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9688 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9689
8bbbc977
EZ
96902012-06-08 Eli Zaretskii <eliz@gnu.org>
9691
9692 * alloc.c (allocate_vectorlike): Fix last change.
9693
f3372c87
DA
96942012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9695
9696 Block-based vector allocation of small vectors.
9697 * lisp.h (struct vectorlike_header): New field `nbytes',
9698 adjust comment accordingly.
9699 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 9700 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
9701 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9702 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9703 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9704 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9705 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9706 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9707 (roundup_size): New constant.
9708 (struct vector_block): New data type.
9709 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 9710 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
9711 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9712 (sweep_vectors): New functions.
9713 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 9714 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
9715 or equal to VBLOCK_BYTES_MAX.
9716 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9717 (init_alloc_once): Add call to init_vectors.
9718
4f18a4ed
SM
97192012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9720
9721 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9722
86f158bc
PE
97232012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9724
9725 * doprnt.c (doprnt): Truncate multibyte char correctly.
9726 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9727 would mishandle a string argument "Xc" if X was a multibyte
9728 character of length 2: it would truncate after X's first byte
9729 rather than including all of X.
9730
c5cfcbe0
CY
97312012-06-06 Chong Yidong <cyd@gnu.org>
9732
9733 * buffer.c (word_wrap): Doc fix.
9734
c05cf390
PE
97352012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9736
9737 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9738
0c3461de
GM
97392012-06-03 Glenn Morris <rgm@gnu.org>
9740
9741 * xdisp.c (tool-bar-style): Doc fix.
9742
c71232db
UM
97432012-06-03 Ulrich Müller <ulm@gentoo.org>
9744
9745 * Makefile.in (PAXCTL): Define.
9746 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9747 binary via PaX flags if the paxctl utility is available.
9748 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9749 Restore PaX flags to their default. (Bug#11398)
9750
383f7350
CY
97512012-06-03 Chong Yidong <cyd@gnu.org>
9752
9753 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9754 buffer (Bug#11226).
9755
5f2c76c6
CY
97562012-06-03 Chong Yidong <cyd@gnu.org>
9757
9758 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9759 (note_mode_line_or_margin_highlight): If there is no help echo,
9760 use mode-line-default-help-echo. Handle the case where the mouse
9761 position is past the end of the mode line string.
9762
9763 * buffer.c (buffer_local_value_1): New function, split from
9764 Fbuffer_local_value; can return Qunbound.
9765 (Fbuffer_local_value): Use it.
9766 (Vmode_line_format): Docstring tweaks.
9767
773d47f6
PE
97682012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9769
9770 * sysdep.c (system_process_attributes): Improve comment.
9771
f2d6a3df
SM
97722012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9773
9774 * keyboard.c: Export real-this-command to Elisp.
9775 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9776 and DEFVAR it. Update all users.
9777
63810350
PE
97782012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9779
7bd5c1f4
PE
9780 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9781
63810350
PE
9782 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9783 Convert pctcpu and pctmem to Lisp float properly.
9784 Let the compiler fold better, as 100.0/0x8000 is exact.
9785
a2821611
AS
97862012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9787
9788 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9789 cons_block.
9790
5fceba1d
PE
97912012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9792
9793 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9794
c98ff5dd
DA
97952012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9796
9797 For a 'struct window', replace some Lisp_Object fields to
9798 bitfields where appropriate, remove unused fields.
9799 * window.h (struct window): Remove unused 'last_mark_x' and
9800 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 9801 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
9802 Change type of 'force_start', 'optional_new_start',
9803 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 9804 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 9805
ca34e0be
PE
98062012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9807
9808 Pacify gcc -Wdouble-precision when using Xaw.
9809 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9810 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9811 Use 'float' consistently, rather than 'float' in most places
9812 and 'double' in a couple of places.
9813
efc00ab1 98142012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
9815
9816 * xdisp.c (handle_stop): Detect whether we have overlay strings
9817 loaded by testing it->current.overlay_string_index to be
9818 non-negative, instead of checking whether n_overlay_strings is
9819 positive. (Bug#11587)
9820
efc00ab1 98212012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
9822
9823 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9824
9825 * doc.c (Fsubstitute_command_keys): Doc fix.
9826
efc00ab1 98272012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
9828
9829 * search.c (search_buffer): Remove calls to
9830 r_alloc_inhibit_buffer_relocation, as it is now called by
9831 maybe_unify_char, which was the cause of relocation of buffer text
9832 in bug#11519.
9833
efc00ab1 98342012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
9835
9836 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9837 for the duration of call to load_charset, to avoid problems with
9838 callers of maybe_unify_char that access buffer text through C
9839 pointers.
9840
9841 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9842 decrement the inhibition flag, instead of just setting or
9843 resetting it.
9844
ba93a187
PE
98452012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9846
9847 Remove obsolete '#define static' cruft.
9848 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9849 This #undef was "temporary" in 2000; it is no longer needed
9850 now that '#define static' has gone away.
9851 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9852 (gray_bitmap_bits): Remove; no longer needed.
9853 All uses replaced with definiens.
9854 * xterm.c: Include "bitmaps/gray.xbm".
9855
9e4bf381
PE
98562012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9857
9858 Clean up __executable_start, monstartup when --enable-profiling.
9859 The following changes affect the code only when profiling.
9860 * dispnew.c (__executable_start): Rename from safe_bcopy.
9861 Define only on platforms that need it.
9862 * emacs.c: Include <sys/gmon.h> when profiling.
9863 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9864 (__executable_start): Remove decl, since lisp.h does it now.
9865 (safe_bcopy): Remove decl; no longer has that name.
9866 (main): Coalesce #if into single bit of code, for simplicity.
9867 Cast pointers to uintptr_t, since standard libraries want integers
9868 and not pointers.
9869 * lisp.h (__executable_start): New decl.
9870
32d72c2f
GM
98712012-05-31 Glenn Morris <rgm@gnu.org>
9872
9873 * image.c (Fimagemagick_types): Doc fix.
9874
baac5bc7
JM
98752012-05-30 Jim Meyering <meyering@redhat.com>
9876
9877 * callproc.c (Fcall_process_region): Include directory component
9878 in mkstemp error message (Bug#11586).
9879
72cb32cf
PE
98802012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9881
9882 * alloc.c, lisp.h (make_pure_vector): Now static.
9883
61b108cc
SM
98842012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9885
9886 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9887 Move to byte-run.el.
9888 (Fautoload): Do the hash-doc more carefully.
9889 * data.c (Fdefalias): Purify definition, except for keymaps.
9890 (Qdefun): Move from eval.c.
9891 * lisp.h (Qdefun): Remove.
9892 * lread.c (read1): Tiny simplification.
9893
471fe23d
TN
98942012-05-29 Troels Nielsen <bn.troels@gmail.com>
9895
934f3f58 9896 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
9897 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9898 Bug#9642, but explicitly check that the buffer the overlay would
9899 be moved to is live and rearrange lines to make sure that errors
9900 will not put the overlay in an inconsistent state.
9901 (Fdelete_overlay): Cosmetics.
9902
85d0efd1
EZ
99032012-05-28 Eli Zaretskii <eliz@gnu.org>
9904
9905 * w32term.c (my_bring_window_to_top): New function.
9906 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
9907 could be different from the original one.
9908 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
9909 (Bug#11513)
9910
9911 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9912 by calling BringWindowToTop.
9913
9914 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9915 (WM_EMACS_END): Increase by one.
9916
da92a98c
PE
99172012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9918
9919 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9920 This avoids undefined behavior that might cause the eassert
9921 to not catch an out-of-range value.
9922
74d1f848
JB
99232012-05-28 Juanma Barranquero <lekktu@gmail.com>
9924
9925 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9926 Update dependencies.
9927
9e1a06fc
EZ
99282012-05-27 Eli Zaretskii <eliz@gnu.org>
9929
9930 * bidi.c (bidi_mirror_char): Fix last change.
9931
f3dd7312
AS
99322012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9933
9934 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9935 when referring to sectname field in printf format.
9936
81899c91
PE
99372012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9938
57b81a9f
PE
9939 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9940 Only r_alloc_inhibit_buffer_relocation needed to be added;
9941 the others were already declared.
9942
81899c91
PE
9943 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9944 before checking whether it's out of range. Put the check inside
9945 eassert. See
9946 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9947
33017faf 99482012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
9949
9950 * callproc.c (Fcall_process): Restore a line that was accidentally
9951 commented out in the 2011-02-13 change (bug#11547).
9952
33017faf 99532012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
9954
9955 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9956 defined on ralloc.c.
9957
9958 * buffer.c [REL_ALLOC]: Remove prototypes of
9959 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9960 they are now on lisp.h.
9961
9962 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9963
9964 * search.c (search_buffer): Use it to inhibit relocation of buffer
9965 text while re_search_2 is doing its job, because re_search_2 is
9966 passed C pointers to buffer text. (Bug#11519)
9967
23415acf
EZ
9968 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9969 Update value to 24.
9970
44e27368
EZ
9971 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9972 state after an additional call to move_it_in_display_line_to, keep
9973 the values of it->max_ascent and it->max_descent found for the
9974 entire line.
9975 (pos_visible_p): Revert the comparison against bottom_y to what it
9976 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9977 (Bug#11464)
9978
c1892f11
PE
99792012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9980
9981 Fix coding-related core dumps with gcc -ftrapv.
9982 The code was computing A - B, where A and B are pointers, and B is
9983 random garbage. This can lead to core dumps on platforms that
9984 have special pointer registers, and it also leads to core dumps on
9985 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9986 A - B only when B is initialized properly.
9987 * coding.c (coding_set_source, coding_set_destination): Return void.
9988 (coding_change_source, coding_change_destinations): New functions,
9989 with the old behaviors of coding_set_source and coding_set_destination.
9990 All callers that need an offset changed to use these new functions.
9991
eb7afdad
GM
99922012-05-26 Glenn Morris <rgm@gnu.org>
9993
9994 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9995
f12fdf02
EZ
99962012-05-26 Eli Zaretskii <eliz@gnu.org>
9997
53a63be6 9998 Extend mouse support on W32 text-mode console.
61b108cc
SM
9999 * xdisp.c (draw_row_with_mouse_face):
10000 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 10001
eb3f6f01 10002 * w32console.c: Include window.h.
61b108cc
SM
10003 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
10004 New functions.
eb3f6f01
EZ
10005 (initialize_w32_display): Initialize mouse-highlight data.
10006
53a63be6
EZ
10007 * w32inevt.c: Include termchar.h and window.h.
10008 (do_mouse_event): Support mouse-autoselect-window. When the mouse
10009 moves, call note_mouse_highlight. If help_echo changed, call
10010 gen_help_event to produce help-echo message in the echo area.
10011 Call clear_mouse_face if mouse_face_hidden is set in the mouse
10012 highlight info.
10013
4cfd81f6
PE
100142012-05-26 Paul Eggert <eggert@cs.ucla.edu>
10015
10016 * lread.c (read1): Simplify slightly to avoid an overflow warning
10017 with GCC 4.7.0 on x86-64.
10018
4446092a
EZ
100192012-05-26 Eli Zaretskii <eliz@gnu.org>
10020
10021 * bidi.c (bidi_mirror_char): Revert last change: an int is
10022 definitely wide enough here.
10023
42b2a986 100242012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 10025
42b2a986 10026 Fix integer width and related bugs (Bug#9874).
eb106a49 10027 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
10028 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
10029 (string_bytes, check_sblock, allocate_string_data):
10030 (compact_small_strings, Fmake_bool_vector, make_string)
10031 (make_unibyte_string, make_multibyte_string)
10032 (make_string_from_bytes, make_specified_string)
10033 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
10034 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
10035 (mark_vectorlike):
10036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10037 (allocate_pseudovector):
10038 Use int, not EMACS_INT, where int is wide enough.
10039 (inhibit_garbage_collection, Fgarbage_collect):
10040 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10041 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
10042 int might not be wide enough.
10043 (bidi_cache_search, bidi_cache_find, bidi_init_it)
10044 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
10045 (bidi_at_paragraph_end, bidi_find_paragraph_start)
10046 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
10047 (bidi_level_of_next_char, bidi_move_to_visually_next):
10048 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10049 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
10050 (Fkill_buffer, Fset_buffer_major_mode)
10051 (advance_to_char_boundary, Fbuffer_swap_text)
10052 (Fset_buffer_multibyte, overlays_at, overlays_in)
10053 (overlay_touches_p, struct sortvec, record_overlay_string)
10054 (overlay_strings, recenter_overlay_lists)
10055 (adjust_overlays_for_insert, adjust_overlays_for_delete)
10056 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
10057 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
10058 (Foverlay_recenter, last_overlay_modification_hooks_used)
10059 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
10060 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
10061 (validate_region): Omit unnecessary test for b <= e,
10062 since that's guaranteed by the previous test.
d311d28c
PE
10063 (adjust_overlays_for_delete): Avoid pos + length overflow.
10064 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
10065 (report_overlay_modification):
10066 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10067 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
10068 Omit pointer cast, which isn't needed anyway, and doesn't work
10069 after the EMACS_INT -> ptrdiff_t change.
02481186 10070 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
10071 * buffer.h: Adjust decls to match defn changes elsewhere.
10072 (struct buffer_text, struct buffer):
10073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10074 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
10075 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
10076 not int, to avoid needless 32-bit limit on 64-bit hosts.
10077 (exec_byte_code): Use tighter memory-full test, one that checks
10078 for alloca overflow. Don't compute the address of the object just
10079 before an array, as that's not portable. Use EMACS_INT, not
10080 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
10081 * callint.c (Fcall_interactively):
10082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10083 * callproc.c (call_process_kill, Fcall_process):
10084 Don't assume pid_t fits into an Emacs fixnum.
10085 (call_process_cleanup, Fcall_process, child_setup):
10086 Don't assume pid_t fits into int.
10087 (call_process_cleanup, Fcall_process, delete_temp_file)
10088 (Fcall_process_region):
10089 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10090 (Fcall_process): Simplify handling of volatile integers.
10091 Use int, not EMACS_INT, where int will do.
10092 * casefiddle.c (casify_object, casify_region, operate_on_word)
10093 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
10094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10095 (casify_object): Avoid integer overflow when overallocating buffer.
10096 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 10097 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
10098 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
10099 * category.h (CATEGORYP): Don't assume arg is nonnegative.
10100 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
10101 integers are now checked earlier. All uses replaced with XINT.
10102 (ccl_driver):
10103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10104 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
10105 (ccl_driver, Fregister_code_conversion_map):
10106 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
10107 (resolve_symbol_ccl_program): Check that vector header is in range.
10108 Always copy the vector, so that we can check its contents reliably
10109 now rather than having to recheck each instruction as it's being
10110 executed. Check that vector words fit in 'int'.
10111 (ccl_get_compiled_code, Fregister_ccl_program)
10112 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
10113 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
10114 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
10115 contents are in range.
10116 (Fccl_execute_on_string): Check that status is in range.
10117 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
10118 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
10119 Accept and return EMACS_INT, not int, because callers can pass values
10120 out of 'int' range.
10121 (c_string_width, strwidth, lisp_string_width, chars_in_text)
10122 (multibyte_chars_in_text, parse_str_as_multibyte)
10123 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
10124 (str_as_unibyte, str_to_unibyte, string_count_byte8)
10125 (string_escape_byte8, Fget_byte):
10126 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 10127 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
10128 avoid mishandling large integers.
10129 * character.h: Adjust decls to match defn changes elsewhere.
10130 * charset.c (load_charset_map_from_file, find_charsets_in_text)
10131 (Ffind_charset_region):
10132 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10133 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
10134 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 10135 Don't assume fixnum fits in int.
d311d28c
PE
10136 (load_charset_map_from_vector, Fmap_charset_chars):
10137 Remove now-unnecessary CHECK_NATNUMs.
10138 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
10139 Don't rely on undefined behavior with signed left shift overflow.
10140 Don't assume unsigned int fits into fixnum, or that fixnum fits
10141 into unsigned int. Don't require max_code to be a valid fixnum;
10142 that's not true for gb10830 4-byte on a 32-bit host. Allow
10143 invalid_code to be a cons, for the same reason. Require code_offset
10144 to be a character. Avoid int overflow if max_char is close
10145 to INT_MAX.
10146 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
10147 this is intended anyway and avoids some undefined behavior.
10148 (load_charset_map): Pass unsigned, not int, as 2nd arg of
10149 INDEX_TO_CODE_POINT, as that's what it expects.
10150 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
10151 * charset.h (DECODE_CHAR): Return int, not unsigned;
10152 this is what was intended anyway, and it avoids undefined behavior.
10153 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
10154 integer-overflow issues.
10155 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
10156 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
10157 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
10158 * chartab.c (Fmake_char_table, Fset_char_table_range)
10159 (uniprop_get_decoder, uniprop_get_encoder):
10160 Don't assume fixnum fits in int.
10161 * cmds.c (move_point): New function, that does the gist of
10162 Fforward_char and Fbackward_char, but does so while checking
10163 for integer overflow more accurately.
c96e5d6a 10164 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
10165 (Fforward_line, Fend_of_line, internal_self_insert)
10166 (internal_self_insert):
10167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10168 Fix a FIXME, by checking for integer overflow when calculating
10169 target_clm and actual_clm.
10170 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 10171 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
10172 (ASSURE_DESTINATION, coding_alloc_by_realloc)
10173 (coding_alloc_by_making_gap, alloc_destination)
10174 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
10175 (encode_coding_utf_16, detect_coding_emacs_mule)
10176 (decode_coding_emacs_mule, encode_coding_emacs_mule)
10177 (detect_coding_iso_2022, decode_coding_iso_2022)
10178 (encode_invocation_designation, encode_designation_at_bol)
10179 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10180 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
10181 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
10182 (encode_coding_ccl, encode_coding_raw_text)
10183 (detect_coding_charset, decode_coding_charset)
10184 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
10185 (produce_composition, produce_charset, produce_annotation)
10186 (decode_coding, handle_composition_annotation)
10187 (handle_charset_annotation, consume_chars, decode_coding_gap)
10188 (decode_coding_object, encode_coding_object, detect_coding_system)
10189 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
10190 (code_convert_region, code_convert_string)
8f50130c
PE
10191 (Fdefine_coding_system_internal)
10192 (coding_set_source, coding_set_destination):
d311d28c
PE
10193 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10194 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
10195 (Fdefine_coding_system_internal):
10196 Don't assume fixnums fit in int.
10197 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 10198 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
10199 (Funencodable_char_position, Fcheck_coding_systems_region)
10200 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 10201 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 10202 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 10203 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 10204 Don't access memory outside of the args array.
d311d28c 10205 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
10206 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
10207 result of ENCODE_CHAR.
d311d28c
PE
10208 * coding.h: Adjust decls to match defn changes elsewhere.
10209 (struct coding_system):
10210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10211 * composite.c (get_composition_id, find_composition)
10212 (run_composition_function, update_compositions)
10213 (compose_text, composition_gstring_put_cache)
10214 (composition_gstring_p, composition_gstring_width)
10215 (fill_gstring_header, fill_gstring_body, autocmp_chars)
10216 (composition_compute_stop_pos, composition_reseat_it)
10217 (composition_update_it, struct position_record)
10218 (find_automatic_composition, composition_adjust_point)
10219 (Fcomposition_get_gstring, Ffind_composition_internal):
10220 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10221 (update_compositions):
10222 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10223 * composite.h: Adjust decls to match defn changes elsewhere.
10224 (struct composition):
10225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10226 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
10227 Do not attempt to compute the address of the object just before a
10228 buffer; this is not portable.
10229 (Faref, Faset):
10230 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10231 (Faset): Use int, not EMACS_INT, where int is wide enough.
10232 (Fstring_to_number): Don't assume fixnums fit in int.
10233 (Frem): Don't assume arg is nonnegative.
10234 * dbusbind.c (xd_append_arg): Check for integers out of range.
10235 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 10236 (extract_signed, extract_unsigned): New functions.
243e0530
PE
10237 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
10238 (xd_get_connection_references): Return ptrdiff_t, not int.
10239 All uses changed.
10240 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
10241 (xd_read_message_1):
10242 Use int, not unsigned, where the dbus API uses int.
10243 (Fdbus_message_internal): Don't overflow mtype.
10244 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
10245 * dired.c (directory_files_internal, file_name_completion, scmp)
10246 (file_name_completion_stat):
10247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10248 (file_name_completion): Don't overflow matchcount.
10249 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
10250 * dispextern.h: Adjust decls to match defn changes elsewhere.
10251 (struct text_pos, struct glyph, struct bidi_saved_info)
10252 (struct bidi_string_data, struct bidi_it, struct composition_it)
10253 (struct it):
10254 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10255 (struct display_pos, struct composition_it, struct it):
10256 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10257 * dispnew.c (increment_matrix_positions)
10258 (increment_row_positions, mode_line_string)
10259 (marginal_area_string):
10260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 10261 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
10262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10263 (duration_to_sec_usec): New function, to check for overflow better.
10264 (Fsleep_for, sit_for): Use it.
10265 * doc.c (get_doc_string, store_function_docstring):
10266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10267 (get_doc_string, Fsnarf_documentation):
10268 Use int, not EMACS_INT, where int is wide enough.
10269 (get_doc_string):
10270 Use SAFE_ALLOCA, not alloca.
10271 Check for overflow when converting EMACS_INT to off_t.
10272 * doprnt.c (doprnt):
10273 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10274 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
10275 Don't assume uid_t fits into fixnum.
10276 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
10277 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
10278 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
10279 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
10280 (general_insert_function)
10281 (Finsert_char, make_buffer_string, make_buffer_string_both)
10282 (update_buffer_properties, Fbuffer_substring)
10283 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
10284 (Fsubst_char_in_region, check_translation)
10285 (Ftranslate_region_internal, save_restriction_restore, Fformat)
10286 (transpose_markers, Ftranspose_regions):
10287 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10288 (clip_to_bounds): Move to lisp.h as an inline function).
10289 (Fconstrain_to_field): Don't assume integers are nonnegative.
10290 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
10291 (Fsubst_char_in_region, Fsave_restriction):
10292 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10293 (Femacs_pid): Don't assume pid_t fits into fixnum.
10294 (lo_time): Use int, not EMACS_INT, when int suffices.
10295 (lisp_time_argument): Check for usec out of range.
10296 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
10297 (Fuser_login_name, Fuser_full_name): Signal an error
10298 if a uid argument is out of range, rather than relying on
10299 undefined behavior.
c8d5c857
PE
10300 (Fformat_time_string): Remove now-unnecessary check.
10301 lisp_time_argument checks for out-of-range usec now.
243e0530 10302 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
10303 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
10304 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
10305 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
10306 (init_cmdargs, Fdump_emacs):
10307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10308 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
10309 the bottom (typically) 32 bits of the fixnum.
10310 * eval.c (specpdl_size, call_debugger):
10311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10312 (when_entered_debugger, Fbacktrace_debug):
10313 Don't assume fixnum can fit in int.
10314 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
10315 the object just before a buffer; this is not portable.
10316 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
10317 (grow_specpdl, unbind_to):
10318 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10319 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
10320 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 10321 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
10322 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
10323 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
10324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10325 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
10326 (a_write, e_write):
10327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10328 (Fcopy_file, non_regular_nbytes, read_non_regular)
10329 (Finsert_file_contents):
10330 Use int, not EMACS_INT, where int is wide enough.
10331 (READ_BUF_SIZE): Verify that it fits in int.
10332 (Finsert_file_contents): Check that counts are in proper range,
10333 rather than assuming fixnums fit into ptrdiff_t etc.
10334 Don't assume fixnums fit into int.
125b3835 10335 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
10336 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
10337 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
10338 (string_char_to_byte, string_byte_to_char)
10339 (string_make_multibyte, string_to_multibyte)
10340 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
10341 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
10342 (substring_both, Fdelete, internal_equal, Ffillarray)
10343 (Fclear_string, mapcar1)
10344 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
10345 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
10346 (larger_vector, make_hash_table, maybe_resize_hash_table)
10347 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
10348 (Fmaphash, secure_hash):
10349 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10350 (concat): Check for string index and length overflow.
10351 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
10352 (Frequire):
10353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10354 (larger_vector): New API (vec, incr_min, size_max) replaces old
10355 one (vec, new_size, init). This catches size overflow.
10356 INIT was removed because it was always Qnil.
10357 All callers changed.
10358 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
10359 the upper bound on a hash table index size.
10360 (make_hash_table, maybe_resize_hash_table): Use it.
10361 (secure_hash): Computer start_byte and end_byte only after
10362 they're known to be in ptrdiff_t range.
10363 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
10364 (Ffont_get_glyphs, Ffont_at):
10365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10366 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
10367 (Flist_fonts, Fopen_font):
10368 Don't assume fixnum can fit in int.
10369 (check_gstring): Don't assume index can fit in int.
10370 (font_match_p): Check that fixnum is a character, not a nonnegative
10371 fixnum, since the later code needs to stuff it into an int.
10372 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
10373 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
10374 conversion overflow issues.
10375 (Fopen_font): Check for integer out of range.
10376 (Ffont_get_glyphs): Don't assume index can fit in int.
10377 * font.h: Adjust decls to match defn changes elsewhere.
10378 * fontset.c (reorder_font_vector): Redo score calculation to avoid
10379 integer overflow.
10380 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
10381 printmax_t, where ptrdiff_t is wide enough.
10382 (Finternal_char_font):
10383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10384 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
10385 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
10386 (Fset_frame_position, x_set_frame_parameters)
10387 (x_set_line_spacing, x_set_border_width)
10388 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
10389 Check that fixnums are in proper range for system types.
10390 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
10391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10392 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
10393 Use SAFE_ALLOCA_LISP, not alloca.
10394 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
10395 intptr_t is wide enough.
10396 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
10397 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
10398 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
10399 Check for fixnum out of range.
10400 * ftfont.c (ftfont_list): Don't assume index fits in int.
10401 Check that fixnums are in proper range for system types.
10402 (ftfont_shape_by_flt):
10403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
10404 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10405 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10406 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10407 Check that fixnums are in proper range for system types.
10408 * gnutls.h: Adjust decls to match defn changes elsewhere.
10409 * gtkutil.c (xg_dialog_run):
10410 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10411 (update_frame_tool_bar):
10412 Check that fixnums are in proper range for system types.
10413 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 10414 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
10415 * indent.c (last_known_column, last_known_column_point):
10416 (current_column_bol_cache):
10417 (skip_invisible, current_column, check_display_width):
10418 (check_display_width, scan_for_column, current_column_1)
10419 (Findent_to, Fcurrent_indentation, position_indentation)
10420 (indented_beyond_p, Fmove_to_column, compute_motion):
10421 (Fcompute_motion, Fvertical_motion):
10422 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10423 (last_known_column_modified): Use EMACS_INT, not int.
10424 (check_display_width):
10425 (Fcompute_motion):
10426 Check that fixnums and floats are in proper range for system types.
10427 (compute_motion): Don't assume index or fixnum fits in int.
10428 (compute_motion, Fcompute_motion):
10429 Use int, not EMACS_INT, when it is wide enough.
10430 (vmotion): Omit local var start_hpos that is always 0; that way
10431 we don't need to worry about overflow in expressions involving it.
10432 * indent.h: Adjust decls to match defn changes elsewhere.
10433 (struct position):
10434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10435 Use int, not EMACS_INT, where int is wide enough.
10436 Remove unused members ovstring_chars_done and tab_offset;
10437 all uses removed.
10438 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10439 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10440 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10441 (make_gap, copy_text, insert, insert_and_inherit)
10442 (insert_before_markers, insert_before_markers_and_inherit)
10443 (insert_1, count_combining_before, count_combining_after)
10444 (insert_1_both, insert_from_string)
10445 (insert_from_string_before_markers, insert_from_string_1)
10446 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10447 (adjust_after_replace, adjust_after_insert, replace_range)
10448 (replace_range_2, del_range, del_range_1, del_range_byte)
10449 (del_range_both, del_range_2, modify_region)
10450 (prepare_to_modify_buffer, signal_before_change)
10451 (signal_after_change, Fcombine_after_change_execute):
10452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10453 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10454 (balance_an_interval, split_interval_right, split_interval_left)
10455 (find_interval, next_interval, update_interval)
10456 (adjust_intervals_for_insertion, delete_node, delete_interval)
10457 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10458 (static_offset_intervals, offset_intervals)
10459 (merge_interval_right, merge_interval_left, make_new_interval)
10460 (graft_intervals_into_buffer, temp_set_point_both)
10461 (temp_set_point, set_point, adjust_for_invis_intang)
10462 (set_point_both, move_if_not_intangible, get_property_and_range)
10463 (get_local_map, copy_intervals, copy_intervals_to_string)
10464 (compare_string_intervals, set_intervals_multibyte_1):
10465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10466 * intervals.h: Adjust decls to match defn changes elsewhere.
10467 (struct interval):
10468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10469 * keyboard.c (this_command_key_count, this_single_command_key_start)
10470 (before_command_key_count, before_command_echo_length, echo_now)
10471 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10472 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10473 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10474 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10476 (last_non_minibuf_size, last_point_position, echo_truncate)
10477 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10478 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10479 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10480 (stuff_buffered_input):
10481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10482 (last_auto_save, command_loop_1, read_char):
10483 Use EMACS_INT, not int, to avoid integer overflow.
10484 (record_char): Avoid overflow in total_keys computation.
10485 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10486 * keyboard.h: Adjust decls to match defn changes elsewhere.
10487 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10488 (Fkey_description, Fdescribe_vector, Flookup_key):
10489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10490 (click_position): New function, to check that positions are in range.
10491 (Fcurrent_active_maps):
10492 (describe_command):
10493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10494 (Faccessible_keymaps, Fkey_description):
10495 (preferred_sequence_p):
10496 Don't assume fixnum can fit into int.
10497 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10498 Check for integer overflow in size calculations.
10499 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10500 avoid mishandling large integers.
10501 * lisp.h: Adjust decls to match defn changes elsewhere.
10502 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10503 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10504 (struct Lisp_Marker):
10505 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10506 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
10507 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10508 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10509 All callers changed.
10510 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10511 Assume the arg has valid form, since it always does.
10512 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10513 unsigned integer system type.
10514 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10515 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10516 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10517 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10518 (duration_to_sec_usec): New decl.
10519 * lread.c (read_from_string_index, read_from_string_index_byte)
10520 (read_from_string_limit, readchar, unreadchar, openp)
10521 (read_internal_start, read1, oblookup):
10522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10523 (Fload, readevalloop, Feval_buffer, Feval_region):
10524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10525 (openp): Check for out-of-range argument to 'access'.
10526 (read1): Use int, not EMACS_INT, where int is wide enough.
10527 Don't assume fixnum fits into int.
6efdadfd 10528 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
10529 (read_filtered_event): Use duration_to_sec_usec
10530 to do proper overflow checking on durations.
d311d28c
PE
10531 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10532 in size calculation.
10533 (Fexecute_kbd_macro):
10534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10535 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10536 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10537 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10538 (set_marker_both, set_marker_restricted_both, marker_position)
10539 (marker_byte_position, Fbuffer_has_markers_at):
10540 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10541 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 10542 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
10543 It now merely ensures that the menu is large enough, without
10544 necessarily growing it, as this avoids some integer overflow issues.
10545 All callers changed.
10546 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10548 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10549 Use SAFE_ALLOCA_LISP, not alloca.
10550 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10551 to EMACS_INT. Check that fixnums are in proper range for system types.
10552 * minibuf.c (minibuf_prompt_width, string_to_object)
10553 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10554 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10556 (get_minibuffer, read_minibuf_unwind):
10557 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10558 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10559 this simplifies overflow checking. All callers changed.
10560 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10561 (Ftest_completion):
10562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10563 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10564 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10565 Check that fixnums are in proper range for system types.
10566 (Fx_create_frame, Fx_show_tip):
10567 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10568 * nsfont.m (ns_findfonts, nsfont_list_family):
10569 Don't assume fixnum fits in long.
10570 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10571 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10572 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10573 wide enough.
17fdb222 10574 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
10575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10576 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10577 (PRINTDECLARE, PRINTPREPARE):
10578 (strout, print_string):
10579 (print, print_preprocess, print_check_string_charset_prop)
10580 (print_object):
10581 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10582 (PRINTDECLARE):
10583 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10584 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10585 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 10586 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 10587 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
10588 (print_error_message): Use SAFE_ALLOCA, not alloca.
10589 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
10590 (print_depth, new_backquote_output, print_number_index):
10591 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
10592 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10593 (Fset_process_window_size, Fformat_network_address)
10594 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 10595 (sigchld_handler):
d311d28c 10596 Check that fixnums are in proper range for system types.
d44287d4 10597 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
10598 Check for process-ids out of pid_t range rather than relying on
10599 undefined behavior.
e4d81efc 10600 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
10601 (Fformat_network_address, read_process_output, send_process)
10602 (Fprocess_send_region, status_notify):
10603 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10604 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10605 (wait_reading_process_output, read_process_output, exec_sentinel):
10606 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10607 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10608 (Faccept_process_output): Use duration_to_sec_usec to do proper
10609 overflow checking on durations.
dde14581
PE
10610 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10611 Don't assume pid_t fits in int.
02481186
PE
10612 * process.h (struct Lisp_Process): Members tick and update_tick
10613 are now of type EMACS_INT, not int.
b62b53e8
PE
10614 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10615 configured --with-wide-int.
d311d28c
PE
10616 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10617 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10618 * search.c (looking_at_1, string_match_1):
10619 (fast_string_match, fast_c_string_match_ignore_case)
10620 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10621 (scan_newline, find_before_next_newline, search_command)
10622 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10623 (set_search_regs, wordify):
10624 (Freplace_match):
10625 (Fmatch_data):
10626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10627 (string_match_1, search_buffer, set_search_regs):
10628 (Fmatch_data):
10629 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10630 (wordify): Check for overflow in size calculation.
10631 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10632 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10633 Check that fixnums are in proper range for system types.
10634 * sound.c (struct sound_device)
10635 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10637 (Fplay_sound_internal):
10638 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 10639 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
10640 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10641 (Fparse_partial_sexp):
10642 Don't assume fixnums can fit in int.
10643 (struct lisp_parse_state, find_start_pos, find_start_value)
10644 (find_start_value_byte, find_start_begv)
10645 (update_syntax_table, char_quoted, dec_bytepos)
10646 (find_defun_start, prev_char_comend_first, back_comment):
10647 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10648 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10649 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10650 (Finternal_describe_syntax_value): Check that match_lisp is a
10651 character, not an integer, since the code stuffs it into int.
10652 (scan_words, scan_sexps_forward):
10653 Check that fixnums are in proper range for system types.
10654 (Fforward_word):
10655 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10656 (scan_sexps_forward):
10657 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10658 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10659 * syntax.h: Adjust decls to match defn changes elsewhere.
10660 (struct gl_state_s):
10661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
10662 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10663 MOST_POSITIVE_FIXNUM.
d311d28c
PE
10664 * sysdep.c (wait_for_termination_1, wait_for_termination)
10665 (interruptible_wait_for_termination, mkdir):
10666 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10667 (emacs_read, emacs_write):
10668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
10669 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10670 and double all fit in int.
d311d28c
PE
10671 * term.c (set_tty_color_mode):
10672 Check that fixnums are in proper range for system types.
10673 * termhooks.h (struct input_event):
10674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10675 * textprop.c (validate_interval_range, interval_of)
10676 (Fadd_text_properties, set_text_properties_1)
10677 (Fremove_text_properties, Fremove_list_of_text_properties)
10678 (Ftext_property_any, Ftext_property_not_all)
10679 (copy_text_properties, text_property_list, extend_property_ranges)
10680 (verify_interval_modification):
10681 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10682 (Fnext_single_char_property_change)
10683 (Fprevious_single_char_property_change):
10684 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
10685 (copy_text_properties):
10686 Check for integer overflow in index calculation.
d311d28c
PE
10687 * undo.c (last_boundary_position, record_point, record_insert)
10688 (record_delete, record_marker_adjustment, record_change)
10689 (record_property_change):
10690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10691 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10692 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10693 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10694 (Fx_hide_tip, Fx_file_dialog):
10695 * w32menu.c (set_frame_menubar):
10696 Use ptrdiff_t, not int, for consistency with rest of code.
10697 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10698 (select_window, Fdelete_other_windows_internal)
10699 (window_scroll_pixel_based, window_scroll_line_based)
10700 (Frecenter, Fset_window_configuration):
10701 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10702 (Fset_window_hscroll, run_window_configuration_change_hook)
10703 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 10704 (Fscroll_other_window, Frecenter):
d311d28c
PE
10705 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10706 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10707 Don't assume fixnum fits in int.
10708 (Fset_window_scroll_bars):
10709 Check that fixnums are in proper range for system types.
10710 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10711 (string_pos, c_string_pos, number_of_chars, init_iterator)
10712 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10713 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10714 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
10715 (face_before_or_after_it_pos, handle_invisible_prop)
10716 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
10717 (display_prop_intangible_p, string_buffer_position_lim)
10718 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10719 (get_overlay_strings_1, get_overlay_strings)
10720 (iterate_out_of_display_property, forward_to_next_line_start)
10721 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10722 (get_next_display_element, set_iterator_to_next)
10723 (get_visually_first_element, compute_stop_pos_backwards)
10724 (handle_stop_backwards, next_element_from_buffer)
10725 (move_it_in_display_line_to, move_it_in_display_line)
10726 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10727 (add_to_log, message_dolog, message_log_check_duplicate)
10728 (message2, message2_nolog, message3, message3_nolog
10729 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10730 (current_message_1, truncate_echo_area, truncate_message_1)
10731 (set_message, set_message_1, store_mode_line_noprop)
10732 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10733 (text_outside_line_unchanged_p, check_point_in_composition)
10734 (reconsider_clip_changes)
10735 (redisplay_internal, set_cursor_from_row, try_scrolling)
10736 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10737 (redisplay_window, find_last_unchanged_at_beg_row)
10738 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10739 (trailing_whitespace_p, find_row_edges, display_line)
10740 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10741 (display_mode_element, store_mode_line_string)
10742 (pint2str, pint2hrstr, decode_mode_spec)
10743 (display_count_lines, display_string, draw_glyphs)
10744 (x_produce_glyphs, x_insert_glyphs)
10745 (rows_from_pos_range, mouse_face_from_buffer_pos)
10746 (fast_find_string_pos, mouse_face_from_string_pos)
10747 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10748 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10749 (safe_call, init_from_display_pos, handle_fontified_prop)
10750 (handle_single_display_spec, load_overlay_strings)
10751 (with_echo_area_buffer, setup_echo_area_for_printing)
10752 (display_echo_area, echo_area_display)
10753 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10754 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
10755 (redisplay_window, dump_glyph_row, display_mode_line)
10756 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 10757 (handle_display_spec, display_prop_string_p):
d311d28c
PE
10758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10759 (handle_single_display_spec, build_desired_tool_bar_string)
10760 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10761 (get_specified_cursor_type):
10762 Check that fixnums are in proper range for system types.
10763 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10764 (Flookup_image_map):
10765 Don't assume fixnums fit in int.
10766 (compare_overlay_entries):
10767 Avoid mishandling comparisons due to subtraction overflow.
10768 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10769 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10770 (handle_tool_bar_click):
10771 Use int, not unsigned, since we prefer signed and the signedness
10772 doesn't matter here.
10773 (get_next_display_element, next_element_from_display_vector):
10774 Use int, not EMACS_INT, when int is wide enough.
10775 (start_hourglass): Use duration_to_sec_usec to do proper
10776 overflow checking on durations.
10777 * xfaces.c (Fbitmap_spec_p):
10778 Check that fixnums are in proper range for system types.
10779 (compare_fonts_by_sort_order):
10780 Avoid mishandling comparisons due to subtraction overflow.
10781 (Fx_family_fonts, realize_basic_faces):
10782 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10783 (Fx_family_fonts):
10784 Don't assume fixnum fits in int.
10785 Use SAFE_ALLOCA_LISP, not alloca.
10786 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10787 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10788 (face_at_buffer_position, face_for_overlay_string)
10789 (face_at_string_position):
10790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10791 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10792 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10793 (Fx_show_tip):
10794 Check that fixnums are in proper range for system types.
10795 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10796 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10798 (Fx_change_window_property): Don't assume fixnums fit in int.
10799 * xfont.c (xfont_chars_supported):
10800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10801 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10802 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10804 * xml.c (parse_region):
10805 * xrdb.c (magic_file_p):
10806 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10807 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10808 (x_get_local_selection, x_reply_selection_request)
10809 (x_handle_selection_request, wait_for_property_change):
10810 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10811 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10812 short is wide enough.
10813 (x_send_client_event): Don't assume fixnum fits in int.
10814 * xterm.c (x_x_to_emacs_modifiers):
10815 Don't assume EMACS_INT overflows nicely into int.
10816 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10817 may come from Lisp.
10818 (handle_one_xevent): NATNUMP can eval its arg twice.
10819 (x_connection_closed):
10820 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10821 * xterm.h: Adjust decls to match defn changes elsewhere.
10822 (struct scroll_bar): Use struct vectorlike_header
10823 rather than rolling our own approximation.
10824 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10825
c6574eb5
GM
108262012-05-25 Glenn Morris <rgm@gnu.org>
10827
10828 * lisp.mk (lisp): Update for more files being compiled now.
10829
e8d32c7e
SM
108302012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10831
48def666
SM
10832 * lread.c: Remove `read_pure' which makes no difference.
10833 (read_pure): Remove var.
10834 (unreadpure): Remove function.
10835 (readevalloop): Don't call read_list with -1 flag.
10836 (read1, read_vector): Don't test read_pure any more.
10837 (read_list): Simplify.
10838
e8d32c7e
SM
10839 * fileio.c, character.h: Minor style tweaks.
10840
4b2addb7
DA
108412012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10842
10843 * window.h (clip_changed): Remove useless declaration.
10844
584461b2
JB
108452012-05-22 Juanma Barranquero <lekktu@gmail.com>
10846
10847 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10848 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10849
34374650
PE
108502012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10851
10852 Remove src/m/*.
10853 This directory predates autoconf and is no longer needed nowadays.
10854 Move its few remaining bits of functionality to where they're needed.
10855 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10856 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10857 * m/template.h: Remove.
10858 * Makefile.in (M_FILE): Remove. All uses removed.
10859 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10860 * lisp.h (USE_LSB_TAG):
10861 * mem-limits.h (EXCEEDS_LISP_PTR):
10862 Use VAL_MAX, not VALBITS, in #if.
10863 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10864 (EMACS_UINT): Define unconditionally now.
10865 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10866 (BITS_PER_EMACS_INT): New constants, replacing
10867 what used to be in config.h, but not useful in #if.
10868 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10869 define them any more.
10870 (VAL_MAX): New macro.
10871 (VALMASK): Use it.
10872 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10873 BITS_PER_EMACS_INT, in #if.
10874 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10875 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10876 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10877 * s/ms-w32.h (DATA_START):
10878 Move here from removed file m/intel386.h.
10879 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10880 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10881
261cb4bb
PE
108822012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10883
10884 Assume C89 or later.
10885 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10886 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10887 (xrealloc):
10888 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10889 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10890 * textprop.c, tparam.c (NULL): Remove.
10891 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10892 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10893 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10894 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10895 * xterm.c (input_signal_count): Assume volatile works.
10896
ff23cd9f
KB
108972012-05-21 Ken Brown <kbrown@cornell.edu>
10898
10899 * xgselect.c (xg_select): Fix first argument in call to 'select'
10900 (bug#11508).
10901
1b170bc6
KB
109022012-05-20 Ken Brown <kbrown@cornell.edu>
10903
10904 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 10905 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 10906
b2f4d39f
KB
109072012-05-19 Ken Brown <kbrown@cornell.edu>
10908
10909 * xfns.c (x_in_use): Remove `static' qualifier.
10910 * xterm.h (x_in_use): Declare.
10911 * xgselect.c: Include xterm.h.
10912 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10913 and `display_arg' (bug#9754).
10914
003fdae2
PE
109152012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10916
9232a6d9
PE
10917 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10918
003fdae2
PE
10919 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10920 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10921
784b56e2
EZ
109222012-05-18 Eli Zaretskii <eliz@gnu.org>
10923
10924 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10925
10926 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 10927 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
10928
10929 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10930 reference to image_cache->refcount.
10931 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10932
a0a79cde
JL
109332012-05-17 Juri Linkov <juri@jurta.org>
10934
10935 * search.c (Fword_search_regexp, Fword_search_backward)
10936 (Fword_search_forward, Fword_search_backward_lax)
10937 (Fword_search_forward_lax): Move functions to isearch.el
10938 (bug#10145, bug#11381).
10939
b0572523
PE
109402012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10941
10942 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10943
9660f5fc
SM
109442012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10945
10946 * lread.c (init_obarray): Declare Qt and Qnil as special.
10947
4374de83
GM
109482012-05-14 Glenn Morris <rgm@gnu.org>
10949
10950 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 10951 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 10952
dc44c39a
PE
109532012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10954
078c97cb
PE
10955 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10956
dc44c39a
PE
10957 * unexaix.c: Port to more-recent AIX compilers.
10958 (report_error, report_error_1, make_hdr, copy_sym)
10959 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10960 Make arguments const char *, not char *, to avoid violations of C
10961 standard and to fix some AIX warnings reported by Gilles Pion.
10962
e18afed7 109632012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
10964
10965 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10966 already have overlays loaded.
10967 (handle_single_display_spec): Before returning without displaying
10968 fringe bitmap, synchronize the bidi iterator with the main display
10969 iterator, by calling iterate_out_of_display_property.
10970 (iterate_out_of_display_property): Detect buffer iteration by
10971 testing that it->string is a Lisp string.
10972 (get_next_display_element): When the current object is exhausted,
10973 and there's something on it->stack, call set_iterator_to_next to
10974 proceed with what's on the stack, instead of returning zero.
10975 (set_iterator_to_next): If called at the end of a Lisp string,
10976 proceed to consider_string_end without incrementing string
10977 position. Don't increment display vector index past the end of
10978 the display vector. (Bug#11417)
c8fb9dc6
EZ
10979 (pos_visible_p): Don't report a position visible when move_it_to
10980 stopped at the last line of window, which happens to be scanned
10981 backwards by the bidi iteration. (Bug#11464)
ac268e67 10982
e18afed7 109832012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
10984
10985 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10986 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
10987 are on a TTY, and thus unable to display on the fringes.
10988 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
10989 so we need to signal to the caller that this is a "replacing"
10990 display spec. This fixes display when the spec is invalid or we
10991 are on a TTY.
10992
e18afed7 109932012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
10994
10995 * unexaix.c (make_hdr): Fix typo in prototype.
10996 This bug broke the build on AIX. Problem reported by Gilles Pion.
10997
9d0a235a
MA
109982012-05-14 Michael Albinus <michael.albinus@gmx.de>
10999
11000 * keyboard.c (kbd_buffer_get_event): Read special events also in
11001 batch mode. (Bug#11415)
11002
9e6b06ed
GM
110032012-05-12 Glenn Morris <rgm@gnu.org>
11004
11005 * ns.mk: Update for ns_appbindir no longer having trailing "/".
11006
c1a1d7a3
EZ
110072012-05-12 Eli Zaretskii <eliz@gnu.org>
11008
11009 * lisp.mk (lisp): Add newcomment.elc.
11010
3fe7cdc8
GM
110112012-05-12 Glenn Morris <rgm@gnu.org>
11012
11013 * Makefile.in (MKDIR_P): New, set by configure.
11014 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
11015
53f7d2c0
PE
110162012-05-11 Paul Eggert <eggert@cs.ucla.edu>
11017
11018 Remove unused function hourglass_started.
11019 * dispextern.h (hourglass_started):
11020 * w32fns.c (hourglass_started):
11021 * xdisp.c (hourglass_started): Remove.
11022
75aafb17
JB
110232012-05-10 Juanma Barranquero <lekktu@gmail.com>
11024
11025 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
11026 Update dependencies.
11027
12959e8e
PE
110282012-05-10 Paul Eggert <eggert@cs.ucla.edu>
11029
97107e2e
PE
11030 * xgselect.c (xg_select): Put maxfds+1 into a var.
11031 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
11032
12959e8e
PE
11033 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
11034
836d29b3
DA
110352012-05-10 Dave Abrahams <dave@boostpro.com>
11036
11037 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
11038 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
11039
5cb67954
MA
110402012-05-09 Michael Albinus <michael.albinus@gmx.de>
11041
11042 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 11043 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
11044 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
11045 Initialize xd_registered_buses.
11046
3478ec45
PE
110472012-05-09 Paul Eggert <eggert@cs.ucla.edu>
11048
b263a6b0
PE
11049 Untag more efficiently if USE_LSB_TAG.
11050 This is based on a proposal by YAMAMOTO Mitsuharu in
11051 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
11052 For an admittedly artificial (nth 8000 longlist) benchmark on
11053 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
11054 Emacs's overall text size by 1%.
11055 * lisp.h (XUNTAG): New macro.
11056 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
11057 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
11058 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
11059 * eval.c (Fautoload):
11060 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
11061 * frame.h (XFRAME): Use XUNTAG.
11062
3478ec45
PE
11063 Port recent dbusbind.c changes to 32-bit --with-wide-int.
11064 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
11065 Remove unportable assumptions about print widths of types like
11066 dbus_uint32_t.
11067 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
11068 intptr_t when converting between pointer and integer, to avoid GCC
11069 warnings about wrong width.
11070
666b903b 110712012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
11072
11073 * w32proc.c (new_child): Force Windows to reserve only 64KB of
11074 stack for each reader_thread, instead of defaulting to 8MB
11075 determined by the linker. This avoids failures in creating
11076 subprocesses on Windows 7, see the discussion in this thread:
11077 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
11078
b120cc17
JC
110792012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
11080
11081 Fix up display of the *Minibuf-0* buffer in the mini window.
11082 * keyboard.c (read_char): Don't clear the echo area if there's no
11083 message to clear.
11084 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 11085 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 11086
9a4b36f8
MA
110872012-05-07 Michael Albinus <michael.albinus@gmx.de>
11088
11089 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
11090 batch mode.
11091
e5f9458f
CY
110922012-05-06 Chong Yidong <cyd@gnu.org>
11093
11094 * lisp.mk (lisp): Update.
11095
eceeb5fc 110962012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
11097
11098 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
11099
71873e2b
SM
111002012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
11101
11102 * data.c (PUT_ERROR): New macro.
11103 (syms_of_data): Use it. Add new error type `user-error'.
11104 * undo.c (user_error): New function.
11105 (Fprimitive_undo): Use it.
11106 * print.c (print_error_message): Adjust print style for `user-error'.
11107 * keyboard.c (user_error): New function.
11108 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
11109
ab0fa4e4
PE
111102012-05-03 Paul Eggert <eggert@cs.ucla.edu>
11111
11112 Do not limit current-time-string to years 1000..9999.
11113 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
11114 (Fcurrent_time_string): Support any year that is supported by the
11115 underlying localtime representation. Don't use asctime, as it
11116 has undefined behavior for years outside the range -999..9999.
11117
7ed806a7
PE
111182012-05-02 Paul Eggert <eggert@cs.ucla.edu>
11119
11120 Fix race conditions involving setenv, gmtime, localtime, asctime.
11121 Without this fix, interrupts could mess up code that uses these
11122 nonreentrant functions, since setting TZ invalidates existing
11123 tm_zone or tzname values, and since most of these functions return
11124 pointers to static storage.
11125 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
11126 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
11127 Grow the critical sections to include not just invoking
11128 localtime/gmtime, but also accessing these functions' results
11129 including their tm_zone values if any, and any related TZ setting.
11130 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
11131 so that the struct tm is saved in the critical section.
11132 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
11133 motivated by the fact that memory allocation needs to be outside
11134 the critical section.
11135
0c16dfed
DA
111362012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
11137
11138 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
11139 with RESET_INTERVAL.
11140
11141 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11142 Remove duplicated buffer name initialization.
11143
3f83ace8
JM
111442012-05-02 Jim Meyering <jim@meyering.net>
11145
11146 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
11147
c7b8541e
JM
11148 * xfns.c (x_window): Use xstrdup (Bug#11375).
11149
90207a15 111502012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
11151
11152 * xdisp.c (pos_visible_p): If already at a newline from the
11153 display string before the 'while' loop, don't walk back the glyphs
11154 from it3.glyph_row. Solves assertion violation when the display
11155 string begins with a newline (egg.el). (Bug#11367)
11156
b593d6a9
AH
111572012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
11158
11159 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
11160 Move to simple.el.
11161
4737362e
GM
111622012-05-01 Glenn Morris <rgm@gnu.org>
11163
99cf43f9
GM
11164 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
11165 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
11166 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
11167 All were removed before 23.1.
11168
9311dcff
GM
11169 * dispnew.c: Remove HAVE_LIBNCURSES test;
11170 it is always true on relevant platforms.
11171
4d5c6349
GM
11172 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
11173 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
11174
4737362e
GM
11175 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
11176
74dd3a6b
AS
111772012-04-30 Andreas Schwab <schwab@linux-m68k.org>
11178
11179 * .gdbinit (xpr): Remove checks for no longer existing misc types.
11180 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
11181 Remove.
11182
13c379ee
PE
111832012-04-28 Paul Eggert <eggert@cs.ucla.edu>
11184
11185 Do not avoid creating empty evaporating overlays (Bug#9642).
11186 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
11187 That is, do not delete an evaporating overlay if it becomes
11188 empty after its bounds are adjusted to fit within its buffer.
11189 This fix caused other problems, and I'm reverting it until we get
11190 to the bottom of them.
11191
a8e7d6d7 111922012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
11193
11194 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
11195
a8e7d6d7 111962012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
11197
11198 * xdisp.c (pos_visible_p): If the window start position is beyond
11199 ZV, start the display from buffer beginning. Prevents assertion
11200 violation in init_iterator when the minibuffer window is scrolled
11201 via the scroll bar.
11202
11203 * window.c (window_scroll_pixel_based): Likewise.
11204
a8e7d6d7 112052012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
11206
11207 * keymap.c (where_is_internal): Doc fix (Bug#10872).
11208
a8e7d6d7 112092012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
11210
11211 * fileio.c (Fcopy_file, Fset_file_selinux_context):
11212 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
11213
a8e7d6d7 112142012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 11215
b593d6a9
AH
11216 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
11217 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 11218
1c6900d9
EZ
112192012-04-26 Eli Zaretskii <eliz@gnu.org>
11220
4c3fa1d9
EZ
11221 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
11222 display element, check also the underlying string or buffer
11223 character. (Bug#11341)
11224
1c6900d9
EZ
11225 * w32menu.c: Include w32heap.h.
11226 (add_menu_item): If the call to AppendMenuW (via
11227 unicode_append_menu) fails, disable Unicode menus only if we are
11228 running on Windows 9X/Me.
11229
42bf8205
AS
112302012-04-24 Andreas Schwab <schwab@linux-m68k.org>
11231
11232 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
11233 (xgetint): Add missing shift for LSB tags.
11234
b1bac16e
MR
112352012-04-24 Martin Rudalics <rudalics@gmx.at>
11236
11237 * keyboard.c (read_char): Don't wipe echo area for select window
11238 events: These might get delayed via `mouse-autoselect-window'
11239 (Bug#11304).
11240
d69621cc
JB
112412012-04-24 Juanma Barranquero <lekktu@gmail.com>
11242
11243 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
11244 manipulation of :loaded-from data.
11245
02fd101b
JB
112462012-04-23 Juanma Barranquero <lekktu@gmail.com>
11247
11248 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
11249 now a cons (bug#11311).
11250
888bec30
PE
112512012-04-23 Paul Eggert <eggert@cs.ucla.edu>
11252
89a438bd
PE
11253 Do not create empty overlays with the evaporate property (Bug#9642).
11254 * buffer.c (Fmove_overlay): Delete an evaporating overlay
11255 if it becomes empty after its bounds are adjusted to fit within
11256 its buffer. Without this fix, in a nonempty buffer (let ((o
11257 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
11258 yields an empty overlay that has the evaporate property, which is
11259 not supposed to happen.
11260
1068fe4d
PE
11261 Fix minor GTK3 problems found by static checking.
11262 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11263 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11264 (struct _EmacsFixedClass, emacs_fixed_get_type):
11265 Move decls here from emacsgtkfixed.h, since they needn't be public.
11266 (emacs_fixed_get_type): Now static.
11267 (emacs_fixed_class_init): Omit unused local.
11268 (emacs_fixed_child_type): Remove; unused.
11269 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11270 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11271 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
11272 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
11273 (EMACS_FIXED_GET_CLASS): Remove; unused.
11274 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
11275
888bec30
PE
11276 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
11277 Problem reported by Juanma Barranquero for Windows -Wunused-function.
11278
de85e130
PE
112792012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11280
d0baac98 11281 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 11282 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
11283 (__malloc_size_t, __malloc_ptrdiff_t):
11284 Remove. All uses removed, replaced by the definiens if needed,
11285 since we can assume C89 or better now.
11286 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
11287 (protect_malloc_state, align, get_contiguous_space)
11288 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
11289 (malloc_atfork_handler_child, malloc_enable_thread)
11290 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
11291 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
11292 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
11293 (special_realloc, _realloc_internal_nolock, _realloc_internal)
11294 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
11295 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
11296 Define using prototypes, not old style.
11297 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
11298 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
11299 (align): Don't assume that signed integer overflow wraps around.
11300 Omit unused local var.
11301 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
11302 (_free_internal_nolock, memalign, mallochook, reallochook):
11303 Omit no-longer-needed casts.
11304 (valloc): Use getpagesize, not __getpagesize.
11305 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
11306 (struct hdr): The 'magic' member is now size_t, not unsigned long.
11307
de85e130
PE
11308 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
11309
dcbf5805
MA
113102012-04-22 Michael Albinus <michael.albinus@gmx.de>
11311
11312 Move functions from C to Lisp. Make non-blocking method calls
11313 the default. Implement further D-Bus standard interfaces.
11314
11315 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
11316 (QCdbus_request_name_allow_replacement)
11317 (QCdbus_request_name_replace_existing)
11318 (QCdbus_request_name_do_not_queue)
11319 (QCdbus_request_name_reply_primary_owner)
11320 (QCdbus_request_name_reply_in_queue)
11321 (QCdbus_request_name_reply_exists)
11322 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
11323 (QCdbus_registered_serial, QCdbus_registered_method)
11324 (QCdbus_registered_signal): New Lisp objects.
11325 (XD_DEBUG_MESSAGE): Use sizeof.
11326 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
11327 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
11328 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
11329 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
11330 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
11331 (xd_signature, xd_append_arg): Allow float for integer types.
11332 (xd_get_connection_references): New function.
b593d6a9
AH
11333 (xd_get_connection_address): Rename from xd_initialize.
11334 Return cached address.
dcbf5805
MA
11335 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
11336 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
11337 level.
11338 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 11339 Return number of refcounts.
dcbf5805
MA
11340 (Fdbus_get_unique_name): Make stronger parameter check.
11341 (Fdbus_message_internal): New defun.
11342 (Fdbus_call_method, Fdbus_call_method_asynchronously)
11343 (Fdbus_method_return_internal, Fdbus_method_error_internal)
11344 (Fdbus_send_signal, Fdbus_register_service)
11345 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
11346 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
11347 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
11348 (Vdbus_compiled_version, Vdbus_runtime_version)
11349 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
11350 (Vdbus_message_type_method_return, Vdbus_message_type_error)
11351 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
11352 (Vdbus_registered_buses, Vdbus_registered_objects_table):
11353 Adapt docstring.
dcbf5805 11354
52828e02
PE
113552012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11356
da05bc4c
PE
11357 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
11358 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
11359 Do not assume ptrdiff_t is the same width as 'int'.
11360
52828e02
PE
11361 * alloc.c: Handle unusual debugging option combinations.
11362 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
11363 since the two debugging options are incompatible.
11364 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
11365 is defined.
11366 (mem_init, mem_insert, mem_insert_fixup):
11367 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
11368 (NEED_MEM_INSERT): Remove; no longer needed.
11369
f01769f9
LL
113702012-04-22 Leo Liu <sdl.web@gmail.com>
11371
11372 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
11373
5790543d
PE
113742012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11375
11376 * sysdep.c [__FreeBSD__]: Minor cleanups.
11377 (list_system_processes, system_process_attributes) [__FreeBSD__]:
11378 Use Emacs indenting style more consistently. Avoid some casts.
11379 Use 'double' consistently rather than mixing 'float' and 'double'.
11380
b91b7e4d
EW
113812012-04-21 Eduard Wiebe <usenet@pusto.de>
11382
b593d6a9
AH
11383 * sysdep.c (list_system_processes, system_process_attributes):
11384 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 11385
6114eb15
AS
113862012-04-21 Andreas Schwab <schwab@linux-m68k.org>
11387
11388 * lisp.mk (lisp): Update.
11389
2f38dff7
PE
113902012-04-20 Paul Eggert <eggert@cs.ucla.edu>
11391
11392 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
11393 It is never used otherwise.
11394
4ae29f89
SM
113952012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
11396
11397 * print.c (print_preprocess): Only check print_depth if print-circle
11398 is nil.
11399 (print_object): Check for cycles even when print-circle is nil and
11400 print-gensym is t, but only check print_depth if print-circle is nil.
11401
f30d612a
CY
114022012-04-20 Chong Yidong <cyd@gnu.org>
11403
11404 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11405 set the status to "failed" and ensure that sentinel is run.
11406
c07a4c0b 114072012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
11408
11409 * process.c (Fset_process_inherit_coding_system_flag)
11410 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 11411 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 11412
c07a4c0b 114132012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
11414
11415 * xdisp.c (string_buffer_position_lim): Limit starting position to
11416 BEGV.
11417 (set_cursor_from_row): If called for a mode-line or header-line
11418 row, return zero immediately.
11419 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
11420 farther than the first row after the header line, if any.
11421 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
11422 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11423
c07a4c0b 114242012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11425
4ae29f89
SM
11426 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11427 (bug#11238).
ad3a2b41 11428
c07a4c0b 114292012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 114302012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
11431
11432 configure: new option --enable-gcc-warnings (Bug#11207)
11433 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11434 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11435 (ALL_CFLAGS): Use new macros rather than old.
11436 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11437 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11438 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11439 -Wunused-result, -Wunused-variable. This should go away once
11440 the Emacs and Gnulib regex code is merged.
11441 (xmalloc, xrealloc): Now static.
11442
aba027e8
PE
114432012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11444
11445 * dired.c (Fsystem_groups): Remove unused local.
11446
e5a36063
GM
114472012-04-17 Glenn Morris <rgm@gnu.org>
11448
11449 * dired.c (Fsystem_users): Doc fix.
11450
316411f0
DA
114512012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11452
11453 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11454 (syms_of_dired): Add them.
11455
9426aba4
PE
114562012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11457
b62a57be
PE
11458 Fix minor alloc.c problems found by static checking.
11459 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11460 New extern decls, to avoid calling undeclared functions.
11461 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11462 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11463 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11464 (NEED_MEM_INSERT): New macro.
11465 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 11466 Remove one incorrect comment and fix another.
b62a57be 11467
3539f31f
PE
11468 Fix minor ralloc.c problems found by static checking.
11469 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11470 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11471 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11472 (r_alloc_sbrk): Now static.
11473
a041960a
PE
11474 Improve ralloc.c interface checking.
11475 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11476 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11477 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11478 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11479 [REL_ALLOC]: ... to here, to check interface.
11480 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11481 Remove decls. This fixes an "It stinks!".
11482
9426aba4
PE
11483 * alloc.c (which_symbols): Fix alignment issue / type clash.
11484
d55c12ed
AS
114852012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11486
11487 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11488 (struct Lisp_Misc_Any): Likewise.
11489 (struct Lisp_Free): Likewise.
11490 * alloc.c (union aligned_Lisp_Symbol): Define.
11491 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11492 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11493 (union aligned_Lisp_Misc): Define.
11494 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11495 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 11496 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 11497
b948ce8b
PE
114982012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11499
11500 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11501 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11502 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11503 * s/netbsd.h, s/sol2-6.h:
11504 Remove definition of GC_MARK_STACK, since the default now works.
11505 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11506 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11507 no longer the default.
11508 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11509
35dc09a1 115102012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11511
35dc09a1
GM
11512 * lread.c (lisp_file_lexically_bound_p):
11513 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 11514
35dc09a1
GM
115152012-04-14 Eli Zaretskii <eliz@gnu.org>
11516
11517 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11518 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11519
115202012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11521
11522 * nsterm.m (constrainFrameRect): Always constrain when there is only
11523 one screen (Bug#10962).
11524
bcd86815
KB
115252012-04-13 Ken Brown <kbrown@cornell.edu>
11526
11527 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11528
c25df26e
RT
115292012-04-13 Reuben Thomas <rrt@sc3d.org>
11530
11531 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11532
0fc59f1e
DC
115332012-04-11 Daniel Colascione <dancol@dancol.org>
11534
11535 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11536 against is gone. It's better to use vfork now so that when Cygwin
11537 gains a new, working vfork, we use it automatically (bug#10398).
11538
de8c03dc
SM
115392012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11540
11541 * window.c (save_window_save): Obey window-point-insertion-type.
11542
2f097256
GM
115432012-04-11 Glenn Morris <rgm@gnu.org>
11544
11545 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11546
453b951e
SM
115472012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11548
11549 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11550
75f1671a 115512012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
11552
11553 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11554 (force_quit_count): New var.
11555 (handle_interrupt): Use it.
11556
2a8ce227
JB
115572012-04-10 Juanma Barranquero <lekktu@gmail.com>
11558
11559 * w32.c (w32_delayed_load): Record the full path of the library
11560 being loaded (bug#10424).
11561
935396c0
GM
115622012-04-09 Glenn Morris <rgm@gnu.org>
11563
05920a43
GM
11564 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11565 not just in the obarray, before snarfing them. (Bug#11036)
11566
935396c0
GM
11567 * Makefile.in ($(leimdir)/leim-list.el):
11568 Pass EMACS rather than BUILT_EMACS.
11569
a18ecafa
TZ
115702012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11571
11572 * process.c (make_process):
11573 * process.h: Add integer `gnutls_handshakes_tried' member to
11574 process struct.
11575
6bbef4e5
JC
11576 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11577 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
11578
11579 * gnutls.c (gnutls_log_function2i): Convenience log function.
11580 (emacs_gnutls_read): Use new log functions,
11581 `gnutls_handshakes_tried' process member, and
11582 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11583 attempts per process (connection).
11584
b4d3bc10
CY
115852012-04-09 Chong Yidong <cyd@gnu.org>
11586
11587 * eval.c (Fuser_variable_p, user_variable_p_eh)
11588 (lisp_indirect_variable): Functions deleted.
11589 (Fdefvar): Caller changed.
11590
11591 * callint.c (Finteractive, Fcall_interactively):
11592 * minibuf.c (Fread_variable): Callers changed.
11593
70f4d973
EZ
115942012-04-09 Eli Zaretskii <eliz@gnu.org>
11595
11596 * xdisp.c (set_cursor_from_row): If the display string appears in
11597 the buffer at position that is closer to point than the position
11598 after the display string, display the cursor on the first glyph of
11599 the display string. Fixes cursor display when a 'display' text
11600 property immediately follows invisible text. (Bug#11094)
11601
cb3c2e3e
PE
116022012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11603
11604 composite.c: use 'double' consistently
11605 * composite.c (get_composition_id): Use 'double' consistently
11606 instead of converting 'float' to 'double' and vice versa; this is
11607 easier to understand and avoids a GCC warning.
11608
fd06db5d
GM
116092012-04-09 Glenn Morris <rgm@gnu.org>
11610
50fe702a
GM
11611 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11612 preparation for dumping it with emacs. (Bug#4789)
11613 (leimdir): New variable.
11614 ($(leimdir)/leim-list.el): New rule.
11615 (emacs$(EXEEXT)): Depend on leim-list.el.
11616
fd06db5d
GM
11617 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11618 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11619 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11620
55c131ee
AS
116212012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11622
11623 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11624 proper alignment.
11625
9209588f
JB
116262012-04-07 Juanma Barranquero <lekktu@gmail.com>
11627
11628 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11629 Remove unused local variable.
11630
e3fb2efb
PE
116312012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11632
11633 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11634 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11635 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11636 objects, as mark_maybe_pointer will catch them otherwise.
11637 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11638 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11639
b5385551
PE
116402012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11641
11642 Fix typo that broke non-Windows builds.
11643 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11644
9078ead6
EZ
116452012-04-07 Eli Zaretskii <eliz@gnu.org>
11646
11647 Support building on MS-Windows with libxml2.
11648
11649 * makefile.w32-in (OBJ2): Add xml.$(O).
11650 (GLOBAL_SOURCES): Add xml.c.
11651 ($(BLD)/xml.$(O)): New dependency list.
11652
11653 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11654 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11655 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11656 [!WINDOWSNT]: New macros.
11657 (init_libxml2_functions, libxml2_loaded_p): New functions.
11658 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11659 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11660 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11661 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11662 linked in).
6bbef4e5
JC
11663 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11664 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
11665 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11666
11667 * emacs.c: Don't include libxml/parser.h.
11668 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11669 xmlCleanupParser directly.
11670
11671 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11672
3811fdf3
EZ
116732012-04-07 Eli Zaretskii <eliz@gnu.org>
11674
11675 * indent.c (Fvertical_motion): If there is a display string at
11676 point, use it.vpos to compute how many lines to backtrack after
11677 move_it_to point. (Bug#11133)
11678
2f8e16b2
EZ
116792012-04-06 Eli Zaretskii <eliz@gnu.org>
11680
11681 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11682 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11683 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11684 macros related to unification of CJK characters. For the details,
11685 see the discussion following the message here:
11686 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11687
3d439cd1
CY
116882012-04-04 Chong Yidong <cyd@gnu.org>
11689
11690 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11691
8bc53d00
EZ
116922012-04-01 Eli Zaretskii <eliz@gnu.org>
11693
11694 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11695 instead of alloca. (Bug#11138)
11696
3b0512a3
AS
116972012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11698
11699 * w32menu.c (is_simple_dialog): Properly check lisp types.
11700 (Bug#11141)
11701
8427ddd2
EZ
117022012-03-31 Eli Zaretskii <eliz@gnu.org>
11703
979022ef
EZ
11704 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11705 position we get to after a call to move_it_to fails the
11706 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11707 only if we wind up in a string from display property. (Bug#11063)
11708
a6b1c7cc
EZ
11709 * window.c (Fdelete_other_windows_internal): Invalidate the row
11710 and column information about mouse highlight, so that redisplay
11711 restores it after reallocating the glyph matrices. (Bug#7464)
11712
8427ddd2
EZ
11713 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11714 string comes from a `display' text property, use the buffer
11715 position of that property as if we actually saw that position in
11716 the row's glyphs.
697ba24b
EZ
11717 (move_it_by_lines): Remove the assertion that
11718 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11719 violated when there's a before-string at the beginning of a line.
11720 (Bug#11063)
8427ddd2 11721
65a0a738
EZ
117222012-03-30 Eli Zaretskii <eliz@gnu.org>
11723
11724 * xdisp.c (append_space_for_newline): If the default face was
11725 remapped, use the remapped face for the appended newline.
11726 (extend_face_to_end_of_line): Use the remapped default face for
11727 extending the face to the end of the line.
11728 (display_line): Call extend_face_to_end_of_line when the default
11729 face was remapped. (Bug#11068)
11730
581355cc
EZ
117312012-03-29 Eli Zaretskii <eliz@gnu.org>
11732
11733 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11734
e8fc049f
SM
117352012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11736
11737 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11738
4fb9a543
GM
117392012-03-27 Glenn Morris <rgm@gnu.org>
11740
11741 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11742 Doc fixes.
11743
679910f1
KH
117442012-03-26 Kenichi Handa <handa@m17n.org>
11745
11746 * dispextern.h (struct glyph): Fix previous change. Change the
11747 bit length of glyphless.ch to 25 (Bug#11082).
11748
90d49b7f
CY
117492012-03-26 Chong Yidong <cyd@gnu.org>
11750
11751 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11752 (command_loop_1): Use it; inhibit selection update for
11753 handle-select-window too (Bug#8996).
11754
f514f6f0
FP
117552012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11756
e8fc049f 11757 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 11758
bf43fa51
KH
117592012-03-25 Kenichi Handa <handa@m17n.org>
11760
11761 * dispextern.h (struct glyph): Change the bit length of
11762 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11763
8a0c01dd
EZ
117642012-03-24 Eli Zaretskii <eliz@gnu.org>
11765
11766 * s/ms-w32.h (tzname): Include time.h before redirecting to
11767 _tzname. Fixes the MSVC build. (Bug#9960)
11768
7d1c3a76
AS
117692012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11770
8ed79523
AS
11771 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11772 characters.
11773
7d1c3a76
AS
11774 * xterm.c (XTread_socket): Only modify handling_signal if
11775 !SYNC_INPUT. (Bug#11080)
11776
e99a9b8b
EZ
117772012-03-23 Eli Zaretskii <eliz@gnu.org>
11778
11779 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11780 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11781 when fetching a multibyte character consumes more bytes than
11782 CHAR_BYTES returns, due to unification of CJK characters in
11783 string_char. (Bug#11073)
11784
5063c0e1
TN
117852012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11786
11787 * process.c (wait_reading_process_output): Handle pty disconnect
11788 by refraining from sending oneself a SIGCHLD (bug#10933).
11789
9f851fbd
CY
117902012-03-22 Chong Yidong <cyd@gnu.org>
11791
11792 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11793
5063c0e1 11794 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
11795 Mark string as coming from a prefix property.
11796 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11797 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11798
fb5b8aca
CY
117992012-03-21 Chong Yidong <cyd@gnu.org>
11800
11801 * xfaces.c (Vface_remapping_alist): Doc fix.
11802
62356a1b
EZ
118032012-03-20 Eli Zaretskii <eliz@gnu.org>
11804
11805 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
11806 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11807 Doc fixes.
62356a1b 11808
025de85b
CY
118092012-03-20 Chong Yidong <cyd@gnu.org>
11810
11811 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11812 to reflect default non-nil value of redisplay-dont-pause.
11813
4827f94e
KH
118142012-03-19 Kenichi Handa <handa@m17n.org>
11815
11816 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11817 it fit in a valid range (Bug#11003).
11818
e50a24a2
EZ
118192012-03-18 Eli Zaretskii <eliz@gnu.org>
11820
11821 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11822 that is not from display property, accept the row as a "cursor
11823 row" if one of the string's character has a non-nil `cursor'
11824 property. Fixes cursor positioning when there are newlines in
11825 overlay strings, e.g. in icomplete.el. (Bug#11035)
11826
9af5ed87
PE
118272012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11828
11829 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11830
d1f55f16
CY
118312012-03-12 Chong Yidong <cyd@gnu.org>
11832
11833 * eval.c (inhibit_lisp_code): Rename from
11834 inhibit_window_configuration_change_hook; move from window.c.
11835
11836 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11837 * window.c (run_window_configuration_change_hook)
11838 (syms_of_window): Callers changed.
11839
66c5eebd
CY
118402012-03-11 Chong Yidong <cyd@gnu.org>
11841
413df973
CY
11842 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11843
66c5eebd
CY
11844 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11845
1de11f56
CY
118462012-03-10 Chong Yidong <cyd@gnu.org>
11847
11848 * frame.c (other_visible_frames): Don't assume the selected frame
11849 is visible (Bug#10955).
11850
cae07000
SM
118512012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11852
11853 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11854
89c94350
JD
118552012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11856
11857 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11858 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11859 zero (Bug#10954).
11860
999dd333
GM
118612012-03-03 Glenn Morris <rgm@gnu.org>
11862
01a6dcc8 11863 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 11864
de0100f2
EZ
118652012-03-02 Eli Zaretskii <eliz@gnu.org>
11866
11867 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11868 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
11869 (redisplay_window, next_element_from_string): Fix typos in
11870 comments.
3e441275
EZ
11871 (redisplay_window): Pass to move_it_vertically the margin in
11872 pixels, not in screen lines.
de0100f2 11873
96a72ee9
GM
118742012-03-02 Glenn Morris <rgm@gnu.org>
11875
11876 * buffer.c (buffer-list-update-hook): Doc fix.
11877
312508d7
EZ
118782012-02-29 Eli Zaretskii <eliz@gnu.org>
11879
11880 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11881 push_it before setting up the iterator for the first overlay
11882 string, even if we have an empty string loaded.
11883 (next_overlay_string): If there's an empty string on the iterator
11884 stack, pop the stack. (Bug#10903)
11885
27f3c637
PE
118862012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11887
11888 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11889 Suggested by Stefan Monnier in
11890 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11891 * alloc.c (widen_to_Lisp_Object): New static function.
11892 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11893 and widening them to Lisp_Objects. This would work even if
11894 USE_LSB_TAG is defined and wide integers are used, which might
11895 happen in a future version of Emacs.
11896
3c9dfce6
CY
118972012-02-25 Chong Yidong <cyd@gnu.org>
11898
fa74b241
CY
11899 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11900 Doc fix.
11901
3c9dfce6
CY
11902 * xselect.c (Fx_selection_exists_p): Doc fix.
11903 (x_clipboard_manager_save_all): Print an informative message
11904 before saving to clipboard manager.
11905
9486df08
CY
119062012-02-24 Chong Yidong <cyd@gnu.org>
11907
11908 * keyboard.c (process_special_events): Handle all X selection
11909 requests in kbd_buffer, not just the next one (Bug#8869).
11910
f01d3321
CY
119112012-02-23 Chong Yidong <cyd@gnu.org>
11912
11913 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11914 call when setting menu-bar-lines and tool-bar-lines parameters.
11915 (unwind_create_frame_1): New helper function.
11916
11917 * window.c (inhibit_window_configuration_change_hook): New var.
11918 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 11919 (syms_of_window): Initialize it.
f01d3321 11920
86b847b6
CY
119212012-02-22 Chong Yidong <cyd@gnu.org>
11922
11923 * xterm.c (x_draw_image_relief): Add missing type check for
11924 Vtool_bar_button_margin (Bug#10743).
11925
a59225b1
CY
119262012-02-21 Chong Yidong <cyd@gnu.org>
11927
11928 * fileio.c (Vfile_name_handler_alist): Doc fix.
11929
11930 * buffer.c (Fget_file_buffer): Protect against invalid file
11931 handler return value.
11932
310f5bd4
PE
119332012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11934
cb3a28cc
PE
11935 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11936 when computing $valmask.
11937
310f5bd4
PE
11938 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11939 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11940 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11941 It's useless in that case, and it can cause problems on hosts
11942 that allocate halves of EMACS_INT values separately.
11943 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11944 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11945 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11946 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11947 it avoids undefined behavior on hosts where shifting right by more
11948 than the word width has undefined behavior.
11949
2375c96a
CY
119502012-02-19 Chong Yidong <cyd@gnu.org>
11951
11952 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11953 (Funhandled_file_name_directory, Ffile_name_as_directory)
11954 (Fdirectory_file_name, Fexpand_file_name)
11955 (Fsubstitute_in_file_name): Protect against invalid file handler
11956 return values (Bug#10845).
11957
3eb49e71
EZ
119582012-02-18 Eli Zaretskii <eliz@gnu.org>
11959
11960 * .gdbinit (pitx): Fix incorrect references to fields of the
11961 iterator stack.
11962
7b926f3f
CY
119632012-02-17 Chong Yidong <cyd@gnu.org>
11964
11965 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11966
11273115
PE
119672012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11968
11969 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11970 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11971
c3a70e2b
CY
119722012-02-15 Chong Yidong <cyd@gnu.org>
11973
11974 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11975 marked as special. Also, starting docstrings with * is obsolete.
11976
0ca43699
AS
119772012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11978
11979 * gnutls.c (emacs_gnutls_write): Fix last change.
11980
2e8f3c56
LI
119812012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11982
11983 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11984 send_process.
11985
af70074f
SM
119862012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11987
11988 * keymap.c (Fsingle_key_description): Handle char ranges.
11989
95986d52
CY
119902012-02-12 Chong Yidong <cyd@gnu.org>
11991
afd83bd1
CY
11992 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11993 as that creates a dangerous corner case.
11994
95986d52
CY
11995 * window.c (Fdelete_window_internal): Invalidate the mouse
11996 highlight (Bug#9904).
11997
bd7da63e
GM
119982012-02-12 Glenn Morris <rgm@gnu.org>
11999
12000 * xselect.c (Fx_own_selection_internal)
12001 (Fx_get_selection_internal, Fx_disown_selection_internal)
12002 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
12003 * nsselect.m (Fx_own_selection_internal)
12004 (Fx_disown_selection_internal, Fx_selection_exists_p)
12005 (Fx_selection_owner_p, Fx_get_selection_internal):
12006 Sync docs and argument specs with the xselect.c versions.
12007
77abcbc2
LI
120082012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
12009
12010 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
12011
90b671e2
EZ
120122012-02-11 Eli Zaretskii <eliz@gnu.org>
12013
1c0ca0b7
EZ
12014 * w32select.c (Fx_selection_exists_p): Sync doc string and
12015 argument list with xselect.c. (Bug#10783)
12016
12017 * w16select.c (Fx_selection_exists_p): Sync doc string and
12018 argument list with xselect.c. (Bug#10783)
90b671e2 12019
49241268
GM
120202012-02-10 Glenn Morris <rgm@gnu.org>
12021
12022 * fns.c (Fsecure_hash): Doc fix.
12023
f998bbe7 120242012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
12025
12026 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
12027
0992bd9c
CY
120282012-02-07 Chong Yidong <cyd@gnu.org>
12029
12030 * buffer.c (Fbuffer_local_variables)
12031 (buffer_lisp_local_variables): Handle unbound vars correctly;
12032 don't let Qunbound leak into Lisp.
12033
af008560
GM
120342012-02-07 Glenn Morris <rgm@gnu.org>
12035
dd605cc4
GM
12036 * image.c (Fimagemagick_types): Doc fix.
12037
af008560
GM
12038 * image.c (imagemagick-render-type): Change it from a lisp object
12039 to an integer. Move the doc here from the lisp manual.
12040 Treat all values not equal to 0 the same.
12041
1449fa1d
CY
120422012-02-06 Chong Yidong <cyd@gnu.org>
12043
12044 * doc.c (store_function_docstring): Avoid applying docstring of
12045 alias to base function (Bug#2603).
12046
3723ec07
AS
120472012-02-04 Andreas Schwab <schwab@linux-m68k.org>
12048
12049 * .gdbinit (pp1, pv1): Remove redundant defines.
12050 (pr): Use pp.
12051
79c1cc1e
CY
120522012-02-04 Chong Yidong <cyd@gnu.org>
12053
12054 * nsterm.m: Declare a global (Bug#10694).
12055
d7f29f8e
EZ
120562012-02-04 Eli Zaretskii <eliz@gnu.org>
12057
cae07000
SM
12058 * w32.c (get_emacs_configuration_options):
12059 Include --enable-checking, if specified, in the return value.
d7f29f8e 12060
3b95a6f9
MR
120612012-02-04 Martin Rudalics <rudalics@gmx.at>
12062
12063 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
12064 after rounding frame sizes. (Bug#9723)
12065
d6fa96a6
EZ
120662012-02-04 Eli Zaretskii <eliz@gnu.org>
12067
12068 * keyboard.c (adjust_point_for_property): Don't position point
12069 before BEGV. (Bug#10696)
12070
df0b2940
PE
120712012-02-03 Paul Eggert <eggert@cs.ucla.edu>
12072
12073 Handle overflow when computing char display width (Bug#9496).
12074 * character.c (char_width): Return EMACS_INT, not int.
12075 (char_width, c_string_width): Check for overflow when
12076 computing the width; this is possible now that individual
12077 characters can have unbounded width. Problem introduced
12078 by merge from Emacs 23 on 2012-01-19.
12079
6bee44d6
MA
120802012-02-02 Michael Albinus <michael.albinus@gmx.de>
12081
12082 * dbusbind.c (Fdbus_register_method): Mention the return value
12083 :ignore in the docstring.
12084
44f92739
GM
120852012-02-02 Glenn Morris <rgm@gnu.org>
12086
1b9f60cc
GM
12087 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
12088
44f92739
GM
12089 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12090 Unconditionally set to t. (Bug#10673)
12091 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
12092 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
12093 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
12094
c5d3843c
KH
120952012-02-02 Kenichi Handa <handa@m17n.org>
12096
12097 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
12098 0, do not call append_composite_glyph.
12099
159462d4 121002012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
12101
12102 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
12103 NULL (Bug#6988).
12104 (x_produce_glyphs): If the component of a composition is a null
12105 string, set it->pixel_width to 1 to avoid zero-width glyph.
12106
78cef877
EZ
121072012-02-01 Eli Zaretskii <eliz@gnu.org>
12108
12109 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
12110 first 2 arguments are identical. This makes inserting large
12111 output from a subprocess an order of magnitude faster on
12112 MS-Windows, where all sbrk'ed memory is always contiguous.
12113
97897668
GM
121142012-01-31 Glenn Morris <rgm@gnu.org>
12115
12116 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 12117 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
12118 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
12119
31fd3586
GM
121202012-01-29 Glenn Morris <rgm@gnu.org>
12121
12122 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
12123
0e24a8b2
CY
121242012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
12125
12126 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
12127
cc0adcb0
CY
121282012-01-28 Chong Yidong <cyd@gnu.org>
12129
12130 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
12131
acc28cb9
CY
121322012-01-26 Chong Yidong <cyd@gnu.org>
12133
9c69cfb7
CY
12134 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
12135
acc28cb9
CY
12136 * search.c (Fsearch_forward, Fsearch_backward): Document negative
12137 repeat counts (Bug#10507).
12138
48da7392
GM
121392012-01-26 Glenn Morris <rgm@gnu.org>
12140
12141 * lread.c (syms_of_lread): Doc fix.
12142
14af5f7f
CY
121432012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
12144
12145 * coding.c (encode_designation_at_bol): Change return value to
12146 EMACS_INT.
12147
0b21c100
CY
121482012-01-25 Chong Yidong <cyd@gnu.org>
12149
12150 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
12151
3c2907f7
CY
121522012-01-21 Chong Yidong <cyd@gnu.org>
12153
12154 * floatfns.c (Fcopysign): Make the second argument non-optional,
12155 since nil is not allowed anyway.
12156
959ad23f
AS
121572012-01-21 Andreas Schwab <schwab@linux-m68k.org>
12158
12159 * process.c (read_process_output): Use p instead of XPROCESS (proc).
12160 (send_process): Likewise.
12161
34a02f46
MR
121622012-01-19 Martin Rudalics <rudalics@gmx.at>
12163
12164 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
12165 (Vwindow_persistent_parameters): Do not use Qstate.
12166 Rewrite doc-strings.
34a02f46 12167
1259009a 121682012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
12169
12170 * character.c (char_width): New function.
70d4fdf6
GM
12171 (Fchar_width, c_string_width, lisp_string_width):
12172 Use char_width (Bug#9496).
25ed9e61 12173
6a6ee00d
MR
121742012-01-16 Martin Rudalics <rudalics@gmx.at>
12175
12176 * window.c (Vwindow_persistent_parameters): New variable.
12177 (Fset_window_configuration, save_window_save): Handle persistent
12178 window parameters.
12179
c85efaf7
EZ
121802012-01-14 Eli Zaretskii <eliz@gnu.org>
12181
12182 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
12183 thrashing the stack of the thread. (Bug#9087)
12184
5944709e
PE
121852012-01-12 Paul Eggert <eggert@cs.ucla.edu>
12186
12187 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
12188
e71f5d99
EZ
121892012-01-11 Eli Zaretskii <eliz@gnu.org>
12190
12191 * xdisp.c (rows_from_pos_range): Handle the case where the
12192 highlight ends on a newline. (Bug#10464)
12193 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
12194 he end column for display of highlight that ends on a newline
12195 before a R2L line.
12196
ce316182
GM
121972012-01-11 Glenn Morris <rgm@gnu.org>
12198
12199 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
12200 from load-path also when installation-directory is nil. (Bug#10208)
12201
5b43da69
GM
122022012-01-10 Glenn Morris <rgm@gnu.org>
12203
74cc8ff9
GM
12204 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
12205
7d8d6e4e
GM
12206 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
12207 Update template values to be closer to their typical values these days.
5b43da69 12208
a0db8d43
EZ
122092012-01-09 Eli Zaretskii <eliz@gnu.org>
12210
12211 * xdisp.c (rows_from_pos_range): Accept additional argument
12212 DISP_STRING, and accept any glyph in a row whose object is that
12213 string as eligible for mouse highlight. Fixes mouse highlight of
12214 display strings from overlays. (Bug#10464)
12215
9a0115ab 122162012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 12217
b9110d6a 12218 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
12219 * fileio.c (auto_saving_dir_umask): New static var.
12220 (Fmake_directory_internal): Use it.
12221 (do_auto_save_make_dir): Set it, instead of invoking chmod after
12222 creating the directory. The old code temporarily assigns
12223 too-generous permissions to the directory.
12224 (do_auto_save_eh): Clear it.
b9110d6a 12225 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
12226 that the var is always cleared.
12227
6c1bd3f3
EZ
122282012-01-07 Eli Zaretskii <eliz@gnu.org>
12229
12230 * search.c (scan_buffer): Pass character positions to
12231 know_region_cache, not byte positions. (Bug#6540)
12232
069d2b50
L
122332012-01-07 LynX <_LynX@bk.ru> (tiny change)
12234
12235 * w32.c (sys_rename): Report EXDEV when rename of a directory
12236 fails because the target is on another logical disk. (Bug#10284)
12237
75bf0d33
DB
122382012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
12239
12240 * xterm.c (x_embed_request_focus): New function.
12241
12242 * xterm.h: Add prototype.
12243
12244 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
12245
1c6e5a32
GM
122462012-01-05 Glenn Morris <rgm@gnu.org>
12247
12248 * emacs.c (emacs_copyright): Update short copyright year to 2012.
12249
651e947e
EZ
122502012-01-01 Eli Zaretskii <eliz@gnu.org>
12251
12252 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
12253 Load gnutls_transport_set_lowat only if GnuTLS version is below
12254 2.11.1.
12255 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
12256 GnuTLS versions below 2.11.1.
12257
3778cdd8
AL
122582011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
12259
12260 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
12261 to the doc string advising against its use for altering the way
12262 windows are scrolled.
12263
0e5317f7
KH
122642011-12-28 Kenichi Handa <handa@m17n.org>
12265
12266 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
12267 coding-system ASCII compatible only when it does not produce BOM
12268 on encoding (Bug#10383).
12269
93d5ca1f
JD
122702011-12-26 Jan Djärv <jan.h.d@swipnet.se>
12271
12272 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
12273 can scroll.
12274 (create_and_show_popup_menu): Always use menu_position_func for
12275 Gtk3 (Bug#10361).
12276
ca22b785
AS
122772011-12-24 Andreas Schwab <schwab@linux-m68k.org>
12278
12279 * callint.c (Fcall_interactively): Don't truncate prompt string.
12280
d048e1e6
EZ
122812011-12-23 Eli Zaretskii <eliz@gnu.org>
12282
12283 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
12284 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 12285 resumed from there (after widening). (Bug#10360)
d048e1e6 12286
5ccaba1f
JD
122872011-12-22 Jan Djärv <jan.h.d@swipnet.se>
12288
12289 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
12290
204ee57f
JD
122912011-12-21 Jan Djärv <jan.h.d@swipnet.se>
12292
b81d40f0
JB
12293 * nsterm.m (x_free_frame_resources):
12294 Release f->output_data.ns->miniimage.
204ee57f
JD
12295 (ns_index_color): Fix indentation. Do not retain
12296 color_table->colors[i].
12297
12298 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
12299 before returning.
12300
12301 * nsfns.m (x_set_background_color): Assign return value from
12302 ns_index_color to face-background instead of NSColor*.
12303 (ns_implicitly_set_icon_type): Fix indentation.
12304 Change assignment in for loop to comparison.
12305
12306 * emacs.c (ns_pool): New variable.
12307 (main): Assign ns_pool.
12308 (Fkill_emacs): Call ns_release_autorelease_pool.
12309
12310 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
12311 autorelease fdesc, release fdAttrs and tdict.
12312 (ns_get_covering_families): Release charset.
12313 (ns_findfonts): Release NSFontDescriptor created with new.
12314 (ns_uni_to_glyphs): Fix indentation.
12315 (setString): Release attrStr before assigning new value.
12316
c803b2b7
JD
123172011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12318
678f4426
JD
12319 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
12320 and NS_IMPL_COCOA.
12321 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
12322 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
12323
cd394be1 123242011-12-18 David Reitter <reitter@cmu.edu>
678f4426 12325
5fecd5fc
JD
12326 * nsterm.m (ns_term_init): Subscribe for notifications
12327 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
12328 to method trackingNotification in EmacsMenu.
12329
12330 * nsmenu.m (trackingMenu): New variable.
3771cb17 12331 (trackingNotification): New method (from Aquamacs).
5fecd5fc 12332 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 12333 from Aquamacs (Bug#7030).
678f4426
JD
12334
123352011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 12336
c803b2b7
JD
12337 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
12338 (symbol_to_nsstring): Fix indentation.
12339 (ns_symbol_to_pb): New function.
cae07000
SM
12340 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
12341 (Fns_rotate_cut_buffers_internal): Remove.
12342 (Fns_store_selection_internal): Rename from
c803b2b7
JD
12343 Fns_store_cut_buffer_internal.
12344 (ns_get_foreign_selection, Fx_own_selection_internal)
12345 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
12346 (Fns_get_selection_internal, Fns_store_selection_internal):
12347 Use ns_symbol_to_pb and check if return value is nil.
12348 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
12349 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
12350 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
12351 renamed to Sns_store_selection_internal.
12352 (ns_handle_selection_request): Move code to Fx_own_selection_internal
12353 and remove this function.
12354 (ns_handle_selection_clear): Remove, never used.
12355 (Fx_own_selection_internal): Move code from ns_handle_selection_request
12356 here.
12357
e1b01a3a
KB
123582011-12-17 Ken Brown <kbrown@cornell.edu>
12359
12360 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
12361 GID is unknown (Bug#10257).
12362
2adb6e85
PE
123632011-12-17 Paul Eggert <eggert@cs.ucla.edu>
12364
12365 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
12366 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
12367 which caused a build failure on GNU/Linux IA-64. This problem was
12368 introduced by my 2011-10-07 patch.
12369
d1d7b339
JL
123702011-12-15 Juri Linkov <juri@jurta.org>
12371
12372 * image.c (imagemagick_error): New function. (Bug#10112)
12373 (imagemagick_load_image): Comment out `MagickSetResolution' call.
12374 Use `imagemagick_error' where ImageMagick functions return
12375 `MagickFalse'.
12376 (Fimagemagick_types): Add `Fnreverse' to return the list in the
12377 proper order.
12378
100d5755
KH
123792011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12380
12381 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
12382 fill background (Bug#8992).
12383
454592a6
MR
123842011-12-13 Martin Rudalics <rudalics@gmx.at>
12385
12386 * window.c (Vwindow_combination_resize)
12387 (Vwindow_combination_limit): Use t instead of non-nil in
12388 doc-strings.
61d4b438
MR
12389 (Vrecenter_redisplay): Add first sentence of doc-string on
12390 separate line.
53524d93 12391 (Frecenter): Fix doc-string typo.
454592a6 12392
3633e3aa
KH
123932011-12-11 Kenichi Handa <handa@m17n.org>
12394
12395 * coding.c (Funencodable_char_position): Pay attention to the
12396 buffer text relocation (Bug#9389).
12397
7b9d523a 123982011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 12399
7b9d523a
JD
12400 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
12401 gtk_init (Bug#10100).
12402
b73189c6
EZ
124032011-12-10 Eli Zaretskii <eliz@gnu.org>
12404
12405 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12406 IT->string is nil. (Bug#10263)
12407
f7dfe5d6
JD
124082011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12409
83faebb4
JD
12410 * nsterm.h (x_free_frame_resources): Declare.
12411
f7dfe5d6
JD
12412 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12413 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12414
12415 * nsterm.h (ns_get_defaults_value): Declare.
12416
12417 * nsterm.m (ns_default): Call ns_get_defaults_value.
12418
7cd4e72c
EZ
124192011-12-09 Eli Zaretskii <eliz@gnu.org>
12420
12421 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12422 (Bug#10170)
12423
b34d7317
YM
124242011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12425
12426 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12427 that where the value of an _OBJC_* symbol points to is in the .bss
12428 section (Bug#10240).
12429
76470ad1
KH
124302011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12431
12432 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 12433 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 12434
745fff94
KH
124352011-12-08 Kenichi Handa <handa@m17n.org>
12436
12437 * ftfont.c (get_adstyle_property): Fix previous change
12438 (Bug#10233).
12439
6e44397c
JB
124402011-12-07 Juanma Barranquero <lekktu@gmail.com>
12441
12442 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12443 dirs from the default value of EMACSLOADPATH (bug#10208).
12444
7efa6272
GM
124452011-12-07 Glenn Morris <rgm@gnu.org>
12446
12447 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12448 installation and source directories as well. (Bug#10208)
12449
f6fc4d87
CY
124502011-12-06 Chong Yidong <cyd@gnu.org>
12451
12452 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12453
2bf26180
GM
124542011-12-06 Glenn Morris <rgm@gnu.org>
12455
12456 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12457 as an error, not just -1. (Bug#10217)
12458
3a6ad4f0
CY
124592011-12-05 Chong Yidong <cyd@gnu.org>
12460
12461 * keyboard.c (process_special_events): New function.
12462 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12463
75a3b399
PE
124642011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12465
12466 * coding.c (encode_designation_at_bol): Don't use uninitialized
12467 local variable (Bug#9318).
12468
c3c9e25e
KH
124692011-12-05 Kenichi Handa <handa@m17n.org>
12470
12471 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12472 return Qnil (Bug#8046, Bug#10193).
12473
5eb05ea3
KH
124742011-12-05 Kenichi Handa <handa@m17n.org>
12475
12476 * coding.c (encode_designation_at_bol): New args charbuf_end and
12477 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
12478 (coding_set_source): Return how many bytes coding->source was
12479 relocated.
12480 (coding_set_destination): Return how many bytes
12481 coding->destination was relocated.
12482 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 12483 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
12484
124852011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12486
12487 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12488 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12489 macro (Bug#9318).
12490
124912011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12492
12493 The following changes are to fix Bug#9318.
12494
a79703f5 12495 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
12496 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12497 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 12498 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 12499
7dbda6df
JB
125002011-12-05 Juanma Barranquero <lekktu@gmail.com>
12501
12502 * lisp.h (process_quit_flag): Fix external declaration.
12503
6d5eb5b0
SM
125042011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12505
12506 Don't macro-inline non-performance-critical code.
12507 * eval.c (process_quit_flag): New function.
12508 * lisp.h (QUIT): Use it.
12509
a0c3fad0
JD
125102011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12511
12512 * nsfns.m (get_geometry_from_preferences): New function.
12513 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12514
6c07aac2
AS
125152011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12516
12517 * emacs.c (Qkill_emacs): Define.
12518 (syms_of_emacs): Initialize it.
12519 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12520 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
12521 (quit_throw_to_read_char): Add parameter `from_signal'.
12522 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
12523 * lisp.h (QUIT): Call Fkill_emacs if requested.
12524
c052ead4
JD
125252011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12526
12527 * widget.c (update_wm_hints): Return if wmshell is null.
12528 (widget_update_wm_size_hints): New function.
12529
12530 * widget.h (widget_update_wm_size_hints): Declare.
12531
12532 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12533 widget_update_wm_size_hints (Bug#10104).
12534
9e49252b
EZ
125352011-12-03 Eli Zaretskii <eliz@gnu.org>
12536
12537 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12538 before a newline, prepare the bidi iterator for consuming the
12539 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 12540 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 12541
02b16839
JL
125422011-12-02 Juri Linkov <juri@jurta.org>
12543
12544 * search.c (Fword_search_regexp): New Lisp function created from
12545 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12546 (Fword_search_backward, Fword_search_forward)
12547 (Fword_search_backward_lax, Fword_search_forward_lax):
12548 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12549 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12550
0068070e
SM
125512011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12552
12553 * fileio.c (Finsert_file_contents): Move after-change-function call
12554 to before the "handled:" label, since all "goto handled" appear in
12555 cases where the *-change-functions have already been properly called
12556 (bug#10117).
12557
3360a3fc
AS
125582011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12559
12560 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12561 waiting for input. (Bug#10169)
12562
73d6c093
EZ
125632011-11-30 Eli Zaretskii <eliz@gnu.org>
12564
12565 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12566 verifies glyph row's hash code--we have just reallocated the
12567 glyphs, so their contents can be complete garbage. (Bug#10164)
12568
febe6bea
JB
125692011-11-30 Juanma Barranquero <lekktu@gmail.com>
12570
12571 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12572
801a4313
EZ
125732011-11-30 Eli Zaretskii <eliz@gnu.org>
12574
12575 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12576 attributes are tested _before_ calling verify_row_hash, to protect
12577 against GCC re-ordering of the tests. (Bug#10164)
12578
2b56b87e
JD
125792011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12580
12581 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12582
12583 * xterm.c (handle_one_xevent): Only set async_visible and friends
12584 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 12585 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
12586 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12587
dbf31225
PE
125882011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12589
12590 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12591 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12592 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12593 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12594 All uses changed to use GCPRO1 etc.
12595 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12596 Revert to old implementation (i.e., before 2011-03-11).
12597
1305621b
YM
125982011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12599
12600 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12601 of scroll runs so as to avoid assigning disabled bogus rows and
12602 unnecessary graphics copy operations.
12603
8c9afb46
EZ
126042011-11-27 Eli Zaretskii <eliz@gnu.org>
12605
12606 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12607 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12608 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12609 (malloc, free, realloc, calloc): Redirect to e_* only when
12610 compiling Emacs.
12611
12612 * lisp.h (GCTYPEBITS): Move before first use.
12613 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12614 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12615 this macro definition.
12616
12617 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12618 _MSC_VER.
12619
54e9e3bf
JD
126202011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12621
6d5eb5b0
SM
12622 * gtkutil.c (xg_create_frame_widgets):
12623 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
12624 present with Gtk+ 2.0.
12625
83aca1cb
PE
126262011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12627
12628 * fileio.c (Finsert_file_contents): Undo previous change; see
12629 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12630
5b76caa4
PE
126312011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12632
12633 Rename locals to avoid shadowing.
12634 * fileio.c (Finsert_file_contents):
12635 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12636 * process.c (wait_reading_process_output):
12637 Rename inner 'proc' to 'p' to avoid shadowing.
12638 Indent for consistency with usual Emacs style.
12639
8c535114
EZ
126402011-11-25 Eli Zaretskii <eliz@gnu.org>
12641
12642 * xdisp.c (redisplay_window): If cursor row is not fully visible
12643 after recentering, and scroll-conservatively is set to a large
12644 number, scroll window by a few more lines to make the cursor fully
12645 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
12646 (start_display): Don't move to the next line if the display should
12647 start at a newline that is part of a display vector or an overlay
12648 string. (Bug#10119)
8c535114 12649
fa4fdb5c
JL
126502011-11-24 Juri Linkov <juri@jurta.org>
12651
12652 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12653 after the `MagickPingImage' call. (Bug#10112)
12654
90ec88df
CY
126552011-11-23 Chong Yidong <cyd@gnu.org>
12656
12657 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12658
56e2e794
MR
126592011-11-23 Martin Rudalics <rudalics@gmx.at>
12660
12661 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12662 making another buffer current. (Bug#10114)
12663
b6e64c41
GM
126642011-11-23 Glenn Morris <rgm@gnu.org>
12665
12666 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12667
6b21de18
CY
126682011-11-23 Chong Yidong <cyd@gnu.org>
12669
12670 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12671 using it (Bug#5984).
12672
b12cd789
EZ
126732011-11-22 Eli Zaretskii <eliz@gnu.org>
12674
12675 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12676 and header-lines, as they don't have one computed for them.
12677 (Bug#10098)
12678
12679 * .gdbinit (prow): Make displayed values more self-explaining.
12680 Add row's hash code.
12681
261b6fd4
LMI
126822011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12683
12684 * process.c (wait_reading_process_output): Fix asynchrounous
12685 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 12686 (wait_reading_process_output): Add comment and URL.
261b6fd4 12687
e7cfd277
JD
126882011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12689
12690 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12691
a9b9b7f5
CY
126922011-11-21 Chong Yidong <cyd@gnu.org>
12693
12694 * window.c (Fnext_window, Fprevious_window): Doc fix.
12695
b0d15b4f
SM
126962011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12697
12698 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12699
fe7a3057
JB
127002011-11-20 Juanma Barranquero <lekktu@gmail.com>
12701
12702 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12703
d2999b1a
MR
127042011-11-20 Martin Rudalics <rudalics@gmx.at>
12705
12706 * window.c (Fset_window_combination_limit): Rename argument
12707 STATUS to LIMIT.
12708 (Vwindow_combination_limit): Remove "status" from doc-string.
12709
d5ff9cd0
AS
127102011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12711
12712 * m/ibms390.h: Remove.
12713 * m/ibms390x.h: Don't include "ibms390.h".
12714
a5bb9bd3
SM
127152011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12716
12717 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12718 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12719
cd1181db
JB
127202011-11-20 Juanma Barranquero <lekktu@gmail.com>
12721
12722 * casetab.c (Fset_case_table):
12723 * charset.c (Fcharset_after): Fix typos.
12724
615a3b8d 127252011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 12726
17e845af
PE
12727 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12728 Otherwise, valgrind does not work on some platforms.
12729 Problem reported by Andreas Schwab in
6a0bf43d
PE
12730 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12731 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12732 is set, removing the need for VIRT_ADDRESS_VARIES.
12733 (PURE_P): Use a more-efficient implementation that needs just one
12734 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12735 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12736 to 4 (xorl, subq, cmpq, setbe).
12737 * alloc.c (pure): Always extern now, since that's the
12738 VIRT_ADDR_VARIES behavior.
12739 (PURE_POINTER_P): Use a single comparison, not two, for
12740 consistency with the new puresize.h.
12741 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12742 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12743 Remove VIRT_ADDR_VARIES no longer needed.
12744
f8fe6f96
EZ
127452011-11-19 Eli Zaretskii <eliz@gnu.org>
12746
12747 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12748 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12749 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12750 behave as if the cursor position were at the window margin.
12751
12752 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12753 and the cursor position is out of bounds, behave as if the cursor
12754 position were at the window margin. (Bug#10075)
12755
df05a53c
CY
127562011-11-18 Chong Yidong <cyd@gnu.org>
12757
12758 * window.c (Fwindow_combination_limit): Make first argument
12759 non-optional, since it is meaningless for live windows like the
12760 selected window.
61ccba97 12761
2071918e
DA
127622011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12763
12764 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12765
b50a28de
SM
127662011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12767
12768 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12769 (graft_intervals_into_buffer): Simplify.
12770
015137db
EZ
127712011-11-18 Eli Zaretskii <eliz@gnu.org>
12772
12773 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12774 hash values of the two rows.
12775 (copy_row_except_pointers): Preserve the used[] arrays and the
12776 hash values of the two rows. (Bug#10035)
68c95424 12777 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
12778
12779 * xdisp.c (row_hash): New function, body extracted from
12780 compute_line_metrics.
12781 (compute_line_metrics): Call row_hash, instead of computing the
12782 hash code inline.
12783
12784 * dispnew.c (verify_row_hash): Call row_hash for computing the
12785 hash code of a row, instead of duplicating code from xdisp.c.
12786
12787 * dispextern.h (row_hash): Add prototype.
12788
a2addb04
TH
127892011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12790
12791 * frame.c (delete_frame): Don't delete the terminal when the last
12792 X frame is closed if emacs is built with GTK toolkit.
12793
df85d315
JB
127942011-11-17 Juanma Barranquero <lekktu@gmail.com>
12795
12796 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12797
a0c2d0ae
MR
127982011-11-17 Martin Rudalics <rudalics@gmx.at>
12799
12800 * window.c (Vwindow_splits): Rename to
12801 Vwindow_combination_resize. Suggested by Juri Linkov.
12802 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12803 of Vwindow_splits.
12804
58179cce
JB
128052011-11-16 Juanma Barranquero <lekktu@gmail.com>
12806
7877f373
JB
12807 * nsfns.m (Fns_font_name):
12808 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 12809
b6f67890
MR
128102011-11-16 Martin Rudalics <rudalics@gmx.at>
12811
12812 * window.h (window): Rename slot "nest" to "combination_limit".
12813 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12814 (Fset_window_nest): Rename to Fset_window_combination_limit.
12815 (Vwindow_nest): Rename to Vwindow_combination_limit.
12816 (recombine_windows, make_parent_window, make_window)
12817 (Fsplit_window_internal, saved_window)
12818 (Fset_window_configuration, save_window_save): Rename all
12819 occurrences of window_nest to window_combination_limit.
12820
c7015153
JB
128212011-11-15 Juanma Barranquero <lekktu@gmail.com>
12822
12823 * image.c (imagemagick_load_image): Fix typo.
12824
322ad6ec
EZ
128252011-11-14 Eli Zaretskii <eliz@gnu.org>
12826
12827 * xdisp.c (display_line): Move the call to
12828 highlight_trailing_whitespace before the call to
12829 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
12830 faces of all the glyphs to compute ROW's hash value.
12831 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 12832
f067b8ec
JB
128332011-11-14 Juanma Barranquero <lekktu@gmail.com>
12834
12835 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12836 just return (bug#10044).
12837
1e5b2111
EZ
128382011-11-12 Eli Zaretskii <eliz@gnu.org>
12839
7ef3cbd5
EZ
12840 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12841 with user-defined heap size. Bump the default size of the temacs
12842 heap to 27MB, to avoid memory warning when running temacs.
12843 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12844
1e5b2111
EZ
12845 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12846 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
12847 (verify_row_hash) [XASSERTS]: New function.
12848 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12849 that the hash value of glyph rows is correct.
1e5b2111 12850
89d61221
MR
128512011-11-12 Martin Rudalics <rudalics@gmx.at>
12852
12853 * window.h (window): Remove splits slot.
12854 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12855 (Fdelete_other_windows_internal, make_parent_window)
12856 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12857 (Fset_window_configuration, save_window_save): Don't deal with
12858 split status of windows.
12859 (saved_window): Remove splits slot.
12860 (Vwindow_splits): Rewrite doc-string.
12861
97f18cc8
JD
128622011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12863
12864 * xfns.c (unwind_create_frame):
12865 * nsfns.m (unwind_create_frame):
12866 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12867 Vframe_list (Bug#9999).
12868
22a648b4
DA
128692011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12870
0b381c7e 12871 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 12872
659afede
KH
128732011-11-11 Kenichi Handa <handa@m17n.org>
12874
12875 * callproc.c (Fcall_process): Set the member dst_multibyte of
12876 process_coding.
12877
9ac0394b
KH
128782011-11-11 Johan Bockgård <bojohan@gnu.org>
12879
12880 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12881 avoid a crash (bug#9496).
12882
2fbdc249
CY
128832011-11-09 Chong Yidong <cyd@gnu.org>
12884
12885 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12886 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12887
ac6b1f81
PE
128882011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12889
12890 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12891
09db192c
PE
128922011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12893
12894 Avoid some portability problems by eschewing 'extern inline' functions.
12895 The trivial performance wins aren't worth the portability hassles; see
12896 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12897 et seq.
12898 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12899 (window_box_width, window_box_left, window_box_left_offset)
12900 (window_box_right, window_box_right_offset): Undo previous change,
12901 by removing the "extern"s.
12902 * intervals.c (adjust_intervals_for_insertion)
12903 (adjust_intervals_for_deletion): Undo previous change,
12904 making these static again.
12905 (offset_intervals, temp_set_point_both, temp_set_point)
12906 (copy_intervals_to_string): No longer inline.
12907 * xdisp.c (window_text_bottom_y, window_box_width)
12908 (window_box_height, window_box_left_offset)
12909 (window_box_right_offset, window_box_left, window_box_right)
12910 (window_box): No longer inline.
12911
105216ed
CY
129122011-11-08 Chong Yidong <cyd@gnu.org>
12913
12914 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
12915 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12916 Signal an error if not a live window.
105216ed
CY
12917 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12918 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12919
ae9e237f
JB
129202011-11-07 Juanma Barranquero <lekktu@gmail.com>
12921
12922 * lisp.h (syms_of_abbrev): Remove declaration.
12923 Reported by CHENG Gao <chenggao@royau.me>.
12924
c7aa8333
EZ
129252011-11-07 Eli Zaretskii <eliz@gnu.org>
12926
12927 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12928 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12929 of temacs in GUI mode.
12930
be7f5545
MR
129312011-11-07 Martin Rudalics <rudalics@gmx.at>
12932
12933 * window.h: Declare delete_all_child_windows instead of
12934 delete_all_subwindows.
12935 * window.c (Fwindow_nest, Fset_window_nest)
12936 (Fset_window_new_total, Fset_window_new_normal)
12937 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12938 (delete_all_subwindows): Rename to delete_all_child_windows.
12939 (Fdelete_other_windows_internal, Fset_window_configuration):
12940 Call delete_all_child_windows instead of delete_all_subwindows.
12941 * frame.c (delete_frame): Call delete_all_child_windows instead
12942 of delete_all_subwindows.
12943
ca78dc43
PE
129442011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12945
12946 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12947 This is also needed for porting to any host where GC_MARK_STACK is
12948 not GC_MAKE_GCPROS_NOOPS.
12949 (which_symbols): Use it.
12950
a0241d01
KH
129512011-11-07 Kenichi Handa <handa@m17n.org>
12952
12953 * coding.c (coding_set_destination): Check coding->src_pos only
12954 when coding->src_object is a buffer (bug#9910).
12955
12956 * process.c (send_process): Set the member src_multibyte of coding
12957 to 0 (bug#9911) when sending a unibyte text.
12958
12959 * callproc.c (Fcall_process): Set the member src_multibyte of
12960 process_coding to 0 (bug#9912).
12961
a64bfdfa 129622011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
12963
12964 * xmenu.c (cleanup_widget_value_tree): New function.
12965 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12966 calling free_menubar_widget_value_tree directly (Bug#9830).
12967
cb41b32a
PE
129682011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12969
12970 Fix some portability problems with 'inline'.
12971 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12972 (window_box_width, window_box_left, window_box_left_offset)
12973 (window_box_right, window_box_right_offset): Declare extern.
12974 Otherwise, these inline functions do not conform to C99 and
12975 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12976 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12977 * intervals.c (adjust_intervals_for_insertion)
12978 (adjust_intervals_for_deletion): Now extern, because otherwise the
12979 extern inline functions 'offset_intervals' couldn't refer to it.
12980 (static_offset_intervals): Remove.
12981 (offset_intervals): Rewrite using the old contents of
12982 static_offset_intervals. The old version didn't conform to C99
12983 because an extern inline function contained a reference to an
12984 identifier with static linkage.
12985
b7041366
AS
129862011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12987
12988 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12989 GC.
12990
88a37c4d
EZ
129912011-11-06 Eli Zaretskii <eliz@gnu.org>
12992
12993 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12994 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12995 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12996 return Qleft_to_right.
12997
49745b39
CY
129982011-11-06 Chong Yidong <cyd@gnu.org>
12999
13000 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
13001 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
13002 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
13003 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
13004 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
13005 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
13006 (Fwindow_vscroll): Doc fix.
13007 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
13008 argument, since it makes no sense to pass a live window and for
13009 consistency with window-child.
13010
1f05cd82
CS
130112011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
13012
13013 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
13014 support MSVC.
13015
22610910
JR
130162011-11-05 Jason Rumney <jasonr@gnu.org>
13017
13018 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
13019 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
13020 fonts (Bug#6029).
13021 (add_font_entity_to_list): Fix logic errors in mixed boolean and
13022 bitwise arithmetic preventing use of unicode-sip and non-truetype
13023 opentype fonts.
13024
a06776b2
EZ
130252011-11-05 Eli Zaretskii <eliz@gnu.org>
13026
3ad924ba
EZ
13027 * s/ms-w32.h (fstat, stat, utime): Move redirections to
13028 "emacs"-only part.
13029
a06776b2
EZ
13030 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
13031 initialization code to keep similarity to xfns.c after changes
13032 from 2011-11-05.
13033
c9e7db78
JD
130342011-11-05 Jan Djärv <jan.h.d@swipnet.se>
13035
a97f8f3f
JD
13036 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
13037 (unwind_create_frame): New function (Bug#9943).
13038 (Fx_create_frame): Restructure code to be more similar to the one in
13039 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
13040 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
13041 Move terminal->reference_count++ just before making the frame official
13042 (Bug#9943).
13043
13044 * nsterm.m (x_free_frame_resources): New function.
13045 (x_destroy_window): Move code to x_free_frame_resources.
13046
c9e7db78 13047 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
13048 (Fx_create_frame, x_create_tip_frame):
13049 Move terminal->reference_count++ just before making the frame
75f1671a 13050 official. Move initialization of image_cache_refcount and
c9e7db78
JD
13051 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
13052
a6fc3b5c
EZ
130532011-11-05 Eli Zaretskii <eliz@gnu.org>
13054
13055 Support MSVC build with newer versions of Visual Studio.
13056 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
13057 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
13058 nt/gmake.defs.
13059
13060 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
13061 which are not supported by MSVC.
13062 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
13063 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
13064 bitfields.
13065 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
13066 types in bitfields.
13067 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
13068
13069 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
13070
58179cce 130712011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
13072
13073 Support MSVC build with newer versions of Visual Studio.
13074 * w32.c: Don't include w32api.h for MSVC.
13075 (init_environment) [_MSC_VER]: Call sys_access, not _access.
13076
13077 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
13078 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
13079 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
13080 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
13081 e_* cousins.
13082 (alloca) [_MSC_VER]: Define to _alloca.
13083
13084 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
13085
13086 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
13087
a58c13ed
EZ
130882011-11-04 Eli Zaretskii <eliz@gnu.org>
13089
13090 * xdisp.c (note_mouse_highlight): If either of
13091 previous/next-single-property-change returns nil, treat that as
13092 the beginning or the end of the buffer. (Bug#9955)
13093
fe0b6370
JD
130942011-11-04 Jan Djärv <jan.h.d@swipnet.se>
13095
a58c13ed 13096 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
13097 label is not null (Bug#9951).
13098 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
13099 may be NULL.
13100
89bd5ee1
EZ
131012011-11-04 Eli Zaretskii <eliz@gnu.org>
13102
13103 * window.c (Fwindow_body_size): Mention in the doc string that the
13104 return value is in frame's canonical units. (Bug#9949)
13105
84c3edb9
EZ
131062011-11-03 Eli Zaretskii <eliz@gnu.org>
13107
4e2fb5c7
EZ
13108 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
13109
84c3edb9 13110 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 13111 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 13112 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 13113
bc17a887
EZ
131142011-11-01 Eli Zaretskii <eliz@gnu.org>
13115
13116 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
13117 Don't stop backward scan on the continuation glyph, even though
13118 its CHARPOS is positive.
6d5eb5b0
SM
13119 (mouse_face_from_buffer_pos, note_mouse_highlight):
13120 Rename cover_string to disp_string.
bc17a887 13121
4ee88440
MR
131222011-11-01 Martin Rudalics <rudalics@gmx.at>
13123
13124 * window.c (temp_output_buffer_show): Don't use
13125 Vtemp_buffer_show_specifiers.
13126 (Vtemp_buffer_show_specifiers): Remove unused variable.
13127
c2ff3c02
EZ
131282011-10-30 Eli Zaretskii <eliz@gnu.org>
13129
13130 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
13131 past the beginning of the current glyph matrix.
13132
58179cce 131332011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
13134
13135 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
13136 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
13137 HAVE_GTK3 (Bug#9869).
b77a6a7f 13138
3b574623
JD
13139 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
13140 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
13141
b77a6a7f
JD
13142 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
13143
13144 * xterm.c: Declare x_handle_net_wm_state to return int.
13145 (handle_one_xevent): Check if we are iconified but don't have
13146 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
13147 (get_current_wm_state): Return non-zero if not hidden,
13148 check for _NET_WM_STATE_HIDDEN (Bug#9893).
13149 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
13150 (x_handle_net_wm_state): Return what get_current_wm_state returns.
13151 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
13152
196e41e4
PE
131532011-10-29 Paul Eggert <eggert@cs.ucla.edu>
13154
13155 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
13156 so that this new function doesn't get optimized away by a
13157 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
13158
021f2e1a
AS
131592011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13160
13161 * frame.h (MOUSE_HL_INFO): Remove excess parens.
13162
8b058d44
EZ
131632011-10-29 Eli Zaretskii <eliz@gnu.org>
13164
13165 Fix the `xbytecode' command.
13166 * .gdbinit (xprintbytestr): New command.
b50a28de 13167 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
13168 (xbytecode): Print the byte-code string as well.
13169
4452fb80
EZ
131702011-10-29 Kim Storm <storm@cua.dk>
13171
8b058d44
EZ
13172 * alloc.c (which_symbols): New function.
13173
21b72067
AS
131742011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13175
13176 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
13177 line. (Bug#9903)
13178
83ed7b5c
GM
131792011-10-29 Glenn Morris <rgm@gnu.org>
13180
13181 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
13182 Not clear what it was for, and it causes various bugs. (Bug#9839)
13183
5a7a728b
EZ
131842011-10-28 Eli Zaretskii <eliz@gnu.org>
13185
13186 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
13187 possible random value that matches one of those tested as
13188 condition to clear the mouse face.
13189
d3d0842f
CY
131902011-10-28 Chong Yidong <cyd@gnu.org>
13191
13192 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
13193
31b39d13
DN
131942011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
13195
13196 * window.c (make_window): Initialize phys_cursor_on_p.
13197
9aba6043
SM
131982011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
13199
13200 * lisp.h (struct Lisp_Symbol): Update comments.
13201
c20992f4
JB
132022011-10-28 Juanma Barranquero <lekktu@gmail.com>
13203
13204 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
13205
db4f02f2
EZ
132062011-10-28 Eli Zaretskii <eliz@gnu.org>
13207
13208 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
13209 <oslsachem@gmail.com> for helping to debug this.
13210
13211 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
13212 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
13213 (g_b_init_get_glyph_outline_w): New static variables.
13214 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
13215 (GetGlyphOutlineW_Proc): New typedefs.
13216 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
13217 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
13218 New functions.
13219 (w32font_open_internal, compute_metrics):
13220 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
13221 instead of calling the "wide" APIs directly.
13222
13223 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
13224
13225 * w32.h (syms_of_w32font): Add prototype.
13226
87e68db4
JB
132272011-10-27 Juanma Barranquero <lekktu@gmail.com>
13228
13229 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
13230 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
13231 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
13232 (Fmove_to_window_line): Doc fix.
13233
435c1d67
CY
132342011-10-27 Chong Yidong <cyd@gnu.org>
13235
13236 * process.c (make_process): Set gnutls_state to NULL.
13237
13238 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
13239 non-NULL, regardless of GNUTLS_INITSTAGE.
13240 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
13241 an error. Set process slots as soon as we allocate them.
13242
13243 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
13244
9c6c6f49
CY
132452011-10-27 Chong Yidong <cyd@gnu.org>
13246
9aba6043
SM
13247 * gnutls.c (emacs_gnutls_deinit): New function.
13248 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
13249 (Fgnutls_deinit, Fgnutls_boot): Use it.
13250
13251 * process.c (make_process): Initialize GnuTLS credentials to NULL.
13252 (deactivate_process): Call emacs_gnutls_deinit.
13253
657d08d3
JB
132542011-10-27 Juanma Barranquero <lekktu@gmail.com>
13255
13256 * image.c (x_create_x_image_and_pixmap):
13257 * w32.c (sys_rename, w32_delayed_load):
13258 * w32font.c (fill_in_logfont):
13259 * w32reg.c (x_get_string_resource): Silence compiler warnings.
13260
5430d399
JB
132612011-10-26 Juanma Barranquero <lekktu@gmail.com>
13262
13263 * w32fns.c (w32_default_color_map): New function,
13264 extracted from Fw32_default_color_map.
a7ef684b 13265 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 13266
fe0055fa
PE
132672011-10-25 Paul Eggert <eggert@cs.ucla.edu>
13268
13269 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
13270
e6346438
SM
132712011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
13272
13273 * keyboard.c (test_undefined): New function (bug#9751).
13274 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
13275
e112cc37
ET
132762011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
13277
13278 * sysdep.c (init_sys_modes): Fix the check for the controlling
13279 terminal (Bug#6649).
13280
7b5d6677
EZ
132812011-10-20 Eli Zaretskii <eliz@gnu.org>
13282
13283 * dispextern.h (struct bidi_it): New member next_en_type.
13284
13285 * bidi.c (bidi_line_init): Initialize the next_en_type member.
13286 (bidi_resolve_explicit_1): When next_en_pos is valid for the
13287 current character, check also for next_en_type being WEAK_EN.
13288 (bidi_resolve_weak): Don't enter the expensive loop if the current
13289 position is before next_en_pos. Record the bidi type of the first
13290 non-ET, non-BN character we find, in addition to its position.
13291 (bidi_level_of_next_char): Invalidate next_en_type when
13292 next_en_pos is over-stepped.
13293
7da0b018
PE
132942011-10-20 Paul Eggert <eggert@cs.ucla.edu>
13295
13296 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
13297 * editfns.c: Rewrite current-time-zone so that it invokes
13298 the equivalent of (format-time-string "%Z") to get the time zone name.
13299 This fixes a bug when the time zone name contains characters that
13300 need converting from the system time locale to Emacs internal format.
13301 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
13302 that patch fixed format-time-string to do the conversion, but
13303 I forgot to fix current-time-zone.
13304 (format_time_string): New function, containing most of
13305 what Fformat_time_string used to contain.
13306 (Fformat_time_string): Rewrite in terms of format_time_string.
13307 This doesn't change this function's behavior.
13308 (current-time-zone): Rewrite to use format_time_string.
13309 This fixes the bug reported by Michael Schierl in
13310 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
13311 Jason Rumney's 2007-06-07 change worked around this bug, but
13312 didn't fix it.
13313 * systime.h (tzname, timezone): Remove no-longer-used declarations.
13314
8547b010
EZ
133152011-10-19 Eli Zaretskii <eliz@gnu.org>
13316
13317 * xdisp.c (start_display): If the character at POS is displayed
13318 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
13319 (try_window_reusing_current_matrix): If a line ends in a display
13320 vector or the next line starts in a display vector, continue
13321 redrawing the window even though the character position of
13322 start_row was reached.
8547b010
EZ
13323 (Bug#9771, part 2)
13324
4e948d15
CY
133252011-10-18 Chong Yidong <cyd@gnu.org>
13326
13327 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
13328 with nobreak-char-display too.
13329
4787455f
EZ
133302011-10-18 Eli Zaretskii <eliz@gnu.org>
13331
13332 Fix part 3 of bug#9771.
13333 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
13334 (bidi_resolve_neutral): Don't enter the expensive loop looking for
13335 non-neutral characters if the current character is a paragraph
13336 separator (a.k.a. Newline). This avoids running the same
13337 expensive loop twice, once when we consume the preceding newline
13338 and the other time when the line actually needs to be displayed.
13339 Avoid the loop when we see neutrals on the base embedding level
13340 following a character whose directionality is the same as the
13341 paragraph's. This avoids running the expensive loop when a line
13342 ends in a long sequence of neutrals, like control characters.
13343 Add assertion against STRONG_AL type. Slightly rearrange code
13344 that determines the type of a neutral given the first non-neutral
13345 that follows it.
13346 (bidi_level_of_next_char): Set next_en_pos to zero when
13347 invalidating its info.
13348
2c91f553
EZ
133492011-10-17 Eli Zaretskii <eliz@gnu.org>
13350
13351 * xdisp.c (push_display_prop): Determine whether to record string
13352 or buffer position by IT->string, not by IT->method. Allow
13353 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
13354 (move_it_vertically_backward): Don't look for character position
13355 immediately after the newline when in a continuation line.
13356 (Bug#9771, part 1)
2c91f553 13357
c7b08b0d
MR
133582011-10-15 Martin Rudalics <rudalics@gmx.at>
13359
13360 * window.c (coordinates_in_window): Rewrite and delabelize
13361 vertical border check. (Bug#5357) (Bug#9618)
13362
6b02f655
SM
133632011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
13364
13365 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
13366 errors in XSetWindowBorder (bug#9310).
13367
81d40c92
DA
133682011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
13369
13370 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
13371 avoid crash when xmalloc overrun checking is enabled.
13372
d4172c3b
EZ
133732011-10-13 Eli Zaretskii <eliz@gnu.org>
13374
13375 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
13376 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
13377 cursor motion with <left> and <right> arrow keys.
13378
13379 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
13380 some callers set that themselves.
13381
b00eea75
EZ
133822011-10-12 Eli Zaretskii <eliz@gnu.org>
13383
13384 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
13385 display string and the previous row comes from the same string and
13386 is empty. (Bug#9739) (Bug#9738)
13387
8fe012c4
SM
133882011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
13389
13390 * doc.c (get_doc_string): Encode file name (bug#9735).
13391
0074aef2
EZ
133922011-10-12 Eli Zaretskii <eliz@gnu.org>
13393
79beb178
EZ
13394 * bidi.c (bidi_level_of_next_char):
13395 * xdisp.c (get_visually_first_element): Remove old incorrect
13396 comments regarding the Unicode Line Separator character.
13397
0074aef2
EZ
13398 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
13399
6e4b3fbe
DA
134002011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
13401
13402 * alloc.c (Fgc_status): Do not access beyond zombies array
13403 boundary if nzombies > MAX_ZOMBIES.
13404 * alloc.c (dump_zombies): Add missing format specifier.
13405
0324f3af
PE
134062011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13407
b5525cac
PE
13408 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13409 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13410
0324f3af
PE
13411 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13412 Some packages use them to denote characters with modifiers.
13413
e9b5f888
AS
134142011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13415
13416 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13417 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13418 matching a pp-number. Rename parameter var to var1.
13419
127827c0
SM
134202011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13421
13422 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13423
c8fd3bd0
GM
134242011-10-08 Glenn Morris <rgm@gnu.org>
13425
13426 * callint.c (Fcall_interactively): Give a more explicit error for the
13427 'c' case with a non-character input. (Bug#8479)
13428
352ec8ff
EZ
134292011-10-08 Eli Zaretskii <eliz@gnu.org>
13430
03669ccb
EZ
13431 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13432 lines.
7061c986
EZ
13433 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13434 lines that are hscrolled on the left.
03669ccb 13435
352ec8ff
EZ
13436 * dispnew.c (buffer_posn_from_coords): Account for a possible
13437 presence of header-line. (Bug#4426)
13438
a66cfb1c
SM
134392011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13440
6b02f655
SM
13441 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13442 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 13443
7c5ee88e
PE
134442011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13445
13446 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13447 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13448 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13449 this makes Emacs dump core during garbage collection on rare
13450 occasions. sizeof is obviously inferior to offsetof here, so
13451 stick with offsetof.
13452 (GC_POINTER_ALIGNMENT): New macro.
13453 (mark_memory): Omit 3rd (offset) arg; caller changed.
13454 Don't assume EMACS_INT alignment is the same as pointer alignment.
13455
df1bbe5b
SM
134562011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13457
13458 * keyboard.c (read_key_sequence_remapped): New var.
13459 (read_key_sequence): Compute remapping in the right buffer.
13460 (command_loop_1): Use read_key_sequence's remapping directly.
13461
51553db6
SM
134622011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13463
32c1fffd
SM
13464 * dired.c (file_name_completion): Don't expand file name.
13465 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13466 before checking file name handler.
13467
51553db6
SM
13468 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13469 they've been requested explicitly (bug#9591).
13470
b6bd1599 134712011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
13472
13473 * keymap.c (Fsingle_key_description): Use make_specified_string
13474 instead of build_string to build string from push_key_description.
13475 (Bug#5193)
13476
f701dc2a
PE
134772011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13478
4222c55d
PE
13479 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13480 This fixes a Y2038 bug on 64-bit hosts.
13481 * buffer.c (reset_buffer):
13482 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13483 (Fclear_buffer_auto_save_failure):
13484 Use 0, not -1, to represent an unset failure time, since time_t
13485 might not be signed.
13486
f701dc2a
PE
13487 Remove dependency on glibc malloc internals.
13488 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13489 Move back here from lisp.h, but with their new implementations.
13490 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13491 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13492 * charset.c (charset_table_init): New static var.
13493 (syms_of_charset): Use it instead of xmalloc. This removes a
13494 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13495 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13496 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13497 Move back to alloc.c.
13498 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13499 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13500
9ceebf39
JD
135012011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13502
13503 * nsterm.m (windowDidResize): Call x_set_window_size only when
13504 ns_in_resize is true. Otherwise set pixelwidth/height and
13505 call change_frame_size (Bug#9628).
13506
cb993c58
PE
135072011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13508
3930c88b
PE
13509 Port --enable-checking=all to Fedora 14 x86-64.
13510 * charset.c (syms_of_charset): Also account for glibc malloc's
13511 internal overhead when calculating the initial malloc maximum.
13512
cb993c58
PE
13513 Port --enable-checking=all to Fedora 14 x86.
13514 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13515 Move to lisp.h.
13516 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13517 (overrun_check_realloc, overrun_check_free):
13518 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13519 That way, xmalloc returns a properly-aligned pointer even if
13520 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13521 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13522 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13523 into account when calculating the initial malloc maximum.
13524 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13525 Move here from alloc.c, so that charset.c can use it too.
13526 Properly align; the old code wasn't right for common 32-bit hosts
13527 when configured with --enable-checking=all.
13528 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13529 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13530
31bed486
EZ
135312011-09-29 Eli Zaretskii <eliz@gnu.org>
13532
04c70788 13533 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
13534 use EDOM.
13535
fbcaa2f3
EZ
135362011-09-28 Eli Zaretskii <eliz@gnu.org>
13537
13538 * xdisp.c (compute_display_string_end): If there's no display
13539 string at CHARPOS, return -1.
13540
13541 * bidi.c (bidi_fetch_char): When compute_display_string_end
13542 returns a negative value, treat the character as a normal
13543 character not covered by a display string. (Bug#9624)
13544
a239d4e9
JB
135452011-09-28 Juanma Barranquero <lekktu@gmail.com>
13546
13547 * lread.c (Fread_from_string): Fix typo in docstring.
13548
88652fd5
EZ
135492011-09-27 Eli Zaretskii <eliz@gnu.org>
13550
13551 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13552 newline, reseat the iterator instead of bidi-iterating there one
13553 character at a time. (Bug#9610)
32c1fffd
SM
13554 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13555 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 13556
ed497dd4
AS
135572011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13558
13559 * lread.c (readevalloop): Use correct code for NBSP.
13560 (read1): Likewise. (Bug#9608)
13561
b2bf61aa
MA
135622011-09-25 Michael Albinus <michael.albinus@gmx.de>
13563
13564 * dbusbind.c (Fdbus_register_signal): When service is not
13565 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13566
32bbb17c
GM
135672011-09-25 Glenn Morris <rgm@gnu.org>
13568
13569 * buffer.c (truncate-lines): Doc fix.
13570
94e0933e
CY
135712011-09-24 Chong Yidong <cyd@stupidchicken.com>
13572
13573 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13574 (Fset_window_next_buffers): Doc fix.
13575
cddde921
GM
135762011-09-24 Glenn Morris <rgm@gnu.org>
13577
13578 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13579
1260aef1
PE
135802011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13581
25b4bfa0
PE
13582 Fix minor problems found by static checking.
13583 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
13584 * indent.c (Fvertical_motion): Fix == vs = typo.
13585
e3cbd34b
EZ
135862011-09-24 Eli Zaretskii <eliz@gnu.org>
13587
a66cfb1c
SM
13588 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13589 Default value is now t. Doc fix.
6bf7006f 13590
e3cbd34b 13591 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 13592 logic when moving up, not only when moving down. Fix the
e3cbd34b 13593 confusing name and values of the it_overshoot_expected variable;
32c1fffd 13594 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
13595
13596 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13597 CHARPOS is covered by a display string which includes newlines.
13598 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13599 is covered by a display string with embedded newlines.
13600
a3de0cbd
MA
136012011-09-24 Michael Albinus <michael.albinus@gmx.de>
13602
13603 * dbusbind.c (Fdbus_register_signal): Add match rule to
13604 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
13605 (Fdbus_register_method, Vdbus_registered_objects_table):
13606 Fix docstring.
a3de0cbd 13607
b260039d
JM
136082011-09-24 Jim Meyering <meyering@redhat.com>
13609
32c1fffd 13610 do not ignore write error for any output size
b260039d
JM
13611 The previous change was incomplete.
13612 While it makes emacs --batch detect the vast majority of stdout
13613 write failures, errors were still ignored whenever the output size is
13614 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13615 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13616 && echo FAIL: ignored write error
13617 FAIL: ignored write error
13618 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13619 && echo FAIL: ignored write error
13620 FAIL: ignored write error
13621 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13622
8eca8a7c
AS
136232011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13624
13625 * emacs.c (Fkill_emacs): In noninteractive mode exit
13626 non-successfully if a write error occurred on stdout. (Bug#9574)
13627
3341db62
EZ
136282011-09-21 Eli Zaretskii <eliz@gnu.org>
13629
13630 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13631 the xassert test.
13632
13633 * dispextern.h (struct it): Update the comment documenting what
13634 can it->OBJECT be.
13635
8c203dbf
EZ
136362011-09-20 Eli Zaretskii <eliz@gnu.org>
13637
13638 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13639 a display string, extend search for cursor position to end of row.
13640 (find_row_edges): If the row ends in a newline from a display
13641 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13642 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
13643 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13644 non-empty line. Fixes confusing cursor motion with arrow keys at
13645 the beginning of a line that starts with whitespace.
8c203dbf 13646
a4824228
LMI
136472011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13648
13649 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13650 (bug#9493).
13651
33ed493b
CY
136522011-09-18 Chong Yidong <cyd@stupidchicken.com>
13653
13654 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13655 boolean (Bug#9154).
13656
56cd55c8
EZ
136572011-09-18 Eli Zaretskii <eliz@gnu.org>
13658
13659 * xdisp.c (display_line): Record maximum and minimum buffer
13660 positions even if no glyphs were produced (e.g., by a zero-width
13661 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13662 buffer positions that will be removed from the glyph row because
13663 they don't fit.
c02dcedf
EZ
13664 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13665 column is beyond frame width: don't subtract 1 "pixel" when
13666 computing width of the stretch.
3e62b7e0
EZ
13667 (reseat_at_next_visible_line_start): Undo the change made on
13668 2011-09-17 that saved paragraph information and restored it after
13669 the call to `reseat'. (Bug#9545)
56cd55c8 13670
5ed99d36 136712011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
13672
13673 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13674 and turn window cursor on if cleared (Bug#9415).
13675
5ed99d36 136762011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
13677
13678 * search.c (boyer_moore): Take unibyte characters from pattern
13679 literally. (Bug#9458)
13680
9bade7b2
EZ
136812011-09-18 Eli Zaretskii <eliz@gnu.org>
13682
13683 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13684
e5e9d610
PE
136852011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13686
87e4427a
PE
13687 Fix minor problem found by static checking.
13688 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13689 initialized, to pacify gcc -Wuninitialized.
13690
e5e9d610
PE
13691 * fileio.c: Report proper errno when syscall falls.
13692 (Finsert_file_contents): Save and restore errno,
13693 so that report_file_error outputs the correct diagnostic.
13694 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13695
a1674f0b
EZ
136962011-09-18 Eli Zaretskii <eliz@gnu.org>
13697
13698 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13699
fbfb6dd4
EZ
137002011-09-17 Eli Zaretskii <eliz@gnu.org>
13701
13702 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13703 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13704
bb187662
EZ
137052011-09-17 Eli Zaretskii <eliz@gnu.org>
13706
1137e8b8 13707 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 13708 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
13709
13710 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13711 (bidi_find_paragraph_start): Search back for paragraph beginning
13712 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13713 (bidi_move_to_visually_next): Only trigger paragraph-related
13714 computations when the last character is a newline or at EOB, not
13715 just any NEUTRAL_B. (Bug#9470)
13716
bb187662
EZ
13717 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13718 truncated lines if point is covered by a display string. (Bug#9524)
13719
2e621251
PE
137202011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13721
13722 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13723 (cons_to_x_long): New function.
13724 (lisp_data_to_selection_data): Use it. Correct the test for
13725 short-versus-long data; it was negated. Break out of vector
13726 loop, for efficiency, when a long datum is discovered.
13727
91a15bc6
SM
137282011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13729
13730 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13731
b41c3a35
EZ
137322011-09-16 Eli Zaretskii <eliz@gnu.org>
13733
13734 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13735 GCC PR/17406) by declaring this function with external scope.
13736
7812ba2d
PE
137372011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13738
13739 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13740 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13741
cf7edc2a
AS
137422011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13743
13744 * editfns.c (Fformat): Correctly handle text properties on "%%".
13745
bd01620e
EZ
137462011-09-15 Eli Zaretskii <eliz@gnu.org>
13747
13748 * xterm.c (x_draw_composite_glyph_string_foreground):
13749 * w32term.c (x_draw_composite_glyph_string_foreground):
13750 * term.c (encode_terminal_code):
13751 * composite.c (composition_update_it, get_composition_id):
13752 * xdisp.c (get_next_display_element)
13753 (fill_composite_glyph_string): Add comments about special meaning
13754 of TAB characters in a composition.
13755
a02719a3
PE
137562011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13757
13758 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
13759 This occurs when processing a multibyte format.
13760 Problem reported by Wolfgang Jenker.
a02719a3 13761
72589a3c
JB
137622011-09-15 Johan Bockgård <bojohan@gnu.org>
13763
13764 * xdisp.c (try_cursor_movement): Only check for exact match if
13765 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13766
1c14176c
PE
137672011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13768
13769 Remove unused external symbols.
13770 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13771 * xdisp.c (calc_pixel_width_or_height): Now static.
13772 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13773 * indent.c (check_display_width):
13774 * w32term.c: Fix comment to match code.
13775 * xterm.c, xterm.h (x_catching_errors): Remove.
13776
d2eea5b5
PE
137772011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13778
13779 * xselect.c: Use signed conversions more consistently (Bug#9498).
13780 (selection_data_to_lisp_data): Assume incoming selection data are
13781 signed integers, not unsigned. This is to be consistent with
13782 outgoing selection data, which was modified to use signed integers
13783 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13784 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13785 expects long, not unsigned long.
13786
46888499
EZ
137872011-09-14 Eli Zaretskii <eliz@gnu.org>
13788
13789 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13790 computation of loop end. Reported by Johan Bockgård
13791 <bojohan@gnu.org>.
13792
ef8ef9fb
CY
137932011-09-13 Chong Yidong <cyd@stupidchicken.com>
13794
13795 * frame.c (Fother_visible_frames_p): Function deleted.
13796
fa819fed
EZ
137972011-09-12 Eli Zaretskii <eliz@gnu.org>
13798
13799 * indent.c (compute_motion): Process display vector front to back
13800 rather than the other way around. (Bug#2496)
13801
2ba8e008
SM
138022011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13803
13804 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13805
20f53c69
CY
138062011-09-11 Chong Yidong <cyd@stupidchicken.com>
13807
13808 * minibuf.c (Fread_from_minibuffer): Doc fix.
13809
d562d7a4
EZ
138102011-09-11 Eli Zaretskii <eliz@gnu.org>
13811
13812 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13813 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13814
1c4d7f3d
LMI
138152011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13816
13817 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13818 value for non-existent files.
13819
b885bf36
EZ
138202011-09-11 Eli Zaretskii <eliz@gnu.org>
13821
13822 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13823 set its "size" to -1. This will set the modtime_size field of
13824 the corresponding buffer to -1, which is what
13825 verify-visited-file-modtime expects for files that do not exist.
13826 (Bug#9139)
13827
6612f0bf
PE
138282011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13829
13830 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13831 here ...
13832 * lisp.h: ... from here. push_key_description is no longer
13833 defined in keyboard.c, so its declaration should not be in
13834 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13835 logically belongs with push_key_description.
13836
dfb3f755
PE
138372011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13838
13839 * buffer.h: Include <sys/types.h> instead of <time.h>.
13840 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13841 Problem reported by Herbert J. Skuhra.
13842
3134906c
LMI
138432011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13844
13845 * xml.c (parse_region): Make the parsing work for
13846 non-comment-starting XML files again (bug#9144).
13847
8d903f4e
AS
138482011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13849
13850 * image.c (gif_load): Fix calculation of bottom and right corner.
13851 (Bug#9468)
13852
80ad64f4
EZ
138532011-09-10 Eli Zaretskii <eliz@gnu.org>
13854
13855 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13856 redisplay in small windows.
13857
208a048d
EZ
138582011-09-09 Eli Zaretskii <eliz@gnu.org>
13859
13860 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13861
9b1c252e
MR
138622011-09-08 Martin Rudalics <rudalics@gmx.at>
13863
13864 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13865 Operate on live windows only.
13866
2949f33b
JB
138672011-09-08 Juanma Barranquero <lekktu@gmail.com>
13868
13869 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13870
e08dcafd
EZ
138712011-09-07 Eli Zaretskii <eliz@gnu.org>
13872
13873 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13874 only under bidi iteration.
13875
115b96bd
JD
138762011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13877
13878 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13879
c8199d0f
PE
138802011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13881
13882 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13883 Without this fix, the command to link temacs failed due to an
13884 undefined symbol __builtin_isnan. This is because
13885 /usr/include/iso/math_c99.h #defines isnan(x) to
13886 __builtin_isnan(x), but the bundled gcc, which identifies itself
13887 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13888 a __builtin_isnan.
13889 * floatfns.c (isnan): #undef, and then #define to a clone of
13890 what's in data.c.
13891 (Fisnan): Always define, since it's always available now.
13892 (syms_of_floatfns): Always define isnan at the Lisp level.
13893
e39b275c 138942011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
13895
13896 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13897
b2db44d9 138982011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 13899
f4af5137 13900 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
13901 The previous code assumed that file offsets (off_t values) fit in
13902 EMACS_INT variables, which is not true on typical 32-bit hosts.
13903 The code messed up by falsely reporting buffer overflow in cases
13904 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13905 when "big" contains more than 2**29 bytes, even though this
13906 inserts just one byte and does not overflow the buffer.
13907 (Finsert_file_contents): Store file offsets as off_t
13908 values, not as EMACS_INT values. Check for overflow when
13909 converting between EMACS_INT and off_t. When checking for
13910 buffer overflow or for overlap, take the offsets into account.
13911 Don't use EMACS_INT for small values where int suffices.
13912 When checking for overlap, fix a typo: ZV was used where
13913 ZV_BYTE was intended.
13914 (Fwrite_region): Don't assume off_t fits into 'long'.
13915 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13916
ecfc0a49
MA
139172011-09-05 Michael Albinus <michael.albinus@gmx.de>
13918
13919 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13920
6511acf2 139212011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 13922
0999621a 13923 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
13924
13925 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 13926 (esprintf, exprintf, evxprintf): New functions.
62f19c19 13927 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 13928 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
13929 (modify_event_symbol): Do not assume that the length of
13930 name_alist_or_stem is safe to alloca and fits in int.
13931 (Fexecute_extended_command): Likewise for function name and binding.
13932 (Frecursion_depth): Wrap around reliably on integer overflow.
13933 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13934 since some callers pass EMACS_INT values.
13935 (Fsingle_key_description): Don't crash if symbol name contains more
13936 than MAX_ALLOCA bytes.
13937 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13938 (get_minibuffer): Arg is now EMACS_INT, not int.
13939 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 13940 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
13941 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13942
2be7d702
PE
13943 * dbusbind.c (signature_cat): New function.
13944 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
13945 Do not overrun buffer; instead, report string overflow.
13946
9d1df220
PE
13947 * dispnew.c (add_window_display_history): Don't overrun buffer.
13948 Truncate instead; this is OK since it's just a log.
13949
33ef5c64
PE
13950 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13951 even if the time zone offset is outlandishly large.
13952 Don't mishandle offset == INT_MIN.
13953
66c6fdd5
PE
13954 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13955 when creating daemon; the previous buffer-overflow check was incorrect.
13956
d749b01b
PE
13957 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13958 which has the guts of the old verror function.
13959
b5cd1905
PE
13960 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13961 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13962
6e1a67fb
PE
13963 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13964 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 13965 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 13966 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
13967 length of string rather than counting it via multiple sprintfs;
13968 that's simpler and more reliable.
c21721cc
PE
13969 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13970 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13971 sprintf, in case result does not fit in int.
13972
c57b67fc
PE
13973 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13974 (fontset_from_font): Print it.
13975
8a401434
PE
13976 * frame.c (tty_frame_count): Now printmax_t, not int.
13977 (make_terminal_frame, set_term_frame_name): Print it.
13978 (x_report_frame_params): In X, window IDs are unsigned long,
13979 not signed long, so print them as unsigned.
13980 (validate_x_resource_name): Check for implausibly long names,
13981 and don't assume name length fits in 'int'.
13982 (x_get_resource_string): Don't blindly alloca invocation name;
13983 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13984 not fit in int.
13985
6e1a67fb
PE
13986 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13987 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
13988 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13989
0df02bf3
PE
13990 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13991 Use esprintf, not sprintf, in case result does not fit in int.
13992
48e30793
PE
13993 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13994 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13995 it as a large positive number.
13996 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13997 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13998
a66ff6d8
PE
13999 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
14000 in case result does not fit in int.
14001
aca216ff
PE
14002 * print.c (float_to_string): Detect width overflow more reliably.
14003 (print_object): Make sprintf buffer a bit bigger, to avoid potential
14004 buffer overrun. Don't assume list length fits in 'int'. Treat
14005 print length of 0 as 0, not as infinity; to be consistent with other
14006 uses of print length in this function. Don't overflow print length
14007 index. Don't assume hash table size fits in 'long', or that
14008 vectorlike size fits in 'unsigned long'.
14009
31c286f7
PE
14010 * process.c (make_process): Use printmax_t, not int, to format
14011 process-name gensyms.
14012
55e5faa1
PE
14013 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
14014
80f2e268
PE
14015 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
14016 to avoid potential buffer overrun.
14017
670741ab
PE
14018 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
14019 if X resource line is longer than 512 bytes.
14020
b7163a50
PE
14021 * xfns.c (x_window): Make sprintf buffer a bit bigger
14022 to avoid potential buffer overrun.
14023
ae58ff1f
PE
14024 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
14025
c43c8a6a
PE
14026 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
14027
3f8236f4
PE
140282011-09-04 Paul Eggert <eggert@cs.ucla.edu>
14029
53e9fe90 14030 Integer overflow fixes for scrolling, etc.
6511acf2
PE
14031 Without these, Emacs silently mishandles large integers sometimes.
14032 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
14033 it were "C-u 1 M-x recenter" on a typical 64-bit host.
14034
6511acf2
PE
14035 * xdisp.c (try_window_id): Check Emacs fixnum range before
14036 converting to 'int'.
806add1d 14037
6511acf2 14038 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
14039 Check that an Emacs fixnum is in range before assigning it to 'int'.
14040 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
14041 values converted from Emacs fixnums.
14042 (Frecenter): Don't wrap around a line count if it is out of 'int'
14043 range; instead, treat it as an extreme value.
14044 (Fset_window_configuration, compare_window_configurations):
14045 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
14046
6511acf2
PE
14047 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
14048 that can exceed INT_MAX. Check that EMACS_INT value is in range
14049 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
14050 (match_limit): Don't assume that a fixnum can fit in 'int'.
14051
6511acf2 14052 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
14053 exceed INT_MAX.
14054
6511acf2 14055 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
14056 (Fvertical_motion): Don't wrap around LINES values that don't fit
14057 in 'int'. Instead, treat them as extreme values. This is good
14058 enough for windows, which can't have more than INT_MAX lines anyway.
14059
fcb901a7
LMI
140602011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14061
0f2f6b6d
LMI
14062 * Require libxml/parser.h to avoid compilation warning.
14063
fcb901a7
LMI
14064 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
14065
14066 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
14067 since this reportedly can destroy thread storage.
14068
6e20a0d4
CY
140692011-08-30 Chong Yidong <cyd@stupidchicken.com>
14070
14071 * syntax.c (find_defun_start): Update all cache variables if
14072 exiting early (Bug#9401).
14073
148ae00e
EZ
140742011-08-30 Eli Zaretskii <eliz@gnu.org>
14075
f6cfbd8f
EZ
14076 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
14077
148ae00e
EZ
14078 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
14079 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
14080 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
14081
14082 * term.c (tty_append_glyph): New function.
14083 (produce_stretch_glyph): Static function and its prototype deleted.
14084
a66cfb1c
SM
14085 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
14086 Add prototypes.
148ae00e 14087
c4a07a4c
PE
140882011-08-29 Paul Eggert <eggert@cs.ucla.edu>
14089
14090 * image.c (parse_image_spec): Check for nonnegative, not for positive,
14091 when checking :margin (Bug#9390).
14092 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 14093 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
14094 so that the name doesn't mislead. All uses changed.
14095
6bc8cd65
JB
140962011-08-28 Johan Bockgård <bojohan@gnu.org>
14097
14098 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
14099 set_tty_hooks.
14100
dca4927e
EZ
141012011-08-27 Eli Zaretskii <eliz@gnu.org>
14102
14103 * xdisp.c (move_it_to): Don't bail out early when reaching
14104 position beyond to_charpos, if we are scanning backwards.
14105 (move_it_vertically_backward): When DY == 0, make sure we get to
14106 the first character in the line after the newline.
14107
f2cad773
PE
141082011-08-27 Paul Eggert <eggert@cs.ucla.edu>
14109
14110 * ccl.c: Improve and simplify overflow checking (Bug#9196).
14111 (ccl_driver): Do not generate an out-of-range pointer.
14112 (Fccl_execute_on_string): Remove unnecessary check for
14113 integer overflow, noted by Stefan Monnier in
14114 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
14115 Remove a FIXME that didn't need fixing.
14116 Simplify the newly-introduced buffer reallocation code.
14117
0cae2cdb
JB
141182011-08-27 Juanma Barranquero <lekktu@gmail.com>
14119
14120 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
14121
5fc295a4 141222011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 14123
70c60eb2 14124 Integer and memory overflow issues (Bug#9196).
726e0ab1 14125
d31850da
PE
14126 * doc.c (get_doc_string): Rework so that
14127 get_doc_string_buffer_size is the actual buffer size, rather than
14128 being 1 less than the actual buffer size; this makes xpalloc more
14129 convenient.
14130
a69fbedb
PE
14131 * image.c (x_allocate_bitmap_record, cache_image):
14132 * xselect.c (Fx_register_dnd_atom):
14133 Simplify previous changes by using xpalloc.
14134
fe5c5d37
PE
14135 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
14136 since either will do and ptrdiff_t is convenient with xpalloc.
14137
0065d054
PE
14138 * charset.c (charset_table_size)
14139 (struct charset_sort_data.priority): Now ptrdiff_t.
14140 (charset_compare): Don't overflow if priorities differ greatly.
14141 (Fsort_charsets): Don't assume list length fits in int.
14142 Check for size-calculation overflow when allocating sort data.
14143 (syms_of_charset): Allocate an initial charset table that is
14144 just under 64 KiB, to avoid problems with glibc malloc and mmap.
14145
14146 * cmds.c (internal_self_insert): Check for size-calculation overflow.
14147
14148 * composite.h (struct composition.glyph_len): Now int, not unsigned.
14149 The actual value is always <= INT_MAX, and leaving it unsigned made
14150 overflow checking harder.
14151
14152 * dispextern.h (struct glyph_matrix.rows_allocated)
14153 (struct face_cache.size): Now ptrdiff_t, for convenience in use
14154 with xpalloc. The values are still always <= INT_MAX.
14155
14156 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
14157
14158 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
14159 (SAFE_NALLOCA): New macro.
14160
14161 * region-cache.c (struct boundary.pos, find_cache_boundary)
14162 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
14163 (set_cache_region, invalidate_region_cache)
14164 (revalidate_region_cache, know_region_cache, region_cache_forward)
14165 (region_cache_backward, pp_cache):
14166 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
14167 so that ptrdiff_t * can be passed to xpalloc.
14168 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
14169 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
14170 (pp_cache): Don't assume cache_len fits in int.
14171 * region-cache.h: Adjust extern decls to match.
14172
14173 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
14174 EMACS_INT, since either will do, for xpalloc.
14175
14176 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
14177 (xnmalloc, xnrealloc, xpalloc): New functions.
14178
726e0ab1
PE
14179 * bidi.c (bidi_shelve_header_size): New constant.
14180 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
14181 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
14182
51f30bc5 14183 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
14184 * buffer.c (overlays_at, overlays_in, record_overlay_string)
14185 (overlay_strings):
14186 Don't update size of array until after memory allocation succeeds,
14187 because xmalloc/xrealloc may not return.
0065d054
PE
14188 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
14189 now that we have proper integer overflow checking.
14190 (record_overlay_string, overlay_strings): Catch overflows when
14191 calculating size of overlay_str_buf.
726e0ab1 14192
0065d054
PE
14193 * callproc.c (Fcall_process): Check for size overflow when
14194 calculating size of args2.
14195 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
14196 Normally we prefer signed values, but sticking with ptrdiff_t would
14197 require adding more-complicated checks.
726e0ab1
PE
14198
14199 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
14200 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
14201 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 14202 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
14203
14204 * character.c (Fstring): Check for size-calculation overflow.
14205
14206 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
14207 unnecessary integer overflow. Check for size overflow.
14208 (encode_coding_object): Don't update size until xmalloc succeeds.
14209
14210 * composite.c (get_composition_id): Check for overflow in glyph
14211 length calculations.
14212
14213 Integer and memory overflow fixes for display code.
14214 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
14215 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
14216 (scrolling_window): Check for overflow in size calculations.
14217 (line_draw_cost, realloc_glyph_pool, add_row_entry):
14218 Don't assume glyph table len fits in int.
14219 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
14220 (row_table_size): Now ptrdiff_t, not int.
14221 (scrolling_window): Avoid overflow in size calculations.
14222 Don't update size until allocation succeeds.
14223 * fns.c (concat): Check for overflow in size calculations.
14224 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
14225 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14226 (NEXT_ALMOST_PRIME_LIMIT): New constant.
14227
14228 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
14229 (get_doc_string): Check for size calculation overflow.
14230 Don't update size until allocation succeeds.
14231 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
14232 EMACS_INT, where ptrdiff_t will do.
14233 (Fsubstitute_command_keys): Check for string overflow.
14234
14235 * editfns.c (set_time_zone_rule): Don't assume environment length
14236 fits in int.
14237 (message_length): Now ptrdiff_t, not int.
14238 (Fmessage_box): Don't update size until allocation succeeds.
14239 Don't assume message length fits in int.
14240 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
14241
0065d054
PE
14242 * emacs.c (main): Do not reallocate argv, since there is a null at
14243 the end that can be overwritten, and this way there's no need to
14244 worry about size-calculation overflow.
14245 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
14246
14247 * eval.c (init_eval_once, grow_specpdl): Don't update size until
14248 alloc succeeds.
14249 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
14250
14251 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
14252 (x_set_scroll_bar_width, x_figure_window_size):
14253 Check for integer overflow.
14254 (x_set_alpha): Do not assume XINT fits in int.
14255
14256 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
14257 This is for the members text_lines, text_cols, total_lines, total_cols,
14258 where the system imposes an 'int' limit.
14259
14260 * fringe.c (Fdefine_fringe_bitmap):
14261 Don't update size until alloc works.
14262
14263 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
14264 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
14265
14266 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
14267 Check for size-calculation overflow.
14268 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
14269 do, as we prefer signed integers.
14270 (id_to_widget.max_size, id_to_widget.used)
14271 (xg_store_widget_in_map, xg_remove_widget_from_map)
14272 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
14273 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
14274 Use and return ptrdiff_t, not int.
14275 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
14276 * gtkutil.h: Change prototypes to match the above.
14277
14278 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
14279 are duplicate now that they've been promoted to lisp.h.
14280 (x_allocate_bitmap_record, x_alloc_image_color)
14281 (make_image_cache, cache_image, xpm_load):
14282 Don't update size until alloc is done.
14283 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
14284 (x_detect_edges):
3256efce 14285 Check for size calculation overflow.
726e0ab1
PE
14286 (ct_colors_allocated_max): New constant.
14287 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
14288 overflow.
3256efce 14289
726e0ab1
PE
14290 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
14291 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
14292 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
14293 Use ptrdiff_t, not int, to count maps.
14294 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
14295 calculations. Don't update size until allocation succeeds.
14296 Redo calculations to avoid overflow.
726e0ab1
PE
14297 * keyboard.h: Change prototypes to match the above.
14298
14299 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
14300 to count maps.
14301 (current_minor_maps): Check for size calculation overflow.
14302 * keymap.h: Change prototypes to match the above.
14303
14304 * lread.c (read1, init_obarray): Don't update size until alloc done.
14305
14306 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
14307 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
14308
726e0ab1
PE
14309 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
14310 Now ptrdiff_t, not int.
14311 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
14312 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
14313
14314 * process.c (Fnetwork_interface_list): Check for overflow
14315 in size calculation.
14316
14317 * region-cache.c (move_cache_gap): Check for size calculation overflow.
14318
14319 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
14320 overflow. Don't bother calling xmalloc when xrealloc will do.
14321
14322 * search.c (Freplace_match): Check for size calculation overflow.
14323 (Fset_match_data): Don't assume list lengths fit in 'int'.
14324
14325 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
14326 for command line length. Do not attempt to address one before the
14327 beginning of an array, as that's not portable.
14328
14329 * term.c (max_frame_lines): Remove; unused.
14330 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
14331 not int.
14332 (encode_terminal_code, calculate_costs): Check for size
14333 calculation overflow.
14334 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
14335 table lengths and related sizes. Don't update size until alloc
14336 done. Redo calculations to avoid overflow.
14337 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
14338
14339 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
14340 subtracting pointers.
14341 (gobble_line): Check for overflow more carefully. Don't update size
14342 until alloc done.
14343
14344 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
14345 Don't update size until alloc done.
14346 Redo size calculations to avoid overflow.
14347 Check for size calculation overflow.
0065d054 14348 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
14349
14350 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
14351 Use ptrdiff_t, not int, for sizes.
14352 (store_mode_line_noprop_char): Don't update size until alloc done.
14353
0065d054
PE
14354 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
14355 Use ptrdiff_t, not int, for sizes.
14356 (Finternal_make_lisp_face, cache_face):
14357 Check for size calculation overflow.
14358 (cache_face): Treat size calculation overflows as if they were
14359 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
14360
14361 * xfns.c (x_encode_text, x_set_name_internal)
14362 (Fx_change_window_property): Use ptrdiff_t, not int, to count
14363 sizes, since they can exceed INT_MAX in size. Check for size
14364 calculation overflow.
14365
0065d054
PE
14366 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
14367 (xg_select): Check for size calculation overflow.
726e0ab1
PE
14368 Don't update size until alloc done.
14369
0065d054 14370 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 14371 as sprintf is limited to int lengths.
1d526e2f 14372
252c5ee1
PE
14373 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
14374 (X_LONG_MIN): New macros.
864d7ce7
PE
14375 Use them to make the following changes clearer.
14376 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
14377 This change doesn't affect the value now, but it may help remind
14378 future maintainers not to raise the value too much later.
14379 (SELECTION_QUANTUM): Remove, replacing with ...
14380 (selection_quantum): ... new function, which avoids overflow.
14381 All uses changed.
14382 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
14383 assumption that selection length fits in 'int'.
14384 (x_reply_selection_request, x_handle_selection_request)
14385 (x_get_window_property, receive_incremental_selection)
14386 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
14387 (lisp_data_to_selection_data, clean_local_selection_data):
14388 Use ptrdiff_t, not int, to record length of selection.
14389 (x_reply_selection_request, x_get_window_property)
14390 (receive_incremental_selection, x_property_data_to_lisp):
14391 Redo calculations to avoid overflow.
14392 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 14393 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
14394 something.
14395 (x_get_window_property, receive_incremental_selection)
14396 (lisp_data_to_selection_data, x_property_data_to_lisp):
14397 Check for size-calculation overflow.
14398 (x_get_window_property, receive_incremental_selection)
14399 (lisp_data_to_selection_data, Fx_register_dnd_atom):
14400 Don't store size until memory allocation succeeds.
14401 (x_get_window_property): Plug memory leak on memory exhaustion.
14402 Don't double-block input; malloc is safe here. Don't assume 2**34
14403 - 4 fits in unsigned long. Add an xassert to check
14404 XGetWindowProperty overflow. Be more careful about overflow
14405 calculations, and distinguish size from memory overflow better.
14406 (receive_incremental_selection): When tracing, don't assume
14407 unsigned int is less than INT_MAX.
14408 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14409 harmful) conversions of unsigned short to int.
14410 (lisp_data_to_selection_data): Don't assume that integers
14411 in the range -65535 through -1 fit in an X unsigned short.
14412 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14413 result parameters unless successful. Rely on cons_to_unsigned
14414 to report problems with elements; the old code wasn't right anyway.
14415 (x_check_property_data): Check for int overflow; we cannot use
14416 a wider type due to X limits.
14417 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14418
726e0ab1 14419 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 14420
0065d054
PE
14421 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14422 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
14423 (x_color_cells): Don't store size until memory allocation succeeds.
14424 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 14425 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
14426 (x_term_init): Don't assume length fits in int (sprintf is limited
14427 to int size).
bc18e09d 14428
ebfa62c0
PE
14429 Use ptrdiff_t for composition IDs.
14430 * character.c (lisp_string_width):
14431 * composite.c (composition_table_size, n_compositions)
14432 (get_composition_id, composition_gstring_from_id):
14433 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14434 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14435 * window.c (Frecenter):
14436 Use ptrdiff_t, not int, for composition IDs.
14437 * composite.c (get_composition_id): Check for integer overflow.
14438 * composite.h: Adjust prototypes to match the above changes.
14439
d3411f89
PE
14440 Use ptrdiff_t for hash table indexes.
14441 * category.c (hash_get_category_set):
14442 * ccl.c (ccl_driver):
14443 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14444 * coding.c (coding_system_charset_list, detect_coding_system):
14445 * coding.h (struct coding_system.id):
14446 * composite.c (get_composition_id, gstring_lookup_cache):
14447 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14448 * image.c (xpm_get_color_table_h):
14449 * lisp.h (hash_lookup, hash_put):
14450 * minibuf.c (Ftest_completion):
14451 Use ptrdiff_t for hash table indexes, not int (which is too
14452 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14453 32-bit --with-wide-int hosts).
14454
e097a6fa
PE
14455 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14456 Add a FIXME comment about memory leaks.
14457 (syms_of_charset): Don't assume xmalloc returns.
14458
5637687f
PE
14459 Don't assume that stated character widths fit in int.
14460 * character.c (Fchar_width, c_string_width, lisp_string_width):
14461 * character.h (CHAR_WIDTH):
14462 * indent.c (MULTIBYTE_BYTES_WIDTH):
14463 Use sanitize_char_width to avoid undefined and/or bad behavior
14464 with outlandish widths.
a66cfb1c 14465 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
14466 now that we have two such functions. All uses changed.
14467 (sanitize_char_width): New inline function.
14468
a2271ba2
PE
14469 Don't assume that tab-width fits in int.
14470 * character.h (sanitize_width): New inline function.
14471 (SANE_TAB_WIDTH): New macro.
14472 (ASCII_CHAR_WIDTH): Use it.
14473 * indent.c (sane_tab_width): Remove. All uses replaced by
14474 SANE_TAB_WIDTH (current_buffer).
14475 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14476
18c52557
PE
14477 * fileio.c: Integer overflow issues with file modes.
14478 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14479
caeeedc1
PE
14480 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14481 Remove unreachable code.
14482 (read_hex, load_charset_map_from_file): Check for integer overflow.
14483
6df6ae42 14484 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
14485 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14486 (x_send_scroll_bar_event): Likewise. Check that the size does not
14487 exceed limits imposed by XClientMessageEvent, as well as the usual
14488 ptrdiff_t and size_t limits.
14489
b13995db
PE
14490 * keyboard.c: Overflow, signedness and related fixes.
14491 (make_lispy_movement): Use same integer type in forward decl
14492 that is used in the definition.
14493 (read_key_sequence, keyremap_step):
14494 Change bufsize argument back to int, undoing my 2011-03-30 change.
14495 We prefer signed types, and int is wide enough here.
14496 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14497 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14498 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14499 length, not size_t. Use ptrdiff_t for index, not int.
14500 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14501 possibility of integer overflow.
14502
13464394
PE
14503 Overflow, signedness and related fixes for images.
14504
14505 * dispextern.h (struct it.stack[0].u.image.image_id)
14506 (struct_it.image_id, struct image.id, struct image_cache.size)
14507 (struct image_cache.used, struct image_cache.ref_count):
14508 * gtkutil.c (update_frame_tool_bar):
14509 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14510 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14511 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14512 * nsmenu.m (update_frame_tool_bar):
14513 * xdisp.c (calc_pixel_width_or_height):
14514 * xfns.c (image_cache_refcount):
14515 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14516 on typical 64-bit hosts.
14517
14518 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14519 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14520 Omit unnecessary casts to int.
14521 (parse_image_spec): Check that integers fall into 'int' range
14522 when the callers expect that.
14523 (image_ascent): Redo ascent calculation to avoid int overflow.
14524 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14525 (lookup_image): Remove unnecessary tests.
14526 (xbm_image_p): Locals are now of int, not EMACS_INT,
14527 since parse_image_check makes sure they fit into int.
14528 (png_load, gif_load, svg_load_image):
14529 Prefer int to unsigned where either will do.
14530 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
14531 old tiff_error_handler and tiff_warning_handler.
14532 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
14533 stack buffer overflows. It uses only the features of vsnprintf
14534 that are common to both POSIX and native Microsoft.
14535 (tiff_error_handler, tiff_warning_handler): Use it.
14536 (tiff_load, gif_load, imagemagick_load_image):
14537 Don't assume :index value fits in 'int'.
14538 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14539 (imagemagick_load_image): Check that crop parameters fit into
14540 the integer types that MagickCropImage accepts. Don't assume
14541 Vimagemagick_render_type has a nonnegative value. Don't assume
14542 size_t fits in 'long'.
14543 (gs_load): Use printmax_t to print the widest integers possible.
14544 Check for integer overflow when computing image height and width.
14545
c11821d4
EZ
145462011-08-26 Eli Zaretskii <eliz@gnu.org>
14547
14548 * xdisp.c (redisplay_window): Don't force window start if point
14549 will be invisible in the resulting window. (Bug#9324)
14550
0c95fcf7
EZ
145512011-08-25 Eli Zaretskii <eliz@gnu.org>
14552
14553 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14554 the display spec is of the form `(space ...)'.
14555 (handle_display_spec): Return the value returned by
14556 handle_single_display_spec, not just 1 or zero.
14557 (handle_single_display_spec): If the display spec is of the form
14558 `(space ...)', and specifies display in the text area, return 2
14559 rather than 1.
fee65a97 14560 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
14561 accurately, and prefer exact match for point under bidi.
14562 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
14563
14564 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14565 into disp_prop; all users changed.
14566
14567 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14568 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14569 for the text covered by the display property.
14570
e4ed06f1
CY
145712011-08-25 Chong Yidong <cyd@stupidchicken.com>
14572
14573 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14574 Change return value to nil.
14575 (Frecord_buffer): Delete unused function.
14576
f67cdd7f
EZ
145772011-08-24 Eli Zaretskii <eliz@gnu.org>
14578
5980d4c6
EZ
14579 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14580 buffers, return left-to-right.
8610fe8b
EZ
14581 (set_cursor_from_row): Consider candidate row a win if its glyph
14582 represents a newline and point is on that newline. Fixes cursor
14583 positioning on the newline at EOL of R2L text within L2R
14584 paragraph, and vice versa.
14585 (try_cursor_movement): Check continued rows, in addition to
14586 continuation rows. Fixes unwarranted scroll when point enters a
14587 continued line of R2L text within an L2R paragraph, or vice versa.
14588 (cursor_row_p): Consider the case of point being equal to
14589 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14590 from the end of a short line to the beginning of a continued line
14591 of R2L text within L2R paragraph.
14592 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14593 composed characters.
5980d4c6 14594
f67cdd7f
EZ
14595 * bidi.c (bidi_check_type): Use xassert.
14596 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14597 members.
14598
bca633fb
EZ
145992011-08-23 Eli Zaretskii <eliz@gnu.org>
14600
14601 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14602 a character.
14603
4a5885a7
CY
146042011-08-23 Chong Yidong <cyd@stupidchicken.com>
14605
14606 * nsfont.m (ns_otf_to_script): Fix typo.
14607
0902a04e
KH
146082011-08-22 Kenichi Handa <handa@m17n.org>
14609
14610 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14611 extra slot even if the purpose is char-code-property-table.
14612
1a2e6670
EZ
146132011-08-23 Eli Zaretskii <eliz@gnu.org>
14614
8ddde651
EZ
14615 * xdisp.c (redisplay_window): When computing centering_position,
14616 account for the height of the header line. (Bug#8874)
14617
425cc014
EZ
14618 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14619 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14620 candidate is selected by the mouse, and that candidate has a
14621 composed character under the mouse.
14622
1a2e6670
EZ
14623 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14624 coordinates reported by pos-visible-in-window-p for a composed
14625 character in column zero.
14626
8b76d6f8
SM
146272011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14628
14629 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14630
dac347dd
EZ
146312011-08-22 Eli Zaretskii <eliz@gnu.org>
14632
14633 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14634 consider it a hit if to_charpos is anywhere in the range of the
14635 composed buffer positions.
14636
e013fb34
CY
146372011-08-22 Chong Yidong <cyd@stupidchicken.com>
14638
14639 * image.c (gif_load): Don't assume that each subimage has the same
14640 dimensions as the base image. Handle disposal method that is
14641 "undefined" by the gif spec (Bug#9335).
14642
bd1ba3e8
CY
146432011-08-20 Chong Yidong <cyd@stupidchicken.com>
14644
14645 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 14646 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 14647
54a1215b
EZ
146482011-08-19 Eli Zaretskii <eliz@gnu.org>
14649
823564e5
EZ
14650 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14651 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14652 from an Org mode buffer to a Speedbar frame.
14653
54a1215b
EZ
14654 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14655 a composition, take its buffer position from IT->cmp_it.charpos.
14656 Fixes cursor positioning at the beginning of a line that begins
14657 with a composed character.
14658
9778ebcc
EZ
146592011-08-18 Eli Zaretskii <eliz@gnu.org>
14660
0be6ee06
EZ
14661 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14662 character bidirectional type, use STRONG_L instead. Fixes crashes
14663 in a buffer produced by `describe-categories'.
14664
9778ebcc
EZ
14665 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14666 members before the level stack, so they would be saved and
14667 restored when copying iterator state. Fixes incorrect reordering
14668 around TABs covered by display properties.
14669
156bffbe
AS
146702011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14671
6b02f655 14672 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 14673
72ad093b
CY
146742011-08-17 Chong Yidong <cyd@stupidchicken.com>
14675
14676 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
14677 (internal_condition_case_2, internal_condition_case_n):
14678 Remove unnecessary aborts (Bug#9081).
72ad093b 14679
35774242
EZ
146802011-08-17 Eli Zaretskii <eliz@gnu.org>
14681
14682 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14683 has no `load' handler, try opening the file locally. (Bug#9311)
14684
db76dd85
KB
146852011-08-16 Ken Brown <kbrown@cornell.edu>
14686
14687 * gmalloc.c: Expand comment.
14688
b215eee5
EZ
146892011-08-16 Eli Zaretskii <eliz@gnu.org>
14690
14691 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14692 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14693
a4579d33
KB
146942011-08-16 Ken Brown <kbrown@cornell.edu>
14695
14696 Fix memory allocation problems in Cygwin build (Bug#9273).
14697
14698 * unexcw.c ( __malloc_initialized): Declare external variable.
14699 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14700
8b76d6f8
SM
14701 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14702 New variables.
a4579d33
KB
14703 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14704 dumped emacs.
14705 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14706 in the static heap.
14707 [CYGWIN] (special_realloc): New function.
14708 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14709 requests to realloc storage in the static heap.
14710
3ebec551
PE
147112011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14712
14713 * bidi.c (bidi_initialize): Remove unused local.
14714
9fd8be00
EZ
147152011-08-15 Eli Zaretskii <eliz@gnu.org>
14716
6b02f655
SM
14717 * bidimirror.h:
14718 * biditype.h: Remove file.
14719 * makefile.w32-in ($(BLD)/bidi.$(O)):
14720 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
14721
14722 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14723
14724 * chartab.c: Improve commentary for the uniprop_table API.
14725
32413314
EZ
14726 * bidi.c (bidi_paragraph_init): Support zero value of
14727 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
14728 (bidi_initialize): Use uniprop_table instead of including
14729 biditype.h and bidimirror.h.
32413314 14730
9fd8be00
EZ
14731 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14732 coordinates of the iterator when restoring from ppos_it.
14733 (Bug#9296)
14734
5cf2b69b
KH
147352011-08-14 Kenichi Handa <handa@m17n.org>
14736
14737 * process.c (create_process): Call setup_process_coding_systems
72ad093b 14738 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 14739
daf17d00
EZ
147402011-08-14 Eli Zaretskii <eliz@gnu.org>
14741
14742 * xdisp.c (move_it_in_display_line_to): Don't invoke
14743 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14744 ppos_it. Fixes vertical cursor motion when line beginning is
14745 covered by an image. (Bug#9296)
14746
08e3161a
JD
147472011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14748
14749 * nsterm.h (ns_run_ascript): Declare.
14750 (NSAPP_DATA2_RUNASSCRIPT): Define.
14751
14752 * nsfns.m (as_script, as_result, as_status): New static variables.
14753 (ns_run_ascript): New function.
5e617bc2 14754 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
14755 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14756 the event loop. Get status from as_status (Bug#7276).
14757
14758 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14759 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14760 the event loop (Bug#7276).
14761
a3720aa2
AS
147622011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14763
14764 * gnutls.c (QCgnutls_bootprop_priority)
14765 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14766 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14767 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14768 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14769 (QCgnutls_bootprop_verify_hostname_error)
14770 (QCgnutls_bootprop_callbacks_verify): Rename from
14771 Qgnutls_bootprop_..., all uses changed.
14772
14773 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14774 uses changed.
14775
0a0d27fb
PE
147762011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14777
19d5c50c
PE
14778 * xfaces.c (Qframe_set_background_mode): Now static.
14779 * dispextern.h (Qframe_set_background_mode): Remove decl.
14780
0a0d27fb
PE
14781 * process.c (Fnetwork_interface_info): Declare local only if needed.
14782
377538cb
JD
147832011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14784
14785 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14786 (Fnetwork_interface_list): Allocate in increments of bytes instead
14787 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14788 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14789 sockaddr.
14790 (struct ifflag_def): notrailers is smart on OSX.
14791 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14792 Get hardware address with getifaddrs if available.
14793
08fff70c
EZ
147942011-08-12 Eli Zaretskii <eliz@gnu.org>
14795
14796 * xdisp.c (iterate_out_of_display_property): xassert that
14797 IT->position is set to within IT->object's boundaries. Break from
14798 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
14799 when IT->position is set up wrongly due to some bug.
14800 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
14801 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14802 entry. Force push_it to save on the stack the current
14803 buffer/string position, to be restored by pop_it. Fix flags in
14804 the iterator structure wrt the object coming from a display
14805 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14806 properties. (Bug#9284)
14807
7be1c708 148082011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 14809
7be1c708
CY
14810 * fontset.c (fontset_get_font_group): Add proper type checks.
14811 (Bug#9172)
aac0c6e3 14812
7be1c708 148132011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 14814
7be1c708
CY
14815 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14816 and LC_VERSION_MIN_MACOSX.
14817 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14818 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 14819
97bb72a6
EZ
148202011-08-08 Eli Zaretskii <eliz@gnu.org>
14821
14822 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
14823 no-display-properties-and-no-overlays under bidi display.
14824 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 14825 properties and overlays.
97bb72a6 14826
d5617611
CY
148272011-08-08 Chong Yidong <cyd@stupidchicken.com>
14828
37e11a63
CY
14829 * editfns.c (Fset_time_zone_rule): Document relationship with the
14830 setenv function.
14831
d5617611
CY
14832 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14833 the font entity extracted from the cache (Bug#8109).
14834
58872834
CY
148352011-08-07 Chong Yidong <cyd@stupidchicken.com>
14836
14837 * composite.c (autocmp_chars): Don't reset point. That is done by
14838 restore_point_unwind (Bug#5984).
14839
75bfc667
JL
148402011-08-07 Juri Linkov <juri@jurta.org>
14841
14842 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14843 to show the arg `TIME' instead of `TIMEVAL'.
14844
d1410150
EZ
148452011-08-06 Eli Zaretskii <eliz@gnu.org>
14846
14847 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14848 display property strides EOL and includes a newline, as in
14849 longlines-mode. (Bug#9254)
75b771e4
EZ
14850 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14851 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
14852
14853 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14854 is non-zero, even if the data buffer is NULL. Fixes a crash in
14855 vertical-motion with longlines-mode. (Bug#9254)
14856
35928349
EZ
148572011-08-05 Eli Zaretskii <eliz@gnu.org>
14858
ec7cc85b
EZ
14859 * bidi.c <bidi_cache_total_alloc>: Now static.
14860 (bidi_initialize): Initialize bidi_cache_total_alloc.
14861
8b76d6f8 14862 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
14863 cache. (Bug#9221)
14864
14865 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14866 amount allocated this far in `bidi_cache_total_alloc'.
14867 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14868 non-zero, only free the data buffer without restoring the cache
14869 contents. All callers changed.
14870
14871 * dispextern.h (bidi_unshelve_cache): Update prototype.
14872
14873 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14874 (move_it_in_display_line, move_it_to)
14875 (move_it_vertically_backward, move_it_by_lines): Replace the call
14876 to xfree to an equivalent call to bidi_unshelve_cache.
14877 (move_it_in_display_line_to): Fix logic of returning
412b6358 14878 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 14879
e2e2423b
EZ
148802011-08-05 Eli Zaretskii <eliz@gnu.org>
14881
14882 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14883 came from a string character with a `cursor' property. (Bug#9229)
14884
ae9e757a
JD
148852011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14886
14887 * Makefile.in (LIB_PTHREAD): New variable.
14888 (LIBES): Add LIB_PTHREAD (Bug#9216).
14889
14890 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14891 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14892
213bd7f2
AS
148932011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14894
6b02f655 14895 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 14896
99aaf75f
JD
148972011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14898
14899 * xterm.c (x_find_topmost_parent): New function.
14900 (x_set_frame_alpha): Find topmost parent window with
14901 x_find_topmost_parent and set the property there also (bug#9181).
14902 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14903
c74e9d86
PE
149042011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14905
14906 * callproc.c (Fcall_process): Avoid vfork clobbering
14907 the local vars buffer, coding_systems, current_dir.
14908
640c8776
SM
149092011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14910
14911 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14912
f26d0e4c
PE
149132011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14914
8a10d76c
PE
14915 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14916 so that it is not optimized away.
14917
f26d0e4c
PE
14918 * xdisp.c (compute_display_string_pos): Remove unused local.
14919
55439c61
EZ
149202011-08-02 Eli Zaretskii <eliz@gnu.org>
14921
14922 Fix slow cursor motion and scrolling in large buffers with
14923 selective display, like Org Mode buffers. (Bug#9218)
14924
14925 * dispextern.h (struct bidi_it): New member disp_prop_p.
14926
14927 * xdisp.c: Remove one-slot cache of display string positions.
14928 (compute_display_string_pos): Accept an additional argument
5e617bc2 14929 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
14930 for a display string or property. If found, set DISP_PROP_P
14931 non-zero.
14932
14933 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
14934 DISP_PROP_P, and pass it to compute_display_string_pos.
14935 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
14936 non-zero. All callers of bidi_fetch_char changed.
14937
fb33fa43
SM
149382011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14939
14940 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14941
b099e063
DM
149422010-12-03 Don March <don@ohspite.net>
14943
14944 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14945 last character M-[char] is translated to ESC [char] (bug#7541).
14946
5cc7f7af
KH
149472011-08-02 Kenichi Handa <handa@m17n.org>
14948
d0fffa3f 14949 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
14950
14951 * chartab.c (uniprop_table): Make it non-static.
14952
525d5e6e
EZ
149532011-08-01 Eli Zaretskii <eliz@gnu.org>
14954
14955 * xdisp.c (forward_to_next_line_start): Accept additional argument
14956 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14957 on the newline.
14958 (reseat_at_next_visible_line_start): Use the bidi iterator state
14959 returned by forward_to_next_line_start to restore the state of
14960 it->bidi_it after backing up to previous newline. (Bug#9212)
14961
31011111
AS
149622011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14963
14964 * regex.c (re_comp): Protoize.
14965 (re_exec): Fix return type.
14966 (regexec): Fix type of `ret'. (Bug#9203)
14967
476371c4
PE
149682011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14969
e5d76069
PE
14970 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14971 This is needed if max-image-size is a floating-point number.
14972
9a79b20c
AS
149732011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14974
14975 * print.c (print_object): Print empty symbol as ##.
14976
14977 * lread.c (read1): Read ## as empty symbol.
14978
d8c2fa78
AA
149792011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14980
14981 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14982 setting frame foreground color (Bug#9175).
14983 (x_set_background_color): Likewise.
14984
ffe57a7a
AA
14985 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14986 contents (Bug#9176).
14987 (EmacsTooltip -init): Remove bezels and add shadows to
14988 tooltip windows.
14989
bf3492a5
AA
14990 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14991 or scroll bar (Bug#8470).
14992
d55e9c53
AA
14993 * nsfont.m (nsfont_open): Remove assignment to voffset and
14994 unnecessary vars hshink, expand, hd, full_height, min_height.
14995 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14996
14997 * nsterm.h (nsfont_info): Remove voffset field.
14998
d8c2fa78 149992011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
15000
15001 Implement strike-through and overline on NextStep (Bug#8863).
15002
15003 * nsfont.m (nsfont_open): Use underline position provided by font,
15004 instead of hard-coded value of 2.
15005 (nsfont_draw): Call ns_draw_text_decoration instead.
15006
15007 * nsterm.h: Add declaration for ns_draw_text_decoration.
15008
15009 * nsterm.m (ns_draw_text_decoration): New function for drawing
15010 underline, overline, and strike-through.
15011 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
15012 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 15013 accommodate underlining, etc.
4843aac3 15014
4cc60b9b
EZ
150152011-07-28 Eli Zaretskii <eliz@gnu.org>
15016
bc7ece87
EZ
15017 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
15018 default.
4cc60b9b 15019
476371c4
PE
150202011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15021
66606eea
PE
15022 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
15023 Without this fix, if a signal arrives just after memory fills up,
15024 'malloc' might be invoked reentrantly.
15025
476371c4
PE
15026 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
15027 In other words, assume that every image size is allowed, on non-X
15028 hosts. This assumption is probably wrong, but it lets Emacs compile.
15029
f3fcc40d
AS
150302011-07-28 Andreas Schwab <schwab@linux-m68k.org>
15031
15032 * regex.c (re_iswctype): Convert return values to boolean.
15033
350c992f
EZ
150342011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
15035
15036 * xdisp.c (compute_display_string_pos): Don't use cached display
15037 string position if the buffer had its restriction changed.
15038 (Bug#9184)
15039
5266b4bb
PE
150402011-07-28 Paul Eggert <eggert@cs.ucla.edu>
15041
15042 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
15043
2573a837 150442011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 15045
41f55ccd 15046 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 15047
39e378da
PE
15048 * bidi.c: Integer size and overflow fixes.
15049 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
15050 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
15051 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15052 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
15053 (bidi_find_other_level_edge):
15054 Use ptrdiff_t instead of EMACS_INT where either will do.
15055 This works better on 32-bit hosts configured --with-wide-int.
15056 (bidi_cache_ensure_space): Check for size-calculation overflow.
15057 Use % rather than repeated addition, for better worst-case speed.
15058 Don't set bidi_cache_size until after xrealloc returns, because it
15059 might not return.
15060 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
15061 (bidi_cache_ensure_space): Also check that the bidi cache size
15062 does not exceed that of the largest Lisp string or buffer. See Eli
15063 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 15064
5e927815
PE
15065 * alloc.c (__malloc_size_t): Remove.
15066 All uses replaced by size_t. See Andreas Schwab's note
15067 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
15068
ca4aa935
PE
15069 * image.c: Improve checking for integer overflow.
15070 (check_image_size): Assume that f is nonnull, since
15071 it is always nonnull in practice. This is one less thing to
15072 worry about when checking for integer overflow later.
15073 (x_check_image_size): New function, which checks for integer
15074 overflow issues inside X.
15075 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
15076 This removes the need for a memory_full check.
15077 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
15078 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
15079 (xbm_read_bitmap_data): Change locals back to 'int', since
15080 their values must fit in 'int'.
15081 (xpm_load_image, png_load, tiff_load):
15082 Invoke x_create_x_image_and_pixmap earlier,
15083 to avoid much needless work if the image is too large.
15084 (tiff_load): Treat overly large images as if
15085 x_create_x_image_and_pixmap failed, not as malloc failures.
15086 (gs_load): Use x_check_image_size.
15087
5f8f9cc2
PE
15088 * gtkutil.c: Omit integer casts.
15089 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
15090 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
15091
5adf60bc
PE
15092 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
15093
c8907a93
PE
15094 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
15095 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
15096 would wrongly return t on a 64-bit host.
15097
e3c25c68
PE
15098 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
15099 The plain *_OVERFLOW macros run afoul of GCC bug 49705
15100 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
15101 and therefore cause GCC to emit a bogus diagnostic in some cases.
15102
3f791afe
PE
15103 * image.c: Integer signedness and overflow and related fixes.
15104 This is not an exhaustive set of fixes, but it's time to
15105 record what I've got.
15106 (lookup_pixel_color, check_image_size): Remove redundant decls.
15107 (check_image_size): Don't assume that arbitrary EMACS_INT values
15108 fit in 'int', or that arbitrary 'double' values fit in 'int'.
15109 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
15110 (tiff_load, imagemagick_load_image):
15111 Check for overflow in size calculations.
15112 (x_create_x_image_and_pixmap): Remove unnecessary test for
15113 xmalloc returning NULL; that can't happen.
15114 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
15115 (xpm_color_bucket): Use better integer hashing function.
15116 (xpm_cache_color): Don't possibly over-allocate memory.
15117 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
15118 (gif_memory_source):
15119 Use ptrdiff_t, not int or size_t, to record sizes.
15120 (png_load): Don't assume values greater than 2**31 fit in 'int'.
15121 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
15122 either works, as we prefer signed integers.
15123 (tiff_read_from_memory, tiff_write_from_memory):
15124 Return tsize_t, not size_t, since that's what the TIFF API wants.
15125 (tiff_read_from_memory): Don't fail simply because the read would
15126 go past EOF; instead, return a short read.
15127 (tiff_load): Omit no-longer-needed casts.
15128 (Fimagemagick_types): Don't assume size fits into 'int'.
15129
3cc5a532
PE
15130 Improve hashing quality when configured --with-wide-int.
15131 * fns.c (hash_string): New function, taken from sxhash_string.
15132 Do not discard information about ASCII character case; this
15133 discarding is no longer needed.
15134 (sxhash-string): Use it. Change sig to match it. Caller changed.
15135 * lisp.h: Declare it.
15136 * lread.c (hash_string): Remove, since we now use fns.c's version.
15137 The fns.c version returns a wider integer if --with-wide-int is
15138 specified, so this should help the quality of the hashing a bit.
15139
b312a492
PE
15140 * emacs.c: Integer overflow minor fix.
15141 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
15142 Define only if GNU_LINUX.
15143 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
15144
dfd153ae
PE
15145 * dispnew.c: Integer signedness and overflow fixes.
15146 Remove unnecessary forward decls, that were a maintenance hassle.
15147 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
15148 All uses changed.
15149 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
15150 (scrolling_window): Use ptrdiff_t, not int, for byte count.
15151 (prepare_desired_row, line_draw_cost):
15152 Use int, not unsigned, where either works.
15153 (save_current_matrix, restore_current_matrix):
15154 Use ptrdiff_t, not size_t, where either works.
15155 (init_display): Check for overflow more accurately, and without
15156 relying on undefined behavior.
15157
a81d11a3
PE
15158 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
15159 Remove, replacing with the new symbols in lisp.h. All uses changed.
15160 * fileio.c (make_temp_name):
15161 * filelock.c (lock_file_1, lock_file):
15162 * xdisp.c (message_dolog):
15163 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
15164 Use pMd etc. instead.
15165 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
15166 replacing the pWIDE etc. symbols removed from editfns.c.
15167
3300e6fd
PE
15168 * keyboard.h (num_input_events): Now uintmax_t.
15169 This is (very slightly) less likely to mess up due to wraparound.
15170 All uses changed.
15171
fd05c7e9
PE
15172 * buffer.c: Integer signedness fixes.
15173 (alloc_buffer_text, enlarge_buffer_text):
15174 Use ptrdiff_t rather than size_t when either will do, as we prefer
15175 signed integers.
15176
903fe15d
PE
15177 * alloc.c: Integer signedness and overflow fixes.
15178 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
15179 (__malloc_size_t): Default to size_t, not to int.
15180 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
15181 (Fgarbage_collect, mark_object_loop_halt, mark_object):
15182 Prefer ptrdiff_t to size_t when either would do, as we prefer
15183 signed integers.
15184 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
15185 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
15186 Now const. Initialize with values that are in range even if char
15187 is signed.
15188 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
15189 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
15190 These functions do the right thing with sizes > 2**32.
15191 (check_depth): Now ptrdiff_t, not int.
15192 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
15193 Adjust to new way of storing sizes. Check for size overflow bugs
15194 in rest of code.
15195 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
15196 slightly wrong anyway, as it missed one instance of
15197 XMALLOC_OVERRUN_CHECK_OVERHEAD.
15198 (refill_memory_reserve): Omit needless cast to size_t.
15199 (mark_object_loop_halt): Mark as externally visible.
15200
ac82cc6a
PE
15201 * xselect.c: Integer signedness and overflow fixes.
15202 (Fx_register_dnd_atom, x_handle_dnd_message):
15203 Use ptrdiff_t, not size_t, since we prefer signed.
15204 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
15205 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
15206 x_dnd_atoms_size and x_dnd_atoms_length.
15207
c2d1e36d
PE
15208 * doprnt.c: Prefer signed to unsigned when either works.
15209 * eval.c (verror):
15210 * doprnt.c (doprnt):
15211 * lisp.h (doprnt):
15212 * xdisp.c (vmessage):
15213 Use ptrdiff_t, not size_t, when using or implementing doprnt,
15214 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
15215 prefer signed arithmetic to avoid comparison confusion.
15216 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
15217 but is a bit tricky.
15218
0e926e56
PE
15219 Assume freestanding C89 headers, string.h, stdlib.h.
15220 * data.c, doprnt.c, floatfns.c, print.c:
15221 Include float.h unconditionally.
15222 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
15223 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
15224 * regex.c: Likewise for stddef.h, string.h.
15225 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
15226 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
15227 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
15228 (STDC_HEADERS): Remove obsolete defines.
15229 * sysdep.c: Include limits.h unconditionally.
15230
9cfdb3ec
PE
15231 Assume support for memcmp, memcpy, memmove, memset.
15232 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
15233 * regex.c (memcmp, memcpy):
15234 Remove; we assume C89 now.
15235
15236 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
15237 (__malloc_safe_bcopy): Remove; no longer needed.
15238
cf950e6b 15239 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
15240 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
15241 well either way, and we prefer signed to unsigned.
15242
dbf38e02
LMI
152432011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
15244
15245 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
15246 closes the connection while we're reading (bug#9182).
15247
d6f0886c 152482011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 15249
d6f0886c
JD
15250 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
15251 are specified (Bug#9168).
24e0f6b1 15252
2eb1f9e6
PE
152532011-07-25 Paul Eggert <eggert@cs.ucla.edu>
15254
15255 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
15256 Found by GCC static checking and --with-wide-int on a 32-bit host.
15257
22381272 152582011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
15259
15260 * xdisp.c (compute_display_string_pos): Fix logic of caching
15261 previous display string position. Initialize cached_prev_pos to
15262 -1. Fixes slow-down at the beginning of a buffer.
15263
f25e39b4
EZ
152642011-07-24 Eli Zaretskii <eliz@gnu.org>
15265
15266 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
15267 for attrs[LFACE_FONTSET_INDEX].
15268
04c4b52e
PE
152692011-07-23 Paul Eggert <eggert@cs.ucla.edu>
15270
15271 * xml.c (parse_region): Remove unused local
15272 that was recently introduced.
15273
c1734fbd
EZ
152742011-07-23 Eli Zaretskii <eliz@gnu.org>
15275
be18c5a5
EZ
15276 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
15277 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
15278
c1734fbd
EZ
15279 * xdisp.c (move_it_in_display_line_to): Record the best matching
15280 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
15281 exit if none of the characters scanned was an exact match.
15282 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
15283 when exact match is impossible due to invisible text, and the
15284 lines are truncated.
15285
a258d627
JD
152862011-07-23 Jan Djärv <jan.h.d@swipnet.se>
15287
15288 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
15289 for OSX >= 10.7.
15290
b6d5a689
EZ
152912011-07-22 Eli Zaretskii <eliz@gnu.org>
15292
0f74f785
EZ
15293 Fix a significant slow-down of cursor motion with C-n, C-p,
15294 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
15295 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 15296 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
15297 (next_element_from_buffer): Call compute_stop_pos_backwards to
15298 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
15299 base_level_stop.
15300 (reseat): Don't look for prev_stop, as that could mean a very long
15301 run.
15302 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
15303 <cached_disp_overlay_modiff>: Cache for last found display string
15304 position.
551918c1 15305 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
15306 about the same buffer in the same area of character positions, and
15307 the buffer wasn't changed since the time the display string
15308 position was cached.
551918c1 15309
b2d0c91a
EZ
153102011-07-22 Eli Zaretskii <eliz@gnu.org>
15311
15312 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
15313 is an integer, which is important for empty lines. (Bug#9149)
15314
043604ee
CY
153152011-07-22 Chong Yidong <cyd@stupidchicken.com>
15316
15317 * frame.c (Fmodify_frame_parameters): In tty case, update the
15318 default face if necessary (Bug#4238).
15319
da4adb04
CY
153202011-07-21 Chong Yidong <cyd@stupidchicken.com>
15321
15322 * editfns.c (Fstring_to_char): No need to explain what a character
15323 is in the docstring (Bug#6576).
15324
9abd0532
LMI
153252011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15326
15327 * xml.c (parse_region): Make sure we always return a tree.
15328
36881d16
HK
153292011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
15330
15331 * xml.c (parse_region): If a document contains only comments,
15332 return that, too.
15333
1e98674d
LMI
153342011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15335
15336 * xml.c (make_dom): Return comments, too.
15337
590bd467
PE
153382011-07-19 Paul Eggert <eggert@cs.ucla.edu>
15339
15340 Port to OpenBSD.
15341 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
15342 and the surrounding thread.
15343 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
15344 rather than fgets, and retry after EINTR. Otherwise, 'emacs
15345 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
15346 timer goes off.
15347 * s/openbsd.h (BROKEN_SIGIO): Define.
15348 * unexelf.c (unexec) [__OpenBSD__]:
15349 Don't update the .mdebug section of the Alpha COFF symbol table.
15350
f41628b2
LMI
153512011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15352
15353 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
15354 (bug#8460).
15355
b59b67c5
PE
153562011-07-18 Paul Eggert <eggert@cs.ucla.edu>
15357
15e3a074
PE
15358 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
15359 This fixes some race conditions on the permissions of any newly
15360 created file.
15361
41bed37d
PE
15362 * alloc.c (valid_pointer_p): Use pipe, not open.
15363 This fixes some permissions issues when debugging.
15364
b59b67c5
PE
15365 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
15366 If fchown fails to set both uid and gid, try to set just gid,
15367 as that is sometimes allowed. Adjust the file's mode to eliminate
15368 setuid or setgid bits that are inappropriate if fchown fails.
15369
925a6be7
SM
153702011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
15371
15372 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
15373 to compare Lisp_Objects.
15374 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
15375 global_gnutls_log_level, don't mistake it for a Lisp_Object.
15376 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
15377
52968808
AS
153782011-07-17 Andreas Schwab <schwab@linux-m68k.org>
15379
0a6a104b
AS
15380 * lread.c (read_integer): Unread even EOF character.
15381 (read1): Likewise. Properly record start position of symbol.
15382
52968808
AS
15383 * lread.c (read1): Read `#:' as empty uninterned symbol if no
15384 symbol character follows.
15385
9e381cdd
PE
153862011-07-17 Paul Eggert <eggert@cs.ucla.edu>
15387
15388 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
15389 This works around a problem with the previous change to Fcopy_file.
15390 Recent glibc declares fchown with __attribute__((warn_unused_result)),
15391 and without this change, GCC might complain about discarding
15392 fchown's return value.
15393
b5641435
JB
153942011-07-16 Juanma Barranquero <lekktu@gmail.com>
15395
15396 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
15397
a8031457
PE
153982011-07-16 Paul Eggert <eggert@cs.ucla.edu>
15399
15400 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
15401
dd889327
LMI
154022011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
15403
750c33f7
LMI
15404 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15405 it's used from the C level.
15406
dd889327
LMI
15407 * process.c: Use the same condition for POLL_FOR_INPUT in both
15408 keyboard.c and process.c (bug#1858).
15409
87e86684
LM
154102011-07-09 Lawrence Mitchell <wence@gmx.li>
15411
15412 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15413 (Fgnutls_boot): Use it.
15414
64348f40
AS
154152011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15416
15417 * doc.c (Fsubstitute_command_keys): Revert last change.
15418
1d698799
LMI
154192011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15420
f863868c
LMI
15421 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15422 quotes the next character, and doesn't affect other longer
15423 sequences (bug#8935).
15424
1d698799
LMI
15425 * lread.c (syms_of_lread): Clarify that is isn't only
15426 `eval-buffer' and `eval-defun' that's affected by
15427 `lexical-binding' (bug#8460).
15428
aa4b6df6
EZ
154292011-07-15 Eli Zaretskii <eliz@gnu.org>
15430
15431 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 15432 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 15433
5d856da6
PE
154342011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15435
ad6042bb
PE
15436 Fix minor problems found by static checking.
15437 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15438 (elsz): Now a signed constant, not a size_t var. We prefer signed
15439 types to unsigned, to avoid integer comparison confusion. Without
15440 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15441 "cannot optimize loop, the loop counter may overflow", a symptom
15442 of the confusion.
f00bbb22 15443 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
15444 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15445
6468f31c
LMI
154462011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15447
49080b10
LMI
15448 * search.c (Fre_search_backward): Mention `case-fold-search' in
15449 all the re_search_* functions (bug#8138).
15450
6468f31c
LMI
15451 * keyboard.c (Fopen_dribble_file): Document when the file is
15452 closed (bug#8056).
15453
c965adc5
EZ
154542011-07-14 Eli Zaretskii <eliz@gnu.org>
15455
df9733bf
EZ
15456 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15457 bidi_cache_idx.
15458
0bb23927
EZ
15459 Support bidi reordering of display and overlay strings.
15460 * xdisp.c (compute_display_string_pos)
15461 (compute_display_string_end): Accept additional argument STRING.
15462 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15463 (reseat_to_string): Initialize bidi_it->string.s and
15464 bidi_it->string.schars.
15465 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
15466 NULL (avoids a crash in bidi_paragraph_init).
15467 Initialize itb.string.lstring.
0bb23927
EZ
15468 (init_iterator): Call bidi_init_it only of a valid
15469 buffer position was specified. Initialize paragraph_embedding to
15470 L2R.
15471 (reseat_to_string): Initialize the bidi iterator.
15472 (display_string): If we need to ignore text properties of
15473 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15474 original value of -1 will not work with bidi.)
15475 (compute_display_string_pos): First arg is now struct
15476 `text_pos *'; all callers changed. Support display properties on
15477 Lisp strings.
15478 (compute_display_string_end): Support display properties on Lisp
15479 strings.
15480 (init_iterator, reseat_1, reseat_to_string): Initialize the
15481 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15482 when iterating on a string not from display properties).
640c8776
SM
15483 (compute_display_string_pos, compute_display_string_end):
15484 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
15485 arrow keys.
15486 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
15487 base_level_stop; instead, set base_level_stop to BEGV.
15488 Fixes crashes in vertical-motion.
0bb23927
EZ
15489 (next_element_from_buffer): Improve commentary for when
15490 the iterator is before prev_stop.
15491 (init_iterator): Initialize bidi_p from the default value of
15492 bidi-display-reordering, not from buffer-local value. Use the
15493 buffer-local value only if initializing for buffer iteration.
15494 (handle_invisible_prop): Support invisible properties on strings
15495 that are being bidi-reordered.
15496 (set_iterator_to_next): Support bidi reordering of C strings and
15497 Lisp strings.
15498 (next_element_from_string): Support bidi reordering of Lisp
15499 strings.
15500 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
15501 (display_string): Support display of R2L glyph rows.
15502 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
15503 (init_iterator): Don't initialize it->bidi_p for strings
15504 here.
15505 (reseat_to_string): Initialize it->bidi_p for strings here.
15506 (next_element_from_string, next_element_from_c_string)
15507 (next_element_from_buffer): Add xassert's for correspondence
15508 between IT's object being iterated and it->bidi_it.string
15509 structure.
15510 (face_before_or_after_it_pos): Support bidi iteration.
15511 (next_element_from_c_string): Handle the case of the first string
15512 character that is not the first one in the visual order.
15513 (get_visually_first_element): New function, refactored from common
15514 parts of next_element_from_buffer, next_element_from_string, and
15515 next_element_from_c_string.
15516 (tool_bar_lines_needed, redisplay_tool_bar)
15517 (display_menu_bar): Force left-to-right direction. Add a FIXME
15518 comment for making that be controlled by a user option.
15519 (push_it, pop_it): Save and restore the state of the
15520 bidi iterator. Save and restore the bidi_p flag.
15521 (pop_it): Iterate out of display property for string iteration as
15522 well.
15523 (iterate_out_of_display_property): Support iteration over strings.
15524 (handle_single_display_spec): Set up it->bidi_it for iteration
15525 over a display string, and call bidi_init_it.
15526 (handle_single_display_spec, next_overlay_string)
15527 (get_overlay_strings_1, push_display_prop): Set up the bidi
15528 iterator for displaying display or overlay strings.
15529 (forward_to_next_line_start): Don't use the shortcut if
15530 bidi-iterating.
15531 (back_to_previous_visible_line_start): If handle_display_prop
15532 pushed the iterator stack, restore the internal state of the bidi
15533 iterator by calling bidi_pop_it same number of times.
15534 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15535 and we are bidi-iterating, don't decrement the iterator position;
15536 instead, set the first_elt flag in the bidi iterator, to produce
15537 the same effect.
15538 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15539 (push_display_prop): xassert that we are iterating a buffer.
15540 (push_it, pop_it): Save and restore paragraph_embedding member.
15541 (handle_single_display_spec, next_overlay_string)
15542 (get_overlay_strings_1, reseat_1, reseat_to_string)
15543 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15544 correctly. Don't assume unibyte strings are not bidi-reordered.
15545 (compute_display_string_pos)
15546 (compute_display_string_end): Fix handling the case of C string.
15547 (push_it, pop_it): Save and restore from_disp_prop_p.
15548 (handle_single_display_spec, push_display_prop): Set the
15549 from_disp_prop_p flag.
15550 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15551 (pop_it): Call iterate_out_of_display_property only if we are
15552 popping after iteration over a string that came from a display
15553 property. Fix a typo in popping stretch info. Add an assertion
15554 for verifying that the iterator position is in sync with the bidi
15555 iterator.
15556 (handle_single_display_spec, get_overlay_strings_1)
15557 (push_display_prop): Fix initialization of paragraph direction for
15558 string when that of the parent object is not yet determined.
15559 (reseat_1): Call bidi_init_it to resync the bidi
15560 iterator with IT's position. (Bug#7616)
15561 (find_row_edges): If ROW->start.pos gives position
15562 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15563 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15564 Reset the from_disp_prop_p flag.
15565 (SAVE_IT, RESTORE_IT): New macros.
15566 (pos_visible_p, face_before_or_after_it_pos)
15567 (back_to_previous_visible_line_start)
15568 (move_it_in_display_line_to, move_it_in_display_line)
15569 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15570 (try_scrolling, redisplay_window, display_line): Use them when
15571 saving a temporary copy of the iterator and restoring it back.
15572 (back_to_previous_visible_line_start, reseat_1)
15573 (init_iterator): Empty the bidi cache "stack".
15574 (move_it_in_display_line_to): If iterator ended up at
15575 EOL, but we never saw any buffer positions smaller than
15576 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15577 motion in bidi-reordered lines.
15578 (move_it_in_display_line_to): Record prev_method and prev_pos
15579 immediately before the call to set_iterator_to_next. Fixes cursor
15580 motion in bidi-reordered lines with stretch glyphs and strings
15581 displayed in margins. (Bug#8133) (Bug#8867)
15582 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15583 TO_CHARPOS.
640c8776
SM
15584 (pos_visible_p): Support positions in bidi-reordered lines.
15585 Save and restore bidi cache.
0bb23927
EZ
15586
15587 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15588 (bidi_paragraph_info): Delete unused struct.
15589 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15590 (bidi_cache_start): New variable.
15591 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15592 to zero.
15593 (bidi_cache_fetch_state, bidi_cache_search)
15594 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15595 (bidi_cache_find, bidi_peek_at_next_level)
15596 (bidi_level_of_next_char, bidi_find_other_level_edge)
15597 (bidi_move_to_visually_next): Compare cache index with
15598 bidi_cache_start rather than with zero.
15599 (bidi_fetch_char): Accept new argument STRING; all callers
15600 changed. Support iteration over a string. Support strings with
15601 display properties. Support unibyte strings. Fix the type of
15602 `len' according to what STRING_CHAR_AND_LENGTH expects.
15603 (bidi_paragraph_init, bidi_resolve_explicit_1)
15604 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
15605 (bidi_level_of_next_char, bidi_move_to_visually_next):
15606 Support iteration over a string.
0bb23927
EZ
15607 (bidi_set_sor_type, bidi_resolve_explicit_1)
15608 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15609 can now be zero (for strings); special values 0 and -1 were
15610 changed to -1 and -2, respectively.
15611 (bidi_char_at_pos): New function.
15612 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15613 Call it instead of FETCH_MULTIBYTE_CHAR.
15614 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15615 initialized to valid values.
15616 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15617 values.
15618 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15619 the test for valid cached positions. Fix the logic for looking up
15620 the sentinel state in the cache. GCPRO the Lisp string we are
15621 iterating.
15622 (bidi_push_it, bidi_pop_it): New functions.
15623 (bidi_initialize): Initialize the bidi cache start stack pointer.
15624 (bidi_cache_ensure_space): New function, refactored from part of
15625 bidi_cache_iterator_state. Don't assume the required size is just
15626 one BIDI_CACHE_CHUNK away.
15627 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15628 (bidi_count_bytes, bidi_char_at_pos): New functions.
15629 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15630 always valid if bidi_cache_idx is valid.
15631 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15632 is valid if it's going to be used.
15633 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15634 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
15635 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15636 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
15637 (bidi_find_other_level_edge, bidi_cache_start_stack):
15638 All variables related to cache indices are now EMACS_INT.
c965adc5 15639
0bb23927
EZ
15640 * dispextern.h (struct bidi_string_data): New structure.
15641 (struct bidi_it): New member `string'. Make flag members be 1-bit
15642 fields, and put them last in the struct.
640c8776
SM
15643 (compute_display_string_pos, compute_display_string_end):
15644 Update prototypes.
0bb23927
EZ
15645 (bidi_push_it, bidi_pop_it): Add prototypes.
15646 (struct iterator_stack_entry): New members bidi_p,
15647 paragraph_embedding, and from_disp_prop_p.
15648 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
15649 (bidi_shelve_cache, bidi_unshelve_cache):
15650 Declare prototypes.
0bb23927
EZ
15651
15652 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15653 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15654 and vector-like objects.
15655
15656 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15657 cache around display iteration.
15658
15659 * window.c (Fwindow_end, window_scroll_pixel_based)
15660 (displayed_window_lines, Frecenter): Save and restore the bidi
15661 cache around display iteration.
15662
3bbd2265
LMI
156632011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15664
15665 * editfns.c (Fdelete_region): Clarify the use of the named
15666 parameters (bug#6788).
15667
adc47434
MR
156682011-07-14 Martin Rudalics <rudalics@gmx.at>
15669
15670 * indent.c (Fvertical_motion): Set and restore w->pointm when
15671 saving and restoring the window's buffer (Bug#9006).
15672
837c31f8
LMI
156732011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15674
15675 * editfns.c (Fstring_to_char): Clarify just what is returned
15676 (bug#6576). Text by Eli Zaretskii.
15677
ac389d0c
JB
156782011-07-13 Juanma Barranquero <lekktu@gmail.com>
15679
15680 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15681
0be0ce47
EZ
156822011-07-13 Eli Zaretskii <eliz@gnu.org>
15683
15684 * buffer.c (mmap_find): Fix a typo.
15685
cd18e7e3
JB
156862011-07-13 Johan Bockgård <bojohan@gnu.org>
15687
15688 Fix execution of x selection hooks.
15689 * xselect.c (Qx_lost_selection_functions)
15690 (Qx_sent_selection_functions): New vars.
15691 (syms_of_xselect): DEFSYM them.
15692 (x_handle_selection_request): Pass Qx_sent_selection_functions
15693 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15694 (x_handle_selection_clear,x_clear_frame_selections):
15695 Pass Qx_lost_selection_functions rather than
15696 Vx_lost_selection_functions to Frun_hook_with_args.
15697
47ea7f44
PE
156982011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15699
ac389d0c 15700 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
15701 The old code sometimes used this field without initializing it.
15702
47ea7f44
PE
15703 * alloc.c (gc_sweep): Don't read past end of array.
15704 In theory, the old code could also have corrupted Emacs internals,
15705 though it'd be very unlikely.
15706
bc985c87
AS
157072011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15708
15709 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 15710 argument. (Bug#4026)
bc985c87 15711
0cf34688
LMI
157122011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15713
b3dadd76
LMI
15714 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15715 key" (bug#4257).
15716
0cf34688
LMI
15717 * window.c (Fset_window_start): Doc fix (bug#4199).
15718 (Fset_window_hscroll): Ditto.
15719
270768cd
PE
157202011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15721
077e3dda 15722 Fix minor new problems caught by GCC 4.6.1.
270768cd 15723 * term.c (init_tty): Remove unused local.
490011a6 15724 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 15725 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 15726 not used otherwise.
270768cd 15727
b1f58454
CY
157282011-07-12 Chong Yidong <cyd@stupidchicken.com>
15729
15730 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15731
22b9578d
LMI
157322011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15733
6e70ab07
LMI
15734 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15735 are the mini-buffer and the echo area (bug#3320).
15736
22b9578d
LMI
15737 * term.c (init_tty): Remove support for supdup, c10 and perq
15738 terminals, which are no longer supported (bug#1482).
15739
8974cc9f
JB
157402011-07-10 Johan Bockgård <bojohan@gnu.org>
15741
15742 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15743
a560d974
JD
157442011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15745
15746 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15747 for non-popups (Bug#3642).
15748
1dae0f0a
AS
157492011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15750
268c2c36 15751 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 15752 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
15753 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15754 * cm.c (losecursor): Likewise.
1dae0f0a
AS
15755 * data.c (fmod): Likewise.
15756 * dispnew.c (swap_glyphs_in_rows): Likewise.
15757 * emacs.c (memory_warning_signal): Likewise.
15758 * floatfns.c (float_error): Likewise.
15759 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15760 (otf_open, font_otf_capability, generate_otf_features)
15761 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15762 Likewise.
15763 * image.c (pbm_read_file): Likewise.
15764 * indent.c (string_display_width): Likewise.
15765 * intervals.c (check_for_interval, search_for_interval)
15766 (inc_interval_count, count_intervals, root_interval)
15767 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15768 * lread.c (defalias): Likewise.
268c2c36 15769 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
15770 * regex.c (set_image_of_range_1, set_image_of_range)
15771 (regex_grow_registers): Likewise.
15772 * sysdep.c (strerror): Likewise.
15773 * termcap.c (valid_filename_p, tprint, main): Likewise.
15774 * tparam.c (main): Likewise.
15775 * unexhp9k800.c (run_time_remap, save_data_space)
15776 (update_file_ptrs, read_header, write_header, calculate_checksum)
15777 (copy_file, copy_rest, display_header): Likewise.
15778 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15779 Likewise.
15780 * xdisp.c (check_it): Likewise.
15781 * xfaces.c (register_color, unregister_color, unregister_colors):
15782 Likewise.
15783 * xfns.c (print_fontset_result): Likewise.
15784 * xrdb.c (member, fatal, main): Likewise.
15785
99033785
PE
157862011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15787
15788 Fix minor problems found by static checking (Bug#9031).
15789 * chartab.c (char_table_set_range, map_sub_char_table):
15790 Remove unused locals.
15791 (uniprop_table): Now static.
15792 * composite.c (_work_char): Remove unused static var.
15793
9cb2ac56
JB
157942011-07-09 Juanma Barranquero <lekktu@gmail.com>
15795
15796 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15797
f25661f0
JD
157982011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15799
15800 * gtkutil.c (qttip_cb): Remove code without function.
15801
8278c4fe
EZ
158022011-07-09 Eli Zaretskii <eliz@gnu.org>
15803
15804 * w32.c (pthread_sigmask): New stub.
15805
1692ae2d 158062011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 15807
8a6ebd58 15808 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
15809 sigprocmask is portable only for single-threaded applications, and
15810 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
15811 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15812 (LIBES): Use it.
15813 * callproc.c (Fcall_process):
15814 * process.c (create_process):
15815 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15816 Use pthread_sigmask, not sigprocmask.
123403e4 15817
1b854618
JD
158182011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15819
15820 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15821 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15822 wrong (Bug#8591).
15823
3fe4b549
JD
158242011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15825
0ce7e563
JD
15826 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15827 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15828 (xg_hide_tooltip): Fix comment.
15829
3fe4b549
JD
15830 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15831 in registerServicesMenuSendTypes.
15832 (validRequestorForSendType): Don't check ns_return_types.
15833
15834 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15835 ns_return_type.
15836
5df75e47
JR
158372011-07-08 Jason Rumney <jasonr@gnu.org>
15838
22610910
JR
15839 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15840 SH_SHOW for hidden windows (Bug#5482).
15841
5df75e47
JR
15842 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15843 frame struct members of non-existent frames (Bug#6284).
15844
699c10bd
JD
158452011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15846
4393663b
JD
15847 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15848 variable firstTime not needed on OSX >= 10.6.
15849 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15850 >= 10.5. Use setKnobProportion, setDoubleValue.
15851
15852 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15853 (MAC_OS_X_VERSION_10_5): Define if not defined.
15854 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15855 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15856 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15857
15858 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 15859 cString and lossyCString on OSX >= 10.4.
4393663b 15860
58179cce 15861 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
15862 sizeToFit on OSX >= 10.2.
15863
15864 * nsimage.m (allocInitFromFile): Don't use deprecated method
15865 bestRepresentationForDevice on OSX >= 10.6.
15866
15867 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15868 to avoid warning.
15869
15870 * emacs.c: Declare unexec_init_emacs_zone.
15871
a63e0781
JD
15872 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15873
699c10bd
JD
15874 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15875
15876 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15877 on svcsMenu (Bug#8842).
15878
15879 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15880 ns_return_types.
15881 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15882
15883 * nsterm.m (QUTF8_STRING): Declare.
15884 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15885 (validRequestorForSendType): Return type is (id).
15886 Change indexOfObjectIdenticalTo to indexOfObject.
15887 Check if we have local selection before returning self (Bug#8842).
15888 (writeSelectionToPasteboard): Put local selection into paste board
15889 if we have a local selection (Bug#8842).
15890 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15891
15892 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15893 (ns_get_local_selection): Declare.
15894
54e10184
LMI
158952011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15896
9888ff71
LMI
15897 * keymap.c (describe_map_tree): Don't insert a double newline at
15898 the end of the buffer (bug#1169) and return whether we inserted
15899 something.
15900
54e10184
LMI
15901 * callint.c (Fcall_interactively): Change "reading args" to
15902 "providing args" to try to clarify what it does (bug#1010).
15903
15fa4783
KH
159042011-07-07 Kenichi Handa <handa@m17n.org>
15905
15906 * composite.c (composition_compute_stop_pos): Ignore a static
15907 composition starting before CHARPOS (Bug#8915).
15908
15909 * xdisp.c (handle_composition_prop): Likewise.
15910
a8815b00
EZ
159112011-07-07 Eli Zaretskii <eliz@gnu.org>
15912
15913 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15914 (Bug#9015)
15915
ef7b981d 159162011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
15917
15918 * character.h (unicode_category_t): New enum type.
15919
15920 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15921 (Qchar_code_property_table): New variable.
15922 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15923 (UNIPROP_COMPRESSED_FORM_P): New macros.
15924 (char_table_ascii): Uncompress the compressed values.
15925 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15926 Uncompress the compressed values.
ac389d0c 15927 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
15928 (char_table_ref_and_range): Uncompress the compressed values.
15929 (sub_char_table_set): New arg is_uniprop. Callers changed.
15930 Uncompress the compressed values.
15931 (sub_char_table_set_range): Args changed. Callers changed.
15932 (char_table_set_range): Adjuted for the above change.
15933 (map_sub_char_table): Delete args default_val and parent. Add arg
15934 top. Give decoded values to a Lisp function.
640c8776 15935 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
15936 values to a Lisp function. Gcpro more variables.
15937 (uniprop_table_uncompress)
15938 (uniprop_decode_value_run_length): New functions.
15939 (uniprop_decoder, uniprop_decoder_count): New variables.
15940 (uniprop_get_decoder, uniprop_encode_value_character)
15941 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15942 New functions.
15943 (uniprop_encoder, uniprop_encoder_count): New variables.
15944 (uniprop_get_encoder, uniprop_table)
15945 (Funicode_property_table_internal, Fget_unicode_property_internal)
15946 (Fput_unicode_property_internal): New functions.
15947 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15948 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 15949 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
15950 char-code-property-alist.
15951
640c8776 15952 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
15953 Vunicode_category_table.
15954
640c8776 15955 * font.c (font_range): Adjust for the change of
c805dec0
KH
15956 Vunicode_category_table.
15957
76b397fb
DN
159582011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15959
15960 * m/iris4d.h: Remove file, move contents ...
15961 * s/irix6-5.h: ... here.
15962
22b4128e
PE
159632011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15964
15965 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
15966 * alloc.c (mark_buffer):
15967 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15968 (clone_per_buffer_values): Don't assume that
22b4128e
PE
15969 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15970 This isn't true in general, and it's particularly not true
15971 if Emacs is configured with --with-wide-int.
15972 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15973 New macros, used in the buffer.c change.
15974
869795d6
JD
159752011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15976
15977 * xsettings.c: Use both GConf and GSettings if both are available.
15978 (store_config_changed_event): Add comment.
15979 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15980 (store_tool_bar_style_changed): New functions.
5e617bc2 15981 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
15982 (struct xsettings): Move font inside HAVE_XFT.
15983 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 15984 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 15985 Move inside HAVE_XFT.
640c8776 15986 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
15987 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15988 also.
15989 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 15990 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 15991 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
15992 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15993 (parse_settings): Move check for font inside HAVE_XFT.
15994 (read_settings, apply_xft_settings): Add comment.
15995 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15996 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15997 call store_font_name_changed.
15998 (xft_settings_event): Add comment.
15999 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
16000 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
16001 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
16002 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
16003 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
16004 (xsettings_get_system_font, xsettings_get_system_normal_font):
16005 Add comment.
869795d6 16006
d8ed26bd
PE
160072011-07-05 Paul Eggert <eggert@cs.ucla.edu>
16008
16009 Random fixes. E.g., (random) never returned negative values.
16010 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
16011 subseconds part to the entropy, as that's a bit more random.
16012 Prefer signed to unsigned, since the signedness doesn't matter and
16013 in general we prefer signed. When given a limit, use a
16014 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
16015 latter isn't right if USE_2_TAGS_FOR_INTS.
16016 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
16017 not 0..VALMASK. Don't discard "excess" bits that random () returns.
16018
cabf1cac
SM
160192011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
16020
16021 * textprop.c (text_property_stickiness):
16022 Obey Vtext_property_default_nonsticky.
16023 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
16024 * w32fns.c (syms_of_w32fns):
16025 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
16026
6e9b2be9
PE
160272011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16028
16029 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
16030 This is more efficient than Ffile_directory_p and avoids a minor race.
16031
90186c68
LMI
160322011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
16033
7c301272
LMI
16034 * buffer.c (Foverlay_put): Say what the return value is
16035 (bug#7835).
16036
c4f2d8d4
LMI
16037 * fileio.c (barf_or_query_if_file_exists): Check first if the file
16038 is a directory before asking whether to use the file name
16039 (bug#7564).
ad637907
LMI
16040 (barf_or_query_if_file_exists): Make the "File is a directory"
16041 error be more correct.
c4f2d8d4 16042
90186c68
LMI
16043 * fns.c (Frequire): Remove the mention of the .gz files, since
16044 that's installation-specific, but keep the mention of
16045 `get-load-suffixes'.
16046
da64016e
PE
160472011-07-04 Paul Eggert <eggert@cs.ucla.edu>
16048
16049 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
16050 Report string overflow if the output is too long.
16051
7d47b580
JB
160522011-07-04 Juanma Barranquero <lekktu@gmail.com>
16053
a555cb87
JB
16054 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
16055 (syms_of_gnutls): Remove duplicate DEFSYM for
16056 Qgnutls_bootprop_verify_hostname_error, an error for
16057 Qgnutls_bootprop_verify_error (which is no longer used).
16058
7d47b580
JB
16059 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
16060 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
16061 Also (re)move comments that are misplaced or no longer relevant.
16062
1e49bfab
LMI
160632011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16064
16065 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
16066
1485f4c0
CY
160672011-07-03 Chong Yidong <cyd@stupidchicken.com>
16068
16069 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
16070 and background color parameters if they have been changed.
16071
a9ab721e
LMI
160722011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16073
16074 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
16075
cf7cff57
PE
160762011-07-03 Paul Eggert <eggert@cs.ucla.edu>
16077
2e13213d
PE
16078 * xsettings.c (SYSTEM_FONT): Define only when used.
16079 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
16080
cf7cff57
PE
16081 * keymap.c (access_keymap_1): Now static.
16082
7a8e04f7
CY
160832011-07-02 Chong Yidong <cyd@stupidchicken.com>
16084
16085 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
16086 leave any prefix arg for the up event (Bug#1586).
16087
61352f62
LMI
160882011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
16089
69bb1ef7
LMI
16090 * lread.c (syms_of_lread): Mention single symbols defined by
16091 `defvar' or `defconst' (bug#7154).
16092
61352f62 16093 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 16094 (Frequire): Mention get-load-suffixes.
61352f62 16095
28545e04
MR
160962011-07-02 Martin Rudalics <rudalics@gmx.at>
16097
16098 * window.h (window): Remove clone_number slot.
16099 * window.c (Fwindow_clone_number, Fset_window_clone_number):
16100 Remove.
16101 (make_parent_window, make_window, saved_window)
16102 (Fset_window_configuration, save_window_save): Don't deal with
16103 clone numbers.
16104 * buffer.c (Qclone_number): Remove declaration.
16105 (sort_overlays, overlay_strings): Don't deal with clone numbers.
16106
3349e122
SM
161072011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
16108
16109 Add multiple inheritance to keymaps.
16110 * keymap.c (Fmake_composed_keymap): New function.
16111 (Fset_keymap_parent): Simplify.
16112 (fix_submap_inheritance): Remove.
16113 (access_keymap_1): New function extracted from access_keymap to handle
16114 embedded parents and handle lists of maps.
16115 (access_keymap): Use it.
16116 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
16117 (Fcopy_keymap): Handle embedded parents.
16118 (Fcommand_remapping, define_as_prefix): Simplify.
16119 (Fkey_binding): Simplify.
16120 (syms_of_keymap): Move minibuffer-local-completion-map,
16121 minibuffer-local-filename-completion-map,
16122 minibuffer-local-must-match-map, and
16123 minibuffer-local-filename-must-match-map to Elisp.
16124 (syms_of_keymap): Defsubr make-composed-keymap.
16125 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
16126 (parse_menu_item): Trivial simplification.
16127
3279eb87
GM
161282011-07-01 Glenn Morris <rgm@gnu.org>
16129
16130 * Makefile.in (SETTINGS_LIBS): Fix typo.
16131
39cb9e56 161322011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
16133
16134 * coding.c (Fencode_coding_string): Record the last coding system
16135 used, as the function doc string says (bug#8738).
16136
0949d2b6
JD
161372011-07-01 Jan Djärv <jan.h.d@swipnet.se>
16138
16139 * xsettings.c (store_monospaced_changed): Take new font as arg and
16140 check for change against current_mono_font.
16141 (EMACS_TYPE_SETTINGS): Remove this and related defines.
16142 (emacs_settings_constructor, emacs_settings_get_property)
16143 (emacs_settings_set_property, emacs_settings_class_init)
16144 (emacs_settings_init, gsettings_obj): Remove.
16145 (something_changedCB): New function for HAVE_GSETTINGS.
16146 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
16147 with value as argument.
16148 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
16149 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 16150 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
16151 "changed".
16152
16153 * xgselect.c: Add defined (HAVE_GSETTINGS).
16154 (xgselect_initialize): Ditto.
16155
16156 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
16157 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
16158 xg_select.
16159
bbc6b304
PE
161602011-07-01 Paul Eggert <eggert@cs.ucla.edu>
16161
16162 * eval.c (struct backtrace): Simplify and port the data structure.
16163 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
16164 signed bit field, as this assumption is not portable and it makes
16165 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
16166 "char debug_on_exit : 1" as this is not portable either; instead,
16167 use the portable "unsigned int debug_on_exit : 1". Remove unused
16168 member evalargs. Remove obsolete comments about cc bombing out.
16169
9851bfc5
JD
161702011-06-30 Jan Djärv <jan.h.d@swipnet.se>
16171
51bb811f 16172 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
16173 Let HAVE_GSETTINGS override HAVE_GCONF.
16174 (store_monospaced_changed): New function.
16175 (EMACS_SETTINGS): A new type derived from GObject to handle
16176 GSettings notifications.
16177 (emacs_settings_constructor, emacs_settings_get_property)
16178 (emacs_settings_set_property, emacs_settings_class_init):
16179 New functions.
16180 (gsettings_client, gsettings_obj): New variables.
16181 (GSETTINGS_SCHEMA): New define.
16182 (something_changedCB): Call store_monospaced_changed.
16183 (init_gsettings): New function.
16184 (xsettings_initialize): Call init_gsettings.
16185 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
16186 to NULL.
16187
640c8776 16188 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
16189 GCONF_CFLAGS/LIBS.
16190
5386012d
MR
161912011-06-29 Martin Rudalics <rudalics@gmx.at>
16192
16193 * window.c (resize_root_window, grow_mini_window)
16194 (shrink_mini_window): Rename Qresize_root_window to
16195 Qwindow_resize_root_window and Qresize_root_window_vertically to
16196 Qwindow_resize_root_window_vertically.
16197
f13e0b08
PE
161982011-06-28 Paul Eggert <eggert@cs.ucla.edu>
16199
16200 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
16201
94515237
JB
162022011-06-27 Juanma Barranquero <lekktu@gmail.com>
16203
16204 * makefile.w32-in: Redesign dependencies so they reflect more
16205 clearly which files are directly included by each source file,
16206 and not through other includes.
16207
e43b6e43
MR
162082011-06-27 Martin Rudalics <rudalics@gmx.at>
16209
16210 * buffer.c (Qclone_number): Declare static and DEFSYM it.
16211 (sort_overlays, overlay_strings): When an overlay's clone number
16212 matches the window's clone number process the overlay even if
16213 the overlay's window property doesn't match the current window.
16214
d68443dc
MR
16215 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
16216 (Fwindow_hchild): Rename to Fwindow_left_child.
16217 (Fwindow_next): Rename to Fwindow_next_sibling.
16218 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
16219 (resize_window_check): Rename to window_resize_check.
16220 (resize_window_apply): Rename to window_resize_apply.
16221 (Fresize_window_apply): Rename to Fwindow_resize_apply.
16222 (Fdelete_other_windows_internal, resize_frame_windows)
16223 (Fsplit_window_internal, Fdelete_window_internal)
16224 (grow_mini_window, shrink_mini_window)
16225 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 16226
c7e73be5
JD
162272011-06-26 Jan Djärv <jan.h.d@swipnet.se>
16228
16229 * emacsgtkfixed.h: State that this is only used with Gtk+3.
16230 (emacs_fixed_set_min_size): Remove.
16231 (emacs_fixed_new): Take frame as argument.
16232
16233 * emacsgtkfixed.c: State that this is only used with Gtk+3.
16234 (_EmacsFixedPrivate): Remove minwidth/height.
16235 Add struct frame *f.
16236 (emacs_fixed_init): Initialize priv->f.
16237 (get_parent_class, emacs_fixed_set_min_size): Remove.
16238 (emacs_fixed_new): Set priv->f to argument.
16239 (emacs_fixed_get_preferred_width)
16240 (emacs_fixed_get_preferred_height): Use min_width/height from
16241 frames size_hint to set minimum and natural (Bug#8919).
16242 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
16243 and use min_width/height from frames size_hint to set
16244 min_width/height (Bug#8919).
16245
16246 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
16247 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
16248 Fix indentation.
c7e73be5 16249
cf99dcf8
EZ
162502011-06-26 Eli Zaretskii <eliz@gnu.org>
16251
16252 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
16253 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
16254 called at ZV.
16255
029529ac
CY
162562011-06-26 Chong Yidong <cyd@stupidchicken.com>
16257
16258 * process.c (wait_reading_process_output): Bypass select if
16259 waiting for a cell while ignoring keyboard input, and input is
16260 pending. Suggested by Jan Djärv (Bug#8869).
16261
7a7ef429
PE
162622011-06-25 Paul Eggert <eggert@cs.ucla.edu>
16263
16264 Use gnulib's dup2 module instead of rolling our own.
16265 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
16266
11fdef7d 162672011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
16268
16269 * dispnew.c (scrolling_window): Before scrolling, turn off a
16270 mouse-highlight in the window being scrolled.
16271
cd3520a4
JB
162722011-06-24 Juanma Barranquero <lekktu@gmail.com>
16273
16274 Move DEFSYM to lisp.h and use everywhere.
16275
16276 * character.h (DEFSYM): Move declaration...
16277 * lisp.h (DEFSYM): ...here.
16278
16279 * gnutls.c:
16280 * minibuf.c:
16281 * w32menu.c:
16282 * w32proc.c:
16283 * w32select.c: Don't include character.h.
16284
16285 * alloc.c (syms_of_alloc):
16286 * buffer.c (syms_of_buffer):
16287 * bytecode.c (syms_of_bytecode):
16288 * callint.c (syms_of_callint):
16289 * casefiddle.c (syms_of_casefiddle):
16290 * casetab.c (init_casetab_once):
16291 * category.c (init_category_once, syms_of_category):
16292 * ccl.c (syms_of_ccl):
16293 * cmds.c (syms_of_cmds):
16294 * composite.c (syms_of_composite):
16295 * dbusbind.c (syms_of_dbusbind):
16296 * dired.c (syms_of_dired):
16297 * dispnew.c (syms_of_display):
16298 * doc.c (syms_of_doc):
16299 * editfns.c (syms_of_editfns):
16300 * emacs.c (syms_of_emacs):
16301 * eval.c (syms_of_eval):
16302 * fileio.c (syms_of_fileio):
16303 * fns.c (syms_of_fns):
16304 * frame.c (syms_of_frame):
16305 * fringe.c (syms_of_fringe):
16306 * insdel.c (syms_of_insdel):
16307 * keymap.c (syms_of_keymap):
16308 * lread.c (init_obarray, syms_of_lread):
16309 * macros.c (syms_of_macros):
16310 * msdos.c (syms_of_msdos):
16311 * print.c (syms_of_print):
16312 * process.c (syms_of_process):
16313 * search.c (syms_of_search):
16314 * sound.c (syms_of_sound):
16315 * syntax.c (init_syntax_once, syms_of_syntax):
16316 * terminal.c (syms_of_terminal):
16317 * textprop.c (syms_of_textprop):
16318 * undo.c (syms_of_undo):
16319 * w32.c (globals_of_w32):
16320 * window.c (syms_of_window):
16321 * xdisp.c (syms_of_xdisp):
16322 * xfaces.c (syms_of_xfaces):
16323 * xfns.c (syms_of_xfns):
16324 * xmenu.c (syms_of_xmenu):
16325 * xsettings.c (syms_of_xsettings):
16326 * xterm.c (syms_of_xterm): Use DEFSYM.
16327
4228cf16
TZ
163282011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
16329
cd3520a4 16330 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 16331
7fcccf1e
PE
163322011-06-23 Paul Eggert <eggert@cs.ucla.edu>
16333
7efb4e0e
PE
16334 Integer and buffer overflow fixes (Bug#8873).
16335
ff5844ad
PE
16336 * print.c (printchar, strout): Check for string overflow.
16337 (PRINTPREPARE, printchar, strout):
16338 Don't set size unless allocation succeeds.
16339
90532f02
PE
16340 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
16341 for sizes. Check for string overflow more accurately.
16342 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
16343
6d84508d
PE
16344 * macros.c: Integer and buffer overflow fixes.
16345 * keyboard.h (struct keyboard.kbd_macro_bufsize):
16346 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
16347 Use ptrdiff_t, not int, for sizes.
16348 Don't increment bufsize until after realloc succeeds.
16349 Check for size-calculation overflow.
16350 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
16351
437b2cb4
PE
16352 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
16353
8b9ac8b4
PE
16354 * lread.c: Integer overflow fixes.
16355 (read_integer): Radix is now EMACS_INT, not int,
16356 to improve quality of diagnostics for out-of-range radices.
16357 Calculate buffer size correctly for out-of-range radices.
16358 (read1): Check for integer overflow in radices, and in
16359 read-circle numbers.
82cb60d3
PE
16360 (read_escape): Avoid int overflow.
16361 (Fload, openp, read_buffer_size, read1)
16362 (substitute_object_recurse, read_vector, read_list, map_obarray):
16363 Use ptrdiff_t, not int, for sizes.
16364 (read1): Use EMACS_INT, not int, for sizes.
20270765 16365 Check for size overflow.
8b9ac8b4 16366
7fcccf1e
PE
16367 * image.c (cache_image): Check for size arithmetic overflow.
16368
bfbbd7e7
PE
16369 * lread.c: Integer overflow issues.
16370 (saved_doc_string_size, saved_doc_string_length)
16371 (prev_saved_doc_string_size, prev_saved_doc_string_length):
16372 Now ptrdiff_t, not int.
16373 (read1): Don't assume doc string length fits in int. Check for
16374 out-of-range doc string lengths.
16375 (read_list): Don't assume file position fits in int.
39019e54 16376 (read_escape): Check for hex character overflow.
bfbbd7e7 16377
4e323265
LL
163782011-06-22 Leo Liu <sdl.web@gmail.com>
16379
16380 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
16381 Move to minibuffer.el.
16382
85fece3e
PE
163832011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16384
20b84ce9 16385 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
16386 The following patches are for when GLYPH_DEBUG && !XASSERT.
16387 * dispextern.h (trace_redisplay_p, dump_glyph_string):
16388 * dispnew.c (flush_stdout):
16389 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
16390 Mark as externally visible.
16391 * dispnew.c (check_window_matrix_pointers): Now static.
16392 * dispnew.c (window_to_frame_vpos):
16393 * xfns.c (unwind_create_frame):
16394 * xterm.c (x_check_font): Remove unused local.
16395 * scroll.c (CHECK_BOUNDS):
16396 * xfaces.c (cache_fache): Rename local to avoid shadowing.
16397 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
16398 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
16399 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
16400 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
16401 Now static.
16402 (debug_method_add): Use va_list and vsprintf rather than relying
16403 on undefined behavior with wrong number of arguments.
16404 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16405 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16406 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16407 since we're not interested in debugging glyphs with old libraries.
16408 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16409 GCC 4.6.0's static checking.
16410
0766b489
PE
164112011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16412
31fd4b32
PE
16413 Integer overflow and signedness fixes (Bug#8873).
16414 A few related buffer overrun fixes, too.
16415
b79e8648
PE
16416 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16417
0766b489
PE
16418 * dispextern.h (struct face.stipple):
16419 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16420 (x_bitmap_mask, x_allocate_bitmap_record)
16421 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16422 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16423 (x_create_bitmap_from_xpm_data):
16424 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16425 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16426 (.bitmaps_last):
16427 * xfaces.c (load_pixmap):
16428 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16429 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16430 (.bitmaps_last, struct x_output.icon_bitmap):
16431 Use ptrdiff_t, not int, for bitmap indexes.
16432 (x_allocate_bitmap_record): Check for size overflow.
16433 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16434
b081724f
PE
16435 Use ptrdiff_t, not int, for overlay counts.
16436 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16437 * editfns.c (overlays_around, get_pos_property):
16438 * textprop.c (get_char_property_and_overlay):
16439 * xdisp.c (next_overlay_change, note_mouse_highlight):
16440 * xfaces.c (face_at_buffer_position):
21514da7
PE
16441 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16442 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16443 (Fnext_overlay_change, Fprevious_overlay_change)
16444 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 16445 Use ptrdiff_t, not int, for sizes.
21514da7 16446 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 16447
3de73e5e
PE
16448 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16449
2606c57b
PE
16450 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16451 (x_session_initialize): Do not assume string length fits in int.
16452
aaafe47a
PE
16453 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16454 This is unlikely, but can occur if DPI is outlandish.
16455
2674ddc8 16456 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
16457 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16458
28154962
PE
16459 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16460 * xrdb.c (magic_file_p, search_magic_path):
16461 Omit last arg SUFFIX; it was always 0. All callers changed.
16462 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16463
7de51af5
PE
16464 * xfont.c (xfont_match): Avoid need for strlen.
16465
25ed6cc3
PE
16466 * xfns.c: Don't assume strlen fits in int.
16467 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16468
4eab31dd
PE
16469 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16470 not unsigned long, as we prefer signed integers. All callers changed.
16471 Detect integer overflow in repeat count.
16472 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 16473 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 16474
171e2a58
PE
16475 * termcap.c: Don't assume sizes fit in int and never overflow.
16476 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16477 (gobble_line): Check for size-calculation overflow.
16478
ad39faca 16479 * minibuf.c (Fread_buffer):
6e5bb2dc 16480 * lread.c (intern, intern_c_string):
74ca2eb3
PE
16481 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16482 Don't assume string length fits in int.
16483
52c61c22 16484 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
16485 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16486
b5b8c9e5
PE
16487 * font.c: Don't assume string length fits in int.
16488 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16489 Use ptrdiff_t, not int.
ccd6111c
PE
16490 (font_intern_prop): Don't assume string length fits in int.
16491 Don't assume integer property fits in fixnum.
16492 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 16493
882f0d81 16494 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 16495 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
16496 Reformulate so as not to need the command string.
16497 Invoke gzip -cd rather than gunzip, as it's more portable.
16498 (lock_info_type, lock_file_1, lock_file):
16499 Don't assume pid_t and time_t fit in unsigned long.
16500 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16501 (current_lock_owner): Prefer signed type for sizes.
16502 Use memcpy, not strncpy, where memcpy is what is really wanted.
16503 Don't assume (via atoi) that time_t and pid_t fit in int.
16504 Check for time_t and/or pid_t out of range, e.g., via a network share.
16505 Don't alloca where an auto var works fine.
16506
93f4cf88
PE
16507 * fileio.c: Fix some integer overflow issues.
16508 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16509 Don't assume string length fits in int.
16510 (directory_file_name): Don't assume string length fits in long.
16511 (make_temp_name): Don't assume pid fits in int, or that its print
16512 length is less than 20.
16513
f3e92b69
PE
16514 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16515
1bfdaf10
PE
16516 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16517
35016e9a
PE
16518 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16519
3d1e65a1
PE
16520 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16521 We prefer signed integers, even for size calculations.
16522
0b963a93
PE
16523 * emacs.c: Don't assume string length fits in 'int'.
16524 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16525 (main): Don't invoke strlen when not needed.
16526
573f4b54
PE
16527 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16528 (XD_DEBUG_MESSAGE): Don't waste a byte.
16529
989f33ba
PE
16530 * callproc.c (getenv_internal_1, getenv_internal)
16531 (Fgetenv_internal):
965d34eb
PE
16532 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16533
e4d29b33
PE
16534 * lread.c (invalid_syntax): Omit length argument.
16535 All uses changed. This doesn't fix a bug, but it simplifies the
16536 code away from its former Hollerith-constant appearance, and it's
16537 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 16538 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 16539
eb49b136
PE
16540 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16541 This didn't break anything, but it didn't help either.
16542 It's confusing to put a bogus integer in a place where the actual
16543 value does not matter.
9f62aeb1 16544 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 16545 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 16546
15375a22
PE
16547 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16548 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16549 implementation.
b61cc01c
PE
16550 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16551 We prefer signed types, and the value cannot exceed the EMACS_INT
16552 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
16553 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16554 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16555 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 16556
53b2623d
PE
16557 * indent.c (sane_tab_width): New function.
16558 (current_column, scan_for_column, Findent_to, position_indentation)
16559 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 16560 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 16561
51cab52b 16562 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 16563
f2ed8a70
PE
16564 * lisp.h (lint_assume): New macro.
16565 * composite.c (composition_gstring_put_cache):
16566 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16567
abe80cc6
PE
16568 * editfns.c, insdel.c:
16569 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 16570
b02c740e
PE
16571 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16572
ebc96716
PE
16573 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16574
b4e50fa0 16575 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 16576 Use much-faster test for byte-length change.
311d5d7c 16577 Don't assume string byte-length fits in 'int'.
a4cf38e4 16578 Check that character arg fits in 'int'.
85461888 16579 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 16580
c0c1ee9f
PE
16581 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16582
a498d7f4
PE
16583 * fns.c (concat): Catch string overflow earlier.
16584 Do not rely on integer wraparound.
16585
51cab52b
PE
16586 * dispextern.h (struct it.overlay_strings_charpos)
16587 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
16588 * xdisp.c (forward_to_next_line_start)
16589 (back_to_previous_visible_line_start)
16590 (reseat_at_next_visible_line_start, next_element_from_buffer):
16591 Don't arbitrarily truncate the value of 'selective' to int.
16592
76031fad
PE
16593 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16594
5eb55db9
PE
16595 * composite.c: Don't truncate sizes to 'int'.
16596 (composition_gstring_p, composition_reseat_it)
16597 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
16598 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16599 not EMACS_UINT, for indexes.
5eb55db9 16600
0703a717
PE
16601 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16602
d6202519
PE
16603 * buffer.c: Include <verify.h>.
16604 (struct sortvec.priority, struct sortstr.priority):
8961a454 16605 Now EMACS_INT, not int.
c20998a7 16606 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
16607 (struct sortstr.size, record_overlay_string)
16608 (struct sortstrlist.size, struct sortlist.used):
16609 Don't truncate size to int.
16610 (record_overlay_string): Check for size-calculation overflow.
d6202519 16611 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 16612
d5a19415
JM
166132011-06-22 Jim Meyering <meyering@redhat.com>
16614
029529ac 16615 Don't leak an XBM-image-sized buffer
d5a19415
JM
16616 * image.c (xbm_load): Free the image buffer after using it.
16617
a9041e6c
PE
166182011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16619
16620 Port to Sun C.
16621 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16622 that Sun C diagnosed.
16623 * fns.c (secure_hash): Fix pointer signedness issue.
16624 * intervals.c (static_offset_intervals): New function.
16625 (offset_intervals): Use it.
16626
7f3f739f
LL
166272011-06-21 Leo Liu <sdl.web@gmail.com>
16628
16629 * deps.mk (fns.o):
16630 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16631 sha512.h.
16632
16633 * fns.c (secure_hash): Rename from crypto_hash_function and change
16634 the first arg to accept symbols.
5b66d427 16635 (Fsecure_hash): New primitive.
7f3f739f
LL
16636 (syms_of_fns): New symbols.
16637
76147d94
DD
166382011-06-20 Deniz Dogan <deniz@dogan.se>
16639
16640 * process.c (Fset_process_buffer): Clarify return value in
16641 docstring.
16642
7d7d0045
CY
166432011-06-18 Chong Yidong <cyd@stupidchicken.com>
16644
16645 * dispnew.c (add_window_display_history): Use BVAR.
16646
16647 * xdisp.c (debug_method_add): Use BVAR.
16648 (check_window_end, dump_glyph_matrix, dump_glyph)
16649 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16650
16651 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16652 Likewise.
16653
16654 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16655 check till after the cache is created in init_frame_faces.
16656
ff2bc410
SM
166572011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16658
16659 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16660
28177add
PE
166612011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16662
dd3482fe
PE
16663 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16664 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16665 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16666
393d71f3 16667 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
16668 * fileio.c (Finsert_file_contents):
16669 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16670 Remove the old (too-loose) buffer overflow checks.
16671 They weren't needed, since make_gap checks for buffer overflow.
16672 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16673 The old code merely checked for Emacs fixnum overflow, and relied
16674 on undefined (wraparound) behavior. The new code avoids undefined
16675 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16676
2e6813b0 16677 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
16678 Tune. Don't use wider integers than needed. Don't use alloca.
16679 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 16680
599a9e4f
PE
16681 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16682
99561444
PE
16683 * insdel.c, lisp.h (buffer_overflow): New function.
16684 (insert_from_buffer_1, replace_range, replace_range_2):
16685 * insdel.c (make_gap_larger):
16686 * editfns.c (Finsert_char):
16687 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16688
28177add
PE
16689 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16690
e69dafad
PE
166912011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16692
4baa020d 16693 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 16694
b1c46f02
PE
16695 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16696 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16697
e69dafad
PE
16698 * fileio.c: Don't assume EMACS_INT fits in off_t.
16699 (emacs_lseek): New static function.
16700 (Finsert_file_contents, Fwrite_region): Use it.
16701 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16702
566684ea
PE
16703 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16704
e6966cd6
PE
16705 * fns.c: Don't overflow int when computing a list length.
16706 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16707 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16708 truncation on 64-bit hosts. Check for QUIT every
16709 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16710 faster and is responsive enough.
16711 (Flength): Report an error instead of overflowing an integer.
16712 (Fsafe_length): Return a float if the value is not representable
16713 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 16714 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 16715 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 16716
dd0b0efb
PE
16717 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16718 (header_size, word_size): New constants.
16719 (allocate_vectorlike): Don't check size overflow here.
16720 (allocate_vector): Check it here instead, since this is the only
16721 caller of allocate_vectorlike that could cause overflow.
16722 Check that the new vector's length is representable as a fixnum.
16723
86fe5cfe
PE
16724 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16725 The previous code was bogus. For example, next_almost_prime (32)
16726 returned 39, which is undesirable as it is a multiple of 3; and
16727 next_almost_prime (24) returned 25, which is a multiple of 5 so
16728 why was the code bothering to check for multiples of 7?
16729
80e88859
PE
16730 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16731
4a2f0ad6
PE
16732 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16733
f66c7cf8
PE
16734 Variadic C functions now count arguments with ptrdiff_t.
16735 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16736 Back then I didn't know that the Emacs coding style prefers signed int.
16737 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
16738 were being counted with int, which may truncate counts on 64-bit
16739 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
16740 * lisp.h (struct Lisp_Subr.function.aMANY)
16741 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16742 Arg counts are now ptrdiff_t, not size_t.
16743 All variadic functions and their callers changed accordingly.
16744 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16745 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16746 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16747 * callint.c (Fcall_interactively): Check arg count for overflow,
16748 to avoid potential buffer overrun. Use signed char, not 'int',
16749 for 'varies' array, so that we needn't bother to check its size
16750 calculation for overflow.
16751 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16752 * eval.c (apply_lambda):
16753 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16754 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16755 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16756
a1759b76
PE
16757 * callint.c (Fcall_interactively): Don't use index var as event count.
16758
d96be9fc
PE
16759 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16760 * mem-limits.h (SIZE): Remove; no longer used.
16761
a690a978 16762 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 16763
578c21e6
PE
16764 Remove unnecessary casts.
16765 * xterm.c (x_term_init):
16766 * xfns.c (x_set_border_pixel):
16767 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16768 These aren't needed now that we assume ANSI C.
16769
96f53c6c
PE
16770 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16771 It's more likely to cause problems (due to unsigned overflow)
16772 than to cure them.
16773
83c77d31
PE
16774 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16775
ee2079f1
PE
16776 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16777
6da65536
PE
16778 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16779
7147c4a4
PE
16780 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16781
193e32d9
PE
16782 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16783
e5533da6
PE
16784 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16785
9910e595
PE
16786 GLYPH_CODE_FACE returns EMACS_INT, not int.
16787 * dispextern.h (merge_faces):
16788 * xfaces.c (merge_faces):
01103c44
PE
16789 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16790 Don't assume EMACS_INT fits in int.
9910e595 16791
2638320e
PE
16792 * character.h (CHAR_VALID_P): Remove unused parameter.
16793 * fontset.c, lisp.h, xdisp.c: All uses changed.
16794
045eb8d9
PE
16795 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16796
c1f134b5
PE
16797 * fns.c (concat): Minor tuning based on overflow analysis.
16798 This doesn't fix any bugs. Use int to hold character, instead
16799 of constantly refetching from Emacs object. Use XFASTINT, not
16800 XINT, for value known to be a character. Don't bother comparing
16801 a single byte to 0400, as it's always less.
16802
395fcb93 16803 * floatfns.c (Fexpt):
327eeec8
PE
16804 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16805
abbd3d23
PE
16806 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16807 for characters.
16808
684a03ef
PE
16809 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16810
0fed43f3
PE
16811 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16812 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16813 incorrectly succeed when S was a string, because 4294967386 was
16814 truncated before it was used.
16815
8fd02eb7
PE
16816 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16817 Otherwise, an out-of-range integer could cause undefined behavior
16818 on a 64-bit host.
16819
f8c86b69
PE
16820 * composite.c: Use int, not EMACS_INT, for characters.
16821 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16822 EMACS_INT, for values that are known to be in character range.
16823 This doesn't fix any bugs but is the usual style inside Emacs and
16824 may generate better code on 32-bit machines.
16825
34206dd2
PE
16826 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16827 This is for reasons similar to the recent CHAR_STRING fix.
16828 * charset.c (Fencode_char): Check that character arg is actually
16829 a character. Pass an int to ENCODE_CHAR.
16830 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16831 wider than 'int', as a compile-time check to prevent future regressions
16832 in this area.
16833
c5958d4c 16834 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
16835
16836 Make sure a 64-bit char is never passed to CHAR_STRING.
16837 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16838 by silently ignoring the top 32 bits, allowing some values
16839 that were far too large to be valid characters.
16840 * character.h: Include <verify.h>.
16841 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16842 arguments are no wider than unsigned, as a compile-time check
16843 to prevent future regressions in this area.
16844 * data.c (Faset):
01103c44 16845 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
16846 (Fsubst_char_in_region):
16847 * fns.c (concat):
16848 * xdisp.c (decode_mode_spec_coding):
16849 Adjust to CHAR_STRING's new requirement.
16850 * editfns.c (Finsert_char, Fsubst_char_in_region):
16851 * fns.c (concat): Check that character args are actually
16852 characters. Without this test, these functions did the wrong
16853 thing with wildly out-of-range values on 64-bit hosts.
16854
d37ca623
PE
16855 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16856 These casts should not be needed on 32-bit hosts, either.
16857 * keyboard.c (read_char):
16858 * lread.c (Fload): Remove casts to unsigned.
16859
ea204efb
PE
16860 * lisp.h (UNSIGNED_CMP): New macro.
16861 This fixes comparison bugs on 64-bit hosts.
16862 (ASCII_CHAR_P): Use it.
16863 * casefiddle.c (casify_object):
01103c44 16864 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
16865 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16866 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16867 * dispextern.h (FACE_FROM_ID):
16868 * keyboard.c (read_char): Use UNSIGNED_CMP.
16869
41cb286c
PE
16870 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16871 not to EMACS_INT, to avoid GCC warning.
16872
4a1b9832
PE
16873 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16874
55daad71
PE
16875 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16876 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16877 isn't needed on 32-bit machines.
8f95c75c 16878
01103c44
PE
16879 * buffer.c (Fgenerate_new_buffer_name):
16880 Use EMACS_INT for count, not int.
0ceccced 16881 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
16882
16883 * data.c (Qcompiled_function): Now static.
16884
c6f072e7
PE
16885 * window.c (window_body_lines): Now static.
16886
20ce5912
PE
16887 * image.c (gif_load): Rename local to avoid shadowing.
16888
9c4c5f81
PE
16889 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16890 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16891 * alloc.c (make_save_value): Integer argument is now of type
16892 ptrdiff_t, not int.
16893 (mark_object): Use ptrdiff_t, not int.
16894 * lisp.h (pD): New macro.
16895 * print.c (print_object): Use it.
16896
c0c5c8ae
PE
16897 * alloc.c: Use EMACS_INT, not int, to count objects.
16898 (total_conses, total_markers, total_symbols, total_vector_size)
16899 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
16900 (total_free_floats, total_floats, total_free_intervals)
16901 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
16902 Now EMACS_INT, not int. All uses changed.
16903 (Fgarbage_collect): Compute overall total using a double, so that
16904 integer overflow is less likely to be a problem. Check for overflow
16905 when converting back to an integer.
5a25e253
PE
16906 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16907 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16908 These were 'int' variables that could overflow on 64-bit hosts;
16909 they were never used, so remove them instead of repairing them.
211a0b2a 16910 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
16911 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16912 Previously, this ceilinged at INT_MAX, but that doesn't work on
16913 64-bit machines.
e46bb31a 16914 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 16915
c78baabf 16916 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 16917 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
16918 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16919 when a (possibly-narrower) signed value would do just as well.
16920 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 16921
c9d624c6
PE
16922 * alloc.c: Catch some string size overflows that we were missing.
16923 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16924 for convenience in STRING_BYTES_MAX.
16925 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16926 The definition here is exact; the one in lisp.h was approximate.
16927 (allocate_string_data): Check for string overflow. This catches
16928 some instances we weren't catching before. Also, it catches
16929 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16930 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16931 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 16932
c9d624c6
PE
16933 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16934 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 16935 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 16936
353032ce
PE
16937 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16938
2bccce07
PE
16939 * alloc.c (Fmake_string): Check for out-of-range init.
16940
0ac30604
SM
169412011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16942
16943 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16944
c195f2de
JD
169452011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16946
16947 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16948 xg_get_default_scrollbar_width.
16949
16950 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16951 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16952 (style_changed_cb): Call update_theme_scrollbar_width and call
16953 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16954 all frames (Bug#8505).
16955 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16956 Call gtk_window_set_resizable if HAVE_GTK3.
16957 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16958 and height if HAVE_GTK3 (Bug#8505).
16959 (scroll_bar_width_for_theme): New variable.
16960 (update_theme_scrollbar_width): New function.
16961 (xg_get_default_scrollbar_width): Move code to
16962 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16963 (xg_initialize): Call update_theme_scrollbar_width.
16964
16965 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16966
16967 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16968
e10ac9f1
MR
169692011-06-12 Martin Rudalics <rudalics@gmx.at>
16970
16971 * frame.c (make_frame): Call other_buffer_safely instead of
16972 other_buffer.
16973
16974 * window.c (temp_output_buffer_show): Call display_buffer with
16975 second argument Vtemp_buffer_show_specifiers and reset latter
16976 immediately after the call.
16977 (Vtemp_buffer_show_specifiers): New variable.
16978 (auto_window_vscroll_p, next_screen_context_lines)
16979 (Vscroll_preserve_screen_position): Remove leading asterisks from
16980 doc-strings.
16981
2d3c217e 169822011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 16983
7b7f97e8 16984 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
16985 * buffer.c (Qclone_number): Remove for now, as it's unused.
16986 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16987 (record_buffer): Remove unused local.
16988 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16989 (set_frame_buffer_list): Remove; unused.
16990 * frame.h (other_visible_frames): Remove decl.
16991 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16992 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16993 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16994 if HAVE_GPM.
16995 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16996 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16997 Define only if HAVE_GPM.
16998 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16999 (update_hints_inhibit): Remove; never set. All uses removed.
17000 * widgetprv.h (emacsFrameClassRec): Remove decl.
17001 * window.c (delete_deletable_window): Now returns void, since it
17002 wasn't returning anything.
17003 (compare_window_configurations): Remove unused locals.
17004 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
17005 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
17006 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
17007 the same widths as pointers. This follows up on the 2011-05-06 patch.
17008 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
17009 * xterm.h: Likewise.
17010 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
17011
1384b89e
JB
170122011-06-12 Juanma Barranquero <lekktu@gmail.com>
17013
17014 * makefile.w32-in: Update dependencies.
17015 (LISP_H): Add lib/intprops.h.
17016
1100a63c
CY
170172011-06-11 Chong Yidong <cyd@stupidchicken.com>
17018
17019 * image.c (gif_load): Add animation frame delay to the metadata.
17020 (syms_of_image): Use DEFSYM. New symbol `delay'.
17021
6198ccd0
MR
170222011-06-11 Martin Rudalics <rudalics@gmx.at>
17023
17024 * window.c (delete_deletable_window): Re-add.
17025 (Fset_window_configuration): Rewrite to handle dead buffers and
17026 consequently deletable windows.
17027 (window_tree, Fwindow_tree): Remove. Supply functionality in
17028 window.el.
17029 (compare_window_configurations): Simplify code.
17030
b6e3633c
AS
170312011-06-11 Andreas Schwab <schwab@linux-m68k.org>
17032
1ab0dee5
AS
17033 * image.c (imagemagick_load_image): Fix type mismatch.
17034 (Fimagemagick_types): Likewise.
17035
b6e3633c
AS
17036 * window.h (replace_buffer_in_windows): Declare.
17037
9397e56f
MR
170382011-06-11 Martin Rudalics <rudalics@gmx.at>
17039
17040 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
17041 Qclone_number. Remove external declaration of Qdelete_window.
17042 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
17043 code.
640c8776
SM
17044 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
17045 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
17046 (Fother_buffer): Rewrite doc-string. Major rewrite for new
17047 buffer list implementation.
17048 (other_buffer_safely): New function.
17049 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
17050 calls to replace_buffer_in_windows and
17051 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
17052 if allowed.
17053 (record_buffer): Inhibit quitting and rewrite using quittable
17054 functions. Run Qbuffer_list_update_hook if allowed.
17055 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
17056 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
17057 Move switch-to-buffer to window.el.
9397e56f
MR
17058 (bury-buffer): Move to window.el.
17059 (Vbuffer_list_update_hook): New variable.
17060
17061 * lisp.h (other_buffer_safely): Add prototype in buffer.c
17062 section.
17063
17064 * window.h (resize_frame_windows): Move up in code.
17065 (Fwindow_frame): Remove EXFUN.
17066 (replace_buffer_in_all_windows): Remove prototype.
17067 (replace_buffer_in_windows_safely): Add prototype.
17068
17069 * window.c: Declare Qdelete_window static again. Move down
17070 declaration of select_count.
17071 (Fnext_window, Fprevious_window): Rewrite doc-strings.
17072 (Fother_window): Move to window.el.
17073 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
17074 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
17075 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
17076 window.el.
17077 (replace_buffer_in_windows): Implement by calling
17078 Qreplace_buffer_in_windows.
17079 (replace_buffer_in_all_windows): Remove with some functionality
17080 moved into replace_buffer_in_windows_safely.
17081 (replace_buffer_in_windows_safely): New function.
17082 (select_window_norecord, select_frame_norecord): Move in front
17083 of run_window_configuration_change_hook. Remove now obsolete
17084 declarations.
640c8776
SM
17085 (Fset_window_buffer): Rewrite doc-string.
17086 Call Qrecord_window_buffer.
9397e56f
MR
17087 (keys_of_window): Move binding for other-window to window.el.
17088
b50691aa
CY
170892011-06-11 Chong Yidong <cyd@stupidchicken.com>
17090
17091 * dispextern.h (struct image): Replace data member, whose int_val
17092 and ptr_val fields were not used by anything, with a single
17093 lisp_val object.
17094
17095 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
17096 (gif_clear_image, gif_load, imagemagick_load_image)
17097 (gs_clear_image, gs_load): Callers changed.
17098
3f754b86
PE
170992011-06-10 Paul Eggert <eggert@cs.ucla.edu>
17100
cca69397
PE
17101 * buffer.h: Include <time.h>, for time_t.
17102 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
17103
109e28d0
PE
17104 Fix minor problems found by static checking.
17105
60737f02
PE
17106 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
17107
4b66faf3
PE
17108 Make identifiers static if they are not used in other modules.
17109 * data.c (Qcompiled_function, Qframe, Qvector):
17110 * image.c (QimageMagick, Qsvg):
17111 * minibuf.c (Qmetadata):
17112 * window.c (resize_window_check, resize_root_window): Now static.
17113 * window.h (resize_window_check, resize_root_window): Remove decls.
17114
109e28d0
PE
17115 * window.c (window_deletion_count, delete_deletable_window):
17116 Remove; unused.
46a4ce9e
PE
17117 (window_body_lines): Now static.
17118 (Fdelete_other_windows_internal): Mark vars as initialized.
17119 Make sure 'resize_failed' is initialized.
17120 (run_window_configuration_change_hook): Rename local to avoid shadowing.
17121 (resize_window_apply): Remove unused local.
17122 * window.h (delete_deletable_window): Remove decl.
17123
109e28d0 17124 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
17125 (imagemagick_load_image): Fix pointer signedness problem by changing
17126 last arg from unsigned char * to char *. All uses changed.
17127 Also, fix a local for similar reasons.
17128 Remove unused locals. Remove locals to avoid shadowing.
17129 (fn_rsvg_handle_free): Remove; unused.
17130 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 17131 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 17132
3f754b86
PE
17133 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
17134
2547adb1
CY
171352011-06-10 Chong Yidong <cyd@stupidchicken.com>
17136
17137 * image.c (gif_load): Fix omitted cast error introduced by
17138 2011-06-06 change.
17139
2c8e37d4
MR
171402011-06-10 Martin Rudalics <rudalics@gmx.at>
17141
17142 * window.h (resize_proportionally, orig_total_lines)
17143 (orig_top_line): Remove from window structure.
17144 (set_window_height, set_window_width, change_window_heights)
17145 (Fdelete_window): Remove prototypes.
17146 (resize_frame_windows): Remove duplicate declaration.
17147
440a42e3
EZ
171482011-06-10 Eli Zaretskii <eliz@gnu.org>
17149
17150 * window.h (resize_frame_windows, resize_window_check)
17151 (delete_deletable_window, resize_root_window)
17152 (resize_frame_windows): Declare prototypes.
17153
17154 * window.c (resize_window_apply): Make definition be "static" to
17155 match the prototype.
17156
562dd5e9
MR
171572011-06-10 Martin Rudalics <rudalics@gmx.at>
17158
17159 * window.c: Remove declarations of Qwindow_size_fixed,
17160 window_min_size_1, window_min_size_2, window_min_size,
17161 size_window, window_fixed_size_p, enlarge_window, delete_window.
17162 Remove static from declaration of Qdelete_window, it's
17163 temporarily needed by Fbury_buffer.
17164 (replace_window): Don't assign orig_top_line and
17165 orig_total_lines.
17166 (Fdelete_window, delete_window): Remove. Window deletion is
17167 handled by window.el.
640c8776
SM
17168 (window_loop): Remove DELETE_OTHER_WINDOWS case.
17169 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
17170 (Fdelete_other_windows): Remove. Deleting other windows is
17171 handled by window.el.
17172 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
17173 handled in window.el.
17174 (window_min_size_2, window_min_size_1, window_min_size): Remove.
17175 Window minimum sizes are handled in window.el.
17176 (shrink_windows, size_window, set_window_height)
17177 (set_window_width, change_window_heights, window_height)
17178 (window_width, CURBEG, CURSIZE, enlarge_window)
17179 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
17180 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
17181 handled in window.el.
17182 (make_dummy_parent): Rename to make_parent_window and give it a
17183 second argument horflag.
17184 (make_window): Don't set resize_proportionally any more.
17185 (Fsplit_window): Remove. Windows are split in window.el.
17186 (save_restore_action, save_restore_orig_size)
17187 (shrink_window_lowest_first, save_restore_orig_size): Remove.
17188 Resize mini windows in window.el.
17189 (grow_mini_window, shrink_mini_window): Implement by calling
17190 Qresize_root_window_vertically, resize_window_check and
17191 resize_window_apply.
640c8776
SM
17192 (saved_window, Fset_window_configuration, save_window_save):
17193 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
17194 resize_proportionally.
17195 (window_min_height, window_min_width): Move to window.el.
17196 (keys_of_window): Move bindings for delete-other-windows,
17197 split-window, delete-window and enlarge-window to window.el.
17198
17199 * buffer.c: Temporarily extern Qdelete_window.
17200 (Fbury_buffer): Temporarily call Qdelete_window instead of
17201 Fdelete_window (Fbury_buffer will move to window.el soon).
17202
17203 * frame.c (set_menu_bar_lines_1): Remove code handling
17204 orig_top_line and orig_total_lines.
17205
17206 * dispnew.c (adjust_frame_glyphs_initially): Don't use
17207 set_window_height but set heights directly.
17208 (change_frame_size_1): Use resize_frame_windows.
17209
17210 * xdisp.c (init_xdisp): Don't use set_window_height but set
17211 heights directly.
17212
640c8776
SM
17213 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
17214 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
17215 run_window_configuration_change_hook.
17216
17217 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
17218 instead of change_window_heights and run
17219 run_window_configuration_change_hook.
17220
1a13852e
MR
172212011-06-09 Martin Rudalics <rudalics@gmx.at>
17222
17223 * window.c (replace_window): Rename second argument REPLACEMENT to
17224 NEW. New third argument SETFLAG. Rewrite.
17225 (delete_window, make_dummy_parent): Call replace_window with
17226 third argument 1.
17227 (window_list_1): Move down in code.
17228 (run_window_configuration_change_hook): Move set_buffer part
17229 before select_frame_norecord part in order to unwind correctly.
17230 Rename count1 to count.
17231 (recombine_windows, delete_deletable_window, resize_root_window)
17232 (Fdelete_other_windows_internal)
17233 (Frun_window_configuration_change_hook, make_parent_window)
17234 (resize_window_check, resize_window_apply, Fresize_window_apply)
17235 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
17236 (Fdelete_window_internal, Fresize_mini_window_internal):
17237 New functions.
1a13852e
MR
17238 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
17239
f3d1777e
MR
172402011-06-08 Martin Rudalics <rudalics@gmx.at>
17241
496e208e
MR
17242 * window.h (window): Add some new members to window structure -
17243 normal_lines, normal_cols, new_total, new_normal, clone_number,
17244 splits, nest, prev_buffers, next_buffers.
17245 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 17246 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 17247
f3d1777e
MR
17248 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
17249 Remove.
496e208e
MR
17250 (make_dummy_parent): Set new members of windows structure.
17251 (make_window): Move down in code. Handle new members of window
17252 structure.
17253 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
17254 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
17255 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
17256 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
17257 (Fset_window_next_buffers, Fset_window_clone_number):
17258 New functions.
496e208e
MR
17259 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
17260 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
17261 Doc-string fixes.
17262 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
17263 Argument WINDOW can be now internal window too.
17264 (Fwindow_use_time): Move up in code.
17265 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
17266 Rewrite doc-string.
17267 (Fset_window_configuration, saved_window)
17268 (Fcurrent_window_configuration, save_window_save): Handle new
17269 members of window structure.
b9e809c2
MR
17270 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
17271 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
17272 (syms_of_window): New Lisp objects Qrecord_window_buffer,
17273 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
17274 Qget_mru_window, Qresize_root_window,
17275 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
17276 Qauto_buffer_name; staticpro them.
f3d1777e 17277
abde8f8c
MR
172782011-06-07 Martin Rudalics <rudalics@gmx.at>
17279
17280 * window.c (Fwindow_total_size, Fwindow_left_column)
17281 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
17282 (Fwindow_list_1): New functions.
17283 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
17284 (Fwindow_width, Fscroll_left, Fscroll_right):
17285 Use window_body_cols instead of window_box_text_cols.
17286 (delete_window, Fset_window_configuration):
17287 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
17288 (delete_all_subwindows): Take a window as argument and not a
17289 structure. Rewrite.
190b47e6
MR
17290 (window_loop): Remove handling of GET_LRU_WINDOW and
17291 GET_LARGEST_WINDOW.
17292 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
17293
17294 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
17295 window_box_text_cols. delete_all_subwindows now takes a
17296 Lisp_Object as argument.
abde8f8c 17297
640c8776
SM
17298 * indent.c (compute_motion, Fcompute_motion):
17299 Use window_body_cols instead of window_box_text_cols.
abde8f8c 17300
fa8a67e6
MR
17301 * frame.c (delete_frame): Call delete_all_subwindows with root
17302 window as argument.
17303
a54e3482
DC
173042011-06-07 Daniel Colascione <dan.colascione@gmail.com>
17305
17306 * fns.c (Fputhash): Document return value.
17307
60002bf5
CY
173082011-06-06 Chong Yidong <cyd@stupidchicken.com>
17309
17310 * image.c (gif_load): Implement gif89a spec "no disposal" method.
17311
0c671da6 173122011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 17313
b862a52a 17314 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 17315
be44ca6c
PE
17316 Check for overflow when converting integer to cons and back.
17317 * charset.c (Fdefine_charset_internal, Fdecode_char):
17318 Use cons_to_unsigned to catch overflow.
17319 (Fencode_char): Use INTEGER_TO_CONS.
17320 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
17321 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
17322 * data.c (long_to_cons, cons_to_long): Remove.
17323 (cons_to_unsigned, cons_to_signed): New functions.
17324 These signal an error for invalid or out-of-range values.
17325 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
17326 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
17327 * font.c (Ffont_variation_glyphs):
17328 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
17329 * lisp.h: Include <intprops.h>.
17330 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
17331 (cons_to_signed, cons_to_unsigned): New decls.
17332 (long_to_cons, cons_to_long): Remove decls.
17333 * undo.c (record_first_change): Use INTEGER_TO_CONS.
17334 (Fprimitive_undo): Use CONS_TO_INTEGER.
17335 * xfns.c (Fx_window_property): Likewise.
17336 * xselect.c: Include <limits.h>.
17337 (x_own_selection, selection_data_to_lisp_data):
17338 Use INTEGER_TO_CONS.
17339 (x_handle_selection_request, x_handle_selection_clear)
17340 (x_get_foreign_selection, Fx_disown_selection_internal)
17341 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
17342 (lisp_data_to_selection_data): Use cons_to_unsigned.
17343 (x_fill_property_data): Use cons_to_signed.
17344 Report values out of range.
17345
d1f3d2af
PE
17346 Check for buffer and string overflow more precisely.
17347 * buffer.h (BUF_BYTES_MAX): New macro.
17348 * lisp.h (STRING_BYTES_MAX): New macro.
17349 * alloc.c (Fmake_string):
17350 * character.c (string_escape_byte8):
17351 * coding.c (coding_alloc_by_realloc):
17352 * doprnt.c (doprnt):
17353 * editfns.c (Fformat):
17354 * eval.c (verror):
17355 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
17356 since they may not be the same number.
17357 * editfns.c (Finsert_char):
17358 * fileio.c (Finsert_file_contents):
17359 Likewise for BUF_BYTES_MAX.
17360
dd52fcea
PE
17361 * image.c: Use ptrdiff_t, not int, for sizes.
17362 (slurp_file): Switch from int to ptrdiff_t.
17363 All uses changed.
17364 (slurp_file): Check that file size fits in both size_t (for
17365 malloc) and ptrdiff_t (for sanity and safety).
17366
7f9bbdbb
PE
17367 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
17368 if b->modtime has its maximal value.
17369
dfe18f82
PE
17370 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
17371
84acfcf0
PE
17372 Don't assume time_t can fit into int.
17373 * buffer.h (struct buffer.modtime): Now time_t, not int.
17374 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
17375 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
17376
ccd9a01a
PE
17377 Minor fixes for signed vs unsigned integers.
17378 * character.h (MAYBE_UNIFY_CHAR):
17379 * charset.c (maybe_unify_char):
17380 * keyboard.c (read_char, reorder_modifiers):
17381 XINT -> XFASTINT, since the integer must be nonnegative.
17382 * ftfont.c (ftfont_spec_pattern):
17383 * keymap.c (access_keymap, silly_event_symbol_error):
17384 XUINT -> XFASTINT, since the integer must be nonnegative.
17385 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
17386 since it makes no difference and we prefer signed.
17387 * keyboard.c (record_char): Use XUINT when all the neighbors do.
17388 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
17389 nonnegative.
17390
d6d100dd
SM
173912011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
17392
17393 * window.h (Fwindow_frame): Declare.
17394
2b6148e4
PE
173952011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17396
17397 * alloc.c: Simplify handling of large-request failures (Bug#8800).
17398 (SPARE_MEMORY): Always define.
17399 (LARGE_REQUEST): Remove.
17400 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
17401
f230ecc9
MR
174022011-06-06 Martin Rudalics <rudalics@gmx.at>
17403
727e958e
MR
17404 * lisp.h: Move EXFUNS for Fframe_root_window,
17405 Fframe_first_window and Fset_frame_selected_window to window.h.
17406
17407 * window.h: Move EXFUNS for Fframe_root_window,
17408 Fframe_first_window and Fset_frame_selected_window here from
17409 lisp.h.
17410
17411 * frame.c (Fwindow_frame, Fframe_first_window)
17412 (Fframe_root_window, Fframe_selected_window)
17413 (Fset_frame_selected_window): Move to window.c.
17414 (Factive_minibuffer_window): Move to minibuf.c.
17415 (Fother_visible_frames_p): New function.
17416
17417 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17418
f230ecc9
MR
17419 * window.c (decode_window, decode_any_window): Move up in code.
17420 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17421 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
17422 (Fwindow_buffer): Move up and rewrite doc-string.
17423 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17424 (Fwindow_prev): New functions.
727e958e
MR
17425 (Fwindow_frame): Move here from frame.c. Accept any window as
17426 argument.
17427 (Fframe_root_window, Fframe_first_window)
17428 (Fframe_selected_window): Move here from frame.c. Accept frame
17429 or arbitrary window as argument. Update doc-strings.
17430 (Fminibuffer_window): Move up in code.
17431 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
17432 (Fset_frame_selected_window): Move here from frame.c.
17433 Marginal rewrite.
727e958e
MR
17434 (Fselected_window, select_window, Fselect_window): Move up in
17435 code. Minor doc-string fixes.
f230ecc9 17436
4d09bcf6
PE
174372011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17438
17439 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17440 Do not assume that spare memory exists; that assumption is valid
17441 only if SYSTEM_MALLOC.
17442 (LARGE_REQUEST): New macro, so that the issue of large requests
17443 is separated from the issue of spare memory.
17444
810928a2
AS
174452011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17446
172418ad
AS
17447 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17448 format. (Bug#8806)
17449
43f862f7
AS
17450 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17451
810928a2
AS
17452 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17453 before statements.
17454
a059fe24
JD
174552011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17456
17457 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17458
17459 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17460
17461 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17462 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17463
989bf368
JB
174642011-06-05 Juanma Barranquero <lekktu@gmail.com>
17465
17466 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17467
4b80f674
CY
174682011-06-04 Chong Yidong <cyd@stupidchicken.com>
17469
17470 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17471 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
17472 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17473 New error handlers.
4b80f674
CY
17474 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17475 Obey Vx_select_enable_clipboard_manager. Catch errors in
17476 x_clipboard_manager_save (Bug#8779).
17477 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 17478 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 17479
99a33b77 174802011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
17481
17482 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17483
99a33b77 174842011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
17485
17486 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17487 in the current matrix if keep_current_p is non-zero.
17488
8264569d
EZ
174892011-06-04 Eli Zaretskii <eliz@gnu.org>
17490
17491 * bidi.c (bidi_level_of_next_char): Fix last change.
17492
57f97249
EZ
174932011-06-03 Eli Zaretskii <eliz@gnu.org>
17494
fec2107c 17495 Support bidi reordering of text covered by display properties.
57f97249 17496
fec2107c
EZ
17497 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17498 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17499 (bidi_cache_search, bidi_cache_iterator_state)
17500 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
17501 (bidi_level_of_next_char, bidi_move_to_visually_next):
17502 Support character positions inside a run of characters covered by a
fec2107c
EZ
17503 display string.
17504 (bidi_paragraph_init, bidi_resolve_explicit_1)
17505 (bidi_level_of_next_char): Call bidi_fetch_char and
17506 bidi_fetch_char_advance instead of FETCH_CHAR and
17507 FETCH_CHAR_ADVANCE.
17508 (bidi_init_it): Initialize new members.
17509 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17510 definitions.
17511 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17512 instead of using explicit *_CHAR codes.
d6d100dd
SM
17513 (bidi_resolve_explicit, bidi_resolve_weak):
17514 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
17515 bidirectional text is supported only in multibyte buffers.
17516 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17517 it to initialize the frame_window_p member of struct bidi_it.
17518 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17519 (bidi_resolve_explicit, bidi_resolve_weak)
17520 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17521 bidi_it->nchars is non-positive.
17522 (bidi_level_of_next_char): Don't try to lookup the cache for the
17523 next/previous character if nothing is cached there yet, or if we
17524 were just reseat()'ed to a new position.
c40e2fb2 17525
0e14fe90
EZ
17526 * xdisp.c (set_cursor_from_row): Set start and stop points
17527 according to the row's direction when priming the loop that looks
17528 for the glyph on which to display cursor.
17529 (single_display_spec_intangible_p): Function deleted.
17530 (display_prop_intangible_p): Reimplement to call
17531 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
17532 Accept 3 additional arguments needed by handle_display_spec.
17533 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
17534 values: lists, `(when COND...)' forms, etc.
17535 (single_display_spec_string_p): Support property values that are
17536 lists with the argument STRING its top-level element.
17537 (display_prop_string_p): Fix the condition for processing a
17538 property that is a list to be consistent with handle_display_spec.
fec2107c 17539 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
17540 last portion of handle_display_prop.
17541 (compute_display_string_pos): Accept additional argument
17542 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17543 value of a `display' property is a "replacing spec".
17544 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17545 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17546 the display property, but just return a value indicating whether
17547 the display property will replace the characters it covers.
17548 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17549 frame_window_p members of struct bidi_it.
d6d100dd
SM
17550 (compute_display_string_pos, compute_display_string_end):
17551 New functions.
fec2107c
EZ
17552 (push_it): Accept second argument POSITION, where pop_it should
17553 jump to continue iteration.
17554 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 17555
fec2107c
EZ
17556 * keyboard.c (adjust_point_for_property): Adjust the call to
17557 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
17558
17559 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
17560 (bidi_init_it): Update prototypes.
17561 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
17562 (compute_display_string_pos, compute_display_string_end):
17563 Declare prototypes.
fec2107c
EZ
17564 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17565 EMACS_INT.
fc6f18ce 17566
40087514 175672011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 17568
57f53182
PE
17569 Malloc failure behavior now depends on size of allocation.
17570 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17571 * lisp.h: Change signatures accordingly.
17572 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17573 All callers changed. (Bug#8762)
17574
17575 * gnutls.c: Use Emacs's memory allocators.
17576 Without this change, the gnutls library would invoke malloc etc.
17577 directly, which causes problems on non-SYNC_INPUT hosts, and which
17578 runs afoul of improving memory_full behavior. (Bug#8761)
17579 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17580 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17581 xfree instead of the default malloc, realloc, free.
17582 (Fgnutls_boot): No need to check for memory allocation failure,
17583 since xmalloc does that for us.
17584
ac32cd99 17585 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
17586 * category.c (hash_get_category_set):
17587 * ccl.c (ccl_driver):
17588 * charset.c (Fdefine_charset_internal):
17589 * charset.h (struct charset.hash_index):
17590 * composite.c (get_composition_id, gstring_lookup_cache)
17591 (composition_gstring_put_cache):
17592 * composite.h (struct composition.hash_index):
17593 * dispextern.h (struct image.hash):
17594 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17595 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17596 (hashfn_equal, hashfn_user_defined, make_hash_table)
17597 (maybe_resize_hash_table, hash_lookup, hash_put)
17598 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17599 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17600 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17601 * image.c (make_image, search_image_cache, lookup_image)
17602 (xpm_put_color_table_h):
17603 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 17604 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 17605 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 17606 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
17607 * alloc.c (allocate_vectorlike):
17608 Check for overflow in vector size calculations.
17609 * ccl.c (ccl_driver):
17610 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
17611 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17612 need to be updated by these changes.
40087514
PE
17613 * fns.c (make_hash_table, maybe_resize_hash_table):
17614 Check for integer overflow with large hash tables.
0de4bb68
PE
17615 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17616 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17617 (SXHASH_REDUCE): New macro.
17618 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17619 Use it instead of discarding useful hash info with large hash values.
17620 (sxhash_float): New function.
17621 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17622 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
17623 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17624 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
17625 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17626 Adjust signatures to match updated version of code.
17627 (consing_since_gc): Now EMACS_INT, since a single hash table can
17628 use more than INT_MAX bytes.
17629
698d32e2
DN
176302011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17631
17632 Make it possible to build with GCC-4.6+ -O2 -flto.
17633
17634 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17635
fd6fa53f
SM
176362011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17637
17638 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17639 Call minibuffer-inactive-mode.
17640
864db017
JB
176412011-05-31 Juanma Barranquero <lekktu@gmail.com>
17642
17643 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17644 Update dependencies.
17645
2ad0baf4
DN
176462011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17647
17648 * data.c (init_data): Remove code for UTS, this system is not
17649 supported anymore.
17650
4fcc2638
DN
176512011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17652
17653 Don't force ./temacs to start in terminal mode.
17654
17655 * frame.c (make_initial_frame): Initialize faces in all cases, not
17656 only when CANNOT_DUMP is defined.
17657 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17658
c56e0fd5
DN
176592011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17660
17661 * dispnew.c (add_window_display_history): Use const for the string
17662 pointer. Remove declaration, not needed.
17663
333d54da 176642011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 17665
55d4c1b2 17666 Use 'inline', not 'INLINE'.
333d54da 17667 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
17668 * alloc.c, fontset.c (INLINE): Remove.
17669 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17670 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17671 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17672 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17673 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17674
738db178
DN
176752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17676
17677 Make it possible to run ./temacs.
17678
17679 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17680 syms_of_callproc does the same thing. Remove test for
17681 "initialized", do it in the caller.
17682 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17683
620c53a6
SM
176842011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17685
17686 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17687 (read_minibuf): Use get_minibuffer.
17688 (syms_of_minibuf): Use DEFSYM.
17689 (Qmetadata): New var.
17690 * data.c (Qbuffer): Don't make it static.
17691 (syms_of_data): Use DEFSYM.
17692
e003a292
PE
176932011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17694
17695 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17696 (CCL_CODE_MIN): New macro.
17697
ed008a6d
PE
176982011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17699
3687c2ef
PE
17700 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17701
ed008a6d
PE
17702 * eval.c (Qdebug): Now static.
17703 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17704 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17705 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17706
d66c4c7c
CY
177072011-05-29 Chong Yidong <cyd@stupidchicken.com>
17708
17709 * image.c: Various fixes to ImageMagick code comments.
17710 (Fimagemagick_types): Doc fix.
17711
5fbc2025
PE
177122011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17713
0196f88a
PE
17714 Minor fixes prompted by GCC 4.6.0 warnings.
17715
17716 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17717
5fbc2025
PE
17718 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17719 (x_clipboard_manager_save_all): Move extern decl to ...
17720 * xterm.h: ... here, so that it can be checked for consistency.
17721
1dd3c2d9
CY
177222011-05-29 Chong Yidong <cyd@stupidchicken.com>
17723
17724 * xselect.c (x_clipboard_manager_save_frame)
17725 (x_clipboard_manager_save_all): New functions.
17726 (Fx_clipboard_manager_save): Lisp function deleted.
17727
17728 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17729 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17730
17731 * xterm.h: Update prototype.
17732
5ba6571d
WX
177332011-05-28 William Xu <william.xwl@gmail.com>
17734
17735 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17736 exiting (Bug#8239).
17737
3eaff834
JM
177382011-05-28 Jim Meyering <meyering@redhat.com>
17739
e1900994 17740 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
17741 * fns.c (to_uchar): Define.
17742 (crypto_hash_function): Use it to convert some newly-signed
17743 variables to unsigned, to avoid sign-extension bugs. For example,
17744 without this change, (md5 "truc") would evaluate to
17745 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17746 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 17747 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 17748
0f6990a7
PE
177492011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17750
17751 Integer overflow fixes.
c8a9ca5a 17752
08686060
PE
17753 * dbusbind.c: Serial number integer overflow fixes.
17754 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
17755 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17756 to hold a serial number that is too large for a fixnum.
17757 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17758 Check for serial numbers out of range. Decode any serial number
59568bf0 17759 that was so large that it became a float. (Bug#8722)
08686060 17760
2d1fc3c7
PE
17761 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17762 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17763 Use XFASTINT rather than XUINT when numbers are nonnegative.
17764 (xd_append_arg, Fdbus_method_return_internal):
17765 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17766 arguments, check that Lisp number is nonnegative, rather than
59568bf0 17767 silently wrapping negative numbers around. (Bug#8722)
30217ff0 17768 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 17769 (Bug#8722)
2d1fc3c7 17770
c8a9ca5a
PE
17771 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17772
519e1d69
PE
17773 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17774
6df6ae42 17775 ccl: Add integer overflow checks.
30569699
PE
17776 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17777 (IN_INT_RANGE): New macros.
17778 (ccl_driver): Use them to check for integer overflow when
17779 decoding a CCL program. Many of the new checks are whether XINT (x)
17780 fits in int; it doesn't always, on 64-bit hosts. The new version
17781 doesn't catch all possible integer overflows, but it's an
847044ea 17782 improvement. (Bug#8719)
30569699 17783
c11285dc
PE
17784 * alloc.c (make_event_array): Use XINT, not XUINT.
17785 There's no need for unsigned here.
17786
fdccd48e
PE
17787 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17788 This follows up to the 2011-05-06 change that substituted uintptr_t
17789 for EMACS_INT. This case wasn't caught back then.
17790
37910ab2
PE
17791 Rework Fformat to avoid integer overflow issues.
17792 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17793 now (part of C89). Include <verify.h>.
17794 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17795 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17796 (Fformat): Avoid the prepass trying to compute sizes; it was only
17797 approximate and thus did not catch overflow reliably. Instead, walk
17798 through the format just once, formatting and computing sizes as we go,
17799 checking for integer overflow at every step, and allocating a larger
17800 buffer as needed. Keep track separately whether the format is
17801 multibyte. Keep only the most-recently calculated precision, rather
17802 than them all. Record whether each argument has been converted to
17803 string. Use EMACS_INT, not int, for byte and char and arg counts.
17804 Support field widths and precisions larger than INT_MAX. Avoid
17805 sprintf's undefined behavior with conversion specifications such as %#d
17806 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17807 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17808 formatting out-of-range floating point numbers with int
9173deec 17809 formats. (Bug#8668)
37910ab2 17810
2e6578fb
PE
17811 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17812
0ae6bdee
PE
17813 * data.c: Avoid integer truncation in expressions involving floats.
17814 * data.c: Include <intprops.h>.
17815 (arith_driver): When there's an integer overflow in an expression
17816 involving floating point, convert the integers to floating point
17817 so that the resulting value does not suffer from catastrophic
17818 integer truncation. For example, on a 64-bit host (* 4
17819 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17820 Do not rely on undefined behavior after integer overflow.
17821
de883a70
PE
17822 merge count_size_as_multibyte, parse_str_to_multibyte
17823 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 17824 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
17825 Check for integer overflow.
17826 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17827 since it's now a duplicate of the other. This is more of
17828 a character than a buffer op, so better that it's in character.c.
17829 * fns.c, print.c: Adjust to above changes.
17830
2ff916cb
PE
178312011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17832
17833 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17834
f1b54466
PE
178352011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17836
fb1ac845
PE
17837 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17838 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17839 (x_clipboard_manager_save): Now static.
17840 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17841
f1b54466
PE
17842 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17843 (crypto_hash_function): Now static.
17844 Fix pointer signedness problems. Avoid unnecessary initializations.
17845
a9f737ee
CY
178462011-05-27 Chong Yidong <cyd@stupidchicken.com>
17847
17848 * termhooks.h (Vselection_alist): Make it terminal-local.
17849
17850 * terminal.c (create_terminal): Initialize it.
17851
17852 * xselect.c: Support for clipboard managers.
17853 (Vselection_alist): Move to termhooks.h as terminal-local var.
17854 (LOCAL_SELECTION): New macro.
17855 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17856 (symbol_to_x_atom): Remove gratuitous arg.
17857 (x_handle_selection_request, lisp_data_to_selection_data)
17858 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
17859 (x_own_selection, x_get_local_selection, x_convert_selection):
17860 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
17861 (some_frame_on_display): Delete unused function.
17862 (Fx_own_selection_internal, Fx_get_selection_internal)
17863 (Fx_disown_selection_internal, Fx_selection_owner_p)
17864 (Fx_selection_exists_p): New optional frame arg.
17865 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17866 (x_handle_selection_clear): Don't treat other terminals with the
17867 same keyboard specially. Use the terminal-local Vselection_alist.
17868 (x_clear_frame_selections): Use Frun_hook_with_args.
17869
17870 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17871
17872 * xterm.h: Add support for those atoms.
17873
e067f0c1
CY
178742011-05-26 Chong Yidong <cyd@stupidchicken.com>
17875
17876 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17877 (converted_selections, conversion_fail_tag): New global variables.
17878 (x_selection_request_lisp_error): Free the above.
17879 (x_get_local_selection): Remove unnecessary code.
17880 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
17881 of converted selections stored in converted_selections.
17882 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
17883 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17884 (x_convert_selection): New function.
17885 (x_handle_selection_event): Simplify.
17886 (x_get_foreign_selection): Don't ignore incoming requests while
17887 waiting for an answer; this will fail when we implement
17888 SAVE_TARGETS, and seems unnecessary anyway.
17889 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17890 (Vx_sent_selection_functions): Doc fix.
17891
0f4aebc0
LL
178922011-05-26 Leo Liu <sdl.web@gmail.com>
17893
17894 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17895
e61124cd
YM
178962011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17897
17898 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17899
17900 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17901 for fringe update if it has periodic bitmap.
ac389d0c 17902 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
17903 and fringe_bitmap_periodic_p.
17904
17905 * fringe.c (get_fringe_bitmap_data): New function.
17906 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17907 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17908 row. Mark glyph row for fringe update if periodicity changed.
17909
17910 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17911 for fringe update unless it has periodic bitmap.
17912
f16d9837
KH
179132011-05-25 Kenichi Handa <handa@m17n.org>
17914
17915 * xdisp.c (get_next_display_element): Set correct it->face_id for
17916 a static composition.
17917
e1b90ef6
LL
179182011-05-24 Leo Liu <sdl.web@gmail.com>
17919
17920 * deps.mk (fns.o):
17921 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17922
17923 * fns.c (crypto_hash_function, Fsha1): New function.
17924 (Fmd5): Use crypto_hash_function.
17925 (syms_of_fns): Add Ssha1.
17926
7400048f
PE
179272011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17928
17929 * gnutls.c: Remove unused macros.
17930 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17931 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17932 Remove macros that are defined and never used.
17933 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17934
abb71cf4
CY
179352011-05-22 Chong Yidong <cyd@stupidchicken.com>
17936
17937 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17938 (Fx_get_selection_internal): Minor cleanup.
17939 (Fx_own_selection_internal): Rename arguments for consistency with
17940 select.el.
17941
6307db39
PE
179422011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17943
17944 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17945
f3d4e0a4
CY
179462011-05-22 Chong Yidong <cyd@stupidchicken.com>
17947
17948 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17949
4d8ade89
YM
179502011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17951
17952 * dispnew.c (scrolling_window): Don't exclude the case that the
17953 last enabled row in the desired matrix touches the bottom boundary.
17954
32078c8d
GM
179552011-05-21 Glenn Morris <rgm@gnu.org>
17956
17957 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
17958 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17959 and add some more files.
32078c8d 17960
7285dc67
EZ
179612011-05-20 Eli Zaretskii <eliz@gnu.org>
17962
17963 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17964 report_file_error introduced by the change from 2011-05-07.
17965
89d1bd22
PE
179662011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17967
17968 * systime.h (Time): Define only if emacs is defined.
17969 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17970 where the include path doesn't have X11/X.h by default. See
17971 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17972
cd394be1 179732011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
17974
17975 * composite.c (find_automatic_composition): Fix previous change.
17976
b9704ad9
GM
179772011-05-20 Glenn Morris <rgm@gnu.org>
17978
17979 * lisp.mk: New file, split from Makefile.in.
17980 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17981 (shortlisp): Remove.
17982 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17983
4a720484
GM
179842011-05-19 Glenn Morris <rgm@gnu.org>
17985
17986 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17987 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17988 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17989 (lisp): Set the order to that of loadup.el.
17990 (shortlisp): Make it a copy of $lisp.
17991 (SOME_MACHINE_LISP): Remove.
17992 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17993 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17994
a28d4396
KH
179952011-05-18 Kenichi Handa <handa@m17n.org>
17996
17997 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17998 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17999 (find_automatic_composition): Mostly rewrite for efficiency.
18000
a2b1fa8e
JB
180012011-05-18 Juanma Barranquero <lekktu@gmail.com>
18002
18003 * makefile.w32-in: Update dependencies.
18004
8e1f5610
CS
180052011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
18006
18007 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 18008 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 18009
7025ee00 180102011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 18011
cdfa6eab
PE
18012 Fix some integer overflow issues, such as string length overflow.
18013
06d6db33
PE
18014 * insdel.c (count_size_as_multibyte): Check for string overflow.
18015
2b4560a8
PE
18016 * character.c (lisp_string_width): Check for string overflow.
18017 Use EMACS_INT, not int, for string indexes and lengths; in
18018 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
18019 the resulting string length overflows an EMACS_INT; instead,
18020 report a string overflow if no precision given. When checking for
18021 precision exhaustion, use a check that cannot possibly have
18022 integer overflow. (Bug#8675)
18023 * character.h (lisp_string_width): Adjust to new signature.
18024
cb93f9be
PE
18025 * alloc.c (string_overflow): New function.
18026 (Fmake_string): Use it. This doesn't change behavior, but saves
18027 a few bytes and will simplify future changes.
18028 * character.c (string_escape_byte8): Likewise.
18029 * lisp.h (string_overflow): New decl.
18030
1a1f3366
PE
18031 Fixups, following up to the user-interface timestamp change.
18032 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
18033 for UI timestamps, instead of unsigned long.
9fbd6841
PE
18034 * msdos.c (mouse_get_pos): Likewise.
18035 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
18036 * w32gui.h (Time): Define by including "systime.h" rather than by
18037 declaring it ourselves. (Bug#8664)
18038
d4e3e4d3
PE
18039 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
18040 * image.c (clear_image_cache): Likewise.
18041
f6a24d19
PE
18042 * term.c (term_mouse_position): Don't assume time_t wraparound.
18043
08dc5ae6
PE
18044 Be more systematic about user-interface timestamps.
18045 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
18046 and sometimes 'EMACS_UINT', to represent these timestamps.
18047 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
18048 This makes the code easier to follow, and makes it easier to catch
18049 integer overflow bugs such as Bug#8664.
18050 * frame.c (Fmouse_position, Fmouse_pixel_position):
18051 Use Time, not unsigned long, for user-interface timestamps.
18052 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
18053 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
18054 * keyboard.h (last_event_timestamp): Likewise.
18055 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
18056 * menu.h (xmenu_show): Likewise.
18057 * term.c (term_mouse_position): Likewise.
18058 * termhooks.h (struct input_event.timestamp): Likewise.
18059 (struct terminal.mouse_position_hook): Likewise.
18060 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
18061 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
18062 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
18063 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
18064 what it was before.
18065 * menu.h, termhooks.h: Include "systime.h", for Time.
18066
8e55734a
PE
18067 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
18068 Don't assume that the difference between two unsigned long values
18069 can fit into an integer. At this point, we know button_down_time
18070 <= event->timestamp, so the difference must be nonnegative, so
18071 there's no need to cast the result if double-click-time is
18072 nonnegative, as it should be; check that it's nonnegative, just in
18073 case. This bug is triggered when events are more than 2**31 ms
86db42d2 18074 apart (about 25 days). (Bug#8664)
8e55734a 18075
841f1b75 18076 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 18077 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 18078
3e26f69c
PE
18079 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
18080 that always fit in int. Use a sentinel instead of a counter, to
18081 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
18082 * frame.h (struct frame): Use int for menu_bar_items_used
18083 instead of EMACS_INT, since it always fits in int.
3e26f69c 18084
5cc152c0
PE
18085 * menu.c (grow_menu_items): Check for int overflow.
18086
d89eb65e
PE
18087 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
18088
5235bd3e
PE
18089 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
18090 Before, the code was not consistent. These values cannot exceed
18091 2**31 - 1 so there's no need to make them unsigned.
18092 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
18093 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
18094 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
18095 as modifiers.
18096 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
18097
bc827e23
PE
18098 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
18099 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
18100 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
18101 presumably because the widths might not match.
18102
78eb494e
PE
18103 * window.c (size_window): Avoid needless test at loop start.
18104
04f2d78b
CB
181052011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
18106
18107 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
18108
d2fc7e3d 181092011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
18110
18111 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
18112
d2fc7e3d 181132011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
18114
18115 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
18116 `width' to `bar_area_x' and `bar_area_width', respectively.
18117 (x_scroll_run): Take account of fringe background extension.
18118
04f2d78b
CB
18119 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
18120 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
18121 `bar_area_width', respectively.
18122 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
18123 background extension.
18124
79b70037
GM
181252011-05-10 Jim Meyering <meyering@redhat.com>
18126
18127 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
18128
2f142cc5
JB
181292011-05-10 Juanma Barranquero <lekktu@gmail.com>
18130
18131 * image.c (Finit_image_library): Return t for built-in image types,
18132 like pbm and xbm. (Bug#8640)
18133
57679c86
AS
181342011-05-09 Andreas Schwab <schwab@linux-m68k.org>
18135
18136 * w32menu.c (set_frame_menubar): Fix submenu allocation.
18137
888c9e86
EZ
181382011-05-07 Eli Zaretskii <eliz@gnu.org>
18139
b0512a1d
EZ
18140 * w32console.c (Fset_screen_color): Doc fix.
18141 (Fget_screen_color): New function.
18142 (syms_of_ntterm): Defsubr it.
18143
7285dc67
EZ
18144 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
18145 unlink the temporary file if Fcall_process didn't create it in the
18146 first place.
18147 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
18148 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
18149 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
18150 cue to call_process_cleanup not to close that handle.
18151
4d3fcc8e
BK
181522011-05-07 Ben Key <bkey76@gmail.com>
18153
18154 * makefile.w32-in: The bootstrap-temacs rule now makes use of
18155 one of two shell specific rules, either bootstrap-temacs-CMD or
18156 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
18157 to the previous implementation of the bootstrap-temacs rule.
18158 The bootstrap-temacs-CMD rule is similar to the previous
18159 implementation of the bootstrap-temacs rule except that it
18160 makes use of the ESC_CFLAGS variable instead of the CFLAGS
18161 variable.
18162
18163 These changes, along with some changes to nt/configure.bat,
18164 nt/gmake.defs, and nt/nmake.defs, are required to extend my
18165 earlier fix to add support for --cflags and --ldflags options
18166 that include quotes so that it works whether make uses cmd or
18167 sh as the shell.
18168
b4289b64
MA
181692011-05-06 Michael Albinus <michael.albinus@gmx.de>
18170
18171 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
18172 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
18173 is a constant.
18174 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
18175 a string. Handle both cases.
18176 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
18177 (Fdbus_register_method): Use Qinvalid_function.
18178
af4c0e28
JB
181792011-05-06 Juanma Barranquero <lekktu@gmail.com>
18180
18181 * makefile.w32-in: Update dependencies.
18182 (LISP_H): Add inttypes.h and stdin.h.
18183 (PROCESS_H): Add unistd.h.
18184
c51453d9
EZ
181852011-05-06 Eli Zaretskii <eliz@gnu.org>
18186
18187 * lread.c: Include limits.h (fixes the MS-Windows build broken by
18188 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
18189
8ff0ac3c 181902011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 18191
4c4b566b
PE
18192 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
18193
aab2b9b5
PE
18194 * term.c (vfatal): Remove stray call to va_end.
18195 It's not needed and the C Standard doesn't allow it here anyway.
18196
c378da0b
PE
18197 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
18198 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
18199
288b08c7
PE
18200 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
18201 bytes.
18202
e3601888
PE
18203 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
18204
db6c0e74
PE
18205 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18206
dd5963ea
PE
18207 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
18208
88c9450f
PE
18209 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
18210
2f9442b8
PE
18211 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
18212
c032b5f8
PE
18213 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
18214 * charset.c (Fdefine_charset_internal): Don't initialize
18215 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 18216 32-bit int (Bug#8600).
a108c10b
PE
18217
18218 * lread.c (read_integer): Be more consistent with string-to-number.
18219 Use string_to_number to do the actual conversion; this avoids
18220 rounding errors and fixes some other screwups. Without this fix,
18221 for example, #x1fffffffffffffff was misread as -2305843009213693952.
18222 (digit_to_number): Move earlier, for benefit of read_integer.
18223 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 18224 not a digit in any supported base. (Bug#8602)
a108c10b 18225
ad5f9eea
PE
18226 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
18227
aec1708a
PE
18228 * dispnew.c (scrolling_window): Return 1 if we scrolled,
18229 to match comment at start of function. This also removes a
18230 GCC warning about overflow in a 32+64-bit port.
18231
47be4ab5
PE
18232 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
18233
371cac43
PE
18234 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
18235 Reported by Stefan Monnier in
18236 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
18237 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18238 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 18239
d01a7826
PE
18240 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
18241 (EMACS_UINTPTR): Likewise, with uintptr_t.
18242
7fd47d5c
PE
18243 * lisp.h: Prefer 64-bit EMACS_INT if available.
18244 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
18245 on 32-bit hosts that have 64-bit int, so that they can access
18246 large files.
122b0c86
PE
18247 However, temporarily disable this change unless the temporary
18248 symbol WIDE_EMACS_INT is defined.
7fd47d5c 18249
8727937b
PE
18250 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
18251
8ac068ac
PE
18252 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
18253 This removes an assumption that EMACS_INT and long are the same
18254 width as pointers. The assumption is true for Emacs porting targets
18255 now, but we want to make other targets possible.
18256 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
18257 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
18258 In the rest of the code, change types of integers that hold casted
18259 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
18260 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
18261 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
18262 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
18263 No need to cast type when ORing.
18264 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
18265 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
18266 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
18267 assume EMACS_INT is the same width as char *.
18268 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
18269 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
18270 Remove no-longer-needed casts.
18271 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
18272 (xg_tool_bar_help_callback, xg_make_tool_item):
18273 Use EMACS_INTPTR to hold an integer
18274 that will be cast to void *; this can avoid a GCC warning
18275 if EMACS_INT is not the same width as void *.
18276 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
18277 * xdisp.c (display_echo_area_1, resize_mini_window_1):
18278 (current_message_1, set_message_1):
18279 Use a local to convert to proper width without a cast.
18280 * xmenu.c (dialog_selection_callback): Likewise.
18281
ede49d71
PE
18282 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
18283 Also, don't assume VALBITS / RAND_BITS is less than 5,
18284 and don't rely on undefined behavior when shifting a 1 left into
18285 the sign bit.
18286 * lisp.h (get_random): Change signature to match.
18287
2f30ecd0
PE
18288 * lread.c (hash_string): Use size_t, not int, for hash computation.
18289 Normally we prefer signed values; but hashing is special, because
18290 it's better to use unsigned division on hash table sizes so that
18291 the remainder is nonnegative. Also, size_t is the natural width
18292 for hashing into memory. The previous code used 'int', which doesn't
18293 retain enough info to hash well into very large tables.
18294 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
18295
2a866e7b
PE
18296 * dbusbind.c: Don't possibly lose pointer info when converting.
18297 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18298 Use XPNTR rather than XHASH, so that the high-order bits of
18299 the pointer aren't lost when converting through void *.
18300
51639eac
PE
18301 * eval.c (Fautoload): Don't double-shift a pointer.
18302
92394119
PE
18303 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
18304
dbdb9a7c
JB
183052011-05-06 Juanma Barranquero <lekktu@gmail.com>
18306
18307 * gnutls.c (DEF_GNUTLS_FN):
18308 * image.c (DEF_IMGLIB_FN): Make function pointers static.
18309
db7a0b4f
AS
183102011-05-05 Andreas Schwab <schwab@linux-m68k.org>
18311
18312 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
18313 marker. (Bug#8610)
18314
cd394be1 183152011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
18316
18317 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
18318 New version that can reserve upto 2GB of heap space.
18319
f7ff1b0f 183202011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
18321
18322 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
18323
639c109b
TZ
183242011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
18325
18326 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
18327 `gnutls_certificate_set_x509_key_file'.
18328
d2127135
JB
183292011-05-05 Juanma Barranquero <lekktu@gmail.com>
18330
18331 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
18332 Update dependencies.
18333
e968f4f3
JB
183342011-05-04 Juanma Barranquero <lekktu@gmail.com>
18335
18336 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
18337 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
18338 Remove unused parameter `fildes'.
18339 * process.c (read_process_output, send_process): Don't pass it.
18340
84d358f0
JB
183412011-05-04 Juanma Barranquero <lekktu@gmail.com>
18342
18343 Fix previous change: the library cache is defined in w32.c.
18344 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
18345 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
18346
0898ca10
JB
183472011-05-04 Juanma Barranquero <lekktu@gmail.com>
18348
18349 Implement dynamic loading of GnuTLS on Windows.
18350
18351 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
18352 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
18353 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18354 Declare.
18355
18356 * gnutls.c (Qgnutls_dll): Define.
18357 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
18358 (gnutls_*): Declare function pointers.
18359 (init_gnutls_functions): New function to initialize function pointers.
18360 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
18361 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
18362 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18363 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
18364 (emacs_gnutls_write, emacs_gnutls_read)
18365 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
18366 (Fgnutls_available_p): New function.
18367 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
18368 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
18369 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
18370
18371 * image.c: Include w32.h.
18372 (Vimage_type_cache): Delete.
18373 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
18374 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
18375 (w32_delayed_load): Move to w32.c.
18376
18377 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
18378
18379 * w32.c (QCloaded_from, Vlibrary_cache): Define.
18380 (w32_delayed_load): Move from image.c. When loading a library, record
18381 its filename in the :loaded-from property of the library id.
18382 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
18383 Initialize and staticpro them.
18384 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
18385
18386 * process.c: Include lisp.h before w32.h, not after.
18387 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
18388 instead of gnutls_record_check_pending.
18389
18390 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
18391
ff4de4aa
TZ
183922011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
18393
18394 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
18395 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
18396 as passed in.
18397
abe95abb
JD
183982011-05-03 Jan Djärv <jan.h.d@swipnet.se>
18399
18400 * xterm.c (x_set_frame_alpha): Do not set property on anything
18401 else than FRAME_X_OUTER_WINDOW (Bug#8608).
18402
e16e55d4
JB
184032011-05-02 Juanma Barranquero <lekktu@gmail.com>
18404
18405 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18406
bafcf6a5
JB
184072011-05-02 Juanma Barranquero <lekktu@gmail.com>
18408
18409 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18410 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18411 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18412 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18413 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18414 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18415 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18416 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18417 (Qgnutls_bootprop_callbacks_verify): Make static.
18418
e7a6747f
AS
184192011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18420
19ed11ba
AS
18421 * callproc.c: Indentation fixup.
18422
e7a6747f 18423 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
18424 (wait_for_termination, interruptible_wait_for_termination):
18425 Move after wait_for_termination_1.
e7a6747f 18426
1ef14cb4
LMI
184272011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18428
18429 * sysdep.c (interruptible_wait_for_termination): New function
18430 which is like wait_for_termination, but allows keyboard
18431 interruptions.
18432
18433 * callproc.c (Fcall_process): Add (:file "file") as an option for
18434 the STDOUT buffer.
18435 (Fcall_process_region): Ditto.
18436
330d880c
EZ
184372011-04-30 Eli Zaretskii <eliz@gnu.org>
18438
8db90b73
EZ
18439 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18440 rather than `XVECTOR (FOO)->size'.
18441
330d880c
EZ
18442 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18443 inttypes.h, as a gnulib replacement is used if it not available in
18444 system headers.
18445
15cbd324
EZ
184462011-04-21 Eli Zaretskii <eliz@gnu.org>
18447
18448 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18449 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18450 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18451
18452 * coding.c (coding_alloc_by_realloc): Error out if destination
18453 will grow beyond MOST_POSITIVE_FIXNUM.
18454 (decode_coding_emacs_mule): Abort if there isn't enough place in
18455 charbuf for the composition carryover bytes. Reserve an extra
18456 space for up to 2 characters produced in a loop.
18457 (decode_coding_iso_2022): Abort if there isn't enough place in
18458 charbuf for the composition carryover bytes.
18459
184602011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 18461
ae940cca
EZ
18462 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18463 aborting when %lld or %lll format is passed.
18464 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18465 %llo or %llx format is passed. (Bug#8545)
18466
03ab8921
EZ
18467 * window.c (window_scroll_line_based): Use a marker instead of
18468 simple variables to record original value of point. (Bug#7952)
18469
afda1437
EZ
18470 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18471 produced by %s or %c overflows available buffer space. (Bug#8545)
18472
f76dee0c
PE
184732011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18474
18475 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 18476 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 18477
fdc5744d
JB
184782011-04-28 Juanma Barranquero <lekktu@gmail.com>
18479
18480 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18481
638f053a
JB
184822011-04-28 Juanma Barranquero <lekktu@gmail.com>
18483
18484 * keyboard.c (Qdelayed_warnings_hook): Define.
18485 (command_loop_1): Run `delayed-warnings-hook'
18486 if Vdelayed_warnings_list is non-nil.
18487 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18488 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18489
d178f871
EZ
184902011-04-28 Eli Zaretskii <eliz@gnu.org>
18491
18492 * doprnt.c (doprnt): Don't return value smaller than the buffer
18493 size if the message was truncated. (Bug#8545).
18494
b124fd93
JB
184952011-04-28 Juanma Barranquero <lekktu@gmail.com>
18496
18497 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18498 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18499
e810457d
PE
185002011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18501
18502 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18503
ea51cceb
JB
185042011-04-27 Juanma Barranquero <lekktu@gmail.com>
18505
18506 * makefile.w32-in: Update dependencies.
18507
94dcfacf
EZ
185082011-04-27 Eli Zaretskii <eliz@gnu.org>
18509
18510 Improve `doprnt' and its usage. (Bug#8545)
18511 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18512 `format_end'. Remove support for %l as a conversion specifier.
18513 Don't use xrealloc. Improve diagnostics when the %l size modifier
18514 is used. Update the commentary.
18515
18516 * eval.c (verror): Simplify calculation of size_t.
18517
18518 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18519 messages.
18520
f61f41d7
PE
185212011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18522
18523 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18524 change.
18525
96fb4434
PE
185262011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18527
18528 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18529 This makes this file independent of the recent pseudovector change.
18530
671875da 185312011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 18532
69e9b5a3
PE
18533 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18534
b5f869a7 18535 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 18536 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 18537 Remove unused local.
c8926152 18538 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 18539
841a1577 18540 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
18541 GCC 4.6.0 optimizes based on type-based alias analysis.
18542 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
18543 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18544 != &v->size, and therefore "v->size = 1; b->size = 2; return
18545 v->size;" must therefore return 1. This assumption is incorrect
18546 for Emacs, since it type-puns struct Lisp_Vector * with many other
18547 types. To fix this problem, this patch adds a new type struct
f904488f 18548 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
18549 and pseudovectors, and helps optimizing compilers not get fooled
18550 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18551 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
18552 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18553 the size member.
eab3844f
PE
18554 (XSETPVECTYPE): Rewrite in terms of new macro.
18555 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18556 This is a bit clearer, and further avoids the possibility of
18557 undesirable aliasing.
18558 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 18559 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
18560 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18561 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
18562 (ASIZE): Now uses header.size rather than size.
18563 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
18564 to avoid the hassle of writing XVECTOR (foo)->header.size.
18565 (struct vectorlike_header): New type.
eab3844f
PE
18566 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18567 object, to help avoid aliasing.
18568 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18569 (SUBRP): Likewise, since Lisp_Subr is a special case.
18570 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18571 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18572 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 18573 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
18574 changed to be "header.size" and "header.next".
18575 * buffer.h (struct buffer): Likewise.
18576 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18577 * frame.h (struct frame): Likewise.
18578 * process.h (struct Lisp_Process): Likewise.
18579 * termhooks.h (struct terminal): Likewise.
18580 * window.c (struct save_window_data, struct saved_window): Likewise.
18581 * window.h (struct window): Likewise.
18582 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18583 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18584 * buffer.c (init_buffer_once): Likewise.
18585 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18586 special case.
18587 * process.c (Fformat_network_address): Use local var for size,
18588 for brevity.
18589
0df1eac5
PE
18590 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18591
847ab9d1 18592 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
18593 * data.c (atof): Remove decl; no longer used or needed.
18594 (digit_to_number): Move to lread.c.
18595 (Fstring_to_number): Use new string_to_number function, to be
18596 consistent with how the Lisp reader treats infinities and NaNs.
18597 Do not assume that floating-point numbers represent EMACS_INT
18598 without losing information; this is not true on most 64-bit hosts.
18599 Avoid double-rounding errors, by insisting on integers when
18600 parsing non-base-10 numbers, as the documentation specifies.
18601 * lisp.h (string_to_number): New decl, replacing ...
18602 (isfloat_string): Remove.
bc0a5c13 18603 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 18604 (read1): Do not accept +. and -. as integers; this
452f4150
PE
18605 appears to have been a coding error. Similarly, do not accept
18606 strings like +-1e0 as floating point numbers. Do not report
18607 overflow for integer overflows unless the base is not 10 which
18608 means we have no simple and reliable way to continue.
18609 Break out the floating-point parsing into a new
18610 function string_to_number, so that Fstring_to_number parses
18611 floating point numbers consistently with the Lisp reader.
04f2d78b 18612 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
18613 (E_CHAR, EXP_INT): Remove, replacing with ...
18614 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18615 (string_to_number): New function, replacing isfloat_string.
18616 This function checks for valid syntax and produces the resulting
18617 Lisp float number too. Rework it so that string-to-number
bc0a5c13 18618 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
18619 so that overflow for non-base-10 numbers is reported only when
18620 there's no portable and simple way to convert to floating point.
452f4150 18621
67769ffc
PE
18622 * textprop.c (set_text_properties_1): Rewrite for clarity,
18623 and to avoid GCC warning about integer overflow.
18624
c20db43f
PE
18625 * intervals.h (struct interval): Use EMACS_INT for members
18626 where EMACS_UINT might cause problems. See
18627 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18628 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18629 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18630 All uses changed.
37aa2f85
PE
18631 (offset_intervals): Tell GCC not to worry about length overflow
18632 when negating a negative length.
c20db43f 18633
2538aa2f
PE
18634 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18635 (overrun_check_free): Likewise.
18636
f2d3008d
PE
18637 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18638 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18639 word size.
18640
ec8df744
PE
18641 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18642 (gnutls_make_error): Rename local to avoid shadowing.
18643 (gnutls_emacs_global_deinit): ifdef out; not used.
18644 (Fgnutls_boot): Use const for pointer to readonly storage.
18645 Comment out unused local. Fix pointer signedness problems.
18646
640ee02d
PE
18647 * lread.c (openp): Don't stuff size_t into an 'int'.
18648 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18649 about possible signed overflow.
18650
6048fb2a
PE
18651 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18652 (GDK_KEY_g): Don't define if already defined.
18653 (xg_prepare_tooltip): Avoid pointer signedness problem.
18654 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18655
fa3c87e1
PE
18656 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18657 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18658
2172544b
PE
18659 * xfns.c (Fx_window_property): Simplify a bit,
18660 to make a bit faster and to avoid GCC 4.6.0 warning.
18661 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18662
9b821a21
PE
18663 * fns.c (internal_equal): Don't assume size_t fits in int.
18664
3c616cfa
PE
18665 * alloc.c (compact_small_strings): Tighten assertion a little.
18666
c2982e87
PE
18667 Replace pEd with more-general pI, and fix some printf arg casts.
18668 * lisp.h (pI): New macro, generalizing old pEd macro to other
18669 conversion specifiers. For example, use "...%"pI"d..." rather
18670 than "...%"pEd"...".
18671 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 18672 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
18673 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18674 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18675 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18676 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18677 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18678 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18679 64-bit hosts.
18680 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18681 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18682 * print.c (safe_debug_print, print_object): Likewise.
18683 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18684 to int.
6f04d126
PE
18685 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18686 avoiding the 0 flag, which is not portable.
c2982e87
PE
18687 * process.c (Fmake_network_process): Use pI to avoid cast.
18688 * region-cache.c (pp_cache): Likewise.
18689 * xdisp.c (decode_mode_spec): Likewise.
18690 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18691 behavior on 64-bit hosts with printf arg.
6f04d126 18692 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
18693 (x_stop_queuing_selection_requests): Likewise.
18694 (x_get_window_property): Don't truncate byte count to an 'int'
18695 when tracing.
0b432f21 18696
5e073ec7
PE
18697 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18698 here, since it parses constructs like leading '-' and spaces,
18699 which are not wanted; and it overflows with large numbers.
18700 Instead, simply match F[0-9]+, which is what is wanted anyway.
18701
36372bf9
PE
18702 * alloc.c: Remove unportable assumptions about struct layout.
18703 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18704 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18705 (allocate_vectorlike, make_pure_vector): Use the new macros,
18706 plus offsetof, to remove unportable assumptions about struct layout.
18707 These assumptions hold on all porting targets that I know of, but
18708 they are not guaranteed, they're easy to remove, and removing them
18709 makes further changes easier.
18710
0b432f21
PE
18711 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18712 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
18713 (string_overrun_cookie): Now const. Use initializers that
18714 don't formally overflow signed char, to avoid warnings.
000098c1
PE
18715 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18716 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
18717 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18718 multiple of sizeof (EMACS_INT); it need not be, if
18719 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 18720 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 18721
895009e1
JB
187222011-04-26 Juanma Barranquero <lekktu@gmail.com>
18723
18724 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18725
6a7a1b0b
TZ
187262011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18727
18728 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 18729 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
18730 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18731
841a1577 187322011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
18733
18734 * lisp.h (Qdebug): List symbol.
895009e1 18735 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
18736 * keyboard.c (debug-on-event): New variable.
18737 (handle_user_signal): Break into debugger when debug-on-event
18738 matches the current signal symbol.
18739
f2d3ba6f
DN
187402011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18741
18742 * alloc.c (check_sblock, check_string_bytes)
18743 (check_string_free_list): Convert to standard C.
18744
42ce4c63
TZ
187452011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18746
18747 * w32.c (emacs_gnutls_push): Fix typo.
18748
825cd63c
EZ
187492011-04-25 Eli Zaretskii <eliz@gnu.org>
18750
fb11d64d
EZ
18751 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18752 "cast to pointer from integer of different size".
18753
825cd63c
EZ
18754 Improve doprnt and its use in verror. (Bug#8545)
18755 * doprnt.c (doprnt): Document the set of format control sequences
18756 supported by the function. Use SAFE_ALLOCA instead of always
18757 using `alloca'.
18758
18759 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18760 is one byte too soon. Don't use xrealloc; instead xfree and
18761 xmalloc anew.
18762
e061a11b
TZ
187632011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18764
18765 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18766 callbacks stage.
18767
18768 * gnutls.c: Renamed global_initialized to
18769 gnutls_global_initialized. Added internals for the
18770 :verify-hostname-error, :verify-error, and :verify-flags
18771 parameters of `gnutls-boot' and documented those parameters in the
18772 docstring. Start callback support.
9173deec
JB
18773 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18774 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18775 on error. Return error code.
e061a11b
TZ
18776 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18777 (emacs_gnutls_read): Likewise.
18778 (Fgnutls_boot): Return handshake error code.
18779 (emacs_gnutls_handle_error): New function.
18780 (wsaerror_to_errno): Likewise.
18781
18782 * w32.h (emacs_gnutls_pull): Add prototype.
18783 (emacs_gnutls_push): Likewise.
18784
18785 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18786 (emacs_gnutls_push): Likewise.
18787
187882011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18789
18790 * process.c (wait_reading_process_output): Check if GnuTLS
18791 buffered some data internally if no FDs are set for TLS
18792 connections.
18793
18794 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18795 (LIBS): Link to USER_LIBS.
18796 ($(BLD)/gnutls.$(0)): New target.
18797
fa6996bc
EZ
187982011-04-24 Eli Zaretskii <eliz@gnu.org>
18799
eb35682e
EZ
18800 * xdisp.c (handle_single_display_spec): Rename the
18801 display_replaced_before_p argument into display_replaced_p, to
18802 make it consistent with the commentary. Fix typos in the
18803 commentary.
18804
e2ad650c
EZ
18805 * textprop.c (syms_of_textprop): Remove dead code.
18806 (copy_text_properties): Delete obsolete commentary about an
18807 interface that was deleted long ago. Fix typos in the description
18808 of arguments.
18809
1b2de274
EZ
18810 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18811 to changes in oldXMenu/XMenu.h from 2011-04-16.
18812 <menu_help_message, prev_menu_help_message>: Constify.
18813 (IT_menu_make_room): menu->help_text is now `const char **';
18814 adjust.
18815
18816 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18817 to changes in oldXMenu/XMenu.h from 2011-04-16.
18818 (struct XMenu): Declare `help_text' `const char **'.
18819
18820 * xfaces.c <Qunspecified>: Make extern again.
18821
18822 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 18823 required by POSIX.
1b2de274 18824
762b15be
EZ
18825 * doc.c (get_doc_string): Improve the format passed to `error'.
18826
18827 * doprnt.c (doprnt): Improve commentary.
18828
18829 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18830
18831 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18832 them with etags.
18833
f1052e5d
EZ
18834 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18835 changes in globals.h immediately force recompilation.
762b15be
EZ
18836 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18837 $(CURDIR)/s/ms-w32.h.
18838 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 18839
fa6996bc
EZ
18840 * character.c (Fchar_direction): Function deleted.
18841 (syms_of_character): Don't defsubr it.
18842 <char-direction-table>: Deleted.
18843
e6c3da20
EZ
188442011-04-23 Eli Zaretskii <eliz@gnu.org>
18845
18846 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18847 * doprnt.c: Include limits.h.
18848 (SIZE_MAX): New macro.
04f2d78b
CB
18849 (doprnt): Return a size_t value. 2nd arg is now size_t.
18850 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
18851 Improve overflow protection. Support `l' modifier for integer
18852 conversions. Support %l conversion. Don't assume an EMACS_INT
18853 argument for integer conversions and for %c.
18854
18855 * lisp.h (doprnt): Restore prototype.
18856
18857 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18858 $(SRC)/character.h.
18859
18860 * Makefile.in (base_obj): Add back doprnt.o.
18861
18862 * deps.mk (doprnt.o): Add back prerequisites.
18863 (callint.o): Depend on character.h.
18864
18865 * eval.c (internal_lisp_condition_case): Include the handler
18866 representation in the error message.
18867 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18868 when breaking from the loop.
18869
18870 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18871
18872 * callint.c (Fcall_interactively): When displaying error message
18873 about invalid control letter, pass the character's codepoint, not
18874 a pointer to its multibyte form. Improve display of the character
18875 in octal and display also its hex code.
18876
18877 * character.c (char_string): Use %x to display the (unsigned)
18878 codepoint of an invalid character, to avoid displaying a bogus
18879 negative value.
18880
18881 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18882 `error', not SYMBOL_NAME itself.
18883
18884 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18885 character arguments to `error'.
18886
18887 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18888 to `error' in error message about FINAL_CHAR argument. Make sure
18889 FINAL_CHAR is a character, and use %c when it is passed as
18890 argument to `error'.
18891
4ffd0d6b 188922011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
18893
18894 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18895
18896 * w32.c: Include <time.h>.
18897 (sys_localtime): New function.
18898
4ffd0d6b 188992011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
18900
18901 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18902
4ffd0d6b 18903 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 18904
4ffd0d6b 189052011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 18906
4ffd0d6b
GM
18907 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18908 zombies (Bug#8467).
aac0c6e3 18909
04c56954
EZ
189102011-04-19 Eli Zaretskii <eliz@gnu.org>
18911
18912 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18913 gl_state.e_property when gl_state.object is Qt.
18914
18915 * insdel.c (make_gap_larger): Remove limitation of buffer size
18916 to <= INT_MAX.
18917
16a43933
CY
189182011-04-18 Chong Yidong <cyd@stupidchicken.com>
18919
18920 * xdisp.c (lookup_glyphless_char_display)
18921 (produce_glyphless_glyph): Handle cons cell entry in
18922 glyphless-char-display.
18923 (Vglyphless_char_display): Document it.
18924
18925 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18926 glyphless-char-display.
18927
4581706e
CY
189282011-04-17 Chong Yidong <cyd@stupidchicken.com>
18929
18930 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18931
18932 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18933
18934 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18935 definition for no-X builds.
18936
4887c6e2 189372011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 18938
fd35b6f9
PE
18939 Static checks with GCC 4.6.0 and non-default toolkits.
18940
5c1ccb01
PE
18941 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18942
006c5daa
PE
18943 * process.c (keyboard_bit_set): Define only if SIGIO.
18944 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18945 (send_process): Repair possible setjmp clobbering.
18946
efc736d3
PE
18947 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18948
4e2fe2e6
PE
18949 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18950
f97334a2
PE
18951 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18952
4e75f29d
PE
18953 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18954 Define only if needed.
18955
90efadd1
PE
18956 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18957 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 18958 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 18959
3c647824
PE
18960 * dispextern.h (struct redisplay_interface): Rename param
18961 to avoid shadowing.
e264f262 18962 * termhooks.h (struct terminal): Likewise.
761383f4 18963 * xterm.c (xembed_send_message): Likewise.
3c647824 18964
b58c5c4a
PE
18965 * insdel.c (make_gap_smaller): Define only if
18966 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18967
cad59032
PE
18968 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18969 it.
18970
c339dc2e
PE
18971 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18972 so that we aren't warned about unused symbols.
18973
91a3e27b
PE
18974 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18975
399c71d3 18976 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 18977
8ffc96f5
PE
18978 * xfns.c (x_real_positions): Mark locals as initialized.
18979
eef9bc79
PE
18980 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18981
098db9dd
PE
18982 * xterm.c: Fix problems found by static analysis with other toolkits.
18983 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
18984 (x_dispatch_event): Declare static if USE_GTK, and
18985 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 18986 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 18987 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
18988 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18989 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 18990
eb18f6cc
PE
18991 * xmenu.c (menu_help_callback): Pointer type fixes.
18992 Use const pointers when pointing at readonly data. Avoid pointer
18993 signedness clashes.
18994 (FALSE): Remove unused macro.
18995 (update_frame_menubar): Remove unused decl.
18996
1fe72bf8
PE
18997 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18998
60d9e1db
PE
18999 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
19000 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
19001 (single_menu_item): Rename local to avoid shadowing.
19002
39261c26
PE
19003 * keyboard.c (make_lispy_event): Remove unused local var.
19004
018c5e19
PE
19005 * frame.c, frame.h (x_get_resource_string): Bring this back, but
19006 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
19007
63d2b86e
PE
19008 * bitmaps: Change bitmaps from unsigned char back to the X11
19009 compatible char. Avoid the old compiler warnings about
19010 out-of-range initializers by using, for example, '\xab' rather
19011 than 0xab.
19012
aefd87e1
PE
19013 * xgselect.c (xgselect_initialize): Check vs interface
19014 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
19015
bf501fb9
PE
19016 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
19017
e9829fdf
PE
19018 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
19019 to read-only memory.
19020
1086c095
PE
19021 * fns.c (vector): Remove; this old hack is no longer needed.
19022
2baccd04 19023 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 19024 Remove unused var.
dde42981 19025 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 19026
72391843 19027 * xrdb.c (x_load_resources): Omit unused local.
3565b346 19028
436c16df 19029 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 19030 (x_window): Rename locals to avoid shadowing.
dc5ddd85 19031 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 19032
92bb796d 19033 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 19034 (x_term_init): Remove local to avoid shadowing.
92bb796d 19035
764430a3 19036 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
19037
19038 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
19039 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
19040
d1dfb56c
EZ
190412011-04-16 Eli Zaretskii <eliz@gnu.org>
19042
c4354cb4
EZ
19043 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
19044
d1dfb56c
EZ
19045 Fix regex.c, syntax.c and friends for buffers > 2GB.
19046 * syntax.h (struct gl_state_s): Declare character position members
19047 EMACS_INT.
19048
19049 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
19050
04f2d78b
CB
19051 * textprop.c (verify_interval_modification, interval_of):
19052 Declare arguments EMACS_INT.
d1dfb56c
EZ
19053
19054 * intervals.c (adjust_intervals_for_insertion): Declare arguments
19055 EMACS_INT.
19056
19057 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
19058
19059 * indent.c (Fvertical_motion): Local variable it_start is now
19060 EMACS_INT.
19061
19062 * regex.c (re_match, re_match_2, re_match_2_internal)
19063 (bcmp_translate, regcomp, regexec, print_double_string)
19064 (group_in_compile_stack, re_search, re_search_2, regex_compile)
19065 (re_compile_pattern, re_exec): Declare arguments and local
19066 variables `size_t' and `ssize_t' and return values `regoff_t', as
19067 appropriate.
19068 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
19069 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
19070 <compile_stack_type>: `size' and `avail' are now `size_t'.
19071
19072 * regex.h <regoff_t>: Use ssize_t, not int.
19073 (re_search, re_search_2, re_match, re_match_2): Arguments that
19074 specify buffer/string position and length are now ssize_t and
19075 size_t. Return type is regoff_t.
19076
613052cd
BK
190772011-04-16 Ben Key <bkey76@gmail.com>
19078
19079 * nsfont.m: Fixed bugs in ns_get_family and
19080 ns_descriptor_to_entity that were caused by using free to
19081 deallocate memory blocks that were allocated by xmalloc (via
19082 xstrdup). This caused Emacs to crash when compiled with
19083 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
19084 --enable-checking=xmallocoverrun). xfree is now used to
19085 deallocate these memory blocks.
19086
4170f62f 190872011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 19088
71b41406
PE
19089 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
19090
9587a89d
PE
19091 emacs_write: Accept and return EMACS_INT for sizes.
19092 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
19093 et seq.
19094 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
19095 Accept and return EMACS_INT.
19096 (emacs_gnutls_write): Return the number of bytes written on
19097 partial writes.
19098 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
19099 (emacs_read, emacs_write): Remove check for negative size, as the
19100 Emacs source code has been audited now.
9587a89d
PE
19101 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
19102 (emacs_read, emacs_write): Use it.
273a5f82
PE
19103 * process.c (send_process): Adjust to the new signatures of
19104 emacs_write and emacs_gnutls_write. Do not attempt to store
19105 a byte offset into an 'int'; it might overflow.
9587a89d 19106 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 19107
3e047f51
PE
19108 * sound.c: Don't assume sizes fit in 'int'.
19109 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 19110 Return EMACS_INT, not int.
3e047f51 19111 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
19112 Accept EMACS_INT, not int.
19113 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
19114 record read return values.
19115
cc39a9db
BK
191162011-04-15 Ben Key <bkey76@gmail.com>
19117
c9d0ec6d
JB
19118 * keyboard.c (Qundefined): Don't declare static since it is used
19119 in nsfns.m.
19120 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
19121 static since they are used in nsfont.m.
cc39a9db 19122
6c60eb9f
SM
191232011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
19124
19125 * process.c (Qprocessp): Don't declare static.
19126 * lisp.h (Qprocessp): Declare again.
19127
7990b61a
JB
191282011-04-15 Juanma Barranquero <lekktu@gmail.com>
19129
19130 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
19131
5d4cb038
PE
191322011-04-14 Paul Eggert <eggert@cs.ucla.edu>
19133
8bd7b830 19134 Improve C-level modularity by making more things 'static'.
cd64ea1d 19135
e3b27b31
PE
19136 Don't publish debugger-only interfaces to other modules.
19137 * lisp.h (safe_debug_print, debug_output_compilation_hack):
19138 (verify_bytepos, count_markers): Move decls to the only modules
19139 that need them.
19140 * region-cache.h (pp_cache): Likewise.
19141 * window.h (check_all_windows): Likewise.
19142 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
19143
5d4cb038
PE
19144 * sysdep.c (croak): Now static, if
19145 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
19146 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
19147
19148 * alloc.c (refill_memory_reserve): Now static if
19149 !defined REL_ALLOC || defined SYSTEM_MALLOC.
19150 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 19151
e87b6180
PE
19152 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
19153 Define only if USE_LUCID.
19154
ac64929e
PE
19155 * xrdb.c (x_customization_string, x_rm_string): Now static.
19156
6f37259d
PE
19157 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
19158 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
19159
1683e3ab
PE
19160 * xdisp.c (draw_row_with_mouse_face): Now static.
19161 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
19162
de9c2632
PE
19163 * window.h (check_all_windows): Mark externally visible.
19164
2b96acb7
PE
19165 * window.c (window_deletion_count): Now static.
19166
19167 * undo.c: Make symbols static if they're not exported.
19168 (last_undo_buffer, last_boundary_position, pending_boundary):
19169 Now static.
19170
50436f33
PE
19171 * textprop.c (interval_insert_behind_hooks): Now static.
19172 (interval_insert_in_front_hooks): Likewise.
19173
64520e5c
PE
19174 * term.c: Make symbols static if they're not exported.
19175 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
19176 (max_frame_lines, tty_set_terminal_modes):
19177 (tty_reset_terminal_modes, tty_turn_off_highlight):
19178 (get_tty_terminal): Now static.
19179 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
19180 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 19181 HAVE_WINDOW_SYSTEM.
64520e5c
PE
19182 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
19183 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
19184
1fa53021
PE
19185 * sysdep.c: Make symbols static if they're not exported.
19186 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
19187 Now static.
19188 (sigprocmask_set, full_mask): Remove; unused.
19189 (wait_debugging): Mark as visible.
19190 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
19191 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
19192
d4b43b22
PE
19193 * syntax.c (syntax_temp): Define only if !__GNUC__.
19194
b7c513d0
PE
19195 * sound.c (current_sound_device, current_sound): Now static.
19196
989b29ad
PE
19197 * search.c (searchbufs, searchbuf_head): Now static.
19198
13a55a78
PE
19199 * scroll.c (scroll_cost): Remove; unused.
19200 * dispextern.h (scroll_cost): Remove decl.
19201
de68a1fc
PE
19202 * region-cache.h (pp_cache): Mark as externally visible.
19203
40ccffa6
PE
19204 * process.c: Make symbols static if they're not exported.
19205 (process_tick, update_tick, create_process, chan_process):
19206 (Vprocess_alist, proc_buffered_char, datagram_access):
19207 (fd_callback_data, send_process_frame, process_sent_to): Now static.
19208 (deactivate_process): Mark defn as static, as well as decl.
19209 * lisp.h (create_process): Remove decl.
19210 * process.h (chan_process, Vprocess_alist): Remove decls.
19211
ad64fc97
PE
19212 * print.c: Make symbols static if they're not exported.
19213 (print_depth, new_backquote_output, being_printed, print_buffer):
19214 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
19215 (print_interval, print_number_index, initial_stderr_stream):
19216 Now static.
19217 * lisp.h (Fprinc): Remove decl.
19218 (debug_output_compilation_hack): Mark as externally visible.
19219
adddb265
PE
19220 * sysdep.c (croak): Move decl from here to syssignal.h.
19221 * syssignal.h (croak): Put it here, so the API can be checked when
19222 'croak' is called from dissociate_if_controlling_tty.
19223
1717ede2
PE
19224 * minibuf.c: Make symbols static if they're not exported.
19225 (minibuf_save_list, choose_minibuf_frame): Now static.
19226 * lisp.h (choose_minibuf_frame): Remove decl.
19227
fa5fb2bc
PE
19228 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
19229
1e3890d1
PE
19230 * lread.c: Make symbols static if they're not exported.
19231 (read_objects, initial_obarray, oblookup_last_bucket_number):
19232 Now static.
19233 (make_symbol): Remove; unused.
19234 * lisp.h (initial_obarray, make_symbol): Remove decls.
19235
8a1414fa
PE
19236 * keyboard.c: Make symbols static if they're not exported.
19237 (single_kboard, recent_keys_index, total_keys, recent_keys):
19238 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
19239 (this_single_command_key_start, echoing, last_auto_save):
19240 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
19241 (command_loop, echo_now, keyboard_init_hook, help_char_p):
19242 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
19243 (Vlispy_mouse_stem, double_click_count):
19244 Now static.
19245 (force_auto_save_soon): Define only if SIGDANGER.
19246 (ignore_mouse_drag_p): Now static if
19247 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
19248 (print_help): Remove; unused.
19249 (stop_character, last_timer_event): Mark as externally visible.
19250 * keyboard.h (ignore_mouse_drag_p): Declare only if
19251 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
19252 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
19253 * lisp.h (echoing): Remove decl.
19254 (force_auto_save_soon): Declare only if SIGDANGER.
19255 * xdisp.c (redisplay_window): Simplify code, to make it more
19256 obvious that ignore_mouse_drag_p is not accessed if !defined
19257 USE_GTK && !defined HAVE_NS.
19258
93ea6e8f
PE
19259 * intervals.c: Make symbols static if they're not exported.
19260 (merge_properties_sticky, merge_interval_right, delete_interval):
19261 Now static.
19262 * intervals.h (merge_interval_right, delete_interval): Remove decls.
19263
77382fcc
PE
19264 * insdel.c: Make symbols static if they're not exported.
19265 However, leave prepare_to_modify_buffer alone. It's never
19266 called from outside this function, but that appears to be a bug.
19267 (combine_after_change_list, combine_after_change_buffer):
4889fc82 19268 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
19269 (adjust_after_replace_noundo): Remove; unused.
19270 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 19271 (signal_before_change): Remove decls.
77382fcc 19272
9306c32e
PE
19273 * indent.c (val_compute_motion, val_vmotion): Now static.
19274
cd44d2eb
PE
19275 * image.c: Make symbols static if they're not exported.
19276 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
19277 if USE_GTK.
19278 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
19279 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
19280
ad9a7a06
PE
19281 * fringe.c (standard_bitmaps): Now static.
19282 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
19283
81626931
PE
19284 * frame.c: Make symbols static if they're not exported.
19285 (x_report_frame_params, make_terminal_frame): Now static.
19286 (get_frame_param): Now static, unless HAVE_NS.
19287 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
19288 (x_get_resource_string): Remove; not used.
19289 * frame.h (make_terminal_frame, x_report_frame_params):
19290 (x_get_resource_string); Remove decls.
19291 (x_fullscreen_adjust): Declare only if WINDOWSNT.
19292 * lisp.h (get_frame_param): Declare only if HAVE_NS.
19293
239f9db9
PE
19294 * font.c, fontset.c: Make symbols static if they're not exported.
19295 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
19296 (FACE_SUITABLE_FOR_CHAR_P): Use it.
19297 * font.c (font_close_object): Now static.
19298 * font.h (font_close_object): Remove.
19299 * fontset.c (FONTSET_OBJLIST): Remove.
19300 (free_realized_fontset) #if-0 the body, which does nothing.
19301 (face_suitable_for_char_p): #if-0, as it's never called.
19302 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
19303 * xfaces.c (face_at_string_position):
19304 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
19305 since 0 is always ASCII.
19306
dfcf3579
PE
19307 * fns.c (weak_hash_tables): Now static.
19308
5045092b
PE
19309 * fileio.c: Make symbols static if they're not exported.
19310 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
19311 (Vwrite_region_annotation_buffers): Now static.
19312
57a96f5c
PE
19313 * eval.c: Make symbols static if they're not exported.
19314 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
19315 * lisp.h (backtrace_list): Remove decl.
19316
35f08c38
PE
19317 * emacs.c: Make symbols static if they're not exported.
19318 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
19319 (fatal_error_code, fatal_error_signal_hook, standard_args):
19320 Now static.
19321 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
19322 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
19323 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
19324 * lisp.h (fatal_error_signal_hook): Remove decl.
19325 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
19326
f44bd759
PE
19327 * editfns.c: Move a (normally-unused) function to its only use.
19328 * editfns.c, lisp.h (get_operating_system_release): Remove.
19329 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
19330 worth the hassle of breaking this out.
19331
b532497d
PE
19332 * xterm.c: Make symbols static if they're not exported.
19333 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
19334 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
19335 (x_destroy_window, x_delete_display):
19336 Now static.
19337 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
19338 (x_mouse_leave): Remove; unused.
19339 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
19340 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
19341 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
19342 Remove decls.
19343 (x_mouse_leave): Declare only if WINDOWSNT.
19344 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
19345 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
19346 USE_X_TOOLKIT.
19347
1675728f
PE
19348 * ftxfont.c: Make symbols static if they're not exported.
19349 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
19350 HAVE_FREETYPE.
19351 * font.h (ftxfont_driver): Likewise.
19352
e4cebfca
PE
19353 * xfns.c: Make symbols static if they're not exported.
19354 (x_last_font_name, x_display_info_for_name):
19355 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
19356 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
19357 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
19358 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
19359 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
19360 (last_show_tip_args): Now static.
19361 (xic_defaut_fontset, xic_create_fontsetname): Define only if
19362 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
19363 (x_screen_planes): Remove; unused.
19364 * dispextern.h (x_screen_planes): Remove decl.
19365
5bf46f05
PE
19366 * dispnew.c: Make symbols static if they're not exported.
19367 * dispextern.h (redraw_garbaged_frames, scrolling):
19368 (increment_row_positions): Remove.
19369 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
19370 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
19371 Now static.
19372 (redraw_garbaged_frames): Remove; unused.
19373
435f4c28
PE
19374 * xfaces.c: Make symbols static if they're not exported.
19375 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
19376 Remove decls.
19377 * xterm.h (defined_color): Remove decls.
19378 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
19379 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
19380 (menu_face_changed_default, defined_color, free_realized_face):
19381 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
19382 (ascii_face_of_lisp_face): Remove; unused.
19383
8524aef3
PE
19384 * xdisp.c: Make symbols static if they're not exported.
19385 * dispextern.h (scratch_glyph_row, window_box_edges):
19386 (glyph_to_pixel_coords, set_cursor_from_row):
19387 (get_next_display_element, set_iterator_to_next):
19388 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
19389 (show_mouse_face): Remove decls
19390 * frame.h (message_buf_print): Likewise.
19391 * lisp.h (pop_message, set_message, check_point_in_composition):
19392 Likewise.
19393 * xterm.h (set_vertical_scroll_bar): Likewise.
19394 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
19395 (message_buf_print, scratch_glyph_row, displayed_buffer):
19396 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
19397 (get_next_display_element, show_mouse_face, window_box_edges):
19398 (frame_to_window_pixel_xy, check_point_in_composition):
19399 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
19400 (glyph_to_pixel_coords): Remove; unused.
19401
16390cd2
PE
19402 * dired.c (file_name_completion): Now static.
19403
19404 * dbusbind.c (xd_in_read_queued_messages): Now static.
19405
a25f4dfa
PE
19406 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19407 * data.c (circular_list_error): Remove.
19408
14a9c8df
PE
19409 * commands.h (last_point_position, last_point_position_buffer):
19410 (last_point_position_window): Remove decls.
19411 * keyboard.c: Make these variables static.
19412
04f2d78b
CB
19413 * coding.h (coding, code_convert_region, encode_coding_gap):
19414 Remove decls.
74ab6df5
PE
19415 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19416 (iso_code_class, detect_coding, code_convert_region): Now static.
19417 (encode_coding_gap): Remove; unused.
19418
38dfbee1
PE
19419 * chartab.c (chartab_chars, chartab_bits): Now static.
19420
a2cb4e63
PE
19421 * charset.h (charset_iso_8859_1): Remove decl.
19422 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19423 Now static.
19424
127198fd
PE
19425 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19426 * ccl.c (Vccl_program_table): Now static.
19427 (check_ccl_update): Remove; unused.
19428
d85b608f
PE
19429 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19430 * category.h: ... from here.
19431 * category.c (check_category_table, set_category_set): Now static.
19432
31cd66f3
PE
19433 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19434 * lisp.h: Remove these decls.
19435
c358e587
PE
19436 * buffer.c (buffer_count): Remove unused var.
19437
e78aecca
PE
19438 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19439 so that it's not optimized away.
19440 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19441 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19442 exported only to the debugger.
19443
e192d7d3 19444 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 19445 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 19446
92470028
PE
19447 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19448 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19449 was inaccessible from Lisp.
19450 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19451 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19452
244ed907
PE
19453 alloc.c: Import and export fewer symbols, and remove unused items.
19454 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19455 is defined.
19456 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19457 it's not optimized away by whole-program optimization.
19458 (message_enable_multibyte, free_misc): Remove.
19459 (catchlist, handlerlist, mark_backtrace):
19460 Declare only if BYTE_MARK_STACK.
19461 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19462 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19463 (message_enable_multibyte): Remove decl.
19464 (free_misc, interval_free_list, float_block, float_block_index):
19465 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19466 (cons_free_list, last_marked_index):
19467 Now static.
19468 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19469 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19470 (mark_backtrace): Define only if BYTE_MARK_STACK.
19471 * xdisp.c (message_enable_multibyte): Now static.
19472
61c2b50e 19473 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
19474 This makes it easier for human readers (and static analyzers)
19475 to see whether these variables are used from other modules.
19476 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19477 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19478 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19479 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19480 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19481 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19482 * xmenu.c, xselect.c:
19483 Declare Q* vars static if they are not used in other modules.
19484 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19485 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19486 Remove decls of unexported vars.
19487 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19488
95c82688
PE
19489 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19490
16a97296
PE
19491 Make Emacs functions such as Fatom 'static' by default.
19492 This makes it easier for human readers (and static analyzers)
19493 to see whether these functions can be called from other modules.
19494 DEFUN now defines a static function. To make the function external
19495 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
19496 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19497 (Finit_image_library):
16a97296
PE
19498 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19499 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19500 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19501 Remove decls, since these functions are now static.
19502 (Funintern, Fget_internal_run_time): New decls, since these functions
19503 were already external.
95c82688 19504
16a97296
PE
19505 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19506 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19507 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19508 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19509 * keyboard.c, keymap.c, lread.c:
19510 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19511 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19512 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19513 Mark functions with DEFUE instead of DEFUN,
19514 if they are used in other modules.
19515 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19516 decls for now-static functions.
19517 * buffer.h (Fdelete_overlay): Remove decl.
19518 * callproc.c (Fgetenv_internal): Mark as internal.
19519 * composite.c (Fremove_list_of_text_properties): Remove decl.
19520 (Fcomposition_get_gstring): New forward static decl.
19521 * composite.h (Fcomposite_get_gstring): Remove decl.
19522 * dired.c (Ffile_attributes): New forward static decl.
19523 * doc.c (Fdocumntation_property): New forward static decl.
19524 * eval.c (Ffetch_bytecode): New forward static decl.
19525 (Funintern): Remove extern decl; now in .h file where it belongs.
19526 * fileio.c (Fmake_symbolic_link): New forward static decl.
19527 * image.c (Finit_image_library): New forward static decl.
19528 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19529 * intervals.h (Fprevious_property_change):
19530 (Fremove_list_of_text_properties): Remove decls.
19531 * keyboard.c (Fthis_command_keys): Remove decl.
19532 (Fcommand_execute): New forward static decl.
19533 * keymap.c (Flookup_key): New forward static decl.
19534 (Fcopy_keymap): Now static.
19535 * keymap.h (Flookup_key): Remove decl.
19536 * process.c (Fget_process): New forward static decl.
19537 (Fprocess_datagram_address): Mark as internal.
19538 * syntax.c (Fsyntax_table_p): New forward static decl.
19539 (skip_chars): Remove duplicate decl.
19540 * textprop.c (Fprevious_property_change): New forward static decl.
19541 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19542 Now internal.
19543 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19544 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19545
785bbd42
PE
19546 * editfns.c (Fformat): Remove unreachable code.
19547
8b913b57
AS
195482011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19549
19550 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19551 change. (Bug#8496)
19552
a6744a35
EZ
195532011-04-13 Eli Zaretskii <eliz@gnu.org>
19554
19555 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19556 when at ZV. (Bug#8487)
19557
e7974947
AS
195582011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19559
baad03f0
AS
19560 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19561 (Bug#8437)
19562 * keyboard.c (parse_tool_bar_item): Likewise.
19563 * sound.c (sound_cleanup, alsa_close): Likewise.
19564 * termcap.c (tgetent): Likewise.
19565 * xfns.c (x_default_font_parameter): Likewise.
19566 * xsettings.c (read_and_apply_settings): Likewise.
19567
e7974947
AS
19568 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19569 (overrun_check_free): Protoize.
19570
28272684
PE
195712011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19572
19573 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19574 since callers should never pass a negative size.
19575 Change the signature to match that of plain 'read' and 'write'; see
19576 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19577 * lisp.h: Update prototypes of emacs_write and emacs_read.
19578
11997c76
EZ
195792011-04-11 Eli Zaretskii <eliz@gnu.org>
19580
19581 * xdisp.c (redisplay_window): Don't try to determine the character
19582 position of the scroll margin if the window start point w->startp
e896f03c 19583 is outside the buffer's accessible region. (Bug#8468)
11997c76 19584
8a2cbd72
EZ
195852011-04-10 Eli Zaretskii <eliz@gnu.org>
19586
19587 Fix write-region and its subroutines for buffers > 2GB.
19588 * fileio.c (a_write, e_write): Modify declaration of arguments and
19589 local variables to support buffers larger than 2GB.
19590 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19591
19592 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19593 argument, local variables, and return value.
19594
19595 * lisp.h: Update prototypes of emacs_write and emacs_read.
19596
19597 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19598
4073e537 195992011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 19600
1ebfdcb6
PE
19601 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19602
b2ded58d
PE
19603 Fix more problems found by GCC 4.6.0's static checks.
19604
7d66342c
PE
19605 * xdisp.c (vmessage): Use a better test for character truncation.
19606
bbf47d44
PE
19607 * charset.c (load_charset_map): <, not <=, for optimization,
19608 and to avoid potential problems with integer overflow.
9248994d 19609 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 19610 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 19611 * editfns.c (Fformat): Likewise.
1e69125e 19612 * syntax.c (skip_chars): Likewise.
3befa583 19613
e3019616
PE
19614 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19615 This also lets GCC 4.6.0 generate slightly better loop code.
19616
becfa255
PE
19617 * callint.c (Fcall_interactively): <, not <=, for optimization.
19618 (Fcall_interactively): Count the number of arguments produced,
19619 not the number of arguments given. This is simpler and lets GCC
19620 4.6.0 generate slightly better code.
19621
dae0cd48
PE
19622 * ftfont.c: Distingish more carefully between FcChar8 and char.
19623 The previous code passed unsigned char * to a functions like
19624 strlen and xstrcasecmp that expect char *, which does not
19625 conform to the C standard.
19626 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19627 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19628 char * when the C standard requires it.
19629
76032d70
PE
19630 * keyboard.c (read_char): Remove unused var.
19631
eb3f1cc8
PE
19632 * eval.c: Port to Windows vsnprintf (Bug#8435).
19633 Include <limits.h>.
19634 (SIZE_MAX): Define if the headers do not.
19635 (verror): Do not give up if vsnprintf returns a negative count.
19636 Instead, grow the buffer. This ports to Windows vsnprintf, which
19637 does not conform to C99. Problem reported by Eli Zaretskii.
19638 Also, simplify the allocation scheme, by avoiding the need for
19639 calling realloc, and removing the ALLOCATED variable.
19640
70476b54
PE
19641 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19642
12020a9e
PE
19643 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19644 But keep the doprint source code for now, as we might revamp it
19645 and use it again (Bug#8435).
ea6c7ae6
PE
19646 * lisp.h (doprnt): Remove.
19647 * Makefile.in (base_obj): Remove doprnt.o.
19648 * deps.mk (doprnt.o): Remove.
19649
5fdb398c
PE
19650 error: Print 32- and 64-bit integers portably (Bug#8435).
19651 Without this change, on typical 64-bit hosts error ("...%d...", N)
19652 was used to print both 32- and 64-bit integers N, which relied on
19653 undefined behavior.
61bdb816 19654 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
19655 * lisp.h (error, verror): Mark as printf-like functions.
19656 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19657 Report overflow in size calculations when allocating printf buffer.
19658 Do not truncate output string at its first null byte.
19659 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19660 Truncate the output at a character boundary, since vsnprintf does not
19661 do that.
19662 * charset.c (check_iso_charset_parameter): Convert internal
19663 character to string before calling 'error', since %c now has the
19664 printf meaning.
19665 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19666 overflow when computing char to be passed to 'error'. Do not
19667 pass Lisp_Object to 'error'; pass the integer instead.
19668 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19669 formatted with plain %d.
19670
b189fa66
PE
19671 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19672
bff87ef0
PE
19673 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19674
7e2cac20
PE
19675 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19676
ce4d90b5
PE
19677 * xterm.c (x_catch_errors): Remove duplicate declaration.
19678
266c9547
PE
19679 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19680
79c49ad2
PE
19681 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19682
368f4090
JM
196832011-04-10 Jim Meyering <meyering@redhat.com>
19684
19685 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19686 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19687 return ssize_t not "int", and use size_t as the buffer length.
19688 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19689 * gnutls.h: Update declarations.
19690 * process.c (read_process_output): Use ssize_t, to match.
19691 (send_process): Likewise.
19692
a32d4040
CY
196932011-04-09 Chong Yidong <cyd@stupidchicken.com>
19694
19695 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19696
8546720e 196972011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 19698
04f2d78b
CB
19699 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19700 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 19701
8546720e
GM
19702 * xterm.c (handle_one_xevent):
19703 * xmenu.c (create_and_show_popup_menu):
19704 * xselect.c (x_decline_selection_request)
19705 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 19706
0a2f5c1a 197072011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
19708
19709 Fix some uses of `int' instead of EMACS_INT.
19710 * search.c (string_match_1, fast_string_match)
19711 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19712 (scan_buffer, find_next_newline_no_quit)
19713 (find_before_next_newline, search_command, Freplace_match)
19714 (Fmatch_data): Make some `int' variables be EMACS_INT.
19715
19716 * xdisp.c (display_count_lines): 3rd argument and return value now
19717 EMACS_INT. All callers changed.
19718 (pint2hrstr): Last argument is now EMACS_INT.
19719
19720 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19721 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19722 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19723 (decode_coding_utf_16, decode_coding_emacs_mule)
19724 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19725 (decode_coding_ccl, decode_coding_charset)
19726 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19727 (decode_coding_iso_2022, decode_coding_emacs_mule)
19728 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19729 <char_offset, last_offset>: Declare EMACS_INT.
19730 (encode_coding_utf_8, encode_coding_utf_16)
19731 (encode_coding_emacs_mule, encode_invocation_designation)
19732 (encode_designation_at_bol, encode_coding_iso_2022)
19733 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19734 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19735 Declare EMACS_INT.
19736 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19737 (encode_invocation_designation): Last argument P_NCHARS is now
19738 EMACS_INT.
19739 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19740 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19741
19742 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19743 All users changed.
19744
19745 * ccl.c (Fccl_execute_on_string): Declare some variables
19746 EMACS_INT.
19747
8546720e 197482011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
19749
19750 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19751
4e19a977
CS
197522011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19753
19754 * process.c (Fformat_network_address): Doc fix.
19755
87302331
R
197562011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19757
ee7683eb 19758 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 19759
cbb59342
CY
197602011-04-08 Chong Yidong <cyd@stupidchicken.com>
19761
19762 * keyboard.c (read_char): Call Lisp function help-form-show,
19763 instead of using internal_with_output_to_temp_buffer.
19764 (Qhelp_form_show): New var.
e0d38eeb 19765 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
19766
19767 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19768
19769 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19770
e67a13ab
CY
197712011-04-06 Chong Yidong <cyd@stupidchicken.com>
19772
04f2d78b
CB
19773 * process.c (Flist_processes): Remove to Lisp.
19774 (list_processes_1): Delete.
e67a13ab 19775
973f782d
EZ
197762011-04-06 Eli Zaretskii <eliz@gnu.org>
19777
7c106b1e
EZ
19778 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19779
973f782d
EZ
19780 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19781
41cf7d1a 197822011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 19783
ca23cc88
PE
19784 Fix more problems found by GCC 4.6.0's static checks.
19785
f390e2d5
PE
19786 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19787
42eea0d0
PE
19788 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19789
b69769da 19790 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 19791
f9541e84
PE
19792 * xdisp.c (vmessage): Mark as a printf-like function.
19793
13841b55
PE
19794 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19795
c136c10f
PE
19796 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19797
5e2d4a30
PE
19798 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19799 printf-like functions.
19800 (tiff_load): Add casts to remove these marks before passing them
19801 to system-supplied API.
19802
583f48b9
PE
19803 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19804
b25d760e
PE
19805 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19806 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
19807 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19808 directly, rather than having caller test rule sign. This avoids
19809 some unnecessary tests.
19810 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19811 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19812 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 19813
bc7b6697 19814 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 19815 (xfont_open): Avoid unnecessary tests.
bc7b6697 19816
27ccc379
PE
19817 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19818
dcd5c89a
PE
19819 * composite.h, composite.c (composition_gstring_put_cache):
19820 Use EMACS_INT, not int, for length.
19821
b13a45c6
PE
19822 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19823 breaking out part of COMPOSITION_DECODE_RULE.
19824 (COMPOSITION_DECODE_RULE): Use it.
19825 * composite.c (get_composition_id): Remove unused local vars,
19826 by using the new macro.
19827
1e792e4d
PE
19828 * textprop.c (set_text_properties_1): Change while to do-while,
19829 since the condition is always true at first.
19830
dc6c6455 19831 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
19832 (interval_deletion_adjustment): Return unsigned value.
19833 All uses changed.
dc6c6455 19834
aba7731a
PE
19835 * process.c (list_processes_1, create_pty, read_process_output):
19836 (exec_sentinel): Remove vars that were set but not used.
afd4052b 19837 (create_pty): Remove unnecessary "volatile"s.
bc57d757 19838 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 19839 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 19840 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 19841
fdfc4bf3
PE
19842 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19843
fca8fe46 19844 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 19845 (update_syntax_table): Use unsigned instead of int.
fca8fe46 19846
06a0259a 19847 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 19848 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 19849 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 19850
e7b9e80f
PE
19851 * print.c (print_error_message): Avoid int overflow.
19852
56201685
PE
19853 * font.c (font_list_entities): Redo for clarity,
19854 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19855
78834453 19856 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 19857 (font_score): Avoid potential overflow in diff calculation.
78834453 19858
0bc0b309 19859 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 19860 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 19861
e610eaca
PE
19862 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19863
b895abce
PE
19864 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19865 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19866 can always succeed if overflow has undefined behavior.
19867
1f1d9321 19868 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 19869 (wordify): Omit three unnecessary tests.
1f1d9321 19870
c59478bc
PE
19871 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19872 All callers changed. This avoids the need for an unused var.
19873
79b73827
PE
19874 * casefiddle.c (casify_region): Remove var that is set but not used.
19875
a4db5dfe
PE
19876 * dired.c (file_name_completion): Remove var that is set but not used.
19877
43aae36e
PE
19878 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19879
2a47c44d 19880 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 19881 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 19882
a37c69bf
PE
19883 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19884 Check for integer overflow on size calculations.
19885
328ab8e7
PE
19886 * buffer.c (Fprevious_overlay_change): Remove var that is set
19887 but not used.
19888
e5a2a5cb
PE
19889 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19890 Remove vars that are set but not used.
8d84a6eb 19891 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 19892 (timer_check_2): Mark vars as initialized.
e5a2a5cb 19893
a60e5f68
PE
19894 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19895
f661cb61 19896 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 19897 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 19898
f0397f5a
PE
19899 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19900 that are set but not used.
19901
8664db06 19902 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 19903 if XCreateBitmapFromData fails (Bug#8410).
8664db06 19904
6abdaa4a
PE
19905 * xselect.c (x_get_local_selection, x_handle_property_notify):
19906 Remove vars that are set but not used.
19907
0ce7538d 19908 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 19909 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 19910
9ae848fc
PE
19911 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19912 Remove var that is set but not used.
0b918413
PE
19913 (scroll_bar_windows_size): Now size_t, not int.
19914 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19915 Check for overflow.
9ae848fc 19916
a5a62657
PE
19917 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19918 (map_tty_color) [!defined MSDOS]: Likewise.
19919
5c5cdd39
PE
19920 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19921
66ebf983
PE
19922 * coding.c: Remove vars that are set but not used.
19923 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19924 All callers changed.
19925 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19926 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19927 (decode_coding_charset): Remove vars that are set but not used.
19928
1be4d761
PE
19929 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19930 that is set but not used.
19931
47553fa8
PE
19932 * print.c (print_object): Remove var that is set but not used.
19933
1f7196bf 19934 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
19935 The gnulib version avoids calling malloc in the usual case,
19936 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19937 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19938 * filelock.c (current_lock_owner): Likewise.
19939 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19940 * sysdep.c: Include allocator.h, careadlinkat.h.
19941 (emacs_no_realloc_allocator): New static constant.
19942 (emacs_readlink): New function.
fdb61804
PE
19943 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19944 ../lib/careadlinkat.h.
d1fdcab7 19945
f84c17c7
SM
199462011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19947
19948 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19949 first non-nil return value).
19950
ef3862ad
JD
199512011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19952
19953 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19954 if not defined (Bug#8403).
19955
376a7006
JB
199562011-04-02 Juanma Barranquero <lekktu@gmail.com>
19957
19958 * xdisp.c (display_count_lines): Remove parameter `start',
19959 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19960 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19961 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19962 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19963 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19964 and thereabouts. All callers changed.
19965 (get_per_char_metric): Remove parameter `f', unused since
19966 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19967
6ca3801d
JM
199682011-04-02 Jim Meyering <meyering@redhat.com>
19969
19970 do not dereference NULL upon failed strdup
19971 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19972 (ns_get_family): Likewise.
19973
d8e2b5ba
JB
199742011-04-02 Juanma Barranquero <lekktu@gmail.com>
19975
19976 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19977
8c74fcbd
JD
199782011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19979
19980 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19981 later (Bug#8403).
19982
7200d79c
SM
199832011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19984
03408648 19985 Add lexical binding.
7200d79c 19986
03408648
SM
19987 * window.c (Ftemp_output_buffer_show): New fun.
19988 (Fsave_window_excursion):
19989 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19990
19991 * lread.c (lisp_file_lexically_bound_p): New function.
19992 (Fload): Bind Qlexical_binding.
19993 (readevalloop): Remove `evalfun' arg.
19994 Bind Qinternal_interpreter_environment.
19995 (Feval_buffer): Bind Qlexical_binding.
19996 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19997 Mark as dynamic.
19998 (syms_of_lread): Declare `lexical-binding'.
19999
20000 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
20001
20002 * keyboard.c (eval_dyn): New fun.
20003 (menu_item_eval_property): Use it.
ca105506
SM
20004
20005 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 20006
03408648
SM
20007 * fns.c (concat, mapcar1): Accept byte-code-functions.
20008
20009 * eval.c (Fsetq): Handle lexical vars.
20010 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
20011 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
20012 (FletX, Flet): Obey lexical binding.
20013 (Fcommandp): Handle closures.
20014 (Feval): New `lexical' arg.
20015 (eval_sub): New function extracted from Feval. Use it almost
20016 everywhere where Feval was used. Look up vars in lexical env.
20017 Handle closures.
20018 (Ffunctionp): Move from subr.el.
20019 (Ffuncall): Handle closures.
20020 (apply_lambda): Remove `eval_flags'.
20021 (funcall_lambda): Handle closures and new byte-code-functions.
20022 (Fspecial_variable_p): New function.
20023 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
20024 but without exporting it to Lisp.
23aba0ea 20025
23aba0ea 20026 * doc.c (Fdocumentation, store_function_docstring):
03408648 20027 * data.c (Finteractive_form): Handle closures.
23aba0ea 20028
03408648
SM
20029 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
20030 interactive spec.
ba83908c 20031
04f2d78b
CB
20032 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
20033 New byte-codes.
03408648
SM
20034 (exec_byte_code): New function extracted from Fbyte_code to handle new
20035 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 20036
03408648 20037 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 20038
03408648 20039 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 20040
e2abce01
JB
200412011-03-31 Juanma Barranquero <lekktu@gmail.com>
20042
20043 * xdisp.c (redisplay_internal): Fix prototype.
20044
63696a73 200452011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 20046
63696a73 20047 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
20048 (try_scrolling): Use it when setting scroll_limit.
20049 Limit scrolling to 100 screen lines.
63696a73
EZ
20050 (redisplay_window): Even when falling back on "recentering",
20051 position point in the window according to scroll-conservatively,
20052 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
20053
20054 (try_scrolling): When point is above the window, allow searching
20055 as far as scroll_max, or one screenful, to compute vertical
20056 distance from PT to the scroll margin position. This prevents
20057 try_scrolling from unnecessarily failing when
20058 scroll-conservatively is set to a value slightly larger than the
20059 window height. Clean up the case of PT below the margin at bottom
20060 of window: scroll_max can no longer be INT_MAX. When aggressive
20061 scrolling is in use, don't let point enter the opposite scroll
20062 margin as result of the scroll.
20063 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
20064 threshold of 100 lines for never-recentering scrolling.
20065
e4cc2dfc
JB
200662011-03-31 Juanma Barranquero <lekktu@gmail.com>
20067
20068 * dispextern.h (move_it_by_lines):
20069 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
20070 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
20071 (message_log_check_duplicate): Remove parameters `prev_bol' and
20072 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
20073 (redisplay_internal): Remove parameter `preserve_echo_area',
20074 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
20075
20076 * indent.c (Fvertical_motion):
20077 * window.c (window_scroll_pixel_based, Frecenter):
20078 Don't pass `need_y_p' to `move_it_by_lines'.
20079
1c470562
SM
200802011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
20081
44f230aa
SM
20082 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
20083 steal a few bits to be more compact.
20084 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
20085 Remove unneeded casts.
20086
1c470562
SM
20087 * bytecode.c (Fbyte_code): CAR and CDR can GC.
20088
888adce9
ZK
200892011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
20090
20091 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
20092 binding" message (bug#7967).
20093
f838ed7b
PE
200942011-03-30 Paul Eggert <eggert@cs.ucla.edu>
20095
77861b95
PE
20096 Fix more problems found by GCC 4.6.0's static checks.
20097
de6dbc14
PE
20098 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
20099 Remove unused local var.
20100
f838ed7b
PE
20101 * editfns.c (Fmessage_box): Remove unused local var.
20102
792c7b2b
PE
20103 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
20104 (note_mode_line_or_margin_highlight, note_mouse_highlight):
20105 Omit unused local vars.
c499e557 20106 * window.c (shrink_windows): Omit unused local var.
b01a1c29 20107 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
20108 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
20109 Omit unused local var.
20110
ba0165e1
PE
20111 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
20112 Don't assume string length fits in int.
32ad8845 20113 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 20114 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 20115
3c59b4c9
PE
20116 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
20117 instead of alloca (Bug#8344).
20118
a3eed478 20119 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 20120 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 20121
eb4d412d
PE
20122 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
20123
1658b401
PE
20124 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
20125 concerns.
20126
20127 * term.c (produce_glyphless_glyph): Remove unnecessary test.
20128
20129 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 20130
9a2c6e05
PE
20131 * keyboard.c (syms_of_keyboard): Use the same style as later
20132 in this function when indexing through an array. This also
20133 works around GCC bug 48267.
20134
03d0a109
PE
20135 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
20136
44f730c8
PE
20137 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
20138
fe75f926
PE
20139 * chartab.c (sub_char_table_ref_and_range): Redo for slight
20140 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
20141
ffa8c828
PE
20142 * keyboard.c, keyboard.h (num_input_events): Now size_t.
20143 This avoids undefined behavior on integer overflow, and is a bit
20144 more convenient anyway since it is compared to a size_t variable.
20145
c5101a77
PE
20146 Variadic C functions now count arguments with size_t, not int.
20147 This avoids an unnecessary limitation on 64-bit machines, which
20148 caused (substring ...) to crash on large vectors (Bug#8344).
20149 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
20150 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 20151 All variadic functions and their callers changed accordingly.
c5101a77
PE
20152 (struct gcpro.nvars): Now size_t, not int. All uses changed.
20153 * data.c (arith_driver, float_arith_driver): Likewise.
20154 * editfns.c (general_insert_function): Likewise.
20155 * eval.c (struct backtrace.nargs, interactive_p)
20156 (internal_condition_case_n, run_hook_with_args, apply_lambda)
20157 (funcall_lambda, mark_backtrace): Likewise.
20158 * fns.c (concat): Likewise.
20159 * frame.c (x_set_frame_parameters): Likewise.
20160 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
20161 0 if not found, not -1. All callers changed.
20162
dd3f25f7
PE
20163 * alloc.c (garbage_collect): Don't assume stack size fits in int.
20164 (stack_copy_size): Now size_t, not int.
20165 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
20166
461c2ab9
JB
201672011-03-28 Juanma Barranquero <lekktu@gmail.com>
20168
20169 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
20170 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20171 All callers changed.
20172
20173 * lisp.h (multibyte_char_to_unibyte):
20174 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
20175 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20176 * character.h (CHAR_TO_BYTE8):
20177 * cmds.c (internal_self_insert):
20178 * editfns.c (general_insert_function):
20179 * keymap.c (push_key_description):
20180 * search.c (Freplace_match):
20181 * xdisp.c (message_dolog, set_message_1): All callers changed.
20182
f6d62986
SM
201832011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
20184
20185 * keyboard.c (safe_run_hook_funcall): New function.
20186 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
20187 don't set the hook to nil, but remove the offending function instead.
20188 (Qcommand_hook_internal): Remove, unused.
20189 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
20190 Vcommand_hook_internal.
20191
20192 * eval.c (enum run_hooks_condition): Remove.
20193 (funcall_nil, funcall_not): New functions.
20194 (run_hook_with_args): Call each function through a `funcall' argument.
20195 Remove `cond' argument, now redundant.
20196 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
20197 (Frun_hook_with_args_until_failure): Adjust accordingly.
20198 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
20199
1db5b1ad
JB
202002011-03-28 Juanma Barranquero <lekktu@gmail.com>
20201
20202 * dispextern.h (string_buffer_position): Remove declaration.
20203
20204 * print.c (strout): Remove parameter `multibyte', unused since
20205 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
20206
20207 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
20208 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
20209 All callers changed.
20210
20211 * w32.c (_wsa_errlist): Use braces for struct initializers.
20212
20213 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
20214 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
20215 All callers changed.
20216 (string_buffer_position): Likewise. Also, make static (it's never
20217 used outside xdisp.c).
20218 (cursor_row_p): Remove parameter `w', unused since
20219 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
20220 (decode_mode_spec): Remove parameter `precision', introduced during
20221 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
20222 All callers changed.
20223
5ffb62aa
JD
202242011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20225
20226 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
20227
461c2ab9 202282011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
20229
20230 * nsterm.m (ns_menu_bar_is_hidden): New variable.
20231 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
20232 (ns_update_auto_hide_menu_bar): New functions.
20233 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
20234 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
20235 ns_constrain_all_frames.
20236 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
20237 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
20238
5c380ffb
JD
202392011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20240
20241 * nsmenu.m (runDialogAt): Remove argument to timer_check.
20242
9af30bdf
GM
202432011-03-27 Glenn Morris <rgm@gnu.org>
20244
20245 * syssignal.h: Replace RETSIGTYPE with void.
20246 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
20247 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
20248 Replace SIGTYPE with void everywhere.
20249 * s/usg5-4-common.h (SIGTYPE): Remove definition.
20250 * s/template.h (SIGTYPE): Remove commented out definition.
20251
e2abce01
JB
202522011-03-26 Eli Zaretskii <eliz@gnu.org>
20253
20254 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
20255 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
20256
f868cd8a
JB
202572011-03-26 Juanma Barranquero <lekktu@gmail.com>
20258
59eb0929
JB
20259 * w32.c (read_unc_volume): Use parameter `henum', instead of
20260 global variable `wget_enum_handle'.
20261
20262 * keymap.c (describe_vector): Remove parameters `indices' and
20263 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
20264 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
20265
f868cd8a
JB
20266 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
20267
20268 * keyboard.c (timer_check): Remove parameter `do_it_now',
20269 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
20270 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
20271 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
20272
20273 * keyboard.c (read_char):
20274 * w32menu.c (w32_menu_display_help):
20275 * xmenu.c (show_help_event, menu_help_callback):
20276 Adjust calls to `show_help_echo'.
20277
20278 * gtkutil.c (xg_maybe_add_timer):
20279 * keyboard.c (readable_events):
20280 * process.c (wait_reading_process_output):
20281 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
20282
20283 * insdel.c (adjust_markers_gap_motion):
20284 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
20285 (gap_left, gap_right): Don't call it.
20286
2ecf6fdb
CY
202872011-03-25 Chong Yidong <cyd@stupidchicken.com>
20288
20289 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
20290 incurred during fontification.
20291
6b1f9ba4
JB
202922011-03-25 Juanma Barranquero <lekktu@gmail.com>
20293
20294 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
20295 (DEFVAR_PER_BUFFER): Don't pass it.
20296
20297 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
20298 (scrolling_window): Don't pass it.
20299
0f4a96b5
JB
203002011-03-25 Juanma Barranquero <lekktu@gmail.com>
20301
20302 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
20303
20304 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
20305 and `suffix'.
20306 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
20307 of variables specific to SELinux and computation of `encoded_absname'.
20308
20309 * image.c (XPutPixel): Remove unused variable `height'.
20310
20311 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
20312
20313 * unexw32.c (get_section_info): Remove unused variable `section'.
20314
20315 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
20316 (system_process_attributes): Remove unused variable `sess'.
20317 (sys_read): Remove unused variable `err'.
20318
20319 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
20320 (w32_wnd_proc): Remove unused variable `isdead'.
20321 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
20322 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
20323 (x_create_tip_frame): Remove unused variable `tem'.
20324
20325 * w32inevt.c (w32_console_read_socket):
20326 Remove unused variable `no_events'.
20327
20328 * w32term.c (x_draw_composite_glyph_string_foreground):
20329 Remove unused variable `width'.
20330
1149507c
JB
203312011-03-24 Juanma Barranquero <lekktu@gmail.com>
20332
20333 * w32term.c (x_set_glyph_string_clipping):
20334 Don't pass uninitialized region to CombineRgn.
20335
9c88f339
JB
203362011-03-23 Juanma Barranquero <lekktu@gmail.com>
20337
20338 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
20339 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
20340 (Fx_close_connection): Remove unused variable `i'.
20341
20342 * w32font.c (w32font_draw): Return number of glyphs.
20343 (w32font_open_internal): Remove unused variable `i'.
20344 (w32font_driver): Add missing initializer.
20345
20346 * w32menu.c (utf8to16): Remove unused variable `utf16'.
20347 (fill_in_menu): Remove unused variable `items_added'.
20348
20349 * w32term.c (last_mouse_press_frame): Remove static global variable.
20350 (w32_clip_to_row): Remove unused variable `f'.
20351 (x_delete_terminal): Remove unused variable `i'.
20352
20353 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
20354 (NOTHING): Remove unused static global variable.
20355 (uniscribe_check_otf): Remove unused variable `table'.
20356 (uniscribe_font_driver): Add missing initializers.
20357
dee091a3
JD
203582011-03-23 Julien Danjou <julien@danjou.info>
20359
20360 * term.c (Fsuspend_tty, Fresume_tty):
20361 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
20362 * window.c (temp_output_buffer_show):
20363 * insdel.c (signal_before_change):
20364 * frame.c (Fhandle_switch_frame):
20365 * fileio.c (Fdo_auto_save):
20366 * emacs.c (Fkill_emacs):
20367 * editfns.c (save_excursion_restore):
20368 * cmds.c (internal_self_insert):
20369 * callint.c (Fcall_interactively):
20370 * buffer.c (Fkill_all_local_variables):
20371 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
20372 Use Frun_hooks.
0f4a96b5 20373 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 20374 unconditionally since it does the check itself.
dee091a3 20375
2c520ab5 203762011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 20377
c9c49752
PE
20378 Fix more problems found by GCC 4.5.2's static checks.
20379
8abc3f12
PE
20380 * coding.c (encode_coding_raw_text): Avoid unnecessary test
20381 the first time through the loop, since we know p0 < p1 then.
20382 This also avoids a gcc -Wstrict-overflow warning.
20383
a2d26660
PE
20384 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
20385 leading to a memory leak, possible in functions like
20386 load_charset_map_from_file that can allocate an unbounded number
b12ef411 20387 of objects (Bug#8318).
a2d26660 20388
916c72e9
PE
20389 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
20390 that could (at least in theory) be that large.
20391
19ab8a18
PE
20392 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
20393 This is less likely to overflow, and avoids undefined behavior if
20394 overflow does occur. All callers changed. Use strtoul to scan
20395 for the unsigned long integer.
b7cbbd6f
PE
20396 (pint2hrstr): Simplify and tune code slightly.
20397 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 20398
f0641eff
PE
20399 * scroll.c (do_scrolling): Work around GCC bug 48228.
20400 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
20401
7f650bb9
PE
20402 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
20403 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
20404 (validate_x_resource_name): Simplify count usage.
20405 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 20406
37dd57d1
PE
20407 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20408 fail (Bug#8306).
81e56e61 20409
699979fc 20410 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 20411
401bf9b4
PE
20412 * process.c (Fmake_network_process): Use socklen_t, not int,
20413 where POSIX says socklen_t is required in portable programs.
20414 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 20415 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
20416 (Fmake_network_process, server_accept_connection):
20417 (wait_reading_process_output, read_process_output):
20418 Likewise.
20419
b93aacde
PE
20420 * process.c: Rename or move locals to avoid shadowing.
20421 (list_processes_1, Fmake_network_process):
20422 (read_process_output_error_handler, exec_sentinel_error_handler):
20423 Rename or move locals.
4dc343ee 20424 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 20425 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 20426 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 20427 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 20428 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 20429
af8a867c 20430 Make tparam.h and terminfo.c consistent.
44f230aa
SM
20431 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20432 Include tparam.h instead, since it declares them.
af8a867c
PE
20433 * cm.h (PC): Remove extern decl; tparam.h now does this.
20434 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20435 * terminfo.c: Include tparam.h, to check interfaces.
20436 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20437 (tparam): Adjust signature to match interface in tparam.h;
20438 this removes some undefined behavior. Check that outstring and len
20439 are zero, which they always are with Emacs.
20440 * tparam.h (PC, BC, UP): New extern decls.
20441
0248044d 20442 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 20443 (xftfont_open): Rename locals to avoid shadowing.
0248044d 20444
8ff096c1 20445 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
20446 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20447 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 20448 (ftfont_list): Remove unused local.
49eaafba
PE
20449 (get_adstyle_property, ftfont_pattern_entity):
20450 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20451 Rename locals to avoid shadowing.
8ff096c1 20452
e2be39f6
PE
20453 * xfont.c (xfont_list_family): Mark var as initialized.
20454
c9735e30
PE
20455 * xml.c (make_dom): Now static.
20456
8f5201ae
PE
20457 * composite.c (composition_compute_stop_pos): Rename local to
20458 avoid shadowing.
b246f932
PE
20459 (composition_reseat_it): Remove unused locals.
20460 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 20461 (composition_update_it): Mark var as initialized.
11b61122
PE
20462 (find_automatic_composition): Mark vars as initialized,
20463 with a FIXME (Bug#8290).
8f5201ae 20464
760fbc2c
PE
20465 character.h: Rename locals to avoid shadowing.
20466 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20467 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20468 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20469 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20470 to avoid shadowing.
20471
ff08eb85
PE
20472 * textprop.c (property_change_between_p): Remove; unused.
20473
fc7bf025
PE
20474 * intervals.c (interval_start_pos): Now static.
20475
235d7abc
PE
20476 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20477
44f230aa
SM
20478 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20479 Rename locals to avoid shadowing.
3e7d6594 20480
50060332
PE
20481 * sound.c (wav_play, au_play, Fplay_sound_internal):
20482 Fix pointer signedness.
d01f234b 20483 (alsa_choose_format): Remove unused local var.
c83b8872
PE
20484 (wav_play): Initialize a variable to 0, to prevent undefined
20485 behavior (Bug#8278).
50060332 20486
c4fc4e30
PE
20487 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20488
918436ed
PE
20489 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20490
c939f91b
PE
20491 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20492 clobbering (Bug#8298).
b9c7f648
PE
20493 * sysdep.c (sys_subshell): Likewise.
20494 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 20495
6bd8c144
PE
20496 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20497 This should get cleaned up, so that child_setup has the
20498 same signature on all platforms.
20499
7710357c 20500 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 20501 (relocate_fd): Rename locals to avoid shadowing.
7710357c 20502
c59da222
CY
205032011-03-22 Chong Yidong <cyd@stupidchicken.com>
20504
20505 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20506 not to be necessary, and produces flickering.
20507
66b87493
GM
205082011-03-20 Glenn Morris <rgm@gnu.org>
20509
20510 * config.in: Remove file.
20511
45b6f6d5
JB
205122011-03-20 Juanma Barranquero <lekktu@gmail.com>
20513
20514 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20515 are now in src/globals.h.
20516 (syms_of_minibuf): Remove spurious & from previous change.
20517
cd394be1 205182011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
20519
20520 * minibuf.c (completing-read-function): New variable.
20521 (completing-read-default): Rename from completing-read.
20522 (completing-read): Call completing-read-function.
20523
b14e3e21
CY
205242011-03-19 Juanma Barranquero <lekktu@gmail.com>
20525
20526 * xfaces.c (Fx_load_color_file):
20527 Read color file from absolute filename (bug#8250).
20528
f2b726e6
JB
205292011-03-19 Juanma Barranquero <lekktu@gmail.com>
20530
20531 * makefile.w32-in: Update dependencies.
20532
09f6ff02
EZ
205332011-03-17 Eli Zaretskii <eliz@gnu.org>
20534
20535 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20536
29a6015a
PE
205372011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20538
a3a6c54e
PE
20539 Fix more problems found by GCC 4.5.2's static checks.
20540
b766f867
PE
20541 * process.c (make_serial_process_unwind, send_process_trap):
20542 (sigchld_handler): Now static.
20543
be02381c
PE
20544 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20545 That way, the code declares only the vars that it needs.
20546 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20547 * s/cygwin.h (PTY_ITERATION): Likewise.
20548 * s/darwin.h (PTY_ITERATION): Likewise.
20549 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20550
57048744
PE
20551 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20552 * process.c (allocate_pty): Don't declare stb unless it's needed.
20553
7914961c 20554 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
20555 (CONSTANTLIM): Remove; unused.
20556 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20557 Define only if needed.
7914961c 20558
b3967b18
PE
20559 * unexelf.c (unexec): Name an expression,
20560 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
20561 Use a different way to cause a compilation error if anyone uses
20562 n rather than nn, a way that does not involve shadowing.
73366a00 20563 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 20564
29a6015a
PE
20565 * deps.mk (unexalpha.o): Remove; unused.
20566
43cfc33e 20567 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 20568 * unexec.h: New file.
ce701a33
PE
20569 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20570 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20571 Depend on unexec.h.
20572 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20573 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20574 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 20575 Change as necessary to match prototype in unexec.h.
ce701a33 20576
01f44d5a
PE
20577 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20578 shadowing.
4f63c6bb 20579 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 20580
a6670b0b
PE
20581 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20582 Rename locals to avoid shadowing.
20583
cef2010d 20584 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 20585 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 20586
d4d7173a
PE
20587 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20588
f08b802a
PE
20589 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20590 warning when compiling print.c.
20591
3ddb0639
PE
20592 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20593 instead of using an uninitialized var.
5ad03b97 20594 (font_sort_entities): Mark var as initialized.
3ddb0639 20595
170a2692
PE
20596 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20597
e663c700
PE
20598 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20599 pointers to constants.
89bc529a 20600 (font_parse_fcname): Remove unused vars.
7b81e2d0 20601 (font_delete_unmatched): Now static.
ea838e10 20602 (font_get_spec): Remove; unused.
13a547c6
PE
20603 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20604 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20605 Rename or move locals to avoid shadowing.
e663c700 20606
2a80c887 20607 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 20608 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 20609
1384fa33 20610 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 20611 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 20612
8b2c52e9
PE
20613 * alloc.c (mark_backtrace): Move decl from here ...
20614 * lisp.h: ... to here, so that it can be checked.
20615
475545b5 20616 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 20617 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
20618 (lisp_indirect_variable): Name an expression,
20619 to avoid gcc -Wbad-function-cast warning.
1faed8ae 20620 (Fdefvar): Rename locals to avoid shadowing.
475545b5 20621
b1349114 20622 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 20623 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 20624 Use const pointer when appropriate.
b1349114 20625
a2928364
PE
20626 * lisp.h (get_system_name, get_operating_system_release):
20627 Move decls here, to check interfaces.
20628 * process.c (get_operating_system_release): Move decl to lisp.h.
20629 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
20630 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20631 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20632 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
20633 (Fformat_time_string, Fencode_time, Finsert_char):
20634 (Ftranslate_region_internal, Fformat):
20635 Rename or remove local vars to avoid shadowing.
9710023e 20636 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 20637
a415e694
PE
20638 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20639 avoid shadowing.
20640
8ef4622d
PE
20641 * lisp.h (eassert): Check that the argument compiles, even if
20642 ENABLE_CHECKING is not defined.
20643
946f9a5b
PE
20644 * data.c (Findirect_variable): Name an expression, to avoid
20645 gcc -Wbad-function-cast warning.
112396d6 20646 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 20647 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
20648 (Fmake_variable_buffer_local, Fmake_local_variable):
20649 Mark variables as initialized.
52746918 20650 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 20651
e5aab7e7 20652 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
20653 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20654 Rename locals to avoid shadowing.
dff45157
PE
20655 (mark_stack): Move local variables into the #ifdef region where
20656 they're used.
7bc26fdb
PE
20657 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20658 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20659 needed otherwise.
20660 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20661 (GC_STRING_CHARS): Remove; not used.
d40d4be1 20662 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 20663
e5aab7e7
PE
20664 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20665 avoids undefined behavior in theory.
20666
4da60324
PE
20667 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20668
88043301
PE
20669 Use functions, not macros, for up- and down-casing (Bug#8254).
20670 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20671 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20672 to use the following functions instead of these macros.
20673 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20674 EMACS_INT, since callers assume the returned value fits in int.
20675 (upcase1): Likewise, for UPCASE_TABLE.
20676 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 20677 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 20678 the race-condition problem in the old DOWNCASE.
88043301 20679
19ed5445
PE
20680 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20681 Rename locals to avoid shadowing.
20682 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
20683 (regex_compile, re_search_2, re_match_2_internal):
20684 Remove unused local vars.
952db0d7
PE
20685 (FREE_VAR): Rewrite so as not to use empty "else",
20686 which gcc can warn about.
da053e48 20687 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
20688 (RETALLOC_IF): Define only if needed.
20689 (WORDCHAR_P): Likewise. This one is never needed, but is used
20690 only in a comment talking about a compiler bug, so put inside
20691 the #if 0 of that comment.
20692 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20693 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20694 Remove; unused.
19ed5445 20695
1f3561e4 20696 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
20697 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20698 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 20699
ded6f8f7
PE
20700 * search.c (simple_search): Remove unused var.
20701
dbd37a95
PE
20702 * dired.c (compile_pattern): Move decl from here ...
20703 * lisp.h: ... to here, so that it can be checked.
20704 (struct re_registers): New forward decl.
20705
7e47afad
PE
20706 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20707
85f24f61
PE
20708 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20709 All uses changed.
20710 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20711 Rename locals to avoid shadowing.
5671df8f 20712 (Fvertical_motion): Mark locals as initialized.
85f24f61 20713
181aa2be 20714 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 20715 (casify_region): Mark local as initialized.
181aa2be 20716
930d429c
PE
20717 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20718
7082eac6
PE
20719 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20720 New macros, so that the caller can use some names other than
20721 gcpro1, gcpro2, etc.
20722 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20723 of the new macros.
20724 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20725 argument, for consistency with GCPRO2_VAR, etc: it is now the
20726 prefix of the variable, not the variable itself. All uses
20727 changed.
38b2c076
PE
20728 * dired.c (directory_files_internal, file_name_completion):
20729 Rename locals to avoid shadowing.
20730
15206ed9
PE
20731 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20732 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20733 dired.c's scmp function, had undefined behavior.
20734 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20735 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20736 * buffer.h: ... to here, because these macros use current_buffer,
20737 and the new implementation with inline functions needs to have
20738 current_buffer in scope now, rather than later when the macros
20739 are used.
20740 (downcase, upcase1): New static inline functions.
20741 (DOWNCASE, UPCASE1): Reimplement using these functions.
20742 This avoids undefined behavior in expressions like
20743 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20744 from race conditions in accessing the global variables
20745 case_temp1 and case_temp2.
20746 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20747 * lisp.h (case_temp1, case_temp2): Remove their decls.
20748 * character.h (ASCII_CHAR_P): Move from here ...
20749 * lisp.h: ... to here, so that the inline functions mentioned
20750 above can use them.
20751
4a6bea26
PE
20752 * dired.c (directory_files_internal_unwind): Now static.
20753
f14b7e14
PE
20754 * fileio.c (file_name_as_directory, directory_file_name):
20755 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20756 Now static.
2893f146
PE
20757 (file_name_as_directory): Use const pointers when appropriate.
20758 (Fexpand_file_name): Likewise. In particular, newdir might
20759 point at constant storage, so make it a const pointer.
fd4ead52 20760 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
20761 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20762 signedness issues.
f839df0c
PE
20763 (Fset_file_times, Finsert_file_contents, auto_save_error):
20764 Rename locals to avoid shadowing.
f14b7e14 20765
5716756e 20766 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
20767 (Ftry_completion, Fall_completions): Rename or remove locals
20768 to avoid shadowing.
5716756e 20769
b4c3046a
PE
20770 * marker.c (bytepos_to_charpos): Remove; unused.
20771
b45db522
PE
20772 * lisp.h (verify_bytepos, count_markers): New decls,
20773 so that gcc does not warn that these functions aren't declared.
20774
85876d07
PE
20775 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20776 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 20777 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 20778 (copy_text): Remove unused local var.
85876d07 20779
03d78a21 20780 * filelock.c (within_one_second): Now static.
b3dd38ab 20781 (lock_file_1): Rename local to avoid shadowing.
03d78a21 20782
5df8f01b
PE
20783 * buffer.c (fix_overlays_before): Mark locals as initialized.
20784 (fix_start_end_in_overlays): Likewise. This function should be
20785 simplified by using pointers-to-pointers, but that's a different
20786 matter.
b1d876f1 20787 (switch_to_buffer_1): Now static.
8f54f30a
PE
20788 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20789 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 20790
a70072c9 20791 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 20792 Fix pointer signedness issue.
edced198
PE
20793 (sys_subshell): Mark local as volatile if checking for lint,
20794 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 20795 (MAXPATHLEN): Define only if needed.
a70072c9 20796
a0977c44
PE
20797 * process.c (serial_open, serial_configure): Move decls from here ...
20798 * systty.h: ... to here, so that they can be checked.
20799
a884fdcc
PE
20800 * fns.c (get_random, seed_random): Move extern decls from here ...
20801 * lisp.h: ... to here, so that they can be checked.
20802
604efe86 20803 * sysdep.c (reset_io): Now static.
b8950c94 20804 (wait_for_termination_signal): Remove; unused.
604efe86 20805
38fc62d9
PE
20806 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20807 (copy_keymap_item, append_key, push_text_char_description):
20808 Now static.
1004a21a 20809 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 20810 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
20811 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20812 (describe_map_tree):
20813 Rename locals to avoid shadowing.
38fc62d9 20814
2f2650da
PE
20815 * keyboard.c: Declare functions static if they are not used elsewhere.
20816 (echo_char, echo_dash, cmd_error, top_level_2):
20817 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
20818 (read_char, kbd_buffer_get_event, make_lispy_position):
20819 (make_lispy_event, make_lispy_movement, apply_modifiers):
20820 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20821 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20822 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 20823 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 20824 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 20825
a053e86c 20826 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
20827 (mark_kboards): Move decl here ...
20828 * alloc.c (mark_kboards): ... from here.
a053e86c 20829
4752793e
PE
20830 * lisp.h (force_auto_save_soon): New decl.
20831
74f10ca7 20832 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
20833 (DEFINE_DUMMY_FUNCTION): New macro.
20834 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20835 Use it.
c03cd23f
PE
20836 (main): Add casts to avoid warnings
20837 if GCC considers string literals to be constants.
74f10ca7 20838
022e70d4
PE
20839 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20840
59d6fe83
PE
20841 * dbusbind.c: Pointer signedness fixes.
20842 (xd_signature, xd_append_arg, xd_initialize):
20843 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20844 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20845 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20846 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20847
78320123
PE
20848 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20849 if GCC considers string literals to be constants.
49cebcca 20850 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 20851
35ac2a97
SM
208522011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20853
fb103ca9
SM
20854 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20855 (print_preprocess, print_object): New macro to fix last change.
20856
35ac2a97
SM
20857 * print.c (print_preprocess): Don't forget font objects.
20858
62973b41
JB
208592011-03-16 Juanma Barranquero <lekktu@gmail.com>
20860
20861 * emacs.c (USAGE3): Doc fixes.
20862
0e48bb22
AS
208632011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20864
20865 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20866 structure.
20867
7684e57b
JB
208682011-03-14 Juanma Barranquero <lekktu@gmail.com>
20869
20870 * lisp.h (VWindow_system, Qfile_name_history):
20871 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20872 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20873 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20874
20875 * w32select.c: Don't #include "keyboard.h".
c96bbc66 20876 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
20877
20878 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20879 * w32console.c (detect_input_pending, read_input_pending)
20880 (encode_terminal_code):
20881 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20882 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20883 (w32_system_caret_y, Qfile_name_history):
20884 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20885 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20886 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20887 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20888 * w32proc.c (Qlocal, report_file_error):
20889 * w32term.c (Vwindow_system, updating_frame):
20890 * w32uniscribe.c (initialized, uniscribe_font_driver):
20891 Remove unneeded extern declarations.
20892
2aa46d6c
CY
208932011-03-14 Chong Yidong <cyd@stupidchicken.com>
20894
c96bbc66 20895 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 20896
cffc6f3b
CY
208972011-03-13 Chong Yidong <cyd@stupidchicken.com>
20898
20899 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20900 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20901 These macros can no longer be used for assignment.
20902
44f230aa
SM
20903 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20904 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
20905 (record_buffer_markers, fetch_buffer_markers): New functions for
20906 recording and fetching special buffer markers.
20907 (set_buffer_internal_1, set_buffer_temp): Use them.
20908
20909 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20910
20911 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20912
20913 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20914 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20915
20916 * xdisp.c (hscroll_window_tree):
20917 (reconsider_clip_changes): Use PT instead of BUF_PT.
20918
d251f04b
EZ
209192011-03-13 Eli Zaretskii <eliz@gnu.org>
20920
20921 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20922 $(EMACS_ROOT)/lib/intprops.h.
20923
f0c77cd1
PE
209242011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20925
3eca4629
PE
20926 Fix more problems found by GCC 4.5.2's static checks.
20927
7c86ee98
PE
20928 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20929 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
20930 (xg_free_frame_widgets): Make it clear that a local variable is
20931 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
20932 (gdk_window_get_screen): Make it clear that this macro is needed
20933 only if USE_GTK_TOOLTIP.
1e5524e7
PE
20934 (int_gtk_range_get_value): New function, which avoids a diagnostic
20935 from gcc -Wbad-function-cast.
20936 (xg_set_toolkit_scroll_bar_thumb): Use it.
20937 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20938 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
20939 (get_utf8_string, xg_get_file_with_chooser):
20940 Rename locals to avoid shadowing.
20941 (create_dialog): Move locals to avoid shadowing.
7c86ee98 20942
41729b81
PE
20943 * xgselect.c (xg_select): Remove unused var.
20944
f0c77cd1
PE
20945 * image.c (four_corners_best): Mark locals as initialized.
20946 (gif_load): Initialize transparent_p to zero (Bug#8238).
20947 Mark another local as initialized.
ec6cf4c6 20948 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 20949
ce0ad53d 20950 * image.c (clear_image_cache): Now static.
d5d5a617 20951 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 20952 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
20953 (x_edge_detection): Remove unnecessary cast that
20954 gcc -Wbad-function-cast diagnoses.
2037898d 20955 (gif_load): Fix pointer signedness.
6ae141d6
PE
20956 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20957 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 20958
33383987 209592011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 20960
d32df629
PE
20961 Improve quality of tests for time stamp overflow.
20962 For example, without this patch (encode-time 0 0 0 1 1
20963 1152921504606846976) returns the obviously-bogus value (-948597
20964 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20965 reports time overflow. See
20966 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
20967 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20968 * editfns.c: Include limits.h and intprops.h.
20969 (TIME_T_MIN, TIME_T_MAX): New macros.
20970 (time_overflow): Move earlier, to before first use.
20971 (hi_time, lo_time): New functions, for an accurate test for
20972 out-of-range times.
20973 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20974 (Fget_internal_run_time): Don't assume time_t fits in int.
20975 (make_time): Use list2 instead of Fcons twice.
20976 (Fdecode_time): More accurate test for out-of-range times.
20977 (check_tm_member): New function.
20978 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
20979 (lisp_time_argument): Don't rely on undefined left-shift and
20980 right-shift behavior when checking for time stamp overflow.
8be6f318 20981
fe31d94c
PE
20982 * editfns.c (time_overflow): New function, refactoring common code.
20983 (Fformat_time_string, Fdecode_time, Fencode_time):
20984 (Fcurrent_time_string): Use it.
20985
8be6f318
PE
20986 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20987 * dired.c (make_time): Move to ...
20988 * editfns.c (make_time): ... here.
20989 * systime.h: Note the move.
20990
09d9db2c 209912011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 20992
126bc0dc
YM
20993 * fringe.c (update_window_fringes): Remove unused variables.
20994
c47cbdfd
YM
20995 * unexmacosx.c (copy_data_segment): Also copy __got section.
20996 (Bug#8223)
20997
7ac80be9
EZ
209982011-03-12 Eli Zaretskii <eliz@gnu.org>
20999
c96bbc66 21000 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
21001 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
21002 Constify `char *' arguments and their references according to
21003 prototypes in tparam.h.
21004
ecb0f94d 21005 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 21006
7ac80be9
EZ
21007 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
21008 Adapt all references accordingly.
21009
21010 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
21011
ef1fd07e
TT
210122011-03-11 Tom Tromey <tromey@redhat.com>
21013
21014 * buffer.c (syms_of_buffer): Remove obsolete comment.
21015
7ef4b50c
EZ
210162011-03-11 Eli Zaretskii <eliz@gnu.org>
21017
21018 * termhooks.h (encode_terminal_code): Declare prototype.
21019
21020 * msdos.c (encode_terminal_code): Don't declare prototype.
21021
21022 * term.c (encode_terminal_code): Now external again, used by
21023 w32console.c and msdos.c.
21024
44f230aa
SM
21025 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
21026 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 21027
4b1ec863 210282011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 21029
1714f52b 21030 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 21031
4b1ec863
PE
21032 * fringe.c (update_window_fringes): Mark locals as initialized
21033 (Bug#8227).
21034 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 21035
524c7aa6
PE
21036 * alloc.c (mark_fringe_data): Move decl from here ...
21037 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
21038 to check its interface.
21039 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
21040
a5c0af81 21041 * fontset.c (free_realized_fontset): Now static.
7519b8cd 21042 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 21043 (fontset_font): Mark local as initialized.
a9a06e0b 21044 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 21045
b4716021
PE
21046 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
21047
811e9bac 21048 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 21049 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
21050 (x_own_selection, Fx_disown_selection_internal): Rename locals
21051 to avoid shadowing.
21052 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 21053
7e3ab302
PE
21054 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
21055 so that the caller can use some name other than gcpro1.
21056 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
21057 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21058 (Fx_backspace_delete_keys_p):
21059 Use them to avoid shadowing, and rename vars to avoid shadowing.
21060 (x_decode_color, x_set_name, x_window): Now static.
6b437900 21061 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 21062 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
21063 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
21064 Remove unused locals.
7e3ab302
PE
21065 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
21066 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
21067 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
21068 macros.
f78faa98 21069
e2b13473
PE
21070 * xterm.h (x_mouse_leave): New decl.
21071
77f23912
PE
21072 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
21073 Remove unused functions.
cdf4ba58
PE
21074 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
21075 (x_calc_absolute_position): Now static.
7411c686 21076 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 21077 Don't declare local "event" unless it's used.
ed7bf3a5
PE
21078 (x_iconify_frame, x_free_frame_resources): Don't declare locals
21079 unless they are used.
38d0b34a
PE
21080 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
21081 (x_fatal_error_signal): Remove; not used.
a6067996
PE
21082 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
21083 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
21084 (x_error_catcher, x_connection_closed, x_error_handler):
21085 (x_error_quitter, xembed_send_message, x_iconify_frame):
21086 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 21087 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 21088 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 21089
44f230aa
SM
21090 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
21091 Rename or move locals to avoid shadowing.
6b463e58 21092 (tty_defined_color, merge_face_heights): Now static.
5967d051 21093 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
21094 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
21095 does not deduce is never used uninitialized.
73719eba
PE
21096 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
21097 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 21098
426994c3 21099 * terminal.c (store_terminal_param): Now static.
5489860b 21100
032f1620 21101 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 21102 (set_frame_menubar): Remove unused local.
d4323972 21103 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
21104 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
21105 since they might point to immutable storage.
281585b0
PE
21106 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
21107 since it's unused otherwise.
032f1620 21108
367c19e5 21109 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 21110 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
21111 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
21112 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 21113 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
21114 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
21115 does not deduce are never used uninitialized.
70739cbe 21116
07b48fa9
PE
21117 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
21118
8868a238 21119 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
21120 * window.c (window_loop, size_window):
21121 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 21122
7e5cf297 21123 * window.c (display_buffer): Now static.
d6550a9f
PE
21124 (size_window): Mark variables that gcc -Wuninitialized
21125 does not deduce are never used uninitialized.
a586633d
PE
21126 * window.h (check_all_windows): New decl, to forestall
21127 gcc -Wmissing-prototypes diagnostic.
5b555da1 21128 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 21129
f6095868
PE
21130 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
21131 shadowing.
21132 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
21133 Include <limits.h>.
21134 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
21135 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
21136 (load_charset_map): Mark variables that gcc -Wuninitialized
21137 does not deduce are never used uninitialized.
53df7c11 21138 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 21139
f38b440c
PE
21140 * coding.c (coding_set_source, coding_set_destination):
21141 Use "else { /* comment */ }" rather than "else /* comment */;"
21142 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
21143 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
21144 a block, when the outer 'i' will do.
21145 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
21146 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
21147 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
21148 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
21149 (Fdecode_sjis_char, Fdefine_coding_system_internal):
21150 Rename locals to avoid shadowing.
21151 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
21152 * coding.c (emacs_mule_char, encode_invocation_designation):
21153 Now static, since they're not used elsewhere.
413bb2db 21154 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 21155 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
21156 (decode_coding_emacs_mule): Mark variables that gcc
21157 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
21158 (detect_coding_iso_2022): Initialize a local variable that might
21159 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 21160 this initialization is needed. (Bug#8211)
5f58e762
PE
21161 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
21162 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
21163 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
21164 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
21165 Remove unused macros.
f38b440c 21166
232b38b9 21167 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 21168 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 21169 * character.c (string_count_byte8): Likewise.
232b38b9 21170
fb90da1b
PE
21171 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
21172 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
21173
fb93dbc2
PE
21174 * chartab.c (copy_sub_char_table): Now static, since it's not used
21175 elsewhere.
5c156ace
PE
21176 (sub_char_table_ref_and_range, char_table_ref_and_range):
21177 Rename locals to avoid shadowing.
bbcd0949 21178 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 21179
7d3b3862 21180 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 21181 (BIDI_BOB): Remove unused macro.
7d3b3862 21182
6be7d3da
PE
21183 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
21184 deduce are never used uninitialized.
c2ed9c8b 21185 * term.c (encode_terminal_code): Likewise.
6be7d3da 21186
75f8807f 21187 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 21188
50938595
PE
21189 * tparam.h: New file.
21190 * term.c, tparam.h: Include it.
21191 * deps.mk (term.o, tparam.o): Depend on tparam.h.
21192 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
21193 Move these decls to tparam.h, and make them agree with what
21194 is actually in tparam.c. The previous trick of using incompatible
21195 decls in different modules does not conform to the C standard.
21196 All callers of tparam changed to use tparam's actual API.
21197 * tparam.c (tparam1, tparam, tgoto):
21198 Use const pointers where appropriate.
21199
fbceeba2
PE
21200 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
21201 * cm.h (struct cm): Likewise.
21202 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
21203 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
21204 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
21205 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
21206 (turn_on_face, init_tty): Likewise.
21207 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 21208
7f3f1250
PE
21209 * term.c (term_mouse_position): Rename local to avoid shadowing.
21210
e6ca6543
PE
21211 * alloc.c (mark_ttys): Move decl from here ...
21212 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
21213
c40f8d15
AS
212142011-03-11 Andreas Schwab <schwab@linux-m68k.org>
21215
21216 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
21217
cfe0661d
JB
212182011-03-09 Juanma Barranquero <lekktu@gmail.com>
21219
21220 * search.c (compile_pattern_1): Remove argument regp, unused since
21221 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
21222 (compile_pattern): Don't pass it.
21223
0afb4571
J
212242011-03-08 Jan Djärv <jan.h.d@swipnet.se>
21225
21226 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
21227 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
21228 for ! HAVE_GTK3.
21229 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
21230
21231 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
21232
21233 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
21234 gdk_window_get_screen, gdk_window_get_geometry,
21235 gdk_x11_window_lookup_for_display and GDK_KEY_g.
21236 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
21237 (xg_get_pixbuf_from_pixmap): New function.
21238 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
21239 to Pixmap, take frame as parameter, remove GdkColormap parameter.
21240 Call xg_get_pixbuf_from_pixmap instead of
21241 gdk_pixbuf_get_from_drawable.
21242 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
21243 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
21244 (xg_check_special_colors): Use GtkStyleContext and its functions
21245 for HAVE_GTK3.
21246 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
21247 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
21248 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
21249 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
21250 Call gtk_widget_get_preferred_size.
0afb4571
J
21251 (xg_frame_resized): gdk_window_get_geometry only takes 5
21252 parameters.
44f230aa
SM
21253 (xg_win_to_widget, xg_event_is_for_menubar):
21254 Call gdk_x11_window_lookup_for_display.
0afb4571
J
21255 (xg_set_widget_bg): New function.
21256 (delete_cb): New function.
895009e1 21257 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 21258 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
21259 (xg_set_background_color): Call xg_set_widget_bg.
21260 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
21261 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
21262 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
21263 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
21264 if ! HAVE_GTK3.
21265 (update_frame_tool_bar): Call gtk_widget_hide.
21266 (xg_initialize): Use GDK_KEY_g.
21267
21268 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
21269 if ! HAVE_GTK3
21270 (x_session_initialize): Call gdk_x11_set_sm_client_id.
21271
21272 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
21273 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
21274 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
21275
1c2cc4ef
JB
212762011-03-08 Juanma Barranquero <lekktu@gmail.com>
21277
21278 * w32xfns.c (select_palette): Check success of RealizePalette against
21279 GDI_ERROR, not zero.
21280
33383987 21281See ChangeLog.11 for earlier changes.
aac0c6e3
MR
21282
21283;; Local Variables:
21284;; coding: utf-8
aac0c6e3
MR
21285;; End:
21286
2f097256 21287 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
21288
21289 This file is part of GNU Emacs.
21290
21291 GNU Emacs is free software: you can redistribute it and/or modify
21292 it under the terms of the GNU General Public License as published by
21293 the Free Software Foundation, either version 3 of the License, or
21294 (at your option) any later version.
21295
21296 GNU Emacs is distributed in the hope that it will be useful,
21297 but WITHOUT ANY WARRANTY; without even the implied warranty of
21298 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21299 GNU General Public License for more details.
21300
21301 You should have received a copy of the GNU General Public License
21302 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.