Improve handling of subprocess shutdown on MS-Windows.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
299614f3
EZ
12012-12-23 Eli Zaretskii <eliz@gnu.org>
2
3 * w32proc.c (reader_thread): Do not index fd_info[] with negative
4 values.
5 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
6 after WaitForSingleObject returns normally. This expedites reader
7 thread shutdown when delete_child triggers it.
8 (reap_subprocess): More accurate commentary for why we call
9 delete_child only when cp->fd is negative.
10
11 * w32.c (sys_close): Do not call delete_child on a subprocess
12 whose handle is not yet closed. Instead, set its file descriptor
13 to a negative value, so that reap_subprocess will call
14 delete_child on that subprocess when its SIGCHLD arrives. This
15 avoids closing handles used for communications between sys_select
16 and reader_thread, which doesn't give sys_select a chance to
17 notice that the process exited and invoke the SIGCHLD handler for
18 it.
19
cf162aee
JD
202012-12-23 Jan Djärv <jan.h.d@swipnet.se>
21
22 * nsfns.m (Fns_do_applescript): Run event loop until script has
23 been executed (Bug#12969).
24 (ns_run_ascript): Chech as_script for nil, set to nil after
25 executing script.
26
94900bfe
MR
272012-12-22 Martin Rudalics <rudalics@gmx.at>
28
29 * window.c (Fselect_window): Reword doc-string (Bug#13248).
30
b2faf49c
EZ
312012-12-22 Eli Zaretskii <eliz@gnu.org>
32
33 * w32term.c (w32fullscreen_hook): New function.
34 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
35
7efa3fb3
EZ
362012-12-21 Eli Zaretskii <eliz@gnu.org>
37
bb085aed
EZ
38 * fileio.c (Finsert_file_contents): Doc fix.
39
7efa3fb3
EZ
40 * w32proc.c (new_child, delete_child, find_child_pid): For a
41 subprocess, consider its slot being in use as long as its process
42 handle (procinfo.hProcess) is not NULL. This avoids reusing the
43 slot when a new process is started immediately after killing
44 another one, without waiting enough time for the first process to
45 be reaped and resources allocated for it be orderly freed.
46 (Bug#13086)
47 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
48
c1f02afa
CY
492012-12-21 Chong Yidong <cyd@gnu.org>
50
51 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
52
5bec25eb
CY
53 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
54
a4b0cca1 552012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
56
57 * w32.c (get_name_and_id): Always pass NULL as the first argument
58 of lookup_account_sid. Avoids crashes with UNC file names that
59 refer to DFS domains, not to specific machine names. (Bug#12621)
60 Remove now unused argument FNAME; all callers changed.
61 (get_file_owner_and_group): Remove now unused argument FNAME; all
62 callers changed.
63
34b4b7eb
CY
642012-12-21 Chong Yidong <cyd@gnu.org>
65
66 * editfns.c (Finsert_char): Since read-char-by-name now signals an
67 error for invalid chars, don't check for a nil return value.
68
13002885
DA
692012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
70
71 Avoid calls to CHAR_TO_BYTE if byte position is known.
72 * editfns.c (make_buffer_string_both): Use move_gap_both.
73 (Fbuffer_string): Use make_buffer_string_both.
74 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
75 Adjust comment.
76 (buf_bytepos_to_charpos): Likewise.
77 (charpos_to_bytepos): Remove.
78 * fileio.c (Finsert_file_contents): Use move_gap_both.
79 * search.c (Freplace_match): Likewise.
80 * process.c (process_send_region): Likewise. Use convenient
81 names for byte positions.
82 * lisp.h (charpos_to_bytepos): Remove prototype.
83 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
84 * insdel.c (move_gap): Likewise.
85
99e9311c
PE
862012-12-20 Paul Eggert <eggert@cs.ucla.edu>
87
88 * xdisp.c (redisplay_internal): Remove now-unused local.
89
e02230bf
SM
902012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
91
92 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
93 (redisplay_internal): Don't bother selecting the frame to get the
94 proper value of frame-local variables.
95
1687fb14
DA
962012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
97
98 * textprop.c (set_text_properties_1): Do not allow NULL interval.
99 Rename 4th argument since it may be buffer or string. Adjust comment.
100 * intervals.c (graft_intervals_info_buffer): Find an interval here.
101
a2f07cd2
DA
1022012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
103
104 * coding.c (Fdetect_coding_region): Do not check start and end with
105 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
106 (code_convert_region): Likewise.
107
474d441e
EZ
1082012-12-18 Eli Zaretskii <eliz@gnu.org>
109
110 * w32.c (acl_get_file, acl_set_file): Run the file name through
111 map_w32_filename, and resolve any symlinks in the file name, like
112 Posix platforms do.
113 (acl_set_file): Call revert_to_self, if any privileges were
114 enabled.
115
8725c076
JB
1162012-12-17 Juanma Barranquero <lekktu@gmail.com>
117
118 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
119 ($(BLD)/w32.$(O)): Update dependencies.
120
1e101a4b
SM
1212012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
122
123 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
124 propagate redisplay's scrolling (if any) to the right window.
125 (redisplay_internal): Use ensure_selected_frame.
126 (display_mode_lines): Complete last fix.
127 * window.c (select_window_1): New func, extracted from select_window.
128 (select_window): Use it.
129 * window.h (select_window_1): Declare.
130
66447e07
EZ
1312012-12-17 Eli Zaretskii <eliz@gnu.org>
132
133 Emulate Posix ACL APIs on MS-Windows.
134 * w32.c: Include sddl.h and sys/acl.h.
135 (SDDL_REVISION_1): Define if not already defined.
136 (g_b_init_get_security_descriptor_dacl)
137 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
138 (g_b_init_is_valid_security_descriptor)
139 (g_b_init_set_file_security): New static flags.
140 (globals_of_w32): Initialize them to zero.
141 (SetFileSecurity_Name): New string constant.
142 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
143 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
144 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
145 (IsValidSecurityDescriptor_Proc): New typedefs.
146 (get_file_security, get_security_descriptor_owner)
147 (get_security_descriptor_group): Set errno to ENOTSUP.
148 (set_file_security, get_security_descriptor_dacl)
149 (is_valid_security_descriptor, convert_sd_to_sddl)
150 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
151 (acl_free, acl_get_file, acl_set_file): New functions.
152
153 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
154
207a7ef0
PE
1552012-12-17 Paul Eggert <eggert@cs.ucla.edu>
156
157 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
158 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
159 for some of that bug's symptoms can now cause Emacs to abort.
160 Remove the workaround.
161 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
162 The bug that caused SIGCHLD to get lost has been fixed, and the
163 workaround for it can now cause Emacs to abort.
164
17fdfc15
PE
1652012-12-16 Paul Eggert <eggert@cs.ucla.edu>
166
167 * sysdep.c (emacs_abort): Bump backtrace size to 40.
168 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
169 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
170
7c3d167f
RF
1712012-12-16 Romain Francoise <romain@orebokech.com>
172
173 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
174 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 175 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
176 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
177
178 * Makefile.in (LIBACL_LIBS): New macro.
179 (LIBES): Use it.
180
7d80ea23
PE
1812012-12-15 Paul Eggert <eggert@cs.ucla.edu>
182
183 * fileio.c (internal_delete_file): Use bool for boolean.
184
b0728617
EZ
1852012-12-15 Eli Zaretskii <eliz@gnu.org>
186
187 Fix bug #13079 on MS-Windows with temp files not being deleted.
188 * w32.h (_child_process): New members input_file and
189 pending_deletion.
190 (register_child): First argument is now pid_t.
191 (record_infile, record_pending_deletion): New prototypes.
192
193 * w32proc.c (new_child): Initialize input_file and
194 pending_deletion members of the child.
195 (delete_child): Delete the child's temporary input file, if any,
196 that is pending deletion.
197 (register_child): First argument is now pid_t.
198 (record_infile, record_pending_deletion): New functions.
199 (reap_subprocess): Fix a typo in DebPrint string.
200 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
201
202 * fileio.c (internal_delete_file): Return an int again: non-zero
203 if delete-file succeeds, zero otherwise.
204
205 * lisp.h (internal_delete_file): Adjust prototype.
206
207 * callproc.c (Fcall_process): Don't overwrite infile with result
208 of DECODE_FILE.
209 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
210 asynchronous subprocess, record the name of the input file name,
211 if any.
212 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
213 delete the file, record it as pending deletion when the subprocess
214 exits.
215
7e90af26
EZ
2162012-12-14 Eli Zaretskii <eliz@gnu.org>
217
218 * editfns.c [HAVE_PWD_H]: Include grp.h.
219
220 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
221
97976f9f
PE
2222012-12-14 Paul Eggert <eggert@cs.ucla.edu>
223
224 Fix permissions bugs with setgid directories etc. (Bug#13125)
225 * dired.c (Ffile_attributes): Return t as the 9th attribute,
226 to mark it as a placeholder. The old value was often wrong.
227 The only user of this attribute has been changed to use
228 file-ownership-preserved-p instead, with its new group arg.
229 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
230
26ec1f49
SM
2312012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
232
ad966fe7
SM
233 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
234 Keep selected_window and selected_frame in sync.
26ec1f49 235
5c207910
EZ
2362012-12-14 Eli Zaretskii <eliz@gnu.org>
237
238 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
239 try to get accurate owner and group information from NT file
240 security APIs. This is to make most callers of 'stat' and
241 'lstat', which don't need that information, much faster.
242
26ec1f49
SM
243 * dired.c (Ffile_attributes) [WINDOWSNT]:
244 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
245 owner and group information from 'lstat'.
246
893f52d8
PE
2472012-12-13 Paul Eggert <eggert@cs.ucla.edu>
248
4c95c9a5
PE
249 * fileio.c (Finsert_file_contents): Don't put tail into head area,
250 as that confuses set-auto-coding, so insist on the head-read
251 returning the full 1024 bytes. Let lseek compute the tail offset;
252 less work for us. Do not ignore I/O errors when reading the tail.
253
893f52d8
PE
254 * xdisp.c: Minor style fixes.
255 (init_iterator): Hoist assignment out of if-expression.
256 (markpos_of_region): Callers now test for sign, not for -1.
257
40d1e434
DA
2582012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
259
260 Minor redisplay optimization when the region length is zero.
261 * xdisp.c (markpos_of_region): New function.
262 (init_iterator): Do not highlight the region of zero length.
263 (redisplay_window): Check whether the region is of non-zero length.
264 (try_cursor_movement): Allow if the region length is zero.
265 (try_window_reusing_current_matrix, try_window_id): Likewise.
266
727f9739 2672012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
268
269 * search.c (search_buffer): Check the inverse translations of each
270 character in pattern when the buffer being searched is unibyte.
271 (Bug#13084)
272
727f9739 2732012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
274
275 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
276 files, fixing a regression from 24.2.
645c6a30 277 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 278
d20704ef
PE
2792012-12-13 Paul Eggert <eggert@cs.ucla.edu>
280
281 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
282 fstat shouldn't fail, and if it does fail copy-file should not proceed.
283 Remove unnecessary S_ISLNK test, as (contra the comments) this
284 function can't copy symlinks. Improve quality of error message
285 when attempting to copy files that are neither regular files nor
286 directories.
287
2dd61a9b
DA
2882012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
289
290 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
291 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
292 * window.c (Frecenter):
293 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
294 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
295
cc98b684
DC
2962012-12-12 Daniel Colascione <dancol@dancol.org>
297
1e101a4b 298 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
299 the dumped Emacs is not a sparse file, greatly improving Cygwin
300 "make bootstrap" performance.
301
38e791fd
MA
3022012-12-11 Michael Albinus <michael.albinus@gmx.de>
303
304 * inotify.c (inotify_callback): Generate an Emacs event for every
305 incoming inotify event.
306
f9d1448f
EZ
3072012-12-11 Eli Zaretskii <eliz@gnu.org>
308
309 * xdisp.c (handle_face_prop): Fix logic of computing
310 it->start_of_box_run_p.
311 (append_space_for_newline): If the glyph row is R2L, reset the
312 iterator's end_of_box_run_p flag before prepending the space glyph.
313 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
314 iterator's start_of_box_run_p flag before prepending the stretch.
315 (append_glyph, produce_image_glyph, append_composite_glyph)
316 (append_stretch_glyph, append_glyphless_glyph): Reverse the
317 left_box_line_p and right_box_line_p flags of the glyph for R2L
318 glyph rows. (Bug#13011)
319
c6afe371
DA
3202012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
321
322 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
323 if changed buffer is not shown in a window.
324 * insdel.c (prepare_to_modify_buffer): Likewise.
325 * window.c (replace_buffer_in_windows_safely): Do nothing
326 if buffer is not shown in a window.
327 (Fforce_window_update): Likewise if string or buffer argument
328 is passed.
329
1b47babd
EZ
3302012-12-11 Eli Zaretskii <eliz@gnu.org>
331
332 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
333 encoded_file_name, which is what it is.
334
4c1acb95
DA
3352012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
336
337 Consistently use marker_position and marker_byte_position.
338 * fringe.c (Ffringe_bitmaps_at_pos):
339 * indent.c (Fvertical_motion):
340 * insdel.c (prepare_to_modify_buffer):
341 * keyboard.c (make_lispy_position):
342 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
343 (window_scroll_pixel_based, displayed_window_lines)
344 (Fset_window_configuration):
345 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
346 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
347 Replace direct access to marker fields with calls
348 to marker_position and/or marker_byte_position.
349
0eeb69fe
JB
3502012-12-11 Juanma Barranquero <lekktu@gmail.com>
351
352 * makefile.w32-in (SIG2STR_H): New macro.
353 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
354 ($(BLD)/w32notify.$(O)): Update dependencies.
355
1cf1bbd5
DC
3562012-12-10 Daniel Colascione <dancol@dancol.org>
357
8db4b52f
DC
358 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
359 Windows file notification functionality unless WINDOWSNT.
360
1cf1bbd5
DC
361 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
362 declarations.
363
364 * w32fns.c (cache_system_info): Initialize the global hinst
365 variable here so various initialization calls DTRT.
366
1e101a4b 367 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
368 (hinst): Remove unneeded extern declaration.
369 (_start): Remove initialization of above variables; remove
370 initialization of hinst, as cache_system_info now does that.
371
372 * emacs.c (main): Call cache_system_info early in startup; we
373 previously weren't calling it in Cygwin builds.
374
26ec1f49
SM
375 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
376 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
377 and link it to Emacs.
378
98a07056
DA
3792012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
380
381 Per-buffer window counters.
382 * buffer.h (struct buffer): New member window_count.
383 (buffer_window_count): New function.
384 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
385 Initialize window_count.
386 (Fkill_buffer): Verify window_count for the buffer being killed.
387 (modify_overlay): Do not force redisplay if buffer is not shown
388 in any window.
389 (init_buffer_once): Initialize window_count for buffer_defaults
390 and buffer_local_symbols.
391 * window.h (buffer_shared): Remove declaration.
392 (wset_buffer): Convert from inline ...
393 * window.c (wset_buffer): ... to an ordinary function.
394 (adjust_window_count): New function.
395 (make_parent_window): Use it.
396 * xdisp.c (buffer_shared): Remove.
397 (redisplay_internal, redisplay_window): Adjust users.
398 (buffer_shared_and_changed): Use per-buffer window counter.
399
2b8c9064
EZ
4002012-12-10 Eli Zaretskii <eliz@gnu.org>
401
402 Support for filesystem notifications on MS-Windows.
403 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
404 and this is a TTY frame, signal the caller that keyboard input is
405 available.
406
407 * w32xfns.c (drain_message_queue): Now returns an int: an
408 indication whether any WM_EMACS_FILENOTIFY messages were found in
409 the queue.
410
411 * w32inevt.c (handle_file_notifications): New function.
412 (w32_console_read_socket): Call it to process file notifications.
413
414 * w32console.c (initialize_w32_display): Record the main thread ID
415 in dwMainThreadId.
416
417 * deps.mk (inotify.o): New dependency list.
418
419 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
420
421 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
422 (WM_EMACS_END): Bump value by 1.
423 (notification_buffer_in_use, file_notifications)
424 (notifications_size, notifications_desc): Declare.
425 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
426 Add prototypes.
427
428 * w32term.c (lispy_file_action, queue_notifications): New functions.
429 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
430 <Qrenamed_to>: New symbols.
431 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
432
433 * w32notify.c: New file, implements file event notifications for
434 MS-Windows.
435
436 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
437 by posting it to the w32_read_socket queue.
438
1e101a4b 439 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
440
441 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
442 (GLOBAL_SOURCES): Add w32notify.c
443 ($(BLD)/w32notify.$(O)): New set of dependencies.
444
445 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
446
1e101a4b
SM
447 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
448 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
449 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
450 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
451 w32notify-handle-event by default.
452
453 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
454 syms_of_w32notify.
455
81606b10
RS
4562012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
457
2b8c9064 458 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 459 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
460
461 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
462
463 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
464 (syms_of_keyboard): DEFSYM it.
465 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
466 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
467 Qfile_inotify events.
468 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
469 special-event-map to inotify-handle-event.
470
471 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
472
473 * Makefile.in (base_obj): Add inotify.o.
474
475 * inotify.c: New file.
476
265c2fbf 4772012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
478
479 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
480
265c2fbf 4812012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
482
483 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
484 DWORD_PTR, for compatibility with 64-bit builds.
485
a06ae17d 486 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
487 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
488 (system_process_attributes): Use SIZE_T rather than DWORD, for
489 compatibility with 64-bit builds.
490
265c2fbf 4912012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
492
493 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
494
265c2fbf 4952012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
496
497 * indent.c (Fvertical_motion): If a display string will be
498 displayed on the left or the right margin, don't consider it as a
499 factor in cursor positioning. (Bug#13108)
500
265c2fbf 5012012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
502
503 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
504
5f460827
PE
5052012-12-10 Paul Eggert <eggert@cs.ucla.edu>
506
507 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
508 for string length.
509
a16e75cd
EZ
5102012-12-08 Eli Zaretskii <eliz@gnu.org>
511
512 * w32.c (unsetenv): Return 0 if the input string is too long.
513
5745a7df
PE
5142012-12-08 Paul Eggert <eggert@cs.ucla.edu>
515
516 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
517 * alloc.c (xputenv): New function.
518 * dbusbind.c (Fdbus_init_bus):
519 * emacs.c (main):
520 * xterm.c (x_term_init):
521 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
522 * editfns.c (initial_tz): Move static var decl up.
523 (tzvalbuf_in_environ): New static var.
524 (init_editfns): Initialize these two static vars.
525 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
526 Save old TZ value on stack, if it's small.
527 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
528 instead, use xputenv+unsetenv to set and restore TZ.
529 (environbuf): Remove static var. All uses removed.
530 (Fset_time_zone_rule): Do not save TZ and environ;
531 no longer needed here.
532 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
533 Move to inside set_time_zone_rule; they don't need file scope any more.
534 (set_time_zone_rule): Maintain the TZ=value string separately.
535 (syms_of_editfns): Don't initialize initial_tz;
536 init_editfns now does it.
537 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
538 * lisp.h (xputenv): New decl.
539
c56efa40
FP
5402012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
541
542 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
543
75ceee05
EZ
5442012-12-08 Eli Zaretskii <eliz@gnu.org>
545
546 * w32.c (unsetenv, sys_putenv): New functions.
547
1b6dbfeb
CY
5482012-12-08 Chong Yidong <cyd@gnu.org>
549
550 * editfns.c (Finsert_char): Make the error message more
551 informative (Bug#12992).
552
d983a10b
PE
5532012-12-08 Paul Eggert <eggert@cs.ucla.edu>
554
7be78020
PE
555 Simplify get_lim_data.
556 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
557 Remove USG and vlimit methods; no longer used these days.
558 Add #error catchall just in case.
559
d983a10b
PE
560 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
561 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
562 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
563 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
564 (deleted_pid_list, Fdelete_process, create_process)
565 (record_child_status_change, handle_child_signal, deliver_child_signal)
566 (init_process_emacs, syms_of_process):
567 Assume SIGCHLD is defined.
568 (parse_signal): Remove. All uses removed.
569 (abbr_to_signal): New static function.
570 (Fsignal_process): Use it to convert signal names to ints.
571 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
572 kill (getpgrp (), ...).
573 (emacs_sigaction_init): Assume SIGCHLD is defined.
574 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
575 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
576 * syssignal.h (EMACS_KILLPG): Remove.
577 All uses replaced by 'kill' with a negative pid.
578 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
579 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
580
9cdde1e2
PE
5812012-12-07 Paul Eggert <eggert@cs.ucla.edu>
582
583 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
584 This will cause a production Emacs to dump core instead of
585 infinite-looping.
586
822995f8
DA
5872012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
588
589 * frame.c (make_frame): Do not set window's buffer to t.
590 * window.c (Fsplit_window_internal): Likewise. Previously it was
591 used to indicate that the window is being set up. Now we use
592 set_window_buffer for all new windows, so the condition in ...
593 (Fset_window_buffer): ... is always true and can be removed.
594
ed08365b
DA
5952012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
596
597 Convenient macro to check whether the buffer is hidden.
598 * buffer.h (BUFFER_HIDDEN_P): New macro.
599 * frame.c (make_frame): Use it. Adjust comment.
600 * buffer.c (candidate_buffer): New function.
601 (Fother_buffer, other_buffer_safely): Use it.
602
e86f5134
EZ
6032012-12-06 Eli Zaretskii <eliz@gnu.org>
604
605 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
606 if the child process is still running. Instead, exit the wait
607 loop and return zero. (Bug#13086)
608
1700db3c
DA
6092012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
610
611 * frame.h (x_char_width, x_char_height): Remove prototypes.
612 * w32term.h (x_char_width, x_char_height): Likewise.
613 * xfns.c (x_char_width, x_char_height): Remove.
614 * w32fns.c (x_char_width, x_char_height): Likewise.
615 * nsfns.c (x_char_width, x_char_height): Likewise.
616 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
617 all window frames.
618 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
619 * keyboard.c (command_loop_1): Remove prototype.
620 (command_loop_2, top_level_1): Add static to match prototype.
621
35fb8050
PE
6222012-12-06 Paul Eggert <eggert@cs.ucla.edu>
623
624 Fix a recently-introduced delete-process race condition.
625 * callproc.c, process.h (record_kill_process):
626 New function, containing part of the old call_process_kill.
627 (call_process_kill): Use it.
628 This does not change call_process_kill's behavior.
629 * process.c (Fdelete_process): Use record_kill_process to fix a
630 race condition that could cause Emacs to lose track of a child.
631
565212e5
DA
6322012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
633
634 Avoid code duplication between prev_frame and next_frame.
635 * frame.c (candidate_frame): New function. Add comment.
636 (prev_frame, next_frame): Use it. Adjust comment.
637
d8ad4d3f 6382012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
639
640 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
641 fails, signal an error instead of continuing with an empty
642 string. (Bug#13079)
7c2fcf9b
EZ
643 Encode expanded temp file pattern before passing it to mkstemp or
644 mktemp.
d3cefd13 645
2e7cddd3
EZ
646 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
647 Encode the file name before passing it to dostounix_filename, in
648 case it will downcase it (under w32-downcase-file-names).
649 (Bug#12933)
650
644d3f0d
PE
6512012-12-05 Paul Eggert <eggert@cs.ucla.edu>
652
653 Minor call-process cleanups.
654 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
655 at the same time as other platforms, to simplify analysis.
656 No need for fd0_volatile since we have synch_process_fd.
657 Avoid needless emacs_close; arg is always negative.
658
396376f1
AS
6592012-12-04 Andreas Schwab <schwab@linux-m68k.org>
660
661 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
662 processes.
663
350f51ad
DA
6642012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
665
666 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
667 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
668 and mouse_face_hidden members to a bitfields.
669 * frame.h (struct frame): Remove set-but-not-used space_width member.
670 (FRAME_SPACE_WIDTH): Remove.
671 * nsterm.m, w32term.c, xterm.c: Adjust users.
672 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
673 member. Adjust users. Convert term_initted, delete_in_insert_mode,
674 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
675 members to a bitfields.
676
bc9dbce6
PE
6772012-12-03 Paul Eggert <eggert@cs.ucla.edu>
678
bb5f74ee
PE
679 Don't let call-process be a zombie factory (Bug#12980).
680 Fixing this bug required some cleanup of the signal-handling code.
681 As a side effect, this change also fixes a longstanding rare race
682 condition whereby Emacs could mistakenly kill unrelated processes,
683 and it fixes a bug where a second C-g does not kill a recalcitrant
684 synchronous process in GNU/Linux and similar platforms.
685 The patch should also fix the last vestiges of Bug#9488,
686 a bug which has mostly been fixed on the trunk by other changes.
687 * callproc.c, process.h (synch_process_alive, synch_process_death)
688 (synch_process_termsig, sync_process_retcode):
689 Remove. All uses removed, to simplify analysis and so that
690 less consing is done inside critical sections.
691 * callproc.c (call_process_exited): Remove. All uses replaced
692 with !synch_process_pid.
693 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
694 These take the role of what used to be in unwind-protect arg.
695 All uses changed.
696 (block_child_signal, unblock_child_signal):
697 New functions, to avoid races that could kill innocent-victim processes.
698 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
699 (call_process_kill): Record killed processes as deleted, so that
700 zombies do not clutter up the system. Do this inside a critical
701 section, to avoid a race that would allow the clutter.
702 (call_process_cleanup): Fix code so that the second C-g works again
703 on common platforms such as GNU/Linux.
704 (Fcall_process): Create the child process in a critical section,
705 to fix a race condition. If creating an asynchronous process,
706 record it as deleted so that zombies do not clutter up the system.
707 Do unwind-protect for WINDOWSNT too, as that's simpler in the
708 light of these changes. Omit unnecessary call to emacs_close
709 before failure, as the unwind-protect code does that.
710 * callproc.c (call_process_cleanup):
711 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
712 * process.c (record_deleted_pid): New function, containing
713 code refactored out of Fdelete_process.
714 (Fdelete_process): Use it.
715 (process_status_retrieved): Remove. All callers changed to use
716 child_status_change.
717 (record_child_status_change): Remove, folding its contents into ...
718 (handle_child_signal): ... this signal handler. Now, this
719 function is purely a handler for SIGCHLD, and is not called after
720 a synchronous waitpid returns; the synchronous code is moved to
721 wait_for_termination. There is no need to worry about reaping
722 more than one child now.
723 * sysdep.c (get_child_status, child_status_changed): New functions.
724 (wait_for_termination): Now takes int * status and bool
725 interruptible arguments, too. Do not record child status change;
726 that's now the caller's responsibility. All callers changed.
727 Reimplement in terms of get_child_status.
728 (wait_for_termination_1, interruptible_wait_for_termination):
729 Remove. All callers changed to use wait_for_termination.
730 * syswait.h: Include <stdbool.h>, for bool.
731 (record_child_status_change, interruptible_wait_for_termination):
732 Remove decls.
733 (record_deleted_pid, child_status_changed): New decls.
734 (wait_for_termination): Adjust to API changes noted above.
735
bc9dbce6
PE
736 * bytecode.c, lisp.h (Qbytecode): Remove.
737 No longer needed after 2012-11-20 interactive-p changes.
738
3cf3c607
EZ
7392012-12-03 Eli Zaretskii <eliz@gnu.org>
740
741 * xdisp.c (redisplay_window): If the cursor is visible, but inside
742 the scroll margin, move point outside the margin. (Bug#13055)
743
005c8d13
JD
7442012-12-03 Jan Djärv <jan.h.d@swipnet.se>
745
746 * gtkutil.c (my_log_handler): New function.
747 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
748
20edc1c9
DA
7492012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
750
751 * lisp.h (modify_region): Rename to...
752 (modify_region_1): ...new prototype.
753 * textprop.c (modify_region): Now static. Adjust users.
754 * insdel.c (modify_region): Rename to...
755 (modify_region_1): ...new function to work with current buffer.
756 Adjust comment and users. Use true and false for booleans.
757
62c2e5ed
DA
7582012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
759
760 * alloc.c (free_save_value): New function.
761 (safe_alloca_unwind): Use it.
762 * lisp.h (free_save_value): New prototype.
763 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
764 Add comment.
765 (save_excursion_restore): Adjust to match saved data structure.
766 Use free_save_value to offload some work from GC. Drop obsolete
767 #if 0 code.
768
c5bc2d1d 7692012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
770
771 * fileio.c (Vauto_save_list_file_name): Doc fix.
772
c5bc2d1d 7732012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
774
775 * w32fns.c: Remove prototype of atof.
1e101a4b 776 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 777 builds.
1e101a4b 778 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
779
780 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
781 with 64-bit builds.
782
783 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
784 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
785 defined.
786
c5bc2d1d 7872012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 788
a9de9f0c 789 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 790
21e54a94
PE
7912012-12-02 Paul Eggert <eggert@cs.ucla.edu>
792
2dd2e622
PE
793 Fix xpalloc confusion after memory is exhausted.
794 * alloc.c (xpalloc): Comment fix.
795 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
796 and signals an error, do not clear charset_table_size, as
797 charset_table is still valid.
798 * doprnt.c (evxprintf): Clear *BUF after freeing it.
799
21e54a94
PE
800 Use execve to avoid need to munge environ (Bug#13054).
801 * callproc.c (Fcall_process):
802 * process.c (create_process):
803 Don't save and restore environ; no longer needed.
804 * callproc.c (child_setup):
805 Use execve, not execvp, to preserve environ.
806
3e5490f7
PE
8072012-12-01 Paul Eggert <eggert@cs.ucla.edu>
808
809 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
810
75b4f59c
YM
8112012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
812
813 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
814 display for sliced images (Bug#10500).
815
816 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
817
f8aff4c6
JB
8182012-11-30 Juanma Barranquero <lekktu@gmail.com>
819
820 * doc.c (Fdocumentation): Re-add handling of function-documentation,
821 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
822
3940b924
DA
8232012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
824
825 * xdisp.c (window_outdated): Remove eassert since it hits
826 some suspicious corner cases (see Bug#13007 and Bug#13012).
827 (mode_line_update_needed): New function.
828 (redisplay_internal, redisplay_window): Use it.
829 (ensure_selected_frame): New function.
830 (redisplay_internal, unwind_redisplay): Use it.
831 (redisplay_internal): Move comment about buffer_shared...
832 (buffer_shared_and_changed): ...near to its real use.
833
4a9204fe
PE
8342012-11-29 Paul Eggert <eggert@cs.ucla.edu>
835
836 * callproc.c (Fcall_process): Don't misreport vfork failure.
837
60aeceb8
PE
8382012-11-28 Paul Eggert <eggert@cs.ucla.edu>
839
840 * callproc.c (Fcall_process): Fix vfork portability problems.
841 Do not assume that fd[0], count, filefd, and save_environ survive
842 vfork. Fix bug whereby wrong errno value could be reported for
843 pipe failure. Some minor cleanups, too, as follows. Move buf and
844 bufsize to the context where they're needed. Change new_argv to
845 be of type char **, as this is more convenient and avoids casts.
846 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
847 Now local constants, not macros.
848
00dc3ead
KH
8492012-11-18 Kenichi Handa <handa@gnu.org>
850
851 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
852 for the variable "f".
853
e1bf05c1
KH
8542012-11-13 Kenichi Handa <handa@gnu.org>
855
856 * font.c (font_unparse_xlfd): Exclude special characters from the
857 generating XLFD name.
858
22626a85
PE
8592012-11-27 Paul Eggert <eggert@cs.ucla.edu>
860
350e0088
PE
861 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
862 * dired.c (stat_uname, stat_gname):
863 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
864
22626a85
PE
865 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
866 * dired.c (directory_files_internal, file_name_completion):
867 Assume EAGAIN and EINTR are defined.
350e0088 868
22626a85
PE
869 * fileio.c (Fcopy_file): Assume EISDIR is defined.
870 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
871 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
872 * lread.c (readbyte_from_file): Assume EINTR is defined.
873 * process.c (wait_reading_process_output, send_process) [subprocesses]:
874 Assume EIO and EAGAIN are defined.
875 * unexcoff.c (write_segment): Assume EFAULT is defined.
876
5c9cf0a3 8772012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
878
879 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
880 (Bug#11964)
881
22294a56
EZ
882 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
883 highlighting on the frame was cleared. Prevents assertion
884 violations when repeatedly clicking on the "Top" link of the
885 "bread-crumbs" in Info buffers.
886
5fbab051
PE
8872012-11-25 Paul Eggert <eggert@cs.ucla.edu>
888
889 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
890
bcd77a2b
KB
8912012-11-24 Ken Brown <kbrown@cornell.edu>
892
893 * keyboard.c (HAVE_MOUSE):
894 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
895 were always defined.
896
d125ca15 8972012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 898
24becea4
EZ
899 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
900 between bpos_covered and bpos_max. This fixes cursor display when
901 several display strings follow each other.
902
8654a41b
EZ
903 * .gdbinit (pgx): If the glyph's object is a string, display the
904 pointer to string data, rather than the value of the string object
905 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
906
cb5867b1
EZ
907 * indent.c (Fvertical_motion): If the starting position is covered
908 by a display string, return to one position before that, to avoid
909 overshooting it inside move_it_to. (Bug#12930)
910
f418b22e
DA
9112012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
912
913 * frame.h (struct frame): Remove display_preempted member
914 since all users are dead long ago.
915 * nsterm.h (struct x_output): Use the only dummy member.
916 * w32menu.c (pending_menu_activation): Remove since not
917 really used.
918 (set_frame_menubar): Adjust user.
919 * w32term.h (struct x_output): Drop outdated #if 0 code.
920 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
921 asked_for_visible and menubar_active members.
922 Drop unused pending_menu_activation member.
f418b22e
DA
923 * xterm.h (struct x_output): Drop outdated #if 0 code.
924 Use bitfields for explicit_parent, asked_for_visible,
925 has_been_visible and net_wm_state_hidden_seen members.
926
a879f0ea
EZ
9272012-11-23 Eli Zaretskii <eliz@gnu.org>
928
929 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
930 of a literal "/". (Bug#12955)
931 (gl-stamp): Invoke fc.exe directly, not through cmd.
932
95ef7787
PE
9332012-11-23 Paul Eggert <eggert@cs.ucla.edu>
934
935 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
936 * dired.c: Assume HAVE_DIRENT_H.
937 (NAMLEN): Remove, replacing with ...
938 (dirent_namelen): New function. All uses changed. Use the GNU macro
939 _D_EXACT_NAMELEN if available, as it's faster than strlen.
940 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
941 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
942 * makefile.w32-in (DIR_H): Remove. All uses replaced with
943 $(NT_INC)/dirent.h.
944 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
945 * ndir.h: Rename to ../nt/inc/dirent.h.
946 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
947 Do not include <dirent.h>; no longer needed.
948 * w32.c: Include <dirent.h> rather than "ndir.h".
949
12645ae6
CY
9502012-11-23 Chong Yidong <cyd@gnu.org>
951
952 * xftfont.c (xftfont_open): Remove duplicate assignment.
953
5c747675
DA
9542012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
955
956 * alloc.c (Fgarbage_collect): Unblock input after clearing
957 gc_in_progress to avoid note_mouse_highlight glitch with GC.
958 * frame.h (FRAME_MOUSE_UPDATE): New macro.
959 * msdos.c (IT_frame_up_to_date): Use it here...
960 * w32term.c (w32_frame_up_to_date): ...here...
961 * xterm.c (XTframe_up_to_date): ...and here...
962 * nsterm.m (ns_frame_up_to_date): ...but not here.
963 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
964 Adjust users.
965 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
966 Do not check whether GC is in progress.
967
6ceeb5f1
DA
9682012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
969
970 * xdisp.c (window_buffer_changed): New function.
971 (update_menu_bar, update_tool_bar): Use it to
972 simplify large 'if' statements.
973 (redisplay_internal): Generalize commonly used
974 'tail' and 'frame' local variables.
975
ec84768f
EZ
9762012-11-22 Eli Zaretskii <eliz@gnu.org>
977
978 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
979 with Windows system header.
980
9239d970
PE
9812012-11-21 Paul Eggert <eggert@cs.ucla.edu>
982
983 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
984 * alloc.c: Assume unistd.h exists.
985 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
986 * sysdep.c (get_current_dir_name): Assume getcwd exists.
987 (getwd) [USG]: Remove; no longer needed.
988 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
989 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
990 * w32.h (getcwd): Remove decl.
991
954bba56
SM
9922012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
993
994 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
995 Make it set selected_window as well.
996 (update_tool_bar): Use it.
997
6ef2e5ef 9982012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
999
1000 * emacs.c (main): Set the G_SLICE environment variable for all
1001 Cygwin builds, not just GTK builds. See
1002 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
1003
6ef2e5ef 10042012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
1005
1006 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
1007 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
1008 Define for the MSVC compiler.
1009
6ef2e5ef 1010 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
1011
1012 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
1013 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
1014 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
1015 dostounix_filename assumes it gets a unibyte string.
1016 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
1017 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
1018
eadf1faa
SM
10192012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1020
1021 Conflate Qnil and Qunbound for `symbol-function'.
1022 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
1023 * lread.c (init_obarray): Set `function' fields to Qnil.
1024 * eval.c (Fcommandp): Ignore Qunbound.
1025 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
1026 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
1027 Test NILP rather than Qunbound.
1028 (Ffmakunbound): Set to Qnil.
1029 (Fsymbol_function): Never signal an error.
1030 (Finteractive_form): Ignore Qunbound.
1031
b83fdfa9
PE
10322012-11-20 Paul Eggert <eggert@cs.ucla.edu>
1033
1034 * eval.c (interactive_p): Remove no-longer-used decl.
1035
952580c5
DA
10362012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
1037
1038 * xdisp.c (buffer_shared): Adjust comment.
1039 (buffer_shared_and_changed): New function.
1040 (prepare_menu_bars, redisplay_internal): Use it to
1041 decide whether all windows or frames should be updated.
ea6de9b1
DA
1042 (window_outdated): New function.
1043 (text_outside_line_unchanged_p, redisplay_window): Use it.
1044 (redisplay_internal): Likewise. Fix indentation.
952580c5 1045
23ba2705
SM
10462012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1047
1048 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
1049 (syms_of_eval): Remove corresponding defsubr.
1050 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
1051
6e9f7997
DC
10522012-11-19 Daniel Colascione <dancol@dancol.org>
1053
1054 * w32fns.c (Fx_file_dialog):
1055 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
1056 cygwin_convert_file_name*.
1057
1058 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
1059 Rename cygwin_convert_path* to cygwin_convert_file_name*.
1060
552a1590
PE
10612012-11-18 Paul Eggert <eggert@cs.ucla.edu>
1062
1063 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
1064
2ac9538d 10652012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
1066
1067 * w32select.c: Include w32common.h before w32term.h, so that
1068 windows.h gets included before w32term.h uses some of its
1069 features, see below.
1070
23ba2705
SM
1071 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
1072 New typedefs.
1073 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
1074 New prototypes.
d8715cdf
EZ
1075 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
1076
2ac9538d 10772012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
1078
1079 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
1080 (ns_select): Return at once if events are held (Bug#12834).
1081
2ac9538d 10822012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 1083
1084 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
1085 Needed following 2012-10-20 change. (Bug#12902)
1086
c1f7ba3a
JB
10872012-11-18 Juanma Barranquero <lekktu@gmail.com>
1088
1089 * w32proc.c (waitpid): Remove unused label get_result.
1090
a75ce9d3
JB
10912012-11-17 Juanma Barranquero <lekktu@gmail.com>
1092
1093 * makefile.w32-in (SYSWAIT_H): New macro.
1094 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
1095 ($(BLD)/sysdep.$(O)): Update dependencies.
1096
49cdacda
PE
10972012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1098
1099 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
1100 * callproc.c (relocate_fd): Assume F_DUPFD.
1101 * emacs.c, term.c (O_RDWR): Remove.
1102 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
1103 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
1104 * nsterm.m: Assume <fcntl.h> exists.
1105 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
1106 (create_pty, Fmake_network_process, server_accept_connection)
1107 (wait_reading_process_output, init_process_emacs):
1108 Assume O_NONBLOCK.
1109 (wait_reading_process_output): Put in a special case for WINDOWSNT
1110 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
1111 It's not clear this is needed, but it's a more-conservative change.
1112 (create_process): Assume FD_CLOEXEC.
1113 (create_process, create_pty): Assume O_NOCTTY.
1114 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
1115 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
1116 Omit if not DOS_NT, since F_GETFL is not defined there.
1117 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
1118 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
1119 (O_NOCTTY): Remove.
1120 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
1121 lack it, since gnulib guarantees this.
1122 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
1123
22bae83f
EZ
11242012-11-17 Eli Zaretskii <eliz@gnu.org>
1125
6ad30855
EZ
1126 * w32.c (faccessat): Pretend that directories have the execute bit
1127 set. Emacs expects that, e.g., in files.el:cd-absolute.
1128
22bae83f
EZ
1129 * w32proc.c (create_child): Don't clip the PID of the child
1130 process to fit into an Emacs integer, as this is no longer a
1131 restriction.
1132 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
1133 reaping only the process specified by PID argument, if that is
1134 positive. Use PID instead of dead_child to know which process to
1135 reap. Wait for the child to die only if WNOHANG is not in
1136 OPTIONS.
1137 (sys_select): Don't set dead_child.
1138
1139 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
1140 as it is no longer needed.
1141
1142 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
1143 no longer needed.
1144 (record_child_status_change): Remove the setting of
1145 record_at_most_one_child for the !WNOHANG case.
1146
a631d0e0
PE
11472012-11-17 Paul Eggert <eggert@cs.ucla.edu>
1148
1149 Fix problems in ns port found by static checking.
1150 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
1151 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
1152 not to process group.
1153 (ns_select): Use emacs_write, not write, as that's more robust
1154 in the presence of signals.
1155 (fd_handler:): Check for read errors.
1156
d56f2e49
GM
11572012-11-16 Glenn Morris <rgm@gnu.org>
1158
1159 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
1160
96e05507 11612012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
1162
1163 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
1164
96e05507 11652012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
1166
1167 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
1168 use the same value of thread handle.
1169 (start_timer_thread): If the timer thread exited (due to error),
1170 clean up by closing the two handles it used. Duplicate the caller
1171 thread's handle here, so it gets duplicated only once, when
1172 launching the timer thread. Set priority of the timer thread, not
1173 the caller thread.
1174 (getitimer): Don't duplicate the caller thread's handle here.
1175 (Bug#12832)
1176
96e05507 11772012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
1178
1179 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
1180 called (Bug#12834).
1181
3d082a26
PE
11822012-11-16 Paul Eggert <eggert@cs.ucla.edu>
1183
1184 Remove no-longer-used pty_max_bytes variable.
1185 * process.c (pty_max_bytes): Remove; unused.
1186 (send_process): Do not set it.
1187
b72c161c
JB
11882012-11-15 Juanma Barranquero <lekktu@gmail.com>
1189
1190 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
1191 Update dependencies.
1192
bf20ea80
PE
11932012-11-15 Paul Eggert <eggert@cs.ucla.edu>
1194
1195 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
1196 This follows up on the 2012-09-29 patch that removed indirection
1197 for the 'function' field. Reported by Sergey Vinokurov in
1198 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
1199
14f20728
EZ
12002012-11-14 Eli Zaretskii <eliz@gnu.org>
1201
1202 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
1203 different name, as the MS runtime does not have such a function,
1204 and probably never will.) All callers changed. Ignore DIRFD
1205 value if PATH is an absolute file name, to match Posix spec
1206 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
1207 symlinks.
1208
77731919
DA
12092012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
1210
1211 * xdisp.c (echo_area_display, redisplay_internal):
1212 Omit redundant check whether frame_garbaged is set.
1213
73dcdb9f
PE
12142012-11-14 Paul Eggert <eggert@cs.ucla.edu>
1215
1216 Use faccessat, not access, when checking file permissions (Bug#12632).
1217 This fixes a bug that has been present in Emacs since its creation.
1218 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
1219 which must set some sort of record. (Torek's bug report was against
1220 a predecessor of GNU Emacs, but GNU Emacs happened to have the
1221 same common flaw.) See Torek's Usenet posting
1222 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
1223 Posted: Fri Apr 8 14:18:56 1983.
1224 * Makefile.in (LIB_EACCESS): New macro.
1225 (LIBES): Use it.
1226 * callproc.c (init_callproc):
1227 * charset.c (init_charset):
1228 * fileio.c (check_existing, check_executable, check_writable)
1229 (Ffile_readable_p):
1230 * lread.c (openp, load_path_check):
1231 * process.c (allocate_pty):
1232 * xrdb.c (file_p):
1233 Use effective UID when checking permissions, not real UID.
1234 * callproc.c (init_callproc):
1235 * charset.c (init_charset):
1236 * lread.c (load_path_check, init_lread):
1237 Test whether directories are accessible, not merely whether they exist.
1238 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
1239 * fileio.c (check_existing, check_executable, check_writable)
1240 (Ffile_readable_p):
1241 Use symbolic names instead of integers for the flags, as they're
1242 portable now.
1243 (check_writable): New arg AMODE. All uses changed.
1244 Set errno on failure.
1245 (Ffile_readable_p): Use faccessat, not stat + open + close.
1246 (Ffile_writable_p): No need to call check_existing + check_writable.
1247 Just call check_writable and then look at errno. This saves a syscall.
1248 dir should never be nil; replace an unnecessary runtime check
1249 with an eassert. When checking the parent directory of a nonexistent
1250 file, check that the directory is searchable as well as writable, as
1251 we can't create files in unsearchable directories.
1252 (file_directory_p): New function, which uses 'stat' on most platforms
1253 but faccessat with D_OK (for efficiency) if WINDOWSNT.
1254 (Ffile_directory_p, Fset_file_times): Use it.
1255 (file_accessible_directory_p): New function, which uses a single
1256 syscall for efficiency.
1257 (Ffile_accessible_directory_p): Use it.
1258 * xrdb.c (file_p): Use file_directory_p.
1259 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
1260 * lread.c (openp): When opening a file, use fstat rather than
1261 stat, as that avoids a permissions race. When not opening a file,
1262 use file_directory_p rather than stat.
1263 (dir_warning): First arg is now a usage string, not a format.
1264 Use errno. All uses changed.
1265 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
1266 that merely introduced a race.
1267 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
1268 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
1269 and similarly for the other O_* flags.
1270 * w32.c (sys_faccessat): Rename from sys_access and switch to
1271 faccessat's API. All uses changed.
1272 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
1273 (magic_db): Rename from magic_file_p.
1274 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1275 char *, so that we don't have to test for file existence
1276 separately from opening the file for reading. This removes a race
1277 fixes a permission-checking problem, and simplifies the code.
1278 All uses changed.
1279 (file_p): Remove; no longer needed.
1280
2a14f83b
DA
12812012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1282
1283 Omit glyphs initialization at startup.
1284 * dispnew.c (glyphs_initialized_initially_p): Remove.
1285 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1286 (Fredraw_frame): Move actual code from here...
c7085245 1287 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
1288 (Fredraw_display): Use redraw_frame.
1289 * xdisp.c (clear_garbaged_frames): Likewise.
1290
f78ee6af 12912012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
1292
1293 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1294 passed to pint2str and pint2hrstr to be at most the size of the
1295 frame's decode_mode_spec_buffer. This avoids crashes with very
1296 large values of FIELD_WIDTH argument to decode_mode_spec.
1297 (Bug#12867)
1298
b95a9c0c
PE
12992012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1300
1301 Fix a race with verify-visited-file-modtime (Bug#12863).
1302 Since at least 1991 Emacs has ignored an mtime difference of no
1303 more than one second, but my guess is that this was to work around
1304 file system bugs that were fixed long ago. Since the race is
1305 causing problems now, let's remove that code.
1306 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1307 whose time stamp is off by no more than a second. Insist that the
1308 file time stamps match exactly.
1309
be49ba74
DA
13102012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1311
1312 * frame.h (struct frame): Convert external_tool_bar member to
1313 1-bit unsigned bitfield.
1314 * termhooks.h (struct terminal): Remove mouse_moved member since
1315 all users are long dead. Adjust comment on mouse_position_hook.
1316
5b04e9f9
DA
13172012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1318
1319 Simplify by using FOR_EACH_FRAME here and there.
1320 * frame.c (next_frame, prev_frame, other_visible_frames)
1321 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1322 * w32term.c (x_window_to_scroll_bar): Likewise.
1323 * window.c (window_list): Likewise.
1324 * xdisp.c (x_consider_frame_title): Likewise.
1325 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1326 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1327 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1328 * xmenu.c (menubar_id_to_frame): Likewise.
1329 * xselect.c (frame_for_x_selection): Likewise.
1330 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1331 (x_window_to_menu_bar): Likewise.
1332 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1333
76ae24d7
PE
13342012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1335
12cc4337
PE
1336 * data.c (Qdefalias_fset_function): Now static.
1337
76ae24d7
PE
1338 Another tweak to vectorlike_header change.
1339 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1340 Remove, and replace all uses with ...
1341 (next_in_free_list, set_next_in_free_list):
1342 New functions, which respect C's aliasing rules better.
1343
1479c557
PE
13442012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1345
1346 * window.c (list4i): Rename from 'quad'. All uses changed.
1347 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1348
11235c03
JB
13492012-11-11 Juanma Barranquero <lekktu@gmail.com>
1350
1351 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1352 warning about mixing declarations and code in ISO C90.
1353
6baf66d5 13542012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
1355
1356 * window.c (Fsplit_window_internal): Set combination limit of
1357 new parent window to t iff Vwindow_combination_limit is t;
1358 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 1359 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 1360
6baf66d5 13612012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
1362
1363 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1364 amount when the scroll margins are too large. When scrolling
1365 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
1366 scroll margin within a reasonable number of screen lines.
1367 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
1368 point is positioned many lines beyond the window top/bottom.
1369 (Bug#12811)
1370
508f51f5
EZ
1371 * ralloc.c (relinquish): If real_morecore fails to return memory
1372 to the system, don't crash; instead, leave the last heap
1373 unchanged and return. (Bug#12774)
1374
32e5c58c
SM
13752012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1376
1377 * lisp.h (AUTOLOADP): New macro.
1378 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1379 * data.c (Ffset): Remove special ad-advice-info handling.
1380 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1381 (Fsubr_arity): CSE.
1382 (Finteractive_form): Simplify.
1383 (Fquo): Don't insist on having at least 2 arguments.
1384 (Qdefalias_fset_function): New var.
1385
719b0aa5
JD
13862012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1387
4ab15c3e
JD
1388 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1389
719b0aa5
JD
1390 * nsfont.m (Qcondensed, Qexpanded): New variables.
1391 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1392 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1393
535cc8e9
DA
13942012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1395
1396 Fix recently introduced crash on MS-Windows (Bug#12839).
1397 * w32term.h (struct scroll_bar): Use convenient header.
1398 (SCROLL_BAR_VEC_SIZE): Remove.
1399 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1400
7d377c48
DA
14012012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1402
1403 Tweak last vectorlike_header change.
1404 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1405 vectorlike object on the free list. This is introduced to avoid
1406 some (but not all) pointer casting and aliasing problems, see
1407 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1408 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1409 objects.
1410 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1411
7ad27466
JD
14122012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1413
32e5c58c 1414 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
1415 been removed, so remove them here also.
1416
57618ecf
SM
14172012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1418
1419 * doc.c (Fdocumentation): Handle new property
1420 dynamic-docstring-function to replace the old ad-advice-info.
1421
53371430
PE
14222012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1423
1424 * fns.c (Qeql, hashtest_eq): Now static.
1425
61ddb1b9
SM
14262012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1427
1428 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1429 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1430 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1431 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1432
04a2d0d3
PE
14332012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1434
1435 Use same hash function for hashfn_profiler as for hash_string etc.
1436 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1437 * lisp.h (sxhash_combine): New inline function, with the contents
1438 of the old SXHASH_COMBINE.
1439 * profiler.c (hashfn_profiler): Use it, instead of having a
1440 special hash function containing a comparison that always yields 1.
1441
de5ef41a
SM
14422012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1443
1444 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1445 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1446 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1447 Remove unused vars.
1448
a23c4171
JD
14492012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1450
1451 * image.c (xpm_make_color_table_h): Fix compiler error because
1452 make_hash_table changed.
1453
074d7bb0
JD
14542012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1455
1456 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1457
b7432bb2
SM
14582012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1459
1460 Use ad-hoc comparison function for the profiler's hash-tables.
1461 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1462 (make_log): Use them.
1463 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1464 call Fequal any more.
1465 (Ffunction_equal): New function.
1466 (cmpfn_profiler, hashfn_profiler): New functions.
1467 (syms_of_profiler): Initialize them.
1468 * lisp.h (struct hash_table_test): New struct.
1469 (struct Lisp_Hash_Table): Use it.
1470 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1471 * fns.c (make_hash_table): Take a struct to describe the test.
1472 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1473 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1474 (hash_lookup, hash_remove_from_table): Move assertion checking of
1475 hashfn result here. Check hash-equality before calling cmpfn.
1476 (Fmake_hash_table): Adjust call to make_hash_table.
1477 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1478 (syms_of_fns): Initialize them.
1479 * emacs.c (main): Move syms_of_fns earlier.
1480 * xterm.c (syms_of_xterm):
1481 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1482 * print.c (print_object): Adjust to new hash-table struct.
1483 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1484
88002743
EZ
14852012-11-08 Eli Zaretskii <eliz@gnu.org>
1486
1487 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1488 value of w32-scroll-lock-modifier is neither nil nor one of the
1489 known key modifiers. (Bug#12806)
1490
914adc42
DA
14912012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1492
1493 Shrink struct vectorlike_header to the only size field.
1494 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1495 Adjust comment.
1496 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1497 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1498 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1499 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1500 information from the vector header. Adjust comment.
1501 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1502 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1503 layout.
1504 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1505 (struct vectorlike_header): Remove next member. Adjust comment.
1506 (struct Lisp_Subr): Add convenient header. Adjust comment.
1507 (allocate_pseudovector): Adjust prototype.
1508 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1509 (sweep_string, lisp_malloc): Remove useless prototypes.
1510 (enum mem_type): Adjust comment.
1511 (NEXT_IN_FREE_LIST): New macro.
1512 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1513 (Fmake_bool_vector): Likewise.
1514 (struct large_vector): New type to represent allocation unit for
1515 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1516 (large_vectors): Change type to struct large_vector.
1517 (allocate_vector_from_block): Simplify.
1518 (PSEUDOVECTOR_NBYTES): Replace with...
1519 (vector_nbytes): ...new function. Adjust users.
1520 (sweep_vectors): Adjust processing of large vectors.
1521 (allocate_vectorlike): Likewise.
1522 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1523 Add easserts. Adjust XSETPVECTYPESIZE usage.
1524 (allocate_buffer): Use BUFFER_PVEC_INIT.
1525 (live_vector_p): Adjust to match large vector.
1526 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1527 * buffer.h (struct buffer): Add next member.
1528 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1529 New macros.
1530 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1531 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1532 (copy_hash_table): Adjust to match vector header change.
1533 * lread.c (defsubr): Use XSETPVECTYPE.
1534 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1535 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1536 (xvecsize): New command.
1537
c66f21ea
DA
15382012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1539
1540 * keyboard.c (event_to_kboard): Do not dereference
1541 frame_or_window field of SELECTION_REQUEST_EVENT
1542 and SELECTION_CLEAR_EVENT events (Bug#12814).
1543 * xterm.h (struct selection_input_event): Adjust comment.
1544
eb147960
EZ
15452012-11-07 Eli Zaretskii <eliz@gnu.org>
1546
dab72075
EZ
1547 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1548 such as Scroll Lock, if the respective keys are treated as
1549 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 1550 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 1551
5890e400
DA
15522012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1553
1554 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1555
b6b3b294
PE
15562012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1557
1558 Restore some duplicate definitions (Bug#12814).
1559 This undoes part of the 2012-11-03 changes. Some people build
1560 with plain -g rather than with -g3, and they need the duplicate
1561 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1562 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1563 Define as macros, as well as as enums or as constants.
1564
e770aad5
JD
15652012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1566
1567 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1568 to keypad keys (Bug#12816).
1569
68f8f1c0
PE
15702012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1571
1572 Minor adjustments of recently-changed frame functions.
1573 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1574 known to be a frame (we're in the FRAMEP branch).
1575 * lisp.h (Qframep): Remove decl. frame.h declares this.
1576 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1577 since they're meant for Lisp fixnum values.
1578
72f94d4b
DA
15792012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1580
1581 * window.c (Fwindow_combination_limit): Revert to the only
1582 required argument and adjust docstring as suggested in
1583 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1584 by Martin Rudalics <rudalics@gmx.at>.
1585
d9f07150
DA
15862012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1587
1588 Widely used frame validity and checking functions.
1589 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1590 * frame.c (decode_live_frame, decode_any_frame): New functions.
1591 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1592 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1593 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1594 (Fframe_pointer_visible_p): Use decode_any_frame.
1595 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1596 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1597 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1598 (Fframe_focus): Likewise. Allow zero number of arguments.
1599 Adjust docstring.
1600 (frame_buffer_list, frame_buffer_predicate): Remove.
1601 * lisp.h (frame_buffer_predicate): Remove prototype.
1602 * buffer.c (Fother_buffer): Use decode_any_frame.
1603 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1604 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1605 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1606 (Fclose_font, Ffont_info): Use decode_live_frame.
1607 * fontset.c (check_fontset_name): Likewise.
1608 * terminal.c (Fframe_terminal): Likewise.
1609 * w32fns.c (check_x_frame): Likewise.
1610 * window.c (Fminibuffer_window, Fwindow_at)
1611 (Fcurrent_window_configuration): Likewise.
1612 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1613 Likewise. Allow zero number of arguments. Adjust docstring.
1614 * dispnew.c (Fredraw_frame): Likewise.
1615 * xfaces.c (frame_or_selected_frame): Remove.
1616 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1617 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1618 (Fframe_face_alist): Use decode_live_frame.
1619 * xfns.c (check_x_frame): Likewise.
1620
89bc0592
DA
16212012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1622
1623 * window.c (quad): New function.
1624 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1625 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1626 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1627 (Fwindow_line_height): Use it.
1628 (Fwindow_fringes): Use list3.
1629 (Fwindow_scroll_bars): Use list4.
1630 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1631 (Fwindow_combination_limit): Allow zero number of arguments.
1632
c8e3a9c3
EZ
16332012-11-05 Eli Zaretskii <eliz@gnu.org>
1634
1635 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1636
8e2417bf 1637 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 1638 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 1639 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 1640
209c6a58
CY
16412012-11-05 Chong Yidong <cyd@gnu.org>
1642
1643 * process.c (wait_reading_process_output): Revert previous change.
1644
8148369c
PE
16452012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1646
dd0333b6
PE
1647 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1648 This removes code that has been obsolete since around 1990.
1649 * callproc.c (Fcall_process):
1650 * emacs.c (main):
1651 * process.c (create_process):
1652 * term.c (dissociate_if_controlling_tty):
1653 Assume setsid exists.
1654 * callproc.c (child_setup): Assume setpgid exists and behaves as
1655 per POSIX.1-1988 or later.
1656 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1657 * emacs.c (shut_down_emacs):
1658 * sysdep.c (sys_suspend, init_foreground_group):
1659 Assume getpgrp behaves as per POSIX.1-1998 or later.
1660 * msdos.c (setpgrp): Remove.
1661 (tcgetpgrp, setpgid, setsid): New functions.
1662 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1663 * term.c (no_controlling_tty): Remove; unused.
1664 * w32proc.c (setpgrp): Remove.
1665 (setsid, tcgetpgrp): New functions.
1666
8148369c
PE
1667 Simplify by assuming __fpending.
1668 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1669 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1670 Do not assume that __fpending's result fits in int.
1671
76abf5e5
PE
16722012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1673
06b63c9b
PE
1674 Remove EMACS_OUTQSIZE+sleep hack.
1675 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
1676 than 2400 bps, which throttled Emacs by having it sleep.
1677 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
1678 was added, and anyway those old terminals are long dead.
1679 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1680 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1681
76abf5e5
PE
1682 Fix data-loss with --version (Bug#9574).
1683 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1684 as we can't assume that emacs_strerror is initialized, and strerror
1685 is good enough here.
1686 (main): Invoke atexit earlier, to catch earlier instances of
1687 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1688
8f31e74b
MM
16892012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1690
1691 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1692 (keyDown): Remap keypad keys to X11 virtual key codes.
1693
0d879dca
PE
16942012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1695
7ccfb720
PE
1696 Fix data-loss with --batch (Bug#9574).
1697 * emacs.c: Include <close-stream.h>.
1698 (close_output_streams): New function.
1699 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1700 and handles errors appropriately.
1701 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1702 does that now.
1703
0b3d4a47
PE
1704 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1705 The symptom is a diagnostic "GLib-WARNING **: In call to
1706 g_spawn_sync(), exit status of a child process was requested but
1707 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1708 waitpid(), so exit status can't be returned." The diagnostic
1709 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1710 The real bug is a race condition between Emacs and glib: Emacs
1711 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1712 so that glib can't find it. Work around the bug by invoking
1713 waitpid only on subprocesses that Emacs itself creates.
1714 * process.c (create_process, record_child_status_change):
1715 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
1716 know the pid rather than having the callee infer it.
1717 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
1718 (create_process): Set new 'alive' member if child is created.
1719 (process_status_retrieved): New function.
1720 (record_child_status_change): Use it.
1721 Accept negative 1st argument, which means to wait for the
1722 processes that Emacs already knows about. Move special-case code
1723 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1724 processes that have already been waited for, by testing and
1725 clearing new 'alive' member.
1726 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1727 now does this internally.
1728 (handle_child_signal): Let record_child_status_change do all
1729 the work, since we do not want to reap all exited child processes,
1730 only the child processes that Emacs itself created.
1731 * process.h (Lisp_Process): New boolean member 'alive'.
1732
0d879dca
PE
1733 Omit duplicate definitions no longer needed with gcc -g3.
1734 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1735 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1736 Define only as macros. There's no longer any need to also define
1737 these symbols as enums or as constants, since we now assume
1738 gcc -g3 when debugging.
1739
3478f4b5
EZ
17402012-11-03 Eli Zaretskii <eliz@gnu.org>
1741
1742 * lisp.mk: Adjust comments to the fact that term/internal is now
1743 loaded from loadup.el.
1744
1745 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1746 (msdos_fatal_signal): New function.
1747 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1748 its argument list.
1749
1750 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1751 for GCC versions before 4.
1752 (emacs_raise): Define to call msdos_fatal_signal.
1753
1754 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1755 iterator when starting in the middle of a display or overlay
1756 string. (Bug#12745)
1757
85fabcb7
CY
17582012-11-03 Chong Yidong <cyd@gnu.org>
1759
1760 * process.c (wait_reading_process_output): Clean up the last
1761 change.
1762
893cc455
CY
17632012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1764
1765 * process.c (wait_reading_process_output): Avoid a race condition
1766 with SIGIO delivery (Bug#11536).
1767
0f7b074f
CY
17682012-11-03 Chong Yidong <cyd@gnu.org>
1769
1770 * buffer.c (cursor_type): Untabify docstring.
1771
3737fee7
DA
17722012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1773
1774 * frame.h (struct frame): Drop can_have_scroll_bars member
1775 which is meaningless for a long time. Adjust comments.
1776 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1777 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1778
b6a9e8b1
DA
17792012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1780
1781 * window.c (decode_next_window_args): Update window arg after
1782 calling decode_live_window and so fix crash reported at
1783 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1784 by Juanma Barranquero <lekktu@gmail.com>.
1785 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1786 * font.c (Ffont_at): Likewise.
1787
600d4768
JD
17882012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1789
1790 * widget.c (resize_cb): New function.
1791 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1792 (EmacsFrameResize): Check if all is up to date before changing frame
1793 size.
1794
1005b4b9
EZ
17952012-11-02 Eli Zaretskii <eliz@gnu.org>
1796
1797 Implement backtrace output for fatal errors on MS-Windows.
1798 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1799 (BACKTRACE_LIMIT_MAX): New macro.
1800 (w32_backtrace): New function.
1801 (emacs_abort): Use w32_backtrace when the user chooses not to
1802 attach a debugger. Update the text of the abort dialog.
1803
b9e9df47
DA
18042012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1805
1806 Window-related stuff cleanup here and there.
1807 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1808 Use decode_any_window.
1809 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1810 * xdisp.c (Fformat_mode_line): Likewise.
1811 * font.c (Ffont_at): Use decode_live_window.
1812 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1813 * window.c (decode_next_window_args): Likewise.
1814 (decode_any_window): Remove static.
1815 * window.h (decode_any_window): Add prototype.
1816 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1817 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1818 respectively.
1819
2b371ff7
DA
18202012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1821
1822 Remove pad from struct input_event.
1823 * termhooks.h (struct input_event): Remove padding field.
1824 Adjust comment.
1825 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1826 member is never cons for a long time. Adjust comment.
1827 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1828 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1829 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1830 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1831
7e8b50d9
EZ
18322012-11-01 Eli Zaretskii <eliz@gnu.org>
1833
1834 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1835
322aea6d
PE
18362012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1837
1838 Fix crash when using Emacs as commit editor for git (Bug#12697).
1839 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1840 and it is configured in conf_post.h.
1841 (Fcall_process): Don't invoke both setsid and setpgid; the former
1842 is enough, if it exists.
1843 * callproc.c (Fcall_process, child_setup):
1844 * process.c (create_process): Use setpgid.
1845 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1846 for the real thing.
1847 * dispnew.c (init_display): Initialize the foreground group
1848 if we are running a tty display.
1849 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1850 * lisp.h (init_foreground_group): New decl.
1851 * sysdep.c (inherited_pgroup): New static var.
1852 (init_foreground_group, tcsetpgrp_without_stopping)
1853 (narrow_foreground_group, widen_foreground_group): New functions.
1854 (init_sys_modes): Narrow foreground group.
1855 (reset_sys_modes): Widen foreground group.
1856
220cb2bd
MA
18572012-10-31 Michael Albinus <michael.albinus@gmx.de>
1858
1859 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1860
218e997a
MR
18612012-10-31 Martin Rudalics <rudalics@gmx.at>
1862
1863 * minibuf.c (read_minibuf): Restore current buffer since
1864 choose_minibuf_frame calling Fset_frame_selected_window may
1865 change it (Bug#12766).
1866
02615da0
JD
18672012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1868
1869 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1870
aee5b18e
KH
18712012-10-30 Kenichi Handa <handa@gnu.org>
1872
1873 * font.c (Ffont_at): If WINDOW is specified and it is not
1874 displaying the current buffer, signal an error.
1875
ba116008
DC
18762012-10-29 Daniel Colascione <dancol@dancol.org>
1877
de5ef41a
SM
1878 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1879 In preparation for fixing bug#12739, move these functions from
ba116008
DC
1880 here...
1881
1882 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
1883 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1884 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 1885
640bf8ad
EZ
18862012-10-28 Eli Zaretskii <eliz@gnu.org>
1887
1888 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1889 (timer_loop, getitimer, setitimer): Use it instead of
1890 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1891 'clock'.
1892 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1893 literal 10000.
1894
64ccff5f
JD
18952012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1896
1897 * nsterm.m (NO_APPDEFINED_DATA): New define.
1898 (last_appdefined_event_data): New variable
1899 (last_appdefined_event): Remove.
1900 (ns_select): Initialize t from last_appdefined_event_data instead
1901 of [last_appdefined_event data1].
1902 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1903 remove last_appdefined_event (Bug#12698).
1904
e483264c
SM
19052012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1906
1907 * frame.c (x_set_font): Catch internal error.
1908
6c16c13e
EZ
19092012-10-27 Eli Zaretskii <eliz@gnu.org>
1910
e483264c
SM
1911 Avoid overflow in w32 implementation of interval timers.
1912 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
1913 actually executes.
1914 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
1915 'volatile ULONGLONG' types. All the other data which was
1916 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
1917 (GetThreadTimes_Proc): New typedef.
1918 (w32_get_timer_time): New function, returns a suitable time value
1919 for the timer.
1920 (timer_loop): Enter critical section when accessing ULONGLONG
1921 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
1922 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1923 Remove unused variable.
6c16c13e
EZ
1924 (init_timers): Initialize s_pfn_Get_Thread_Times.
1925 (start_timer_thread): Don't assign itimer->caller_thread here.
1926 (getitimer): Assign itimer->caller_thread here.
1927 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 1928 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 1929
ccc83f50
EZ
19302012-10-26 Eli Zaretskii <eliz@gnu.org>
1931
1932 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1933 mouse movement events if the menu bar is active. This avoids
1934 producing a busy "hour-glass" cursor by Windows if the mouse
1935 pointer is positioned over a tooltip shown for some menu item.
1936
69deda53
PE
19372012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1938
1939 Don't assume process IDs fit in int.
1940 * emacs.c (shut_down_emacs) [!DOS_NT]:
1941 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1942 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1943 Use pid_t, not int, to store process IDs, as 'int'
1944 is not wide enough on a few platforms (e.g., AIX and IRIX).
1945
7e70a152
KH
19462012-10-23 Kenichi Handa <handa@gnu.org>
1947
1948 The following change is to make face-font-rescale-alist work
1949 correctly for non-ASCII fonts.
1950
1951 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1952 (font_open_for_lface): Handle Vface_font_rescale_alist.
1953
49238e7f
CY
19542012-10-23 Chong Yidong <cyd@gnu.org>
1955
1956 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1957
5ec86886
JD
19582012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1959
ef446959
JD
1960 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1961 for screen font.
1962 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1963
5ec86886
JD
1964 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1965 event (Bug#12681).
1966
ee7a418d
GM
19672012-10-21 Glenn Morris <rgm@gnu.org>
1968
1969 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1970
4973679b
PE
19712012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1972
1973 Port to OpenBSD 5.1.
1974 * frame.c (Fmouse_position, Fmouse_pixel_position):
1975 * xdisp.c (produce_stretch_glyph):
1976 Declare local vars only when they're needed.
1977 This is clearer and avoids a warning on OpenBSD about unused vars.
1978 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1979 This is safer, and avoids OpenBSD warnings about unused vars.
1980 * keyboard.c (record_menu_key): Remove unnecessary decl.
1981 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1982 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1983 as our definition clashes with OpenBSD's.
1984 * xfaces.c (load_face_colors, check_lface_attrs)
1985 (get_lface_attributes_no_remap, get_lface_attributes)
1986 (lface_fully_specified_p, x_supports_face_attributes_p)
1987 (tty_supports_face_attributes_p, face_fontset, realize_face)
1988 (realize_x_face, realize_tty_face):
1989 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1990 merely Lisp_Object *. This is more informative and avoids
1991 a warning on OpenBSD about accessing beyond an object's size.
1992
c664f463
CY
19932012-10-20 Chong Yidong <cyd@gnu.org>
1994
1995 * lread.c (Fload): Doc fix (Bug#12592).
1996
6ec83f92 19972012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
1998
1999 * font.c (Ffont_at): Fix previous change.
2000
d2824928
EZ
20012012-10-19 Eli Zaretskii <eliz@gnu.org>
2002
e483264c
SM
2003 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
2004 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
2005 for the reasons.
2006
d2824928
EZ
2007 * alloc.c (NSTATICS): Decrease to 0x800.
2008
f60d391f
SM
20092012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2010
4a0e1924 2011 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
2012 error (bug#12677).
2013
1a9327d5
JD
20142012-10-18 Jan Djärv <jan.h.d@swipnet.se>
2015
2016 * nsterm.m (ns_select): Check writefds before call to
2017 FD_ISSET (Bug#12668).
2018
14145a1e
DC
20192012-10-18 Daniel Colascione <dancol@dancol.org>
2020
2021 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
2022 (staticpro): If we run out of staticpro slots, die with an
2023 informative error instead of just calling emacs_abort.
2024
1f76f6f5
MR
20252012-10-18 Martin Rudalics <rudalics@gmx.at>
2026
2027 Fix two flaws reported by Dmitry Antipov.
2028 * window.c (Ftemp_output_buffer_show): Remove.
2029 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
2030 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
2031
fcf14875
EZ
20322012-10-17 Eli Zaretskii <eliz@gnu.org>
2033
1f76f6f5
MR
2034 * makefile.w32-in ($(BLD)/w32.$(O)):
2035 ($(BLD)/vm-limit.$(O)):
2036 ($(BLD)/term.$(O)):
2037 ($(BLD)/unexw32.$(O)):
2038 ($(BLD)/fileio.$(O)):
a68089e4
EZ
2039 ($(BLD)/dispnew.$(O)): Update dependencies.
2040
2041 * w32term.h (w32_initialize_display_info, initialize_w32_display):
2042 Add prototypes.
2043
2044 * w32proc.c: Include ctype.h.
2045
2046 * w32.h (init_environment, check_windows_init_file)
2047 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
2048 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
2049 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
2050 (sys_link): Add prototypes.
2051
2052 * w32.c: Include w32select.h.
2053 (sys_access, e_malloc, sys_select): Add prototypes.
2054 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
2055
2056 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
2057
2058 * unexw32.c: Include lisp.h and w32.h.
2059
2060 * term.c [WINDOWSNT]: Include w32term.h.
2061
2062 * process.c [WINDOWSNT]: Add prototype of sys_select.
2063
2064 * fileio.c [WINDOWSNT]: Include w32.h.
2065
2066 * dispnew.c [WINDOWSNT]: Include w32.h.
2067
fcf14875
EZ
2068 * cygw32.c (Fcygwin_convert_path_to_windows)
2069 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
2070 Lisp_Object values. (Bug#12661)
2071
2072 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
2073 to Lisp_Object. (Bug#12661)
2074
fe0b1ec4
KH
20752012-10-17 Kenichi Handa <handa@gnu.org>
2076
2077 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
2078 invalidate.
2079
d556ebf9
DA
20802012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2081
2082 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 2083 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 2084
f0863a54
DA
20852012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
2086
2087 Do not verify indirection counters of killed buffers (Bug#12579).
2088 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
2089 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
2090
12fbe755
DA
20912012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2092
2093 * alloc.c (Fmake_byte_code): Fix typo in comment.
2094 * print.c (print_interval): Define as static to match prototype.
2095 * indent.c (disptab_matches_widthtab, recompute_width_table):
2096 Convert to eassert.
2097
61655b89
DA
20982012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
2099
2100 * editfns.c (get_system_name): Remove.
2101 * lisp.h (get_system_name): Remove prototype.
2102 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
2103 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
2104
9520f2f2
DC
21052012-10-15 Daniel Colascione <dancol@dancol.org>
2106
2107 * dbusbind.c: Add comment explaining reason for previous change.
2108
dca778d5
MR
21092012-10-15 Martin Rudalics <rudalics@gmx.at>
2110
2111 * window.c (Fwindow_end): Rewrite check whether cached position
2112 can be used (Bug#12600).
2113 (resize_frame_windows, grow_mini_window, shrink_mini_window):
2114 Set windows_or_buffers_changed.
2115
3e0341b0
DC
21162012-10-15 Daniel Colascione <dancol@dancol.org>
2117
2118 * dbusbind.c: Fix cygw32 build break when compiling with dbus
2119 enabled by undefining the symbol "interface", which the platform
2120 headers define to something incompatible.
2121
33d4113c
DC
21222012-10-14 Daniel Colascione <dancol@dancol.org>
2123
2124 * image.c (init_tiff_functions, init_imagemagick_functions)
2125 (init_svg_functions): Fix cygw32 build break by using these
2126 functions only when WINDOWSNT _and_ HAVE_NTGUI.
2127
a36fb15e
JD
21282012-10-14 Jan Djärv <jan.h.d@swipnet.se>
2129
2130 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
2131
537f336d
JD
21322012-10-13 Jan Djärv <jan.h.d@swipnet.se>
2133
2134 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
2135
0ba06a77
KH
21362012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
2137
2138 * coding.c (detect_coding): Set coding->id before calling
2139 this->detector.
2140
ce2fe65a
AS
21412012-10-13 Andreas Schwab <schwab@linux-m68k.org>
2142
2143 * fileio.c: Formatting fixes.
2144
d6453ce4
PE
21452012-10-13 Paul Eggert <eggert@cs.ucla.edu>
2146
2147 Fix some stat-related races.
2148 * fileio.c (Fwrite_region): Avoid race condition if a file is
2149 removed or renamed by some other process immediately after Emacs
2150 writes it but before Emacs stats it. Do not assume that stat (or
2151 fstat) succeeds.
2152 * image.c (slurp_file): Resolve the file name with fopen + fstat
2153 rather than stat + fopen.
2154 (pbm_read_file) [0]: Remove unused code with stat race.
2155 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
2156 Remove ineffective code with stat race.
2157
06485aa8
SM
21582012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2159
2160 * doc.c (get_doc_string): Don't signal an error if the file is missing.
2161
167e3640
JD
21622012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2163
2164 * nsterm.m (hold_event_q): New static variable.
2165 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
2166 ! q_event_ptr.
2167 (hold_event): New function.
2168 (ns_read_socket): If hold_event_q have events, store them and
2169 return (Bug#12384).
2170 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
2171 is zero (Bug#12384).
2172
c40239df
JB
21732012-10-12 Juanma Barranquero <lekktu@gmail.com>
2174
2175 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
2176
bb385a92
EZ
21772012-10-12 Eli Zaretskii <eliz@gnu.org>
2178
2a9f1099
EZ
2179 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
2180
bb385a92
EZ
2181 * fileio.c (check_existing): New function.
2182 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
2183 instead of calling 'stat', when what's needed is to check whether
2184 a file exists. This avoids expensive system calls on MS-Windows.
2185 (Bug#12587)
2186
8599b23a 2187 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
2188
2189 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
2190 determine whether a file exists and is not a directory.
2191
2192 * lisp.h (check_existing): Add prototype.
2193
2b9c2e68
JD
21942012-10-12 Jan Djärv <jan.h.d@swipnet.se>
2195
2196 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
2197
81749a23
GM
21982012-10-12 Glenn Morris <rgm@gnu.org>
2199
2200 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
2201
5253a5fd
SM
22022012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2203
389a94a5
SM
2204 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
2205
5253a5fd
SM
2206 * eval.c (Fautoload): Remember previous autoload status in load-history.
2207
7cded46f
PE
22082012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2209
2210 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
2211 * lread.c (load_each_byte, new_backquote_flag, readchar)
2212 (read_filtered_event, lisp_file_lexically_bound_p)
2213 (safe_to_load_version, Fload, complete_filename_p, openp)
2214 (build_load_history, readevalloop, read_escape, read1)
2215 (string_to_number, read_vector, read_list):
2216 * macros.c (Fstart_kbd_macro):
2217 * marker.c (CONSIDER):
2218 * menu.c (parse_single_submenu, digest_single_submenu)
2219 (find_and_return_menu_selection, Fx_popup_menu):
2220 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
2221 (Ftry_completion):
2222 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
2223 (ns_menu_show):
2224 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
2225 (xmenu_show, xdialog_show):
2226 Use bool for booleans.
2227 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
2228 as it's not a predicate. All uses changed. Omit unnecessary
2229 buffer termination.
2230
549c3414
DA
22312012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2232
2233 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
2234 (save_excursion_restore): Do not restore mark if it was not saved.
2235
e85aafe7
PE
22362012-10-11 Paul Eggert <eggert@cs.ucla.edu>
2237
fd2f90cf
PE
2238 * marker.c (cached_modiff): EMACS_INT, not int.
2239
c1af190b
PE
2240 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
2241 instead of having a wrong decl.
e85aafe7
PE
2242 * nsmenu.m (waiting_for_input): Remove wrong decl.
2243
e738ca56
PE
22442012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2245
9fa1de30
PE
2246 keyboard.c, keymap.c: Use bool for booleans.
2247 * dispnew.c (sit_for): Distinguish between 3-way display_option
2248 and boolean do_display.
2249 * keyboard.c (single_kboard, this_command_key_count_reset)
2250 (waiting_for_input, echoing, immediate_quit, input_pending)
2251 (interrupt_input, interrupts_deferred, pop_kboard)
2252 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
2253 (command_loop_1, adjust_point_for_property)
2254 (safe_run_hooks_error, input_polling_used, read_char):
2255 (help_char_p, readable_events, kbd_buffer_events_waiting)
2256 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
2257 (lucid_event_type_list_p, get_input_pending):
2258 (gobble_input, menu_separator_name_p, menu_bar_item)
2259 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
2260 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
2261 (keyremap_step, test_undefined, read_key_sequence)
2262 (detect_input_pending, detect_input_pending_ignore_squeezables)
2263 (detect_input_pending_run_timers, requeued_events_pending_p)
2264 (quit_throw_to_read_char, Fset_input_interrupt_mode):
2265 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
2266 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
2267 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
2268 (accessible_keymaps_1, Fkey_description, push_key_description):
2269 (shadow_lookup, struct where_is_internal_data)
2270 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
2271 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
2272 (describe_map, describe_vector):
2273 * menu.c (single_menu_item):
2274 * nsmenu.m (ns_update_menubar):
2275 * process.c (wait_reading_process_output):
2276 * search.c (scan_buffer, scan_newline):
2277 Use bool for boolean.
2278 * keyboard.c (timers_run, swallow_events)
2279 (detect_input_pending_run_timers):
2280 * process.c (wait_reading_process_output):
2281 Use unsigned for counter where wraparound-on-overflow is desired,
2282 since unsigned is guaranteed to have that behavior and signed is not.
2283 (read_char): Use ptrdiff_t for string length.
2284 (get_input_pending): Remove first argument, since it was always
2285 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2286 and behave as if it had that value. Return new value of
2287 input_pending. All callers changed.
2288 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2289 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2290 a string length.
2291 * keymap.c (push_key_description): Omit last arg, which was always 1.
2292 All callers changed.
2293
e738ca56
PE
2294 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2295
29f21cdf
JB
22962012-10-10 Juanma Barranquero <lekktu@gmail.com>
2297
2298 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2299 ($(BLD)/term.$(O)): Update dependencies.
2300
6aea7528
DA
23012012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2302
2303 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2304 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2305 initializer for PVEC_NORMAL_VECTOR.
2306
5f3f57be
PE
23072012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2308
2309 Clean out old termopts cruft.
2310 * termopts.h (flow_control, meta_key): Remove unused decls.
2311 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2312 Don't include termopts.h.
2313
3e98c68e
DA
23142012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2315
2316 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2317
77e344e5
PE
23182012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2319
2320 * commands.h (immediate_quit): Remove duplicate decl.
2321
5683d7cd
JD
23222012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2323
2324 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2325 caching.
2326 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 2327 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 2328
cf5fc6db
EZ
23292012-10-09 Eli Zaretskii <eliz@gnu.org>
2330
b15736e6
EZ
2331 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2332 match what GetLastError returns. Explain why the function is
2333 needed.
2334
cf5fc6db
EZ
2335 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2336 'is_tooltip_frame', to avoid confusion with its global namesake.
2337
f99714ce
DC
23382012-10-08 Daniel Colascione <dancol@dancol.org>
2339
2340 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
2341 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2342 build that caused Emacs to display the hourglass cursor forever.
f99714ce 2343
fd59cb29
GM
2344 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2345 which is broken under remote desktop, calculate the number of
2346 colors available for a display based on the display's number of
2347 planes and number of bits per pixel per plane. (bug#10397).
2348
62c480c9 23492012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 2350
62c480c9
JD
2351 * nsfont.m (Vfonts_in_cache): New variable.
2352 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2353 are used. Add cached fonts to Vfonts_in_cache.
2354 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2355
607446ba
JB
23562012-10-08 Juanma Barranquero <lekktu@gmail.com>
2357
fd5125ad
JB
2358 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2359 in nt/config.nt.
46979e0b
JB
2360 (FONT_H): Define after FRAME_H.
2361 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2362 Update dependencies.
fd5125ad 2363
607446ba
JB
2364 * w32term.c: Remove leftover declaration of keyboard_codepage.
2365
b6f4e300
EZ
23662012-10-08 Eli Zaretskii <eliz@gnu.org>
2367
c54ebba4
EZ
2368 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2369 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2370 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2371 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
2372 ($(BLD)/unexw32.$(O)):
2373 ($(BLD)/w32.$(O)):
2374 ($(BLD)/w32console.$(O)):
2375 ($(BLD)/w32fns.$(O)):
2376 ($(BLD)/w32heap.$(O)):
2377 ($(BLD)/w32menu.$(O)):
15c720a3 2378 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 2379
b6f4e300
EZ
2380 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2381 'const char *'.
2382 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2383
501199a3
DC
23842012-10-08 Daniel Colascione <dancol@dancol.org>
2385
2386 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2387 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2388 accidental message numbering hole. Change other messages to
2389 match.
2390
2391 * w32select.h (HAVE_W32SELECT): Remove.
2392
2393 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 2394 w32common.h instead of w32heap.h.
501199a3
DC
2395
2396 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2397 (get_allocation_unit, get_processor_type, get_w32_major_version)
2398 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2399 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2400 (OS_NT, os_subtype, cache_system_info): Move declarations to
2401 w32common.
2402
2403 * w32heap.c: Include w32common.h.
2404 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
2405 (w32_minor_version, w32_build_number, w32_subtype):
2406 Remove duplicate definitions.
501199a3
DC
2407
2408 * w32fns.c: Include w32common.h; include w32heap.h only in
2409 WINDOWSNT.
2410
2411 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2412 Use `report_file_error' instead of `error' in order to better
2413 inform users of what went wrong. Increase NTGUI_UNICODE file
2414 dialog box file name length to 32k, the maximum allowed by the NT
2415 kernel.
2416
2417 * w32common.h: New file.
2418 (ROUND_UP, ROUND_DOWN, get_page_size)
2419 (get_allocation_unit, get_processor_type, get_w32_major_version)
2420 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2421 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2422 (OS_NT, os_subtype, cache_system_info): Move here.
2423
2424 * unexw32.c, unexcw.c: Include w32common.h.
2425
2426 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2427 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2428 to call syms_of_w32select.
2429
2430 * cygw32.h: Remove obsolete EXFUN declarations.
2431
2432 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2433
2434 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2435 of w32inevt.o from SOME_MACHINE_OBJECTS.
2436
93aa5c81
DC
24372012-10-08 Daniel Colascione <dancol@dancol.org>
2438
2439 * image.c: Permanent fix for JPEG compilation issue --- limit
2440 jpeglib `boolean' redefinition to Cygwin builds.
2441
d424f3d8
EZ
24422012-10-08 Eli Zaretskii <eliz@gnu.org>
2443
8ee4c6ce
EZ
2444 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2445
d424f3d8
EZ
2446 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2447 Cygwin.
2448
e08348a0
DC
24492012-10-08 Daniel Colascione <dancol@dancol.org>
2450
2451 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2452 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2453 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2454 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2455 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2456 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2457 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2458 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2459 now a supported configuration.
2460
2461 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 2462 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
2463
2464 * conf_post.h:
2465 (_DebPrint) declare tracing facility for W32 debugging. We need
2466 to unify tracing later.
2467
2468 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2469 unconditional use of W32 Unicode functions. Cygwin runs only on
2470 100% Unicode operating systems.
2471
2472 * cygw32.c: New file. Define Cygwin-specific facilities.
2473 (Fcygwin_convert_path_to_windows)
2474 (Fcygwin_convert_path_from_windows): New user functions for
2475 accessing Cygwin path-munging routines.
2476
2477 * cygw32.h: New file.
2478 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2479 UTF-16LE strings temporarily inside non-Lisp-visible string
2480 objects.
2481
2482 (w32_strerror): Just what it says on the tin.
2483
2484 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2485 also run for Cygwin; both systems have the same problem with using
2486 GUI facilities in a forked child. Also call syms_of_cygw32,
2487 syms_of_w32select in correct places.
2488
2489 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2490 needs fork-then-exec for daemon launching.
2491
2492 * font.h: Include frame.h.
2493
2494 * image.c: Use the image library cache machinery only when we're
2495 compiling for native WINDOWSNT; Cygwin can use shared libraries
2496 like any other Unixlike system.
2497
2498 * keyboard.c: Clarify a comment regarding the input loop.
2499
2500 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2501 functions directly instead of trying to detect at runtime that our
2502 host operating system supports them. We make this change for two
2503 reasons: Cygwin lacks support for the multibyte character
2504 conversion functions used by the legacy menu code, and Cygwin
2505 never needs to rely on non-Unicode APIs.
2506
2507 * unexw32.c (hinst): Declare extern.
2508
2509 * w32.c: Change header order;
2510 (w32_strerror): Move to w32fns.c because we need it for
2511 non-WINDOWSNT builds.
2512
2513 * w32.h: Add #error macro to make sure we don't include w32.h for
2514 Cygwin builds. Remove w32select declarations.
2515
2516 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 2517 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
2518
2519 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2520 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2521 POSIXy alternative.
2522 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2523 (w32_major_version, w32_minor_version, w32_build_number)
2524 (os_subtype, sound_type): Define here
2525 (w32_defined_color): Make color parameter const for consistency
2526 with other _defined_color functions.
2527 (w32_createwindow): Unconditionally call w32_init_class instead of
2528 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2529 through the code is complex and unnecessary because class
2530 registration is practically free.
2531 (w32_name_of_message): New EMACSDEBUG-only function.
2532 (Fset_message_beep): Move here
2533 (Fx_open_connection): Require that the display name for Windows be
2534 "w32" for consistency, emacsclient disambiguation, and maybe, one
2535 day, multi-window-system support.
2536 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2537 Cygwin files for W32 GUI facilities, since these clearly don't
2538 expect Cygwin names.
2539 (_DebPrint): Define.
2540 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2541 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2542 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2543 (w32_last_error): Remove.
2544
2545 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2546
2547 * w32heap.c (syspage_mask): Declare here.
2548 (cache_system_info): Remove.
2549
2550 * w32inevt.c (faked_key): Define globally, not statically.
2551 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2552 (w32_console_toggle_lock_key): Move to w32fns.c.
2553
2554 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2555
2556 * w32proc.c (_DebPrint): Move to w32fns.c.
2557 * w32select.c: Include string.h, stdio.h for Cygwin.
2558 * w32select.h: New File.
2559
2560 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2561 get_osfhandle.
2562 (w32_message_fd): New variable. Under Cygwin, holds the file
2563 descriptor the system used to tell us about pending thread
2564 messages.
2565
2566 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2567 that prevented compilation under non-WINDOWSNT systems.
2568
2569 (w32_initialize): Open /dev/windows and assign it to
2570 w32_message_fd. Provide w32 feature.
2571
2572 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2573 (WM_EMACS_INPUT_READY): add.
2574 (prepend_msg, w32_message_fd): Declare globally.
2575
2576 * w32xfns.c:
2577 (keyboard_handle): Use only when WINDOWSNT.
2578 (notify_msg_ready): New function. Posts a message to the main
2579 thread's message queue under CYGWIN, which wakes up the main
2580 thread from select(2) by making the /dev/windows file descriptor
2581 ready. Under WINDOWSNT, it sets an event the same way the old
2582 code did.
2583
2584 (post, prepend_msg): Actually call notify_msg_ready instead of
2585 setting the input event directly.
2586
98daa893
EZ
25872012-10-07 Eli Zaretskii <eliz@gnu.org>
2588
2589 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2590 but it still has blocs in it, don't return it to the system,
2591 instead of aborting. (Bug#12402)
2592
3bc0a2f7
JD
25932012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2594
8ad5b73b 2595 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 2596
335f5ae4
JD
2597 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2598 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
2599 (syms_of_nsterm): Remove comment about Panther and above for
2600 ns-antialias-text.
335f5ae4
JD
2601 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2602 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2603 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2604
2605 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2606 MAC_OS_X_VERSION_10_4.
2607
8ad5b73b
JD
2608 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2609 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
2610
2611 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2612
2613 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2614 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2615
3bc0a2f7
JD
2616 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2617 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
2618 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2619 Remove ns_in_resize check.
3bc0a2f7
JD
2620 (ns_clear_frame_area): Remove resize handle code.
2621
2622 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
2623 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2624 Remove ns_in_resize check.
3bc0a2f7 2625
c622b48f
PE
26262012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2627
2628 Improve sys_siglist detection.
2629 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2630 defined as a macro, as is done in Solaris.
2631 (sys_siglist_entries): New macro.
2632 (save_strsignal): Use it.
2633 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2634 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2635
04fafa46
JD
26362012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2637
2638 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2639 fullscreen/Fullscreen.
2640
2641 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2642 tobar_height is new.
2643
2644 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2645 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2646 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2647 (windowDidResize:): Check for correct window if old style fullscreen.
2648 Capitalize word in comment. Remove incorrect comment.
2649 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2650 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2651 error in drawing background.
1f9f395d 2652 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
2653 Set toolbar values to zero, save old height in tobar_height.
2654 Restore tool bar height when leaving fullscreen.
2655 (canBecomeMainWindow): New function.
2656
c6e21c03
PE
26572012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2658
2659 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2660
0d9f584b
EZ
26612012-10-05 Eli Zaretskii <eliz@gnu.org>
2662
a65fbb5f
EZ
2663 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2664
0d9f584b 2665 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
2666 that time stamps of directories could also be changed.
2667 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
2668 FILE_WRITE_ATTRIBUTES access rights.
2669
2670 * fileio.c (Fset_file_times): Special-case ignoring errors for
2671 directories only on MSDOS, not on MS-Windows.
2672
e8757f09 26732012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
2674
2675 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2676
7604f298
EZ
26772012-10-04 Eli Zaretskii <eliz@gnu.org>
2678
2679 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2680 see whether CreateFile failed.
2681
88d69b7d
PE
26822012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2683
2684 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2685 to avoid similar races.
2686 * keyboard.c (pending_signals): Now bool, not int.
2687
7509f454
PE
2688 Port timers to OpenBSD, plus check for timer failures.
2689 OpenBSD problem reported by Han Boetes.
2690 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2691 and/or setitimer.
2692 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2693 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2694 like OpenBSD, which has timer_settime but does not declare it.
2695 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2696 whether to use itimerspec-related primitives. All uses of
2697 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2698
a3c5c0c5
PE
26992012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2700
2701 * profiler.c (handle_profiler_signal): Fix a malloc race
2702 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2703
914e743b
JD
27042012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2705
2706 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2707
d8ab37a8
EZ
27082012-10-02 Eli Zaretskii <eliz@gnu.org>
2709
2710 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2711 consistent with the change in return value of 'safe_strsignal'.
2712
b3ecad33
PE
27132012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2714
0a99eee1
PE
2715 Prefer plain 'static' to 'static inline' (Bug#12541).
2716 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2717 (bidi_set_sor_type, bidi_push_embedding_level)
2718 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2719 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2720 (bidi_cache_search, bidi_cache_ensure_space)
2721 (bidi_cache_iterator_state, bidi_cache_find)
2722 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2723 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2724 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2725 Now 'static', not 'static inline'.
2726
b3ecad33
PE
2727 Count overruns when profiling; change units to ns.
2728 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2729 Give extra weight to samples after overruns, to attempt to count
2730 the time more accurately.
2731 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2732 the underlying primitives nominally do ns.
2733 (Fprofiler_cpu_start): Document the change. Mention that
2734 the sampling intervals are only approximate.
2735
090cf9db
SM
27362012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2737
2738 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2739
2740 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2741 case for the special 0 coding-system.
2742
2743 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2744 (Fmake_overlay): Remove redundant tests.
64edc777 2745 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 2746
81550bf4
JB
27472012-10-02 Juanma Barranquero <lekktu@gmail.com>
2748
2749 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2750 Update dependencies.
2751
aa1ba90e
PE
27522012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2753
2754 Fix a malloc race condition involving strsignal.
2755 A signal can arrive in the middle of a malloc, and Emacs's signal
2756 handler can invoke strsignal, which can invoke malloc, which is
2757 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2758 Fix it by altering the signal handler so that it does not invoke
2759 strsignal.
2760 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2761 * process.c (status_message): Use const pointer, in case strsignal
2762 is #defined to safe_strsignal.
2763 * sysdep.c (sys_siglist, init_signals): Always define and
2764 initialize a substitute sys_siglist if the system does not define
2765 one, even if HAVE_STRSIGNAL.
2766 (safe_strsignal): Rename from strsignal. Always define,
2767 using sys_siglist. Return a const pointer.
2768 * syssignal.h (safe_strsignal): New decl.
2769 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2770
ace917bd
EZ
27712012-10-01 Eli Zaretskii <eliz@gnu.org>
2772
2773 * w32proc.c (timer_loop): Fix code that waits for timer
2774 expiration, to avoid high CPU usage.
2775
9eb71b9c
SM
27762012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2777
2778 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2779 (sweep_weak_table): Remove redundant prototypes.
2780
b3317662
FP
27812012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2782
2783 * emacs.c: Move the inclusion of TERM_HEADER after including
2784 windows.h on WINDOWSNT. This avoids compilation problems with
2785 MSVC.
2786
f0e5f225
EZ
27872012-10-01 Eli Zaretskii <eliz@gnu.org>
2788
2d7d1608
EZ
2789 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2790 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2791 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2792 as the previous version used 'void *'.
2793
2794 * ralloc.c (ROUNDUP): Fix last change.
2795 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2796 'size_t'.
2797
f0e5f225
EZ
2798 * w32proc.c <disable_itimers>: New static flag.
2799 (init_timers): Initialize it to zero, after creating the critical
2800 sections used by the timer threads.
2801 (term_timers): Set to 1 before deleting the critical sections.
2802 (getitimer, setitimer): If disable_itimers is non-zero, return an
2803 error indication without doing anything. Reported by Fabrice
2804 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
2805 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2806 return results.
2807 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2808 support timers.
f0e5f225
EZ
2809
2810 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2811 term_ntproc after all the other bookkeeping, to get timers working
2812 as long as possible.
2813
82ef37c1
PE
28142012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2815
b3a4c387
PE
2816 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2817 Suggested by Juri Linkov in
2818 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2819
b0ab8123
PE
2820 Prefer plain 'static' to 'static inline' (Bug#12541).
2821 With static functions, modern compilers inline pretty well by
2822 themselves; advice from programmers often hurts as much as it helps.
2823 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2824 this change shrinks the text size of the Emacs executable by 1.1%
2825 without affecting CPU significantly in my benchmark.
2826 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2827 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2828 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2829 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2830 (bset_auto_fill_function, bset_auto_save_file_format)
2831 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2832 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2833 (bset_cache_long_line_scans, bset_case_fold_search)
2834 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2835 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2836 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2837 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2838 (bset_header_line_format, bset_indicate_buffer_boundaries)
2839 (bset_indicate_empty_lines, bset_invisibility_spec)
2840 (bset_left_fringe_width, bset_major_mode, bset_mark)
2841 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2842 (bset_name, bset_overwrite_mode, bset_pt_marker)
2843 (bset_right_fringe_width, bset_save_length)
2844 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2845 (bset_scroll_up_aggressively, bset_selective_display)
2846 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2847 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2848 (set_buffer_overlays_after):
2849 * category.c (bset_category_table):
2850 * charset.c (read_hex):
2851 * coding.c (produce_composition, produce_charset)
2852 (handle_composition_annotation, handle_charset_annotation)
2853 (char_encodable_p):
2854 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2855 (assign_row, set_frame_matrix_frame, make_current)
2856 (add_row_entry):
2857 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2858 * fns.c (maybe_resize_hash_table):
2859 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2860 * gmalloc.c (register_heapinfo):
2861 * image.c (lookup_image_type):
2862 * intervals.c (set_interval_object, set_interval_left)
2863 (set_interval_right, copy_interval_parent, rotate_right)
2864 (rotate_left, balance_possible_root_interval):
2865 * keyboard.c (kset_echo_string, kset_kbd_queue)
2866 (kset_keyboard_translate_table, kset_last_prefix_arg)
2867 (kset_last_repeatable_command, kset_local_function_key_map)
2868 (kset_overriding_terminal_local_map, kset_real_last_command)
2869 (kset_system_key_syms, clear_event, set_prop):
2870 * lread.c (digit_to_number):
2871 * marker.c (attach_marker, live_buffer, set_marker_internal):
2872 * nsterm.m (ns_compute_glyph_string_overhangs):
2873 * process.c (pset_buffer, pset_command)
2874 (pset_decode_coding_system, pset_decoding_buf)
2875 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2876 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2877 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2878 * syntax.c (bset_syntax_table, dec_bytepos):
2879 * terminal.c (tset_param_alist):
2880 * textprop.c (interval_has_some_properties)
2881 (interval_has_some_properties_list):
2882 * window.c (wset_combination_limit, wset_dedicated)
2883 (wset_display_table, wset_hchild, wset_left_fringe_width)
2884 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2885 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2886 (wset_right_fringe_width, wset_right_margin_cols)
2887 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2888 (wset_vertical_scroll_bar_type, wset_window_parameters):
2889 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2890 (wset_column_number_displayed, wset_region_showing)
2891 (window_box_edges, run_window_scroll_functions)
2892 (append_glyph_string_lists, prepend_glyph_string_lists)
2893 (append_glyph_string, set_glyph_string_background_width)
2894 (append_glyph, append_composite_glyph)
2895 (take_vertical_position_into_account):
2896 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2897 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2898 (lface_hash, lface_same_font_attributes_p, lookup_face):
2899 * xml.c (libxml2_loaded_p):
2900 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2901 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2902 Now 'static', not 'static inline'.
2903
05584c31
PE
2904 * bidi.c: Tune.
2905 (bidi_copy_it): Do the whole copy with a single memcpy.
2906 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2907
86ec63ba
PE
2908 Revert the FOLLOW-SYMLINKS change for file-attributes.
2909 Doing it right would require several changes to Tramp, and there's
2910 not enough time to get that tested before the freeze today.
2911 * dired.c (directory_files_internal, Ffile_attributes):
2912 Undo last change.
2913
82ef37c1
PE
2914 * frame.c (x_report_frame_params): Port better to wider ints.
2915 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2916 or that pointers can be printed in 15 decimal digits.
2917 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2918
62aba0d4
FP
29192012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2920
2921 Support x64 build on MS-Windows.
2922 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2923 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2924 compatibility with x64.
5e4daaf3 2925 (x_get_focus_frame): Add prototype.
62aba0d4
FP
2926
2927 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2928 defining an XRectangle structure.
2929
2930 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2931 arithmetics for compatibility with x64.
2932
2933 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2934 compatibility with x64.
2935
2936 * w32heap.h: Adjust prototypes and declarations.
2937
2938 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2939 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2940 DWORD, long, and unsigned long, for compatibility with x64.
2941 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2942 (sbrk): Argument is now of type ptrdiff_t.
2943
2944 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2945 less than 0x0500.
2946 (w32_msg_pump): Use WPARAM type for 'result'.
2947
2948 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2949 architecture.
2950 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2951 compatibility with x64.
2952
2953 * vm-limit.c (lim_data): Now size_t.
2954 (check_memory_limits): Adjust prototypes of real_morecore and
2955 __morecore to receive argument of type ptrdiff_t. Use size_t for
2956 five_percent and data_size.
2957
2958 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2959 variables, for compatibility with x64.
2960 (rva_to_section, offset_to_section, relocate_offset)
2961 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2962 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2963 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2964 for compatibility with x64.
2965
2966 * sysdep.c (STDERR_FILENO): Define if not already defined.
2967
2968 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2969 (__morecore): Argument type is now ptrdiff_t.
2970 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2971 (relinquish): Use ptrdiff_t type for 'excess'.
2972 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2973
2974 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2975 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2976 instead of a literal number.
2977
2978 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2979 (min): Define only if not already defined.
2980
2981 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2982 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2983 hosts.
2984
2985 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2986 'bitmaps' is a pointer.
2987
2988 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2989
2990 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2991
e7a2937b
PE
29922012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2993
2994 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2995 * dired.c (directory_files_internal, Ffile_attributes):
2996 New arg follow_symlinks. All uses changed.
2997
b43d62ae
SM
29982012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2999
3000 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
3001
c06c382a
EZ
30022012-09-30 Eli Zaretskii <eliz@gnu.org>
3003
3004 Support atimers and CPU profiler via profile.c on MS-Windows.
3005 * w32proc.c (sig_mask, crit_sig): New static variables.
3006 (sys_signal): Support SIGALRM and SIGPROF.
3007 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 3008 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
3009 sigfillset, and sigprocmask are no longer no-ops.
3010 (sigismember): New function.
3011 (struct itimer_data): New definition.
3012 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
3013 (crit_prof): New static variables.
3014 (MAX_SINGLE_SLEEP): New definition.
3015 (timer_loop, stop_timer_thread, term_timers, init_timers)
3016 (start_timer_thread, getitimer, setitimer): New functions.
3017 (alarm): No longer a no-op, calls setitimer.
3018
3019 * w32.c (term_ntproc): Call term_timers.
3020 (init_ntproc): Make sure all signals are unblocked at startup, to
3021 erase any traces of dumping. Call init_timers.
3022
3023 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
3024 Windows-specific code to display the hourglass mouse pointer is no
3025 longer used.
3026 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
3027 to hourglass timer expiration.
3028 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
3029 Remove, no longer used.
b43d62ae
SM
3030 (w32_note_current_window, show_hourglass, hide_hourglass):
3031 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
3032 window systems.
3033 (syms_of_w32fns): Don't initialize hourglass_timer.
3034
3035 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
3036 WINDOWSNT as well.
3037 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
3038
3039 * w32.h (init_timers, term_timers): Add prototypes.
3040
95402d5f
KH
30412012-09-30 Kenichi Handa <handa@gnu.org>
3042
3043 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
3044 to the buffer relocation which may be caused by ccl_driver.
3045
dd946752
JD
30462012-09-30 Jan Djärv <jan.h.d@swipnet.se>
3047
d7e642cc
JD
3048 * xfns.c (Fx_file_dialog): Update comment.
3049
3050 * w32fns.c (Fx_file_dialog): Update comment.
3051
3052 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
3053 Initialize panel name field if OSX >= 10.6.
3054
3055 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
3056
dd946752
JD
3057 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
3058
3059 * nsterm.m (NEW_STYLE_FS): New define.
3060 (ns_fullscreen_hook, windowWillEnterFullScreen)
3061 (windowDidEnterFullScreen, windowWillExitFullScreen)
3062 (windowDidExitFullScreen, toggleFullScreen, handleFS)
3063 (setFSValue): New functions.
3064 (EmacsFSWindow): New implementation.
3065 (canBecomeKeyWindow): New function for EmacsFSWindow.
3066 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
3067 (dealloc): Release nonfs_window if in fullscreen.
3068 (updateFrameSize:): Call windowDidMove to update top/left.
3069 (windowWillResize:toSize:): Check if frame is still maximized.
3070 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
3071 next_maximized, maximized_width, maximized_height and nonfs_window.
3072 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
3073 tbar_height.
3074 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 3075 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
3076
3077 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
3078 (EmacsView): Add variables for fullscreen.
3079 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
3080 (EmacsFSWindow): New interface for fullscreen.
3081
427730eb
JB
30822012-09-30 Juanma Barranquero <lekktu@gmail.com>
3083
3084 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3085
48de8b12
CY
30862012-09-30 Chong Yidong <cyd@gnu.org>
3087
3088 * fns.c (Frandom): Doc fix.
3089
5938d519
MR
30902012-09-30 Martin Rudalics <rudalics@gmx.at>
3091
3092 * window.c (Vwindow_combination_limit): New default value.
3093 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
3094
cb5b0266
PE
30952012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3096
3097 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
3098 Suggested by Eli Zaretskii in
3099 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
3100
84f72efd
EZ
31012012-09-30 Eli Zaretskii <eliz@gnu.org>
3102
3103 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
3104 HAVE_TIMER_SETTIME is defined.
3105
9d4dcdc9
PE
31062012-09-30 Paul Eggert <eggert@cs.ucla.edu>
3107
d89460ed
PE
3108 Profiler improvements: more-accurate timers, overflow checks.
3109 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
3110 signal.h, setjmp.h. Include systime.h instead.
3111 (saturated_add): New function.
3112 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
3113 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
3114 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
3115 New static vars.
84f72efd 3116 (enum profiler_cpu_running): New enum.
d89460ed
PE
3117 (profiler_cpu_running): Now of that enum type, not bool.
3118 All uses changed to store the new value.
3119 (handle_profiler_signal): Rename from sigprof_handler_1,
3120 for consistency with other handlers. Do not check whether
3121 cpu_log is a hash-table if garbage collecting, since it
3122 doesn't matter in that case.
3123 (deliver_profiler_signal): Rename from sigprof_handler,
3124 for consistency with other handlers.
3125 (setup_cpu_timer): New function, with much of what used to be in
3126 Fprofiler_cpu_start. Check for out-of-range argument.
3127 Prefer timer_settime if available, and prefer
3128 thread cputime clocks, then process cputime clocks, then
3129 monotonic clocks, to the old realtime clock. Use make_timeval
3130 to round more-correctly when falling back to setitimer.
3131 (Fprofiler_cpu_start): Use it.
3132 (Fprofiler_cpu_stop): Prefer timer_settime if available.
3133 Don't assume that passing NULL as the 2nd argument of setitimer
3134 is the same as passing a pointer to all-zero storage.
3135 Ignore SIGPROF afterwards.
3136 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
3137 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
3138 non-fatal signal handlers. Ignore SIGPROF on startup.
3139 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
3140 in profiler.c, since sysdep.c now uses it.
3141
9d4dcdc9
PE
3142 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
3143 Suggested by Eli Zaretskii in
3144 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3145
8e5691a0
JB
31462012-09-29 Juanma Barranquero <lekktu@gmail.com>
3147
3148 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3149
e7c1b6ef
SM
31502012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
3151
3152 * lisp.h (struct backtrace): Remove indirection for `function' field.
3153 * xdisp.c (redisplay_internal):
3154 * profiler.c (record_backtrace, sigprof_handler_1):
3155 * alloc.c (Fgarbage_collect):
3156 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
3157 (Fbacktrace_frame): Adjust accordingly.
3158
e61d39cd 31592012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
3160
3161 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
3162 (Frun_hook_with_args_until_failure): Doc fixes.
3163
404043ea
EZ
31642012-09-28 Eli Zaretskii <eliz@gnu.org>
3165
3166 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
3167 Qautomatic_redisplay and change the symbol name. All users changed.
3168
704d3f45
TM
31692012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
3170
3171 * profiler.c (sigprof_handler): Fix race condition.
3172
757140ff
GM
31732012-09-28 Glenn Morris <rgm@gnu.org>
3174
3175 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
3176
a615a3ae
PE
31772012-09-27 Paul Eggert <eggert@cs.ucla.edu>
3178
3179 Check more robustly for timer_settime.
89d17fd0
PE
3180 * Makefile.in (LIB_TIMER_TIME): New macro.
3181 (LIBES): Add it.
a615a3ae
PE
3182 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
3183 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
3184 call timer_settime.
3185
3670daf7
TM
31862012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3187
3188 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
3189
6a586b7f
JB
31902012-09-26 Juanma Barranquero <lekktu@gmail.com>
3191
3192 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
3193
41c8bfcf
PE
31942012-09-26 Paul Eggert <eggert@cs.ucla.edu>
3195
3196 * character.h (MAYBE_UNIFY_CHAR): Remove.
3197 * charset.c, charset.h (maybe_unify_char): Now static.
3198 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
3199 Since this stuff is now private to charset.c, there's no need for
3200 a public macro and no need to inline by hand.
3201
3a880af4
SM
32022012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
3203 Stefan Monnier <monnier@iro.umontreal.ca>
3204 Juanma Barranquero <lekktu@gmail.com>
611b7507 3205
3a880af4
SM
3206 * profiler.c: New file.
3207 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
3208 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
3209 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
3210 * emacs.c (main): Call syms_of_profiler.
3211 * alloc.c (Qautomatic_gc): New constant.
3212 (MALLOC_PROBE): New macro.
3213 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
3214 (total_bytes_of_live_objects): New function.
3215 (Fgarbage_collect): Use it. Record itself in backtrace_list.
3216 Call malloc_probe for the memory profiler.
3217 (syms_of_alloc): Define Qautomatic_gc.
3218 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
3219 race condition.
3220 (struct backtrace): Move definition...
3221 * lisp.h (struct backtrace): ..here.
3222 (Qautomatic_gc, profiler_memory_running): Declare vars.
3223 (malloc_probe, syms_of_profiler): Declare functions.
3224 * xdisp.c (Qautomatic_redisplay): New constant.
3225 (redisplay_internal): Record itself in backtrace_list.
3226 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 3227
5938d519 32282012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
32292012-09-25 Juanma Barranquero <lekktu@gmail.com>
3230
3231 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
3232
e26fd2e4
PE
32332012-09-25 Paul Eggert <eggert@cs.ucla.edu>
3234
3235 Prefer POSIX timers if available.
3236 They avoid a race if the timer is too close to the current time.
3237 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
3238 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 3239 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 3240
eedec3ee
EZ
32412012-09-25 Eli Zaretskii <eliz@gnu.org>
3242
3243 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
3244 CHAR_STRING_ADVANCE.
3245 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
3246 STRING_CHAR_ADVANCE.
3247
aa15c6bb
JB
32482012-09-25 Juanma Barranquero <lekktu@gmail.com>
3249
3250 Move Vlibrary_cache to emacs.c and reset before dumping.
3251
3252 * lisp.h (reset_image_types): Declare.
3253 [WINDOWSNT] (Vlibrary_cache): Declare.
3254
3255 * image.c (reset_image_types): New function.
3256
3257 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
3258 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
3259 (Fdump_emacs): Reset Vlibrary_cache and image_types.
3260
3261 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
3262 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
3263
3264 * w32.h (Vlibrary_cache): Do not declare.
3265
54d629be
EZ
32662012-09-25 Eli Zaretskii <eliz@gnu.org>
3267
16b22fef
EZ
3268 * w32proc.c (sys_signal): Handle all signals defined by the
3269 MS-Windows runtime, not just SIGCHLD. Actually install the signal
3270 handlers for signals supported by Windows. Don't override
3271 term_ntproc as the handler for SIGABRT.
3272 (sigaction): Rewrite to call sys_signal instead of duplicating its
3273 code.
3274 (sys_kill): Improve commentary.
3275
3276 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3277 consistency with a signature of a signal handler. All callers
3278 changed.
3279 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3280 install term_ntproc as a signal handler for SIGABRT, as that
3281 should be done by the dumped Emacs.
3282
3283 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3284
3285 * w32select.c (term_w32select): Protect against repeated
3286 invocation by setting clipboard_owner to NULL after calling
3287 DestroyWindow.
3288
3289 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3290 and term_ntproc to their modified signatures.
3291
54d629be
EZ
3292 * character.c (char_string, string_char): Remove calls to
3293 MAYBE_UNIFY_CHAR. See the discussion starting at
3294 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3295 for the details.
3296
59f7af81
CY
32972012-09-25 Chong Yidong <cyd@gnu.org>
3298
3299 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3300
22e8cf4a
SM
33012012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3302
3303 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3304 when encountering an unknown bytecode.
3305
578098f3
PE
33062012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3307
3308 image.c, indent.c: Use bool for booleans.
3309 * dispextern.h (struct image_type): Members valid_p, load, init
3310 now return bool, not int. All uses changed.
3311 * image.c: Omit unnecessary static decls.
3312 (x_create_bitmap_mask, x_build_heuristic_mask):
3313 Return void, not int, since callers don't care about the return value.
3314 (x_create_bitmap_mask, define_image_type, valid_image_p)
3315 (struct image_keyword, parse_image_spec, image_spec_value)
3316 (check_image_size, image_background)
3317 (image_background_transparent, x_clear_image_1)
3318 (postprocess_image, lookup_image, x_check_image_size)
3319 (x_create_x_image_and_pixmap, xbm_image_p)
3320 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3321 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3322 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3323 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3324 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3325 (png_image_p, init_png_functions, png_load_body, png_load)
3326 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3327 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3328 (init_gif_functions, gif_load, imagemagick_image_p)
3329 (imagemagick_load_image, imagemagick_load, svg_image_p)
3330 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3331 (gs_load):
3332 * nsimage.m (ns_load_image):
3333 * nsterm.m (ns_defined_color):
3334 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3335 * xfns.c (x_defined_color):
3336 * xterm.c (x_alloc_lighter_color_for_widget)
3337 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3338 (x_alloc_lighter_color):
3339 * indent.c (disptab_matches_widthtab, current_column)
3340 (scan_for_column, string_display_width, indented_beyond_p)
3341 (compute_motion, vmotion, Fvertical_motion):
3342 Use bool for booleans.
3343
a5f2b6ec
CY
33442012-09-24 Chong Yidong <cyd@gnu.org>
3345
3346 * chartab.c (Fset_char_table_default): Obsolete function removed.
3347
18e27ea8
PE
33482012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3349
afea8a8a
PE
3350 Move pid_t related decls out of lisp.h.
3351 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3352 (interruptible_wait_for_termination):
3353 Move these decls from lisp.h to syswait.h, since they use pid_t.
3354 Needed on FreeBSD; see Herbert J. Skuhra in
3355 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3356 * callproc.c: Include syswait.h.
3357
18e27ea8
PE
3358 gnutls.c, gtkutil.c: Use bool for boolean.
3359 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3360 (emacs_gnutls_handle_error):
3361 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3362 (xg_hide_tooltip, xg_create_frame_widgets)
3363 (create_dialog, xg_uses_old_file_dialog)
3364 (xg_get_file_with_chooser, xg_get_file_with_selection)
3365 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3366 (xg_item_label_same_p, xg_update_menubar)
3367 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3368 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3369 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3370 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3371 (update_frame_tool_bar, free_frame_tool_bar):
3372 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3373 * nsmenu.m (ns_update_menubar):
3374 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3375 * xfns.c (Fx_show_tip) [USE_GTK]:
3376 Use bool for boolean.
3377 * gtkutil.c (xg_update_frame_menubar):
3378 * xmenu.c (update_frame_menubar):
3379 Return void, not int, since caller ignores return value.
3380 * gtkutil.c (xg_change_toolbar_position):
3381 Return void, not 1.
3382
af0e9f75
JB
33832012-09-23 Juanma Barranquero <lekktu@gmail.com>
3384
3385 * makefile.w32-in (BLOCKINPUT_H): Remove.
3386 (SYSSIGNAL_H): New macro.
3387 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3388 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3389 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3390 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3391 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3392 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3393 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3394 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3395 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3396 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3397 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3398 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3399 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3400 ($(BLD)/w32xfns.$(O)): Update dependencies.
3401
5101529e
EZ
34022012-09-23 Eli Zaretskii <eliz@gnu.org>
3403
3404 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3405 fatal_error_backtrace.
3406
3407 * w32proc.c (sys_kill): Undo last change: don't do anything when
3408 invoked to deliver SIGABRT to our own process. This is now
3409 handled by emacs_raise.
3410
2c3ee0ad
JB
34112012-09-23 Juanma Barranquero <lekktu@gmail.com>
3412
3413 * w32term.c (w32_read_socket): Remove leftover reference to
3414 interrupt_input_pending.
3415
62a1d661
PE
34162012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3417
3418 Do not use SA_NODEFER.
3419 Problem reported by Dani Moncayo in
3420 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3421 * alloc.c (die):
3422 * sysdep.c (emacs_abort): Do not reset signal handler.
3423 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3424 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3425 wanted even on POSIXish hosts, and it doesn't work on Windows.
3426
a0942b9a
JD
34272012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3428
3429 * xterm.c (x_term_init): Call fixup_locale before and after calling
3430 gtk_init (Bug#12392).
3431
d07ff9db
CY
34322012-09-23 Chong Yidong <cyd@gnu.org>
3433
3434 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3435 Vdynamic_library_alist.
3436
3437 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3438 (Fgnutls_available_p): Caller changed.
3439
3440 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3441 (Flibxml_parse_xml_region): Likewise.
3442
3443 * dispextern.h (struct image_type): Remove arg from init function.
3444
3445 * image.c (Finit_image_library, lookup_image_type)
3446 (define_image_type): Remove now-unneeded second arg.
3447 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3448 (init_tiff_functions, init_gif_functions, init_svg_functions):
3449 Arglist and w32_delayed_load calling convention changed.
3450 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 3451 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 3452
4d7e6e51
PE
34532012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3454
3455 Simplify and avoid signal-handling races (Bug#12471).
3456 * alloc.c (die):
3457 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3458 Avoid recursive loop if there's a fatal error in the function itself.
3459 * atimer.c (pending_atimers):
3460 * blockinput.h: Don't include "atimer.h"; no longer needed.
3461 (interrupt_input_pending): Remove. All uses removed.
3462 pending_signals now counts both atimers and ordinary interrupts.
3463 This is less racy than having three separate pending-signal flags.
3464 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3465 (input_blocked_p):
3466 Rename from their upper-case counterparts BLOCK_INPUT,
3467 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3468 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3469 This makes it easier to access volatile variables more accurately.
3470 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3471 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3472 that's more reliable if the code is buggy and sets
3473 interrupt_input_blocked to a negative value. All uses changed.
3474 * atimer.c (deliver_alarm_signal):
3475 Remove. No need to deliver this to the parent; any thread can
3476 handle this signal now. All uses replaced by underlying handler.
3477 * atimer.c (turn_on_atimers):
3478 * dispnew.c (handle_window_change_signal):
3479 * emacs.c (handle_danger_signal):
3480 * keyboard.c (kbd_buffer_get_event):
3481 Don't reestablish signal handler; not needed with sigaction.
3482 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3483 (UNBLOCK_INPUT_TO):
3484 Rework to avoid unnecessary accesses to volatile variables.
3485 (UNBLOCK_INPUT_TO): Now a function.
3486 (totally_unblock_input, unblock_input): New decls.
3487 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3488 (init_data): Remove. Necessary stuff now done in init_signal.
3489 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3490 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3491 (fatal_error_code): Remove; no longer needed.
3492 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3493 it doesn't always backtrace. All uses changed. No need to reset
3494 signal to default, since sigaction and/or die does that for us now.
3495 Use emacs_raise (FOO), not kill (getpid (), FOO).
3496 (main): Check more-accurately whether we're dumping.
3497 Move fatal-error setup to sysdep.c
3498 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3499 * gtkutil.c (xg_get_file_name, xg_get_font):
3500 Remove no-longer-needed signal-mask manipulation.
3501 * keyboard.c, process.c (POLL_FOR_INPUT):
3502 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3503 * keyboard.c (read_avail_input): Remove.
3504 All uses replaced by gobble_input.
3505 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3506 (kbd_buffer_store_event_hold, gobble_input):
3507 (record_asynch_buffer_change) [USABLE_SIGIO]:
3508 (store_user_signal_events):
3509 No need to mess with signal mask.
3510 (gobble_input): If blocking input and there are terminals, simply
3511 set pending_signals to 1 and return. All hooks changed to not
3512 worry about whether input is blocked.
3513 (process_pending_signals): Clear pending_signals before processing
3514 them, in case a signal comes in while we're processing.
3515 By convention callers now test pending_signals before calling us.
3516 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3517 New functions, to support changes to blockinput.h.
3518 (handle_input_available_signal): Now extern.
3519 (reinvoke_input_signal): Remove. All uses replaced by
3520 handle_async_input.
3521 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
3522 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3523 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
3524 Clear sigmask reliably, even if Fsignal returns, which it can.
3525 Omit unnecessary accesses to volatile var.
3526 (quit_throw_to_read_char): No need to restore sigmask.
3527 * keyboard.c (gobble_input, handle_user_signal):
3528 * process.c (wait_reading_process_output):
3529 Call signal-handling code rather than killing ourselves.
3530 * lisp.h: Include <float.h>, for...
3531 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3532 (pending_signals): Now volatile.
3533 (syms_of_data): Now const if IEEE floating point.
3534 (handle_input_available_signal) [USABLE_SIGIO]:
3535 (terminate_due_to_signal, record_child_status_change): New decls.
3536 * process.c (create_process): Avoid disaster if memory is exhausted
3537 while we're processing a vfork, by tightening the critical section
3538 around the vfork.
3539 (send_process_frame, process_sent_to, handle_pipe_signal)
3540 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3541 ignores SIGPIPE.
3542 (send_process): No need for setjmp/longjmp any more, since the
3543 SIGPIPE stuff is now gone. Instead, report an error if errno
3544 is EPIPE.
3545 (record_child_status_change): Now extern. PID and W are now args.
3546 Return void, not bool. All callers changed.
3547 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3548 Remove. All uses removed. This bug should be fixed now in a
3549 different way.
3550 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3551 and record the child status change directly. This avoids the
3552 need to futz with the signal mask.
3553 (process_fatal_action): Move here from emacs.c.
3554 (emacs_sigaction_flags): New function, containing
3555 much of what used to be in emacs_sigaction_init.
3556 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3557 caught by emacs, to make races less likely.
3558 (deliver_process_signal): Rename from handle_on_main_thread.
3559 All uses changed.
3560 (BACKTRACE_LIMIT_MAX): Now at top level.
3561 (thread_backtrace_buffer, threadback_backtrace_pointers):
3562 New static vars.
3563 (deliver_thread_signal, deliver_fatal_thread_signal):
3564 New functions, for more-accurate delivery of thread-specific signals.
3565 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3566 (deliver_arith_signal): Handle in this thread, not
3567 in the main thread, since it's triggered by this thread.
3568 (maybe_fatal_sig): New function.
3569 (init_signals): New arg DUMPING so that we can be more accurate
3570 about whether we're dumping. Caller changed.
3571 Treat thread-specific signals differently from process-general signals.
3572 Block all signals while handling fatal error; that's safer.
3573 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3574 on IEEE hosts.
3575 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3576 Ignore SIGPIPE unless batch.
3577 (emacs_backtrace): Output backtrace for the appropriate thread,
3578 which is not necessarily the main thread.
3579 * syssignal.h: Include <stdbool.h>.
3580 (emacs_raise): New macro.
3581 * xterm.c (x_connection_signal): Remove; no longer needed
3582 now that we use sigaction.
3583 (x_connection_closed): No need to mess with sigmask now.
3584 (x_initialize): No need to reset SIGPIPE handler here, since
3585 init_signals does this for us now.
3586
8f4635e9
JD
35872012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3588
3589 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 3590 background rect may be larger (Bug#12245).
8f4635e9 3591
3296976d
CY
35922012-09-23 Chong Yidong <cyd@gnu.org>
3593
3594 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3595
d41e491e
PE
35962012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3597
3598 * .gdbinit: Just stop at fatal_error_backtrace.
3599 See Stefan Monnier's request in
3600 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3601 Remove no-longer-used query of system type.
3602
c88b867f
CY
36032012-09-22 Chong Yidong <cyd@gnu.org>
3604
3605 * search.c (Freplace_match): Doc fix (Bug#12325).
3606
3607 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3608
3609 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3610 (Fline_end_position): Doc fix.
3611
3612 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3613
bb4d86b4
CY
36142012-09-22 Chong Yidong <cyd@gnu.org>
3615
3616 * dispextern.h (struct image_type): Add new slot, storing a type
3617 initialization function.
3618
3619 * image.c (define_image_type): Call the image initializer function
3620 if it is defined. Arguments and return value changed.
3621 (valid_image_p, make_image): Callers changed.
3622 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
3623 (gif_type, imagemagick_type, svg_type, gs_type):
3624 Add initialization functions.
bb4d86b4
CY
3625 (Finit_image_library): Call lookup_image_type.
3626 (CHECK_LIB_AVAILABLE): Macro deleted.
3627 (lookup_image_type): Call define_image_type here, rather than via
3628 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3629 (syms_of_image): Move define_image_type calls for xbm_type and
3630 pbm_type to lookup_image_type.
3631
df9685f3
EZ
36322012-09-22 Eli Zaretskii <eliz@gnu.org>
3633
3634 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3635 'idle_timers' from here ...
3636 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3637 lists, to avoid infloops when the timer does something stupid,
3638 like reinvoke itself with the same or smaller time-out.
3639 (Bug#12447)
3640
8e17c9ba
MR
36412012-09-22 Martin Rudalics <rudalics@gmx.at>
3642
3643 * window.c (Fsplit_window_internal): Handle only Qt value of
3644 Vwindow_combination_limit separately.
3645 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
3646 (Vwindow_combination_limit): New default value.
3647 Rewrite doc-string.
8e17c9ba 3648
589bd69b
EZ
36492012-09-22 Eli Zaretskii <eliz@gnu.org>
3650
3651 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3652 the new overlay string. (Bug#10159)
3653
01108e3f
PE
36542012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3655
3656 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3657 or that fprintf is async-signal-safe. POSIX doesn't require
3658 either assumption.
3659
82f8cd94
CY
36602012-09-22 Chong Yidong <cyd@gnu.org>
3661
3662 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3663 (Bug#8207).
3664
3cccbd87
KH
36652012-09-22 Kenichi Handa <handa@gnu.org>
3666
3667 * composite.c (composition_reseat_it): Handle the case that a
3668 grapheme cluster is not covered by a single font (Bug#12352).
3669
09c01941
CY
36702012-09-21 Chong Yidong <cyd@gnu.org>
3671
3672 * image.c (define_image_type): Avoid adding duplicate types to
3673 image_types (Bug#12463). Suggested by Jörg Walter.
3674
acfa068f 36752012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
3676
3677 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3678 (print_load_command_name): Add case LC_DATA_IN_CODE.
3679 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3680
acfa068f 36812012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
3682
3683 * eval.c (Frun_hook_with_args_until_success)
3684 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3685
acfa068f 36862012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
3687
3688 * fileio.c (Ffile_selinux_context): Only call freecon when
3689 lgetfilecon succeeded.
3690 (Fset_file_selinux_context): Likewise. (Bug#12444)
3691
acfa068f 36922012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
3693
3694 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3695 reordering, locate the cursor by calling set_cursor_from_row; if
3696 that fails, clear the desired glyph matrix before returning a
3697 failure indication to the caller. Fixes leaving garbled display
3698 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
3699 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3700 scrolling through multibyte text.
aa36e4d2 3701
e99f70c8
SM
37022012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3703
3704 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3705 calling mark_vectorlike since that's the one that marks the window.
3706 (mark_discard_killed_buffers): Mark the final cdr.
3707 * window.h (struct window): Move prev/next_buffers to the
3708 non-standard fields.
3709 * window.c (make_window): Initialize prev/next_buffers manually.
3710
f75beb47
PE
37112012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3712
3713 Omit unused arg EXPECTED from socket hooks.
3714 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3715 * nsterm.m (ns_term_init):
3716 * termhooks.h (struct terminal.read_socket_hook):
3717 * w32inevt.c (w32_console_read_socket):
3718 * w32term.c (w32_read_socket):
3719 * xterm.c (XTread_socket):
3720 Omit unused arg EXPECTED. All callers changed.
3721 (store_user_signal_events): Return void, not int, since callers no
3722 longer care about the return value. All uses changed.
3723
b019b76a
JB
37242012-09-20 Juanma Barranquero <lekktu@gmail.com>
3725
3726 * w32gui.h (XParseGeometry): Do not declare.
3727
05642592
PE
37282012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3729
e4bce92a 3730 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 3731 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
3732 <http://bugs.gnu.org/12471#8> (last line).
3733
05642592
PE
3734 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3735 (XParseGeometry): Now static. Substitute extremal values for
3736 values that are out of range.
3737
e543ae91
JD
37382012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3739
3740 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3741
3742 * nsfns.m (XParseGeometry): Remove.
3743 (Fx_create_frame): Call x_set_offset to correctly interpret
3744 top_pos in geometry.
3745
3a880af4 3746 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
3747 (Fx_parse_geometry): If there is a space in string, call
3748 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3749
45ba16c7
EZ
37502012-09-17 Eli Zaretskii <eliz@gnu.org>
3751
c8b9f1bc
EZ
3752 * search.c (scan_buffer): Use character positions in calls to
3753 region_cache_forward and region_cache_backward, not byte
3754 positions. (Bug#12196)
3755
b4c932a2
EZ
3756 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3757 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3758
45ba16c7
EZ
3759 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3760 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3761 emacs_blocked_malloc, now deleted.
3762
eeceac93
PE
37632012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3764
3765 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3766 The workaround was for improving performance on Solaris 2.4, but
3767 is getting in the way now. Emacs will still work if someone is
3768 still running Solaris 2.4 in a museum somewhere; Sun dropped
3769 support for Solaris 2.4 in 2003.
3770 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3771 * process.c (create_process) [HAVE_WORKING_VFORK]:
3772 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3773 since Emacs no longer uses vfork on that platform.
3774
78f83752
GM
37752012-09-17 Glenn Morris <rgm@gnu.org>
3776
3777 * emacs.c: Use COPYRIGHT.
3778
634b8cac
PE
37792012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3780
0caaedb1
PE
3781 Remove configure's --without-sync-input option (Bug#12450).
3782 When auditing signal-handling in preparation for cleaning it up,
3783 I found that SYNC_INPUT has race conditions and would be a real
3784 pain to fix. Since it's an undocumented and deprecated
3785 configure-time option, now seems like a good time to remove it.
3786 Also see <http://bugs.gnu.org/11080#16>.
3787 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3788 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3789 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3790 (malloc_hysteresis):
3791 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3792 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3793 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3794 (dont_register_blocks, bytes_used_when_reconsidered)
3795 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3796 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3797 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 3798 Remove. All uses removed.
0caaedb1
PE
3799 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3800 implementation, one that depends on whether the new macro
3801 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3802 is defined.
3803 * atimer.c (run_timers, handle_alarm_signal):
3804 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3805 (handle_async_input, process_pending_signals)
3806 (handle_input_available_signal, init_keyboard):
3807 * nsterm.m (ns_read_socket):
3808 * process.c (wait_reading_process_output):
3809 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3810 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3811 (emacs_write):
3812 * xterm.c (XTread_socket):
3813 Assume SYNC_INPUT.
3814 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3815 * eval.c (handling_signal): Remove. All uses removed.
3816 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3817 All uses replaced with the SYNC_INPUT version.
3818 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3819 Remove decls.
3820 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3821 Now static.
3822
634b8cac
PE
3823 * font.c (Ffont_shape_gstring): Remove unused local.
3824
83da1b55
GM
38252012-09-16 Glenn Morris <rgm@gnu.org>
3826
518650a5
GM
3827 * Makefile.in (clean): No longer run nextstep's clean.
3828
83da1b55
GM
3829 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3830 (ns_frag): Remove.
3831 (ns-app): Move here from ns.mk, and simplify.
3832 (clean): Simplify nextstep entry.
3833 * ns.mk: Remove file.
3834
85a43e2e
KH
38352012-09-17 Kenichi Handa <handa@gnu.org>
3836
3837 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3838 not covert the last few charactes.
3839
ba13e616 38402012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
3841
3842 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3843 here, but just check the validity of glyphs in the glyph-string.
3844
a8c729af
MR
38452012-09-16 Martin Rudalics <rudalics@gmx.at>
3846
3a880af4
SM
3847 * window.c (Fwindow_parameter, Fset_window_parameter):
3848 Accept any window as argument (Bug#12452).
a8c729af 3849
c077c059
JD
38502012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3851
3852 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3853 to ns_term_init to avoid memory leak.
3854
3855 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3856 explicit retain/release.
3857 (ns_term_init): Only allow one display. Initialize outerpool and
3858 ns_*_types.
3859
39a57ad0
PE
38602012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3863 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3864 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3865 the Microsoft problem in a different way, by altering ../nt/config.nt.
3866
7105c8cb
EZ
38672012-09-15 Eli Zaretskii <eliz@gnu.org>
3868
3869 * w32xfns.c:
3870 * w32uniscribe.c:
3871 * w32term.c:
3872 * w32select.c:
3873 * w32reg.c:
3874 * w32proc.c:
3875 * w32menu.c:
3876 * w32inevt.c:
3877 * w32heap.c:
3878 * w32font.c:
3879 * w32fns.c:
3880 * w32console.c:
3881 * w32.c:
3882 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3883 by lisp.h. This completes removal of setjmp.h inclusion
3884 erroneously announced in the previous commit. (Bug#12446)
3885
3886 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3887 more accurate.
3888
3889 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3890 not defined as a macro. The latter happens on MS-Windows.
3891 (Bug#12446)
3892
0328b6de
PE
38932012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3894
3895 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3896 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 3897 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
3898 only reason for the instance was because "lisp.h" was included.
3899 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3900 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3901 and _longjmp with the new symbols. Emacs already uses _setjmp if
3902 available, so this change affects only POSIXish hosts that have
3903 sigsetjmp but not _setjmp, such as some versions of Solaris and
3904 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3905 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3906 (png_load_body) [HAVE_PNG]:
3907 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3908 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3909 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3910 since PNG requires jmp_buf. This is the only exception to the
3911 general rule that we now use sys_setjmp and sys_longjmp.
3912 This exception is OK since this code does not change the signal
3913 mask or longjmp out of a signal handler.
3914
2af03429
PE
39152012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3916
3917 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3918 Include "syssignal.h", for 'main_thread'.
3919
2f294edf
DA
39202012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3921
3922 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
3923 * insdel.c (replace_range, replace_range_2):
3924 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
3925 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3926 Remove redundant check before calling offset_intervals.
3927
6b533e9c
MR
39282012-09-14 Martin Rudalics <rudalics@gmx.at>
3929
3930 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3931 current buffer (Bug#12387).
3932
2a7931e3
JB
39332012-09-14 Juanma Barranquero <lekktu@gmail.com>
3934
3935 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3936
c18e885b
PE
39372012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3938
3939 Use a more backwards-compatible timer format (Bug#12430).
3940 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3941 vector element, not from the 4th, since PSECS is now at the end.
3942 (Fcurrent_idle_time): Doc fix.
3943
d59a1afb
DA
39442012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3945
3946 Function to mark objects and remove killed buffers at once.
3947 * alloc.c (discard_killed_buffers): Rename to ...
3948 (mark_discard_killed buffers) ... new name. Add marking
3949 of remaining objects. Fix comment. Adjust users.
3950 (mark_object): Do not touch frame buffer lists here.
3951 * frame.c (delete_frame): Reset frame buffer lists here.
3952
5f0cb45a
PE
39532012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3954
8ea47e3a
PE
3955 Better workaround for GNOME bug when --enable-gcc-warnings.
3956 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3957 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3958 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3959
4a4bbad2
PE
3960 Simplify SIGIO usage (Bug#12408).
3961 The code that dealt with SIGIO was crufty and confusing, e.g., it
3962 played tricks like "#undef SIGIO" but these tricks were not used
3963 consistently. Simplify mostly by not #undeffing standard symbols,
3964 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3965 or not as we please) rather than "defined SIGIO" (standard symbol
3966 that we probably shouldn't #undef).
3967 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3968 Modules that need it can include it.
3969 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3970 * dispextern.h (ignore_sigio): New decl.
3971 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3972 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3973 * emacs.c (shut_down_emacs):
3974 * keyboard.c (kbd_buffer_store_event_hold):
3975 Use ignore_sigio rather than invoking 'signal' directly.
3976 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3977 for FIONREAD.
3978 (FIONREAD, SIGIO): Do not #undef.
3979 (tty_read_avail_input): Use #error rather than a syntax error.
3980 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3981 for I_PIPE, used by SETUP_SLAVE_PTY.
3982 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3983 * sysdep.c (croak): Remove; no longer needed. This bit of
3984 temporary code, with Fred N. Fish's comment that it's temporary,
3985 has been in Emacs since at least 1992!
3986 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3987 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3988 * syssignal.h (croak): Remove decl.
3989 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3990 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3991 now that we're termios-only.
3992 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3993 * term.c (dissociate_if_controlling_tty): Use #error rather than
3994 a run-time error.
3995
5f0cb45a
PE
3996 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3997 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3998 to work around GNOME bug 683906.
3999 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
4000 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
4001 This works around GCC bug 54561.
4002
40bce90b
PE
40032012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4004
4005 More fixes for 'volatile' and setjmp/longjmp.
4006 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
4007 * image.c (struct png_load_context) [HAVE_PNG]: New type.
4008 (png_load_body) [HAVE_PNG]:
4009 (jpeg_load_body) [HAVE_JPEG]:
4010 New function, with most of the old parent function's body.
4011 (png_load) [HAVE_PNG]:
4012 (jpeg_load) [HAVE_JPEG]:
4013 Invoke the new function, to avoid longjmp munging our locals.
4014 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
4015 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
4016 longjmp is passed 2, as the C standard doesn't guarantee this.
4017 Instead, store the failure code into mgr->failure_code.
4018
bfeae2cf
SM
40192012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4020
4021 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
4022 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
4023 (syms_of_keyboard): Remove support for unread-command-char.
4024
8099e36b
EZ
40252012-09-12 Eli Zaretskii <eliz@gnu.org>
4026
4027 * w32proc.c (sys_kill): If PID is our process ID and the signal is
4028 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
4029 violation. (Bug#12426)
4030
92547ff9
PE
40312012-09-12 Paul Eggert <eggert@cs.ucla.edu>
4032
4033 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
4034
45b82ad0
SM
40352012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4036
4037 * eval.c: Add `inhibit-debugger'.
4038 (Qinhibit_debugger): New symbol.
4039 (call_debugger): Bind it instead of Qdebug_on_error.
4040 (maybe_call_debugger): Test Vinhibit_debugger.
4041 (syms_of_eval): Define inhibit-debugger.
4042 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
4043 (syms_of_xdisp): Remove inhibit-debug-on-message.
4044
5779a1dc
PE
40452012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4046
50f2e553
PE
4047 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
4048 If a nonvolatile local variable is written before a _longjmp to
4049 the frame containing the variable, and is read after the _longjmp,
4050 the value read is indeterminate. Some local variables of type
4051 'struct handler' and 'struct catchtag' are used in this way, so
4052 mark each of their slots as volatile if the slot can be set before
4053 _longjmp and read afterwards.
4054 * lisp.h (struct handler): var and chosen_clause are now volatile.
4055 (struct catchtag): val, next, and pdlcount are now volatile.
4056
ae1d87e2
PE
4057 * bidi.c (bidi_push_it, bidi_pop_it):
4058 * fns.c (copy_hash_table):
4059 * image.c (define_image_type):
4060 * keyboard.c (kbd_buffer_store_event_hold):
4061 * process.c (Fprocess_send_eof):
4062 * xfaces.c (x_create_gc) [HAVE_NS]:
4063 * xgselect.c (xg_select):
4064 Prefer assignment to memcpy when either will do.
4065
5779a1dc
PE
4066 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
4067 Use pointer-to-a-pointer to simplify and avoid a NILP check each
4068 time an item is removed. No need to mark this function 'inline';
4069 the compiler knows better than we do.
4070
c4c9756b
JD
40712012-09-11 Jan Djärv <jan.h.d@swipnet.se>
4072
4073 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
4074 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
4075 to change_frame_size (Bug#12388).
4076 (windowDidResize:): Pass YES to updateFrameSize.
4077
4078 * nsterm.h: Add delay parameter to updateFrameSize.
4079
d73e321c
DA
40802012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4081
4082 Discard killed buffers from deleted window and frame objects.
4083 This reduces an amount of references to killed buffers and
4084 helps GC to reclaim them faster.
4085 * alloc.c (discard_killed_buffers): New function.
4086 (mark_object): Use it for deleted windows and frames.
4087 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 4088 or deleted frame, restore its global binding.
d73e321c
DA
4089 * data.c (swap_in_global_binding): Add GC notice.
4090 (swap_in_symval_forwarding): Use convenient set_blv_where.
4091 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
4092 * window.h: ... to here.
4093
e578f381
DA
40942012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
4095
4096 Convenient macro to check whether the buffer is live.
4097 * buffer.h (BUFFER_LIVE_P): New macro.
4098 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
4099 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
4100
3057e615
YM
41012012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4102
4103 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
4104 composition cases (Bug#12364).
4105
4106 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
4107 overhang of succeeding glyphs overlapping box cursor.
4108
4109 * w32term.c (x_draw_glyph_string): Likewise.
4110
6fda35f2
PE
41112012-09-11 Paul Eggert <eggert@cs.ucla.edu>
4112
c990426a
PE
4113 Simplify, document, and port floating-point (Bug#12381).
4114 The porting part of this patch fixes bugs on non-IEEE platforms
4115 with frexp, ldexp, logb.
4116 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
4117 Now static.
4118 * floatfns.c: Simplify discussion of functions that Emacs doesn't
4119 support, by removing commented-out code and briefly listing the
4120 C89 functions excluded. The commented-out stuff was confusing
4121 maintenance, e.g., we thought we needed cbrt but it was commented out.
4122 (logb): Remove decl; no longer needed.
4123 (isfinite): New macro, if not already supplied.
4124 (isnan): Don't replace any existing macro.
4125 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
4126 are present on all C89 platforms.
4127 (Ffrexp): Do not special-case zero, as frexp does the right thing
4128 for that case.
4129 (Flogb): Do not use logb, as it doesn't have the desired meaning
4130 on hosts that use non-base-2 floating point. Instead, stick with
4131 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
4132 frexp, to avoid getting an unspecified result.
4133
6fda35f2
PE
4134 * xdisp.c (Qinhibit_debug_on_message): Now static.
4135
16130a58
JD
41362012-09-10 Jan Djärv <jan.h.d@swipnet.se>
4137
4138 * nsterm.m (ns_update_begin): Set clip path to whole view by using
4139 NSBezierPath (Bug#12131).
4140
d105a573
CY
41412012-09-10 Chong Yidong <cyd@gnu.org>
4142
4143 * fns.c (Fdelq, Fdelete): Doc fix.
4144
ff55dfe8
PE
41452012-09-10 Paul Eggert <eggert@cs.ucla.edu>
4146
4147 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
4148 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
4149
e7032e7c
SM
41502012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
4151
4152 * lisp.h (make_lisp_ptr): New macro to replace XSET.
4153 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
4154 Use it.
4155
e9957956
EZ
41562012-09-09 Eli Zaretskii <eliz@gnu.org>
4157
aba05ce9
EZ
4158 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
4159 left fringe if the window has a left margin. This avoids leaving
4160 traces of the cursor because its leftmost pixel is not drawn over.
4161
e9957956
EZ
4162 * dispnew.c (update_window_line): When the left margin area of a
4163 screen line is updated, set the redraw_fringe_bitmaps_p flag of
4164 that screen line. (Bug#12277)
4165
f6196b87
PE
41662012-09-09 Paul Eggert <eggert@cs.ucla.edu>
4167
4168 Assume C89 or later for math functions (Bug#12381).
4169 This simplifies the code, and makes it a bit smaller and faster,
4170 and (most important) makes it easier to clean up signal handling
4171 since we can stop worring about floating-point exceptions in
4172 library code. That was a problem before C89, but the problem
4173 went away many years ago on all practical Emacs targets.
4174 * data.c, image.c, lread.c, print.c:
4175 Don't include <math.h>; no longer needed.
4176 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
4177 might be autoconfigured, as that never happens.
4178 * data.c (fmod):
4179 * doprnt.c (DBL_MAX_10_EXP):
4180 * print.c (DBL_DIG):
4181 Remove. C89 or later always defines these.
4182 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
4183 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
4184 (arith_error, domain_error, domain_error2):
4185 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
4186 no longer needed -- we simply return what C returns. All uses removed.
4187 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
4188 the wrapped code.
4189 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
4190 Remove. All uses expanded, as these macros are no longer used
4191 more than once and are now more trouble than they're worth.
4192 (Ftan): Use tan, not sin / cos.
4193 (Flogb): Assume C89 frexp.
4194 (fmod_float): Assume C89 fmod.
4195 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
4196 (init_floatfns): Remove. All uses removed.
4197
9d7f1863
JD
41982012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4199
4200 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
4201 compositeToPoint for OSX < 10.6 (Bug#12390).
4202
eabf0404
PE
42032012-09-08 Paul Eggert <eggert@cs.ucla.edu>
4204
4205 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
4206 This produces more-accurate results.
4207
0b3b1d23
JD
42082012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4209
4210 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
4211 changes (Bug#12088).
4212
6dcef6ec
CY
42132012-09-08 Chong Yidong <cyd@gnu.org>
4214
4215 * syntax.c (Fstring_to_syntax): Doc fix.
4216
aa7d57c5
JD
42172012-09-08 Jan Djärv <jan.h.d@swipnet.se>
4218
4219 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
4220 in the internal border.
4221 (x_set_window_size): Remove static variables and their usage.
4222 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
4223 (ns_after_update_window_line, ns_draw_fringe_bitmap):
4224 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
4225 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
4226 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
4227 (ns_fix_rect_ibw): Remove.
4228 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
4229 (ns_dumpglyphs_box_or_relief): Ditto.
4230 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
4231 adjustment.
4232 (ns_dumpglyphs_image): Ditto.
fc0c31f8 4233 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
4234 border adjustment.
4235 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
4236 their usage. Add fringe_extended_p and its use as in other terms.
4237 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
4238 scroll bar was removed.
4239 (updateFrameSize): New function.
4240 (windowDidResize): Move code to updateFrameSize and call it.
4241
4242 * nsterm.h (EmacsView): Add updateFrameSize.
4243
1a5432bc
CY
42442012-09-07 Chong Yidong <cyd@gnu.org>
4245
b4f5313e
CY
4246 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
4247
1a5432bc
CY
4248 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
4249
1a4f1e9b
PE
42502012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4251
4252 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
4253 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
4254 Problem introduced when merging patches. Noted by Eli Zaretskii in
4255 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
4256 * floatfns.c: Comment fix.
4257 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
4258 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
4259 and anyway the declaration is harmless even if SIGDANGER is not defined.
4260 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
4261 defined BROKEN_FIONREAD). systty.h formerly did this, but other
4262 source files not surprisingly expected syssignal.h to define, or
4263 not define, SIGIO, and it's cleaner to do it that way, for consistency.
4264 Include <sys/ioctl.h>, for FIONREAD.
4265 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
4266 This eliminates a problem whereby other files mysteriously had
4267 to include "syssignal.h" before including "systty.h" if they
4268 wanted to use "#ifdef SIGIO".
4269
bc8000ff
EZ
42702012-09-07 Eli Zaretskii <eliz@gnu.org>
4271
3e6d6928
EZ
4272 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
4273
4274 * w32.c (sigemptyset): Empty the set.
4275 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4276
bc8000ff
EZ
4277 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4278
b4fa72f2
DA
42792012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4280
4281 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4282 (mark_object): Likewise for frame objects.
4283
30730c93
PE
42842012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4285
4286 * syssignal.h (handle_on_main_thread): Always declare,
4287 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4288 This ports to platforms without HAVE_PTHREAD.
4289
2fe28299
PE
42902012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4291
4292 Signal-handler cleanup (Bug#12327).
4293 Emacs's signal handlers were written in the old 4.2BSD style with
4294 sigblock and sigmask and so forth, and this led to some
4295 inefficiencies and confusion. Rewrite these to use
4296 pthread_sigmask etc. without copying signal sets around. Also,
4297 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4298 'signal', and instead use functions that do not attempt to take
4299 over the system name space. This patch causes Emacs's text
4300 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4301 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4302 Do not include <signal.h> or "syssignal.h", as these
4303 modules do not use signals.
4304 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4305 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4306 Do not include <signal.h>, as "syssignal.h" does that for us now.
4307 * atimer.c (sigmask_atimers): New function.
4308 (block_atimers, unblock_atimers): New functions,
4309 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4310 All uses replaced.
4311 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4312 no longer needed here.
4313 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 4314 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
4315 * sysdep.c (struct save_signal): New member 'action', replacing
4316 old member 'handler'.
4317 (save_signal_handlers, restore_signal_handlers):
4318 Use sigaction instead of 'signal' to save and restore.
4319 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4320 New function. All users of 'signal' modified to use set_sighandler
4321 if they're writeonly, and to use sys_signal if they're read+write.
4322 (emacs_sigaction_init, forwarded_signal): New functions.
4323 (sys_signal): Remove. All uses replaced by calls to sigaction
4324 and emacs_sigaction_init, or by direct calls to 'signal'.
4325 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4326 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4327 all uses replaced by pthread_sigmask etc. calls.
4328 * syssignal.h: Include <signal.h>.
4329 (emacs_sigaction_init, forwarded_signal): New decls.
4330 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4331 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4332 (sigmask, sys_sigmask): Remove; no longer needed.
4333 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4334 (sigblock, sigunblock, sigfree):
4335 (sigsetmask) [!defined sigsetmask]:
4336 Remove. All uses replaced by pthread_sigmask.
4337 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4338 no longer need to be replaced, and its typical old uses
4339 are now done via emacs_sigaction_init and sigaction.
4340 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4341 (sys_sigdel): Remove; unused.
4342 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4343
0216c128
EZ
43442012-09-06 Eli Zaretskii <eliz@gnu.org>
4345
4346 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4347 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4348
c752cfa9
DA
43492012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4350
4351 Explicitly mark buffer_defaults and buffer_local_symbols.
4352 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4353 mark_local_symbols here.
4354 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4355 since special buffers aren't marked here any more.
4356 (allocate_buffer): Chain new buffer with all_buffers here...
4357 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4358 not here.
4359 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4360 (syms_of_buffer): Remove staticpro of the above.
4361 (init_buffer_once): Set names for buffer_defaults and
4362 buffer_local_symbols.
4363
a864ef14
PE
43642012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4365
4366 Use bool for booleans in font-related modules.
4367 * font.c (font_intern_prop, font_style_to_value)
4368 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4369 (generate_otf_features, font_check_otf_features, font_check_otf)
4370 (font_match_p, font_list_entities, font_at):
4371 * fontset.c (fontset_id_valid_p, reorder_font_vector
4372 (fontset_find_font, Fset_fontset_font)
4373 (face_suitable_for_char_p) [0]:
4374 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4375 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4376 (m17n_flt_initialized, ftfont_shape_by_flt):
4377 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4378 * nsfont.m (nsfont_draw):
4379 * w32font.c (w32font_draw):
4380 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4381 Use bool for booleans.
4382 * font.h: Adjust to above API changes.
4383 (struct font, struct font_driver, struct font_driver_list):
4384 Use bool for booleans.
4385 (struct font): Remove useless member encoding_type.
4386 All users removed.
4387 * fontset.c, xftfont.c: Omit unnecessary static decls.
4388
0699fc18
DA
43892012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4390
4391 * alloc.c (mark_object): Revert window marking code
4392 since it's unsafe for the Fset_window_configuration.
4393
20ef56db
PE
43942012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4395
2fe28299 4396 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
4397 Be more systematic about preserving errno whenever a signal
4398 handler returns, even if it's not in the main thread. Do this by
4399 renaming signal handlers to distinguish between signal delivery
4400 and signal handling. All uses changed.
4401 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4402 * data.c (deliver_arith_signal): Rename from arith_error.
4403 * dispnew.c (deliver_window_change_signal): Rename from
4404 window_change_signal.
4405 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4406 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4407 * keyboard.c (deliver_input_available_signal): Rename from
4408 input_available_signal.
4409 (deliver_user_signal): Rename from handle_user_signal.
4410 (deliver_interrupt_signal): Rename from interrupt_signal.
4411 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4412 (deliver_child_signal): Rename from sigchld_handler.
4413 * atimer.c (handle_alarm_signal):
4414 * data.c (handle_arith_signal):
4415 * dispnew.c (handle_window_change_signal):
4416 * emacs.c (handle_fatal_signal, handle_danger_signal):
4417 * keyboard.c (handle_input_available_signal):
4418 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4419 * process.c (handle_pipe_signal, handle_child_signal):
4420 New functions, with the actual signal-handling code taken from the
4421 original respective signal handlers, sans the sporadic attempts to
4422 preserve errno, since that's now done by handle_on_main_thread.
4423 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4424 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4425 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4426 Move to sysdep.c.
4427 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4428 Move initialization of main_thread to sysdep.c's init_signals.
4429 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4430 our usage, and simplifies the mainline code.
4431 (record_child_status_change): New static function, as a helper
4432 for handle_child_signal, and with most of the old child handler's
4433 contents.
4434 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4435 (handle_child_signal): Use the above.
4436 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4437 Moved here from emacs.c.
4438 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4439 code moved here from emacs.c's main function.
4440 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
4441 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4442 This lets callers save and restore errno properly.
20ef56db 4443
e3ccf108
DA
44442012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4445
4446 Remove redundant or unused things here and there.
4447 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4448 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4449 * editfns.c (Fcompare_buffer_substrings): Likewise.
4450 * frame.h (struct terminal, struct font_driver_list):
4451 Remove redundant declarations.
4452 * window.h (Qleft, Qright): Likewise.
4453
697e1e39
DA
44542012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4455
4456 Do not mark objects from deleted buffers, windows and frames.
4457 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4458 (mark_object): Likewise for windows and frames.
4459
c1ca42ca
DA
44602012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4461
4462 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4463 buffer_defaults and buffer_local_symbols as valid objects.
4464 Return special value to denote them.
4465
014d93be
PE
44662012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4467
f75d7a91
PE
4468 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4469 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4470 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4471 (file_name_absolute_p, Fsubstitute_in_file_name):
4472 (check_executable, check_writable, Ffile_accessible_directory_p)
4473 (Fset_file_selinux_context, Fdefault_file_modes)
4474 (Finsert_file_contents, choose_write_coding_system)
4475 (Fwrite_region, build_annotations, a_write, e_write)
4476 (Fdo_auto_save):
4477 * filelock.c (boot_time_initialized, get_boot_time)
4478 (get_boot_time_1, lock_file_1, within_one_second):
4479 * floatfns.c (in_float):
4480 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4481 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4482 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4483 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4484 * window.c (compare_window_configurations):
4485 Use bool for booleans.
4486 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4487 (Fdefault_file_modes): Now mode_t, not int, for modes.
4488 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4489 (internal_delete_file): Now returns void, not a (boolean) int,
4490 since nobody was looking at the return value.
4491 * lisp.h, window.h: Adjust to above API changes.
4492
014d93be
PE
4493 * xdisp.c (set_message): Simplify and reindent last change.
4494
776f29e1
JB
44952012-09-05 Juanma Barranquero <lekktu@gmail.com>
4496
4497 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4498
7f7e0167
LI
44992012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4500
4501 * eval.c (call_debugger): Make the function non-static so that we
4502 can call it from set_message.
4503
4504 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4505 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4506
cf29dd84
PE
45072012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4508
4509 Give more-useful info on a fatal error (Bug#12328).
4510 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4511 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4512 of doing the work ourselves.
4513 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4514 do most of the work.
4515 (fatal_error_backtrace): New function, taken from the guts
4516 of the old fatal_error_signal, but with a new option to output
4517 a backtrace.
4518 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4519 info about the signal than just its number.
4520 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4521 * sysdep.c: Include <execinfo.h>
4522 (emacs_backtrace): New function, taken partly from the previous
4523 code of the 'die' function.
4524 (emacs_abort): Call fatal_error_backtrace rather than abort.
4525
972debf2
SM
45262012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4527
4528 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4529 eager (load-time) macro-expansion.
4530 * lisp.mk (lisp): Add macroexp.
4531
1088b922
PE
45322012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4533
4534 Simplify redefinition of 'abort' (Bug#12316).
4535 Do not try to redefine the 'abort' function. Instead, redo
4536 the code so that it calls 'emacs_abort' rather than 'abort'.
4537 This removes the need for the NO_ABORT configure-time macro
4538 and makes it easier to change the abort code to do a backtrace.
4539 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4540 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4541 Remove; sysdep.c's emacs_abort now takes its place.
4542 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4543 'abort' changed to use 'emacs_abort'.
4544 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4545 (abort) [!defined abort]: Rename to ...
4546 (emacs_abort): ... new name.
4547 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4548 the place of the old 'abort' in emacs.c.
4549 * w32.c, w32fns.c (abort): Do not #undef.
4550 * w32.c (emacs_abort): Rename from w32_abort.
4551
30934d33
EZ
45522012-09-04 Eli Zaretskii <eliz@gnu.org>
4553
4554 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4555 offsets[j].dv, since the y axis of the screen coordinates points
4556 down, while the y axis of the font definition coordinates points
4557 up. This fixes display of Arabic diacritics such as KASRA and
4558 KASRATAN. (Bug#11860)
4559
af26b72c
PE
45602012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4561
4562 Be more systematic about _setjmp vs setjmp.
4563 * alloc.c (test_setjmp, mark_stack):
4564 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4565 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4566 (png_load, my_error_exit, jpeg_load):
4567 * process.c (send_process_trap, send_process):
4568 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4569 The underscored versions are up to 30x faster on some hosts.
4570 Formerly, the code used setjmp+longjmp sometimes and
4571 _setjmp+_longjmp at other times, with no particular reason to
4572 prefer setjmp+longjmp.
4573
26d4541d
PE
45742012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4575
d42f4f0f 4576 Fix minor problem found by static checking.
26d4541d 4577 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 4578
c5e28e39
MR
45792012-09-03 Martin Rudalics <rudalics@gmx.at>
4580
4581 * buffer.c (Fdelete_all_overlays): New function.
4582
3eab3ca9
CY
45832012-09-03 Chong Yidong <cyd@gnu.org>
4584
4585 * gtkutil.c: Add extern decl for Qxft.
4586
c04889f8
PE
45872012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4588
1882aa38
PE
4589 * emacs.c, eval.c: Use bool for boolean.
4590 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4591 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4592 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4593 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4594 (main, decode_env_path, Fdaemon_initialized):
4595 * eval.c (call_debugger, Finteractive_p, interactive_p):
4596 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4597 (maybe_call_debugger, Fbacktrace):
4598 * process.c (read_process_output, exec_sentinel):
4599 Use bool for booleans.
4600 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4601 All callers changed.
4602 * eval.c (interactive_p): Omit always-true boolean argument
4603 EXCLUDE_SUBRS_P. All callers changed.
4604 * dispextern.h, lisp.h: Reflect above API changes.
4605 * firstfile.c (dummy): Use the address of 'main', whose signature
4606 won't change, instead of the address of 'initialize', whose
4607 signature just changed from int to bool.
4608 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4609 * msdos.c (fatal_error_in_progress): ... from here.
4610 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4611 of incrementing it.
4612 (redisplay_internal, unwind_redisplay): Simply clear
4613 REDISPLAYING_P when unwinding, instead of saving its previous,
4614 always-false value and then restoring it.
4615
a411ac43
PE
4616 Clean up some extern decls.
4617 Mostly, this hoists extern decls out of .c files and into .h files.
4618 That way, we're more likely to catch errors if the interfaces change.
4619 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4620 declare xg_mark_data.
4621 * dispextern.h (x_frame_parm_handlers):
4622 * font.h (Qxft):
4623 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4624 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4625 (Qultra_bold, Qoblique, Qitalic):
4626 Move extern decl here from .c file.
4627 * alloc.c (xg_mark_data) [USE_GTK]:
4628 * doc.c (Qclosure):
4629 * eval.c (Qlexical_binding):
4630 * fns.c (time) [!HAVE_UNISTD_H]:
4631 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4632 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4633 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4634 * lread.c (Qinternal_interpreter_environment):
4635 * minibuf.c (Qbuffer):
4636 * process.c (QCfamily, QCfilter):
4637 * widget.c (free_frame_faces):
4638 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4639 * xfont.c (x_clear_errors):
4640 * xterm.c (x_frame_parm_handlers):
4641 Remove now-redundant extern decls.
4642 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4643 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4644 Now static.
4645 * xfaces.c: Remove unnecessary static decls.
4646 * xterm.c (updating_frame): Remove decl of nonexistent object.
4647
c04889f8
PE
4648 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4649 when building globals.h, as the objects that are not built on
4650 this host are not needed to compile C files on this host.
4651
8b339673
JD
46522012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4653
4654 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4655
4656 * frame.h: Add missing prototype for x_wm_set_size_hint.
4657
a08d4ba7
PE
46582012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4659
4660 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4661 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4662 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4663 (Fsubstitute_command_keys):
4664 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4665 (save_excursion_save, save_excursion_restore)
4666 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4667 (format_time_string, general_insert_function)
4668 (make_buffer_string, make_buffer_string_both)
4669 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4670 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4671 (copy_text, insert_1, insert_1_both, insert_from_string)
4672 (insert_from_string_before_markers, insert_from_string_1)
4673 (insert_from_buffer, insert_from_buffer_1, replace_range)
4674 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4675 (del_range_2, modify_region):
4676 * intervals.c (intervals_equal, balance_possible_root_interval)
4677 (adjust_intervals_for_insertion, merge_properties_sticky)
4678 (graft_intervals_into_buffer, lookup_char_property)
4679 (adjust_for_invis_intang, set_point_both)
4680 (get_property_and_range, compare_string_intervals)
4681 (set_intervals_multibyte_1, set_intervals_multibyte):
4682 * keyboard.c (decode_timer):
4683 Use bool for boolean.
4684 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4685 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4686
48c948de
CY
46872012-09-02 Chong Yidong <cyd@gnu.org>
4688
4689 * keymap.c (push_key_description): Print M-TAB as C-M-i
4690 (Bug#11758).
4691
6c49a40b
JB
46922012-09-02 Juanma Barranquero <lekktu@gmail.com>
4693
4694 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4695 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4696 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4697 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4698 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4699 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4700 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4701
4dfbd238
EZ
47022012-09-01 Eli Zaretskii <eliz@gnu.org>
4703
7e510e28
EZ
4704 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4705 more than one grapheme cluster passed to the shaper: compute the
4706 offset adjustment values separately for each cluster. (Bug#11860)
4707
4dfbd238
EZ
4708 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4709 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4710 about implicit conversions from integer to pointer.
4711
86571ae0
DC
47122012-09-01 Daniel Colascione <dancol@dancol.org>
4713
4714 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4715 system used too early.
4716
0e23ef9d
PE
47172012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4718
4719 Better seed support for (random).
4720 * emacs.c (main): Call init_random.
4721 * fns.c (Frandom): Set the seed from a string argument, if given.
4722 Remove long-obsolete Gentzel cruft.
4723 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4724 (init_random): New function.
4725
17a2cbbd
DC
47262012-09-01 Daniel Colascione <dancol@dancol.org>
4727
4728 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4729 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4730 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4731 x_wm_set_size_hint, x_query_colors, x_real_positions,
4732 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4733 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4734 all of which have been moved to common code.
4735
4736 * xfaces.c: Include TERM_HEADER instead of listing all possible
4737 window-system headers.
4738
4739 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4740 to match header.
4741
4742 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4743 directly accessing frame internals.
4744
f18cbb28 4745 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
4746 globals_of_w32font.
4747
4748 * process.c: Include TERM_HEADER instead of listing all possible
4749 window-system headers.
4750
3a880af4
SM
4751 * nsterm.h: Remove declarations now in frame.h.
4752 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
4753
4754 * menu.c: Include TERM_HEADER instead of listing all possible
4755 window-system headers.
4756
4757 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4758 window system.
4759
4760 * keyboard.c: Include TERM_HEADER instead of listing all possible
4761 window-system headers.
4762
4763 * image.c: Include TERM_HEADER instead of listing all possible
4764 window-system headers. Declare Vlibrary_cache when compiling for
4765 Windows.
4766
4767 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4768 window system declarations.
4769
4770 * frame.h: Move common functions here: set_frame_menubar,
4771 x_set_window_size, x_sync, x_get_focus_frame,
4772 x_set_mouse_position, x_set_mouse_pixel_position,
4773 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4774 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4775 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4776 x_activate_menubar, x_real_positions, x_bitmap_icon,
4777 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4778 and x_query_colors.
4779
4780 * frame.c: Include TERM_HEADER instead of listing all possible
4781 window-system headers.
4782
4783 * font.c: Include TERM_HEADER instead of listing all possible
4784 window-system headers.
4785
4786 * emacs.c: Include TERM_HEADER.
4787
f18cbb28
EZ
4788 * dispnew.c: Include TERM_HEADER instead of listing all possible
4789 window-system headers.
17a2cbbd 4790
f18cbb28 4791 * ccl.h: Include character.h.
17a2cbbd
DC
4792
4793 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4794 the current window system; include in list of objects to link into
4795 Emacs.
4796
c650a5de
DA
47972012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4798
4799 Remove mark_ttys function and fix tty_display_info initialization.
4800 * lisp.h (mark_ttys): Remove prototype.
4801 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4802 to mark_ttys because all possible values of 'top_frame' slot are
4803 the frames which are reachable from Vframe_list.
4804 * term.c (mark_ttys): Remove.
4805 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4806
4e0f6479
DA
48072012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4808
4809 Change struct frame bitfields from unsigned char to unsigned.
4810 * frame.h (struct frame): Change type of 'display_preempted',
4811 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4812 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4813 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4814 bitfields from unsigned char to unsigned.
4815
8b96a52c
DA
48162012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4817
4818 Remove unused member of struct x_output and struct w32_output.
4819 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4820 * w32term.h (struct w32_output): Likewise.
4821
b4444c8a
JD
48222012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4823
4824 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4825 does not become zero (Bug#12234).
4826
b98521db
PE
48272012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4830 for GCC 4.7.1 x86-64.
4831
31d02438
GM
48322012-08-30 Glenn Morris <rgm@gnu.org>
4833
4834 * lread.c (init_lread): For out-of-tree builds, only add the
4835 source directory's site-lisp dir to the load-path if it exists,
4836 consistent with in-tree builds. (Bug#12302)
4837
7f8941d8
JD
48382012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4839
4840 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 4841 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
4842 (windowShouldClose:): Set window_closed.
4843 (dealloc): New member, free button_values.
fc0c31f8
JB
4844 (process_dialog:): Make member function. Remove window argument,
4845 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
4846 in button_values.
4847 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 4848 with tag. Remove return self, declare return value as void.
7f8941d8
JD
4849 (addString:row:): Remove return self, declare return value as void.
4850 (addSplit): Remove return self, declare return value as void.
4851 (clicked:): Remove return self, declare return value as void.
fc0c31f8 4852 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
4853 (initFromContents:isQuestion:): Adjust call to process_dialog.
4854 Code formatting change.
4855 (timeout_handler:): Set timer_fired to YES.
4856 (runDialogAt:): Set timer_fired to NO.
4857 Handle click on close button as quit.
4858
4859 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4860 Add window_closed and button_values. Add void as return value for
4861 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4862 Add process_dialog as new member.
4863
eada0861 48642012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 4865
eada0861
GM
4866 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4867 is not one of the heaps we manage. (Bug#12242)
4868
48692012-08-28 Glenn Morris <rgm@gnu.org>
4870
4871 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4872
457294dd
MR
48732012-08-28 Martin Rudalics <rudalics@gmx.at>
4874
4875 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
4876 auto-buffer-name window parameter. Install revision of reverted
4877 fix.
457294dd 4878
4f2daf31
DA
48792012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4880
4881 Do not allow to set major mode for a dead buffer.
4882 * buffer.c (Fset_buffer_major_mode): Signal an error
4883 if the buffer is dead.
4884 (Fother_buffer, other_buffer_safely): Remove redundant
4885 nested declaration.
4886
66322887
DA
48872012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4888
4889 Always use set_buffer_if_live to restore original buffer at unwind.
4890 * buffer.h (record_unwind_current_buffer): New function.
4891 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4892 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4893 * undo.c, window.c: Adjust users.
4894 * buffer.c (set_buffer_if_live): Fix comment.
4895
a3d794a1
DA
48962012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4897
4898 Fix usage of set_buffer_internal.
4899 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4900 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4901 * coding.c (decode_coding): Omit redundant test.
4902 * fileio.c (decide_coding_unwind): Likewise.
4903 * fns.c (secure_hash): Likewise.
4904 * insdel.c (modify_region): Likewise.
4905 * keyboard.c (command_loop_1): Likewise.
4906 * print.c (PRINTFINISH): Likewise.
4907 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4908
59ea14cd
PE
49092012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4910
4911 * dispnew.c: Use bool for boolean.
4912 (frame_garbaged, display_completed, delayed_size_change)
4913 (fonts_changed_p, add_window_display_history)
4914 (add_frame_display_history, verify_row_hash)
4915 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4916 (row_equal_p, realloc_glyph_pool)
4917 (allocate_matrices_for_frame_redisplay)
4918 (showing_window_margins_p)
4919 (adjust_frame_glyphs_for_frame_redisplay)
4920 (build_frame_matrix_from_leaf_window, make_current)
4921 (mirrored_line_dance, mirror_line_dance, update_frame)
4922 (update_window_tree, update_single_window)
4923 (check_current_matrix_flags, update_window, update_text_area)
4924 (update_window_line, set_window_update_flags, scrolling_window)
4925 (update_frame_1, scrolling, buffer_posn_from_coords)
4926 (do_pending_window_change, change_frame_size)
4927 (change_frame_size_1, sit_for):
4928 Use bool for boolean.
4929 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4930 and remove last int (actually boolean) argument, which was always 0.
4931 All callers changed.
4932 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4933 * dispextern.h (struct composition_it): Use bool for boolean.
4934 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4935 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4936 * dired.c (file_name_completion):
4937 Use bool for boolean. (This was missed in an earlier change.)
4938
95072a94
MR
49392012-08-27 Martin Rudalics <rudalics@gmx.at>
4940
4941 * window.c (Fset_window_configuration): Revert first part of
4942 last change.
4943
0f19feff
JD
49442012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4945
4946 * nsterm.h (NSPanel): New class variable dialog_return.
4947
3a880af4
SM
4948 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4949 Initialize dialog_return.
0f19feff
JD
4950 (windowShouldClose:): Use stop instead of stopModalWithCode.
4951 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4952 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4953 event.
4954 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4955 modal loop returns.
4956
f10fe38f
PE
49572012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4958
de1339b0
PE
4959 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4960 * composite.c (find_composition, composition_gstring_p)
4961 (composition_reseat_it, find_automatic_composition):
4962 * data.c (let_shadows_buffer_binding_p)
4963 (let_shadows_global_binding_p, set_internal, make_blv)
4964 (Fmake_variable_buffer_local, Fmake_local_variable)
4965 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4966 (cons_to_signed, arith_driver):
4967 * dbusbind.c (xd_in_read_queued_messages):
4968 * dired.c (directory_files_internal, file_name_completion):
4969 Use bool for booleans.
4970 * dired.c (file_name_completion):
4971 * process.h (fd_callback):
4972 Omit int (actually boolean) argument. It wasn't being used.
4973 All uses changed.
4974 * composite.h, lisp.h: Reflect above API changes.
4975
f10fe38f
PE
4976 * cmds.c, coding.c: Use bool for booleans.
4977 * cmds.c (move_point, Fself_insert_command):
4978 * coding.h (struct composition status, struct coding_system):
4979 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4980 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4981 (emacs_mule_char, decode_coding_emacs_mule)
4982 (encode_coding_emacs_mule, detect_coding_iso_2022)
4983 (decode_coding_iso_2022, encode_invocation_designation)
4984 (encode_designation_at_bol, encode_coding_iso_2022)
4985 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4986 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4987 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4988 (encode_coding_raw_text, detect_coding_charset)
4989 (decode_coding_charset, encode_coding_charset, detect_eol)
4990 (detect_coding, get_translation_table, produce_chars)
4991 (consume_chars, reused_workbuf_in_use)
4992 (make_conversion_work_buffer, code_conversion_save)
4993 (decode_coding_object, encode_coding_object)
4994 (detect_coding_system, char_encodable_p)
4995 (Funencodable_char_position, code_convert_region)
4996 (code_convert_string, code_convert_string_norecord)
4997 (Fset_coding_system_priority):
4998 * fileio.c (Finsert_file_contents):
4999 Use bool for booleans.
5000 * coding.h, lisp.h: Reflect above API changes.
5001 * coding.c: Remove unnecessary static function decls.
5002 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
5003 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
5004 not a boolean 'int', since callers never look at the return value.
5005 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
5006 * coding.h (decoding_buffer_size, encoding_buffer_size)
5007 (emacs_mule_string_char): Remove unused extern decls.
5008 (struct iso_2022_spec, struct coding_system):
5009 Use 'unsigned int : 1' for boolean fields, since there's more than one.
5010 (struct emacs_mule_spec): Remove unused field 'full_support'.
5011 All initializations removed.
5012 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
5013
5474c384
DA
50142012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5015
f10fe38f 5016 Fix spare memory change (Bug#12286).
5474c384
DA
5017 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
5018 (valid_lisp_object_p): Likewise.
5019
c4b6914d
MR
50202012-08-27 Martin Rudalics <rudalics@gmx.at>
5021
5022 * window.c (Fset_window_configuration): Record any window's old
5023 buffer if it's replaced (see Bug#8789). If the new current
5024 buffer doesn't appear in the selected window, go to its old
5025 point (Bug#12208).
5026
35aaa1ea
DA
50272012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
5028
5029 Special MEM_TYPE_SPARE to denote reserved memory.
5030 * alloc.c (enum mem_type): New memory type.
5031 (refill_memory_reserve): Use new type for spare memory.
5032 This prevents live_cons_p and live_string_p from incorrect
5033 detection of uninitialized objects from spare memory as live.
5034
6af64513
PE
50352012-08-26 Paul Eggert <eggert@cs.ucla.edu>
5036
8b2e00a3
PE
5037 Spelling fixes.
5038 * Makefile.in (.PHONY): versioclean -> versionclean.
5039
b52d6985
PE
5040 Remove unused external symbols.
5041 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
5042 * window.c (Qwindow_valid_p, decode_valid_window):
5043 Now static, not extern.
5044 * data.c (Qinterval): Remove; unused.
5045 (syms_of_data): Do not define 'interval'.
5046 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
5047 * window.h (decode_valid_window):
5048 Remove decls.
5049
d5172d4f
PE
5050 * character.c, charset.c, chartab.c: Use bool for booleans.
5051 * character.c (lisp_string_width, string_count_byte8)
5052 (string_escape_byte8):
5053 * charset.c (charset_map_loaded, load_charset_map, read_hex):
5054 (load_charset_map_from_file, map_charset_chars)
5055 (Fdefine_charset_internal, define_charset_internal)
5056 (Fdeclare_equiv_charset, find_charsets_in_text)
5057 (Ffind_charset_region, char_charset, Fiso_charset):
5058 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
5059 (sub_char_table_set, sub_char_table_set_range)
5060 (char_table_set_range, optimize_sub_char_table)
5061 (map_sub_char_table):
5062 Use bool for boolean.
5063 * character.c (str_to_unibyte): Omit last boolean argument; it was
5064 always 0. All callers changed.
5065 * character.h, charset.h: Adjust to match previous changes.
5066 * character.h (char_printable_p): Remove decl of nonexistent function.
5067 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
5068 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
5069 are all boolean, so make them single-bit bitfields.
5070
6af64513
PE
5071 * lisp.h (ASET): Remove attempt to detect side effects.
5072 It was meant to be temporary and it often doesn't work,
5073 because when IDX has side effects the behavior of IDX==IDX
5074 is undefined. See Stefan Monnier in
5075 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
5076
e1f29348
BR
50772012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5078
5079 * lisp.h (functionp): New function (extracted from Ffunctionp).
5080 (FUNCTIONP): Use it.
5081 * eval.c (Ffunctionp): Use it.
5082
17c05d74
PE
50832012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5084
0f46bc75
PE
5085 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
5086 as that's faster and simpler than static storage. Don't bother
5087 with the g_main_context_query overhead if g_main_context_pending
5088 says no events are pending.
5089 (gfds, gfds_size): Remove these static vars.
5090 (xgselect_initialize): Remove; no longer needed.
5091 All uses and decls removed.
5092
ee4c0f69
PE
5093 * emacs.c (fatal_error_signal_hook): Remove.
5094 All uses removed. This leftover from old code was always 0.
5095
17c05d74
PE
5096 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
5097 * casefiddle.c (casify_object, casify_region):
5098 * casetab.c (set_case_table):
5099 * category.c, category.h (word_boundary_p):
5100 * category.h (CHAR_HAS_CATEGORY):
5101 Use bool for booleans, instead of int.
5102
391ceac5
EZ
51032012-08-25 Eli Zaretskii <eliz@gnu.org>
5104
5105 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
5106
2f221583
PE
51072012-08-25 Paul Eggert <eggert@cs.ucla.edu>
5108
f4a681b0
PE
5109 On assertion failure, print backtrace if available.
5110 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
5111 (die) [ENABLE_CHECKING]: Print a backtrace if available.
5112 * Makefile.in (LIB_EXECINFO): New macro.
5113 (LIBES): Use it.
5114
2f221583
PE
5115 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
5116 * bytecode.c (exec_byte_code):
5117 * callint.c (check_mark, Fcall_interactively):
5118 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
5119 (getenv_internal, sync_process_alive, call_process_exited):
5120 * lisp.h (USE_SAFE_ALLOCA):
5121 Use bool for booleans, instead of int.
5122 * lisp.h, process.h: Adjust prototypes to match above changes.
5123 * callint.c (Fcall_interactively): Don't assume the mark's
5124 offset fits in 'int'.
5125
37ef52bb
PE
51262012-08-24 Paul Eggert <eggert@cs.ucla.edu>
5127
5128 * buffer.c, buffer.h: Use bool for boolean.
5129 * buffer.c (reset_buffer_local_variables)
5130 (buffer_lisp_local_variables, Fset_buffer_modified_p)
5131 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
5132 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
5133 (overlay_touches_p, overlay_strings, Foverlay_put)
5134 (report_overlay_modification, call_overlay_mod_hooks):
5135 (mmap_enlarge, mmap_set_vars):
5136 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
5137 Use bool for booleans, instead of int.
5138 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
5139 since the 1-or-0 return value is always ignored anyway.
5140 (mmap_initialized_p):
5141 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
5142 * buffer.h, lisp.h: Adjust prototypes to match above changes.
5143
2cc21167
PE
51442012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5145
5146 * bidi.c: Use bool for boolean.
5147 This is a bit more readable, and makes the text segment of bidi.o
5148 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
5149 Presumably it's faster too.
5150 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
5151 Now bool.
5152 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5153 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
5154 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
5155 (bidi_explicit_dir_char, bidi_level_of_next_char)
5156 (bidi_find_other_level_edge, bidi_move_to_visually_next):
5157 Use bool for booleans, instead of int.
5158 * dispextern.h (bidi_init_it, bidi_paragraph_init)
5159 (bidi_unshelve_cache): Adjust decls to match code.
5160
7db4ddf4
MR
51612012-08-23 Martin Rudalics <rudalics@gmx.at>
5162
5163 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
5164 argument.
5165
b1bb8011
PE
51662012-08-23 Paul Eggert <eggert@cs.ucla.edu>
5167
5168 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
5169 * atimer.h: Include <stdbool.h>.
5170
ff687885
DN
51712012-08-22 Dan Nicolaescu <dann@gnu.org>
5172
5173 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
5174 compile time tests instead of run time tests on systems that do
5175 not use them.
5176 (FRAME_MAC_P): Remove leftover from deleted code.
5177 * frame.c (syms_of_frame): Remove leftover from deleted code.
5178
4ce7a138
JD
51792012-08-22 Jan Djärv <jan.h.d@swipnet.se>
5180
5181 * nsterm.m (insertText:): Don't clear modifiers if code is space.
5182
d733ec6d
PE
51832012-08-22 Paul Eggert <eggert@cs.ucla.edu>
5184
5185 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
5186 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 5187 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
5188 (fontset_add): Return void, for FONTSET_ADD.
5189
d0d2d26f
PE
51902012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5191
fce31d69
PE
5192 * alloc.c: Use bool for booleans.
5193 (gc_in_progress, abort_on_gc)
5194 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5195 (dont_register_blocks) [GC_MALLOC_CHECK]:
5196 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
5197 (check_string_bytes, make_specified_string, memory_full)
5198 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
5199 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
5200 (mark_stack, valid_pointer_p, make_pure_string)
5201 (Fgarbage_collect, survives_gc_p, gc_sweep):
5202 Use bool for booleans, instead of int.
5203 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
5204 Remove unused local.
5205 * alloc.c (PURE_POINTER_P):
5206 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
5207 * editfns.c (Fformat):
5208 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
5209 (Fdo_auto_save):
5210 * fns.c (sweep_weak_table):
5211 * lisp.h (suppress_checking, push_message, survives_gc_p)
5212 (make_pure_string, gc_in_progress, abort_on_gc):
5213 * lread.c (readchar, read1):
5214 * print.c (Fprin1_to_string):
5215 * xdisp.c (push_message):
5216 Use bool for booleans affected directly or indirectly by
5217 alloc.c's changes.
5218
d0d2d26f
PE
5219 Make recently-introduced setters macros.
5220 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
5221 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
5222 (set_fontset_default, set_fontset_fallback): Rename from their
5223 upper-case counterparts, and make them functions rather than macros.
5224 This is more consistent with the other recently-introduced setters.
5225 These don't need to be inline, since they're local.
5226
d18e2bb6
JD
52272012-08-21 Jan Djärv <jan.h.d@swipnet.se>
5228
5229 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
5230 the loop (Bug#12247).
5231
1b9d9d16
PE
52322012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5233
5234 * lisp.h (vcopy): Use memcpy rather than our own loop.
5235 This fixes a performance regression introduced by the recent
5236 addition of vcopy. This means 'vcopy' will need to be modified
5237 for a copying collector, but that's OK. Also, tighten the
5238 checking in the assertion.
5239
b2f09701
EZ
52402012-08-21 Eli Zaretskii <eliz@gnu.org>
5241
5242 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
5243 components for RTL text (Bug#11860). Adjust X-OFFSET of each
5244 non-base glyph for the width of the base character, according to
e1f29348
BR
5245 what x_draw_composite_glyph_string_foreground expects.
5246 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
5247 expectations, to produce correct width of the composed character.
5248 Reverse the sign of the DU offset produced by ScriptPlace.
5249
9b994fed
PE
52502012-08-21 Paul Eggert <eggert@cs.ucla.edu>
5251
5252 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
5253
086ca913
DA
52542012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5255
5256 Avoid direct writes to contents member of struct Lisp_Vector.
5257 * lisp.h (vcopy): New function to copy data into vector.
5258 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
5259 * fns.c (Ffillarray): Use ASET.
5260 * keyboard.c (timer_check_2): Use AREF and ASET.
5261 (append_tool_bar_item, Frecent_keys): Use vcopy.
5262 * lread.c (read_vector): Use ASET.
5263 * msdos.c (Frecent_doskeys): Use vcopy.
5264 * xface.c (Finternal_copy_lisp_face): Use vcopy.
5265 (Finternal_merge_in_global_face): Use ASET and vcopy.
5266 * xfont.c (xfont_list_pattern): Likewise.
5267
5481664a
MR
52682012-08-21 Martin Rudalics <rudalics@gmx.at>
5269
5270 * window.c (Fwindow_point): For the selected window always return
5271 the position of its buffer's point.
5272 (Fset_window_point): For the selected window always go in its
5273 buffer to the specified position.
5274
6d470bdd
DA
52752012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5276
5277 Setter macros for fontsets.
5278 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5279 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5280 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5281 Adjust users.
5282
24564fe1
GM
52832012-08-20 Glenn Morris <rgm@gnu.org>
5284
5285 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5286 Don't assume that `ln -f' works.
5287
0a05a035
EZ
52882012-08-20 Eli Zaretskii <eliz@gnu.org>
5289
5290 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5291 and later about non-assignments with no effect. See discussion at
5292 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5293 details.
5294
e46f2325
DA
52952012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5296
5297 Inline setter functions for Lisp_Objects slots of struct specbinding.
5298 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5299 Adjust users.
5300
734fbd86
MR
53012012-08-20 Martin Rudalics <rudalics@gmx.at>
5302
5303 * window.c (select_window): Always make selected window's buffer
5304 current.
5305
f1a95992
DA
53062012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5307
5308 Use AREF and ASET for docstrings of category tables.
5309 * category.h (CATEGORY_DOCSTRING): Use AREF.
5310 (SET_CATEGORY_DOCSTRING): Use ASET.
5311 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5312
e83064be
DA
53132012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5314
5315 Inline setter functions for hash table members.
5316 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5317 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5318 (set_hash_key_and_value, set_hash_index, set_hash_next)
5319 (set_hash_hash): New functions.
5320 * charset.c, fns.c: Adjust users.
5321
4ce60d2e
DA
53222012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5323
5324 Inline getter and setter functions for per-buffer values.
5325 * buffer.h (per_buffer_default, set_per_buffer_default)
5326 (per_buffer_value, set_per_buffer_value): New functions.
5327 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5328 * buffer.c, data.c: Adjust users.
5329
c06c9690
JB
53302012-08-20 Juanma Barranquero <lekktu@gmail.com>
5331
5332 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5333
32bd4250
PE
53342012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5335
bad03192 5336 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
5337 as gnulib does this if the system doesn't.
5338 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
5339 Remove declaration. MS-Windows declares it on stdlib.h which is
5340 included by conf_post.h.
b69a6d22
PE
5341 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5342 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5343 * vm-limit.c: Include <unistd.h>, for 'environ'.
5344
22d7feb2
PE
5345 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5346 (start_of_data): Remove decl; mem-limits.h provides it.
5347
32bd4250
PE
5348 * xdisp.c (handle_invisible_prop): Make it a bit faster
5349 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5350
450809af
CY
53512012-08-19 Chong Yidong <cyd@gnu.org>
5352
5353 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5354 ends (Bug#3874).
5355
9e677988
AS
53562012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5357
6b1319ce
AS
5358 * .gdbinit: Use call instead of set when calling a function in the
5359 inferior.
5360
9e677988
AS
5361 * data.c (set_internal): Don't use set_blv_found.
5362 (Fkill_local_variable): Likewise.
5363
d7191076
AA
53642012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5365
5366 * nsfont.m (ns_ascii_average_width): Ensure the string
5367 ascii_printable is initialized with a null-terminated character
5368 array. Otherwise, it can contain undesired extra characters.
5369
e757f1c6
PE
53702012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5371
5372 port new setting code to Sun C 5.8 2005/10/13
5373 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5374 Return void, not Lisp_Object. Otherwise, the compiler
5375 complains about (A?B:C) where B is void and C is Lisp_Object
5376 when compiling CHAR_TABLE_SET, due to the recent change to
5377 the API of sub_char_table_set_contents.
5378
a999ce26
CY
53792012-08-18 Chong Yidong <cyd@gnu.org>
5380
5381 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5382 for the string case (Bug#3874).
5383
3f22b86f
PE
53842012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5385
39eb03f1
PE
5386 * buffer.h (BSET): Remove (Bug#12215).
5387 Replace all uses with calls to new setter functions.
5388 (bset_bidi_paragraph_direction, bset_case_canon_table)
5389 (bset_case_eqv_table, bset_directory, bset_display_count)
5390 (bset_display_time, bset_downcase_table)
5391 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5392 (bset_last_selected_window, bset_local_var_alist)
5393 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5394 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5395 (bset_width_table):
5396 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5397 (bset_auto_fill_function, bset_auto_save_file_format)
5398 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5399 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5400 (bset_cache_long_line_scans, bset_case_fold_search)
5401 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5402 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5403 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5404 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5405 (bset_header_line_format, bset_indicate_buffer_boundaries)
5406 (bset_indicate_empty_lines, bset_invisibility_spec)
5407 (bset_left_fringe_width, bset_major_mode, bset_mark)
5408 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5409 (bset_name, bset_overwrite_mode, bset_pt_marker)
5410 (bset_right_fringe_width, bset_save_length)
5411 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5412 (bset_scroll_up_aggressively, bset_selective_display)
5413 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5414 (bset_word_wrap, bset_zv_marker):
5415 * category.c (bset_category_table):
5416 * syntax.c (bset_syntax_table):
5417 New setter functions.
5418
6a09a33b
PE
5419 * process.h (PSET): Remove (Bug#12215).
5420 Replace all uses with calls to new setter functions.
5421 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5422 (PROCESS_INLINE): New macro.
5423 (pset_childp): New setter function.
5424 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5425 * process.c (PROCESS_INLINE):
5426 Define to EXTERN_INLINE, so that the corresponding functions
5427 are compiled into code.
5428 (pset_buffer, pset_command, pset_decode_coding_system)
5429 (pset_decoding_buf, pset_encode_coding_system)
5430 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5431 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5432 (pset_type, pset_write_queue): New setter functions.
5433
e8c17b81
PE
5434 * window.h (WSET): Remove (Bug#12215).
5435 Replace all uses with calls to new setter functions.
5436 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5437 (WINDOW_INLINE): New macro.
5438 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5439 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5440 (wset_total_lines, wset_vertical_scroll_bar)
5441 (wset_window_end_pos, wset_window_end_valid)
5442 (wset_window_end_vpos): New setter functions.
5443 * window.c (WINDOW_INLINE):
5444 Define to EXTERN_INLINE, so that the corresponding functions
5445 are compiled into code.
5446 (wset_combination_limit, wset_dedicated, wset_display_table)
5447 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5448 (wset_new_normal, wset_new_total, wset_next_buffers)
5449 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5450 (wset_prev_buffers, wset_right_fringe_width)
5451 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5452 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5453 (wset_window_parameters):
5454 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5455 (wset_column_number_displayed, wset_region_showing):
5456 New setter functions.
5457
3f22b86f
PE
5458 * termhooks.h (TSET): Remove (Bug#12215).
5459 Replace all uses with calls to new setter functions.
5460 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5461 (TERMHOOKS_INLINE): New macro.
5462 (tset_charset_list, tset_selection_alist): New setter functions.
5463 * terminal.c (TERMHOOKS_INLINE):
5464 Define to EXTERN_INLINE, so that the corresponding functions
5465 are compiled into code.
5466 (tset_param_alist): New setter function.
5467
742af32f
PE
54682012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5469
15dbb4d6
PE
5470 * keyboard.h (KSET): Remove (Bug#12215).
5471 Replace all uses with calls to new setter functions.
5472 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5473 (KEYBOARD_INLINE): New macro.
5474 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5475 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5476 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5477 New setter functions.
5478 * keyboard.c (KEYBOARD_INLINE):
5479 Define to EXTERN_INLINE, so that the corresponding functions
5480 are compiled into code.
5481 (kset_echo_string, kset_kbd_queue)
5482 (kset_keyboard_translate_table, kset_last_prefix_arg)
5483 (kset_last_repeatable_command, kset_local_function_key_map)
5484 (kset_overriding_terminal_local_map, kset_real_last_command)
5485 (kset_system_key_syms): New setter functions.
5486
f00af5b1
PE
5487 * frame.h (FSET): Remove (Bug#12215).
5488 Replace all uses with calls to new setter functions.
5489 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5490 (FRAME_INLINE): New macro.
5491 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5492 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5493 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5494 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5495 (fset_param_alist, fset_root_window, fset_scroll_bars)
5496 (fset_selected_window, fset_title, fset_tool_bar_items)
5497 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5498 * frame.c (FRAME_INLINE):
5499 Define to EXTERN_INLINE, so that the corresponding functions
5500 are compiled into code.
5501 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5502
0c94c8d6
PE
5503 A few more naming-convention fixes for getters and setters.
5504 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5505 and rename from buffer_overlays_set_before.
5506 (set_buffer_overlays_after): Move here from buffer.h, and rename
5507 from buffer_overlays_set_after.
5508 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5509 All uses changed.
5510 (set_buffer_intervals): Rename from buffer_set_intervals.
5511 * intervals.c (set_interval_object): Move here from intervals.h,
5512 and rename from interval_set_object.
5513 (set_interval_left): Move here from intervals.h, and rename from
5514 interval_set_left.
5515 (set_interval_right): Move here from intervals.h, and rename from
5516 interval_set_right.
5517 (copy_interval_parent): Move here from intervals.h, and rename from
5518 interval_copy_parent.
5519 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5520 (set_interval_plist): Rename from interval_set_plist.
5521 Return void, not Lisp_Object, since no caller uses the result.
5522 * lisp.h (string_intervals): Rename from string_get_intervals.
5523 (set_string_intervals): Rename from string_set_intervals.
5524
34dabdb7
PE
5525 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5526 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 5527 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
5528 All uses changed. See the end of
5529 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5530
742af32f
PE
5531 * lisp.h (CSET): Remove (Bug#12215).
5532 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5533 (set_char_table_purpose): New functions,
5534 replacing CSET. All uses changed. For example, replace
5535 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 5536 "set_char_table_parent (char_table, parent);".
742af32f
PE
5537 The old version was confusing because it used the same name
5538 'parent' for two different things.
5539
a04e2c62
DA
55402012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5541
5542 Functions to get and set Lisp_Object fields of buffer-local variables.
5543 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5544 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5545 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5546 * data.c, eval.c, frame.c: Adjust users.
5547
383dcbf9
CY
55482012-08-17 Chong Yidong <cyd@gnu.org>
5549
5550 * xfaces.c (merge_face_vectors): If the target font specfies a
5551 font spec, make the font's attributes take precedence over
5552 directly-specified attributes.
5553 (merge_face_ref): Recognize :font.
5554
44386687
DA
55552012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5556
5557 Do not use memcpy for copying intervals.
5558 * intervals.c (reproduce_interval): New function.
5559 (reproduce_tree, reproduce_tree_obj): Use it.
5560 (reproduce_tree_obj): Remove prototype.
5561
927c7216
PE
55622012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5563
5564 * lisp.h (duration_to_sec_usec): Remove unused decl.
5565
93044f7b
AA
55662012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5567
5568 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5569 to an allocated instance of NSString, not to the class itself.
5570
9851e4a5
JB
55712012-08-17 Juanma Barranquero <lekktu@gmail.com>
5572
5573 * makefile.w32-in (C_CTYPE_H): New macro.
5574 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5575 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5576 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5577
620f13b0
PE
55782012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5579
5580 Use ASCII tests for character types.
5581 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5582 * xfns.c, xterm.c:
5583 Don't include <ctype.h>; was not needed.
5584 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5585 * sysdep.c, xfaces.c:
5586 Include <c-ctype.h> instead of <ctype.h>.
5587 * nsterm.m: Include <c-ctype.h>.
5588 * charset.c (read_hex):
5589 * doc.c (Fsnarf_documentation):
5590 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5591 (DRIVE_LETTER) [DOS_NT]:
5592 (Ffile_name_directory, Fexpand_file_name)
5593 (Fsubstitute_in_file_name):
5594 * font.c (font_parse_xlfd, font_parse_fcname):
5595 * frame.c (x_set_font_backend):
5596 * gtkutil.c (xg_get_font):
5597 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5598 * nsimage.m (hexchar):
5599 * nsterm.m (ns_xlfd_to_fontname):
5600 * sysdep.c (system_process_attributes):
5601 * xfaces.c (hash_string_case_insensitive):
5602 Use C-locale tests instead of locale-specific tests for character
5603 types, since we want the ASCII interpretation here, not the
5604 interpretation suitable for whatever happens to be the current locale.
5605
52162052
MR
56062012-08-16 Martin Rudalics <rudalics@gmx.at>
5607
5608 Consistently check windows for validity/liveness
5609 (Bug#11984, Bug#12025, Bug#12026).
5610 * lisp.h (CHECK_VALID_WINDOW): New macro.
5611 * window.c (decode_window): Rename to decode_live_window.
5612 (decode_valid_window, Fwindow_valid_p): New functions.
5613 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5614 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5615 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5616 (Fwindow_prev_sibling, Fwindow_combination_limit)
5617 (Fset_window_combination_limit, Fwindow_use_time)
5618 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5619 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5620 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5621 (Fwindow_hscroll, Fset_window_hscroll)
5622 (Fwindow_redisplay_end_trigger)
5623 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5624 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5625 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5626 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5627 (Fwindow_end, Fset_window_point, Fset_window_start)
5628 (Fpos_visible_in_window_p, Fwindow_line_height)
5629 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5630 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5631 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5632 (Fset_window_parameter, Fwindow_display_table)
5633 (Fset_window_display_table, Fdelete_other_windows_internal)
5634 (Fset_window_buffer, Fset_window_new_total)
5635 (Fset_window_new_normal, Fdelete_window_internal)
5636 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5637 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5638 (Fwindow_scroll_bars): Check whether argument window is a valid or
5639 live window. Update doc-strings.
5640 (syms_of_window): New symbol Qwindow_valid_p.
5641 * keyboard.c (Fposn_at_x_y): Check whether argument
5642 frame_or_window denotes a valid window.
5643
2751c80f
DA
56442012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5645
5646 Fix previous char table change.
5647 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5648 * chartab.c (optimize_sub_char_table): Likewise.
5649
032a42c8
CY
56502012-08-16 Chong Yidong <cyd@gnu.org>
5651
a2d19368
CY
5652 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5653
032a42c8
CY
5654 * xfont.c (xfont_open):
5655 * xftfont.c (xftfont_open): Set the font's max_width field.
5656
5657 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5658 min_width to space_width and average_width to the average over
5659 printable ASCII characters.
5660 (ns_char_width): Code cleanup.
5661 (ns_ascii_average_width): New utility function.
5662
5663 * font.h (struct font): Update comments.
5664
a098c930
DA
56652012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5666
032a42c8 5667 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
5668 * lisp.h (CSET): New macro.
5669 (char_table_set_extras, char_table_set_contents)
5670 (sub_char_table_set_contents): New function.
5671 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5672 * syntax.c: Adjust users.
5673
8be3a09c
SM
56742012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5675
5676 * eval.c (eval_sub): Bind lexical-binding.
5677 * lread.c (Qlexical_binding): Make non-static.
5678
ac4845a6
JD
56792012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5680
ddee6515
JD
5681 * nsmenu.m (popupSession): Remove.
5682 (pop_down_menu): Remove endModalSession.
5683 (timeout_handler:): New method.
5684 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5685 Call runModalForWindow. Check timer_fired when it returns.
5686 If not set, cancel timer and break out of loop.
5687 Otherwise loop again, with a new timeout.
5688
5689 * nsterm.m: Include fcntl.h if present.
5690 (fd_entry, t_readfds, inNsSelect): Remove.
5691 (select_writefds, select_valid, select_timeout, selfds)
5692 (select_mutex, apploopnr): Add.
5693 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5694 Otherwise call kbd_buffer_store_event.
5695 (ns_send_appdefined): Remove release of fd_entry.
5696 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5697 Increment and decrement apploopnr.
5698 (ns_select): If no file descriptors, just do a NSTimer.
5699 Otherwise copy read/write masks and start select thread (fd_handler).
5700 Start main loop and wait for application defined event.
5701 Inform select thread to stop selecting after main loop is exited.
5702 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 5703 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
5704 (fd_handler:): Loop forever, wait for info from the main thread
5705 to either start or stop selecting. When select returns, send
5706 and appdefined event.
5707 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5708 If not call kbd_buffer_store_event.
5709
5710 * nsterm.h (EmacsApp): fd_handler takes id argument.
5711 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5712
ac4845a6
JD
5713 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5714
eb424fe3
EZ
57152012-08-15 Eli Zaretskii <eliz@gnu.org>
5716
5717 * region-cache.c (move_cache_gap): Update gap_len using the actual
5718 growth of the boundaries array. Do not change cache_len.
5719 (Bug#12196)
5720
4e6a86c6
DA
57212012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5722
5723 Generalize and cleanup font subsystem checks.
5724 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
5725 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5726 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 5727
5bf192ca
DA
57282012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5729
5730 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5731
f2045622
CY
57322012-08-15 Chong Yidong <cyd@gnu.org>
5733
8be3a09c
SM
5734 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5735 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5736 extract the font descriptor instead of just the font name.
5737 In that case, return a font spec instead of a string.
f2045622
CY
5738 (x_last_font_name): Move to this file from xfns.c.
5739
5740 * xfns.c (Fx_select_font): The return value can also be a font
5741 spec. Move x_last_font_name management to gtkutil.c.
5742
5743 * xfaces.c: Make font weight and style symbols non-static.
5744
7f6feb56
SM
57452012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5746
5747 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5748 (bug#12117).
5749
fecbd8ff
SM
57502012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5751
5752 * alloc.c (Fgarbage_collect): Use plural form consistently.
5753
9b8d5165
EZ
57542012-08-14 Eli Zaretskii <eliz@gnu.org>
5755
5756 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5757 iteration through the command loop. Fixes a problem whereby mouse
5758 movements are ignored until the first mouse click.
5759
f5d9e83a
PE
57602012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5761
5762 Use bool, not int, for Lisp booleans.
5763 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5764 makes Emacs a bit smaller and presumably a bit faster.
5765 * lisp.h: Include <stdbool.h>.
5766 (struct Lisp_Boolfwd, defvar_bool):
5767 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5768 * regex.c [!emacs]: Include <stdbool.h>.
5769 (false, true): Remove; <stdbool.h> does this for us now.
5770
55802e4a
CY
57712012-08-14 Chong Yidong <cyd@gnu.org>
5772
4abcdac8
CY
5773 * character.c (Fcharacterp): Doc fix (Bug#12076).
5774
5775 * data.c (Findirect_variable): Doc fix (Bug#11040).
5776
55802e4a
CY
5777 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5778
5779 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 5780 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 5781
8e99d072
BR
57822012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5783
5784 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5785 (bug#12022).
5786
08908aca
MR
57872012-08-14 Martin Rudalics <rudalics@gmx.at>
5788
5789 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5790 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5791 * minibuf.c (choose_minibuf_frame, read_minibuf):
5792 * w32fns.c (x_create_tip_frame):
5793 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5794 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5795
56120d6f
PE
57962012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5797
5798 * intervals.c (offset_intervals): Remove obsolete comment.
5799
67b77c0b
AS
58002012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5801
5802 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5803
f48b82fd
GR
58042012-08-14 Gergely Risko <gergely@risko.hu>
5805
5806 * coding.c (decode_coding): Record buffer modification before
5807 disabling undo_list (Bug#11773).
5808
fd318b54
DA
58092012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5810
5811 Revert and cleanup some recent overlay changes.
5812 * buffer.h (enum overlay_type): Remove.
5813 (buffer_get_overlays, buffer_set_overlays): Likewise.
5814 (buffer_set_overlays_before, buffer_set_overlays_after):
5815 New function. Adjust users.
5816 (unchain_both): Add eassert.
5817
41a62dd9
DA
58182012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5819
5820 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5821
5884c324
PE
58222012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5823
5824 * gtkutil.c (xg_mark_data): Don't assume C99.
5825
ca06f160
JD
58262012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5827
5828 * gtkutil.c (xg_frame_tb_info): New struct.
5829 (TB_INFO_KEY): New define.
5830 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5831 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5832 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5833 if not present.
5834 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 5835 is up to date. Otherwise store new data.
ca06f160
JD
5836 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5837
7864a3f7
DA
58382012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5839
5840 Use KSET for write access to Lisp_Object members of struct kboard.
5841 * keyboard.h (KSET): New macro.
5842 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5843 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5844 * xterm.c: Adjust users.
5845
4c31be61
DA
58462012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5847
5848 Use BSET for write access to Lisp_Object members of struct buffer.
5849 * buffer.h (BSET): New macro.
5850 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5851 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5852 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5853 * window.c, xdisp.c, xfns.c: Adjust users.
5854
14ae4239
BT
58552012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5856
5857 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5858
32bcadb4
JD
58592012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5860
3d29b2ce 5861 * nsterm.m (not_in_argv): New function.
fc0c31f8 5862 (application:openFile, application:openTempFile:):
3d29b2ce
JD
5863 (application:openFileWithoutUI:, application:openFiles:): Open file
5864 if not_in_argv returns non-zero (bug#12171).
5865
32bcadb4 5866 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
5867 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5868 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
5869 (xg_get_font_name): Use those functions/macros here.
5870 Reported by Frans Oilinki <moilinki@gmail.com>.
5871
9ff9402d 58722012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
5873
5874 * unexmacosx.c (copy_data_segment): Copy initialized data in
5875 statically linked libraries from input file rather than memory.
5876
db74a5fc
YM
5877 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5878 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5879 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5880
25e65510
GM
58812012-08-10 Glenn Morris <rgm@gnu.org>
5882
5883 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5884 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5885
7961135c
DA
58862012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5887
5888 Fix last change to allow compilation with low optimization levels.
5889 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5890 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5891
42b3a444
DA
58922012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5893
5894 Use common inline syntax in intervals.h.
5895 * intervals.h (INTERVALS_INLINE): New macro.
5896 Change all users from LISP_INLINE.
5897
9fb0c957
DA
58982012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5899
5900 Define Qnone once for all platforms.
5901 * frame.c (Qnone): Define here.
5902 (syms_of_frame): DEFSYM it.
5903 * lisp.h (Qnone): New declaration.
5904 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5905 * xfns.c: Remove duplication. Adjust users.
5906
65e8ee52
DA
59072012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5908
5909 Remove unused macros from intervals.h.
5910 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5911 * intervals.c: Adjust comment.
5912
9b855fd6
EZ
59132012-08-10 Eli Zaretskii <eliz@gnu.org>
5914
5915 * w32fns.c <w32_unicode_gui>: New static variable.
5916 (globals_of_w32fns): Initialize it according to os_subtype.
5917 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5918 testing os_subtype.
5919
39cb9e56 59202012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
5921 Eli Zaretskii <eliz@gnu.org>
5922
5923 Fix bug #10299 with Unicode characters sent by customized
5924 keyboards created by MSKLC.
5925 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5926 (w32_init_class): Use it to initialize the Emacs class with either
5927 ANSI or Unicode API calls.
5928 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5929 later.
5930 (w32_wnd_proc): If the character code sent by WM_CHAR or
5931 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5932 original message. Call DefWindowProcW on NT and later.
5933
9374581a
GM
59342012-08-10 Glenn Morris <rgm@gnu.org>
5935
4b94e8cf
GM
5936 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5937
9374581a
GM
5938 * lisp.h (DIRECTORY_SEP): Let configure set it.
5939
a2752828
DA
59402012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5941
5942 Use TSET for write access to Lisp_Object slots of struct terminal.
5943 * termhooks.h (TSET): New macro.
5944 * coding.c, terminal.c, xselect.c: Adjust users.
5945
cc92c454
SM
59462012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5947
5948 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5949 the failing expression, include them in the error message.
5950 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5951 * lisp.h (internal_condition_case_n): Update declaration.
5952
4cb3e6b3
DA
59532012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5954
5955 Inline functions to examine and change buffer overlays.
5956 * buffer.c (unchain_both): New function.
5957 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5958 (buffer_has_overlays): New function.
5959 (enum overlay_type): New enum.
5960 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5961 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5962
8707c1e5
DA
59632012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5964
5965 Inline functions to examine and change buffer intervals.
5966 * alloc.c (mark_interval_tree): Remove.
5967 (MARK_INTERVAL_TREE): Simplify.
5968 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5969 * intervals.c (buffer_balance_intervals): New function.
5970 (graft_intervals_into_buffer): Adjust indentation.
5971 (set_intervals_multibyte): Simplify.
5972 * buffer.h (BUF_INTERVALS): Remove.
5973 (buffer_get_intervals, buffer_set_intervals): New function.
5974 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5975 * intervals.c, textprop.c: Adjust users.
5976
ad8c997f
DA
59772012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5978
5979 Inline functions to examine and change string intervals.
5980 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5981 (string_get_intervals, string_set_intervals): New function.
5982 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5983 * lread.c, print.c, textprop.c: Adjust users.
5984
32ac3a6b
GM
59852012-08-08 Glenn Morris <rgm@gnu.org>
5986
5987 * lisp.mk (lisp): Remove language/persian.elc.
5988
77c7bcb1
DA
59892012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5990
5991 Cleanup intervals.
5992 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5993 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
5994 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5995 Adjust comment. Move under #if 0.
77c7bcb1
DA
5996 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5997 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5998
9c08a8d4
DA
59992012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
6000
6001 Check total length of intervals with eassert.
6002 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
6003 * intervals.c: Change all users to eassert.
6004
26d16b35
EZ
60052012-08-07 Eli Zaretskii <eliz@gnu.org>
6006
14ae4239
BT
6007 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
6008 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
6009 INTERNAL_FIELD in Lisp_Cons.
6010
c644523b
DA
60112012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6012
6013 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
6014 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
6015 name since all xname users are fixed long time ago. Do not
6016 use INTERNAL_FIELD.
6017 (set_symbol_name, set_symbol_function, set_symbol_plist):
6018 (set_symbol_next, set_overlay_plist): New function.
6019 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
6020 (struct Lisp_Overlay): Likewise.
6021 (CVAR, MVAR, SVAR): Remove.
6022 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
6023 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
6024 * xterm.c: Adjust users.
6025 * .gdbinit: Change to use name field of struct Lisp_Symbol
6026 where appropriate.
6027
6a3d20cc
DA
60282012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6029
6030 Basic functions to set Lisp_Object and pointer slots of intervals.
6031 * intervals.h (interval_set_parent, interval_set_object):
6032 (interval_set_left, interval_set_right, interval_set_plist):
6033 (interval_copy_parent): New function.
6034 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
6035 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
6036 Adjust indentation.
6a3d20cc
DA
6037 (INTERVAL_SIZE): Remove. Adjust users.
6038 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
6039
4d2b044c
DA
60402012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6041
6042 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
6043 * process.h (PGET): Remove.
6044 (struct Lisp_Process): Do not use INTERNAL_FIELD.
6045 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6046
d3d50620
DA
60472012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6048
6049 Drop WGET and revert read access to Lisp_Objects slots of struct window.
6050 * window.h (WGET): Remove.
6051 (struct window): Do not use INTERNAL_FIELD.
6052 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6053 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6054 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6055 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6056 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6057 Adjust users.
6058
d10a51dc
CY
60592012-08-07 Chong Yidong <cyd@gnu.org>
6060
6061 * window.c (Fwindow_edges, Fwindow_pixel_edges)
6062 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
6063 (Fdelete_window_internal): Signal an error if the window is not on
6064 a live frame (Bug#12025).
6065
e69b0960
DA
60662012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
6067
6068 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
6069 * frame.h (FGET): Remove.
6070 (struct frame): Do not use INTERNAL_FIELD.
6071 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6072 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6073 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6074 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6075
25a20a3a
JB
60762012-08-06 Juanma Barranquero <lekktu@gmail.com>
6077
6078 * w32.c: Silence compiler warnings.
6079 (map_w32_filename): Remove unused variable `is_fat'.
6080 (chase_symlinks): Add parentheses around expression.
6081
1c6f11f4
GM
60822012-08-06 Glenn Morris <rgm@gnu.org>
6083
1db4583a
GM
6084 * sysdep.c: Respect BROKEN_GETWD.
6085
1c6f11f4
GM
6086 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
6087 Let configure handle it.
6088 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
6089
2b90362b
DA
60902012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6091
6092 Use GCALIGNMENT where appropriate.
6093 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
6094 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
6095 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
6096
5f50daf2
EZ
60972012-08-06 Eli Zaretskii <eliz@gnu.org>
6098
14ae4239
BT
6099 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
6100 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 6101
cbcc7007
SM
61022012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
6103
6104 * buffer.h (struct buffer): Revert `indirections' to a simple int;
6105 that should be sufficient for everyone.
6106
4d365fa4
JD
61072012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6108
6109 * keyboard.c (timer_check_2): Add break so timer_check returns next
6110 timeout.
6111
dd86bd82
DA
61122012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6113
6114 Fix Windows build errors introduced after converting to WGET and WSET.
6115 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
6116 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6117
054e1668
JD
61182012-08-06 Jan Djärv <jan.h.d@swipnet.se>
6119
6120 * nsterm.m (ns_frame_rehighlight): Use FSET.
6121
6122 * nsmenu.m (ns_update_menubar): Use FSET.
6123
21238f11
DA
61242012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6125
6126 Separate read and write access to Lisp_Object slots of Lisp_Process.
6127 * process.h (PGET, PSET): New macros similar to AREF and ASET.
6128 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
6129
077288cf
DA
61302012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6131
6132 Separate read and write access to Lisp_Object slots of struct window.
6133 * window.h (WGET, WSET): New macros similar to AREF and ASET.
6134 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6135 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6136 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
6137 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
6138 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
6139 Adjust users.
6140
71688bd7
DA
61412012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6142
6143 Fix Windows build errors introduced after converting to FGET and FSET.
6144 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
6145 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
6146 (w32_judge_scroll_bars): Change to use FSET.
6147 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
6148
f99bac93
DA
61492012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6150
6151 Fix replacement typo.
6152 * window.c (replace_window): Set root_window instead of
6153 selected_window. This fixes a total window subsystem
6154 malfunction reported by Bastien Guerry <bzg@gnu.org>.
6155
8c2a0f2d
GM
61562012-08-06 Glenn Morris <rgm@gnu.org>
6157
6158 * lisp.mk (lisp): Add language/persian.elc.
6159
edd74c35
DA
61602012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
6161
6162 Separate read and write access to Lisp_Object slots of struct frame.
6163 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
6164 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
6165 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
6166 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
6167 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
6168
8671676c
AS
61692012-08-05 Andreas Schwab <schwab@linux-m68k.org>
6170
6171 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
6172
663e2b3f
DA
61732012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
6174
6175 Generalize common compile-time constants.
6176 * lisp.h (header_size, bool_header_size, word_size): Now here.
6177 (struct Lisp_Vector): Add comment.
6178 (struct Lisp_Bool_Vector): Move up to define handy constants.
6179 (VECSIZE, PSEUDOVECSIZE): Simplify.
6180 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
6181 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
6182 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
6183 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
6184 * xfont.c, xmenu.c: Use word_size where appropriate.
6185
d32e47af
LM
61862012-08-05 Lawrence Mitchell <wence@gmx.li>
6187
6188 * search.c (Freplace_match): Treat \? in the replacement text
6189 literally (Bug#8161).
6190
e5d9c0d1
CY
61912012-08-05 Chong Yidong <cyd@gnu.org>
6192
6193 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
6194 * frame.c (Vdelete_frame_functions):
6195 * emacs.c (Vkill_emacs_hook): Doc fix.
6196
8da0576b
EZ
61972012-08-04 Eli Zaretskii <eliz@gnu.org>
6198
6199 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
6200 --with-x-toolkit=no builds.
6201 Reported by Carsten Mattner <carstenmattner@gmail.com>.
6202
02676e5d
CY
62032012-08-04 Chong Yidong <cyd@gnu.org>
6204
6205 * syntax.c (Fmodify_syntax_entry): Doc fix.
6206
97147da9
EZ
62072012-08-04 Eli Zaretskii <eliz@gnu.org>
6208
76151e2c
EZ
6209 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
6210 * w32.c (init_environment): Change the default values of many
6211 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
6212 them into environment when they were not already defined.
6213 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 6214 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
6215 (check_windows_init_file): Now external, not static.
6216 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
6217 called when Vload_path is already set up.
6218
6219 * w32.h (check_windows_init_file): Add prototype.
6220
6221 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
6222 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
6223 compatibility with Posix platforms.
6224 (main): Move the call to check_windows_init_file to here from
6225 w32.c.
6226 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
6227 any, in the DEFALT argument into the root of the Emacs build or
6228 installation tree, as appropriate.
6229
6230 * callproc.c (init_callproc_1): Call decode_env_path instead of
6231 doing its equivalent by hand.
6232 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
6233 the code that sets Vexec_path run on MS-Windows.
6234
6235 * lread.c (init_lread): Add comments to #ifdef's.
6236
97147da9
EZ
6237 * msdos.c (dos_set_window_size, IT_update_begin)
6238 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
6239 instead of direct references.
6240
185ee146
PE
62412012-08-04 Paul Eggert <eggert@cs.ucla.edu>
6242
6243 Export DEFAULT_REHASH_* to GDB.
6244 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
6245 Now constants, not macros.
6246
8834c57a
PE
62472012-08-03 Paul Eggert <eggert@cs.ucla.edu>
6248
98c6f1e3
PE
6249 Remove unnecessary casts involving pointers.
6250 These casts are no longer needed now that we assume C89 or later,
6251 since they involve casting to or from void *.
6252 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
6253 (make_pure_float, make_pure_vector):
6254 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
6255 * macros.c (Fstart_kbd_macro):
6256 * menu.c (find_and_return_menu_selection):
6257 * minibuf.c (read_minibuf_noninteractive):
6258 * sysdep.c (closedir):
6259 * xdisp.c (x_produce_glyphs):
6260 * xfaces.c (compare_fonts_by_sort_order):
6261 * xfns.c (x_real_positions, select_visual):
6262 * xselect.c (x_stop_queuing_selection_requests)
6263 (x_get_window_property, x_get_window_property_as_lisp_data):
6264 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
6265 Remove unnecessary pointer casts.
6266 * alloc.c (record_xmalloc): New function.
6267 * lisp.h (record_xmalloc): New decl.
6268 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
6269 more like a function. This is because the pointer cast is not
6270 needed. All uses changed.
6271 * print.c (print_string, print_error_message): Avoid length recalc.
6272
8834c57a
PE
6273 Improve fix for macroexp crash with debugging (Bug#12118).
6274 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6275 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6276 not supposed to be invoked from the garbage collector.
6277 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6278 (gc_aset): New function, which is like ASET but can be
6279 used in the garbage collector.
6280 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6281 (set_hash_index): Use it instead of ASET.
6282
6dad7178
EZ
62832012-08-03 Eli Zaretskii <eliz@gnu.org>
6284
6285 Support symlinks on latest versions of MS-Windows.
6286 * w32.c: Include winioctl.h and aclapi.h.
6287 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6288 (revert_to_self): Forward declarations of static functions.
6289 <static BOOL g_b_init_get_security_info>:
6290 <g_b_init_create_symbolic_link>: New static flags.
6291 (globals_of_w32): Initialize them to zero.
6292 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6293 (map_w32_filename): Improve commentary. Simplify switch.
6294 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6295 headers (most versions of MinGW w32api don't).
6296 (get_security_info, create_symbolic_link)
6297 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6298 New functions.
6299 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6300 in the argument file name.
6301 (sys_access): Call unc_volume_file_attributes only if
6302 GetFileAttributes fails with network-related error codes.
6303 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6304 have the required privileges.
14ae4239 6305 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
6306 get_file_security_desc.
6307 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
6308 with addition of handling of symlinks and support for 'lstat'.
6309 If possible, get file's attributes and security information by
6dad7178
EZ
6310 handle, not by name. Produce S_IFLNK bit for symlinks, when
6311 called from 'lstat'.
6312 (stat, lstat): New functions, call 'stat_worker'.
6313 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6314 symlinks when the underlying filesystem supports them.
6315
f162bcc3
PE
63162012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6317
79ea6c20
PE
6318 Fix macroexp crash on Windows with debugging (Bug#12118).
6319 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6320 checking subscripts; problem introduced with the recent
6321 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6322 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6323 since it's used in non-static inline functions now.
6324
c0ce93fd
PE
6325 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6326 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 6327
f162bcc3
PE
6328 Use C99-style 'extern inline' if available.
6329 * buffer.h (BUFFER_INLINE):
6330 * category.h (CATEGORY_INLINE):
6331 * character.h (CHARACTER_INLINE):
6332 * charset.h (CHARSET_INLINE):
6333 * composite.h (COMPOSITE_INLINE):
6334 * dispextern.h (DISPEXTERN_INLINE):
6335 * lisp.h (LISP_INLINE):
6336 * systime.h (SYSTIME_INLINE):
6337 New macro, replacing 'static inline' in this header.
6338 * buffer.h, category.h, character.h, charset.h, composite.h:
6339 * dispextern.h, lisp.h, systime.h:
6340 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6341 * alloc.c (LISP_INLINE):
6342 * buffer.c (BUFFER_INLINE):
6343 * category.c (CATEGORY_INLINE):
6344 * character.c (CHARACTER_INLINE):
6345 * charset.c (CHARSET_INLINE):
6346 * composite.c (COMPOSITE_INLINE):
6347 * dispnew.c (DISPEXTERN_INLINE):
6348 * sysdep.c (SYSTIME_INLINE):
6349 Define to EXTERN_INLINE, so that the corresponding functions
6350 are compiled into code.
6351 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6352 (INLINE_HEADER_END): New macros.
6353 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6354 since it's used in non-static inline functions now.
a8333d03 6355 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 6356
837b365b
GM
63572012-08-02 Glenn Morris <rgm@gnu.org>
6358
d66b744d
GM
6359 * s/: Remove empty directory.
6360
837b365b
GM
6361 * s/ms-w32.h: Move to ../nt/inc.
6362 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6363 Update for new ms-w32.h location.
6364
13294f95
PE
63652012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6366
6367 Port to Solaris 8.
6368 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6369
90df0db3
GM
63702012-08-02 Glenn Morris <rgm@gnu.org>
6371
6372 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6373 hard-coding the path separator.
6374
4939150c
PE
63752012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6376
6377 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6378 This how ASET and AREF are supposed to work, and makes
6379 it easier to think about future improvements. See
6380 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6381 * charset.h (set_charset_attr): New function.
6382 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6383 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6384 (aref_addr): New function. All uses of &AREF(...) changed.
6385 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6386 (set_hash_index): New functions. All lvalue-style uses of
6387 HASH_KEY etc. changed.
6388 * keyboard.c (set_prop): New function. All lvalue-style uses
6389 of PROP changed.
6390
947b2afd
AA
63912012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6392
6393 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6394 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 6395 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
6396 * nsfns.m (ns_set_name_as_filename): Likewise.
6397 * nsmenu.m (ns_update_menubar): Likewise.
6398 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6399
4f5d0325
EZ
64002012-08-01 Eli Zaretskii <eliz@gnu.org>
6401
2008beae
EZ
6402 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6403 Adapt to latest changes in field names of the corresponding Lisp
288479f6 6404 objects.
2008beae 6405
4f5d0325
EZ
6406 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6407
fe3cc771
GM
64082012-08-01 Glenn Morris <rgm@gnu.org>
6409
6410 * s/msdos.h: Remove file.
6411 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6412 * Makefile.in (S_FILE): Remove.
6413 (config_h): Remove S_FILE.
6414
c90acc54
JB
64152012-08-01 Juanma Barranquero <lekktu@gmail.com>
6416
6417 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6418 Remove; moved to nt/config.nt.
6419
d8a05828
DA
64202012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6421
6422 Use INTERNAL_FIELD for conses and overlays.
6423 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6424 Remove obsolete comment.
6425 (MVAR): New macro.
6426 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6427 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6428
8271d590
DA
64292012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6430
6431 Use INTERNAL_FIELD for symbols.
6432 * lisp.h (SVAR): New macro. Adjust users.
6433 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6434 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6435
3193acd2
DA
64362012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6437
6438 Use INTERNAL_FIELD for processes.
6439 * process.h (PVAR): New macro. Adjust style.
6440 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6441 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6442
3a45383a
DA
64432012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6444
6445 Use INTERNAL_FIELD for windows.
6446 * window.h (WVAR): New macro.
6447 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6448 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6449 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6450 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6451 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6452 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6453
c1dbc63c
PE
64542012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6457
5c0c0e8a
GM
64582012-08-01 Glenn Morris <rgm@gnu.org>
6459
6460 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6461 Move to configure.ac.
6462
552a99b4
JB
64632012-08-01 Juanma Barranquero <lekktu@gmail.com>
6464
6465 * makefile.w32-in (CONFIG_H): Update dependencies.
6466 (CONF_POST_H): New macro.
6467
6468 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6469
8d8e2dfe
GM
64702012-07-31 Glenn Morris <rgm@gnu.org>
6471
bc96620a
GM
6472 * Makefile.in (S_FILE): No longer set by configure.
6473
476b1b2d
GM
6474 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6475 is available.
6476 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6477
b2c7a106
GM
6478 * process.h (NULL_DEVICE):
6479 * emacs.c (SEPCHAR):
6480 * editfns.c (USER_FULL_NAME): Let configure set them.
6481
d53d062a
GM
6482 * s/README, s/template.h: Remove files.
6483
4515017f
GM
6484 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6485
8d8e2dfe
GM
6486 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6487 Move to configure.ac.
6488
5b20b3cc
EZ
64892012-07-31 Eli Zaretskii <eliz@gnu.org>
6490
1e0afd9a
EZ
6491 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6492 resulting renaming of 'struct frame' members.
6493
5b20b3cc
EZ
6494 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6495
6496 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6497 after introduction of FVAR.
6498
f1310128
JD
64992012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6500
79e721e0
JD
6501 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6502
6503 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6504 instead of compositeToPoint.
6505 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6506
8d7c7eed 6507 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 6508
e34f7f79
DA
65092012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6510
6511 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6512 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 6513 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
6514 (BVAR): Change to use INTERNAL_FIELD.
6515 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6516 (KVAR): Change to use INTERNAL_FIELD.
6517 * frame.h (FVAR): New macro.
6518 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
6519 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6520 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6521 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
6522 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6523
c09bfb2f
DA
65242012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6525
6526 Miscellaneous fixes for non-default X toolkits.
6527 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6528 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6529 Move under #ifdef USE_LUCID.
6530 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6531 definition and usage to avoid warnings.
6532
14c114ae
JD
65332012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6534
6535 * nsterm.m (openFiles): Fix previous checkin.
6536
3bd21e82
PE
65372012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6538
6539 * indent.c (compute_motion): Remove unused local.
6540
c1529ded
GM
65412012-07-31 Glenn Morris <rgm@gnu.org>
6542
400d5621
GM
6543 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6544
268e2432
GM
6545 * conf_post.h [USG5_4]:
6546 Move remaining contents of s/usg5-4-common.h here.
6547 * s/usg5-4-common.h: Remove file.
6548
7552f3ee
GM
6549 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6550 * s/irix6-5.h: Remove file.
6551
6a381852
GM
6552 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6553 * s/darwin.h: Remove file.
6554
c1529ded
GM
6555 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6556 * s/hpux10-20.h: Remove file, which is now empty.
6557
b429a4ee
GM
65582012-07-30 Glenn Morris <rgm@gnu.org>
6559
6560 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6561 * Makefile.in (config_h): Add conf_post.h.
6562 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6563
adff3182
JD
65642012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6565
6566 * nsterm.m (ns_do_open_file): New variable.
b9031d69 6567 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
6568 (openFile, openTempFile, openFileWithoutUI, openFiles):
6569 Open files only if ns_do_open_file.
adff3182 6570
c32af1e4
PE
65712012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6572
7393bcbb
PE
6573 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6574 This no-op macro hasn't been needed for many years.
6575 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6576
c32af1e4
PE
6577 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6578 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6579 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6580 gdb_make_enums_visible.
6581 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6582 (DIRECTORY_SEP): Now a constant, not a macro.
6583
302fc036
EZ
65842012-07-30 Eli Zaretskii <eliz@gnu.org>
6585
6586 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6587 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6588
6589 * w32term.c <w32_keyboard_codepage>: Renamed from
6590 keyboard_codepage and now external. All users changed.
6591
6592 * w32term.h: Add declaration of w32_keyboard_codepage.
6593
6594 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6595 the codepage to translate keys to Unicode. If this argument is
6596 -1, use the value returned by GetConsoleCP. All callers changed.
6597
88fb40b4
PE
65982012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6599
0aee6912
PE
6600 Update .PHONY listings in makefiles.
6601 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6602 bootstrap-clean, distclean, maintainer-clean, versioclean,
6603 extraclean, frc.
6604
88fb40b4
PE
6605 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6606 This is a bit clearer. Fix some commentary typos.
6607
0a763bd1
GM
66082012-07-30 Glenn Morris <rgm@gnu.org>
6609
32bac6d6
GM
6610 * s/netbsd.h: Let configure include signal.h if needed.
6611 Remove file, which is now empty.
6612
b65e7c46
GM
6613 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6614 Let configure set them.
6615 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6616 No more need to undefine.
0a763bd1 6617
169304bd
AS
66182012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6619
6620 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6621 non-single-byte char when adding meta modifier. (Bug#12090)
6622
6cd7a139
DA
66232012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6624
6625 Convert safe_call to use variable number of arguments.
6626 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6627 (safe_call2): Fix comment.
6628 * lisp.h (safe_call): Adjust prototype.
6629 * coding.c (encode_coding_object): Change to use safe_call2.
6630 * xfaces.c (merge_face_heights): Change to use safe_call1.
6631
d34d6ffc
GM
66322012-07-30 Glenn Morris <rgm@gnu.org>
6633
7b8a48e4 6634 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 6635 does that unconditionally. Remove file, which is now empty.
7b8a48e4 6636
d34d6ffc
GM
6637 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6638 Remove empty files.
6639
03a660a6
PE
66402012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6641
6642 Export to GDB most of lisp.h's remaining object-like macros.
6643 * lisp.h (min, max): Move earlier, because they're used earlier now.
6644 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6645 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6646 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6647 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6648 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6649 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6650 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6651 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6652 Now constants, for GDB. They need not be macros.
6653 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6654 Now constants, for GDB, as well as macros, for static initializers.
6655 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6656 Move to after the definition of struct Lisp_Char_Table,
6657 since the former now needs that type defined.
6658 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6659 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6660 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6661 New enums, for gdb_make_enums_visible.
6662 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 6663 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
6664 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6665 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6666 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6667 enum maxargs, enum MAX_ALLOCA.
6668 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6669 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6670 no longer needed, now that they are done in lisp.h.
6671
e499d0ee
DA
66722012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6673
6674 Cleanup string bytes checking.
6675 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6676 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6677 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6678 (check_sblock, compact_small_strings): Simplify.
6679
d5040d2d
PE
66802012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6681
6682 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6683 These macros are confusing and no longer need to be defined, as
6684 the enum values now suffice. All uses replaced with definiens.
6685 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6686
7f259ae6
JB
66872012-07-29 Juanma Barranquero <lekktu@gmail.com>
6688
6689 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6690 ($(BLD)/w32console.$(O)): Update dependencies.
6691
7e63e0c3
DA
66922012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6693
6694 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6695 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6696 time. Adjust users.
6697 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6698
ffd817eb
JD
66992012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6700
6701 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6702 setting sitelisp (Bug#12010).
6703
417a7a0e
EZ
67042012-07-29 Eli Zaretskii <eliz@gnu.org>
6705
14ae4239 6706 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
6707
6708 * w32heap.c (cache_system_info):
6709 * w32.c (sys_rename):
6710 * w32proc.c (find_child_console, sys_kill): All users changed.
6711
387d4d92
PE
67122012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6713
6714 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6715
55a6cca6
EZ
67162012-07-29 Eli Zaretskii <eliz@gnu.org>
6717
6718 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6719
dbcf001c
DA
67202012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6721
6722 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
6723 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6724 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 6725
e2688e4a
DA
67262012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6727
6728 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6729 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6730 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6731 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6732 (replace_range, replace_range_2, del_range_2): Change to eassert.
6733 * marker.c (byte_char_debug_check): Adjust style.
6734
b46a6a83
PE
67352012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6736
6737 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6738 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6739 long-ago-commented-out code that talks about "WIN32".
6740 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6741 All uses changed.
6742
e32a5799
PE
67432012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6744
6745 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6746 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6747 Simplify by using alignof.
6748 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6749 * lisp.h: Include <stdalign.h>.
6750 (GCALIGNMENT): New macro and constant.
6751 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6752 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6753 (stdalign): New macro, if not already defined.
6754
df81cd29
EZ
67552012-07-28 Eli Zaretskii <eliz@gnu.org>
6756
01bd1b0d
EZ
6757 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6758 * w32inevt.c: Include w32inevt.h.
6759 (w32_read_console_input): New inline function, calls either
6760 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6761 w32_console_unicode_input.
6762 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6763 (w32_kbd_patch_key, key_event): Use the codepage returned by
6764 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6765 (key_event): use uChar.UnicodeChar only if
6766 w32_console_unicode_input is non-zero.
6767
6768 * w32console.c: Include w32heap.h.
6769 <w32_console_unicode_input>: New global variable.
6770 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6771 family of Windows, zero otherwise.
6772
6773 * w32inevt.h: Declare w32_console_unicode_input.
6774
df81cd29
EZ
6775 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6776 --without-x. (Bug#11742)
6777
c20fdd9e
PE
67782012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6779
6780 Adjust GDB to reflect pvec_type changes (Bug#12036).
6781 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
6782 2012-07-04 changes to pseudovector representation.
6783 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 6784
32770973 67852012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
6786
6787 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6788 bus address.
6789 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6790
3438fe21
EZ
67912012-07-27 Eli Zaretskii <eliz@gnu.org>
6792
bcfbc9de
EZ
6793 * alloc.c (listn): Fix the order the arguments are consed onto the
6794 list.
6795
3438fe21
EZ
6796 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6797 enumeration constants, as PURE and HEAP are too general, and clash
6798 with other headers and sources, such as gmalloc.c and the
6799 MS-Windows system headers. All users changed.
6800
eeaea515
DA
68012012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6802
6803 Revert last save_excursion_save and save_excursion_restore changes.
6804 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6805 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6806
073c88c2
DA
68072012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6808
6809 Fix recently-introduced typos in Windows port.
6810 Reported by Martin Rudalics <rudalics@gmx.at>.
6811 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 6812 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 6813
4706125e
PE
68142012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6815
6816 Improve GDB symbol export (Bug#12036).
6817 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6818 arms of an 'if', not using conditional expressions; otherwise GDB
6819 complains about the types in the unevaluated arm when the argument
6820 is an integer literal.
6821 (xgetint): Simplify expression.
6822 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6823 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6824 Zaretskii in <http://bugs.gnu.org/12036#13>.
6825 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6826 needed now that we have gdb_make_enums_visible.
6827 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6828 (enum enum_USE_LSB_TAG):
6829 New enum types, packaging up enums that need to be exported to GDB.
6830
694b6c97
DA
68312012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6832
6833 Utility function to make a list from specified amount of objects.
6834 * lisp.h (enum constype): New datatype.
6835 (listn): New prototype.
6836 * alloc.c (listn): New function.
6837 (Fmemory_use_count, syms_of_alloc): Use it.
6838 * buffer.c (syms_of_buffer): Likewise.
6839 * callint.c (syms_of_callint): Likewise.
6840 * charset.c (define_charset_internal): Likewise.
6841 * coding.c (syms_of_coding): Likewise.
6842 * keymap.c (syms_of_keymap): Likewise.
6843 * search.c (syms_of_search): Likewise.
6844 * syntax.c (syms_of_syntax): Likewise.
6845 * w32.c (init_environment): Likewise.
6846 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6847 * xdisp.c (syms_of_xdisp): Likewise.
6848 * xfns.c (syms_of_xfns): Likewise.
6849
6195f384
DA
68502012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6851
6852 Fast save_excursion_save and save_excursion_restore.
6853 * lisp.h (struct Lisp_Excursion): New data type.
6854 (PVEC_EXCURSION): New pseudovector type.
6855 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6856 to deal with it. Adjust comments.
6857 (init_marker, attach_marker): New prototype.
6858 (unchain_marker): Adjust prototype.
6859 * marker.c (attach_marker): Change to global.
6860 (init_marker): New function.
6861 * alloc.c (Fmake_marker, build_marker): Use it.
6862 (build_marker): More easserts.
6863 (mark_object): Handle struct Lisp_Excursion.
6864 * editfns.c (save_excursion_save, save_excursion_restore):
6865 Reimplement to use struct Lisp_Excursion. Add comments.
6866
5eceb8fb
PE
68672012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6868
6869 Fix export of symbols to GDB (Bug#12036).
6870 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6871 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6872 emacs.c, as this is a more-suitable home. Had this been done earlier
6873 the fix for 12036 would have avoided some of the problems noted in
6874 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6875 would have been more obvious.
562157c8
PE
6876 * emacs.c: Do not include <verify.h>; no longer needed.
6877 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
6878 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6879 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6880 Remove; now done in lisp.h.
6881 * lisp.h (PUBLISH_TO_GDB): New macro.
6882 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6883 (DATA_SEG_BITS): Use it.
6884 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6885 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6886 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6887 not be usable in #if. This simplifies things.
6888
d6749401
JB
68892012-07-26 Juanma Barranquero <lekktu@gmail.com>
6890
6891 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6892
1781b9e9
PE
68932012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6894
d89518db 6895 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
6896 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6897 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6898 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6899 Adjust to changes in lisp.h and emacs.c, by using
6900 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6901 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6902 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6903 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6904 instead of gdb_valbits.
6905 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6906 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6907 instead of gdb_array_mark_flag.
6908 (xboolvector): Get size from $->size, not $->header.size.
6909 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6910 (xreload, hook-run, hookpost-run): Remove.
6911 * emacs.c: Include <verify.h>.
6912 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6913 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6914 Remove.
6915 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6916 (gdb_USE_LSB_TAG): New enum constants.
6917 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6918 Also define these as enum constants, so they're visible to GDB.
6919 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6920 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6921 as constants, so they're visible to GDB.
6922 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6923 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6924 Now enum constants, not macros, so they're visible to GDB.
6925 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6926 more convenient now. All uses changed.
6927 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6928 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6929
3628596a
DA
69302012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6931
6932 Explicitly free restriction data that are not needed anymore.
6933 * editfns.c (save_restriction_restore): Free restriction data.
6934
7abaf5cc
SM
69352012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6936
6937 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6938 add argument, tune behavior, and adjust all callers.
6939
71f88e00
PE
69402012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6941
6942 Use typedef for EMACS_INT, EMACS_UINT.
6943 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6944 than macros. This simplifies debugging in the usual case, since
6945 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6946 and it allows expressions involving EMACS_INT casts.
6947 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6948
57ec3034
JD
69492012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6950
6951 * nsterm.m (ns_read_socket): Return early if there is a modal
6952 window (Bug#12043).
6953
8137e7b3
MR
69542012-07-25 Martin Rudalics <rudalics@gmx.at>
6955
6956 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6957 that FOCUS-FRAME can be omitted.
6958
04e9897c
DA
69592012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6960
6961 Adjust buffer text indirection counters at the end of Fkill_buffer.
6962 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6963 buffer is definitely dead. This should really fix an issue reported
6964 by Christoph Scholtes again. (Bug#12007).
6965 (init_buffer_once): Initialize indirection counters of
6966 buffer_defaults and buffer_local_symbols (for sanity and safety).
6967
8a0484e1
EZ
69682012-07-24 Eli Zaretskii <eliz@gnu.org>
6969
6970 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6971 and continuation glyphs on tooltip frames, leave them at zero.
6972 Avoids continued lines in tooltips. (Bug#11832)
6973
fa691a83
DA
69742012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6975
6976 Simplify copy_overlay.
04e9897c 6977 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
6978 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6979
436bc8e0
EZ
69802012-07-23 Eli Zaretskii <eliz@gnu.org>
6981
6982 * print.c (print_object): Don't crash when a frame's name is nil
6983 or invalid. (Bug#12025)
6984
6985 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6986 it signals an error when a tooltip frame is being created.
6987
d7a7fda3
DA
69882012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6989
6990 Cleanup miscellaneous objects allocation and initialization.
6991 * alloc.c (allocate_misc): Change to static. Add argument to
6992 specify the subtype. Adjust comment and users.
6993 (build_overlay): New function.
6994 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6995 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6996 (allocate_misc): Remove prototype.
6997 (build_overlay): Add prototype.
6998
69992012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
7000
7001 Swap buffer text indirection counters in Fbuffer_swap_text.
7002 * buffer.c (Fbuffer_swap_text): Swap indirections too.
7003 This avoids crash reported by Christoph Scholtes at
7004 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
7005
9d7fa573
JD
70062012-07-22 Jan Djärv <jan.h.d@swipnet.se>
7007
7008 * nsmenu.m (Popdown_data): New struct.
7009 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
7010 free Popdown_data.
7011 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
7012 (initWithContentRect): Make imgView and contentView non-static
7013 and autorelease them. Also autorelease img and matrix (Bug#12005).
7014 (dealloc): Remove (Bug#12005).
7015
0dd6d66d
DA
70162012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7017
7018 Adjust consing_since_gc when objects are explicitly freed.
7019 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
7020 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
7021 (free_cons, free_misc): Subtract object size from consing_since_gc.
7022
d36d71df
DA
70232012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
7024
7025 Simplify and cleanup markers positioning code.
7026 * marker.c (attach_marker): More useful eassert.
7027 (live_buffer, set_marker_internal): New function.
7028 (Fset_marker, set_marker_restricted): Use set_marker_internal.
7029 (set_marker_both, set_marker_restricted_both): Use live_buffer.
7030
fb9ea40f
PE
70312012-07-22 Paul Eggert <eggert@cs.ucla.edu>
7032
7033 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
7034 as it's limited by the amount of memory, not by INT_MAX.
7035
2d5c5f7d
EZ
70362012-07-21 Eli Zaretskii <eliz@gnu.org>
7037
07fb592e
EZ
7038 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
7039 in special-event-map. See the discussion at
7040 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
7041 for the reasons.
7042
37a9eac8 7043 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
7044 info.dwItemData. Fixes crashes on 64-bit Windows.
7045 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 7046
c4328746
JD
70472012-07-21 Jan Djärv <jan.h.d@swipnet.se>
7048
fc0c31f8 7049 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 7050 (conversationIdentifier): Return value is NSInteger.
784051c4 7051 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 7052
6e5d1c12
CY
70532012-07-21 Chong Yidong <cyd@gnu.org>
7054
7055 * window.c (decode_any_window): Signal an error if the window is
7056 on a dead frame (Bug#11984).
7057
9928463d
DA
70582012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7059
7060 Add indirection counting to speed up Fkill_buffer.
7061 * buffer.h (struct buffer): New member.
7062 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
7063 (Fmake_indirect_buffer): Set indirection counter to -1, increment
7064 base buffer indirection counter.
7065 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
7066 (Fkill_buffer): Adjust indirection counters as needed, don't walk
7067 through buffer list if indirection counter is 0.
7068
f8643a6b
DA
70692012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7070
7071 Extend the value returned by Fgarbage_collect with heap statistics.
7072 * alloc.c (Qheap): New symbol.
7073 (syms_of_alloc): DEFSYM it.
7074 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
7075 (Fmemory_free): Remove.
7076 (syms_of_alloc): Don't defsubr it.
7077 * buffer.c (Fcompact_buffer): Remove.
7078 (syms_of_buffer): Don't defsubr it.
7079
dac616ff
DA
70802012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7081
7082 Make maybe_gc inline.
7083 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
7084 * lisp.h (consing_since_gc, gc_relative_threshold)
7085 (memory_full_cons_threshold): Revert declaration.
7086 (maybe_gc): Remove prototype, define as inline.
7087 * alloc.c: Remove old commented-out code.
7088 (consing_since_gc, gc_relative_threshold)
7089 (memory_full_cons_threshold): Revert to global.
7090 (maybe_gc): Remove.
7091
d7ea76b4
DA
70922012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7093
7094 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
7095 * lisp.h (build_unibyte_string): New function.
7096 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
7097 * sysdep.c, w32fns.c, xfns.c: Use it.
7098 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
7099 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
7100 Adjust users accordingly.
7101 * font.h (font_open_by_name): Adjust prototype.
7102
765e61e3
DA
71032012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
7104
7105 Cleanup calls to Fgarbage_collect.
7106 * lisp.h (maybe_gc): New prototype.
7107 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7108 Remove declarations.
7109 * alloc.c (maybe_gc): New function.
7110 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
7111 Make them static.
7112 * bytecode.c (MAYBE_GC): Use maybe_gc.
7113 * eval.c (eval_sub, Ffuncall): Likewise.
7114 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
7115 to avoid dependency from auto-save feature.
7116
52b852c7
PE
71172012-07-19 Paul Eggert <eggert@cs.ucla.edu>
7118
7119 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
7120 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
7121 'for_each_per_buffer_object_at'.
7122 All uses changed. It's better to use upper-case for macros that
7123 cannot be implemented as functions, to give the reader a clue
7124 that they're special.
7125
5db81e33
SM
71262012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
7127
7128 * alloc.c (Fgarbage_collect): Tweak docstring.
7129
5b835e1d
DA
71302012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7131
7132 Tweak the value returned from Fgarbage_collect again.
7133 * alloc.c (Fgarbage_collect): New return value, as confirmed in
7134 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
7135 Adjust documentation.
7136 (total_vector_bytes): Rename to total_vector_slots, adjust
7137 accounting.
7138 (total_free_vector_bytes): Rename to total_free_vector_slots,
7139 adjust accounting.
7140 (Qstring_bytes, Qvector_slots): New symbols.
7141 (syms_of_alloc): DEFSYM them.
7142
9cd47b72
DA
71432012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7144
7145 Buffer compaction primitive which may be used from Lisp.
7146 * buffer.c (compact_buffer, Fcompact_buffer): New function.
7147 (syms_of_buffer): Register Fcompact_buffer.
7148 * alloc.c (Fgarbage_collect): Use compact_buffer.
7149 * buffer.h (compact_buffer): New prototype.
7150 (struct buffer_text): New member.
7151
d17337e5
DA
71522012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
7153
7154 New macro to iterate over all buffers, miscellaneous cleanups.
7155 * lisp.h (all_buffers): Remove declaration.
7156 * buffer.h (all_buffers): Add declaration, with comment.
7157 (for_each_buffer): New macro.
7158 * alloc.c (Fgarbage_collect, mark_object): Use it.
7159 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
7160 (init_buffer): Likewise.
7161 * data.c (Fset_default): Likewise.
7162 * coding.c (code_conversion_restore): Remove redundant check
7163 for dead buffer.
7164 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
7165
60cfd278
AS
71662012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7167
7168 Fix bug that created negative-length intervals.
7169 * intervals.c (merge_interval_right, merge_interval_left):
7170 Do not zero out this interval if it is absorbed by its children,
7171 as this interval's total length doesn't change in that case. See
7172 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
7173
d06714cb
PE
71742012-07-18 Paul Eggert <eggert@cs.ucla.edu>
7175
83713154
PE
7176 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
7177 when invoking (make-bool-vector N t) and N is a positive
7178 multiple of 8 -- the last 8 bits were mistakenly cleared.
7179
d06714cb
PE
7180 Remove some struct layout assumptions in bool vectors.
7181 * alloc.c (bool_header_size): New constant.
7182 (header_size, word_size): Move earlier, as they're now used earlier.
7183 Use 'word_size' in a few more places, where it's appropriate.
7184 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
7185 padding before the data member of a bool vector.
7186 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
7187 than doing the check by hand with an abort ().
7188
464d5a5e
SM
71892012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7190
5fbc0409
SM
7191 * eval.c (Fdefvar): Don't check constants since we only set the var if
7192 it's not yet defined anyway (bug#11904).
7193
464d5a5e
SM
7194 * lisp.h (last_undo_boundary): Declare new var.
7195 * keyboard.c (command_loop_1): Set it.
7196 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
7197 were auto-added by the command loop (bug#11774).
7198
8dc2e44a
AS
71992012-07-18 Andreas Schwab <schwab@linux-m68k.org>
7200
7201 * w32font.c (Qsymbol): Remove local definition.
7202 (syms_of_w32font): Don't DEFSYM it.
7203
169925ec
DA
72042012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7205
7206 Fix sweep_vectors to handle large bool vectors correctly.
7207 * alloc.c (sweep_vectors): Account total_vector_bytes for
7208 bool vectors larger than VBLOCK_BYTES_MAX.
7209
5fbfb018
CY
72102012-07-18 Chong Yidong <cyd@gnu.org>
7211
7212 * frame.c (x_set_frame_parameters): Revert bogus change introduced
7213 in 2012-05-25 commit by Paul Eggert (Bug#11738).
7214
3ab6e069
DA
72152012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
7216
7217 Return more descriptive data from Fgarbage_collect.
7218 Suggested by Stefan Monnier in
7219 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
7220 * alloc.c (bounded_number): New function.
7221 (total_buffers, total_vectors): New variable.
7222 (total_string_size): Rename to total_string_bytes, adjust users.
7223 (total_vector_size): Rename to total_vector_bytes, adjust users.
7224 (sweep_vectors): Account total_vectors and total_vector_bytes.
7225 (Fgarbage_collect): New return value. Adjust documentation.
7226 (gc_sweep): Account total_buffers.
7227 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
7228 (VECTOR_SIZE): Remove.
7229 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
7230 (Qinterval, Qmisc): New symbols.
7231 (syms_of_data): Initialize them.
7232 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
7233 (Qcons, Qbuffer): New declarations.
7234
6d02fe5b
PE
72352012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7236
7237 * alloc.c (Fmemory_free): Account for memory-free's own storage.
7238 Round up, not down. Improve doc.
7239
b7ffe040
DA
72402012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7241
7242 Restore old code in allocate_string_data to avoid Faset breakage.
7243 Reported by Julien Danjou <julien@danjou.info> in
7244 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
7245 * alloc.c (allocate_string_data): Restore old code with minor
7246 adjustments, fix comment to explain this subtle issue.
7247
4dc7c8d5
SM
72482012-07-17 Eli Zaretskii <eliz@gnu.org>
7249
7250 Remove FILE_SYSTEM_CASE.
7251 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
7252
7253 * fileio.c (FILE_SYSTEM_CASE): Don't define.
7254 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
7255 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
7256 call-process-region passes it through expand-file-name.
7257
7258 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
7259
72602012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7261
7262 Fix crash when creating indirect buffer (Bug#11917)
7263 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
7264 Don't handle unbound variables specially if non-zero.
7265 (Fbuffer_local_variables): Pass zero.
7266 (clone_per_buffer_values): Pass non-zero.
7267
72682012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7269
7270 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
7271 to make the loop interruptible.
7272
72732012-07-17 Andreas Schwab <schwab@linux-m68k.org>
7274
7275 * gnutls.c (emacs_gnutls_handshake): Only retry if
7276 GNUTLS_E_INTERRUPTED.
7277
cce7fefc
DA
72782012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7279
7280 Cleanup and convert miscellaneous checks to eassert.
7281 * alloc.c (mark_interval): Fix comment, partially rephrase
7282 old comment from intervals.h (see below).
7283 * intervals.c (find_interval, adjust_intervals_for_insertion)
7284 (delete_interval, adjust_intervals_for_deletion)
7285 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7286 Convert to eassert.
7287 (adjust_intervals_for_insertion, make_new_interval):
7288 Remove obsolete and unused code.
7289 * intervals.h (struct interval): Remove obsolete comment.
7290 * textprotp.c (erase_properties): Remove unused code.
7291 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7292 (Fremove_list_of_text_properties): Convert to eassert.
7293
9ea10cc3
CY
72942012-07-17 Chong Yidong <cyd@gnu.org>
7295
7296 * editfns.c (Finsert_char): Doc fix.
7297
3900d5de
DA
72982012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7299
7300 Fix previous change to make Fmemory_free always accurate.
7301 * alloc.c (make_interval): Update total_free_intervals.
7302 (make_float): Likewise for total_free_floats.
7303 (free_cons, Fcons): Likewise for total_free_conses.
7304 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7305 Likewise for total_free_vector_bytes.
7306 (Fmake_symbol): Likewise for total_free_symbols.
7307 (bytes_free): Remove.
7308
7098646f
DA
73092012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7310
7311 Simple free memory accounting feature.
7312 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7313 (sweep_vectors): Accumulate size of free vectors.
7314 (Fgarbage_collect): Setup bytes_free.
7315 (Fmemory_free): New function.
7316 (syms_of_alloc): Register it.
7317
22657b40
DA
73182012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7319
7320 Cleanup overlays checking.
7321 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7322 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7323 eassert and OVERLAYP.
7324 (sort_overlays): Change to use OVERLAYP.
7325
ddfc8813
RK
73262012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7327
7328 * editfns.c (Finsert_char): Make it interactive, and make the
7329 second arg optional. Copy interactive spec and docstring from
7330 ucs-insert.
7331
7c26cf3c
PE
73322012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7333
7334 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7335 Unlike the other wrapped functions, fabs has an unspecified
7336 effect on errno.
7337
5d127af9
JD
73382012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7339
7340 * nsterm.m (keyDown): Interpret flags without left/right bits
7341 as the left key (Bug#11670).
7342
6a0dd1d7
DA
73432012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7344
7345 Remove empty and useless init functions.
7346 * lisp.h (init_character_once, init_fns, init_image)
7347 (init_filelock, init_sound): Remove prototype.
7348 * character.c (init_character_once): Remove.
7349 * filelock.c (init_filelock): Likewise.
7350 * fns.c (init_fns): Likewise.
7351 * image.c (init_image): Likewise.
7352 * sound.c (init_sound): Likewise.
7353 * emacs.c (main): Adjust accordingly.
7354
7a6136fd
DA
73552012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7356
7357 * gtkutil.h: Tiny cleanups.
7358 (use_old_gtk_file_dialog): Remove useless declaration.
7359 (xg_uses_old_file_dialog): Add suggested const attribute.
7360
ce811ad9
EZ
73612012-07-15 Eli Zaretskii <eliz@gnu.org>
7362
7363 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7364 (bidi_paragraph_init): Use it to limit search forward for a strong
7365 directional character in abnormally large paragraphs full of
7366 neutral or weak characters. (Bug#11943)
7367
c9adfeaa
SF
73682012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7369
7370 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7371 the toolbar (Bug#9451).
7372 (xg_make_tool_item): Give the widget event box a transparent
7373 background.
7374
fff62aa9
DA
73752012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7376
7377 Cleanup basic allocation variables and functions.
7378 * alloc.c (ignore_warnings, init_intervals, init_float)
7379 (init_cons, init_symbol, init_marker): Remove.
7380 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7381 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7382 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7383 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7384 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7385 (staticidx, init_alloc_once, init_strings, free_ablock):
7386 Remove redundant initialization.
7387 * fns.c (init_weak_hash_tables): Remove.
7388 * lisp.h (init_weak_hash_tables): Remove prototype.
7389
9730daca
DA
73902012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7391
7392 Use zero_vector where appropriate.
7393 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7394 accordingly.
7395 * lisp.h (zero_vector): New declaration.
7396 * font.c (null_vector): Remove.
7397 (syms_of_font): Remove initialization and staticpro.
7398 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7399 * keymap.c (Faccessible_keymaps): Likewise.
7400
2e2d2a13
LL
74012012-07-15 Leo Liu <sdl.web@gmail.com>
7402
7403 * fringe.c: Fix typo in comments.
7404
cd276f6e
LL
74052012-07-14 Leo Liu <sdl.web@gmail.com>
7406
7407 * fringe.c: Add a new bitmap exclamation-mark.
7408
5a1131d9
EZ
74092012-07-14 Eli Zaretskii <eliz@gnu.org>
7410
7411 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7412
7413 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7414 (HAVE_MENUS): Don't define, defined by editing config.in with
7415 msdos/sed2v2.inp.
7416 (GMALLOC_INHIBIT_VALLOC): Don't define.
7417 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7418
22e983b7
JB
74192012-07-14 Juanma Barranquero <lekktu@gmail.com>
7420
7421 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7422
5b3f250f
GM
74232012-07-14 Glenn Morris <rgm@gnu.org>
7424
7425 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7426 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7427 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7428
33d63ff4
GM
74292012-07-13 Glenn Morris <rgm@gnu.org>
7430
5b633342
GM
7431 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7432
33d63ff4
GM
7433 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7434 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7435
b55b9f85
JD
74362012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7437
0dc8cf50
JD
7438 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7439 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7440 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7441 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7442 where appropriate.
7443 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7444 as boolean expression.
7445 (x_set_window_size): Remove unused variable toolbar.
7446 (ns_get_color_default, ns_mod_to_lisp): Remove.
7447 (ns_mouse_position): Remove unused variables xchar and ychar.
7448 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7449 (ns_set_vertical_scroll_bar): Remove unused variable count.
7450 (ns_delete_terminal): Remove unused variable i.
7451 (ns_term_init): Remove unused variables r, g and b.
7452 (mouseDown): Remove unused variable window.
7453 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7454 (initFrameFromEmacs): Remove unused variable vbextra.
7455 (mouseEntered): Remove unused variables p and dpyinfo.
7456 (mouseExited): Remove unused variables p and r.
7457 (ns_define_frame_cursor, ns_clear_frame_area)
7458 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7459 (menuDown): Assign [sender tag] to variable and cast the variable.
7460
7461 * nsterm.h (menuDown): Add id as type to argument sender.
7462 (ns_display_info_for_name): Add Lisp_Object argument.
7463 (ns_term_init): Add Lisp_Object argument.
7464 (ns_map_event_to_object): Add void argument.
7465 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7466 prototype with arguments and only declare if __OBJC__.
7467 (nxatoms_of_nsselect): Add void argument.
7468 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7469 (ns_alloc_autorelease_pool): Add void argument.
7470 (ns_release_autorelease_pool): Add void* argument.
7471 (ns_get_defaults_value): Add const char* argument.
7472
7473 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7474 (initFromContents): Use SSDATA where appropriate.
7475 (ns_update_menubar): Add braces to ambigous if-else.
7476 (initWithTitle): Put () around assignment in if statement.
7477 (ns_menu_show): Remove unused variables window and keymap.
7478 (update_frame_tool_bar): Remove unused variable selected_p.
7479 (initWithContentRect): Remove unused variable this_cmd_name.
7480
7481 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7482 appropriate.
7483 (setXBMColor): Remove unused variable len.
7484 (setPixmapData): Put () around assignment in loop statement.
7485
7486 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7487 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7488 where appropriate.
7489 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7490 around assignment in loop statement.
7491 (nsfont_open): Remove unused variable i.
7492 (nsfont_open): Remove unused variable len.
7493 (nsfont_draw): Remove unused variable cs.
7494
7495 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7496 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7497 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7498 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7499 (Fns_font_name, Fns_perform_service)
7500 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7501 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7502 (ns_set_name): Remove unused variable view.
7503 (x_set_menu_bar_lines): Remove unused variable olines.
7504 (x_set_tool_bar_lines): Remove unused variable root_window.
7505 (Fns_list_colors): Put () around assignment in while statement.
7506 (Fns_perform_service): Remove unused variable len.
7507 (Fns_display_usable_bounds): Remove unused variable top.
7508 (syms_of_nsfns): Remove unused variable i.
7509
b55b9f85
JD
7510 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7511 memcpy (Bug#11907).
7512
ed9265fc 75132012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
7514
7515 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7516 and free it with DestroyExceptionInfo (Bug#11558).
7517
ef099b57
JB
75182012-07-13 Juanma Barranquero <lekktu@gmail.com>
7519
7520 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7521 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7522 Set here, not in nt/config.nt.
7523
ea814a5d
EZ
75242012-07-13 Eli Zaretskii <eliz@gnu.org>
7525
7526 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7527 cursor overflow into the last glyph on display line when the right
7528 fringe is off. (Bug#11832)
7529
1a952767
PE
75302012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7531
7532 * xdisp.c (produce_special_glyphs): Now static.
7533 * dispextern.h (produce_special_glyphs): Remove decl.
7534
983188fd
GM
75352012-07-13 Glenn Morris <rgm@gnu.org>
7536
8d7c7eed 7537 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
7538 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7539
983188fd
GM
7540 * s/usg5-4-common.h (USG, USG5):
7541 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7542 * s/sol2-6.h (SOLARIS2):
7543 * s/irix6-5.h (IRIX6_5):
7544 * s/hpux10-20.h (USG, USG5, HPUX):
7545 * s/gnu-linux.h (USG, GNU_LINUX):
7546 * s/freebsd.h (BSD_SYSTEM):
7547 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7548 * s/cygwin.h (CYGWIN):
7549 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7550 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7551
d1e68667 75522012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
7553
7554 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 7555
6de0e799
GM
75562012-07-13 Glenn Morris <rgm@gnu.org>
7557
739ae010
GM
7558 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7559
dbee5793
GM
7560 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7561
6de0e799
GM
7562 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7563 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7564
b82da769
GM
75652012-07-12 Glenn Morris <rgm@gnu.org>
7566
4fae5a7a 7567 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
7568
7569 * process.c (init_process_emacs): Rename from init_process.
7570 The old name is also the name of a Mach system call.
7571 * lisp.h, emacs.c: Update for this name change.
7572 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7573 longer needed.
7574
5a979817
EZ
75752012-07-12 Eli Zaretskii <eliz@gnu.org>
7576
7577 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7578 memmove call that removes glyphs covered by the left truncation
7579 glyph. Improve commentary.
7580 (display_line): Fix display of continuation glyphs on GUI frames
7581 when the right fringe is turned off and variable-size fonts are
7582 used in the window. Move the code that appends a stretch glyph to
7583 produce_special_glyphs, so that it could be used for truncation
7584 and continuation glyphs alike.
7585 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7586 glyph of a suitably computed width, to align the special glyphs at
7587 the window margin. Code moved from display_line. (Bug#11832)
7588
3e91a053
GM
75892012-07-12 Glenn Morris <rgm@gnu.org>
7590
ba9e4b84
GM
7591 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7592
7593 * s/gnu-linux.h, s/hpux10-20.h:
7594 Do not unconditionally define HAVE_XRMSETDATABASE.
7595
3e91a053
GM
7596 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7597
b300b1f4
PE
75982012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7599
7600 Fix typos that broke OS X build.
7601 Reported by Randal L. Schwartz in
7602 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7603 * nsterm.m (ns_timeout): Add missing local decl.
7604 (ns_get_color): snprintf -> sprintf, to fix typo.
7605
6e777848
GM
76062012-07-12 Glenn Morris <rgm@gnu.org>
7607
3f922c37
GM
7608 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7609 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7610 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7611 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7612
0ab7b23a
GM
7613 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7614 Move PTY_OPEN to configure.
7615
6e777848
GM
7616 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7617 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7618 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7619
4a7edc24
DA
76202012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7621
7622 Use empty_unibyte_string where applicable.
7623 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7624 * lread.c (read1): Likewise.
7625 * xsettings.c (syms_of_xsettings): Likewise.
7626
308aab79
GM
76272012-07-12 Glenn Morris <rgm@gnu.org>
7628
42bd1719
GM
7629 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7630 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
7631 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7632 * s/hpux10-20.h (RUN_TIME_REMAP):
7633 * s/bsd-common.h (TABDLY): Move to configure.
7634
7635 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7636
7637 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7638
ea0bbd17 7639 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 7640 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
7641
7642 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 7643
308aab79
GM
7644 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7645 * s/template.h: Move NARROWPROTO to configure.
7646
ee1cf5cf
GM
76472012-07-11 Glenn Morris <rgm@gnu.org>
7648
30fe9bf4
GM
7649 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7650 unused since 2011-01-17 change to systty.h.
7651
ee1cf5cf
GM
7652 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7653 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7654 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7655
63e47e07
PE
76562012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7657
7658 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7659
c43fb4c3
GM
76602012-07-11 Glenn Morris <rgm@gnu.org>
7661
7662 * s/darwin.h, s/gnu-linux.h, s/template.h:
7663 Move INTERRUPT_INPUT to configure.
7664
e8df9267
DA
76652012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7666
7667 Minor adjustments to interning code.
7668 * lisp.h (intern, intern_c_string): Redefine as static inline
7669 wrappers for intern_1 and intern_c_string_1, respectively.
7670 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
7671 * lread.c (intern_1, intern_c_string_1, oblookup):
7672 Simplify Vobarray checking.
e8df9267
DA
7673 * font.c (font_intern_prop): Likewise. Adjust comment.
7674 * w32font.c (intern_font_name): Likewise.
7675
34348bd4
AS
76762012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7677
d96a1e0c
AS
7678 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7679
34348bd4
AS
7680 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7681 of Fcar/Fcdr if possible.
7682 * font.c (check_otf_features): Likewise.
7683 * fontset.c (Fnew_fontset): Likewise.
7684 * gnutls.c (Fgnutls_boot): Likewise.
7685 * minibuf.c (read_minibuf): Likewise.
7686 * msdos.c (IT_set_frame_parameters): Likewise.
7687 * xmenu.c (Fx_popup_dialog): Likewise.
7688 * w32menu.c (Fx_popup_dialog): Likewise.
7689
c8add24e
GM
76902012-07-11 Glenn Morris <rgm@gnu.org>
7691
4b575b3c
GM
7692 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7693 since nothing has defined it on these platforms.
7694
09f4e3b0
GM
7695 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7696 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7697
172bedef
GM
7698 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7699 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7700 Move CLASH_DETECTION to configure.
7701
249685df
GM
7702 * s/gnu.h: Remove file, which is now empty.
7703
c8add24e
GM
7704 * s/gnu.h, s/gnu-linux.h:
7705 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7706
b41253a3
JW
77072012-07-11 John Wiegley <johnw@newartisans.com>
7708
7709 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7710 function attribute, so we only use it if it exists in the
7711 compiler.
7712
d923b542
DA
77132012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7714
7715 Avoid call to strlen in fast_c_string_match_ignore_case.
7716 * search.c (fast_c_string_match_ignore_case): Change to use
7717 length argument. Adjust users accordingly.
7718 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7719
5ebbef1d
PE
77202012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7721
bb352260
PE
7722 Assume mkdir, rmdir.
7723 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7724 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7725
57054ddd
PE
7726 Assume rename.
7727 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7728
b747d3f7
PE
7729 Assume perror.
7730 * s/hpux10-20.h (HAVE_PERROR): Remove.
7731 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7732 Remove dummy definition, as this problem was obsolete long ago.
7733
5ebbef1d
PE
7734 Assume strerror.
7735 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7736
984e7f30
DA
77372012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7738
7739 Avoid calls to strlen in font processing functions.
7740 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
7741 (font_open_by_name): Change to use length argument.
7742 Adjust users accordingly.
d923b542
DA
7743 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7744 Adjust prototypes.
7745 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7746 Change to return ptrdiff_t.
984e7f30
DA
7747 (xfont_list_pattern, xfont_match): Use length returned by
7748 xfont_decode_coding_xlfd.
7749 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7750
20e94fdd
GM
77512012-07-11 Glenn Morris <rgm@gnu.org>
7752
9d596af3
GM
7753 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7754 Move DONT_REOPEN_PTY to configure.
7755
20e94fdd
GM
7756 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7757 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7758
e99a530f
PE
77592012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7760
22ffb973
PE
7761 Remove "#define unix" that is no longer needed (Bug#11905).
7762 * s/aix4-2.h (unix): Remove; no longer needed.
7763
e9a9ae03
PE
7764 EMACS_TIME simplification (Bug#11875).
7765 This replaces macros (which typically do not work in GDB)
7766 with functions, typedefs and enums, making the code easier to debug.
7767 The functional style also makes code easier to read and maintain.
7768 * systime.h: Include <sys/time.h> on all hosts, not just if
7769 WINDOWSNT, since 'struct timeval' is needed in general.
7770 (EMACS_TIME): Now a typedef, not a macro.
7771 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7772 not macros.
7773 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7774 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7775 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7776 (EMACS_TIME_LE): Now functions, not macros.
7777 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7778 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7779 which are not functions. All uses rewritten to use:
7780 (make_emacs_time): New function.
7781 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7782 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7783 not functions. All uses rewritten to use the following, respectively:
7784 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7785 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 7786 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
7787 * fileio.c (Fcopy_file):
7788 * xterm.c (XTflash): Get the current time closer to when it's used.
7789 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7790
ffacb126
PE
7791 * bytecode.c (targets): Suppress -Woverride-init warnings.
7792
e99a530f
PE
7793 Simplify by avoiding confusing use of strncpy etc.
7794 * doc.c (Fsnarf_documentation):
7795 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7796 * frame.c (Fmake_terminal_frame):
7797 * gtkutil.c (get_utf8_string):
7798 * lread.c (openp):
7799 * nsmenu.m (ns_update_menubar):
7800 * regex.c (regerror):
7801 Prefer memcpy to strncpy and strncat when either will do.
7802 * fileio.c (Fsubstitute_in_file_name):
7803 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7804 (menu_separator_name_p):
7805 * nsmenu.m (ns_update_menubar):
7806 Prefer memcmp to strncmp when either will do.
7807 * nsterm.m: Include <ftoastr.h>.
7808 (ns_get_color):
7809 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7810 Prefer snprintf to strncpy.
7811 * nsterm.m (ns_term_init):
7812 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7813 * nsterm.m (ns_term_init):
7814 Avoid the need for strncpy, by using build_string or
7815 make_unibyte_string directly. Use dtoastr, not snprintf.
7816 * process.c (Fmake_network_process): Diagnose service names that
7817 are too long, rather than silently truncating them or creating
7818 non-null-terminated names.
7819 (Fnetwork_interface_info): Likewise, for interface names.
7820 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7821 Prefer sprintf to strncat.
7822 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7823 Prefer vsnprintf to vsprintf + strncpy.
7824
c59592b3
GM
78252012-07-10 Glenn Morris <rgm@gnu.org>
7826
7827 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7828 Clarify fallback case.
7829
7d7bbefd
DA
78302012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7831
7832 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7833 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7834 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 7835 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
7836 where argument type is known to be a Lisp_Cons.
7837
3a4c8000
TT
78382012-07-10 Tom Tromey <tromey@redhat.com>
7839
7840 * bytecode.c (BYTE_CODE_THREADED): New macro.
7841 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7842 (enum byte_code_op): New type.
7843 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7844 (exec_byte_code): Use them. Use token threading when applicable.
7845
2a0213a6
DA
78462012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7847
7848 Optimize pure C strings initialization.
7849 * lisp.h (make_pure_string): Fix prototype.
7850 (build_pure_c_string): New function, defined as static inline. This
7851 provides a better opportunity to optimize away calls to strlen when
7852 the function is called with compile-time constant argument.
7853 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7854 argument, adjust users accordingly. Use build_pure_c_string where
7855 appropriate.
7856 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7857 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7858 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7859
cb1caeaf
DA
78602012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7861
7862 Avoid calls to strlen in miscellaneous functions.
7863 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7864 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7865 * lread.c (openp): Likewise.
7866
c293e30c
DA
78672012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7868
7869 Avoid calls to strlen in path processing functions.
7870 * fileio.c (file_name_as_directory): Add comment. Change to add
7871 srclen argument and return the length of result. Adjust users
7872 accordingly.
7873 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
7874 swap 1st and 2nd arguments to obey the common convention.
7875 Adjust users accordingly.
c293e30c
DA
7876 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7877
9e059e3f
GM
78782012-07-10 Glenn Morris <rgm@gnu.org>
7879
d02eb359
GM
7880 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7881 Move PENDING_OUTPUT_COUNT definition to configure.
7882
882cf227
GM
7883 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7884 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7885 * s/gnu.h (DATA_START): Move definitions to configure.
7886
af6e839f
GM
7887 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7888 We include usg5-4-common.h, which defines them both.
7889
40289a12
GM
7890 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7891 O_RDONLY already includes it).
7892
9e059e3f
GM
7893 Stop ns builds setting the EMACSLOADPATH environment variable.
7894 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7895 Now it does not set EMACSLOADPATH, just returns the load-path string.
7896 * nsterm.h: Update accordingly.
7897 * lread.c [HAVE_NS]: Include nsterm.h.
7898 (init_lread) [HAVE_NS]: Use ns_load_path.
7899 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7900
7c4e8ec0
GM
79012012-07-09 Glenn Morris <rgm@gnu.org>
7902
d4f600ff
GM
7903 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7904 since the included bsd-common.h does so.
7905
cbb31951
GM
7906 Stop ns builds setting the EMACSPATH environment variable.
7907 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7908 (ns_init_paths): Do not set EMACSPATH.
7909 * nsterm.h (ns_exec_path): Add it.
7910 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7911 Use ns_exec_path.
7912
7c4e8ec0
GM
7913 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7914
26bccfae
PE
79152012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7916
a0bee46f
PE
7917 * process.c (wait_reading_process_output): 'waitchannels' was unset
7918 when read_kbd || !NILP (wait_for_cell); fix this.
7919
5994c183
PE
7920 Add GCC-style 'const' attribute to functions that can use it.
7921 * character.h (char_resolve_modifier_mask):
7922 * keyboard.h (make_ctrl_char):
7923 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7924 (init_character_once, next_almost_prime, init_fns, init_image)
7925 (flush_pending_output, init_sound):
7926 * mem-limits.h (start_of_data):
7927 * menu.h (finish_menu_items):
7928 Add ATTRIBUTE_CONST.
7929 * emacs.c (DEFINE_DUMMY_FUNCTION):
7930 Declare the dummy function with ATTRIBUTE_CONST.
7931 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7932 Add decls with ATTRIBUTE_CONST.
7933
26bccfae
PE
7934 Minor improvements to make_formatted_string.
7935 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7936 where int is good enough, as vsprintf returns an int.
7937 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7938
a8290ec3
DA
79392012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7940
7941 Use make_formatted_string to avoid double length calculation.
7942 * lisp.h (make_formatted_string): New prototype.
7943 * alloc.c (make_formatted_string): New function.
7944 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 7945 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
7946 * editfns.c (Fcurrent_time_zone): Likewise.
7947 * filelock.c (get_boot_time): Likewise.
7948 * frame.c (make_terminal_frame, set_term_frame_name)
7949 (x_report_frame_params): Likewise.
7950 * image.c (gs_load): Likewise.
7951 * minibuf.c (get_minibuffer): Likewise.
7952 * msdos.c (dos_set_window_size): Likewise.
7953 * process.c (make_process): Likewise.
7954 * xdisp.c (ensure_echo_area_buffers): Likewise.
7955 * xsettings.c (apply_xft_settings): Likewise.
7956
d01ba2f1
GM
79572012-07-09 Glenn Morris <rgm@gnu.org>
7958
7959 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7960 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7961 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7962 * nsterm.h (ns_etc_directory): Add it.
7963 * callproc.c [HAVE_NS]: Include nsterm.h.
7964 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7965
f1f924b6
DA
79662012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7967
7968 Move marker debugging code under MARKER_DEBUG.
7969 * marker.c (MARKER_DEBUG): Move marker debugging code under
7970 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7971 for bootstrap with --enable-checking (~3x slowdown reported
7972 by Juanma Barranquero <lekktu@gmail.com>).
7973 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7974
ab531b66
PE
79752012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7976
7977 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7978 See <http://bugs.gnu.org/11825#29>.
7979
c4b3bc8a
EZ
79802012-07-08 Eli Zaretskii <eliz@gnu.org>
7981
7982 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7983 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
7984 (display_line): Add commentary about displaying truncation glyphs
7985 on GUI frames.
7986 (produce_special_glyphs): Move here from term.c.
7987
7988 * term.c (produce_special_glyphs): Move to xdisp.c.
7989
7990 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7991 section.
c4b3bc8a 7992
b676b881
AS
79932012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7994
f17c5273
AS
7995 * xdisp.c (display_line): Avoid warning about implicit declaration
7996 of FRAME_FONT.
7997
298819b9
AS
7998 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7999
b676b881
AS
8000 * lisp.h: Remove empty conditional.
8001
6045c4fd
PE
80022012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8003
b3350bf9
PE
8004 * lread.c (load_path_check): Now static.
8005
6045c4fd
PE
8006 Fix some minor --with-ns problems found by static checking.
8007 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
8008 (x_set_font) [!HAVE_X_WINDOWS]:
8009 * image.c (xpm_load_image) [HAVE_NS]:
8010 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
8011 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
8012 Remove unused local.
8013 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
8014 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
8015 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
8016 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
8017 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
8018 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
8019 Fix pointer signedness problem.
8020 * xfaces.c (FRAME_X_FONT_TABLE):
8021 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
8022
929e7845
GM
80232012-07-07 Glenn Morris <rgm@gnu.org>
8024
8025 * lread.c (load_path_check): New function, split from init_lread.
8026 (init_lread): Reorganize. Motivation:
8027 If EMACSLOADPATH is set, check/warn about that rather than the
8028 defaults, which we are not going to use. Hence we can remove
8029 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
8030 Don't warn if site-lisp directories are missing.
8031 If not installed, start from a blank load-path, since
8032 PATH_LOADSEARCH refers to the eventual installation directories.
8033
58dd0aa4
EZ
80342012-07-07 Eli Zaretskii <eliz@gnu.org>
8035
8036 Support truncation and continuation glyphs on GUI frames, when
8037 fringes are disabled. (Bug#11832)
8038 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
8039 continuation glyphs even if on GUI frames.
8040 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
8041 or both, are absent.
8042 (start_display, move_it_in_display_line_to): Handle the case of a
8043 GUI frame without a fringe to display continuation or truncation
8044 glyphs.
8045 (insert_left_trunc_glyphs): Support GUI frames: make sure
8046 truncation glyphs overwrite enough glyphs from the current line to
8047 have sufficient space in pixels.
8048 (display_line): Support truncation and continuation glyphs on GUI
8049 frames. If some spare pixels are left on the line after inserting
8050 the truncation glyphs, fill that space with a stretch glyph of a
8051 suitably computed width.
8052
8053 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
8054 produce_glyphs, to support GUI sessions.
8055
31571fd7
PE
80562012-07-07 Paul Eggert <eggert@cs.ucla.edu>
8057
5a16b9bc
PE
8058 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
8059
f3047c75
PE
8060 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
8061
31571fd7
PE
8062 Do not require float-time's arg to fit in time_t (Bug#11825).
8063 This works better on hosts where time_t is unsigned, and where
8064 float-time is applied to the (negative) difference between two times.
8065 * editfns.c (decode_time_components): Last arg is now double *,
8066 not int *, and means to store all the result as a double, without
8067 worrying about whether the seconds part fits in time_t.
8068 All callers changed.
8069 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
8070 All callers changed.
8071 (Ffloat_time): Do not fail merely because the specified time falls
8072 outside of time_t range.
8073
4516fbef
GM
80742012-07-07 Glenn Morris <rgm@gnu.org>
8075
8076 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
8077 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
8078 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
8079
07adc2c6
JB
80802012-07-07 Juanma Barranquero <lekktu@gmail.com>
8081
8082 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
8083 Update dependencies.
8084
8085 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
8086
fd573f31
PE
80872012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8088
fee5959d
PE
8089 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
8090 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
8091 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
8092 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
8093 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
8094 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
8095
fd573f31
PE
8096 * xfont.c (compare_font_names): Redo to omit the need for casts.
8097
ddadbc0e
AS
80982012-07-06 Andreas Schwab <schwab@linux-m68k.org>
8099
fca8d6b6
AS
8100 * xfns.c (Fx_change_window_property): Doc fix.
8101 * w32fns.c (Fx_change_window_property): Doc fix.
8102
ddadbc0e
AS
8103 * w32fns.c (Fx_window_property): Accept the same arguments as the
8104 X Windows version. Doc fix.
8105 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
8106
ed9265fc 81072012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
8108 Eli Zaretskii <eliz@gnu.org>
8109
8110 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
8111 Windows-specific code from nt/config.nt moved here.
8112 Obsolete settings removed.
8113
216ee680
PE
81142012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8115
8116 * process.c: Avoid unnecessary calls to gettime.
8117 (wait_reading_process_output): Don't get the time of day
8118 when gobbling data immediately and not waiting, as there's no need
8119 for it in that case. This removes a FIXME.
8120
bdd091e4
JD
81212012-07-06 Jan Djärv <jan.h.d@swipnet.se>
8122
8123 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
8124 is defined (Bug#11768).
8125
9d44f8ce
DA
81262012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8127
8128 Fix marker debugging code.
8129 * marker.c (byte_char_debug_check): Do not perform the check
8130 if buffer is not multibyte.
090bd7cb
JB
8131 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8132 Call byte_char_debug_check with correct arguments.
9d44f8ce 8133
90fc4786
DA
81342012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8135
8136 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
8137 * marker.c (byte_char_debug_check, count_markers):
8138 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
8139 (byte_debug_flag): Remove.
8140 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
8141 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
8142
7b7ae965
DA
81432012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8144
4e57b342
DA
8145 Avoid code repetition in marker-related functions.
8146 * marker.c (attach_marker): New function.
8147 (Fset_marker, set_marker_restricted, set_marker_both)
8148 (set_marker_restricted_both): Use it.
8149 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
8150 Consistently rename charno to charpos.
8151 (marker_position): Add eassert.
8152 (marker_byte_position): Convert to eassert.
8153
81542012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8155
8156 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 8157 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 8158 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 8159
657924ff
DA
81602012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8161
8162 Introduce fast path for the widely used marker operation.
8163 * alloc.c (build_marker): New function.
8164 * lisp.h (build_marker): New prototype.
8165 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
8166 * composite.c (autocmp_chars): Likewise.
8167 * editfns.c (buildmark): Remove.
8168 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
8169 (save_restriction_save): Use build_marker.
8170 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
8171 * window.c (save_window_save): Likewise.
8172
041a49a6
DA
81732012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
8174
8175 Do not use Fdelete_overlay in delete_all_overlays
8176 to avoid redundant calls to unchain_overlay.
8177 * buffer.c (drop_overlay): New function.
8178 (delete_all_overlays, Fdelete_overlay): Use it.
8179 * minibuf.c (get_minibuffer): Fix comment.
8180
7dca65a4
PE
81812012-07-06 Paul Eggert <eggert@cs.ucla.edu>
8182
8183 Port to OpenBSD 5.1 amd64.
8184 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
8185 This is needed for OpenBSD, and should be harmless on all BSD systems.
8186 Also, include <sys/sysctl.h>, as it should be available on all
8187 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
8188 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
8189 use p_pid member, not kp_proc.pid.
8190
8eb876e2
GM
81912012-07-06 Glenn Morris <rgm@gnu.org>
8192
8193 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
8194
38182d90
PE
81952012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8196
8197 More xmalloc and related cleanup.
8198 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
8199 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
8200 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
8201 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
8202 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
8203 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
8204 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
8205 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
8206 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
8207 * xterm.c:
8208 Omit needless casts involving void * pointers and allocation.
8209 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
8210 as the former is more robust if P's type is changed.
8211 Prefer xzalloc to xmalloc + memset 0.
8212 Simplify malloc-or-realloc to realloc.
8213 Don't worry about xmalloc returning a null pointer.
8214 Prefer xstrdup to xmalloc + strcpy.
8215 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
8216 growing it.
8217 * keyboard.c (apply_modifiers_uncached): Prefer local array to
8218 alloca of a constant.
8219
6dd5a677
EZ
82202012-07-05 Eli Zaretskii <eliz@gnu.org>
8221
8222 * xdisp.c (display_line): Fix horizontal pixel coordinates when
8223 hscroll is larger than the line width. Fixes long and futile
8224 looping inside extend_face_to_end_of_line (on a TTY) producing
8225 glyphs that are not needed and thrown away.
8226
6b312f0f
DA
82272012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8228
8229 * marker.c (set_marker_restricted_both): Simplify by using
8230 clip_to_bounds.
8231
f520ef9b
PE
82322012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8233
8234 * editfns.c (region_limit): Simplify by using clip_to_bounds.
8235
383b7c95
JD
82362012-07-05 Jan Djärv <jan.h.d@swipnet.se>
8237
8238 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
8239 not defined (Bug#11768).
8240 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
8241 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
8242 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
8243 followed by gtk_box_set_homogeneous (Bug#11768).
8244 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
8245 (update_theme_scrollbar_width, xg_create_scroll_bar):
8246 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
8247 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
8248 (is_box_type): New function (Bug#11768).
8249 (xg_tool_item_stale_p): Call is_box_type.
5293d758 8250 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
8251 with default display (Bug#11768).
8252
d6e7bf45
EZ
82532012-07-05 Eli Zaretskii <eliz@gnu.org>
8254
8255 * xdisp.c (window_hscroll_limited): New function.
8256 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
8257 coordinates when window's hscroll is set to insanely large
8258 values. (Bug#11857)
8259
431391ec
JB
82602012-07-05 Juanma Barranquero <lekktu@gmail.com>
8261
8262 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
8263 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
8264
23f86fce
DA
82652012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
8266
8267 Cleanup xmalloc.
8268 * lisp.h (xzalloc): New prototype. Omit needless casts.
8269 * alloc.c (xzalloc): New function. Omit needless casts.
8270 * charset.c: Omit needless casts. Convert all calls to
8271 xmalloc with following memset to xzalloc.
8272 * dispnew.c: Likewise.
8273 * fringe.c: Likewise.
8274 * image.c: Likewise.
8275 * sound.c: Likewise.
8276 * term.c: Likewise.
8277 * w32fns.c: Likewise.
8278 * w32font.c: Likewise.
8279 * w32term.c: Likewise.
8280 * xfaces.c: Likewise.
8281 * xfns.c: Likewise.
8282 * xterm.c: Likewise.
8283 * atimer.c: Omit needless casts.
8284 * buffer.c: Likewise.
8285 * callproc.c: Likewise.
8286 * ccl.c: Likewise.
8287 * coding.c: Likewise.
8288 * composite.c: Likewise.
8289 * doc.c: Likewise.
8290 * doprnt.c: Likewise.
8291 * editfns.c: Likewise.
8292 * emacs.c: Likewise.
8293 * eval.c: Likewise.
8294 * filelock.c: Likewise.
8295 * fns.c: Likewise.
8296 * gtkutil.c: Likewise.
8297 * keyboard.c: Likewise.
8298 * lisp.h: Likewise.
8299 * lread.c: Likewise.
8300 * minibuf.c: Likewise.
8301 * msdos.c: Likewise.
8302 * print.c: Likewise.
8303 * process.c: Likewise.
8304 * region-cache.c: Likewise.
8305 * search.c: Likewise.
8306 * sysdep.c: Likewise.
8307 * termcap.c: Likewise.
8308 * terminal.c: Likewise.
8309 * tparam.c: Likewise.
8310 * w16select.c: Likewise.
8311 * w32.c: Likewise.
8312 * w32reg.c: Likewise.
8313 * w32select.c: Likewise.
8314 * w32uniscribe.c: Likewise.
8315 * widget.c: Likewise.
8316 * xdisp.c: Likewise.
8317 * xmenu.c: Likewise.
8318 * xrdb.c: Likewise.
8319 * xselect.c: Likewise.
8320
0497dc44
PE
83212012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8322
8323 * fileio.c (time_error_value): Check the right error number.
8324 Problem reported by Troels Nielsen in
8325 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8326
356e7178
PE
83272012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8328
4e71fd89
PE
8329 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8330 This should be fixed in a better way; see Eli Zaretskii in
8331 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8332 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8333
f0941253
PE
8334 * fileio.c (time_error_value): Rename from special_mtime.
8335 The old name's problems were noted by Eli Zaretskii in
8336 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8337
065c9eb4
PE
8338 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8339 This variable's comment says Emacs needs at least one GDB-visible
8340 symbol of type enum pvec_type, to work around GDB problems.
8341 The symbol's value doesn't matter.
8342
356e7178
PE
8343 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8344 that causes compilation to fail on pre-C99 compilers.
8345
ed9265fc 83462012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
8347
8348 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8349 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8350
3884d954
DA
83512012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8352
d209e2fb 8353 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
8354 headers for buffer_defaults and buffer_local_symbols.
8355 Reported by Juanma Barranquero <lekktu@gmail.com>.
8356
ee28be33
SM
83572012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8358
8359 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8360 * lisp.h (enum pvec_type): Use fewer bits.
8361 (PSEUDOVECTOR_SIZE_BITS): New constant.
8362 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8363 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8364 change in pvec_type.
8365 (PSEUDOVECTOR_TYPEP): New macro.
8366 (TYPED_PSEUDOVECTORP): Use it.
8367 * fns.c (internal_equal): Adapt code to extract pvectype.
8368 * emacs.c (gdb_pvec_type): Update type.
8369 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8370 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8371 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8372 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8373 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8374 abusing vector->header.next.nbytes.
8375 (live_vector_p): Use PVEC_TYPE.
8376 (mark_object): Adapt code to extract pvectype. Use switch.
8377
c7f2cd7f
PE
83782012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8379
8380 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8381 Tighten new eassert a bit.
8382
8ce70ed2
DA
83832012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8384
8385 Fix compilation with --enable-gcc-warnings and -O1
8386 optimization level.
8387 * doprnt.c (doprnt): Change type of tem to int, initialize
8388 to avoid compiler warning. Add eassert.
8389 * search.c (simple_search): Initialize match_byte to avoid
8390 compiler warning. Add eassert.
8391
dea7f1e5
PE
83922012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8393
24a212eb
PE
8394 Avoid weird behavior with large horizontal scrolls.
8395 Without this change, for example, large hscroll values would
8396 mess up Emacs's display on Fedora 15 x86, presumably due to
8397 overflows in int calculations in the display code.
8398 Also, if buffers had long lines, Emacs would freeze.
8399 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8400 (set_window_hscroll): New function, containing the old guts of
8401 Fset_window_hscroll. Return the clipped value.
8402 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8403 This avoids the need to check against PTRDIFF_MAX.
8404
dea7f1e5
PE
8405 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8406
76046526
DA
84072012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8408
8409 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8410
39adff0d
PE
84112012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8412
63807d47
PE
8413 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8414 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8415 since GCC 4.4.6 issues a bogus warning for them.
8416
39adff0d
PE
8417 Fix bugs in file timestamp newness comparisons.
8418 * fileio.c (Ffile_newer_than_file_p):
8419 * lread.c (Fload): Use full timestamp resolution of files,
8420 not just the 1-second resolution, so that files that are only
8421 slightly newer still count as newer.
8422 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8423 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8424
dbeed9a6
PE
84252012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8426
8427 * fileio.c: Improve handling of file time marker. (Bug#11852)
8428 (special_mtime): New function.
8429 (Finsert_file_contents, Fverify_visited_file_modtime):
8430 Use it to set special mtime values consistently.
8431
636334d6
AS
84322012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8433
8434 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8435 marker for non-existing file. (Bug#11852)
8436
e2017fe2
GM
84372012-07-03 Glenn Morris <rgm@gnu.org>
8438
8439 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8440 and did not make it into globals.h).
8441
404dbd37
TT
84422012-07-03 Tom Tromey <tromey@redhat.com>
8443
8444 * window.c (Fset_window_margins, Fset_window_fringes)
8445 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8446 * textprop.c (Fprevious_property_change): No longer static.
8447 * syntax.c (Fsyntax_table_p): No longer static.
8448 * process.c (Fget_process, Fprocess_datagram_address): No longer
8449 static.
8450 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8451 * keyboard.c (Fcommand_execute): No longer static.
8452 Remove EXFUN.
8453 * insdel.c (Fcombine_after_change_execute): No longer static.
8454 * image.c (Finit_image_library): No longer static.
8455 * fileio.c (Fmake_symbolic_link): No longer static.
8456 * eval.c (Ffetch_bytecode): No longer static.
8457 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
8458 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8459 No longer static.
404dbd37
TT
8460 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8461 static.
8462 * dired.c (Ffile_attributes): No longer static.
8463 * composite.c (Fcomposition_get_gstring): No longer static.
8464 * callproc.c (Fgetenv_internal): No longer static.
8465
8466 * ccl.h: Remove EXFUNs.
8467 * buffer.h: Remove EXFUNs.
8468 * dispextern.h: Remove EXFUNs.
8469 * intervals.h: Remove EXFUNs.
8470 * fontset.h: Remove EXFUN.
8471 * font.h: Remove EXFUNs.
8472 * dosfns.c (system_process_attributes): Remove EXFUN.
8473 * keymap.h: Remove EXFUNs.
8474 * lisp.h: Remove EXFUNs.
8475 * w32term.h: Remove EXFUNs.
8476 * window.h: Remove EXFUNs.
8477 * xsettings.h: Remove EXFUN.
8478 * xterm.h: Remove EXFUN.
8479
8e4fd1e1
GM
84802012-07-03 Glenn Morris <rgm@gnu.org>
8481
8482 * lisp.h (Frandom): Make it visible to C.
8483 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8484 buffer for invisible buffers. (Bug#1229)
8485
ca95b3eb
DA
84862012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8487
8488 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8489 values which aren't power of 2.
14ae4239 8490 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 8491 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
8492 accordingly.
8493
7555c33f
SM
84942012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8495
8496 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8497
8498 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8499
d12e8f5a
DA
85002012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8501
8502 * alloc.c (allocate_vector_block): Remove redundant
8503 calls to mallopt if DOUG_LEA_MALLOC is defined.
8504 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8505 avoid calls to mallopt if zero_vector is returned.
8506
296094c3
DA
85072012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8508
8509 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8510 is enabled, avoid dereferencing NULL current_sblock if
8511 running undumped.
8512
36429c89
DA
85132012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8514
8515 Cleanup basic buffer management.
8516 * buffer.h (struct buffer): Change layout to use generic vector
8517 marking code. Fix some comments. Change type of 'clip_changed'
8518 to bitfield. Remove unused #ifndef old.
8519 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8520 (GET_OVERLAYS_AT): Fix indentation.
8521 (for_each_per_buffer_object_at): New macro.
8522 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8523 (Fbuffer_local_variables): Use it.
8524 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8525 * alloc.c (allocate_buffer): Adjust to match new layout of
8526 struct buffer. Fix comment.
8527 (mark_overlay): New function.
8528 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8529 Lisp area of struct buffer.
8530 (mark_object): Use it. Adjust marking of misc objects
8531 and related comments.
8532
3b3e4cac
PE
85332012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8534
8535 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8536 wrapper that is not needed because the wrapped code is a no-op (zero
8537 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8538 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8539
cf5c0175
DA
85402012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8541
8542 * alloc.c (mark_buffer): Simplify. Remove prototype.
8543 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 8544 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
8545 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8546 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 8547
ca26824c
GM
85482012-06-30 Glenn Morris <rgm@gnu.org>
8549
2e4c5312
GM
8550 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8551
ca26824c
GM
8552 * epaths.in (PATH_SITELOADSEARCH): New.
8553 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8554 This is rather than relying on --enable-locallisppath elements
8555 having "site-lisp" in their names. (Bug#10208#25, 11658)
8556
0d23c240
EZ
85572012-06-30 Eli Zaretskii <eliz@gnu.org>
8558
c9240d7a
EZ
8559 * w32proc.c (sys_select): Accept and ignore one more argument.
8560
8561 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8562
0d23c240 8563 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 8564 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
8565
8566 * sysdep.c: Don't include dos.h and dosfns.h.
8567
8568 * process.c (sys_select):
8569 * msdos.c (sys_select): Accept one more argument and ignore it.
8570
8571 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8572 adapt data types and code to that.
8573
8574 * dosfns.c:
8575 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8576 which clashes with the gnulib function of the same name.
8577
af5a5a98
AS
85782012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8579
c5e4379c
AS
8580 * font.c (font_style_to_value, font_style_symbolic)
8581 (font_prop_validate_style): Add type checks for values in
8582 font_style_table.
8583
af5a5a98
AS
8584 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8585 argument.
8586 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8587 uses.
8588
8d38f461
EZ
85892012-06-29 Eli Zaretskii <eliz@gnu.org>
8590
2e5a6631
EZ
8591 * xdisp.c (try_window_id): Undo last change.
8592
8d38f461
EZ
8593 * w32.c (getwd): Adjust commentary about startup_dir.
8594 (init_environment): Always call sys_access, even in non-MSVC
8595 builds. Don't chdir to the directory of the Emacs executable.
8596 This undoes code from 1997 which was justified by the need to
8597 "avoid conflicts when removing and renaming directories". But its
8598 downside was that every relative file name was being interpreted
8599 relative to the directory of the Emacs executable, which can never
8600 be TRT. In particular, it broke sys_access when called with
8601 relative file names.
8602 (sys_access): Map GetLastError to errno.
8603
2af3565e
DA
86042012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8605
8606 * window.h (struct window): Change type of 'fringes_outside_margins'
8607 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 8608 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
8609 Adjust comment.
8610 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8611 to ptrdiff_t.
8612
c8d3a25c 86132012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 8614
c8d3a25c
GM
8615 * gnutls.c (emacs_gnutls_handshake):
8616 Add QUIT to make the loop interruptible.
57570cd3 8617
c8d3a25c 86182012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 8619
c8d3a25c
GM
8620 * charset.c (init_charset): Make lack of etc/charsets fatal.
8621
3e984ee8
DA
86222012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8623
8624 * editfns.c (region_limit): Fix type mismatch.
8625
ef884f23
DA
86262012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8627
8628 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8629 undefined. Convert from xassert to eassert.
8630 * nsmenu.m: Convert from xassert to eassert.
8631 * nsterm.m: Likewise.
8632
7d7e0027
SM
86332012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8634
8635 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8636
aa754e6a
PE
86372012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8638
8639 Avoid integer overflow on scroll-left and scroll-right.
8640 * window.c (HSCROLL_MAX): New macro.
8641 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8642 overflow when requested scroll falls outside ptrdiff_t range.
8643
80b00b08
DA
86442012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8645
8646 * window.h (struct window): Change type of 'hscroll',
8647 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8648 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8649 Adjust users accordingly.
8650 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8651 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8652 from EMACS_INT to ptrdiff_t.
8653 (make_window): Omit redundant initialization.
8654
62b2bcf6
JB
86552012-06-28 Juanma Barranquero <lekktu@gmail.com>
8656
8657 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8658
45942c7d
DA
86592012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8660
8661 * window.h (struct window): Change type of 'use_time' and
8662 'sequence_number' from Lisp_Object to int.
8663 * frame.c (make_frame): Adjust users accordingly.
8664 * print.c (print_object): Likewise.
8665 * window.c (select_window, Fwindow_use_time, make_parent_window)
8666 (make_window): Likewise.
8667
e509cfa6
DA
86682012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8669
8670 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8671 enabled with --enable-checking=[all,glyphs] configure option.
8672 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8673 adjust comments accordingly.
8674 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8675 undefined, adjust comments accordingly.
8676 * image.c: Likewise.
8677 * scroll.c: Likewise.
8678 * w32fns.c: Likewise.
8679 * w32term.c: Likewise.
8680 * xdisp.c: Likewise.
8681 * xfaces.c: Likewise.
8682 * xfns.c: Likewise.
8683 * xterm.c: Likewise.
8684
a54e2c05
DA
86852012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8686
8687 Generalize run-time debugging checks.
8688 * dispextern.h (XASSERTS): Remove.
8689 * fontset.c (xassert): Remove.
8690 Convert from xassert to eassert.
8691 * alloc.c: Convert from xassert to eassert.
8692 * bidi.c: Likewise.
8693 * dispnew.c: Likewise.
8694 * fns.c: Likewise.
8695 * fringe.c: Likewise.
8696 * ftfont.c: Likewise.
8697 * gtkutil.c: Likewise.
8698 * image.c: Likewise.
8699 * keyboard.c: Likewise.
8700 * menu.c: Likewise.
8701 * process.c: Likewise.
8702 * scroll.c: Likewise.
8703 * sound.c: Likewise.
8704 * term.c: Likewise.
8705 * w32console.c: Likewise.
8706 * w32fns.c: Likewise.
8707 * w32term.c: Likewise.
8708 * window.c: Likewise.
8709 * xdisp.c: Likewise.
8710 * xfaces.c: Likewise.
8711 * xfns.c: Likewise.
8712 * xselect.c: Likewise.
8713 * xterm.c: Likewise.
8714
1ec4b7b2
SM
87152012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8716
8717 * fns.c (maybe_resize_hash_table): Output message when growing the
8718 purify-hashtable.
8719
2014308a
DA
87202012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8721
8722 * alloc.c (allocate_string_data): Remove dead code.
8723 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8724 avoid GCC warning about unused macro.
8725
246155eb
DA
87262012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8727
8728 * alloc.c (allocate_string): Omit intervals initialization.
8729 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8730 as in make_pure_string and make_pure_c_string.
8731
43184b7b
DA
87322012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8733
d209e2fb 8734 * alloc.c (allocate_string): Fix last change.
43184b7b 8735
3fe6dd74
DA
87362012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8737
d209e2fb 8738 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
8739 to memset, add explicit initialization where appropriate.
8740
1ba6038a
GM
87412012-06-27 Glenn Morris <rgm@gnu.org>
8742
8743 * lisp.mk (lisp): Remove paths.elc.
8744
c89926a5
CY
87452012-06-27 Chong Yidong <cyd@gnu.org>
8746
8747 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8748
ed6b3510
JW
87492012-06-26 John Wiegley <johnw@newartisans.com>
8750
1ec4b7b2 8751 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
8752 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8753
ed6b3510
JW
8754 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8755 when building with Clang.
8756
8edd4a2b
SM
87572012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8758
8759 * eval.c (Fapply): Allow calling it with a single argument.
8760
f6f62d1b
EZ
87612012-06-26 Eli Zaretskii <eliz@gnu.org>
8762
8763 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8764 _stricmp and _strnicmp.
8765 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8766
62efea5e
DA
87672012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8770 allocated window.
8771 (allocate_process): Likewise for new process.
8edd4a2b 8772 (allocate_terminal): Change to use offsetof.
62efea5e
DA
8773 (allocate_frame): Likewise.
8774 * frame.c (make_frame): Omit redundant initialization.
8775 * window.c (make_parent_window): Use memset.
8776 (make_window): Omit redundant initialization.
8777 * process.c (make_process): Omit redundant initialization.
8778 * terminal.c (create_terminal): Likewise.
8779
42997f4d
DA
87802012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8781
8782 * term.c (delete_tty): Remove redundant call to memset.
8783
1130ecfc
DA
87842012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8785
8786 * alloc.c: Remove build_string.
8787 * lisp.h: Define build_string as static inline. This provides
8788 a better opportunity to optimize away calls to strlen when the
8789 function is called with compile-time constant argument.
8790 * image.c (imagemagick_error): Convert to build_string.
8791 * w32proc.c (sys_spawnve): Likewise.
8792 * xterm.c (x_term_init): Likewise.
8793
cf38a720
PE
87942012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8795
99027bdd
PE
8796 Use sprintf return value instead of invoking strlen on result.
8797 In the old days this wasn't portable, since some sprintf
8798 implementations returned char *. But they died out years ago and
8799 Emacs already assumes sprintf returns int.
8800 Similarly for float_to_string.
8801 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8802 * ccl.c (ccl_driver):
8803 * character.c (string_escape_byte8):
8804 * data.c (Fnumber_to_string):
8805 * doprnt.c (doprnt):
8806 * print.c (print_object):
8807 * xdisp.c (message_dolog):
8808 * xfns.c (syms_of_xfns):
8809 Use sprintf or float_to_string result to avoid need to call strlen.
8810 * data.c (Fnumber_to_string):
8811 Use make_unibyte_string, since the string must be ASCII.
8812 * lisp.h, print.c (float_to_string): Now returns int length.
8813 * term.c (produce_glyphless_glyph):
8814 Use sprintf result rather than recomputing it.
8815
cf38a720
PE
8816 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8817 * Makefile.in (ALL_CFLAGS):
8818 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8819 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8820
3511c784
DA
88212012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8822
0a08eb21 8823 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
8824 strcasecmp if available.
8825 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8826
fb7da12e
AS
88272012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8828
8829 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8830 Avoid comma operator.
8831 * menu.c (push_submenu_start, push_submenu_end)
8832 (push_left_right_boundary, push_menu_pane): Likewise.
8833 * msdos.c (dos_rawgetc): Likewise.
8834
afa2ffd8
DA
88352012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8836
8837 * xfns.c (xic_create_fontsetname): Remove redundant calls
8838 to memset.
8839
b3b4476b
PE
88402012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8841
4495ff38
PE
8842 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8843 sprintf already null-terminates its output.
8844
b3b4476b
PE
8845 * xfns.c (x_window): Remove redundant cast.
8846
b00876c9
DA
88472012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8848
8849 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8850 `const char *' to `char *' to avoid compiler warning.
8851
d188e26b
PE
88522012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8853
885d1d74
PE
8854 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8855 instead of truncating it to 63 (admittedly a generous limit).
8856
d188e26b
PE
8857 * process.c: Fix spelling and caps in comments.
8858
e2f560b1
DN
88592012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8860
e86db54b 8861 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
8862 * sysdep.c (setpgrp): Remove definition, not used in this file.
8863
7583a3a1
JB
88642012-06-24 Juanma Barranquero <lekktu@gmail.com>
8865
8866 * makefile.w32-in: Update dependencies.
8867
696056c2
EZ
88682012-06-24 Eli Zaretskii <eliz@gnu.org>
8869
8870 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8871 (SYSTIME_H): Add nt/inc/sys/time.h.
8872
8873 * systime.h [WINDOWSNT]: Include sys/time.h.
8874
8875 * s/ms-w32.h (struct timespec): Definition moved from
8876 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8877
845ca893
PE
88782012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8879
8880 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8881 * buffer.h (buffer_slot_type_mismatch):
8882 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8883 * eval.c (unwind_to_catch):
8884 * image.c (my_png_error, my_error_exit):
8885 * keyboard.c (quit_throw_to_read_char, user_error)
8886 (Fexit_recursive_edit, Fabort_recursive_edit):
8887 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8888 (wrong_type_argument, buffer_overflow, __executable_start)
8889 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8890 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8891 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8892 (fatal):
8893 (child_setup) [!DOS_NT]:
8894 * lread.c (end_of_file_error, invalid_syntax):
8895 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8896 * puresize.h (pure_write_error):
8897 * search.c (matcher_overflow):
8898 * sound.c (sound_perror, alsa_sound_perror):
8899 * sysdep.c, syssignal.h (croak):
8900 * term.c (maybe_fatal, vfatal):
8901 * textprop.c (text_read_only):
8902 * undo.c (user_error):
8903 * unexmacosx.c (unexec_error):
8904 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8905 Use _Noreturn rather than NO_RETURN.
8906 No need for separate decl merely because of _Noreturn.
8907 * sound.c (sound_warning, parse_sound):
8908 Remove unnecessary forward decls.
8909
f1dd8073
PE
89102012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8911
8912 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8913 * lisp.h (WAIT_READING_MAX): New macro.
8914 * dispnew.c (Fsleep_for, sit_for):
8915 * keyboard.c (kbd_buffer_get_event):
8916 * process.c (Faccept_process_output):
8917 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8918 This improves on the previous patch, which introduced a bug
8919 when time_t is unsigned and as wide as intmax_t.
8920 See <http://bugs.gnu.org/9000#51>.
8921
b82c1755
EZ
89222012-06-23 Eli Zaretskii <eliz@gnu.org>
8923
8924 * dispnew.c (sit_for, Fsleep_for):
8925 * keyboard.c (kbd_buffer_get_event):
8926 * process.c (Faccept_process_output): Avoid compiler warnings when
8927 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8928
ca300656
JB
89292012-06-23 Juanma Barranquero <lekktu@gmail.com>
8930
049ec95b
JB
8931 * makefile.w32-in: Update dependencies.
8932
ca300656
JB
8933 * w32.c (ltime): Add return type and declare static.
8934 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8935
db7b8d06
PE
89362012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8937
8938 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8939 Privately reported by Herbert J. Skuhra.
8940 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8941 All uses changed.
8942 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8943 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8944
0bd8297f
EZ
89452012-06-23 Eli Zaretskii <eliz@gnu.org>
8946
96512555
EZ
8947 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8948 last argument of make_unibyte_string.
8949
0bd8297f
EZ
8950 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8951 language ID in the event parameters.
8952
8953 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8954 event.code, not the obscure "character set ID".
8955
63def6b6
CY
89562012-06-23 Chong Yidong <cyd@gnu.org>
8957
8958 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8959
e8a02204
EZ
89602012-06-23 Eli Zaretskii <eliz@gnu.org>
8961
388cdec0
EZ
8962 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8963 * w32.c (fdutimens): New function.
8964
8965 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8966
8967 * s/ms-w32.h (pselect): Redirect to sys_select.
8968
8969 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8970
e8a02204
EZ
8971 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8972 in the logic of incrementing and decrementing the value of
8973 use_relocatable_buffers.
8974
d054f3fb
PE
89752012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8976
8977 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8978 Privately reported by Herbert J. Skuhra.
8979 [__FreeBSD__]: Remove "*/" typo after "#include".
8980 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8981 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8982 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8983 Don't assume EMACS_TIME and struct timeval are the same type.
8984
d35af63c
PE
89852012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8986
8987 Support higher-resolution time stamps (Bug#9000).
8988 The time stamps are only nanosecond-resolution at the C level,
8989 since that's the best that any real-world system supports now.
8990 But they are picosecond-resolution at the Lisp level, as that's
8991 easy, and leaves room for future OS improvements.
8992
8993 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8994 (LIBES): Use it.
8995
8996 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8997 Don't get current time unless it's needed.
8998
8999 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
9000 now provides it if it's absent.
9001 (start_atimer): Port to higher-res time stamps.
9002 Check for time stamp overflow. Don't get current time more
9003 often than is needed.
9004
9005 * buffer.h (struct buffer): Buffer modtime now has high resolution.
9006 Include systime.h, not time.h.
9007 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
9008
9009 * dired.c: Include stat-time.h.
9010 (Ffile-attributes): File times now have higher resolution.
9011
9012 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
9013 (struct image): Timestamp now has higher resolution.
9014
9015 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
9016 has at least microseconds now. All uses removed.
9017 (update_frame, update_single_window, update_window, update_frame_1)
9018 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 9019 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
9020
9021 * editfns.c (time_overflow): Now extern.
9022 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
9023 (float-time, Fformat_time_string, Fcurrent_time_string)
9024 (Fcurrent_time_zone): Accept and generate higher-resolution
9025 time stamps.
9026 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
9027 (decode_time_components, lisp_seconds_argument): New functions.
9028 (make_time): Now static.
9029 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
9030 Report an error if the time is invalid, rather than having the caller
9031 do that.
9032
9033 * fileio.c: Include <stat-time.h>
9034 (Fcopy_file): Copy higher-resolution time stamps.
9035 Prefer to set the time stamp via a file descriptor if that works.
9036 (Fset_file_times, Finsert_file_contents, Fwrite_region)
9037 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
9038 (Fvisited_file_modtime, Fset_visited_file_modtime):
9039 Support higher-resolution time stamps.
9040
9041 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
9042
9043 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
9044
9045 * image.c (prepare_image_for_display, clear_image_cache)
9046 (lookup_image): Port to higer-resolution time stamps.
9047
9048 * keyboard.c (start_polling, bind_polling_period):
9049 Check for time stamp overflow.
9050 (read_char, kbd_buffer_get_event, timer_start_idle)
9051 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
9052 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
9053 Port to higher-resolution time stamps. Do not assume time_t is signed.
9054 (decode_timer): New function. Timers are now vectors of length 9,
9055 not 8, to accommodate the picosecond component.
9056 (timer_check_2): Use it.
9057
9058 * nsterm.m (select_timeout, timeval_subtract): Remove.
9059 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
9060 as they're a bit more accurate and handle overflow better.
9061 (ns_select): Change prototype to be compatible with pselect.
9062 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
9063 * nsterm.h (ns_select): Adjust prototype.
9064
9065 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
9066 us-resolution time stamps.
9067 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
9068
9069 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
9070
9071 * lisp.h (time_overflow): New decl.
9072 (wait_reading_process_output): First arg is now intmax_t, not int,
9073 to accommodate larger waits.
9074
9075 * process.h (struct Lisp_Process.read_output_delay):
9076 Now counts nanoseconds, not microseconds.
9077 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
9078 EMACS_HAS_USECS.
9079 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
9080 (wait_reading_process_output):
9081 Port to ns-resolution time stamps.
9082 (Faccept_process_output, wait_reading_process_output):
9083 Check for time stamp overflow. Do not assume time_t is signed.
9084 (select_wrapper): Remove; we now use pselect.
9085 (Fprocess_attributes): Now generates ns-resolution time stamps.
9086
9087 * sysdep.c: Include utimens.h. Don't include utime.h
9088 or worry about struct utimbuf; gnulib does that for us now.
9089 (gettimeofday): Remove; gnulib provides a substitute.
9090 (make_timeval): New function.
9091 (set_file_times): Now sets ns-resolution time stamps.
9092 New arg FD; all uses changed.
9093 (time_from_jiffies, ltime_from_jiffies, get_up_time)
9094 (system_process_attributes):
9095 Now returns ns-resolution time stamp. All uses changed.
9096 Check for time stamp overflow.
9097
9098 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
9099 provides a substitute now.
9100
9101 * systime.h: Include timespec.h rather than sys/time.h and time.h,
9102 since it guarantees struct timespec.
9103 (EMACS_TIME): Now struct timespec, so that we can support
9104 ns-resolution time stamps.
9105 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
9106 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
9107 (EMACS_USECS): Remove.
9108 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
9109 so multiply the arg by 1000 before storing it.
9110 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
9111 New macros.
9112 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
9113 Port to ns-resolution time stamps.
9114 (EMACS_TIME_NEG_P): Remove; replaced by....
9115 (EMACS_TIME_SIGN): New macro.
9116 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
9117 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
9118 (set_file_times, make_time, lisp_time_argument): Adjust signature.
9119 (make_timeval, make_lisp_time, decode_time_components): New decls.
9120 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
9121 that it mishandled time_t overflow. You can't compare by subtracting!
9122 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
9123 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
9124
9125 * term.c: Include <sys/time.h>.
9126 (timeval_to_Time): New function, for proper overflow wraparound.
9127 (term_mouse_position, term_mouse_click): Use it.
9128
9129 * undo.c (record_first_change): Support higher-resolution time stamps
9130 in the undo buffer.
9131 (Fprimitive_undo): Use them when restoring time stamps.
9132
9133 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
9134 (w32_get_internal_run_time):
9135 Port to higher-resolution Emacs time stamps.
9136 (ltime): Now accepts single 64-bit integer, as that's more convenient
9137 for callers.
9138
9139 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
9140
9141 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
9142 for compatibility with pselect. Support ns-resolution time stamps.
9143
9144 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
9145
9146 * xselect.c (wait_for_property_change, x_get_foreign_selection):
9147 Check for time stamp overflow, and support ns-resolution time stamps.
9148
9149 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
9150 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
9151 (timeval_subtract): Remove; no longer needed.
9152 (XTflash, XTring_bell, x_wait_for_event):
9153 Port to ns-resolution time stamps. Don't assume time_t is signed.
9154
b6a92dfe
CY
91552012-06-22 Chong Yidong <cyd@gnu.org>
9156
9157 * xdisp.c (x_consider_frame_title): Revert last change.
9158
d251c37c
EZ
91592012-06-22 Eli Zaretskii <eliz@gnu.org>
9160
9161 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
9162 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
9163 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
9164 staticidx goes up to 1597 out of 1600 = 0x640.)
9165
f10deafb
PE
91662012-06-20 Paul Eggert <eggert@cs.ucla.edu>
9167
9168 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
9169 Otherwise, the umask might be mistakenly 0 while handling input signals.
9170
ec6de1e2
SM
91712012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
9172
9173 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
9174
28be1ada
DA
91752012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
9176
9177 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
9178 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
9179 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
9180 access to `contents' member of Lisp_Vector objects with AREF and ASET
9181 where appropriate.
9182
c6bf3022
CY
91832012-06-19 Chong Yidong <cyd@gnu.org>
9184
9185 * frame.c (delete_frame): When selecting a frame on a different
9186 text terminal, do not alter the terminal's top-frame.
9187
9188 * xdisp.c (format_mode_line_unwind_data): Record the target
9189 frame's selected window and its terminal's top-frame.
9190 (unwind_format_mode_line): Restore them.
9191 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
9192 Callers changed.
9193 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
9194 since tty frames can be explicitly named.
9195 (prepare_menu_bars): Likewise.
9196
9197 * term.c (Ftty_top_frame): New function.
9198
defd4196
PE
91992012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9200
9201 Port byte-code-meter to modern targets.
9202 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
9203 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 9204 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
9205 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
9206 (METER_1, METER_2): Simplify.
9207
1053a871
SM
92082012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
9209
9210 * data.c (Fdefalias): Return `symbol' (bug#11686).
9211
b7e8d081
MR
92122012-06-18 Martin Rudalics <rudalics@gmx.at>
9213
9214 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
9215 gets killed during executing of this function (Bug#11665).
9216 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
9217 (Vkill_buffer_query_functions): In doc-string say that functions
9218 run by this hook should not change the current buffer.
9219
7ea2b339
PE
92202012-06-18 Paul Eggert <eggert@cs.ucla.edu>
9221
9222 Fix recently-introduced process.c problems found by static checking.
9223 * process.c (write_queue_push, write_queue_pop, send_process):
9224 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
9225 (write_queue_pop): Fix pointer signedness problem.
9226 (send_process): Remove unused local.
9227
96a313a1
CY
92282012-06-17 Chong Yidong <cyd@gnu.org>
9229
9230 * xdisp.c (redisplay_internal): No need to redisplay terminal
9231 frames that are not on top.
9232
20ca2e94
TN
92332012-06-17 Troels Nielsen <bn.troels@gmail.com>
9234
9235 * process.c (make_process): Initialize write_queue.
9236 (write_queue_push, write_queue_pop): New functions.
9237 (send_process): Use them to maintain correct ordering of process
9238 writes (Bug#10815).
9239
9a900ca9
PE
92402012-06-17 Paul Eggert <eggert@cs.ucla.edu>
9241
310fbfa8
PE
9242 * lisp.h (eassert): Assume C89 or later.
9243 This removes the need for CHECK.
9244 (CHECK): Remove. Its comments about always evaluating its
9245 argument were confusing, as 'eassert' typically does not evaluate
9246 its argument.
9247
27bb1ca4
PE
9248 * coding.c (produce_chars): Use ptrdiff_t, not int.
9249
9a900ca9
PE
9250 * xterm.c (x_draw_underwave): Check for integer overflow.
9251 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
9252
41b7f8bc 92532012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
9254
9255 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
9256 referenced (Bug#11583).
9257
9b0e3eba
AA
92582012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
9259
9260 Implement wave-style variant of underlining.
9261 * dispextern.h (face_underline_type): New enum.
9262 (face): Add field for underline type.
9263 * nsterm.m (ns_draw_underwave): New function.
9264 (ns_draw_text_decoration): Use it.
9265 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
9266 New functions.
9267 (x_draw_glyph_string): Use them.
9268 * xfaces.c (Qline, Qwave): New Lisp objects.
9269 (check_lface_attrs, merge_face_ref)
1053a871
SM
9270 (Finternal_set_lisp_face_attribute, realize_x_face):
9271 Handle wave-style underline face attributes.
9b0e3eba
AA
9272 * xterm.c (x_draw_underwave): New function.
9273 (x_draw_glyph_string): Use it.
9274
0fb52f11
JB
92752012-06-16 Juanma Barranquero <lekktu@gmail.com>
9276
9277 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9278 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9279 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9280 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9281 ($(BLD)/w32select.$(O)): Update dependencies.
9282
e5560ff7
AS
92832012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9284
9285 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9286 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9287 * character.c (_fetch_multibyte_char_p): Remove.
9288 * alloc.c: Include "character.h" before "buffer.h".
9289 * bidi.c: Likewise.
9290 * buffer.c: Likewise.
9291 * bytecode.c: Likewise.
9292 * callint.c: Likewise.
9293 * callproc.c: Likewise.
9294 * casefiddle.c: Likewise.
9295 * casetab.c: Likewise.
9296 * category.c: Likewise.
9297 * cmds.c: Likewise.
9298 * coding.c: Likewise.
9299 * composite.c: Likewise.
9300 * dired.c: Likewise.
9301 * dispnew.c: Likewise.
9302 * doc.c: Likewise.
9303 * dosfns.c: Likewise.
9304 * editfns.c: Likewise.
9305 * emacs.c: Likewise.
9306 * fileio.c: Likewise.
9307 * filelock.c: Likewise.
9308 * font.c: Likewise.
9309 * fontset.c: Likewise.
9310 * fringe.c: Likewise.
9311 * indent.c: Likewise.
9312 * insdel.c: Likewise.
9313 * intervals.c: Likewise.
9314 * keyboard.c: Likewise.
9315 * keymap.c: Likewise.
9316 * lread.c: Likewise.
9317 * macros.c: Likewise.
9318 * marker.c: Likewise.
9319 * minibuf.c: Likewise.
9320 * nsfns.m: Likewise.
9321 * nsmenu.m: Likewise.
9322 * print.c: Likewise.
9323 * process.c: Likewise.
9324 * regex.c: Likewise.
9325 * region-cache.c: Likewise.
9326 * search.c: Likewise.
9327 * syntax.c: Likewise.
9328 * term.c: Likewise.
9329 * textprop.c: Likewise.
9330 * undo.c: Likewise.
9331 * unexsol.c: Likewise.
9332 * w16select.c: Likewise.
9333 * w32fns.c: Likewise.
9334 * w32menu.c: Likewise.
9335 * window.c: Likewise.
9336 * xdisp.c: Likewise.
9337 * xfns.c: Likewise.
9338 * xmenu.c: Likewise.
9339 * xml.c: Likewise.
9340 * xselect.c: Likewise.
9341
2f07e6af
EZ
93422012-06-16 Eli Zaretskii <eliz@gnu.org>
9343
1053a871
SM
9344 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9345 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 9346 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
9347 row.
9348 (handle_face_prop): Use chunk-relative overlay string index when
9349 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
9350 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9351 the rightmost. (Bug#11720)
2f07e6af 9352
29b83cec
AS
93532012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9354
9355 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9356 (CATEGORY_MEMBER): Enforce 1/0 value.
9357 * category.c (_temp_category_set): Remove.
9358
4c5501e9
EZ
93592012-06-16 Eli Zaretskii <eliz@gnu.org>
9360
9361 * window.c (Fdelete_other_windows_internal)
9362 (Fdelete_window_internal): Don't access frame's mouse highlight
9363 info of the initial frame. (Bug#11677)
9364
2b570124
PE
93652012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9366
e93864f9
PE
9367 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9368 Assume USE_2_TAGS_FOR_INTS.
9369 (xreload): Adjust $tagmask width to match recent lisp.h change.
9370
2b570124
PE
9371 Simplify lisp.h in minor ways that should not affect code.
9372 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9373 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9374 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9375 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9376 (INTTYPEBITS): New macro, for clarity.
9377 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
9378 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9379 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
9380 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9381 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9382
81755f69
JB
93832012-06-13 Juanma Barranquero <lekktu@gmail.com>
9384
9385 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9386
16192a57
GM
93872012-06-13 Glenn Morris <rgm@gnu.org>
9388
9389 * s/bsd-common.h (BSD4_3):
9390 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9391
646b5f55
AS
93922012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9393
9394 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9395 instead of union.
9396 (XLI, XIL): Define.
1053a871
SM
9397 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9398 Use them.
9399 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 9400 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 9401 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
9402 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9403 * frame.c (delete_frame): Remove outdated comment.
9404 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9405 USE_LISP_UNION_TYPE.
9406 (Fw32_unregister_hot_key): Likewise.
9407 (Fw32_toggle_lock_key): Likewise.
9408 * w32menu.c (add_menu_item): Likewise.
9409 (w32_menu_display_help): Use XIL instead of checking
9410 USE_LISP_UNION_TYPE.
9411 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9412 (init_heap): Likewise.
9413 * w32term.c (w32_read_socket): Update comment.
9414
1d3823c9
GM
94152012-06-13 Glenn Morris <rgm@gnu.org>
9416
c62ff706
GM
9417 * s/usg5-4-common.h, src/s/unixware.h:
9418 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9419
1d3823c9
GM
9420 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9421
bfe3e0a2
PE
94222012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9423
9424 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9425 * alloc.c (make_number) [!defined make_number]:
9426 Remove, as lisp.h always defines this now.
9427 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9428 (roundup_size): Verify that it is a power of 2.
9429 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9430 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9431 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9432 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9433 USE_LSB_TAG now is always defined to be either 0 or 1.
9434 All uses changed.
9435 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9436 code works fine either way, and efficiency is not a concern here,
9437 as the union type is for debugging, not for production.
9438 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9439 Use an inline function on all platforms when using the union type,
9440 since this is simpler and 'static inline' can be used portably
9441 within Emacs now.
9442 (LISP_INITIALLY_ZERO): New macro.
9443 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9444 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9445
45fa9c0f
GM
94462012-06-12 Glenn Morris <rgm@gnu.org>
9447
b4492cba
GM
9448 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9449
9450 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 9451
45fa9c0f
GM
9452 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9453 Move BROKEN_SIGIO to configure.
9454
9455 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9456 Move NO_TERMIO to configure.
9457
0e25d334
CY
94582012-06-12 Chong Yidong <cyd@gnu.org>
9459
9460 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9461 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9462 MagickExportImagePixels is undefined.
9463
43682bb6
PE
94642012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9465
9466 * image.c (imagemagick_load_image): Remove unused label.
9467
a9be7d2b
GM
94682012-06-11 Glenn Morris <rgm@gnu.org>
9469
9470 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9471 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9472 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9473 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9474
3017f87f
SM
94752012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9476
9477 * alloc.c (make_byte_code): New function.
9478 (Fmake_byte_code): Use it. Don't purify here.
9479 * lread.c (read1): Use it as well to avoid extra allocation.
9480
1b9b4cf4
CY
94812012-06-11 Chong Yidong <cyd@gnu.org>
9482
9483 * image.c (imagemagick_load_image): Implement transparency.
9484
95988fcf
AS
94852012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9486
9487 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9488 account for preceding backslashes. (Bug#11663)
9489
cd4eb164
CY
94902012-06-09 Chong Yidong <cyd@gnu.org>
9491
9492 * term.c: Support italics in capable terminals (Bug#9652).
9493 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9494 (turn_on_face): Output using TS_enter_italic_mode if available.
9495 Don't handle unused blinking and alt-charset cases.
9496 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9497 and tty_alt_charset_p cases.
9498 (tty_capable_p, init_tty): Support italics.
9499
9500 * termchar.h (struct tty_display_info): Add field for italics.
9501 Remove unused blink field.
9502
9503 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9504 Handle slant.
9505
9506 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9507 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9508 tty_alt_charset_p. Add tty_italic_p.
9509
ff88beb8
MA
95102012-06-09 Michael Albinus <michael.albinus@gmx.de>
9511
9512 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9513 dbus_type_is_basic if available.
9514 (xd_extract_signed, xd_extract_unsigned): Rename from
9515 extract_signed and extract_unsigned, respectively. Adapt callers.
9516
44286096
CY
95172012-06-09 Chong Yidong <cyd@gnu.org>
9518
1682701f
CY
9519 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9520
44286096
CY
9521 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9522 case (Bug#9752).
9523
d86feb17
PE
95242012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9525
9526 * xdisp.c (vmessage): Treat frame message as multibyte.
9527 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9528 would generate the diagnostic "Making \302\247 buffer-local while
9529 let-bound!".
9530
d5c20fe8
EZ
95312012-06-08 Eli Zaretskii <eliz@gnu.org>
9532
9533 * dispnew.c (showing_window_margins_p): Undo last change, which
9534 was done due to an inadvertent commit.
9535 (adjust_frame_glyphs_for_frame_redisplay): Do call
9536 showing_window_margins_p.
9537
513749ee
SM
95382012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9539
9540 * eval.c (Fmake_var_non_special): New primitive.
9541 (syms_of_eval): Defsubr it.
9542 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9543
d4a8f5c1
JB
95442012-06-08 Juanma Barranquero <lekktu@gmail.com>
9545
9546 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9547 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9548
8bbbc977
EZ
95492012-06-08 Eli Zaretskii <eliz@gnu.org>
9550
9551 * alloc.c (allocate_vectorlike): Fix last change.
9552
f3372c87
DA
95532012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9554
9555 Block-based vector allocation of small vectors.
9556 * lisp.h (struct vectorlike_header): New field `nbytes',
9557 adjust comment accordingly.
9558 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 9559 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
9560 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9561 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9562 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9563 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9564 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9565 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9566 (roundup_size): New constant.
9567 (struct vector_block): New data type.
9568 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 9569 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
9570 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9571 (sweep_vectors): New functions.
9572 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 9573 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
9574 or equal to VBLOCK_BYTES_MAX.
9575 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9576 (init_alloc_once): Add call to init_vectors.
9577
4f18a4ed
SM
95782012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9579
9580 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9581
86f158bc
PE
95822012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9583
9584 * doprnt.c (doprnt): Truncate multibyte char correctly.
9585 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9586 would mishandle a string argument "Xc" if X was a multibyte
9587 character of length 2: it would truncate after X's first byte
9588 rather than including all of X.
9589
c5cfcbe0
CY
95902012-06-06 Chong Yidong <cyd@gnu.org>
9591
9592 * buffer.c (word_wrap): Doc fix.
9593
c05cf390
PE
95942012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9595
9596 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9597
0c3461de
GM
95982012-06-03 Glenn Morris <rgm@gnu.org>
9599
9600 * xdisp.c (tool-bar-style): Doc fix.
9601
c71232db
UM
96022012-06-03 Ulrich Müller <ulm@gentoo.org>
9603
9604 * Makefile.in (PAXCTL): Define.
9605 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9606 binary via PaX flags if the paxctl utility is available.
9607 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9608 Restore PaX flags to their default. (Bug#11398)
9609
383f7350
CY
96102012-06-03 Chong Yidong <cyd@gnu.org>
9611
9612 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9613 buffer (Bug#11226).
9614
5f2c76c6
CY
96152012-06-03 Chong Yidong <cyd@gnu.org>
9616
9617 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9618 (note_mode_line_or_margin_highlight): If there is no help echo,
9619 use mode-line-default-help-echo. Handle the case where the mouse
9620 position is past the end of the mode line string.
9621
9622 * buffer.c (buffer_local_value_1): New function, split from
9623 Fbuffer_local_value; can return Qunbound.
9624 (Fbuffer_local_value): Use it.
9625 (Vmode_line_format): Docstring tweaks.
9626
773d47f6
PE
96272012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9628
9629 * sysdep.c (system_process_attributes): Improve comment.
9630
f2d6a3df
SM
96312012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9632
9633 * keyboard.c: Export real-this-command to Elisp.
9634 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9635 and DEFVAR it. Update all users.
9636
63810350
PE
96372012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9638
7bd5c1f4
PE
9639 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9640
63810350
PE
9641 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9642 Convert pctcpu and pctmem to Lisp float properly.
9643 Let the compiler fold better, as 100.0/0x8000 is exact.
9644
a2821611
AS
96452012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9646
9647 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9648 cons_block.
9649
5fceba1d
PE
96502012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9651
9652 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9653
c98ff5dd
DA
96542012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9655
9656 For a 'struct window', replace some Lisp_Object fields to
9657 bitfields where appropriate, remove unused fields.
9658 * window.h (struct window): Remove unused 'last_mark_x' and
9659 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 9660 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
9661 Change type of 'force_start', 'optional_new_start',
9662 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 9663 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 9664
ca34e0be
PE
96652012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9666
9667 Pacify gcc -Wdouble-precision when using Xaw.
9668 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9669 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9670 Use 'float' consistently, rather than 'float' in most places
9671 and 'double' in a couple of places.
9672
efc00ab1 96732012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
9674
9675 * xdisp.c (handle_stop): Detect whether we have overlay strings
9676 loaded by testing it->current.overlay_string_index to be
9677 non-negative, instead of checking whether n_overlay_strings is
9678 positive. (Bug#11587)
9679
efc00ab1 96802012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
9681
9682 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9683
9684 * doc.c (Fsubstitute_command_keys): Doc fix.
9685
efc00ab1 96862012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
9687
9688 * search.c (search_buffer): Remove calls to
9689 r_alloc_inhibit_buffer_relocation, as it is now called by
9690 maybe_unify_char, which was the cause of relocation of buffer text
9691 in bug#11519.
9692
efc00ab1 96932012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
9694
9695 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9696 for the duration of call to load_charset, to avoid problems with
9697 callers of maybe_unify_char that access buffer text through C
9698 pointers.
9699
9700 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9701 decrement the inhibition flag, instead of just setting or
9702 resetting it.
9703
ba93a187
PE
97042012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9705
9706 Remove obsolete '#define static' cruft.
9707 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9708 This #undef was "temporary" in 2000; it is no longer needed
9709 now that '#define static' has gone away.
9710 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9711 (gray_bitmap_bits): Remove; no longer needed.
9712 All uses replaced with definiens.
9713 * xterm.c: Include "bitmaps/gray.xbm".
9714
9e4bf381
PE
97152012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9716
9717 Clean up __executable_start, monstartup when --enable-profiling.
9718 The following changes affect the code only when profiling.
9719 * dispnew.c (__executable_start): Rename from safe_bcopy.
9720 Define only on platforms that need it.
9721 * emacs.c: Include <sys/gmon.h> when profiling.
9722 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9723 (__executable_start): Remove decl, since lisp.h does it now.
9724 (safe_bcopy): Remove decl; no longer has that name.
9725 (main): Coalesce #if into single bit of code, for simplicity.
9726 Cast pointers to uintptr_t, since standard libraries want integers
9727 and not pointers.
9728 * lisp.h (__executable_start): New decl.
9729
32d72c2f
GM
97302012-05-31 Glenn Morris <rgm@gnu.org>
9731
9732 * image.c (Fimagemagick_types): Doc fix.
9733
baac5bc7
JM
97342012-05-30 Jim Meyering <meyering@redhat.com>
9735
9736 * callproc.c (Fcall_process_region): Include directory component
9737 in mkstemp error message (Bug#11586).
9738
72cb32cf
PE
97392012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9740
9741 * alloc.c, lisp.h (make_pure_vector): Now static.
9742
61b108cc
SM
97432012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9744
9745 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9746 Move to byte-run.el.
9747 (Fautoload): Do the hash-doc more carefully.
9748 * data.c (Fdefalias): Purify definition, except for keymaps.
9749 (Qdefun): Move from eval.c.
9750 * lisp.h (Qdefun): Remove.
9751 * lread.c (read1): Tiny simplification.
9752
471fe23d
TN
97532012-05-29 Troels Nielsen <bn.troels@gmail.com>
9754
934f3f58 9755 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
9756 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9757 Bug#9642, but explicitly check that the buffer the overlay would
9758 be moved to is live and rearrange lines to make sure that errors
9759 will not put the overlay in an inconsistent state.
9760 (Fdelete_overlay): Cosmetics.
9761
85d0efd1
EZ
97622012-05-28 Eli Zaretskii <eliz@gnu.org>
9763
9764 * w32term.c (my_bring_window_to_top): New function.
9765 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
9766 could be different from the original one.
9767 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
9768 (Bug#11513)
9769
9770 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9771 by calling BringWindowToTop.
9772
9773 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9774 (WM_EMACS_END): Increase by one.
9775
da92a98c
PE
97762012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9779 This avoids undefined behavior that might cause the eassert
9780 to not catch an out-of-range value.
9781
74d1f848
JB
97822012-05-28 Juanma Barranquero <lekktu@gmail.com>
9783
9784 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9785 Update dependencies.
9786
9e1a06fc
EZ
97872012-05-27 Eli Zaretskii <eliz@gnu.org>
9788
9789 * bidi.c (bidi_mirror_char): Fix last change.
9790
f3dd7312
AS
97912012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9792
9793 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9794 when referring to sectname field in printf format.
9795
81899c91
PE
97962012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9797
57b81a9f
PE
9798 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9799 Only r_alloc_inhibit_buffer_relocation needed to be added;
9800 the others were already declared.
9801
81899c91
PE
9802 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9803 before checking whether it's out of range. Put the check inside
9804 eassert. See
9805 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9806
33017faf 98072012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
9808
9809 * callproc.c (Fcall_process): Restore a line that was accidentally
9810 commented out in the 2011-02-13 change (bug#11547).
9811
33017faf 98122012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
9813
9814 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9815 defined on ralloc.c.
9816
9817 * buffer.c [REL_ALLOC]: Remove prototypes of
9818 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9819 they are now on lisp.h.
9820
9821 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9822
9823 * search.c (search_buffer): Use it to inhibit relocation of buffer
9824 text while re_search_2 is doing its job, because re_search_2 is
9825 passed C pointers to buffer text. (Bug#11519)
9826
23415acf
EZ
9827 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9828 Update value to 24.
9829
44e27368
EZ
9830 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9831 state after an additional call to move_it_in_display_line_to, keep
9832 the values of it->max_ascent and it->max_descent found for the
9833 entire line.
9834 (pos_visible_p): Revert the comparison against bottom_y to what it
9835 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9836 (Bug#11464)
9837
c1892f11
PE
98382012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9839
9840 Fix coding-related core dumps with gcc -ftrapv.
9841 The code was computing A - B, where A and B are pointers, and B is
9842 random garbage. This can lead to core dumps on platforms that
9843 have special pointer registers, and it also leads to core dumps on
9844 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9845 A - B only when B is initialized properly.
9846 * coding.c (coding_set_source, coding_set_destination): Return void.
9847 (coding_change_source, coding_change_destinations): New functions,
9848 with the old behaviors of coding_set_source and coding_set_destination.
9849 All callers that need an offset changed to use these new functions.
9850
eb7afdad
GM
98512012-05-26 Glenn Morris <rgm@gnu.org>
9852
9853 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9854
f12fdf02
EZ
98552012-05-26 Eli Zaretskii <eliz@gnu.org>
9856
53a63be6 9857 Extend mouse support on W32 text-mode console.
61b108cc
SM
9858 * xdisp.c (draw_row_with_mouse_face):
9859 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 9860
eb3f6f01 9861 * w32console.c: Include window.h.
61b108cc
SM
9862 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9863 New functions.
eb3f6f01
EZ
9864 (initialize_w32_display): Initialize mouse-highlight data.
9865
53a63be6
EZ
9866 * w32inevt.c: Include termchar.h and window.h.
9867 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9868 moves, call note_mouse_highlight. If help_echo changed, call
9869 gen_help_event to produce help-echo message in the echo area.
9870 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9871 highlight info.
9872
4cfd81f6
PE
98732012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9874
9875 * lread.c (read1): Simplify slightly to avoid an overflow warning
9876 with GCC 4.7.0 on x86-64.
9877
4446092a
EZ
98782012-05-26 Eli Zaretskii <eliz@gnu.org>
9879
9880 * bidi.c (bidi_mirror_char): Revert last change: an int is
9881 definitely wide enough here.
9882
42b2a986 98832012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 9884
42b2a986 9885 Fix integer width and related bugs (Bug#9874).
eb106a49 9886 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
9887 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9888 (string_bytes, check_sblock, allocate_string_data):
9889 (compact_small_strings, Fmake_bool_vector, make_string)
9890 (make_unibyte_string, make_multibyte_string)
9891 (make_string_from_bytes, make_specified_string)
9892 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9893 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9894 (mark_vectorlike):
9895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9896 (allocate_pseudovector):
9897 Use int, not EMACS_INT, where int is wide enough.
9898 (inhibit_garbage_collection, Fgarbage_collect):
9899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9900 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9901 int might not be wide enough.
9902 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9903 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9904 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9905 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9906 (bidi_level_of_next_char, bidi_move_to_visually_next):
9907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9908 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9909 (Fkill_buffer, Fset_buffer_major_mode)
9910 (advance_to_char_boundary, Fbuffer_swap_text)
9911 (Fset_buffer_multibyte, overlays_at, overlays_in)
9912 (overlay_touches_p, struct sortvec, record_overlay_string)
9913 (overlay_strings, recenter_overlay_lists)
9914 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9915 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9916 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9917 (Foverlay_recenter, last_overlay_modification_hooks_used)
9918 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
9920 (validate_region): Omit unnecessary test for b <= e,
9921 since that's guaranteed by the previous test.
d311d28c
PE
9922 (adjust_overlays_for_delete): Avoid pos + length overflow.
9923 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9924 (report_overlay_modification):
9925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9926 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9927 Omit pointer cast, which isn't needed anyway, and doesn't work
9928 after the EMACS_INT -> ptrdiff_t change.
02481186 9929 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
9930 * buffer.h: Adjust decls to match defn changes elsewhere.
9931 (struct buffer_text, struct buffer):
9932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9933 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
9934 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9935 not int, to avoid needless 32-bit limit on 64-bit hosts.
9936 (exec_byte_code): Use tighter memory-full test, one that checks
9937 for alloca overflow. Don't compute the address of the object just
9938 before an array, as that's not portable. Use EMACS_INT, not
9939 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
9940 * callint.c (Fcall_interactively):
9941 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9942 * callproc.c (call_process_kill, Fcall_process):
9943 Don't assume pid_t fits into an Emacs fixnum.
9944 (call_process_cleanup, Fcall_process, child_setup):
9945 Don't assume pid_t fits into int.
9946 (call_process_cleanup, Fcall_process, delete_temp_file)
9947 (Fcall_process_region):
9948 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9949 (Fcall_process): Simplify handling of volatile integers.
9950 Use int, not EMACS_INT, where int will do.
9951 * casefiddle.c (casify_object, casify_region, operate_on_word)
9952 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9953 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9954 (casify_object): Avoid integer overflow when overallocating buffer.
9955 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 9956 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
9957 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9958 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9959 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9960 integers are now checked earlier. All uses replaced with XINT.
9961 (ccl_driver):
9962 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9963 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
9964 (ccl_driver, Fregister_code_conversion_map):
9965 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
9966 (resolve_symbol_ccl_program): Check that vector header is in range.
9967 Always copy the vector, so that we can check its contents reliably
9968 now rather than having to recheck each instruction as it's being
9969 executed. Check that vector words fit in 'int'.
9970 (ccl_get_compiled_code, Fregister_ccl_program)
9971 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9972 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9973 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9974 contents are in range.
9975 (Fccl_execute_on_string): Check that status is in range.
9976 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9977 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9978 Accept and return EMACS_INT, not int, because callers can pass values
9979 out of 'int' range.
9980 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9981 (multibyte_chars_in_text, parse_str_as_multibyte)
9982 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9983 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9984 (string_escape_byte8, Fget_byte):
9985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 9986 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
9987 avoid mishandling large integers.
9988 * character.h: Adjust decls to match defn changes elsewhere.
9989 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9990 (Ffind_charset_region):
9991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9992 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9993 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 9994 Don't assume fixnum fits in int.
d311d28c
PE
9995 (load_charset_map_from_vector, Fmap_charset_chars):
9996 Remove now-unnecessary CHECK_NATNUMs.
9997 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
9998 Don't rely on undefined behavior with signed left shift overflow.
9999 Don't assume unsigned int fits into fixnum, or that fixnum fits
10000 into unsigned int. Don't require max_code to be a valid fixnum;
10001 that's not true for gb10830 4-byte on a 32-bit host. Allow
10002 invalid_code to be a cons, for the same reason. Require code_offset
10003 to be a character. Avoid int overflow if max_char is close
10004 to INT_MAX.
10005 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
10006 this is intended anyway and avoids some undefined behavior.
10007 (load_charset_map): Pass unsigned, not int, as 2nd arg of
10008 INDEX_TO_CODE_POINT, as that's what it expects.
10009 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
10010 * charset.h (DECODE_CHAR): Return int, not unsigned;
10011 this is what was intended anyway, and it avoids undefined behavior.
10012 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
10013 integer-overflow issues.
10014 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
10015 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
10016 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
10017 * chartab.c (Fmake_char_table, Fset_char_table_range)
10018 (uniprop_get_decoder, uniprop_get_encoder):
10019 Don't assume fixnum fits in int.
10020 * cmds.c (move_point): New function, that does the gist of
10021 Fforward_char and Fbackward_char, but does so while checking
10022 for integer overflow more accurately.
c96e5d6a 10023 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
10024 (Fforward_line, Fend_of_line, internal_self_insert)
10025 (internal_self_insert):
10026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10027 Fix a FIXME, by checking for integer overflow when calculating
10028 target_clm and actual_clm.
10029 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 10030 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
10031 (ASSURE_DESTINATION, coding_alloc_by_realloc)
10032 (coding_alloc_by_making_gap, alloc_destination)
10033 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
10034 (encode_coding_utf_16, detect_coding_emacs_mule)
10035 (decode_coding_emacs_mule, encode_coding_emacs_mule)
10036 (detect_coding_iso_2022, decode_coding_iso_2022)
10037 (encode_invocation_designation, encode_designation_at_bol)
10038 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10039 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
10040 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
10041 (encode_coding_ccl, encode_coding_raw_text)
10042 (detect_coding_charset, decode_coding_charset)
10043 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
10044 (produce_composition, produce_charset, produce_annotation)
10045 (decode_coding, handle_composition_annotation)
10046 (handle_charset_annotation, consume_chars, decode_coding_gap)
10047 (decode_coding_object, encode_coding_object, detect_coding_system)
10048 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
10049 (code_convert_region, code_convert_string)
8f50130c
PE
10050 (Fdefine_coding_system_internal)
10051 (coding_set_source, coding_set_destination):
d311d28c
PE
10052 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10053 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
10054 (Fdefine_coding_system_internal):
10055 Don't assume fixnums fit in int.
10056 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 10057 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
10058 (Funencodable_char_position, Fcheck_coding_systems_region)
10059 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 10060 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 10061 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 10062 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 10063 Don't access memory outside of the args array.
d311d28c 10064 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
10065 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
10066 result of ENCODE_CHAR.
d311d28c
PE
10067 * coding.h: Adjust decls to match defn changes elsewhere.
10068 (struct coding_system):
10069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10070 * composite.c (get_composition_id, find_composition)
10071 (run_composition_function, update_compositions)
10072 (compose_text, composition_gstring_put_cache)
10073 (composition_gstring_p, composition_gstring_width)
10074 (fill_gstring_header, fill_gstring_body, autocmp_chars)
10075 (composition_compute_stop_pos, composition_reseat_it)
10076 (composition_update_it, struct position_record)
10077 (find_automatic_composition, composition_adjust_point)
10078 (Fcomposition_get_gstring, Ffind_composition_internal):
10079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10080 (update_compositions):
10081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10082 * composite.h: Adjust decls to match defn changes elsewhere.
10083 (struct composition):
10084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10085 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
10086 Do not attempt to compute the address of the object just before a
10087 buffer; this is not portable.
10088 (Faref, Faset):
10089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10090 (Faset): Use int, not EMACS_INT, where int is wide enough.
10091 (Fstring_to_number): Don't assume fixnums fit in int.
10092 (Frem): Don't assume arg is nonnegative.
10093 * dbusbind.c (xd_append_arg): Check for integers out of range.
10094 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 10095 (extract_signed, extract_unsigned): New functions.
243e0530
PE
10096 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
10097 (xd_get_connection_references): Return ptrdiff_t, not int.
10098 All uses changed.
10099 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
10100 (xd_read_message_1):
10101 Use int, not unsigned, where the dbus API uses int.
10102 (Fdbus_message_internal): Don't overflow mtype.
10103 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
10104 * dired.c (directory_files_internal, file_name_completion, scmp)
10105 (file_name_completion_stat):
10106 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10107 (file_name_completion): Don't overflow matchcount.
10108 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
10109 * dispextern.h: Adjust decls to match defn changes elsewhere.
10110 (struct text_pos, struct glyph, struct bidi_saved_info)
10111 (struct bidi_string_data, struct bidi_it, struct composition_it)
10112 (struct it):
10113 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10114 (struct display_pos, struct composition_it, struct it):
10115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10116 * dispnew.c (increment_matrix_positions)
10117 (increment_row_positions, mode_line_string)
10118 (marginal_area_string):
10119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 10120 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
10121 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10122 (duration_to_sec_usec): New function, to check for overflow better.
10123 (Fsleep_for, sit_for): Use it.
10124 * doc.c (get_doc_string, store_function_docstring):
10125 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10126 (get_doc_string, Fsnarf_documentation):
10127 Use int, not EMACS_INT, where int is wide enough.
10128 (get_doc_string):
10129 Use SAFE_ALLOCA, not alloca.
10130 Check for overflow when converting EMACS_INT to off_t.
10131 * doprnt.c (doprnt):
10132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10133 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
10134 Don't assume uid_t fits into fixnum.
10135 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
10136 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
10137 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
10138 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
10139 (general_insert_function)
10140 (Finsert_char, make_buffer_string, make_buffer_string_both)
10141 (update_buffer_properties, Fbuffer_substring)
10142 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
10143 (Fsubst_char_in_region, check_translation)
10144 (Ftranslate_region_internal, save_restriction_restore, Fformat)
10145 (transpose_markers, Ftranspose_regions):
10146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10147 (clip_to_bounds): Move to lisp.h as an inline function).
10148 (Fconstrain_to_field): Don't assume integers are nonnegative.
10149 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
10150 (Fsubst_char_in_region, Fsave_restriction):
10151 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10152 (Femacs_pid): Don't assume pid_t fits into fixnum.
10153 (lo_time): Use int, not EMACS_INT, when int suffices.
10154 (lisp_time_argument): Check for usec out of range.
10155 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
10156 (Fuser_login_name, Fuser_full_name): Signal an error
10157 if a uid argument is out of range, rather than relying on
10158 undefined behavior.
c8d5c857
PE
10159 (Fformat_time_string): Remove now-unnecessary check.
10160 lisp_time_argument checks for out-of-range usec now.
243e0530 10161 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
10162 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
10163 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
10164 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
10165 (init_cmdargs, Fdump_emacs):
10166 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10167 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
10168 the bottom (typically) 32 bits of the fixnum.
10169 * eval.c (specpdl_size, call_debugger):
10170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10171 (when_entered_debugger, Fbacktrace_debug):
10172 Don't assume fixnum can fit in int.
10173 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
10174 the object just before a buffer; this is not portable.
10175 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
10176 (grow_specpdl, unbind_to):
10177 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10178 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
10179 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 10180 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
10181 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
10182 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
10183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10184 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
10185 (a_write, e_write):
10186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10187 (Fcopy_file, non_regular_nbytes, read_non_regular)
10188 (Finsert_file_contents):
10189 Use int, not EMACS_INT, where int is wide enough.
10190 (READ_BUF_SIZE): Verify that it fits in int.
10191 (Finsert_file_contents): Check that counts are in proper range,
10192 rather than assuming fixnums fit into ptrdiff_t etc.
10193 Don't assume fixnums fit into int.
125b3835 10194 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
10195 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
10196 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
10197 (string_char_to_byte, string_byte_to_char)
10198 (string_make_multibyte, string_to_multibyte)
10199 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
10200 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
10201 (substring_both, Fdelete, internal_equal, Ffillarray)
10202 (Fclear_string, mapcar1)
10203 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
10204 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
10205 (larger_vector, make_hash_table, maybe_resize_hash_table)
10206 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
10207 (Fmaphash, secure_hash):
10208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10209 (concat): Check for string index and length overflow.
10210 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
10211 (Frequire):
10212 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10213 (larger_vector): New API (vec, incr_min, size_max) replaces old
10214 one (vec, new_size, init). This catches size overflow.
10215 INIT was removed because it was always Qnil.
10216 All callers changed.
10217 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
10218 the upper bound on a hash table index size.
10219 (make_hash_table, maybe_resize_hash_table): Use it.
10220 (secure_hash): Computer start_byte and end_byte only after
10221 they're known to be in ptrdiff_t range.
10222 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
10223 (Ffont_get_glyphs, Ffont_at):
10224 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10225 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
10226 (Flist_fonts, Fopen_font):
10227 Don't assume fixnum can fit in int.
10228 (check_gstring): Don't assume index can fit in int.
10229 (font_match_p): Check that fixnum is a character, not a nonnegative
10230 fixnum, since the later code needs to stuff it into an int.
10231 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
10232 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
10233 conversion overflow issues.
10234 (Fopen_font): Check for integer out of range.
10235 (Ffont_get_glyphs): Don't assume index can fit in int.
10236 * font.h: Adjust decls to match defn changes elsewhere.
10237 * fontset.c (reorder_font_vector): Redo score calculation to avoid
10238 integer overflow.
10239 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
10240 printmax_t, where ptrdiff_t is wide enough.
10241 (Finternal_char_font):
10242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10243 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
10244 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
10245 (Fset_frame_position, x_set_frame_parameters)
10246 (x_set_line_spacing, x_set_border_width)
10247 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
10248 Check that fixnums are in proper range for system types.
10249 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
10250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10251 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
10252 Use SAFE_ALLOCA_LISP, not alloca.
10253 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
10254 intptr_t is wide enough.
10255 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
10256 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
10257 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
10258 Check for fixnum out of range.
10259 * ftfont.c (ftfont_list): Don't assume index fits in int.
10260 Check that fixnums are in proper range for system types.
10261 (ftfont_shape_by_flt):
10262 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
10263 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10264 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10265 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
10266 Check that fixnums are in proper range for system types.
10267 * gnutls.h: Adjust decls to match defn changes elsewhere.
10268 * gtkutil.c (xg_dialog_run):
10269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10270 (update_frame_tool_bar):
10271 Check that fixnums are in proper range for system types.
10272 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 10273 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
10274 * indent.c (last_known_column, last_known_column_point):
10275 (current_column_bol_cache):
10276 (skip_invisible, current_column, check_display_width):
10277 (check_display_width, scan_for_column, current_column_1)
10278 (Findent_to, Fcurrent_indentation, position_indentation)
10279 (indented_beyond_p, Fmove_to_column, compute_motion):
10280 (Fcompute_motion, Fvertical_motion):
10281 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10282 (last_known_column_modified): Use EMACS_INT, not int.
10283 (check_display_width):
10284 (Fcompute_motion):
10285 Check that fixnums and floats are in proper range for system types.
10286 (compute_motion): Don't assume index or fixnum fits in int.
10287 (compute_motion, Fcompute_motion):
10288 Use int, not EMACS_INT, when it is wide enough.
10289 (vmotion): Omit local var start_hpos that is always 0; that way
10290 we don't need to worry about overflow in expressions involving it.
10291 * indent.h: Adjust decls to match defn changes elsewhere.
10292 (struct position):
10293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10294 Use int, not EMACS_INT, where int is wide enough.
10295 Remove unused members ovstring_chars_done and tab_offset;
10296 all uses removed.
10297 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10298 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10299 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10300 (make_gap, copy_text, insert, insert_and_inherit)
10301 (insert_before_markers, insert_before_markers_and_inherit)
10302 (insert_1, count_combining_before, count_combining_after)
10303 (insert_1_both, insert_from_string)
10304 (insert_from_string_before_markers, insert_from_string_1)
10305 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10306 (adjust_after_replace, adjust_after_insert, replace_range)
10307 (replace_range_2, del_range, del_range_1, del_range_byte)
10308 (del_range_both, del_range_2, modify_region)
10309 (prepare_to_modify_buffer, signal_before_change)
10310 (signal_after_change, Fcombine_after_change_execute):
10311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10312 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10313 (balance_an_interval, split_interval_right, split_interval_left)
10314 (find_interval, next_interval, update_interval)
10315 (adjust_intervals_for_insertion, delete_node, delete_interval)
10316 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10317 (static_offset_intervals, offset_intervals)
10318 (merge_interval_right, merge_interval_left, make_new_interval)
10319 (graft_intervals_into_buffer, temp_set_point_both)
10320 (temp_set_point, set_point, adjust_for_invis_intang)
10321 (set_point_both, move_if_not_intangible, get_property_and_range)
10322 (get_local_map, copy_intervals, copy_intervals_to_string)
10323 (compare_string_intervals, set_intervals_multibyte_1):
10324 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10325 * intervals.h: Adjust decls to match defn changes elsewhere.
10326 (struct interval):
10327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10328 * keyboard.c (this_command_key_count, this_single_command_key_start)
10329 (before_command_key_count, before_command_echo_length, echo_now)
10330 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10331 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10332 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10333 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10334 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10335 (last_non_minibuf_size, last_point_position, echo_truncate)
10336 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10337 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10338 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10339 (stuff_buffered_input):
10340 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10341 (last_auto_save, command_loop_1, read_char):
10342 Use EMACS_INT, not int, to avoid integer overflow.
10343 (record_char): Avoid overflow in total_keys computation.
10344 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10345 * keyboard.h: Adjust decls to match defn changes elsewhere.
10346 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10347 (Fkey_description, Fdescribe_vector, Flookup_key):
10348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10349 (click_position): New function, to check that positions are in range.
10350 (Fcurrent_active_maps):
10351 (describe_command):
10352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10353 (Faccessible_keymaps, Fkey_description):
10354 (preferred_sequence_p):
10355 Don't assume fixnum can fit into int.
10356 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10357 Check for integer overflow in size calculations.
10358 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10359 avoid mishandling large integers.
10360 * lisp.h: Adjust decls to match defn changes elsewhere.
10361 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10362 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10363 (struct Lisp_Marker):
10364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10365 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
10366 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10367 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10368 All callers changed.
10369 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10370 Assume the arg has valid form, since it always does.
10371 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10372 unsigned integer system type.
10373 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10374 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10376 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10377 (duration_to_sec_usec): New decl.
10378 * lread.c (read_from_string_index, read_from_string_index_byte)
10379 (read_from_string_limit, readchar, unreadchar, openp)
10380 (read_internal_start, read1, oblookup):
10381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10382 (Fload, readevalloop, Feval_buffer, Feval_region):
10383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10384 (openp): Check for out-of-range argument to 'access'.
10385 (read1): Use int, not EMACS_INT, where int is wide enough.
10386 Don't assume fixnum fits into int.
6efdadfd 10387 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
10388 (read_filtered_event): Use duration_to_sec_usec
10389 to do proper overflow checking on durations.
d311d28c
PE
10390 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10391 in size calculation.
10392 (Fexecute_kbd_macro):
10393 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10394 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10395 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10396 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10397 (set_marker_both, set_marker_restricted_both, marker_position)
10398 (marker_byte_position, Fbuffer_has_markers_at):
10399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10400 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 10401 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
10402 It now merely ensures that the menu is large enough, without
10403 necessarily growing it, as this avoids some integer overflow issues.
10404 All callers changed.
10405 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10406 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10407 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10408 Use SAFE_ALLOCA_LISP, not alloca.
10409 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10410 to EMACS_INT. Check that fixnums are in proper range for system types.
10411 * minibuf.c (minibuf_prompt_width, string_to_object)
10412 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10413 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10414 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10415 (get_minibuffer, read_minibuf_unwind):
10416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10417 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10418 this simplifies overflow checking. All callers changed.
10419 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10420 (Ftest_completion):
10421 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10422 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10423 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10424 Check that fixnums are in proper range for system types.
10425 (Fx_create_frame, Fx_show_tip):
10426 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10427 * nsfont.m (ns_findfonts, nsfont_list_family):
10428 Don't assume fixnum fits in long.
10429 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10430 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10431 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10432 wide enough.
17fdb222 10433 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
10434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10435 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10436 (PRINTDECLARE, PRINTPREPARE):
10437 (strout, print_string):
10438 (print, print_preprocess, print_check_string_charset_prop)
10439 (print_object):
10440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10441 (PRINTDECLARE):
10442 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10444 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 10445 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 10446 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
10447 (print_error_message): Use SAFE_ALLOCA, not alloca.
10448 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
10449 (print_depth, new_backquote_output, print_number_index):
10450 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
10451 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10452 (Fset_process_window_size, Fformat_network_address)
10453 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 10454 (sigchld_handler):
d311d28c 10455 Check that fixnums are in proper range for system types.
d44287d4 10456 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
10457 Check for process-ids out of pid_t range rather than relying on
10458 undefined behavior.
e4d81efc 10459 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
10460 (Fformat_network_address, read_process_output, send_process)
10461 (Fprocess_send_region, status_notify):
10462 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10463 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10464 (wait_reading_process_output, read_process_output, exec_sentinel):
10465 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10466 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10467 (Faccept_process_output): Use duration_to_sec_usec to do proper
10468 overflow checking on durations.
dde14581
PE
10469 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10470 Don't assume pid_t fits in int.
02481186
PE
10471 * process.h (struct Lisp_Process): Members tick and update_tick
10472 are now of type EMACS_INT, not int.
b62b53e8
PE
10473 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10474 configured --with-wide-int.
d311d28c
PE
10475 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10476 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10477 * search.c (looking_at_1, string_match_1):
10478 (fast_string_match, fast_c_string_match_ignore_case)
10479 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10480 (scan_newline, find_before_next_newline, search_command)
10481 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10482 (set_search_regs, wordify):
10483 (Freplace_match):
10484 (Fmatch_data):
10485 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10486 (string_match_1, search_buffer, set_search_regs):
10487 (Fmatch_data):
10488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10489 (wordify): Check for overflow in size calculation.
10490 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10491 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10492 Check that fixnums are in proper range for system types.
10493 * sound.c (struct sound_device)
10494 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10495 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10496 (Fplay_sound_internal):
10497 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 10498 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
10499 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10500 (Fparse_partial_sexp):
10501 Don't assume fixnums can fit in int.
10502 (struct lisp_parse_state, find_start_pos, find_start_value)
10503 (find_start_value_byte, find_start_begv)
10504 (update_syntax_table, char_quoted, dec_bytepos)
10505 (find_defun_start, prev_char_comend_first, back_comment):
10506 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10507 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10509 (Finternal_describe_syntax_value): Check that match_lisp is a
10510 character, not an integer, since the code stuffs it into int.
10511 (scan_words, scan_sexps_forward):
10512 Check that fixnums are in proper range for system types.
10513 (Fforward_word):
10514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10515 (scan_sexps_forward):
10516 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10517 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10518 * syntax.h: Adjust decls to match defn changes elsewhere.
10519 (struct gl_state_s):
10520 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
10521 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10522 MOST_POSITIVE_FIXNUM.
d311d28c
PE
10523 * sysdep.c (wait_for_termination_1, wait_for_termination)
10524 (interruptible_wait_for_termination, mkdir):
10525 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10526 (emacs_read, emacs_write):
10527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
10528 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10529 and double all fit in int.
d311d28c
PE
10530 * term.c (set_tty_color_mode):
10531 Check that fixnums are in proper range for system types.
10532 * termhooks.h (struct input_event):
10533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10534 * textprop.c (validate_interval_range, interval_of)
10535 (Fadd_text_properties, set_text_properties_1)
10536 (Fremove_text_properties, Fremove_list_of_text_properties)
10537 (Ftext_property_any, Ftext_property_not_all)
10538 (copy_text_properties, text_property_list, extend_property_ranges)
10539 (verify_interval_modification):
10540 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10541 (Fnext_single_char_property_change)
10542 (Fprevious_single_char_property_change):
10543 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
10544 (copy_text_properties):
10545 Check for integer overflow in index calculation.
d311d28c
PE
10546 * undo.c (last_boundary_position, record_point, record_insert)
10547 (record_delete, record_marker_adjustment, record_change)
10548 (record_property_change):
10549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10550 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10551 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10552 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10553 (Fx_hide_tip, Fx_file_dialog):
10554 * w32menu.c (set_frame_menubar):
10555 Use ptrdiff_t, not int, for consistency with rest of code.
10556 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10557 (select_window, Fdelete_other_windows_internal)
10558 (window_scroll_pixel_based, window_scroll_line_based)
10559 (Frecenter, Fset_window_configuration):
10560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10561 (Fset_window_hscroll, run_window_configuration_change_hook)
10562 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 10563 (Fscroll_other_window, Frecenter):
d311d28c
PE
10564 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10565 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10566 Don't assume fixnum fits in int.
10567 (Fset_window_scroll_bars):
10568 Check that fixnums are in proper range for system types.
10569 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10570 (string_pos, c_string_pos, number_of_chars, init_iterator)
10571 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10572 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10573 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
10574 (face_before_or_after_it_pos, handle_invisible_prop)
10575 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
10576 (display_prop_intangible_p, string_buffer_position_lim)
10577 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10578 (get_overlay_strings_1, get_overlay_strings)
10579 (iterate_out_of_display_property, forward_to_next_line_start)
10580 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10581 (get_next_display_element, set_iterator_to_next)
10582 (get_visually_first_element, compute_stop_pos_backwards)
10583 (handle_stop_backwards, next_element_from_buffer)
10584 (move_it_in_display_line_to, move_it_in_display_line)
10585 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10586 (add_to_log, message_dolog, message_log_check_duplicate)
10587 (message2, message2_nolog, message3, message3_nolog
10588 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10589 (current_message_1, truncate_echo_area, truncate_message_1)
10590 (set_message, set_message_1, store_mode_line_noprop)
10591 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10592 (text_outside_line_unchanged_p, check_point_in_composition)
10593 (reconsider_clip_changes)
10594 (redisplay_internal, set_cursor_from_row, try_scrolling)
10595 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10596 (redisplay_window, find_last_unchanged_at_beg_row)
10597 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10598 (trailing_whitespace_p, find_row_edges, display_line)
10599 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10600 (display_mode_element, store_mode_line_string)
10601 (pint2str, pint2hrstr, decode_mode_spec)
10602 (display_count_lines, display_string, draw_glyphs)
10603 (x_produce_glyphs, x_insert_glyphs)
10604 (rows_from_pos_range, mouse_face_from_buffer_pos)
10605 (fast_find_string_pos, mouse_face_from_string_pos)
10606 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10608 (safe_call, init_from_display_pos, handle_fontified_prop)
10609 (handle_single_display_spec, load_overlay_strings)
10610 (with_echo_area_buffer, setup_echo_area_for_printing)
10611 (display_echo_area, echo_area_display)
10612 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10613 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
10614 (redisplay_window, dump_glyph_row, display_mode_line)
10615 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 10616 (handle_display_spec, display_prop_string_p):
d311d28c
PE
10617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10618 (handle_single_display_spec, build_desired_tool_bar_string)
10619 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10620 (get_specified_cursor_type):
10621 Check that fixnums are in proper range for system types.
10622 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10623 (Flookup_image_map):
10624 Don't assume fixnums fit in int.
10625 (compare_overlay_entries):
10626 Avoid mishandling comparisons due to subtraction overflow.
10627 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10628 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10629 (handle_tool_bar_click):
10630 Use int, not unsigned, since we prefer signed and the signedness
10631 doesn't matter here.
10632 (get_next_display_element, next_element_from_display_vector):
10633 Use int, not EMACS_INT, when int is wide enough.
10634 (start_hourglass): Use duration_to_sec_usec to do proper
10635 overflow checking on durations.
10636 * xfaces.c (Fbitmap_spec_p):
10637 Check that fixnums are in proper range for system types.
10638 (compare_fonts_by_sort_order):
10639 Avoid mishandling comparisons due to subtraction overflow.
10640 (Fx_family_fonts, realize_basic_faces):
10641 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10642 (Fx_family_fonts):
10643 Don't assume fixnum fits in int.
10644 Use SAFE_ALLOCA_LISP, not alloca.
10645 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10646 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10647 (face_at_buffer_position, face_for_overlay_string)
10648 (face_at_string_position):
10649 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10650 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10651 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10652 (Fx_show_tip):
10653 Check that fixnums are in proper range for system types.
10654 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10655 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10656 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10657 (Fx_change_window_property): Don't assume fixnums fit in int.
10658 * xfont.c (xfont_chars_supported):
10659 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10660 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10661 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10663 * xml.c (parse_region):
10664 * xrdb.c (magic_file_p):
10665 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10666 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10667 (x_get_local_selection, x_reply_selection_request)
10668 (x_handle_selection_request, wait_for_property_change):
10669 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10670 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10671 short is wide enough.
10672 (x_send_client_event): Don't assume fixnum fits in int.
10673 * xterm.c (x_x_to_emacs_modifiers):
10674 Don't assume EMACS_INT overflows nicely into int.
10675 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10676 may come from Lisp.
10677 (handle_one_xevent): NATNUMP can eval its arg twice.
10678 (x_connection_closed):
10679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10680 * xterm.h: Adjust decls to match defn changes elsewhere.
10681 (struct scroll_bar): Use struct vectorlike_header
10682 rather than rolling our own approximation.
10683 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10684
c6574eb5
GM
106852012-05-25 Glenn Morris <rgm@gnu.org>
10686
10687 * lisp.mk (lisp): Update for more files being compiled now.
10688
e8d32c7e
SM
106892012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10690
48def666
SM
10691 * lread.c: Remove `read_pure' which makes no difference.
10692 (read_pure): Remove var.
10693 (unreadpure): Remove function.
10694 (readevalloop): Don't call read_list with -1 flag.
10695 (read1, read_vector): Don't test read_pure any more.
10696 (read_list): Simplify.
10697
e8d32c7e
SM
10698 * fileio.c, character.h: Minor style tweaks.
10699
4b2addb7
DA
107002012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10701
10702 * window.h (clip_changed): Remove useless declaration.
10703
584461b2
JB
107042012-05-22 Juanma Barranquero <lekktu@gmail.com>
10705
10706 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10707 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10708
34374650
PE
107092012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10710
10711 Remove src/m/*.
10712 This directory predates autoconf and is no longer needed nowadays.
10713 Move its few remaining bits of functionality to where they're needed.
10714 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10715 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10716 * m/template.h: Remove.
10717 * Makefile.in (M_FILE): Remove. All uses removed.
10718 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10719 * lisp.h (USE_LSB_TAG):
10720 * mem-limits.h (EXCEEDS_LISP_PTR):
10721 Use VAL_MAX, not VALBITS, in #if.
10722 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10723 (EMACS_UINT): Define unconditionally now.
10724 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10725 (BITS_PER_EMACS_INT): New constants, replacing
10726 what used to be in config.h, but not useful in #if.
10727 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10728 define them any more.
10729 (VAL_MAX): New macro.
10730 (VALMASK): Use it.
10731 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10732 BITS_PER_EMACS_INT, in #if.
10733 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10734 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10735 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10736 * s/ms-w32.h (DATA_START):
10737 Move here from removed file m/intel386.h.
10738 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10739 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10740
261cb4bb
PE
107412012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10742
10743 Assume C89 or later.
10744 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10745 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10746 (xrealloc):
10747 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10748 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10749 * textprop.c, tparam.c (NULL): Remove.
10750 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10751 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10752 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10753 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10754 * xterm.c (input_signal_count): Assume volatile works.
10755
ff23cd9f
KB
107562012-05-21 Ken Brown <kbrown@cornell.edu>
10757
10758 * xgselect.c (xg_select): Fix first argument in call to 'select'
10759 (bug#11508).
10760
1b170bc6
KB
107612012-05-20 Ken Brown <kbrown@cornell.edu>
10762
10763 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 10764 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 10765
b2f4d39f
KB
107662012-05-19 Ken Brown <kbrown@cornell.edu>
10767
10768 * xfns.c (x_in_use): Remove `static' qualifier.
10769 * xterm.h (x_in_use): Declare.
10770 * xgselect.c: Include xterm.h.
10771 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10772 and `display_arg' (bug#9754).
10773
003fdae2
PE
107742012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10775
9232a6d9
PE
10776 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10777
003fdae2
PE
10778 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10779 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10780
784b56e2
EZ
107812012-05-18 Eli Zaretskii <eliz@gnu.org>
10782
10783 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10784
10785 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 10786 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
10787
10788 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10789 reference to image_cache->refcount.
10790 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10791
a0a79cde
JL
107922012-05-17 Juri Linkov <juri@jurta.org>
10793
10794 * search.c (Fword_search_regexp, Fword_search_backward)
10795 (Fword_search_forward, Fword_search_backward_lax)
10796 (Fword_search_forward_lax): Move functions to isearch.el
10797 (bug#10145, bug#11381).
10798
b0572523
PE
107992012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10800
10801 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10802
9660f5fc
SM
108032012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10804
10805 * lread.c (init_obarray): Declare Qt and Qnil as special.
10806
4374de83
GM
108072012-05-14 Glenn Morris <rgm@gnu.org>
10808
10809 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 10810 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 10811
dc44c39a
PE
108122012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10813
078c97cb
PE
10814 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10815
dc44c39a
PE
10816 * unexaix.c: Port to more-recent AIX compilers.
10817 (report_error, report_error_1, make_hdr, copy_sym)
10818 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10819 Make arguments const char *, not char *, to avoid violations of C
10820 standard and to fix some AIX warnings reported by Gilles Pion.
10821
e18afed7 108222012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
10823
10824 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10825 already have overlays loaded.
10826 (handle_single_display_spec): Before returning without displaying
10827 fringe bitmap, synchronize the bidi iterator with the main display
10828 iterator, by calling iterate_out_of_display_property.
10829 (iterate_out_of_display_property): Detect buffer iteration by
10830 testing that it->string is a Lisp string.
10831 (get_next_display_element): When the current object is exhausted,
10832 and there's something on it->stack, call set_iterator_to_next to
10833 proceed with what's on the stack, instead of returning zero.
10834 (set_iterator_to_next): If called at the end of a Lisp string,
10835 proceed to consider_string_end without incrementing string
10836 position. Don't increment display vector index past the end of
10837 the display vector. (Bug#11417)
c8fb9dc6
EZ
10838 (pos_visible_p): Don't report a position visible when move_it_to
10839 stopped at the last line of window, which happens to be scanned
10840 backwards by the bidi iteration. (Bug#11464)
ac268e67 10841
e18afed7 108422012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
10843
10844 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10845 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
10846 are on a TTY, and thus unable to display on the fringes.
10847 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
10848 so we need to signal to the caller that this is a "replacing"
10849 display spec. This fixes display when the spec is invalid or we
10850 are on a TTY.
10851
e18afed7 108522012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
10853
10854 * unexaix.c (make_hdr): Fix typo in prototype.
10855 This bug broke the build on AIX. Problem reported by Gilles Pion.
10856
9d0a235a
MA
108572012-05-14 Michael Albinus <michael.albinus@gmx.de>
10858
10859 * keyboard.c (kbd_buffer_get_event): Read special events also in
10860 batch mode. (Bug#11415)
10861
9e6b06ed
GM
108622012-05-12 Glenn Morris <rgm@gnu.org>
10863
10864 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10865
c1a1d7a3
EZ
108662012-05-12 Eli Zaretskii <eliz@gnu.org>
10867
10868 * lisp.mk (lisp): Add newcomment.elc.
10869
3fe7cdc8
GM
108702012-05-12 Glenn Morris <rgm@gnu.org>
10871
10872 * Makefile.in (MKDIR_P): New, set by configure.
10873 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10874
53f7d2c0
PE
108752012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10876
10877 Remove unused function hourglass_started.
10878 * dispextern.h (hourglass_started):
10879 * w32fns.c (hourglass_started):
10880 * xdisp.c (hourglass_started): Remove.
10881
75aafb17
JB
108822012-05-10 Juanma Barranquero <lekktu@gmail.com>
10883
10884 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10885 Update dependencies.
10886
12959e8e
PE
108872012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10888
97107e2e
PE
10889 * xgselect.c (xg_select): Put maxfds+1 into a var.
10890 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10891
12959e8e
PE
10892 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10893
836d29b3
DA
108942012-05-10 Dave Abrahams <dave@boostpro.com>
10895
10896 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10897 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10898
5cb67954
MA
108992012-05-09 Michael Albinus <michael.albinus@gmx.de>
10900
10901 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 10902 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
10903 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10904 Initialize xd_registered_buses.
10905
3478ec45
PE
109062012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10907
b263a6b0
PE
10908 Untag more efficiently if USE_LSB_TAG.
10909 This is based on a proposal by YAMAMOTO Mitsuharu in
10910 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10911 For an admittedly artificial (nth 8000 longlist) benchmark on
10912 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10913 Emacs's overall text size by 1%.
10914 * lisp.h (XUNTAG): New macro.
10915 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10916 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10917 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10918 * eval.c (Fautoload):
10919 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10920 * frame.h (XFRAME): Use XUNTAG.
10921
3478ec45
PE
10922 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10923 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10924 Remove unportable assumptions about print widths of types like
10925 dbus_uint32_t.
10926 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10927 intptr_t when converting between pointer and integer, to avoid GCC
10928 warnings about wrong width.
10929
666b903b 109302012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
10931
10932 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10933 stack for each reader_thread, instead of defaulting to 8MB
10934 determined by the linker. This avoids failures in creating
10935 subprocesses on Windows 7, see the discussion in this thread:
10936 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10937
b120cc17
JC
109382012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10939
10940 Fix up display of the *Minibuf-0* buffer in the mini window.
10941 * keyboard.c (read_char): Don't clear the echo area if there's no
10942 message to clear.
10943 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 10944 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 10945
9a4b36f8
MA
109462012-05-07 Michael Albinus <michael.albinus@gmx.de>
10947
10948 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10949 batch mode.
10950
e5f9458f
CY
109512012-05-06 Chong Yidong <cyd@gnu.org>
10952
10953 * lisp.mk (lisp): Update.
10954
eceeb5fc 109552012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
10956
10957 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10958
71873e2b
SM
109592012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10960
10961 * data.c (PUT_ERROR): New macro.
10962 (syms_of_data): Use it. Add new error type `user-error'.
10963 * undo.c (user_error): New function.
10964 (Fprimitive_undo): Use it.
10965 * print.c (print_error_message): Adjust print style for `user-error'.
10966 * keyboard.c (user_error): New function.
10967 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10968
ab0fa4e4
PE
109692012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10970
10971 Do not limit current-time-string to years 1000..9999.
10972 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10973 (Fcurrent_time_string): Support any year that is supported by the
10974 underlying localtime representation. Don't use asctime, as it
10975 has undefined behavior for years outside the range -999..9999.
10976
7ed806a7
PE
109772012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10978
10979 Fix race conditions involving setenv, gmtime, localtime, asctime.
10980 Without this fix, interrupts could mess up code that uses these
10981 nonreentrant functions, since setting TZ invalidates existing
10982 tm_zone or tzname values, and since most of these functions return
10983 pointers to static storage.
10984 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10985 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10986 Grow the critical sections to include not just invoking
10987 localtime/gmtime, but also accessing these functions' results
10988 including their tm_zone values if any, and any related TZ setting.
10989 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
10990 so that the struct tm is saved in the critical section.
10991 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
10992 motivated by the fact that memory allocation needs to be outside
10993 the critical section.
10994
0c16dfed
DA
109952012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10996
10997 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10998 with RESET_INTERVAL.
10999
11000 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11001 Remove duplicated buffer name initialization.
11002
3f83ace8
JM
110032012-05-02 Jim Meyering <jim@meyering.net>
11004
11005 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
11006
c7b8541e
JM
11007 * xfns.c (x_window): Use xstrdup (Bug#11375).
11008
90207a15 110092012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
11010
11011 * xdisp.c (pos_visible_p): If already at a newline from the
11012 display string before the 'while' loop, don't walk back the glyphs
11013 from it3.glyph_row. Solves assertion violation when the display
11014 string begins with a newline (egg.el). (Bug#11367)
11015
b593d6a9
AH
110162012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
11017
11018 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
11019 Move to simple.el.
11020
4737362e
GM
110212012-05-01 Glenn Morris <rgm@gnu.org>
11022
99cf43f9
GM
11023 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
11024 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
11025 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
11026 All were removed before 23.1.
11027
9311dcff
GM
11028 * dispnew.c: Remove HAVE_LIBNCURSES test;
11029 it is always true on relevant platforms.
11030
4d5c6349
GM
11031 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
11032 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
11033
4737362e
GM
11034 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
11035
74dd3a6b
AS
110362012-04-30 Andreas Schwab <schwab@linux-m68k.org>
11037
11038 * .gdbinit (xpr): Remove checks for no longer existing misc types.
11039 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
11040 Remove.
11041
13c379ee
PE
110422012-04-28 Paul Eggert <eggert@cs.ucla.edu>
11043
11044 Do not avoid creating empty evaporating overlays (Bug#9642).
11045 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
11046 That is, do not delete an evaporating overlay if it becomes
11047 empty after its bounds are adjusted to fit within its buffer.
11048 This fix caused other problems, and I'm reverting it until we get
11049 to the bottom of them.
11050
a8e7d6d7 110512012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
11052
11053 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
11054
a8e7d6d7 110552012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
11056
11057 * xdisp.c (pos_visible_p): If the window start position is beyond
11058 ZV, start the display from buffer beginning. Prevents assertion
11059 violation in init_iterator when the minibuffer window is scrolled
11060 via the scroll bar.
11061
11062 * window.c (window_scroll_pixel_based): Likewise.
11063
a8e7d6d7 110642012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
11065
11066 * keymap.c (where_is_internal): Doc fix (Bug#10872).
11067
a8e7d6d7 110682012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
11069
11070 * fileio.c (Fcopy_file, Fset_file_selinux_context):
11071 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
11072
a8e7d6d7 110732012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 11074
b593d6a9
AH
11075 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
11076 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 11077
1c6900d9
EZ
110782012-04-26 Eli Zaretskii <eliz@gnu.org>
11079
4c3fa1d9
EZ
11080 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
11081 display element, check also the underlying string or buffer
11082 character. (Bug#11341)
11083
1c6900d9
EZ
11084 * w32menu.c: Include w32heap.h.
11085 (add_menu_item): If the call to AppendMenuW (via
11086 unicode_append_menu) fails, disable Unicode menus only if we are
11087 running on Windows 9X/Me.
11088
42bf8205
AS
110892012-04-24 Andreas Schwab <schwab@linux-m68k.org>
11090
11091 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
11092 (xgetint): Add missing shift for LSB tags.
11093
b1bac16e
MR
110942012-04-24 Martin Rudalics <rudalics@gmx.at>
11095
11096 * keyboard.c (read_char): Don't wipe echo area for select window
11097 events: These might get delayed via `mouse-autoselect-window'
11098 (Bug#11304).
11099
d69621cc
JB
111002012-04-24 Juanma Barranquero <lekktu@gmail.com>
11101
11102 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
11103 manipulation of :loaded-from data.
11104
02fd101b
JB
111052012-04-23 Juanma Barranquero <lekktu@gmail.com>
11106
11107 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
11108 now a cons (bug#11311).
11109
888bec30
PE
111102012-04-23 Paul Eggert <eggert@cs.ucla.edu>
11111
89a438bd
PE
11112 Do not create empty overlays with the evaporate property (Bug#9642).
11113 * buffer.c (Fmove_overlay): Delete an evaporating overlay
11114 if it becomes empty after its bounds are adjusted to fit within
11115 its buffer. Without this fix, in a nonempty buffer (let ((o
11116 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
11117 yields an empty overlay that has the evaporate property, which is
11118 not supposed to happen.
11119
1068fe4d
PE
11120 Fix minor GTK3 problems found by static checking.
11121 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11122 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11123 (struct _EmacsFixedClass, emacs_fixed_get_type):
11124 Move decls here from emacsgtkfixed.h, since they needn't be public.
11125 (emacs_fixed_get_type): Now static.
11126 (emacs_fixed_class_init): Omit unused local.
11127 (emacs_fixed_child_type): Remove; unused.
11128 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
11129 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
11130 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
11131 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
11132 (EMACS_FIXED_GET_CLASS): Remove; unused.
11133 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
11134
888bec30
PE
11135 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
11136 Problem reported by Juanma Barranquero for Windows -Wunused-function.
11137
de85e130
PE
111382012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11139
d0baac98 11140 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 11141 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
11142 (__malloc_size_t, __malloc_ptrdiff_t):
11143 Remove. All uses removed, replaced by the definiens if needed,
11144 since we can assume C89 or better now.
11145 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
11146 (protect_malloc_state, align, get_contiguous_space)
11147 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
11148 (malloc_atfork_handler_child, malloc_enable_thread)
11149 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
11150 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
11151 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
11152 (special_realloc, _realloc_internal_nolock, _realloc_internal)
11153 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
11154 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
11155 Define using prototypes, not old style.
11156 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
11157 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
11158 (align): Don't assume that signed integer overflow wraps around.
11159 Omit unused local var.
11160 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
11161 (_free_internal_nolock, memalign, mallochook, reallochook):
11162 Omit no-longer-needed casts.
11163 (valloc): Use getpagesize, not __getpagesize.
11164 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
11165 (struct hdr): The 'magic' member is now size_t, not unsigned long.
11166
de85e130
PE
11167 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
11168
dcbf5805
MA
111692012-04-22 Michael Albinus <michael.albinus@gmx.de>
11170
11171 Move functions from C to Lisp. Make non-blocking method calls
11172 the default. Implement further D-Bus standard interfaces.
11173
11174 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
11175 (QCdbus_request_name_allow_replacement)
11176 (QCdbus_request_name_replace_existing)
11177 (QCdbus_request_name_do_not_queue)
11178 (QCdbus_request_name_reply_primary_owner)
11179 (QCdbus_request_name_reply_in_queue)
11180 (QCdbus_request_name_reply_exists)
11181 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
11182 (QCdbus_registered_serial, QCdbus_registered_method)
11183 (QCdbus_registered_signal): New Lisp objects.
11184 (XD_DEBUG_MESSAGE): Use sizeof.
11185 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
11186 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
11187 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
11188 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
11189 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
11190 (xd_signature, xd_append_arg): Allow float for integer types.
11191 (xd_get_connection_references): New function.
b593d6a9
AH
11192 (xd_get_connection_address): Rename from xd_initialize.
11193 Return cached address.
dcbf5805
MA
11194 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
11195 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
11196 level.
11197 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 11198 Return number of refcounts.
dcbf5805
MA
11199 (Fdbus_get_unique_name): Make stronger parameter check.
11200 (Fdbus_message_internal): New defun.
11201 (Fdbus_call_method, Fdbus_call_method_asynchronously)
11202 (Fdbus_method_return_internal, Fdbus_method_error_internal)
11203 (Fdbus_send_signal, Fdbus_register_service)
11204 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
11205 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
11206 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
11207 (Vdbus_compiled_version, Vdbus_runtime_version)
11208 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
11209 (Vdbus_message_type_method_return, Vdbus_message_type_error)
11210 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
11211 (Vdbus_registered_buses, Vdbus_registered_objects_table):
11212 Adapt docstring.
dcbf5805 11213
52828e02
PE
112142012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11215
da05bc4c
PE
11216 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
11217 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
11218 Do not assume ptrdiff_t is the same width as 'int'.
11219
52828e02
PE
11220 * alloc.c: Handle unusual debugging option combinations.
11221 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
11222 since the two debugging options are incompatible.
11223 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
11224 is defined.
11225 (mem_init, mem_insert, mem_insert_fixup):
11226 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
11227 (NEED_MEM_INSERT): Remove; no longer needed.
11228
f01769f9
LL
112292012-04-22 Leo Liu <sdl.web@gmail.com>
11230
11231 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
11232
5790543d
PE
112332012-04-22 Paul Eggert <eggert@cs.ucla.edu>
11234
11235 * sysdep.c [__FreeBSD__]: Minor cleanups.
11236 (list_system_processes, system_process_attributes) [__FreeBSD__]:
11237 Use Emacs indenting style more consistently. Avoid some casts.
11238 Use 'double' consistently rather than mixing 'float' and 'double'.
11239
b91b7e4d
EW
112402012-04-21 Eduard Wiebe <usenet@pusto.de>
11241
b593d6a9
AH
11242 * sysdep.c (list_system_processes, system_process_attributes):
11243 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 11244
6114eb15
AS
112452012-04-21 Andreas Schwab <schwab@linux-m68k.org>
11246
11247 * lisp.mk (lisp): Update.
11248
2f38dff7
PE
112492012-04-20 Paul Eggert <eggert@cs.ucla.edu>
11250
11251 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
11252 It is never used otherwise.
11253
4ae29f89
SM
112542012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
11255
11256 * print.c (print_preprocess): Only check print_depth if print-circle
11257 is nil.
11258 (print_object): Check for cycles even when print-circle is nil and
11259 print-gensym is t, but only check print_depth if print-circle is nil.
11260
f30d612a
CY
112612012-04-20 Chong Yidong <cyd@gnu.org>
11262
11263 * process.c (wait_reading_process_output): If EIO occurs on a pty,
11264 set the status to "failed" and ensure that sentinel is run.
11265
c07a4c0b 112662012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
11267
11268 * process.c (Fset_process_inherit_coding_system_flag)
11269 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 11270 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 11271
c07a4c0b 112722012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
11273
11274 * xdisp.c (string_buffer_position_lim): Limit starting position to
11275 BEGV.
11276 (set_cursor_from_row): If called for a mode-line or header-line
11277 row, return zero immediately.
11278 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
11279 farther than the first row after the header line, if any.
11280 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
11281 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11282
c07a4c0b 112832012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11284
4ae29f89
SM
11285 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11286 (bug#11238).
ad3a2b41 11287
c07a4c0b 112882012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 112892012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
11290
11291 configure: new option --enable-gcc-warnings (Bug#11207)
11292 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11293 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11294 (ALL_CFLAGS): Use new macros rather than old.
11295 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11296 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11297 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11298 -Wunused-result, -Wunused-variable. This should go away once
11299 the Emacs and Gnulib regex code is merged.
11300 (xmalloc, xrealloc): Now static.
11301
aba027e8
PE
113022012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11303
11304 * dired.c (Fsystem_groups): Remove unused local.
11305
e5a36063
GM
113062012-04-17 Glenn Morris <rgm@gnu.org>
11307
11308 * dired.c (Fsystem_users): Doc fix.
11309
316411f0
DA
113102012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11311
11312 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11313 (syms_of_dired): Add them.
11314
9426aba4
PE
113152012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11316
b62a57be
PE
11317 Fix minor alloc.c problems found by static checking.
11318 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11319 New extern decls, to avoid calling undeclared functions.
11320 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11321 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11322 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11323 (NEED_MEM_INSERT): New macro.
11324 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 11325 Remove one incorrect comment and fix another.
b62a57be 11326
3539f31f
PE
11327 Fix minor ralloc.c problems found by static checking.
11328 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11329 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11330 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11331 (r_alloc_sbrk): Now static.
11332
a041960a
PE
11333 Improve ralloc.c interface checking.
11334 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11335 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11336 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11337 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11338 [REL_ALLOC]: ... to here, to check interface.
11339 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11340 Remove decls. This fixes an "It stinks!".
11341
9426aba4
PE
11342 * alloc.c (which_symbols): Fix alignment issue / type clash.
11343
d55c12ed
AS
113442012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11345
11346 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11347 (struct Lisp_Misc_Any): Likewise.
11348 (struct Lisp_Free): Likewise.
11349 * alloc.c (union aligned_Lisp_Symbol): Define.
11350 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11351 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11352 (union aligned_Lisp_Misc): Define.
11353 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11354 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 11355 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 11356
b948ce8b
PE
113572012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11358
11359 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11360 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11361 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11362 * s/netbsd.h, s/sol2-6.h:
11363 Remove definition of GC_MARK_STACK, since the default now works.
11364 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11365 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11366 no longer the default.
11367 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11368
35dc09a1 113692012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11370
35dc09a1
GM
11371 * lread.c (lisp_file_lexically_bound_p):
11372 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 11373
35dc09a1
GM
113742012-04-14 Eli Zaretskii <eliz@gnu.org>
11375
11376 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11377 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11378
113792012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11380
11381 * nsterm.m (constrainFrameRect): Always constrain when there is only
11382 one screen (Bug#10962).
11383
bcd86815
KB
113842012-04-13 Ken Brown <kbrown@cornell.edu>
11385
11386 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11387
c25df26e
RT
113882012-04-13 Reuben Thomas <rrt@sc3d.org>
11389
11390 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11391
0fc59f1e
DC
113922012-04-11 Daniel Colascione <dancol@dancol.org>
11393
11394 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11395 against is gone. It's better to use vfork now so that when Cygwin
11396 gains a new, working vfork, we use it automatically (bug#10398).
11397
de8c03dc
SM
113982012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11399
11400 * window.c (save_window_save): Obey window-point-insertion-type.
11401
2f097256
GM
114022012-04-11 Glenn Morris <rgm@gnu.org>
11403
11404 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11405
453b951e
SM
114062012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11407
11408 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11409
75f1671a 114102012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
11411
11412 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11413 (force_quit_count): New var.
11414 (handle_interrupt): Use it.
11415
2a8ce227
JB
114162012-04-10 Juanma Barranquero <lekktu@gmail.com>
11417
11418 * w32.c (w32_delayed_load): Record the full path of the library
11419 being loaded (bug#10424).
11420
935396c0
GM
114212012-04-09 Glenn Morris <rgm@gnu.org>
11422
05920a43
GM
11423 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11424 not just in the obarray, before snarfing them. (Bug#11036)
11425
935396c0
GM
11426 * Makefile.in ($(leimdir)/leim-list.el):
11427 Pass EMACS rather than BUILT_EMACS.
11428
a18ecafa
TZ
114292012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11430
11431 * process.c (make_process):
11432 * process.h: Add integer `gnutls_handshakes_tried' member to
11433 process struct.
11434
6bbef4e5
JC
11435 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11436 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
11437
11438 * gnutls.c (gnutls_log_function2i): Convenience log function.
11439 (emacs_gnutls_read): Use new log functions,
11440 `gnutls_handshakes_tried' process member, and
11441 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11442 attempts per process (connection).
11443
b4d3bc10
CY
114442012-04-09 Chong Yidong <cyd@gnu.org>
11445
11446 * eval.c (Fuser_variable_p, user_variable_p_eh)
11447 (lisp_indirect_variable): Functions deleted.
11448 (Fdefvar): Caller changed.
11449
11450 * callint.c (Finteractive, Fcall_interactively):
11451 * minibuf.c (Fread_variable): Callers changed.
11452
70f4d973
EZ
114532012-04-09 Eli Zaretskii <eliz@gnu.org>
11454
11455 * xdisp.c (set_cursor_from_row): If the display string appears in
11456 the buffer at position that is closer to point than the position
11457 after the display string, display the cursor on the first glyph of
11458 the display string. Fixes cursor display when a 'display' text
11459 property immediately follows invisible text. (Bug#11094)
11460
cb3c2e3e
PE
114612012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11462
11463 composite.c: use 'double' consistently
11464 * composite.c (get_composition_id): Use 'double' consistently
11465 instead of converting 'float' to 'double' and vice versa; this is
11466 easier to understand and avoids a GCC warning.
11467
fd06db5d
GM
114682012-04-09 Glenn Morris <rgm@gnu.org>
11469
50fe702a
GM
11470 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11471 preparation for dumping it with emacs. (Bug#4789)
11472 (leimdir): New variable.
11473 ($(leimdir)/leim-list.el): New rule.
11474 (emacs$(EXEEXT)): Depend on leim-list.el.
11475
fd06db5d
GM
11476 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11477 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11478 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11479
55c131ee
AS
114802012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11481
11482 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11483 proper alignment.
11484
9209588f
JB
114852012-04-07 Juanma Barranquero <lekktu@gmail.com>
11486
11487 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11488 Remove unused local variable.
11489
e3fb2efb
PE
114902012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11491
11492 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11493 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11494 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11495 objects, as mark_maybe_pointer will catch them otherwise.
11496 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11497 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11498
b5385551
PE
114992012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11500
11501 Fix typo that broke non-Windows builds.
11502 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11503
9078ead6
EZ
115042012-04-07 Eli Zaretskii <eliz@gnu.org>
11505
11506 Support building on MS-Windows with libxml2.
11507
11508 * makefile.w32-in (OBJ2): Add xml.$(O).
11509 (GLOBAL_SOURCES): Add xml.c.
11510 ($(BLD)/xml.$(O)): New dependency list.
11511
11512 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11513 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11514 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11515 [!WINDOWSNT]: New macros.
11516 (init_libxml2_functions, libxml2_loaded_p): New functions.
11517 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11518 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11519 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11520 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11521 linked in).
6bbef4e5
JC
11522 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11523 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
11524 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11525
11526 * emacs.c: Don't include libxml/parser.h.
11527 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11528 xmlCleanupParser directly.
11529
11530 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11531
3811fdf3
EZ
115322012-04-07 Eli Zaretskii <eliz@gnu.org>
11533
11534 * indent.c (Fvertical_motion): If there is a display string at
11535 point, use it.vpos to compute how many lines to backtrack after
11536 move_it_to point. (Bug#11133)
11537
2f8e16b2
EZ
115382012-04-06 Eli Zaretskii <eliz@gnu.org>
11539
11540 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11541 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11542 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11543 macros related to unification of CJK characters. For the details,
11544 see the discussion following the message here:
11545 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11546
3d439cd1
CY
115472012-04-04 Chong Yidong <cyd@gnu.org>
11548
11549 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11550
8bc53d00
EZ
115512012-04-01 Eli Zaretskii <eliz@gnu.org>
11552
11553 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11554 instead of alloca. (Bug#11138)
11555
3b0512a3
AS
115562012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11557
11558 * w32menu.c (is_simple_dialog): Properly check lisp types.
11559 (Bug#11141)
11560
8427ddd2
EZ
115612012-03-31 Eli Zaretskii <eliz@gnu.org>
11562
979022ef
EZ
11563 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11564 position we get to after a call to move_it_to fails the
11565 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11566 only if we wind up in a string from display property. (Bug#11063)
11567
a6b1c7cc
EZ
11568 * window.c (Fdelete_other_windows_internal): Invalidate the row
11569 and column information about mouse highlight, so that redisplay
11570 restores it after reallocating the glyph matrices. (Bug#7464)
11571
8427ddd2
EZ
11572 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11573 string comes from a `display' text property, use the buffer
11574 position of that property as if we actually saw that position in
11575 the row's glyphs.
697ba24b
EZ
11576 (move_it_by_lines): Remove the assertion that
11577 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11578 violated when there's a before-string at the beginning of a line.
11579 (Bug#11063)
8427ddd2 11580
65a0a738
EZ
115812012-03-30 Eli Zaretskii <eliz@gnu.org>
11582
11583 * xdisp.c (append_space_for_newline): If the default face was
11584 remapped, use the remapped face for the appended newline.
11585 (extend_face_to_end_of_line): Use the remapped default face for
11586 extending the face to the end of the line.
11587 (display_line): Call extend_face_to_end_of_line when the default
11588 face was remapped. (Bug#11068)
11589
581355cc
EZ
115902012-03-29 Eli Zaretskii <eliz@gnu.org>
11591
11592 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11593
e8fc049f
SM
115942012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11595
11596 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11597
4fb9a543
GM
115982012-03-27 Glenn Morris <rgm@gnu.org>
11599
11600 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11601 Doc fixes.
11602
679910f1
KH
116032012-03-26 Kenichi Handa <handa@m17n.org>
11604
11605 * dispextern.h (struct glyph): Fix previous change. Change the
11606 bit length of glyphless.ch to 25 (Bug#11082).
11607
90d49b7f
CY
116082012-03-26 Chong Yidong <cyd@gnu.org>
11609
11610 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11611 (command_loop_1): Use it; inhibit selection update for
11612 handle-select-window too (Bug#8996).
11613
f514f6f0
FP
116142012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11615
e8fc049f 11616 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 11617
bf43fa51
KH
116182012-03-25 Kenichi Handa <handa@m17n.org>
11619
11620 * dispextern.h (struct glyph): Change the bit length of
11621 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11622
8a0c01dd
EZ
116232012-03-24 Eli Zaretskii <eliz@gnu.org>
11624
11625 * s/ms-w32.h (tzname): Include time.h before redirecting to
11626 _tzname. Fixes the MSVC build. (Bug#9960)
11627
7d1c3a76
AS
116282012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11629
8ed79523
AS
11630 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11631 characters.
11632
7d1c3a76
AS
11633 * xterm.c (XTread_socket): Only modify handling_signal if
11634 !SYNC_INPUT. (Bug#11080)
11635
e99a9b8b
EZ
116362012-03-23 Eli Zaretskii <eliz@gnu.org>
11637
11638 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11639 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11640 when fetching a multibyte character consumes more bytes than
11641 CHAR_BYTES returns, due to unification of CJK characters in
11642 string_char. (Bug#11073)
11643
5063c0e1
TN
116442012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11645
11646 * process.c (wait_reading_process_output): Handle pty disconnect
11647 by refraining from sending oneself a SIGCHLD (bug#10933).
11648
9f851fbd
CY
116492012-03-22 Chong Yidong <cyd@gnu.org>
11650
11651 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11652
5063c0e1 11653 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
11654 Mark string as coming from a prefix property.
11655 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11656 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11657
fb5b8aca
CY
116582012-03-21 Chong Yidong <cyd@gnu.org>
11659
11660 * xfaces.c (Vface_remapping_alist): Doc fix.
11661
62356a1b
EZ
116622012-03-20 Eli Zaretskii <eliz@gnu.org>
11663
11664 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
11665 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11666 Doc fixes.
62356a1b 11667
025de85b
CY
116682012-03-20 Chong Yidong <cyd@gnu.org>
11669
11670 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11671 to reflect default non-nil value of redisplay-dont-pause.
11672
4827f94e
KH
116732012-03-19 Kenichi Handa <handa@m17n.org>
11674
11675 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11676 it fit in a valid range (Bug#11003).
11677
e50a24a2
EZ
116782012-03-18 Eli Zaretskii <eliz@gnu.org>
11679
11680 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11681 that is not from display property, accept the row as a "cursor
11682 row" if one of the string's character has a non-nil `cursor'
11683 property. Fixes cursor positioning when there are newlines in
11684 overlay strings, e.g. in icomplete.el. (Bug#11035)
11685
9af5ed87
PE
116862012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11687
11688 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11689
d1f55f16
CY
116902012-03-12 Chong Yidong <cyd@gnu.org>
11691
11692 * eval.c (inhibit_lisp_code): Rename from
11693 inhibit_window_configuration_change_hook; move from window.c.
11694
11695 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11696 * window.c (run_window_configuration_change_hook)
11697 (syms_of_window): Callers changed.
11698
66c5eebd
CY
116992012-03-11 Chong Yidong <cyd@gnu.org>
11700
413df973
CY
11701 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11702
66c5eebd
CY
11703 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11704
1de11f56
CY
117052012-03-10 Chong Yidong <cyd@gnu.org>
11706
11707 * frame.c (other_visible_frames): Don't assume the selected frame
11708 is visible (Bug#10955).
11709
cae07000
SM
117102012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11711
11712 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11713
89c94350
JD
117142012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11715
11716 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11717 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11718 zero (Bug#10954).
11719
999dd333
GM
117202012-03-03 Glenn Morris <rgm@gnu.org>
11721
01a6dcc8 11722 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 11723
de0100f2
EZ
117242012-03-02 Eli Zaretskii <eliz@gnu.org>
11725
11726 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11727 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
11728 (redisplay_window, next_element_from_string): Fix typos in
11729 comments.
3e441275
EZ
11730 (redisplay_window): Pass to move_it_vertically the margin in
11731 pixels, not in screen lines.
de0100f2 11732
96a72ee9
GM
117332012-03-02 Glenn Morris <rgm@gnu.org>
11734
11735 * buffer.c (buffer-list-update-hook): Doc fix.
11736
312508d7
EZ
117372012-02-29 Eli Zaretskii <eliz@gnu.org>
11738
11739 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11740 push_it before setting up the iterator for the first overlay
11741 string, even if we have an empty string loaded.
11742 (next_overlay_string): If there's an empty string on the iterator
11743 stack, pop the stack. (Bug#10903)
11744
27f3c637
PE
117452012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11746
11747 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11748 Suggested by Stefan Monnier in
11749 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11750 * alloc.c (widen_to_Lisp_Object): New static function.
11751 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11752 and widening them to Lisp_Objects. This would work even if
11753 USE_LSB_TAG is defined and wide integers are used, which might
11754 happen in a future version of Emacs.
11755
3c9dfce6
CY
117562012-02-25 Chong Yidong <cyd@gnu.org>
11757
fa74b241
CY
11758 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11759 Doc fix.
11760
3c9dfce6
CY
11761 * xselect.c (Fx_selection_exists_p): Doc fix.
11762 (x_clipboard_manager_save_all): Print an informative message
11763 before saving to clipboard manager.
11764
9486df08
CY
117652012-02-24 Chong Yidong <cyd@gnu.org>
11766
11767 * keyboard.c (process_special_events): Handle all X selection
11768 requests in kbd_buffer, not just the next one (Bug#8869).
11769
f01d3321
CY
117702012-02-23 Chong Yidong <cyd@gnu.org>
11771
11772 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11773 call when setting menu-bar-lines and tool-bar-lines parameters.
11774 (unwind_create_frame_1): New helper function.
11775
11776 * window.c (inhibit_window_configuration_change_hook): New var.
11777 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 11778 (syms_of_window): Initialize it.
f01d3321 11779
86b847b6
CY
117802012-02-22 Chong Yidong <cyd@gnu.org>
11781
11782 * xterm.c (x_draw_image_relief): Add missing type check for
11783 Vtool_bar_button_margin (Bug#10743).
11784
a59225b1
CY
117852012-02-21 Chong Yidong <cyd@gnu.org>
11786
11787 * fileio.c (Vfile_name_handler_alist): Doc fix.
11788
11789 * buffer.c (Fget_file_buffer): Protect against invalid file
11790 handler return value.
11791
310f5bd4
PE
117922012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11793
cb3a28cc
PE
11794 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11795 when computing $valmask.
11796
310f5bd4
PE
11797 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11798 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11799 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11800 It's useless in that case, and it can cause problems on hosts
11801 that allocate halves of EMACS_INT values separately.
11802 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11803 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11804 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11805 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11806 it avoids undefined behavior on hosts where shifting right by more
11807 than the word width has undefined behavior.
11808
2375c96a
CY
118092012-02-19 Chong Yidong <cyd@gnu.org>
11810
11811 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11812 (Funhandled_file_name_directory, Ffile_name_as_directory)
11813 (Fdirectory_file_name, Fexpand_file_name)
11814 (Fsubstitute_in_file_name): Protect against invalid file handler
11815 return values (Bug#10845).
11816
3eb49e71
EZ
118172012-02-18 Eli Zaretskii <eliz@gnu.org>
11818
11819 * .gdbinit (pitx): Fix incorrect references to fields of the
11820 iterator stack.
11821
7b926f3f
CY
118222012-02-17 Chong Yidong <cyd@gnu.org>
11823
11824 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11825
11273115
PE
118262012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11827
11828 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11829 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11830
c3a70e2b
CY
118312012-02-15 Chong Yidong <cyd@gnu.org>
11832
11833 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11834 marked as special. Also, starting docstrings with * is obsolete.
11835
0ca43699
AS
118362012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11837
11838 * gnutls.c (emacs_gnutls_write): Fix last change.
11839
2e8f3c56
LI
118402012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11841
11842 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11843 send_process.
11844
af70074f
SM
118452012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11846
11847 * keymap.c (Fsingle_key_description): Handle char ranges.
11848
95986d52
CY
118492012-02-12 Chong Yidong <cyd@gnu.org>
11850
afd83bd1
CY
11851 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11852 as that creates a dangerous corner case.
11853
95986d52
CY
11854 * window.c (Fdelete_window_internal): Invalidate the mouse
11855 highlight (Bug#9904).
11856
bd7da63e
GM
118572012-02-12 Glenn Morris <rgm@gnu.org>
11858
11859 * xselect.c (Fx_own_selection_internal)
11860 (Fx_get_selection_internal, Fx_disown_selection_internal)
11861 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11862 * nsselect.m (Fx_own_selection_internal)
11863 (Fx_disown_selection_internal, Fx_selection_exists_p)
11864 (Fx_selection_owner_p, Fx_get_selection_internal):
11865 Sync docs and argument specs with the xselect.c versions.
11866
77abcbc2
LI
118672012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11868
11869 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11870
90b671e2
EZ
118712012-02-11 Eli Zaretskii <eliz@gnu.org>
11872
1c0ca0b7
EZ
11873 * w32select.c (Fx_selection_exists_p): Sync doc string and
11874 argument list with xselect.c. (Bug#10783)
11875
11876 * w16select.c (Fx_selection_exists_p): Sync doc string and
11877 argument list with xselect.c. (Bug#10783)
90b671e2 11878
49241268
GM
118792012-02-10 Glenn Morris <rgm@gnu.org>
11880
11881 * fns.c (Fsecure_hash): Doc fix.
11882
f998bbe7 118832012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
11884
11885 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11886
0992bd9c
CY
118872012-02-07 Chong Yidong <cyd@gnu.org>
11888
11889 * buffer.c (Fbuffer_local_variables)
11890 (buffer_lisp_local_variables): Handle unbound vars correctly;
11891 don't let Qunbound leak into Lisp.
11892
af008560
GM
118932012-02-07 Glenn Morris <rgm@gnu.org>
11894
dd605cc4
GM
11895 * image.c (Fimagemagick_types): Doc fix.
11896
af008560
GM
11897 * image.c (imagemagick-render-type): Change it from a lisp object
11898 to an integer. Move the doc here from the lisp manual.
11899 Treat all values not equal to 0 the same.
11900
1449fa1d
CY
119012012-02-06 Chong Yidong <cyd@gnu.org>
11902
11903 * doc.c (store_function_docstring): Avoid applying docstring of
11904 alias to base function (Bug#2603).
11905
3723ec07
AS
119062012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11907
11908 * .gdbinit (pp1, pv1): Remove redundant defines.
11909 (pr): Use pp.
11910
79c1cc1e
CY
119112012-02-04 Chong Yidong <cyd@gnu.org>
11912
11913 * nsterm.m: Declare a global (Bug#10694).
11914
d7f29f8e
EZ
119152012-02-04 Eli Zaretskii <eliz@gnu.org>
11916
cae07000
SM
11917 * w32.c (get_emacs_configuration_options):
11918 Include --enable-checking, if specified, in the return value.
d7f29f8e 11919
3b95a6f9
MR
119202012-02-04 Martin Rudalics <rudalics@gmx.at>
11921
11922 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11923 after rounding frame sizes. (Bug#9723)
11924
d6fa96a6
EZ
119252012-02-04 Eli Zaretskii <eliz@gnu.org>
11926
11927 * keyboard.c (adjust_point_for_property): Don't position point
11928 before BEGV. (Bug#10696)
11929
df0b2940
PE
119302012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11931
11932 Handle overflow when computing char display width (Bug#9496).
11933 * character.c (char_width): Return EMACS_INT, not int.
11934 (char_width, c_string_width): Check for overflow when
11935 computing the width; this is possible now that individual
11936 characters can have unbounded width. Problem introduced
11937 by merge from Emacs 23 on 2012-01-19.
11938
6bee44d6
MA
119392012-02-02 Michael Albinus <michael.albinus@gmx.de>
11940
11941 * dbusbind.c (Fdbus_register_method): Mention the return value
11942 :ignore in the docstring.
11943
44f92739
GM
119442012-02-02 Glenn Morris <rgm@gnu.org>
11945
1b9f60cc
GM
11946 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11947
44f92739
GM
11948 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11949 Unconditionally set to t. (Bug#10673)
11950 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11951 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11952 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11953
c5d3843c
KH
119542012-02-02 Kenichi Handa <handa@m17n.org>
11955
11956 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11957 0, do not call append_composite_glyph.
11958
159462d4 119592012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
11960
11961 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11962 NULL (Bug#6988).
11963 (x_produce_glyphs): If the component of a composition is a null
11964 string, set it->pixel_width to 1 to avoid zero-width glyph.
11965
78cef877
EZ
119662012-02-01 Eli Zaretskii <eliz@gnu.org>
11967
11968 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11969 first 2 arguments are identical. This makes inserting large
11970 output from a subprocess an order of magnitude faster on
11971 MS-Windows, where all sbrk'ed memory is always contiguous.
11972
97897668
GM
119732012-01-31 Glenn Morris <rgm@gnu.org>
11974
11975 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 11976 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
11977 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11978
31fd3586
GM
119792012-01-29 Glenn Morris <rgm@gnu.org>
11980
11981 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11982
0e24a8b2
CY
119832012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11984
11985 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11986
cc0adcb0
CY
119872012-01-28 Chong Yidong <cyd@gnu.org>
11988
11989 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11990
acc28cb9
CY
119912012-01-26 Chong Yidong <cyd@gnu.org>
11992
9c69cfb7
CY
11993 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11994
acc28cb9
CY
11995 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11996 repeat counts (Bug#10507).
11997
48da7392
GM
119982012-01-26 Glenn Morris <rgm@gnu.org>
11999
12000 * lread.c (syms_of_lread): Doc fix.
12001
14af5f7f
CY
120022012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
12003
12004 * coding.c (encode_designation_at_bol): Change return value to
12005 EMACS_INT.
12006
0b21c100
CY
120072012-01-25 Chong Yidong <cyd@gnu.org>
12008
12009 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
12010
3c2907f7
CY
120112012-01-21 Chong Yidong <cyd@gnu.org>
12012
12013 * floatfns.c (Fcopysign): Make the second argument non-optional,
12014 since nil is not allowed anyway.
12015
959ad23f
AS
120162012-01-21 Andreas Schwab <schwab@linux-m68k.org>
12017
12018 * process.c (read_process_output): Use p instead of XPROCESS (proc).
12019 (send_process): Likewise.
12020
34a02f46
MR
120212012-01-19 Martin Rudalics <rudalics@gmx.at>
12022
12023 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
12024 (Vwindow_persistent_parameters): Do not use Qstate.
12025 Rewrite doc-strings.
34a02f46 12026
1259009a 120272012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
12028
12029 * character.c (char_width): New function.
70d4fdf6
GM
12030 (Fchar_width, c_string_width, lisp_string_width):
12031 Use char_width (Bug#9496).
25ed9e61 12032
6a6ee00d
MR
120332012-01-16 Martin Rudalics <rudalics@gmx.at>
12034
12035 * window.c (Vwindow_persistent_parameters): New variable.
12036 (Fset_window_configuration, save_window_save): Handle persistent
12037 window parameters.
12038
c85efaf7
EZ
120392012-01-14 Eli Zaretskii <eliz@gnu.org>
12040
12041 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
12042 thrashing the stack of the thread. (Bug#9087)
12043
5944709e
PE
120442012-01-12 Paul Eggert <eggert@cs.ucla.edu>
12045
12046 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
12047
e71f5d99
EZ
120482012-01-11 Eli Zaretskii <eliz@gnu.org>
12049
12050 * xdisp.c (rows_from_pos_range): Handle the case where the
12051 highlight ends on a newline. (Bug#10464)
12052 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
12053 he end column for display of highlight that ends on a newline
12054 before a R2L line.
12055
ce316182
GM
120562012-01-11 Glenn Morris <rgm@gnu.org>
12057
12058 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
12059 from load-path also when installation-directory is nil. (Bug#10208)
12060
5b43da69
GM
120612012-01-10 Glenn Morris <rgm@gnu.org>
12062
74cc8ff9
GM
12063 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
12064
7d8d6e4e
GM
12065 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
12066 Update template values to be closer to their typical values these days.
5b43da69 12067
a0db8d43
EZ
120682012-01-09 Eli Zaretskii <eliz@gnu.org>
12069
12070 * xdisp.c (rows_from_pos_range): Accept additional argument
12071 DISP_STRING, and accept any glyph in a row whose object is that
12072 string as eligible for mouse highlight. Fixes mouse highlight of
12073 display strings from overlays. (Bug#10464)
12074
9a0115ab 120752012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 12076
b9110d6a 12077 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
12078 * fileio.c (auto_saving_dir_umask): New static var.
12079 (Fmake_directory_internal): Use it.
12080 (do_auto_save_make_dir): Set it, instead of invoking chmod after
12081 creating the directory. The old code temporarily assigns
12082 too-generous permissions to the directory.
12083 (do_auto_save_eh): Clear it.
b9110d6a 12084 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
12085 that the var is always cleared.
12086
6c1bd3f3
EZ
120872012-01-07 Eli Zaretskii <eliz@gnu.org>
12088
12089 * search.c (scan_buffer): Pass character positions to
12090 know_region_cache, not byte positions. (Bug#6540)
12091
069d2b50
L
120922012-01-07 LynX <_LynX@bk.ru> (tiny change)
12093
12094 * w32.c (sys_rename): Report EXDEV when rename of a directory
12095 fails because the target is on another logical disk. (Bug#10284)
12096
75bf0d33
DB
120972012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
12098
12099 * xterm.c (x_embed_request_focus): New function.
12100
12101 * xterm.h: Add prototype.
12102
12103 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
12104
1c6e5a32
GM
121052012-01-05 Glenn Morris <rgm@gnu.org>
12106
12107 * emacs.c (emacs_copyright): Update short copyright year to 2012.
12108
651e947e
EZ
121092012-01-01 Eli Zaretskii <eliz@gnu.org>
12110
12111 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
12112 Load gnutls_transport_set_lowat only if GnuTLS version is below
12113 2.11.1.
12114 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
12115 GnuTLS versions below 2.11.1.
12116
3778cdd8
AL
121172011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
12118
12119 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
12120 to the doc string advising against its use for altering the way
12121 windows are scrolled.
12122
0e5317f7
KH
121232011-12-28 Kenichi Handa <handa@m17n.org>
12124
12125 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
12126 coding-system ASCII compatible only when it does not produce BOM
12127 on encoding (Bug#10383).
12128
93d5ca1f
JD
121292011-12-26 Jan Djärv <jan.h.d@swipnet.se>
12130
12131 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
12132 can scroll.
12133 (create_and_show_popup_menu): Always use menu_position_func for
12134 Gtk3 (Bug#10361).
12135
ca22b785
AS
121362011-12-24 Andreas Schwab <schwab@linux-m68k.org>
12137
12138 * callint.c (Fcall_interactively): Don't truncate prompt string.
12139
d048e1e6
EZ
121402011-12-23 Eli Zaretskii <eliz@gnu.org>
12141
12142 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
12143 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 12144 resumed from there (after widening). (Bug#10360)
d048e1e6 12145
5ccaba1f
JD
121462011-12-22 Jan Djärv <jan.h.d@swipnet.se>
12147
12148 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
12149
204ee57f
JD
121502011-12-21 Jan Djärv <jan.h.d@swipnet.se>
12151
b81d40f0
JB
12152 * nsterm.m (x_free_frame_resources):
12153 Release f->output_data.ns->miniimage.
204ee57f
JD
12154 (ns_index_color): Fix indentation. Do not retain
12155 color_table->colors[i].
12156
12157 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
12158 before returning.
12159
12160 * nsfns.m (x_set_background_color): Assign return value from
12161 ns_index_color to face-background instead of NSColor*.
12162 (ns_implicitly_set_icon_type): Fix indentation.
12163 Change assignment in for loop to comparison.
12164
12165 * emacs.c (ns_pool): New variable.
12166 (main): Assign ns_pool.
12167 (Fkill_emacs): Call ns_release_autorelease_pool.
12168
12169 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
12170 autorelease fdesc, release fdAttrs and tdict.
12171 (ns_get_covering_families): Release charset.
12172 (ns_findfonts): Release NSFontDescriptor created with new.
12173 (ns_uni_to_glyphs): Fix indentation.
12174 (setString): Release attrStr before assigning new value.
12175
c803b2b7
JD
121762011-12-18 Jan Djärv <jan.h.d@swipnet.se>
12177
678f4426
JD
12178 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
12179 and NS_IMPL_COCOA.
12180 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
12181 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
12182
cd394be1 121832011-12-18 David Reitter <reitter@cmu.edu>
678f4426 12184
5fecd5fc
JD
12185 * nsterm.m (ns_term_init): Subscribe for notifications
12186 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
12187 to method trackingNotification in EmacsMenu.
12188
12189 * nsmenu.m (trackingMenu): New variable.
3771cb17 12190 (trackingNotification): New method (from Aquamacs).
5fecd5fc 12191 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 12192 from Aquamacs (Bug#7030).
678f4426
JD
12193
121942011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 12195
c803b2b7
JD
12196 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
12197 (symbol_to_nsstring): Fix indentation.
12198 (ns_symbol_to_pb): New function.
cae07000
SM
12199 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
12200 (Fns_rotate_cut_buffers_internal): Remove.
12201 (Fns_store_selection_internal): Rename from
c803b2b7
JD
12202 Fns_store_cut_buffer_internal.
12203 (ns_get_foreign_selection, Fx_own_selection_internal)
12204 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
12205 (Fns_get_selection_internal, Fns_store_selection_internal):
12206 Use ns_symbol_to_pb and check if return value is nil.
12207 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
12208 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
12209 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
12210 renamed to Sns_store_selection_internal.
12211 (ns_handle_selection_request): Move code to Fx_own_selection_internal
12212 and remove this function.
12213 (ns_handle_selection_clear): Remove, never used.
12214 (Fx_own_selection_internal): Move code from ns_handle_selection_request
12215 here.
12216
e1b01a3a
KB
122172011-12-17 Ken Brown <kbrown@cornell.edu>
12218
12219 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
12220 GID is unknown (Bug#10257).
12221
2adb6e85
PE
122222011-12-17 Paul Eggert <eggert@cs.ucla.edu>
12223
12224 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
12225 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
12226 which caused a build failure on GNU/Linux IA-64. This problem was
12227 introduced by my 2011-10-07 patch.
12228
d1d7b339
JL
122292011-12-15 Juri Linkov <juri@jurta.org>
12230
12231 * image.c (imagemagick_error): New function. (Bug#10112)
12232 (imagemagick_load_image): Comment out `MagickSetResolution' call.
12233 Use `imagemagick_error' where ImageMagick functions return
12234 `MagickFalse'.
12235 (Fimagemagick_types): Add `Fnreverse' to return the list in the
12236 proper order.
12237
100d5755
KH
122382011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12239
12240 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
12241 fill background (Bug#8992).
12242
454592a6
MR
122432011-12-13 Martin Rudalics <rudalics@gmx.at>
12244
12245 * window.c (Vwindow_combination_resize)
12246 (Vwindow_combination_limit): Use t instead of non-nil in
12247 doc-strings.
61d4b438
MR
12248 (Vrecenter_redisplay): Add first sentence of doc-string on
12249 separate line.
53524d93 12250 (Frecenter): Fix doc-string typo.
454592a6 12251
3633e3aa
KH
122522011-12-11 Kenichi Handa <handa@m17n.org>
12253
12254 * coding.c (Funencodable_char_position): Pay attention to the
12255 buffer text relocation (Bug#9389).
12256
7b9d523a 122572011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 12258
7b9d523a
JD
12259 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
12260 gtk_init (Bug#10100).
12261
b73189c6
EZ
122622011-12-10 Eli Zaretskii <eliz@gnu.org>
12263
12264 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
12265 IT->string is nil. (Bug#10263)
12266
f7dfe5d6
JD
122672011-12-10 Jan Djärv <jan.h.d@swipnet.se>
12268
83faebb4
JD
12269 * nsterm.h (x_free_frame_resources): Declare.
12270
f7dfe5d6
JD
12271 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
12272 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
12273
12274 * nsterm.h (ns_get_defaults_value): Declare.
12275
12276 * nsterm.m (ns_default): Call ns_get_defaults_value.
12277
7cd4e72c
EZ
122782011-12-09 Eli Zaretskii <eliz@gnu.org>
12279
12280 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12281 (Bug#10170)
12282
b34d7317
YM
122832011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12284
12285 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12286 that where the value of an _OBJC_* symbol points to is in the .bss
12287 section (Bug#10240).
12288
76470ad1
KH
122892011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12290
12291 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 12292 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 12293
745fff94
KH
122942011-12-08 Kenichi Handa <handa@m17n.org>
12295
12296 * ftfont.c (get_adstyle_property): Fix previous change
12297 (Bug#10233).
12298
6e44397c
JB
122992011-12-07 Juanma Barranquero <lekktu@gmail.com>
12300
12301 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12302 dirs from the default value of EMACSLOADPATH (bug#10208).
12303
7efa6272
GM
123042011-12-07 Glenn Morris <rgm@gnu.org>
12305
12306 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12307 installation and source directories as well. (Bug#10208)
12308
f6fc4d87
CY
123092011-12-06 Chong Yidong <cyd@gnu.org>
12310
12311 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12312
2bf26180
GM
123132011-12-06 Glenn Morris <rgm@gnu.org>
12314
12315 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12316 as an error, not just -1. (Bug#10217)
12317
3a6ad4f0
CY
123182011-12-05 Chong Yidong <cyd@gnu.org>
12319
12320 * keyboard.c (process_special_events): New function.
12321 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12322
75a3b399
PE
123232011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12324
12325 * coding.c (encode_designation_at_bol): Don't use uninitialized
12326 local variable (Bug#9318).
12327
c3c9e25e
KH
123282011-12-05 Kenichi Handa <handa@m17n.org>
12329
12330 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12331 return Qnil (Bug#8046, Bug#10193).
12332
5eb05ea3
KH
123332011-12-05 Kenichi Handa <handa@m17n.org>
12334
12335 * coding.c (encode_designation_at_bol): New args charbuf_end and
12336 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
12337 (coding_set_source): Return how many bytes coding->source was
12338 relocated.
12339 (coding_set_destination): Return how many bytes
12340 coding->destination was relocated.
12341 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 12342 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
12343
123442011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12345
12346 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12347 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12348 macro (Bug#9318).
12349
123502011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12351
12352 The following changes are to fix Bug#9318.
12353
a79703f5 12354 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
12355 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12356 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 12357 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 12358
7dbda6df
JB
123592011-12-05 Juanma Barranquero <lekktu@gmail.com>
12360
12361 * lisp.h (process_quit_flag): Fix external declaration.
12362
6d5eb5b0
SM
123632011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12364
12365 Don't macro-inline non-performance-critical code.
12366 * eval.c (process_quit_flag): New function.
12367 * lisp.h (QUIT): Use it.
12368
a0c3fad0
JD
123692011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12370
12371 * nsfns.m (get_geometry_from_preferences): New function.
12372 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12373
6c07aac2
AS
123742011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12375
12376 * emacs.c (Qkill_emacs): Define.
12377 (syms_of_emacs): Initialize it.
12378 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12379 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
12380 (quit_throw_to_read_char): Add parameter `from_signal'.
12381 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
12382 * lisp.h (QUIT): Call Fkill_emacs if requested.
12383
c052ead4
JD
123842011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12385
12386 * widget.c (update_wm_hints): Return if wmshell is null.
12387 (widget_update_wm_size_hints): New function.
12388
12389 * widget.h (widget_update_wm_size_hints): Declare.
12390
12391 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12392 widget_update_wm_size_hints (Bug#10104).
12393
9e49252b
EZ
123942011-12-03 Eli Zaretskii <eliz@gnu.org>
12395
12396 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12397 before a newline, prepare the bidi iterator for consuming the
12398 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 12399 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 12400
02b16839
JL
124012011-12-02 Juri Linkov <juri@jurta.org>
12402
12403 * search.c (Fword_search_regexp): New Lisp function created from
12404 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12405 (Fword_search_backward, Fword_search_forward)
12406 (Fword_search_backward_lax, Fword_search_forward_lax):
12407 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12408 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12409
0068070e
SM
124102011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12411
12412 * fileio.c (Finsert_file_contents): Move after-change-function call
12413 to before the "handled:" label, since all "goto handled" appear in
12414 cases where the *-change-functions have already been properly called
12415 (bug#10117).
12416
3360a3fc
AS
124172011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12418
12419 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12420 waiting for input. (Bug#10169)
12421
73d6c093
EZ
124222011-11-30 Eli Zaretskii <eliz@gnu.org>
12423
12424 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12425 verifies glyph row's hash code--we have just reallocated the
12426 glyphs, so their contents can be complete garbage. (Bug#10164)
12427
febe6bea
JB
124282011-11-30 Juanma Barranquero <lekktu@gmail.com>
12429
12430 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12431
801a4313
EZ
124322011-11-30 Eli Zaretskii <eliz@gnu.org>
12433
12434 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12435 attributes are tested _before_ calling verify_row_hash, to protect
12436 against GCC re-ordering of the tests. (Bug#10164)
12437
2b56b87e
JD
124382011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12439
12440 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12441
12442 * xterm.c (handle_one_xevent): Only set async_visible and friends
12443 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 12444 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
12445 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12446
dbf31225
PE
124472011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12448
12449 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12450 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12451 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12452 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12453 All uses changed to use GCPRO1 etc.
12454 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12455 Revert to old implementation (i.e., before 2011-03-11).
12456
1305621b
YM
124572011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12458
12459 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12460 of scroll runs so as to avoid assigning disabled bogus rows and
12461 unnecessary graphics copy operations.
12462
8c9afb46
EZ
124632011-11-27 Eli Zaretskii <eliz@gnu.org>
12464
12465 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12466 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12467 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12468 (malloc, free, realloc, calloc): Redirect to e_* only when
12469 compiling Emacs.
12470
12471 * lisp.h (GCTYPEBITS): Move before first use.
12472 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12473 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12474 this macro definition.
12475
12476 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12477 _MSC_VER.
12478
54e9e3bf
JD
124792011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12480
6d5eb5b0
SM
12481 * gtkutil.c (xg_create_frame_widgets):
12482 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
12483 present with Gtk+ 2.0.
12484
83aca1cb
PE
124852011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12486
12487 * fileio.c (Finsert_file_contents): Undo previous change; see
12488 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12489
5b76caa4
PE
124902011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12491
12492 Rename locals to avoid shadowing.
12493 * fileio.c (Finsert_file_contents):
12494 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12495 * process.c (wait_reading_process_output):
12496 Rename inner 'proc' to 'p' to avoid shadowing.
12497 Indent for consistency with usual Emacs style.
12498
8c535114
EZ
124992011-11-25 Eli Zaretskii <eliz@gnu.org>
12500
12501 * xdisp.c (redisplay_window): If cursor row is not fully visible
12502 after recentering, and scroll-conservatively is set to a large
12503 number, scroll window by a few more lines to make the cursor fully
12504 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
12505 (start_display): Don't move to the next line if the display should
12506 start at a newline that is part of a display vector or an overlay
12507 string. (Bug#10119)
8c535114 12508
fa4fdb5c
JL
125092011-11-24 Juri Linkov <juri@jurta.org>
12510
12511 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12512 after the `MagickPingImage' call. (Bug#10112)
12513
90ec88df
CY
125142011-11-23 Chong Yidong <cyd@gnu.org>
12515
12516 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12517
56e2e794
MR
125182011-11-23 Martin Rudalics <rudalics@gmx.at>
12519
12520 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12521 making another buffer current. (Bug#10114)
12522
b6e64c41
GM
125232011-11-23 Glenn Morris <rgm@gnu.org>
12524
12525 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12526
6b21de18
CY
125272011-11-23 Chong Yidong <cyd@gnu.org>
12528
12529 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12530 using it (Bug#5984).
12531
b12cd789
EZ
125322011-11-22 Eli Zaretskii <eliz@gnu.org>
12533
12534 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12535 and header-lines, as they don't have one computed for them.
12536 (Bug#10098)
12537
12538 * .gdbinit (prow): Make displayed values more self-explaining.
12539 Add row's hash code.
12540
261b6fd4
LMI
125412011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12542
12543 * process.c (wait_reading_process_output): Fix asynchrounous
12544 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 12545 (wait_reading_process_output): Add comment and URL.
261b6fd4 12546
e7cfd277
JD
125472011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12548
12549 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12550
a9b9b7f5
CY
125512011-11-21 Chong Yidong <cyd@gnu.org>
12552
12553 * window.c (Fnext_window, Fprevious_window): Doc fix.
12554
b0d15b4f
SM
125552011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12556
12557 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12558
fe7a3057
JB
125592011-11-20 Juanma Barranquero <lekktu@gmail.com>
12560
12561 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12562
d2999b1a
MR
125632011-11-20 Martin Rudalics <rudalics@gmx.at>
12564
12565 * window.c (Fset_window_combination_limit): Rename argument
12566 STATUS to LIMIT.
12567 (Vwindow_combination_limit): Remove "status" from doc-string.
12568
d5ff9cd0
AS
125692011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12570
12571 * m/ibms390.h: Remove.
12572 * m/ibms390x.h: Don't include "ibms390.h".
12573
a5bb9bd3
SM
125742011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12575
12576 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12577 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12578
cd1181db
JB
125792011-11-20 Juanma Barranquero <lekktu@gmail.com>
12580
12581 * casetab.c (Fset_case_table):
12582 * charset.c (Fcharset_after): Fix typos.
12583
615a3b8d 125842011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 12585
17e845af
PE
12586 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12587 Otherwise, valgrind does not work on some platforms.
12588 Problem reported by Andreas Schwab in
6a0bf43d
PE
12589 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12590 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12591 is set, removing the need for VIRT_ADDRESS_VARIES.
12592 (PURE_P): Use a more-efficient implementation that needs just one
12593 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12594 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12595 to 4 (xorl, subq, cmpq, setbe).
12596 * alloc.c (pure): Always extern now, since that's the
12597 VIRT_ADDR_VARIES behavior.
12598 (PURE_POINTER_P): Use a single comparison, not two, for
12599 consistency with the new puresize.h.
12600 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12601 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12602 Remove VIRT_ADDR_VARIES no longer needed.
12603
f8fe6f96
EZ
126042011-11-19 Eli Zaretskii <eliz@gnu.org>
12605
12606 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12607 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12608 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12609 behave as if the cursor position were at the window margin.
12610
12611 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12612 and the cursor position is out of bounds, behave as if the cursor
12613 position were at the window margin. (Bug#10075)
12614
df05a53c
CY
126152011-11-18 Chong Yidong <cyd@gnu.org>
12616
12617 * window.c (Fwindow_combination_limit): Make first argument
12618 non-optional, since it is meaningless for live windows like the
12619 selected window.
61ccba97 12620
2071918e
DA
126212011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12622
12623 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12624
b50a28de
SM
126252011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12626
12627 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12628 (graft_intervals_into_buffer): Simplify.
12629
015137db
EZ
126302011-11-18 Eli Zaretskii <eliz@gnu.org>
12631
12632 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12633 hash values of the two rows.
12634 (copy_row_except_pointers): Preserve the used[] arrays and the
12635 hash values of the two rows. (Bug#10035)
68c95424 12636 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
12637
12638 * xdisp.c (row_hash): New function, body extracted from
12639 compute_line_metrics.
12640 (compute_line_metrics): Call row_hash, instead of computing the
12641 hash code inline.
12642
12643 * dispnew.c (verify_row_hash): Call row_hash for computing the
12644 hash code of a row, instead of duplicating code from xdisp.c.
12645
12646 * dispextern.h (row_hash): Add prototype.
12647
a2addb04
TH
126482011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12649
12650 * frame.c (delete_frame): Don't delete the terminal when the last
12651 X frame is closed if emacs is built with GTK toolkit.
12652
df85d315
JB
126532011-11-17 Juanma Barranquero <lekktu@gmail.com>
12654
12655 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12656
a0c2d0ae
MR
126572011-11-17 Martin Rudalics <rudalics@gmx.at>
12658
12659 * window.c (Vwindow_splits): Rename to
12660 Vwindow_combination_resize. Suggested by Juri Linkov.
12661 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12662 of Vwindow_splits.
12663
58179cce
JB
126642011-11-16 Juanma Barranquero <lekktu@gmail.com>
12665
7877f373
JB
12666 * nsfns.m (Fns_font_name):
12667 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 12668
b6f67890
MR
126692011-11-16 Martin Rudalics <rudalics@gmx.at>
12670
12671 * window.h (window): Rename slot "nest" to "combination_limit".
12672 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12673 (Fset_window_nest): Rename to Fset_window_combination_limit.
12674 (Vwindow_nest): Rename to Vwindow_combination_limit.
12675 (recombine_windows, make_parent_window, make_window)
12676 (Fsplit_window_internal, saved_window)
12677 (Fset_window_configuration, save_window_save): Rename all
12678 occurrences of window_nest to window_combination_limit.
12679
c7015153
JB
126802011-11-15 Juanma Barranquero <lekktu@gmail.com>
12681
12682 * image.c (imagemagick_load_image): Fix typo.
12683
322ad6ec
EZ
126842011-11-14 Eli Zaretskii <eliz@gnu.org>
12685
12686 * xdisp.c (display_line): Move the call to
12687 highlight_trailing_whitespace before the call to
12688 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
12689 faces of all the glyphs to compute ROW's hash value.
12690 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 12691
f067b8ec
JB
126922011-11-14 Juanma Barranquero <lekktu@gmail.com>
12693
12694 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12695 just return (bug#10044).
12696
1e5b2111
EZ
126972011-11-12 Eli Zaretskii <eliz@gnu.org>
12698
7ef3cbd5
EZ
12699 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12700 with user-defined heap size. Bump the default size of the temacs
12701 heap to 27MB, to avoid memory warning when running temacs.
12702 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12703
1e5b2111
EZ
12704 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12705 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
12706 (verify_row_hash) [XASSERTS]: New function.
12707 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12708 that the hash value of glyph rows is correct.
1e5b2111 12709
89d61221
MR
127102011-11-12 Martin Rudalics <rudalics@gmx.at>
12711
12712 * window.h (window): Remove splits slot.
12713 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12714 (Fdelete_other_windows_internal, make_parent_window)
12715 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12716 (Fset_window_configuration, save_window_save): Don't deal with
12717 split status of windows.
12718 (saved_window): Remove splits slot.
12719 (Vwindow_splits): Rewrite doc-string.
12720
97f18cc8
JD
127212011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12722
12723 * xfns.c (unwind_create_frame):
12724 * nsfns.m (unwind_create_frame):
12725 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12726 Vframe_list (Bug#9999).
12727
22a648b4
DA
127282011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12729
0b381c7e 12730 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 12731
659afede
KH
127322011-11-11 Kenichi Handa <handa@m17n.org>
12733
12734 * callproc.c (Fcall_process): Set the member dst_multibyte of
12735 process_coding.
12736
9ac0394b
KH
127372011-11-11 Johan Bockgård <bojohan@gnu.org>
12738
12739 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12740 avoid a crash (bug#9496).
12741
2fbdc249
CY
127422011-11-09 Chong Yidong <cyd@gnu.org>
12743
12744 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12745 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12746
ac6b1f81
PE
127472011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12748
12749 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12750
09db192c
PE
127512011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12752
12753 Avoid some portability problems by eschewing 'extern inline' functions.
12754 The trivial performance wins aren't worth the portability hassles; see
12755 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12756 et seq.
12757 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12758 (window_box_width, window_box_left, window_box_left_offset)
12759 (window_box_right, window_box_right_offset): Undo previous change,
12760 by removing the "extern"s.
12761 * intervals.c (adjust_intervals_for_insertion)
12762 (adjust_intervals_for_deletion): Undo previous change,
12763 making these static again.
12764 (offset_intervals, temp_set_point_both, temp_set_point)
12765 (copy_intervals_to_string): No longer inline.
12766 * xdisp.c (window_text_bottom_y, window_box_width)
12767 (window_box_height, window_box_left_offset)
12768 (window_box_right_offset, window_box_left, window_box_right)
12769 (window_box): No longer inline.
12770
105216ed
CY
127712011-11-08 Chong Yidong <cyd@gnu.org>
12772
12773 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
12774 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12775 Signal an error if not a live window.
105216ed
CY
12776 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12777 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12778
ae9e237f
JB
127792011-11-07 Juanma Barranquero <lekktu@gmail.com>
12780
12781 * lisp.h (syms_of_abbrev): Remove declaration.
12782 Reported by CHENG Gao <chenggao@royau.me>.
12783
c7aa8333
EZ
127842011-11-07 Eli Zaretskii <eliz@gnu.org>
12785
12786 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12787 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12788 of temacs in GUI mode.
12789
be7f5545
MR
127902011-11-07 Martin Rudalics <rudalics@gmx.at>
12791
12792 * window.h: Declare delete_all_child_windows instead of
12793 delete_all_subwindows.
12794 * window.c (Fwindow_nest, Fset_window_nest)
12795 (Fset_window_new_total, Fset_window_new_normal)
12796 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12797 (delete_all_subwindows): Rename to delete_all_child_windows.
12798 (Fdelete_other_windows_internal, Fset_window_configuration):
12799 Call delete_all_child_windows instead of delete_all_subwindows.
12800 * frame.c (delete_frame): Call delete_all_child_windows instead
12801 of delete_all_subwindows.
12802
ca78dc43
PE
128032011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12804
12805 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12806 This is also needed for porting to any host where GC_MARK_STACK is
12807 not GC_MAKE_GCPROS_NOOPS.
12808 (which_symbols): Use it.
12809
a0241d01
KH
128102011-11-07 Kenichi Handa <handa@m17n.org>
12811
12812 * coding.c (coding_set_destination): Check coding->src_pos only
12813 when coding->src_object is a buffer (bug#9910).
12814
12815 * process.c (send_process): Set the member src_multibyte of coding
12816 to 0 (bug#9911) when sending a unibyte text.
12817
12818 * callproc.c (Fcall_process): Set the member src_multibyte of
12819 process_coding to 0 (bug#9912).
12820
a64bfdfa 128212011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
12822
12823 * xmenu.c (cleanup_widget_value_tree): New function.
12824 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12825 calling free_menubar_widget_value_tree directly (Bug#9830).
12826
cb41b32a
PE
128272011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12828
12829 Fix some portability problems with 'inline'.
12830 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12831 (window_box_width, window_box_left, window_box_left_offset)
12832 (window_box_right, window_box_right_offset): Declare extern.
12833 Otherwise, these inline functions do not conform to C99 and
12834 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12835 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12836 * intervals.c (adjust_intervals_for_insertion)
12837 (adjust_intervals_for_deletion): Now extern, because otherwise the
12838 extern inline functions 'offset_intervals' couldn't refer to it.
12839 (static_offset_intervals): Remove.
12840 (offset_intervals): Rewrite using the old contents of
12841 static_offset_intervals. The old version didn't conform to C99
12842 because an extern inline function contained a reference to an
12843 identifier with static linkage.
12844
b7041366
AS
128452011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12846
12847 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12848 GC.
12849
88a37c4d
EZ
128502011-11-06 Eli Zaretskii <eliz@gnu.org>
12851
12852 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12853 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12854 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12855 return Qleft_to_right.
12856
49745b39
CY
128572011-11-06 Chong Yidong <cyd@gnu.org>
12858
12859 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12860 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12861 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12862 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12863 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12864 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12865 (Fwindow_vscroll): Doc fix.
12866 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12867 argument, since it makes no sense to pass a live window and for
12868 consistency with window-child.
12869
1f05cd82
CS
128702011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12871
12872 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12873 support MSVC.
12874
22610910
JR
128752011-11-05 Jason Rumney <jasonr@gnu.org>
12876
12877 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12878 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12879 fonts (Bug#6029).
12880 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12881 bitwise arithmetic preventing use of unicode-sip and non-truetype
12882 opentype fonts.
12883
a06776b2
EZ
128842011-11-05 Eli Zaretskii <eliz@gnu.org>
12885
3ad924ba
EZ
12886 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12887 "emacs"-only part.
12888
a06776b2
EZ
12889 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12890 initialization code to keep similarity to xfns.c after changes
12891 from 2011-11-05.
12892
c9e7db78
JD
128932011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12894
a97f8f3f
JD
12895 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12896 (unwind_create_frame): New function (Bug#9943).
12897 (Fx_create_frame): Restructure code to be more similar to the one in
12898 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12899 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12900 Move terminal->reference_count++ just before making the frame official
12901 (Bug#9943).
12902
12903 * nsterm.m (x_free_frame_resources): New function.
12904 (x_destroy_window): Move code to x_free_frame_resources.
12905
c9e7db78 12906 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
12907 (Fx_create_frame, x_create_tip_frame):
12908 Move terminal->reference_count++ just before making the frame
75f1671a 12909 official. Move initialization of image_cache_refcount and
c9e7db78
JD
12910 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12911
a6fc3b5c
EZ
129122011-11-05 Eli Zaretskii <eliz@gnu.org>
12913
12914 Support MSVC build with newer versions of Visual Studio.
12915 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12916 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12917 nt/gmake.defs.
12918
12919 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12920 which are not supported by MSVC.
12921 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12922 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12923 bitfields.
12924 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12925 types in bitfields.
12926 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12927
12928 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12929
58179cce 129302011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
12931
12932 Support MSVC build with newer versions of Visual Studio.
12933 * w32.c: Don't include w32api.h for MSVC.
12934 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12935
12936 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12937 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12938 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12939 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12940 e_* cousins.
12941 (alloca) [_MSC_VER]: Define to _alloca.
12942
12943 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12944
12945 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12946
a58c13ed
EZ
129472011-11-04 Eli Zaretskii <eliz@gnu.org>
12948
12949 * xdisp.c (note_mouse_highlight): If either of
12950 previous/next-single-property-change returns nil, treat that as
12951 the beginning or the end of the buffer. (Bug#9955)
12952
fe0b6370
JD
129532011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12954
a58c13ed 12955 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
12956 label is not null (Bug#9951).
12957 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12958 may be NULL.
12959
89bd5ee1
EZ
129602011-11-04 Eli Zaretskii <eliz@gnu.org>
12961
12962 * window.c (Fwindow_body_size): Mention in the doc string that the
12963 return value is in frame's canonical units. (Bug#9949)
12964
84c3edb9
EZ
129652011-11-03 Eli Zaretskii <eliz@gnu.org>
12966
4e2fb5c7
EZ
12967 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12968
84c3edb9 12969 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 12970 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 12971 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 12972
bc17a887
EZ
129732011-11-01 Eli Zaretskii <eliz@gnu.org>
12974
12975 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12976 Don't stop backward scan on the continuation glyph, even though
12977 its CHARPOS is positive.
6d5eb5b0
SM
12978 (mouse_face_from_buffer_pos, note_mouse_highlight):
12979 Rename cover_string to disp_string.
bc17a887 12980
4ee88440
MR
129812011-11-01 Martin Rudalics <rudalics@gmx.at>
12982
12983 * window.c (temp_output_buffer_show): Don't use
12984 Vtemp_buffer_show_specifiers.
12985 (Vtemp_buffer_show_specifiers): Remove unused variable.
12986
c2ff3c02
EZ
129872011-10-30 Eli Zaretskii <eliz@gnu.org>
12988
12989 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12990 past the beginning of the current glyph matrix.
12991
58179cce 129922011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
12993
12994 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12995 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12996 HAVE_GTK3 (Bug#9869).
b77a6a7f 12997
3b574623
JD
12998 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12999 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
13000
b77a6a7f
JD
13001 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
13002
13003 * xterm.c: Declare x_handle_net_wm_state to return int.
13004 (handle_one_xevent): Check if we are iconified but don't have
13005 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
13006 (get_current_wm_state): Return non-zero if not hidden,
13007 check for _NET_WM_STATE_HIDDEN (Bug#9893).
13008 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
13009 (x_handle_net_wm_state): Return what get_current_wm_state returns.
13010 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
13011
196e41e4
PE
130122011-10-29 Paul Eggert <eggert@cs.ucla.edu>
13013
13014 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
13015 so that this new function doesn't get optimized away by a
13016 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
13017
021f2e1a
AS
130182011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13019
13020 * frame.h (MOUSE_HL_INFO): Remove excess parens.
13021
8b058d44
EZ
130222011-10-29 Eli Zaretskii <eliz@gnu.org>
13023
13024 Fix the `xbytecode' command.
13025 * .gdbinit (xprintbytestr): New command.
b50a28de 13026 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
13027 (xbytecode): Print the byte-code string as well.
13028
4452fb80
EZ
130292011-10-29 Kim Storm <storm@cua.dk>
13030
8b058d44
EZ
13031 * alloc.c (which_symbols): New function.
13032
21b72067
AS
130332011-10-29 Andreas Schwab <schwab@linux-m68k.org>
13034
13035 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
13036 line. (Bug#9903)
13037
83ed7b5c
GM
130382011-10-29 Glenn Morris <rgm@gnu.org>
13039
13040 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
13041 Not clear what it was for, and it causes various bugs. (Bug#9839)
13042
5a7a728b
EZ
130432011-10-28 Eli Zaretskii <eliz@gnu.org>
13044
13045 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
13046 possible random value that matches one of those tested as
13047 condition to clear the mouse face.
13048
d3d0842f
CY
130492011-10-28 Chong Yidong <cyd@gnu.org>
13050
13051 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
13052
31b39d13
DN
130532011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
13054
13055 * window.c (make_window): Initialize phys_cursor_on_p.
13056
9aba6043
SM
130572011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
13058
13059 * lisp.h (struct Lisp_Symbol): Update comments.
13060
c20992f4
JB
130612011-10-28 Juanma Barranquero <lekktu@gmail.com>
13062
13063 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
13064
db4f02f2
EZ
130652011-10-28 Eli Zaretskii <eliz@gnu.org>
13066
13067 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
13068 <oslsachem@gmail.com> for helping to debug this.
13069
13070 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
13071 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
13072 (g_b_init_get_glyph_outline_w): New static variables.
13073 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
13074 (GetGlyphOutlineW_Proc): New typedefs.
13075 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
13076 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
13077 New functions.
13078 (w32font_open_internal, compute_metrics):
13079 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
13080 instead of calling the "wide" APIs directly.
13081
13082 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
13083
13084 * w32.h (syms_of_w32font): Add prototype.
13085
87e68db4
JB
130862011-10-27 Juanma Barranquero <lekktu@gmail.com>
13087
13088 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
13089 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
13090 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
13091 (Fmove_to_window_line): Doc fix.
13092
435c1d67
CY
130932011-10-27 Chong Yidong <cyd@gnu.org>
13094
13095 * process.c (make_process): Set gnutls_state to NULL.
13096
13097 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
13098 non-NULL, regardless of GNUTLS_INITSTAGE.
13099 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
13100 an error. Set process slots as soon as we allocate them.
13101
13102 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
13103
9c6c6f49
CY
131042011-10-27 Chong Yidong <cyd@gnu.org>
13105
9aba6043
SM
13106 * gnutls.c (emacs_gnutls_deinit): New function.
13107 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
13108 (Fgnutls_deinit, Fgnutls_boot): Use it.
13109
13110 * process.c (make_process): Initialize GnuTLS credentials to NULL.
13111 (deactivate_process): Call emacs_gnutls_deinit.
13112
657d08d3
JB
131132011-10-27 Juanma Barranquero <lekktu@gmail.com>
13114
13115 * image.c (x_create_x_image_and_pixmap):
13116 * w32.c (sys_rename, w32_delayed_load):
13117 * w32font.c (fill_in_logfont):
13118 * w32reg.c (x_get_string_resource): Silence compiler warnings.
13119
5430d399
JB
131202011-10-26 Juanma Barranquero <lekktu@gmail.com>
13121
13122 * w32fns.c (w32_default_color_map): New function,
13123 extracted from Fw32_default_color_map.
a7ef684b 13124 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 13125
fe0055fa
PE
131262011-10-25 Paul Eggert <eggert@cs.ucla.edu>
13127
13128 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
13129
e6346438
SM
131302011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
13131
13132 * keyboard.c (test_undefined): New function (bug#9751).
13133 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
13134
e112cc37
ET
131352011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
13136
13137 * sysdep.c (init_sys_modes): Fix the check for the controlling
13138 terminal (Bug#6649).
13139
7b5d6677
EZ
131402011-10-20 Eli Zaretskii <eliz@gnu.org>
13141
13142 * dispextern.h (struct bidi_it): New member next_en_type.
13143
13144 * bidi.c (bidi_line_init): Initialize the next_en_type member.
13145 (bidi_resolve_explicit_1): When next_en_pos is valid for the
13146 current character, check also for next_en_type being WEAK_EN.
13147 (bidi_resolve_weak): Don't enter the expensive loop if the current
13148 position is before next_en_pos. Record the bidi type of the first
13149 non-ET, non-BN character we find, in addition to its position.
13150 (bidi_level_of_next_char): Invalidate next_en_type when
13151 next_en_pos is over-stepped.
13152
7da0b018
PE
131532011-10-20 Paul Eggert <eggert@cs.ucla.edu>
13154
13155 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
13156 * editfns.c: Rewrite current-time-zone so that it invokes
13157 the equivalent of (format-time-string "%Z") to get the time zone name.
13158 This fixes a bug when the time zone name contains characters that
13159 need converting from the system time locale to Emacs internal format.
13160 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
13161 that patch fixed format-time-string to do the conversion, but
13162 I forgot to fix current-time-zone.
13163 (format_time_string): New function, containing most of
13164 what Fformat_time_string used to contain.
13165 (Fformat_time_string): Rewrite in terms of format_time_string.
13166 This doesn't change this function's behavior.
13167 (current-time-zone): Rewrite to use format_time_string.
13168 This fixes the bug reported by Michael Schierl in
13169 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
13170 Jason Rumney's 2007-06-07 change worked around this bug, but
13171 didn't fix it.
13172 * systime.h (tzname, timezone): Remove no-longer-used declarations.
13173
8547b010
EZ
131742011-10-19 Eli Zaretskii <eliz@gnu.org>
13175
13176 * xdisp.c (start_display): If the character at POS is displayed
13177 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
13178 (try_window_reusing_current_matrix): If a line ends in a display
13179 vector or the next line starts in a display vector, continue
13180 redrawing the window even though the character position of
13181 start_row was reached.
8547b010
EZ
13182 (Bug#9771, part 2)
13183
4e948d15
CY
131842011-10-18 Chong Yidong <cyd@gnu.org>
13185
13186 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
13187 with nobreak-char-display too.
13188
4787455f
EZ
131892011-10-18 Eli Zaretskii <eliz@gnu.org>
13190
13191 Fix part 3 of bug#9771.
13192 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
13193 (bidi_resolve_neutral): Don't enter the expensive loop looking for
13194 non-neutral characters if the current character is a paragraph
13195 separator (a.k.a. Newline). This avoids running the same
13196 expensive loop twice, once when we consume the preceding newline
13197 and the other time when the line actually needs to be displayed.
13198 Avoid the loop when we see neutrals on the base embedding level
13199 following a character whose directionality is the same as the
13200 paragraph's. This avoids running the expensive loop when a line
13201 ends in a long sequence of neutrals, like control characters.
13202 Add assertion against STRONG_AL type. Slightly rearrange code
13203 that determines the type of a neutral given the first non-neutral
13204 that follows it.
13205 (bidi_level_of_next_char): Set next_en_pos to zero when
13206 invalidating its info.
13207
2c91f553
EZ
132082011-10-17 Eli Zaretskii <eliz@gnu.org>
13209
13210 * xdisp.c (push_display_prop): Determine whether to record string
13211 or buffer position by IT->string, not by IT->method. Allow
13212 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
13213 (move_it_vertically_backward): Don't look for character position
13214 immediately after the newline when in a continuation line.
13215 (Bug#9771, part 1)
2c91f553 13216
c7b08b0d
MR
132172011-10-15 Martin Rudalics <rudalics@gmx.at>
13218
13219 * window.c (coordinates_in_window): Rewrite and delabelize
13220 vertical border check. (Bug#5357) (Bug#9618)
13221
6b02f655
SM
132222011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
13223
13224 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
13225 errors in XSetWindowBorder (bug#9310).
13226
81d40c92
DA
132272011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
13228
13229 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
13230 avoid crash when xmalloc overrun checking is enabled.
13231
d4172c3b
EZ
132322011-10-13 Eli Zaretskii <eliz@gnu.org>
13233
13234 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
13235 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
13236 cursor motion with <left> and <right> arrow keys.
13237
13238 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
13239 some callers set that themselves.
13240
b00eea75
EZ
132412011-10-12 Eli Zaretskii <eliz@gnu.org>
13242
13243 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
13244 display string and the previous row comes from the same string and
13245 is empty. (Bug#9739) (Bug#9738)
13246
8fe012c4
SM
132472011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
13248
13249 * doc.c (get_doc_string): Encode file name (bug#9735).
13250
0074aef2
EZ
132512011-10-12 Eli Zaretskii <eliz@gnu.org>
13252
79beb178
EZ
13253 * bidi.c (bidi_level_of_next_char):
13254 * xdisp.c (get_visually_first_element): Remove old incorrect
13255 comments regarding the Unicode Line Separator character.
13256
0074aef2
EZ
13257 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
13258
6e4b3fbe
DA
132592011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
13260
13261 * alloc.c (Fgc_status): Do not access beyond zombies array
13262 boundary if nzombies > MAX_ZOMBIES.
13263 * alloc.c (dump_zombies): Add missing format specifier.
13264
0324f3af
PE
132652011-10-12 Paul Eggert <eggert@cs.ucla.edu>
13266
b5525cac
PE
13267 * xdisp.c (set_cursor_from_row): Simplify conditionals,
13268 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
13269
0324f3af
PE
13270 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
13271 Some packages use them to denote characters with modifiers.
13272
e9b5f888
AS
132732011-10-11 Andreas Schwab <schwab@linux-m68k.org>
13274
13275 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13276 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13277 matching a pp-number. Rename parameter var to var1.
13278
127827c0
SM
132792011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13280
13281 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13282
c8fd3bd0
GM
132832011-10-08 Glenn Morris <rgm@gnu.org>
13284
13285 * callint.c (Fcall_interactively): Give a more explicit error for the
13286 'c' case with a non-character input. (Bug#8479)
13287
352ec8ff
EZ
132882011-10-08 Eli Zaretskii <eliz@gnu.org>
13289
03669ccb
EZ
13290 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13291 lines.
7061c986
EZ
13292 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13293 lines that are hscrolled on the left.
03669ccb 13294
352ec8ff
EZ
13295 * dispnew.c (buffer_posn_from_coords): Account for a possible
13296 presence of header-line. (Bug#4426)
13297
a66cfb1c
SM
132982011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13299
6b02f655
SM
13300 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13301 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 13302
7c5ee88e
PE
133032011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13304
13305 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13306 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13307 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13308 this makes Emacs dump core during garbage collection on rare
13309 occasions. sizeof is obviously inferior to offsetof here, so
13310 stick with offsetof.
13311 (GC_POINTER_ALIGNMENT): New macro.
13312 (mark_memory): Omit 3rd (offset) arg; caller changed.
13313 Don't assume EMACS_INT alignment is the same as pointer alignment.
13314
df1bbe5b
SM
133152011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13316
13317 * keyboard.c (read_key_sequence_remapped): New var.
13318 (read_key_sequence): Compute remapping in the right buffer.
13319 (command_loop_1): Use read_key_sequence's remapping directly.
13320
51553db6
SM
133212011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13322
32c1fffd
SM
13323 * dired.c (file_name_completion): Don't expand file name.
13324 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13325 before checking file name handler.
13326
51553db6
SM
13327 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13328 they've been requested explicitly (bug#9591).
13329
b6bd1599 133302011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
13331
13332 * keymap.c (Fsingle_key_description): Use make_specified_string
13333 instead of build_string to build string from push_key_description.
13334 (Bug#5193)
13335
f701dc2a
PE
133362011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13337
4222c55d
PE
13338 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13339 This fixes a Y2038 bug on 64-bit hosts.
13340 * buffer.c (reset_buffer):
13341 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13342 (Fclear_buffer_auto_save_failure):
13343 Use 0, not -1, to represent an unset failure time, since time_t
13344 might not be signed.
13345
f701dc2a
PE
13346 Remove dependency on glibc malloc internals.
13347 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13348 Move back here from lisp.h, but with their new implementations.
13349 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13350 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13351 * charset.c (charset_table_init): New static var.
13352 (syms_of_charset): Use it instead of xmalloc. This removes a
13353 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13354 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13355 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13356 Move back to alloc.c.
13357 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13358 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13359
9ceebf39
JD
133602011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13361
13362 * nsterm.m (windowDidResize): Call x_set_window_size only when
13363 ns_in_resize is true. Otherwise set pixelwidth/height and
13364 call change_frame_size (Bug#9628).
13365
cb993c58
PE
133662011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13367
3930c88b
PE
13368 Port --enable-checking=all to Fedora 14 x86-64.
13369 * charset.c (syms_of_charset): Also account for glibc malloc's
13370 internal overhead when calculating the initial malloc maximum.
13371
cb993c58
PE
13372 Port --enable-checking=all to Fedora 14 x86.
13373 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13374 Move to lisp.h.
13375 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13376 (overrun_check_realloc, overrun_check_free):
13377 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13378 That way, xmalloc returns a properly-aligned pointer even if
13379 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13380 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13381 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13382 into account when calculating the initial malloc maximum.
13383 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13384 Move here from alloc.c, so that charset.c can use it too.
13385 Properly align; the old code wasn't right for common 32-bit hosts
13386 when configured with --enable-checking=all.
13387 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13388 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13389
31bed486
EZ
133902011-09-29 Eli Zaretskii <eliz@gnu.org>
13391
04c70788 13392 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
13393 use EDOM.
13394
fbcaa2f3
EZ
133952011-09-28 Eli Zaretskii <eliz@gnu.org>
13396
13397 * xdisp.c (compute_display_string_end): If there's no display
13398 string at CHARPOS, return -1.
13399
13400 * bidi.c (bidi_fetch_char): When compute_display_string_end
13401 returns a negative value, treat the character as a normal
13402 character not covered by a display string. (Bug#9624)
13403
a239d4e9
JB
134042011-09-28 Juanma Barranquero <lekktu@gmail.com>
13405
13406 * lread.c (Fread_from_string): Fix typo in docstring.
13407
88652fd5
EZ
134082011-09-27 Eli Zaretskii <eliz@gnu.org>
13409
13410 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13411 newline, reseat the iterator instead of bidi-iterating there one
13412 character at a time. (Bug#9610)
32c1fffd
SM
13413 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13414 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 13415
ed497dd4
AS
134162011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13417
13418 * lread.c (readevalloop): Use correct code for NBSP.
13419 (read1): Likewise. (Bug#9608)
13420
b2bf61aa
MA
134212011-09-25 Michael Albinus <michael.albinus@gmx.de>
13422
13423 * dbusbind.c (Fdbus_register_signal): When service is not
13424 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13425
32bbb17c
GM
134262011-09-25 Glenn Morris <rgm@gnu.org>
13427
13428 * buffer.c (truncate-lines): Doc fix.
13429
94e0933e
CY
134302011-09-24 Chong Yidong <cyd@stupidchicken.com>
13431
13432 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13433 (Fset_window_next_buffers): Doc fix.
13434
cddde921
GM
134352011-09-24 Glenn Morris <rgm@gnu.org>
13436
13437 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13438
1260aef1
PE
134392011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13440
25b4bfa0
PE
13441 Fix minor problems found by static checking.
13442 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
13443 * indent.c (Fvertical_motion): Fix == vs = typo.
13444
e3cbd34b
EZ
134452011-09-24 Eli Zaretskii <eliz@gnu.org>
13446
a66cfb1c
SM
13447 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13448 Default value is now t. Doc fix.
6bf7006f 13449
e3cbd34b 13450 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 13451 logic when moving up, not only when moving down. Fix the
e3cbd34b 13452 confusing name and values of the it_overshoot_expected variable;
32c1fffd 13453 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
13454
13455 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13456 CHARPOS is covered by a display string which includes newlines.
13457 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13458 is covered by a display string with embedded newlines.
13459
a3de0cbd
MA
134602011-09-24 Michael Albinus <michael.albinus@gmx.de>
13461
13462 * dbusbind.c (Fdbus_register_signal): Add match rule to
13463 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
13464 (Fdbus_register_method, Vdbus_registered_objects_table):
13465 Fix docstring.
a3de0cbd 13466
b260039d
JM
134672011-09-24 Jim Meyering <meyering@redhat.com>
13468
32c1fffd 13469 do not ignore write error for any output size
b260039d
JM
13470 The previous change was incomplete.
13471 While it makes emacs --batch detect the vast majority of stdout
13472 write failures, errors were still ignored whenever the output size is
13473 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13474 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13475 && echo FAIL: ignored write error
13476 FAIL: ignored write error
13477 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13478 && echo FAIL: ignored write error
13479 FAIL: ignored write error
13480 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13481
8eca8a7c
AS
134822011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13483
13484 * emacs.c (Fkill_emacs): In noninteractive mode exit
13485 non-successfully if a write error occurred on stdout. (Bug#9574)
13486
3341db62
EZ
134872011-09-21 Eli Zaretskii <eliz@gnu.org>
13488
13489 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13490 the xassert test.
13491
13492 * dispextern.h (struct it): Update the comment documenting what
13493 can it->OBJECT be.
13494
8c203dbf
EZ
134952011-09-20 Eli Zaretskii <eliz@gnu.org>
13496
13497 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13498 a display string, extend search for cursor position to end of row.
13499 (find_row_edges): If the row ends in a newline from a display
13500 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13501 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
13502 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13503 non-empty line. Fixes confusing cursor motion with arrow keys at
13504 the beginning of a line that starts with whitespace.
8c203dbf 13505
a4824228
LMI
135062011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13507
13508 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13509 (bug#9493).
13510
33ed493b
CY
135112011-09-18 Chong Yidong <cyd@stupidchicken.com>
13512
13513 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13514 boolean (Bug#9154).
13515
56cd55c8
EZ
135162011-09-18 Eli Zaretskii <eliz@gnu.org>
13517
13518 * xdisp.c (display_line): Record maximum and minimum buffer
13519 positions even if no glyphs were produced (e.g., by a zero-width
13520 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13521 buffer positions that will be removed from the glyph row because
13522 they don't fit.
c02dcedf
EZ
13523 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13524 column is beyond frame width: don't subtract 1 "pixel" when
13525 computing width of the stretch.
3e62b7e0
EZ
13526 (reseat_at_next_visible_line_start): Undo the change made on
13527 2011-09-17 that saved paragraph information and restored it after
13528 the call to `reseat'. (Bug#9545)
56cd55c8 13529
5ed99d36 135302011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
13531
13532 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13533 and turn window cursor on if cleared (Bug#9415).
13534
5ed99d36 135352011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
13536
13537 * search.c (boyer_moore): Take unibyte characters from pattern
13538 literally. (Bug#9458)
13539
9bade7b2
EZ
135402011-09-18 Eli Zaretskii <eliz@gnu.org>
13541
13542 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13543
e5e9d610
PE
135442011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13545
87e4427a
PE
13546 Fix minor problem found by static checking.
13547 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13548 initialized, to pacify gcc -Wuninitialized.
13549
e5e9d610
PE
13550 * fileio.c: Report proper errno when syscall falls.
13551 (Finsert_file_contents): Save and restore errno,
13552 so that report_file_error outputs the correct diagnostic.
13553 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13554
a1674f0b
EZ
135552011-09-18 Eli Zaretskii <eliz@gnu.org>
13556
13557 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13558
fbfb6dd4
EZ
135592011-09-17 Eli Zaretskii <eliz@gnu.org>
13560
13561 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13562 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13563
bb187662
EZ
135642011-09-17 Eli Zaretskii <eliz@gnu.org>
13565
1137e8b8 13566 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 13567 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
13568
13569 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13570 (bidi_find_paragraph_start): Search back for paragraph beginning
13571 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13572 (bidi_move_to_visually_next): Only trigger paragraph-related
13573 computations when the last character is a newline or at EOB, not
13574 just any NEUTRAL_B. (Bug#9470)
13575
bb187662
EZ
13576 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13577 truncated lines if point is covered by a display string. (Bug#9524)
13578
2e621251
PE
135792011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13580
13581 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13582 (cons_to_x_long): New function.
13583 (lisp_data_to_selection_data): Use it. Correct the test for
13584 short-versus-long data; it was negated. Break out of vector
13585 loop, for efficiency, when a long datum is discovered.
13586
91a15bc6
SM
135872011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13588
13589 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13590
b41c3a35
EZ
135912011-09-16 Eli Zaretskii <eliz@gnu.org>
13592
13593 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13594 GCC PR/17406) by declaring this function with external scope.
13595
7812ba2d
PE
135962011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13597
13598 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13599 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13600
cf7edc2a
AS
136012011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13602
13603 * editfns.c (Fformat): Correctly handle text properties on "%%".
13604
bd01620e
EZ
136052011-09-15 Eli Zaretskii <eliz@gnu.org>
13606
13607 * xterm.c (x_draw_composite_glyph_string_foreground):
13608 * w32term.c (x_draw_composite_glyph_string_foreground):
13609 * term.c (encode_terminal_code):
13610 * composite.c (composition_update_it, get_composition_id):
13611 * xdisp.c (get_next_display_element)
13612 (fill_composite_glyph_string): Add comments about special meaning
13613 of TAB characters in a composition.
13614
a02719a3
PE
136152011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13616
13617 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
13618 This occurs when processing a multibyte format.
13619 Problem reported by Wolfgang Jenker.
a02719a3 13620
72589a3c
JB
136212011-09-15 Johan Bockgård <bojohan@gnu.org>
13622
13623 * xdisp.c (try_cursor_movement): Only check for exact match if
13624 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13625
1c14176c
PE
136262011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13627
13628 Remove unused external symbols.
13629 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13630 * xdisp.c (calc_pixel_width_or_height): Now static.
13631 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13632 * indent.c (check_display_width):
13633 * w32term.c: Fix comment to match code.
13634 * xterm.c, xterm.h (x_catching_errors): Remove.
13635
d2eea5b5
PE
136362011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13637
13638 * xselect.c: Use signed conversions more consistently (Bug#9498).
13639 (selection_data_to_lisp_data): Assume incoming selection data are
13640 signed integers, not unsigned. This is to be consistent with
13641 outgoing selection data, which was modified to use signed integers
13642 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13643 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13644 expects long, not unsigned long.
13645
46888499
EZ
136462011-09-14 Eli Zaretskii <eliz@gnu.org>
13647
13648 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13649 computation of loop end. Reported by Johan Bockgård
13650 <bojohan@gnu.org>.
13651
ef8ef9fb
CY
136522011-09-13 Chong Yidong <cyd@stupidchicken.com>
13653
13654 * frame.c (Fother_visible_frames_p): Function deleted.
13655
fa819fed
EZ
136562011-09-12 Eli Zaretskii <eliz@gnu.org>
13657
13658 * indent.c (compute_motion): Process display vector front to back
13659 rather than the other way around. (Bug#2496)
13660
2ba8e008
SM
136612011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13662
13663 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13664
20f53c69
CY
136652011-09-11 Chong Yidong <cyd@stupidchicken.com>
13666
13667 * minibuf.c (Fread_from_minibuffer): Doc fix.
13668
d562d7a4
EZ
136692011-09-11 Eli Zaretskii <eliz@gnu.org>
13670
13671 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13672 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13673
1c4d7f3d
LMI
136742011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13675
13676 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13677 value for non-existent files.
13678
b885bf36
EZ
136792011-09-11 Eli Zaretskii <eliz@gnu.org>
13680
13681 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13682 set its "size" to -1. This will set the modtime_size field of
13683 the corresponding buffer to -1, which is what
13684 verify-visited-file-modtime expects for files that do not exist.
13685 (Bug#9139)
13686
6612f0bf
PE
136872011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13688
13689 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13690 here ...
13691 * lisp.h: ... from here. push_key_description is no longer
13692 defined in keyboard.c, so its declaration should not be in
13693 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13694 logically belongs with push_key_description.
13695
dfb3f755
PE
136962011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13697
13698 * buffer.h: Include <sys/types.h> instead of <time.h>.
13699 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13700 Problem reported by Herbert J. Skuhra.
13701
3134906c
LMI
137022011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13703
13704 * xml.c (parse_region): Make the parsing work for
13705 non-comment-starting XML files again (bug#9144).
13706
8d903f4e
AS
137072011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13708
13709 * image.c (gif_load): Fix calculation of bottom and right corner.
13710 (Bug#9468)
13711
80ad64f4
EZ
137122011-09-10 Eli Zaretskii <eliz@gnu.org>
13713
13714 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13715 redisplay in small windows.
13716
208a048d
EZ
137172011-09-09 Eli Zaretskii <eliz@gnu.org>
13718
13719 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13720
9b1c252e
MR
137212011-09-08 Martin Rudalics <rudalics@gmx.at>
13722
13723 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13724 Operate on live windows only.
13725
2949f33b
JB
137262011-09-08 Juanma Barranquero <lekktu@gmail.com>
13727
13728 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13729
e08dcafd
EZ
137302011-09-07 Eli Zaretskii <eliz@gnu.org>
13731
13732 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13733 only under bidi iteration.
13734
115b96bd
JD
137352011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13736
13737 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13738
c8199d0f
PE
137392011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13740
13741 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13742 Without this fix, the command to link temacs failed due to an
13743 undefined symbol __builtin_isnan. This is because
13744 /usr/include/iso/math_c99.h #defines isnan(x) to
13745 __builtin_isnan(x), but the bundled gcc, which identifies itself
13746 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13747 a __builtin_isnan.
13748 * floatfns.c (isnan): #undef, and then #define to a clone of
13749 what's in data.c.
13750 (Fisnan): Always define, since it's always available now.
13751 (syms_of_floatfns): Always define isnan at the Lisp level.
13752
e39b275c 137532011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
13754
13755 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13756
b2db44d9 137572011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 13758
f4af5137 13759 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
13760 The previous code assumed that file offsets (off_t values) fit in
13761 EMACS_INT variables, which is not true on typical 32-bit hosts.
13762 The code messed up by falsely reporting buffer overflow in cases
13763 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13764 when "big" contains more than 2**29 bytes, even though this
13765 inserts just one byte and does not overflow the buffer.
13766 (Finsert_file_contents): Store file offsets as off_t
13767 values, not as EMACS_INT values. Check for overflow when
13768 converting between EMACS_INT and off_t. When checking for
13769 buffer overflow or for overlap, take the offsets into account.
13770 Don't use EMACS_INT for small values where int suffices.
13771 When checking for overlap, fix a typo: ZV was used where
13772 ZV_BYTE was intended.
13773 (Fwrite_region): Don't assume off_t fits into 'long'.
13774 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13775
ecfc0a49
MA
137762011-09-05 Michael Albinus <michael.albinus@gmx.de>
13777
13778 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13779
6511acf2 137802011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 13781
0999621a 13782 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
13783
13784 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 13785 (esprintf, exprintf, evxprintf): New functions.
62f19c19 13786 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 13787 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
13788 (modify_event_symbol): Do not assume that the length of
13789 name_alist_or_stem is safe to alloca and fits in int.
13790 (Fexecute_extended_command): Likewise for function name and binding.
13791 (Frecursion_depth): Wrap around reliably on integer overflow.
13792 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13793 since some callers pass EMACS_INT values.
13794 (Fsingle_key_description): Don't crash if symbol name contains more
13795 than MAX_ALLOCA bytes.
13796 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13797 (get_minibuffer): Arg is now EMACS_INT, not int.
13798 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 13799 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
13800 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13801
2be7d702
PE
13802 * dbusbind.c (signature_cat): New function.
13803 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
13804 Do not overrun buffer; instead, report string overflow.
13805
9d1df220
PE
13806 * dispnew.c (add_window_display_history): Don't overrun buffer.
13807 Truncate instead; this is OK since it's just a log.
13808
33ef5c64
PE
13809 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13810 even if the time zone offset is outlandishly large.
13811 Don't mishandle offset == INT_MIN.
13812
66c6fdd5
PE
13813 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13814 when creating daemon; the previous buffer-overflow check was incorrect.
13815
d749b01b
PE
13816 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13817 which has the guts of the old verror function.
13818
b5cd1905
PE
13819 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13820 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13821
6e1a67fb
PE
13822 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13823 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 13824 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 13825 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
13826 length of string rather than counting it via multiple sprintfs;
13827 that's simpler and more reliable.
c21721cc
PE
13828 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13829 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13830 sprintf, in case result does not fit in int.
13831
c57b67fc
PE
13832 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13833 (fontset_from_font): Print it.
13834
8a401434
PE
13835 * frame.c (tty_frame_count): Now printmax_t, not int.
13836 (make_terminal_frame, set_term_frame_name): Print it.
13837 (x_report_frame_params): In X, window IDs are unsigned long,
13838 not signed long, so print them as unsigned.
13839 (validate_x_resource_name): Check for implausibly long names,
13840 and don't assume name length fits in 'int'.
13841 (x_get_resource_string): Don't blindly alloca invocation name;
13842 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13843 not fit in int.
13844
6e1a67fb
PE
13845 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13846 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
13847 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13848
0df02bf3
PE
13849 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13850 Use esprintf, not sprintf, in case result does not fit in int.
13851
48e30793
PE
13852 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13853 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13854 it as a large positive number.
13855 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13856 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13857
a66ff6d8
PE
13858 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13859 in case result does not fit in int.
13860
aca216ff
PE
13861 * print.c (float_to_string): Detect width overflow more reliably.
13862 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13863 buffer overrun. Don't assume list length fits in 'int'. Treat
13864 print length of 0 as 0, not as infinity; to be consistent with other
13865 uses of print length in this function. Don't overflow print length
13866 index. Don't assume hash table size fits in 'long', or that
13867 vectorlike size fits in 'unsigned long'.
13868
31c286f7
PE
13869 * process.c (make_process): Use printmax_t, not int, to format
13870 process-name gensyms.
13871
55e5faa1
PE
13872 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13873
80f2e268
PE
13874 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13875 to avoid potential buffer overrun.
13876
670741ab
PE
13877 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13878 if X resource line is longer than 512 bytes.
13879
b7163a50
PE
13880 * xfns.c (x_window): Make sprintf buffer a bit bigger
13881 to avoid potential buffer overrun.
13882
ae58ff1f
PE
13883 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13884
c43c8a6a
PE
13885 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13886
3f8236f4
PE
138872011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13888
53e9fe90 13889 Integer overflow fixes for scrolling, etc.
6511acf2
PE
13890 Without these, Emacs silently mishandles large integers sometimes.
13891 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
13892 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13893
6511acf2
PE
13894 * xdisp.c (try_window_id): Check Emacs fixnum range before
13895 converting to 'int'.
806add1d 13896
6511acf2 13897 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
13898 Check that an Emacs fixnum is in range before assigning it to 'int'.
13899 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13900 values converted from Emacs fixnums.
13901 (Frecenter): Don't wrap around a line count if it is out of 'int'
13902 range; instead, treat it as an extreme value.
13903 (Fset_window_configuration, compare_window_configurations):
13904 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13905
6511acf2
PE
13906 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13907 that can exceed INT_MAX. Check that EMACS_INT value is in range
13908 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
13909 (match_limit): Don't assume that a fixnum can fit in 'int'.
13910
6511acf2 13911 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
13912 exceed INT_MAX.
13913
6511acf2 13914 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
13915 (Fvertical_motion): Don't wrap around LINES values that don't fit
13916 in 'int'. Instead, treat them as extreme values. This is good
13917 enough for windows, which can't have more than INT_MAX lines anyway.
13918
fcb901a7
LMI
139192011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13920
0f2f6b6d
LMI
13921 * Require libxml/parser.h to avoid compilation warning.
13922
fcb901a7
LMI
13923 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13924
13925 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13926 since this reportedly can destroy thread storage.
13927
6e20a0d4
CY
139282011-08-30 Chong Yidong <cyd@stupidchicken.com>
13929
13930 * syntax.c (find_defun_start): Update all cache variables if
13931 exiting early (Bug#9401).
13932
148ae00e
EZ
139332011-08-30 Eli Zaretskii <eliz@gnu.org>
13934
f6cfbd8f
EZ
13935 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13936
148ae00e
EZ
13937 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13938 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13939 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13940
13941 * term.c (tty_append_glyph): New function.
13942 (produce_stretch_glyph): Static function and its prototype deleted.
13943
a66cfb1c
SM
13944 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13945 Add prototypes.
148ae00e 13946
c4a07a4c
PE
139472011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13948
13949 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13950 when checking :margin (Bug#9390).
13951 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 13952 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
13953 so that the name doesn't mislead. All uses changed.
13954
6bc8cd65
JB
139552011-08-28 Johan Bockgård <bojohan@gnu.org>
13956
13957 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13958 set_tty_hooks.
13959
dca4927e
EZ
139602011-08-27 Eli Zaretskii <eliz@gnu.org>
13961
13962 * xdisp.c (move_it_to): Don't bail out early when reaching
13963 position beyond to_charpos, if we are scanning backwards.
13964 (move_it_vertically_backward): When DY == 0, make sure we get to
13965 the first character in the line after the newline.
13966
f2cad773
PE
139672011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13968
13969 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13970 (ccl_driver): Do not generate an out-of-range pointer.
13971 (Fccl_execute_on_string): Remove unnecessary check for
13972 integer overflow, noted by Stefan Monnier in
13973 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13974 Remove a FIXME that didn't need fixing.
13975 Simplify the newly-introduced buffer reallocation code.
13976
0cae2cdb
JB
139772011-08-27 Juanma Barranquero <lekktu@gmail.com>
13978
13979 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13980
5fc295a4 139812011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 13982
70c60eb2 13983 Integer and memory overflow issues (Bug#9196).
726e0ab1 13984
d31850da
PE
13985 * doc.c (get_doc_string): Rework so that
13986 get_doc_string_buffer_size is the actual buffer size, rather than
13987 being 1 less than the actual buffer size; this makes xpalloc more
13988 convenient.
13989
a69fbedb
PE
13990 * image.c (x_allocate_bitmap_record, cache_image):
13991 * xselect.c (Fx_register_dnd_atom):
13992 Simplify previous changes by using xpalloc.
13993
fe5c5d37
PE
13994 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13995 since either will do and ptrdiff_t is convenient with xpalloc.
13996
0065d054
PE
13997 * charset.c (charset_table_size)
13998 (struct charset_sort_data.priority): Now ptrdiff_t.
13999 (charset_compare): Don't overflow if priorities differ greatly.
14000 (Fsort_charsets): Don't assume list length fits in int.
14001 Check for size-calculation overflow when allocating sort data.
14002 (syms_of_charset): Allocate an initial charset table that is
14003 just under 64 KiB, to avoid problems with glibc malloc and mmap.
14004
14005 * cmds.c (internal_self_insert): Check for size-calculation overflow.
14006
14007 * composite.h (struct composition.glyph_len): Now int, not unsigned.
14008 The actual value is always <= INT_MAX, and leaving it unsigned made
14009 overflow checking harder.
14010
14011 * dispextern.h (struct glyph_matrix.rows_allocated)
14012 (struct face_cache.size): Now ptrdiff_t, for convenience in use
14013 with xpalloc. The values are still always <= INT_MAX.
14014
14015 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
14016
14017 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
14018 (SAFE_NALLOCA): New macro.
14019
14020 * region-cache.c (struct boundary.pos, find_cache_boundary)
14021 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
14022 (set_cache_region, invalidate_region_cache)
14023 (revalidate_region_cache, know_region_cache, region_cache_forward)
14024 (region_cache_backward, pp_cache):
14025 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
14026 so that ptrdiff_t * can be passed to xpalloc.
14027 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
14028 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
14029 (pp_cache): Don't assume cache_len fits in int.
14030 * region-cache.h: Adjust extern decls to match.
14031
14032 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
14033 EMACS_INT, since either will do, for xpalloc.
14034
14035 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
14036 (xnmalloc, xnrealloc, xpalloc): New functions.
14037
726e0ab1
PE
14038 * bidi.c (bidi_shelve_header_size): New constant.
14039 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
14040 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
14041
51f30bc5 14042 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
14043 * buffer.c (overlays_at, overlays_in, record_overlay_string)
14044 (overlay_strings):
14045 Don't update size of array until after memory allocation succeeds,
14046 because xmalloc/xrealloc may not return.
0065d054
PE
14047 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
14048 now that we have proper integer overflow checking.
14049 (record_overlay_string, overlay_strings): Catch overflows when
14050 calculating size of overlay_str_buf.
726e0ab1 14051
0065d054
PE
14052 * callproc.c (Fcall_process): Check for size overflow when
14053 calculating size of args2.
14054 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
14055 Normally we prefer signed values, but sticking with ptrdiff_t would
14056 require adding more-complicated checks.
726e0ab1
PE
14057
14058 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
14059 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
14060 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 14061 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
14062
14063 * character.c (Fstring): Check for size-calculation overflow.
14064
14065 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
14066 unnecessary integer overflow. Check for size overflow.
14067 (encode_coding_object): Don't update size until xmalloc succeeds.
14068
14069 * composite.c (get_composition_id): Check for overflow in glyph
14070 length calculations.
14071
14072 Integer and memory overflow fixes for display code.
14073 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
14074 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
14075 (scrolling_window): Check for overflow in size calculations.
14076 (line_draw_cost, realloc_glyph_pool, add_row_entry):
14077 Don't assume glyph table len fits in int.
14078 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
14079 (row_table_size): Now ptrdiff_t, not int.
14080 (scrolling_window): Avoid overflow in size calculations.
14081 Don't update size until allocation succeeds.
14082 * fns.c (concat): Check for overflow in size calculations.
14083 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
14084 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14085 (NEXT_ALMOST_PRIME_LIMIT): New constant.
14086
14087 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
14088 (get_doc_string): Check for size calculation overflow.
14089 Don't update size until allocation succeeds.
14090 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
14091 EMACS_INT, where ptrdiff_t will do.
14092 (Fsubstitute_command_keys): Check for string overflow.
14093
14094 * editfns.c (set_time_zone_rule): Don't assume environment length
14095 fits in int.
14096 (message_length): Now ptrdiff_t, not int.
14097 (Fmessage_box): Don't update size until allocation succeeds.
14098 Don't assume message length fits in int.
14099 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
14100
0065d054
PE
14101 * emacs.c (main): Do not reallocate argv, since there is a null at
14102 the end that can be overwritten, and this way there's no need to
14103 worry about size-calculation overflow.
14104 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
14105
14106 * eval.c (init_eval_once, grow_specpdl): Don't update size until
14107 alloc succeeds.
14108 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
14109
14110 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
14111 (x_set_scroll_bar_width, x_figure_window_size):
14112 Check for integer overflow.
14113 (x_set_alpha): Do not assume XINT fits in int.
14114
14115 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
14116 This is for the members text_lines, text_cols, total_lines, total_cols,
14117 where the system imposes an 'int' limit.
14118
14119 * fringe.c (Fdefine_fringe_bitmap):
14120 Don't update size until alloc works.
14121
14122 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
14123 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
14124
14125 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
14126 Check for size-calculation overflow.
14127 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
14128 do, as we prefer signed integers.
14129 (id_to_widget.max_size, id_to_widget.used)
14130 (xg_store_widget_in_map, xg_remove_widget_from_map)
14131 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
14132 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
14133 Use and return ptrdiff_t, not int.
14134 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
14135 * gtkutil.h: Change prototypes to match the above.
14136
14137 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
14138 are duplicate now that they've been promoted to lisp.h.
14139 (x_allocate_bitmap_record, x_alloc_image_color)
14140 (make_image_cache, cache_image, xpm_load):
14141 Don't update size until alloc is done.
14142 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
14143 (x_detect_edges):
3256efce 14144 Check for size calculation overflow.
726e0ab1
PE
14145 (ct_colors_allocated_max): New constant.
14146 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
14147 overflow.
3256efce 14148
726e0ab1
PE
14149 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
14150 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
14151 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
14152 Use ptrdiff_t, not int, to count maps.
14153 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
14154 calculations. Don't update size until allocation succeeds.
14155 Redo calculations to avoid overflow.
726e0ab1
PE
14156 * keyboard.h: Change prototypes to match the above.
14157
14158 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
14159 to count maps.
14160 (current_minor_maps): Check for size calculation overflow.
14161 * keymap.h: Change prototypes to match the above.
14162
14163 * lread.c (read1, init_obarray): Don't update size until alloc done.
14164
14165 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
14166 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
14167
726e0ab1
PE
14168 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
14169 Now ptrdiff_t, not int.
14170 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
14171 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
14172
14173 * process.c (Fnetwork_interface_list): Check for overflow
14174 in size calculation.
14175
14176 * region-cache.c (move_cache_gap): Check for size calculation overflow.
14177
14178 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
14179 overflow. Don't bother calling xmalloc when xrealloc will do.
14180
14181 * search.c (Freplace_match): Check for size calculation overflow.
14182 (Fset_match_data): Don't assume list lengths fit in 'int'.
14183
14184 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
14185 for command line length. Do not attempt to address one before the
14186 beginning of an array, as that's not portable.
14187
14188 * term.c (max_frame_lines): Remove; unused.
14189 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
14190 not int.
14191 (encode_terminal_code, calculate_costs): Check for size
14192 calculation overflow.
14193 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
14194 table lengths and related sizes. Don't update size until alloc
14195 done. Redo calculations to avoid overflow.
14196 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
14197
14198 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
14199 subtracting pointers.
14200 (gobble_line): Check for overflow more carefully. Don't update size
14201 until alloc done.
14202
14203 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
14204 Don't update size until alloc done.
14205 Redo size calculations to avoid overflow.
14206 Check for size calculation overflow.
0065d054 14207 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
14208
14209 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
14210 Use ptrdiff_t, not int, for sizes.
14211 (store_mode_line_noprop_char): Don't update size until alloc done.
14212
0065d054
PE
14213 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
14214 Use ptrdiff_t, not int, for sizes.
14215 (Finternal_make_lisp_face, cache_face):
14216 Check for size calculation overflow.
14217 (cache_face): Treat size calculation overflows as if they were
14218 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
14219
14220 * xfns.c (x_encode_text, x_set_name_internal)
14221 (Fx_change_window_property): Use ptrdiff_t, not int, to count
14222 sizes, since they can exceed INT_MAX in size. Check for size
14223 calculation overflow.
14224
0065d054
PE
14225 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
14226 (xg_select): Check for size calculation overflow.
726e0ab1
PE
14227 Don't update size until alloc done.
14228
0065d054 14229 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 14230 as sprintf is limited to int lengths.
1d526e2f 14231
252c5ee1
PE
14232 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
14233 (X_LONG_MIN): New macros.
864d7ce7
PE
14234 Use them to make the following changes clearer.
14235 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
14236 This change doesn't affect the value now, but it may help remind
14237 future maintainers not to raise the value too much later.
14238 (SELECTION_QUANTUM): Remove, replacing with ...
14239 (selection_quantum): ... new function, which avoids overflow.
14240 All uses changed.
14241 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
14242 assumption that selection length fits in 'int'.
14243 (x_reply_selection_request, x_handle_selection_request)
14244 (x_get_window_property, receive_incremental_selection)
14245 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
14246 (lisp_data_to_selection_data, clean_local_selection_data):
14247 Use ptrdiff_t, not int, to record length of selection.
14248 (x_reply_selection_request, x_get_window_property)
14249 (receive_incremental_selection, x_property_data_to_lisp):
14250 Redo calculations to avoid overflow.
14251 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 14252 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
14253 something.
14254 (x_get_window_property, receive_incremental_selection)
14255 (lisp_data_to_selection_data, x_property_data_to_lisp):
14256 Check for size-calculation overflow.
14257 (x_get_window_property, receive_incremental_selection)
14258 (lisp_data_to_selection_data, Fx_register_dnd_atom):
14259 Don't store size until memory allocation succeeds.
14260 (x_get_window_property): Plug memory leak on memory exhaustion.
14261 Don't double-block input; malloc is safe here. Don't assume 2**34
14262 - 4 fits in unsigned long. Add an xassert to check
14263 XGetWindowProperty overflow. Be more careful about overflow
14264 calculations, and distinguish size from memory overflow better.
14265 (receive_incremental_selection): When tracing, don't assume
14266 unsigned int is less than INT_MAX.
14267 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
14268 harmful) conversions of unsigned short to int.
14269 (lisp_data_to_selection_data): Don't assume that integers
14270 in the range -65535 through -1 fit in an X unsigned short.
14271 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
14272 result parameters unless successful. Rely on cons_to_unsigned
14273 to report problems with elements; the old code wasn't right anyway.
14274 (x_check_property_data): Check for int overflow; we cannot use
14275 a wider type due to X limits.
14276 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14277
726e0ab1 14278 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 14279
0065d054
PE
14280 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14281 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
14282 (x_color_cells): Don't store size until memory allocation succeeds.
14283 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 14284 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
14285 (x_term_init): Don't assume length fits in int (sprintf is limited
14286 to int size).
bc18e09d 14287
ebfa62c0
PE
14288 Use ptrdiff_t for composition IDs.
14289 * character.c (lisp_string_width):
14290 * composite.c (composition_table_size, n_compositions)
14291 (get_composition_id, composition_gstring_from_id):
14292 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14293 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14294 * window.c (Frecenter):
14295 Use ptrdiff_t, not int, for composition IDs.
14296 * composite.c (get_composition_id): Check for integer overflow.
14297 * composite.h: Adjust prototypes to match the above changes.
14298
d3411f89
PE
14299 Use ptrdiff_t for hash table indexes.
14300 * category.c (hash_get_category_set):
14301 * ccl.c (ccl_driver):
14302 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14303 * coding.c (coding_system_charset_list, detect_coding_system):
14304 * coding.h (struct coding_system.id):
14305 * composite.c (get_composition_id, gstring_lookup_cache):
14306 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14307 * image.c (xpm_get_color_table_h):
14308 * lisp.h (hash_lookup, hash_put):
14309 * minibuf.c (Ftest_completion):
14310 Use ptrdiff_t for hash table indexes, not int (which is too
14311 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14312 32-bit --with-wide-int hosts).
14313
e097a6fa
PE
14314 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14315 Add a FIXME comment about memory leaks.
14316 (syms_of_charset): Don't assume xmalloc returns.
14317
5637687f
PE
14318 Don't assume that stated character widths fit in int.
14319 * character.c (Fchar_width, c_string_width, lisp_string_width):
14320 * character.h (CHAR_WIDTH):
14321 * indent.c (MULTIBYTE_BYTES_WIDTH):
14322 Use sanitize_char_width to avoid undefined and/or bad behavior
14323 with outlandish widths.
a66cfb1c 14324 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
14325 now that we have two such functions. All uses changed.
14326 (sanitize_char_width): New inline function.
14327
a2271ba2
PE
14328 Don't assume that tab-width fits in int.
14329 * character.h (sanitize_width): New inline function.
14330 (SANE_TAB_WIDTH): New macro.
14331 (ASCII_CHAR_WIDTH): Use it.
14332 * indent.c (sane_tab_width): Remove. All uses replaced by
14333 SANE_TAB_WIDTH (current_buffer).
14334 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14335
18c52557
PE
14336 * fileio.c: Integer overflow issues with file modes.
14337 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14338
caeeedc1
PE
14339 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14340 Remove unreachable code.
14341 (read_hex, load_charset_map_from_file): Check for integer overflow.
14342
6df6ae42 14343 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
14344 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14345 (x_send_scroll_bar_event): Likewise. Check that the size does not
14346 exceed limits imposed by XClientMessageEvent, as well as the usual
14347 ptrdiff_t and size_t limits.
14348
b13995db
PE
14349 * keyboard.c: Overflow, signedness and related fixes.
14350 (make_lispy_movement): Use same integer type in forward decl
14351 that is used in the definition.
14352 (read_key_sequence, keyremap_step):
14353 Change bufsize argument back to int, undoing my 2011-03-30 change.
14354 We prefer signed types, and int is wide enough here.
14355 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14356 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14357 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14358 length, not size_t. Use ptrdiff_t for index, not int.
14359 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14360 possibility of integer overflow.
14361
13464394
PE
14362 Overflow, signedness and related fixes for images.
14363
14364 * dispextern.h (struct it.stack[0].u.image.image_id)
14365 (struct_it.image_id, struct image.id, struct image_cache.size)
14366 (struct image_cache.used, struct image_cache.ref_count):
14367 * gtkutil.c (update_frame_tool_bar):
14368 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14369 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14370 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14371 * nsmenu.m (update_frame_tool_bar):
14372 * xdisp.c (calc_pixel_width_or_height):
14373 * xfns.c (image_cache_refcount):
14374 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14375 on typical 64-bit hosts.
14376
14377 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14378 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14379 Omit unnecessary casts to int.
14380 (parse_image_spec): Check that integers fall into 'int' range
14381 when the callers expect that.
14382 (image_ascent): Redo ascent calculation to avoid int overflow.
14383 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14384 (lookup_image): Remove unnecessary tests.
14385 (xbm_image_p): Locals are now of int, not EMACS_INT,
14386 since parse_image_check makes sure they fit into int.
14387 (png_load, gif_load, svg_load_image):
14388 Prefer int to unsigned where either will do.
14389 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
14390 old tiff_error_handler and tiff_warning_handler.
14391 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
14392 stack buffer overflows. It uses only the features of vsnprintf
14393 that are common to both POSIX and native Microsoft.
14394 (tiff_error_handler, tiff_warning_handler): Use it.
14395 (tiff_load, gif_load, imagemagick_load_image):
14396 Don't assume :index value fits in 'int'.
14397 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14398 (imagemagick_load_image): Check that crop parameters fit into
14399 the integer types that MagickCropImage accepts. Don't assume
14400 Vimagemagick_render_type has a nonnegative value. Don't assume
14401 size_t fits in 'long'.
14402 (gs_load): Use printmax_t to print the widest integers possible.
14403 Check for integer overflow when computing image height and width.
14404
c11821d4
EZ
144052011-08-26 Eli Zaretskii <eliz@gnu.org>
14406
14407 * xdisp.c (redisplay_window): Don't force window start if point
14408 will be invisible in the resulting window. (Bug#9324)
14409
0c95fcf7
EZ
144102011-08-25 Eli Zaretskii <eliz@gnu.org>
14411
14412 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14413 the display spec is of the form `(space ...)'.
14414 (handle_display_spec): Return the value returned by
14415 handle_single_display_spec, not just 1 or zero.
14416 (handle_single_display_spec): If the display spec is of the form
14417 `(space ...)', and specifies display in the text area, return 2
14418 rather than 1.
fee65a97 14419 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
14420 accurately, and prefer exact match for point under bidi.
14421 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
14422
14423 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14424 into disp_prop; all users changed.
14425
14426 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14427 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14428 for the text covered by the display property.
14429
e4ed06f1
CY
144302011-08-25 Chong Yidong <cyd@stupidchicken.com>
14431
14432 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14433 Change return value to nil.
14434 (Frecord_buffer): Delete unused function.
14435
f67cdd7f
EZ
144362011-08-24 Eli Zaretskii <eliz@gnu.org>
14437
5980d4c6
EZ
14438 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14439 buffers, return left-to-right.
8610fe8b
EZ
14440 (set_cursor_from_row): Consider candidate row a win if its glyph
14441 represents a newline and point is on that newline. Fixes cursor
14442 positioning on the newline at EOL of R2L text within L2R
14443 paragraph, and vice versa.
14444 (try_cursor_movement): Check continued rows, in addition to
14445 continuation rows. Fixes unwarranted scroll when point enters a
14446 continued line of R2L text within an L2R paragraph, or vice versa.
14447 (cursor_row_p): Consider the case of point being equal to
14448 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14449 from the end of a short line to the beginning of a continued line
14450 of R2L text within L2R paragraph.
14451 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14452 composed characters.
5980d4c6 14453
f67cdd7f
EZ
14454 * bidi.c (bidi_check_type): Use xassert.
14455 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14456 members.
14457
bca633fb
EZ
144582011-08-23 Eli Zaretskii <eliz@gnu.org>
14459
14460 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14461 a character.
14462
4a5885a7
CY
144632011-08-23 Chong Yidong <cyd@stupidchicken.com>
14464
14465 * nsfont.m (ns_otf_to_script): Fix typo.
14466
0902a04e
KH
144672011-08-22 Kenichi Handa <handa@m17n.org>
14468
14469 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14470 extra slot even if the purpose is char-code-property-table.
14471
1a2e6670
EZ
144722011-08-23 Eli Zaretskii <eliz@gnu.org>
14473
8ddde651
EZ
14474 * xdisp.c (redisplay_window): When computing centering_position,
14475 account for the height of the header line. (Bug#8874)
14476
425cc014
EZ
14477 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14478 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14479 candidate is selected by the mouse, and that candidate has a
14480 composed character under the mouse.
14481
1a2e6670
EZ
14482 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14483 coordinates reported by pos-visible-in-window-p for a composed
14484 character in column zero.
14485
8b76d6f8
SM
144862011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14487
14488 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14489
dac347dd
EZ
144902011-08-22 Eli Zaretskii <eliz@gnu.org>
14491
14492 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14493 consider it a hit if to_charpos is anywhere in the range of the
14494 composed buffer positions.
14495
e013fb34
CY
144962011-08-22 Chong Yidong <cyd@stupidchicken.com>
14497
14498 * image.c (gif_load): Don't assume that each subimage has the same
14499 dimensions as the base image. Handle disposal method that is
14500 "undefined" by the gif spec (Bug#9335).
14501
bd1ba3e8
CY
145022011-08-20 Chong Yidong <cyd@stupidchicken.com>
14503
14504 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 14505 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 14506
54a1215b
EZ
145072011-08-19 Eli Zaretskii <eliz@gnu.org>
14508
823564e5
EZ
14509 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14510 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14511 from an Org mode buffer to a Speedbar frame.
14512
54a1215b
EZ
14513 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14514 a composition, take its buffer position from IT->cmp_it.charpos.
14515 Fixes cursor positioning at the beginning of a line that begins
14516 with a composed character.
14517
9778ebcc
EZ
145182011-08-18 Eli Zaretskii <eliz@gnu.org>
14519
0be6ee06
EZ
14520 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14521 character bidirectional type, use STRONG_L instead. Fixes crashes
14522 in a buffer produced by `describe-categories'.
14523
9778ebcc
EZ
14524 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14525 members before the level stack, so they would be saved and
14526 restored when copying iterator state. Fixes incorrect reordering
14527 around TABs covered by display properties.
14528
156bffbe
AS
145292011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14530
6b02f655 14531 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 14532
72ad093b
CY
145332011-08-17 Chong Yidong <cyd@stupidchicken.com>
14534
14535 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
14536 (internal_condition_case_2, internal_condition_case_n):
14537 Remove unnecessary aborts (Bug#9081).
72ad093b 14538
35774242
EZ
145392011-08-17 Eli Zaretskii <eliz@gnu.org>
14540
14541 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14542 has no `load' handler, try opening the file locally. (Bug#9311)
14543
db76dd85
KB
145442011-08-16 Ken Brown <kbrown@cornell.edu>
14545
14546 * gmalloc.c: Expand comment.
14547
b215eee5
EZ
145482011-08-16 Eli Zaretskii <eliz@gnu.org>
14549
14550 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14551 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14552
a4579d33
KB
145532011-08-16 Ken Brown <kbrown@cornell.edu>
14554
14555 Fix memory allocation problems in Cygwin build (Bug#9273).
14556
14557 * unexcw.c ( __malloc_initialized): Declare external variable.
14558 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14559
8b76d6f8
SM
14560 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14561 New variables.
a4579d33
KB
14562 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14563 dumped emacs.
14564 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14565 in the static heap.
14566 [CYGWIN] (special_realloc): New function.
14567 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14568 requests to realloc storage in the static heap.
14569
3ebec551
PE
145702011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14571
14572 * bidi.c (bidi_initialize): Remove unused local.
14573
9fd8be00
EZ
145742011-08-15 Eli Zaretskii <eliz@gnu.org>
14575
6b02f655
SM
14576 * bidimirror.h:
14577 * biditype.h: Remove file.
14578 * makefile.w32-in ($(BLD)/bidi.$(O)):
14579 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
14580
14581 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14582
14583 * chartab.c: Improve commentary for the uniprop_table API.
14584
32413314
EZ
14585 * bidi.c (bidi_paragraph_init): Support zero value of
14586 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
14587 (bidi_initialize): Use uniprop_table instead of including
14588 biditype.h and bidimirror.h.
32413314 14589
9fd8be00
EZ
14590 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14591 coordinates of the iterator when restoring from ppos_it.
14592 (Bug#9296)
14593
5cf2b69b
KH
145942011-08-14 Kenichi Handa <handa@m17n.org>
14595
14596 * process.c (create_process): Call setup_process_coding_systems
72ad093b 14597 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 14598
daf17d00
EZ
145992011-08-14 Eli Zaretskii <eliz@gnu.org>
14600
14601 * xdisp.c (move_it_in_display_line_to): Don't invoke
14602 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14603 ppos_it. Fixes vertical cursor motion when line beginning is
14604 covered by an image. (Bug#9296)
14605
08e3161a
JD
146062011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14607
14608 * nsterm.h (ns_run_ascript): Declare.
14609 (NSAPP_DATA2_RUNASSCRIPT): Define.
14610
14611 * nsfns.m (as_script, as_result, as_status): New static variables.
14612 (ns_run_ascript): New function.
5e617bc2 14613 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
14614 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14615 the event loop. Get status from as_status (Bug#7276).
14616
14617 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14618 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14619 the event loop (Bug#7276).
14620
a3720aa2
AS
146212011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14622
14623 * gnutls.c (QCgnutls_bootprop_priority)
14624 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14625 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14626 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14627 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14628 (QCgnutls_bootprop_verify_hostname_error)
14629 (QCgnutls_bootprop_callbacks_verify): Rename from
14630 Qgnutls_bootprop_..., all uses changed.
14631
14632 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14633 uses changed.
14634
0a0d27fb
PE
146352011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14636
19d5c50c
PE
14637 * xfaces.c (Qframe_set_background_mode): Now static.
14638 * dispextern.h (Qframe_set_background_mode): Remove decl.
14639
0a0d27fb
PE
14640 * process.c (Fnetwork_interface_info): Declare local only if needed.
14641
377538cb
JD
146422011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14643
14644 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14645 (Fnetwork_interface_list): Allocate in increments of bytes instead
14646 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14647 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14648 sockaddr.
14649 (struct ifflag_def): notrailers is smart on OSX.
14650 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14651 Get hardware address with getifaddrs if available.
14652
08fff70c
EZ
146532011-08-12 Eli Zaretskii <eliz@gnu.org>
14654
14655 * xdisp.c (iterate_out_of_display_property): xassert that
14656 IT->position is set to within IT->object's boundaries. Break from
14657 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
14658 when IT->position is set up wrongly due to some bug.
14659 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
14660 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14661 entry. Force push_it to save on the stack the current
14662 buffer/string position, to be restored by pop_it. Fix flags in
14663 the iterator structure wrt the object coming from a display
14664 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14665 properties. (Bug#9284)
14666
7be1c708 146672011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 14668
7be1c708
CY
14669 * fontset.c (fontset_get_font_group): Add proper type checks.
14670 (Bug#9172)
aac0c6e3 14671
7be1c708 146722011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 14673
7be1c708
CY
14674 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14675 and LC_VERSION_MIN_MACOSX.
14676 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14677 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 14678
97bb72a6
EZ
146792011-08-08 Eli Zaretskii <eliz@gnu.org>
14680
14681 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
14682 no-display-properties-and-no-overlays under bidi display.
14683 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 14684 properties and overlays.
97bb72a6 14685
d5617611
CY
146862011-08-08 Chong Yidong <cyd@stupidchicken.com>
14687
37e11a63
CY
14688 * editfns.c (Fset_time_zone_rule): Document relationship with the
14689 setenv function.
14690
d5617611
CY
14691 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14692 the font entity extracted from the cache (Bug#8109).
14693
58872834
CY
146942011-08-07 Chong Yidong <cyd@stupidchicken.com>
14695
14696 * composite.c (autocmp_chars): Don't reset point. That is done by
14697 restore_point_unwind (Bug#5984).
14698
75bfc667
JL
146992011-08-07 Juri Linkov <juri@jurta.org>
14700
14701 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14702 to show the arg `TIME' instead of `TIMEVAL'.
14703
d1410150
EZ
147042011-08-06 Eli Zaretskii <eliz@gnu.org>
14705
14706 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14707 display property strides EOL and includes a newline, as in
14708 longlines-mode. (Bug#9254)
75b771e4
EZ
14709 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14710 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
14711
14712 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14713 is non-zero, even if the data buffer is NULL. Fixes a crash in
14714 vertical-motion with longlines-mode. (Bug#9254)
14715
35928349
EZ
147162011-08-05 Eli Zaretskii <eliz@gnu.org>
14717
ec7cc85b
EZ
14718 * bidi.c <bidi_cache_total_alloc>: Now static.
14719 (bidi_initialize): Initialize bidi_cache_total_alloc.
14720
8b76d6f8 14721 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
14722 cache. (Bug#9221)
14723
14724 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14725 amount allocated this far in `bidi_cache_total_alloc'.
14726 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14727 non-zero, only free the data buffer without restoring the cache
14728 contents. All callers changed.
14729
14730 * dispextern.h (bidi_unshelve_cache): Update prototype.
14731
14732 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14733 (move_it_in_display_line, move_it_to)
14734 (move_it_vertically_backward, move_it_by_lines): Replace the call
14735 to xfree to an equivalent call to bidi_unshelve_cache.
14736 (move_it_in_display_line_to): Fix logic of returning
412b6358 14737 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 14738
e2e2423b
EZ
147392011-08-05 Eli Zaretskii <eliz@gnu.org>
14740
14741 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14742 came from a string character with a `cursor' property. (Bug#9229)
14743
ae9e757a
JD
147442011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14745
14746 * Makefile.in (LIB_PTHREAD): New variable.
14747 (LIBES): Add LIB_PTHREAD (Bug#9216).
14748
14749 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14750 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14751
213bd7f2
AS
147522011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14753
6b02f655 14754 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 14755
99aaf75f
JD
147562011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14757
14758 * xterm.c (x_find_topmost_parent): New function.
14759 (x_set_frame_alpha): Find topmost parent window with
14760 x_find_topmost_parent and set the property there also (bug#9181).
14761 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14762
c74e9d86
PE
147632011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14764
14765 * callproc.c (Fcall_process): Avoid vfork clobbering
14766 the local vars buffer, coding_systems, current_dir.
14767
640c8776
SM
147682011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14769
14770 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14771
f26d0e4c
PE
147722011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14773
8a10d76c
PE
14774 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14775 so that it is not optimized away.
14776
f26d0e4c
PE
14777 * xdisp.c (compute_display_string_pos): Remove unused local.
14778
55439c61
EZ
147792011-08-02 Eli Zaretskii <eliz@gnu.org>
14780
14781 Fix slow cursor motion and scrolling in large buffers with
14782 selective display, like Org Mode buffers. (Bug#9218)
14783
14784 * dispextern.h (struct bidi_it): New member disp_prop_p.
14785
14786 * xdisp.c: Remove one-slot cache of display string positions.
14787 (compute_display_string_pos): Accept an additional argument
5e617bc2 14788 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
14789 for a display string or property. If found, set DISP_PROP_P
14790 non-zero.
14791
14792 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
14793 DISP_PROP_P, and pass it to compute_display_string_pos.
14794 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
14795 non-zero. All callers of bidi_fetch_char changed.
14796
fb33fa43
SM
147972011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14798
14799 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14800
b099e063
DM
148012010-12-03 Don March <don@ohspite.net>
14802
14803 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14804 last character M-[char] is translated to ESC [char] (bug#7541).
14805
5cc7f7af
KH
148062011-08-02 Kenichi Handa <handa@m17n.org>
14807
d0fffa3f 14808 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
14809
14810 * chartab.c (uniprop_table): Make it non-static.
14811
525d5e6e
EZ
148122011-08-01 Eli Zaretskii <eliz@gnu.org>
14813
14814 * xdisp.c (forward_to_next_line_start): Accept additional argument
14815 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14816 on the newline.
14817 (reseat_at_next_visible_line_start): Use the bidi iterator state
14818 returned by forward_to_next_line_start to restore the state of
14819 it->bidi_it after backing up to previous newline. (Bug#9212)
14820
31011111
AS
148212011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14822
14823 * regex.c (re_comp): Protoize.
14824 (re_exec): Fix return type.
14825 (regexec): Fix type of `ret'. (Bug#9203)
14826
476371c4
PE
148272011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14828
e5d76069
PE
14829 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14830 This is needed if max-image-size is a floating-point number.
14831
9a79b20c
AS
148322011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14833
14834 * print.c (print_object): Print empty symbol as ##.
14835
14836 * lread.c (read1): Read ## as empty symbol.
14837
d8c2fa78
AA
148382011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14839
14840 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14841 setting frame foreground color (Bug#9175).
14842 (x_set_background_color): Likewise.
14843
ffe57a7a
AA
14844 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14845 contents (Bug#9176).
14846 (EmacsTooltip -init): Remove bezels and add shadows to
14847 tooltip windows.
14848
bf3492a5
AA
14849 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14850 or scroll bar (Bug#8470).
14851
d55e9c53
AA
14852 * nsfont.m (nsfont_open): Remove assignment to voffset and
14853 unnecessary vars hshink, expand, hd, full_height, min_height.
14854 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14855
14856 * nsterm.h (nsfont_info): Remove voffset field.
14857
d8c2fa78 148582011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
14859
14860 Implement strike-through and overline on NextStep (Bug#8863).
14861
14862 * nsfont.m (nsfont_open): Use underline position provided by font,
14863 instead of hard-coded value of 2.
14864 (nsfont_draw): Call ns_draw_text_decoration instead.
14865
14866 * nsterm.h: Add declaration for ns_draw_text_decoration.
14867
14868 * nsterm.m (ns_draw_text_decoration): New function for drawing
14869 underline, overline, and strike-through.
14870 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14871 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 14872 accommodate underlining, etc.
4843aac3 14873
4cc60b9b
EZ
148742011-07-28 Eli Zaretskii <eliz@gnu.org>
14875
bc7ece87
EZ
14876 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14877 default.
4cc60b9b 14878
476371c4
PE
148792011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14880
66606eea
PE
14881 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14882 Without this fix, if a signal arrives just after memory fills up,
14883 'malloc' might be invoked reentrantly.
14884
476371c4
PE
14885 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14886 In other words, assume that every image size is allowed, on non-X
14887 hosts. This assumption is probably wrong, but it lets Emacs compile.
14888
f3fcc40d
AS
148892011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14890
14891 * regex.c (re_iswctype): Convert return values to boolean.
14892
350c992f
EZ
148932011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14894
14895 * xdisp.c (compute_display_string_pos): Don't use cached display
14896 string position if the buffer had its restriction changed.
14897 (Bug#9184)
14898
5266b4bb
PE
148992011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14900
14901 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14902
2573a837 149032011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 14904
41f55ccd 14905 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 14906
39e378da
PE
14907 * bidi.c: Integer size and overflow fixes.
14908 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14909 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14910 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14911 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14912 (bidi_find_other_level_edge):
14913 Use ptrdiff_t instead of EMACS_INT where either will do.
14914 This works better on 32-bit hosts configured --with-wide-int.
14915 (bidi_cache_ensure_space): Check for size-calculation overflow.
14916 Use % rather than repeated addition, for better worst-case speed.
14917 Don't set bidi_cache_size until after xrealloc returns, because it
14918 might not return.
14919 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
14920 (bidi_cache_ensure_space): Also check that the bidi cache size
14921 does not exceed that of the largest Lisp string or buffer. See Eli
14922 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 14923
5e927815
PE
14924 * alloc.c (__malloc_size_t): Remove.
14925 All uses replaced by size_t. See Andreas Schwab's note
14926 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14927
ca4aa935
PE
14928 * image.c: Improve checking for integer overflow.
14929 (check_image_size): Assume that f is nonnull, since
14930 it is always nonnull in practice. This is one less thing to
14931 worry about when checking for integer overflow later.
14932 (x_check_image_size): New function, which checks for integer
14933 overflow issues inside X.
14934 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14935 This removes the need for a memory_full check.
14936 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14937 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14938 (xbm_read_bitmap_data): Change locals back to 'int', since
14939 their values must fit in 'int'.
14940 (xpm_load_image, png_load, tiff_load):
14941 Invoke x_create_x_image_and_pixmap earlier,
14942 to avoid much needless work if the image is too large.
14943 (tiff_load): Treat overly large images as if
14944 x_create_x_image_and_pixmap failed, not as malloc failures.
14945 (gs_load): Use x_check_image_size.
14946
5f8f9cc2
PE
14947 * gtkutil.c: Omit integer casts.
14948 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14949 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14950
5adf60bc
PE
14951 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14952
c8907a93
PE
14953 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14954 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14955 would wrongly return t on a 64-bit host.
14956
e3c25c68
PE
14957 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14958 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14959 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14960 and therefore cause GCC to emit a bogus diagnostic in some cases.
14961
3f791afe
PE
14962 * image.c: Integer signedness and overflow and related fixes.
14963 This is not an exhaustive set of fixes, but it's time to
14964 record what I've got.
14965 (lookup_pixel_color, check_image_size): Remove redundant decls.
14966 (check_image_size): Don't assume that arbitrary EMACS_INT values
14967 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14968 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14969 (tiff_load, imagemagick_load_image):
14970 Check for overflow in size calculations.
14971 (x_create_x_image_and_pixmap): Remove unnecessary test for
14972 xmalloc returning NULL; that can't happen.
14973 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14974 (xpm_color_bucket): Use better integer hashing function.
14975 (xpm_cache_color): Don't possibly over-allocate memory.
14976 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14977 (gif_memory_source):
14978 Use ptrdiff_t, not int or size_t, to record sizes.
14979 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14980 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14981 either works, as we prefer signed integers.
14982 (tiff_read_from_memory, tiff_write_from_memory):
14983 Return tsize_t, not size_t, since that's what the TIFF API wants.
14984 (tiff_read_from_memory): Don't fail simply because the read would
14985 go past EOF; instead, return a short read.
14986 (tiff_load): Omit no-longer-needed casts.
14987 (Fimagemagick_types): Don't assume size fits into 'int'.
14988
3cc5a532
PE
14989 Improve hashing quality when configured --with-wide-int.
14990 * fns.c (hash_string): New function, taken from sxhash_string.
14991 Do not discard information about ASCII character case; this
14992 discarding is no longer needed.
14993 (sxhash-string): Use it. Change sig to match it. Caller changed.
14994 * lisp.h: Declare it.
14995 * lread.c (hash_string): Remove, since we now use fns.c's version.
14996 The fns.c version returns a wider integer if --with-wide-int is
14997 specified, so this should help the quality of the hashing a bit.
14998
b312a492
PE
14999 * emacs.c: Integer overflow minor fix.
15000 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
15001 Define only if GNU_LINUX.
15002 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
15003
dfd153ae
PE
15004 * dispnew.c: Integer signedness and overflow fixes.
15005 Remove unnecessary forward decls, that were a maintenance hassle.
15006 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
15007 All uses changed.
15008 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
15009 (scrolling_window): Use ptrdiff_t, not int, for byte count.
15010 (prepare_desired_row, line_draw_cost):
15011 Use int, not unsigned, where either works.
15012 (save_current_matrix, restore_current_matrix):
15013 Use ptrdiff_t, not size_t, where either works.
15014 (init_display): Check for overflow more accurately, and without
15015 relying on undefined behavior.
15016
a81d11a3
PE
15017 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
15018 Remove, replacing with the new symbols in lisp.h. All uses changed.
15019 * fileio.c (make_temp_name):
15020 * filelock.c (lock_file_1, lock_file):
15021 * xdisp.c (message_dolog):
15022 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
15023 Use pMd etc. instead.
15024 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
15025 replacing the pWIDE etc. symbols removed from editfns.c.
15026
3300e6fd
PE
15027 * keyboard.h (num_input_events): Now uintmax_t.
15028 This is (very slightly) less likely to mess up due to wraparound.
15029 All uses changed.
15030
fd05c7e9
PE
15031 * buffer.c: Integer signedness fixes.
15032 (alloc_buffer_text, enlarge_buffer_text):
15033 Use ptrdiff_t rather than size_t when either will do, as we prefer
15034 signed integers.
15035
903fe15d
PE
15036 * alloc.c: Integer signedness and overflow fixes.
15037 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
15038 (__malloc_size_t): Default to size_t, not to int.
15039 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
15040 (Fgarbage_collect, mark_object_loop_halt, mark_object):
15041 Prefer ptrdiff_t to size_t when either would do, as we prefer
15042 signed integers.
15043 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
15044 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
15045 Now const. Initialize with values that are in range even if char
15046 is signed.
15047 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
15048 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
15049 These functions do the right thing with sizes > 2**32.
15050 (check_depth): Now ptrdiff_t, not int.
15051 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
15052 Adjust to new way of storing sizes. Check for size overflow bugs
15053 in rest of code.
15054 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
15055 slightly wrong anyway, as it missed one instance of
15056 XMALLOC_OVERRUN_CHECK_OVERHEAD.
15057 (refill_memory_reserve): Omit needless cast to size_t.
15058 (mark_object_loop_halt): Mark as externally visible.
15059
ac82cc6a
PE
15060 * xselect.c: Integer signedness and overflow fixes.
15061 (Fx_register_dnd_atom, x_handle_dnd_message):
15062 Use ptrdiff_t, not size_t, since we prefer signed.
15063 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
15064 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
15065 x_dnd_atoms_size and x_dnd_atoms_length.
15066
c2d1e36d
PE
15067 * doprnt.c: Prefer signed to unsigned when either works.
15068 * eval.c (verror):
15069 * doprnt.c (doprnt):
15070 * lisp.h (doprnt):
15071 * xdisp.c (vmessage):
15072 Use ptrdiff_t, not size_t, when using or implementing doprnt,
15073 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
15074 prefer signed arithmetic to avoid comparison confusion.
15075 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
15076 but is a bit tricky.
15077
0e926e56
PE
15078 Assume freestanding C89 headers, string.h, stdlib.h.
15079 * data.c, doprnt.c, floatfns.c, print.c:
15080 Include float.h unconditionally.
15081 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
15082 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
15083 * regex.c: Likewise for stddef.h, string.h.
15084 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
15085 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
15086 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
15087 (STDC_HEADERS): Remove obsolete defines.
15088 * sysdep.c: Include limits.h unconditionally.
15089
9cfdb3ec
PE
15090 Assume support for memcmp, memcpy, memmove, memset.
15091 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
15092 * regex.c (memcmp, memcpy):
15093 Remove; we assume C89 now.
15094
15095 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
15096 (__malloc_safe_bcopy): Remove; no longer needed.
15097
cf950e6b 15098 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
15099 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
15100 well either way, and we prefer signed to unsigned.
15101
dbf38e02
LMI
151022011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
15103
15104 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
15105 closes the connection while we're reading (bug#9182).
15106
d6f0886c 151072011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 15108
d6f0886c
JD
15109 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
15110 are specified (Bug#9168).
24e0f6b1 15111
2eb1f9e6
PE
151122011-07-25 Paul Eggert <eggert@cs.ucla.edu>
15113
15114 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
15115 Found by GCC static checking and --with-wide-int on a 32-bit host.
15116
22381272 151172011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
15118
15119 * xdisp.c (compute_display_string_pos): Fix logic of caching
15120 previous display string position. Initialize cached_prev_pos to
15121 -1. Fixes slow-down at the beginning of a buffer.
15122
f25e39b4
EZ
151232011-07-24 Eli Zaretskii <eliz@gnu.org>
15124
15125 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
15126 for attrs[LFACE_FONTSET_INDEX].
15127
04c4b52e
PE
151282011-07-23 Paul Eggert <eggert@cs.ucla.edu>
15129
15130 * xml.c (parse_region): Remove unused local
15131 that was recently introduced.
15132
c1734fbd
EZ
151332011-07-23 Eli Zaretskii <eliz@gnu.org>
15134
be18c5a5
EZ
15135 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
15136 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
15137
c1734fbd
EZ
15138 * xdisp.c (move_it_in_display_line_to): Record the best matching
15139 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
15140 exit if none of the characters scanned was an exact match.
15141 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
15142 when exact match is impossible due to invisible text, and the
15143 lines are truncated.
15144
a258d627
JD
151452011-07-23 Jan Djärv <jan.h.d@swipnet.se>
15146
15147 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
15148 for OSX >= 10.7.
15149
b6d5a689
EZ
151502011-07-22 Eli Zaretskii <eliz@gnu.org>
15151
0f74f785
EZ
15152 Fix a significant slow-down of cursor motion with C-n, C-p,
15153 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
15154 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 15155 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
15156 (next_element_from_buffer): Call compute_stop_pos_backwards to
15157 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
15158 base_level_stop.
15159 (reseat): Don't look for prev_stop, as that could mean a very long
15160 run.
15161 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
15162 <cached_disp_overlay_modiff>: Cache for last found display string
15163 position.
551918c1 15164 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
15165 about the same buffer in the same area of character positions, and
15166 the buffer wasn't changed since the time the display string
15167 position was cached.
551918c1 15168
b2d0c91a
EZ
151692011-07-22 Eli Zaretskii <eliz@gnu.org>
15170
15171 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
15172 is an integer, which is important for empty lines. (Bug#9149)
15173
043604ee
CY
151742011-07-22 Chong Yidong <cyd@stupidchicken.com>
15175
15176 * frame.c (Fmodify_frame_parameters): In tty case, update the
15177 default face if necessary (Bug#4238).
15178
da4adb04
CY
151792011-07-21 Chong Yidong <cyd@stupidchicken.com>
15180
15181 * editfns.c (Fstring_to_char): No need to explain what a character
15182 is in the docstring (Bug#6576).
15183
9abd0532
LMI
151842011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15185
15186 * xml.c (parse_region): Make sure we always return a tree.
15187
36881d16
HK
151882011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
15189
15190 * xml.c (parse_region): If a document contains only comments,
15191 return that, too.
15192
1e98674d
LMI
151932011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
15194
15195 * xml.c (make_dom): Return comments, too.
15196
590bd467
PE
151972011-07-19 Paul Eggert <eggert@cs.ucla.edu>
15198
15199 Port to OpenBSD.
15200 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
15201 and the surrounding thread.
15202 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
15203 rather than fgets, and retry after EINTR. Otherwise, 'emacs
15204 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
15205 timer goes off.
15206 * s/openbsd.h (BROKEN_SIGIO): Define.
15207 * unexelf.c (unexec) [__OpenBSD__]:
15208 Don't update the .mdebug section of the Alpha COFF symbol table.
15209
f41628b2
LMI
152102011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15211
15212 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
15213 (bug#8460).
15214
b59b67c5
PE
152152011-07-18 Paul Eggert <eggert@cs.ucla.edu>
15216
15e3a074
PE
15217 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
15218 This fixes some race conditions on the permissions of any newly
15219 created file.
15220
41bed37d
PE
15221 * alloc.c (valid_pointer_p): Use pipe, not open.
15222 This fixes some permissions issues when debugging.
15223
b59b67c5
PE
15224 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
15225 If fchown fails to set both uid and gid, try to set just gid,
15226 as that is sometimes allowed. Adjust the file's mode to eliminate
15227 setuid or setgid bits that are inappropriate if fchown fails.
15228
925a6be7
SM
152292011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
15230
15231 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
15232 to compare Lisp_Objects.
15233 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
15234 global_gnutls_log_level, don't mistake it for a Lisp_Object.
15235 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
15236
52968808
AS
152372011-07-17 Andreas Schwab <schwab@linux-m68k.org>
15238
0a6a104b
AS
15239 * lread.c (read_integer): Unread even EOF character.
15240 (read1): Likewise. Properly record start position of symbol.
15241
52968808
AS
15242 * lread.c (read1): Read `#:' as empty uninterned symbol if no
15243 symbol character follows.
15244
9e381cdd
PE
152452011-07-17 Paul Eggert <eggert@cs.ucla.edu>
15246
15247 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
15248 This works around a problem with the previous change to Fcopy_file.
15249 Recent glibc declares fchown with __attribute__((warn_unused_result)),
15250 and without this change, GCC might complain about discarding
15251 fchown's return value.
15252
b5641435
JB
152532011-07-16 Juanma Barranquero <lekktu@gmail.com>
15254
15255 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
15256
a8031457
PE
152572011-07-16 Paul Eggert <eggert@cs.ucla.edu>
15258
15259 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
15260
dd889327
LMI
152612011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
15262
750c33f7
LMI
15263 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
15264 it's used from the C level.
15265
dd889327
LMI
15266 * process.c: Use the same condition for POLL_FOR_INPUT in both
15267 keyboard.c and process.c (bug#1858).
15268
87e86684
LM
152692011-07-09 Lawrence Mitchell <wence@gmx.li>
15270
15271 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
15272 (Fgnutls_boot): Use it.
15273
64348f40
AS
152742011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15275
15276 * doc.c (Fsubstitute_command_keys): Revert last change.
15277
1d698799
LMI
152782011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15279
f863868c
LMI
15280 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15281 quotes the next character, and doesn't affect other longer
15282 sequences (bug#8935).
15283
1d698799
LMI
15284 * lread.c (syms_of_lread): Clarify that is isn't only
15285 `eval-buffer' and `eval-defun' that's affected by
15286 `lexical-binding' (bug#8460).
15287
aa4b6df6
EZ
152882011-07-15 Eli Zaretskii <eliz@gnu.org>
15289
15290 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 15291 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 15292
5d856da6
PE
152932011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15294
ad6042bb
PE
15295 Fix minor problems found by static checking.
15296 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15297 (elsz): Now a signed constant, not a size_t var. We prefer signed
15298 types to unsigned, to avoid integer comparison confusion. Without
15299 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15300 "cannot optimize loop, the loop counter may overflow", a symptom
15301 of the confusion.
f00bbb22 15302 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
15303 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15304
6468f31c
LMI
153052011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15306
49080b10
LMI
15307 * search.c (Fre_search_backward): Mention `case-fold-search' in
15308 all the re_search_* functions (bug#8138).
15309
6468f31c
LMI
15310 * keyboard.c (Fopen_dribble_file): Document when the file is
15311 closed (bug#8056).
15312
c965adc5
EZ
153132011-07-14 Eli Zaretskii <eliz@gnu.org>
15314
df9733bf
EZ
15315 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15316 bidi_cache_idx.
15317
0bb23927
EZ
15318 Support bidi reordering of display and overlay strings.
15319 * xdisp.c (compute_display_string_pos)
15320 (compute_display_string_end): Accept additional argument STRING.
15321 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15322 (reseat_to_string): Initialize bidi_it->string.s and
15323 bidi_it->string.schars.
15324 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
15325 NULL (avoids a crash in bidi_paragraph_init).
15326 Initialize itb.string.lstring.
0bb23927
EZ
15327 (init_iterator): Call bidi_init_it only of a valid
15328 buffer position was specified. Initialize paragraph_embedding to
15329 L2R.
15330 (reseat_to_string): Initialize the bidi iterator.
15331 (display_string): If we need to ignore text properties of
15332 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15333 original value of -1 will not work with bidi.)
15334 (compute_display_string_pos): First arg is now struct
15335 `text_pos *'; all callers changed. Support display properties on
15336 Lisp strings.
15337 (compute_display_string_end): Support display properties on Lisp
15338 strings.
15339 (init_iterator, reseat_1, reseat_to_string): Initialize the
15340 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15341 when iterating on a string not from display properties).
640c8776
SM
15342 (compute_display_string_pos, compute_display_string_end):
15343 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
15344 arrow keys.
15345 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
15346 base_level_stop; instead, set base_level_stop to BEGV.
15347 Fixes crashes in vertical-motion.
0bb23927
EZ
15348 (next_element_from_buffer): Improve commentary for when
15349 the iterator is before prev_stop.
15350 (init_iterator): Initialize bidi_p from the default value of
15351 bidi-display-reordering, not from buffer-local value. Use the
15352 buffer-local value only if initializing for buffer iteration.
15353 (handle_invisible_prop): Support invisible properties on strings
15354 that are being bidi-reordered.
15355 (set_iterator_to_next): Support bidi reordering of C strings and
15356 Lisp strings.
15357 (next_element_from_string): Support bidi reordering of Lisp
15358 strings.
15359 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
15360 (display_string): Support display of R2L glyph rows.
15361 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
15362 (init_iterator): Don't initialize it->bidi_p for strings
15363 here.
15364 (reseat_to_string): Initialize it->bidi_p for strings here.
15365 (next_element_from_string, next_element_from_c_string)
15366 (next_element_from_buffer): Add xassert's for correspondence
15367 between IT's object being iterated and it->bidi_it.string
15368 structure.
15369 (face_before_or_after_it_pos): Support bidi iteration.
15370 (next_element_from_c_string): Handle the case of the first string
15371 character that is not the first one in the visual order.
15372 (get_visually_first_element): New function, refactored from common
15373 parts of next_element_from_buffer, next_element_from_string, and
15374 next_element_from_c_string.
15375 (tool_bar_lines_needed, redisplay_tool_bar)
15376 (display_menu_bar): Force left-to-right direction. Add a FIXME
15377 comment for making that be controlled by a user option.
15378 (push_it, pop_it): Save and restore the state of the
15379 bidi iterator. Save and restore the bidi_p flag.
15380 (pop_it): Iterate out of display property for string iteration as
15381 well.
15382 (iterate_out_of_display_property): Support iteration over strings.
15383 (handle_single_display_spec): Set up it->bidi_it for iteration
15384 over a display string, and call bidi_init_it.
15385 (handle_single_display_spec, next_overlay_string)
15386 (get_overlay_strings_1, push_display_prop): Set up the bidi
15387 iterator for displaying display or overlay strings.
15388 (forward_to_next_line_start): Don't use the shortcut if
15389 bidi-iterating.
15390 (back_to_previous_visible_line_start): If handle_display_prop
15391 pushed the iterator stack, restore the internal state of the bidi
15392 iterator by calling bidi_pop_it same number of times.
15393 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15394 and we are bidi-iterating, don't decrement the iterator position;
15395 instead, set the first_elt flag in the bidi iterator, to produce
15396 the same effect.
15397 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15398 (push_display_prop): xassert that we are iterating a buffer.
15399 (push_it, pop_it): Save and restore paragraph_embedding member.
15400 (handle_single_display_spec, next_overlay_string)
15401 (get_overlay_strings_1, reseat_1, reseat_to_string)
15402 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15403 correctly. Don't assume unibyte strings are not bidi-reordered.
15404 (compute_display_string_pos)
15405 (compute_display_string_end): Fix handling the case of C string.
15406 (push_it, pop_it): Save and restore from_disp_prop_p.
15407 (handle_single_display_spec, push_display_prop): Set the
15408 from_disp_prop_p flag.
15409 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15410 (pop_it): Call iterate_out_of_display_property only if we are
15411 popping after iteration over a string that came from a display
15412 property. Fix a typo in popping stretch info. Add an assertion
15413 for verifying that the iterator position is in sync with the bidi
15414 iterator.
15415 (handle_single_display_spec, get_overlay_strings_1)
15416 (push_display_prop): Fix initialization of paragraph direction for
15417 string when that of the parent object is not yet determined.
15418 (reseat_1): Call bidi_init_it to resync the bidi
15419 iterator with IT's position. (Bug#7616)
15420 (find_row_edges): If ROW->start.pos gives position
15421 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15422 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15423 Reset the from_disp_prop_p flag.
15424 (SAVE_IT, RESTORE_IT): New macros.
15425 (pos_visible_p, face_before_or_after_it_pos)
15426 (back_to_previous_visible_line_start)
15427 (move_it_in_display_line_to, move_it_in_display_line)
15428 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15429 (try_scrolling, redisplay_window, display_line): Use them when
15430 saving a temporary copy of the iterator and restoring it back.
15431 (back_to_previous_visible_line_start, reseat_1)
15432 (init_iterator): Empty the bidi cache "stack".
15433 (move_it_in_display_line_to): If iterator ended up at
15434 EOL, but we never saw any buffer positions smaller than
15435 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15436 motion in bidi-reordered lines.
15437 (move_it_in_display_line_to): Record prev_method and prev_pos
15438 immediately before the call to set_iterator_to_next. Fixes cursor
15439 motion in bidi-reordered lines with stretch glyphs and strings
15440 displayed in margins. (Bug#8133) (Bug#8867)
15441 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15442 TO_CHARPOS.
640c8776
SM
15443 (pos_visible_p): Support positions in bidi-reordered lines.
15444 Save and restore bidi cache.
0bb23927
EZ
15445
15446 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15447 (bidi_paragraph_info): Delete unused struct.
15448 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15449 (bidi_cache_start): New variable.
15450 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15451 to zero.
15452 (bidi_cache_fetch_state, bidi_cache_search)
15453 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15454 (bidi_cache_find, bidi_peek_at_next_level)
15455 (bidi_level_of_next_char, bidi_find_other_level_edge)
15456 (bidi_move_to_visually_next): Compare cache index with
15457 bidi_cache_start rather than with zero.
15458 (bidi_fetch_char): Accept new argument STRING; all callers
15459 changed. Support iteration over a string. Support strings with
15460 display properties. Support unibyte strings. Fix the type of
15461 `len' according to what STRING_CHAR_AND_LENGTH expects.
15462 (bidi_paragraph_init, bidi_resolve_explicit_1)
15463 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
15464 (bidi_level_of_next_char, bidi_move_to_visually_next):
15465 Support iteration over a string.
0bb23927
EZ
15466 (bidi_set_sor_type, bidi_resolve_explicit_1)
15467 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15468 can now be zero (for strings); special values 0 and -1 were
15469 changed to -1 and -2, respectively.
15470 (bidi_char_at_pos): New function.
15471 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15472 Call it instead of FETCH_MULTIBYTE_CHAR.
15473 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15474 initialized to valid values.
15475 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15476 values.
15477 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15478 the test for valid cached positions. Fix the logic for looking up
15479 the sentinel state in the cache. GCPRO the Lisp string we are
15480 iterating.
15481 (bidi_push_it, bidi_pop_it): New functions.
15482 (bidi_initialize): Initialize the bidi cache start stack pointer.
15483 (bidi_cache_ensure_space): New function, refactored from part of
15484 bidi_cache_iterator_state. Don't assume the required size is just
15485 one BIDI_CACHE_CHUNK away.
15486 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15487 (bidi_count_bytes, bidi_char_at_pos): New functions.
15488 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15489 always valid if bidi_cache_idx is valid.
15490 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15491 is valid if it's going to be used.
15492 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15493 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
15494 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15495 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
15496 (bidi_find_other_level_edge, bidi_cache_start_stack):
15497 All variables related to cache indices are now EMACS_INT.
c965adc5 15498
0bb23927
EZ
15499 * dispextern.h (struct bidi_string_data): New structure.
15500 (struct bidi_it): New member `string'. Make flag members be 1-bit
15501 fields, and put them last in the struct.
640c8776
SM
15502 (compute_display_string_pos, compute_display_string_end):
15503 Update prototypes.
0bb23927
EZ
15504 (bidi_push_it, bidi_pop_it): Add prototypes.
15505 (struct iterator_stack_entry): New members bidi_p,
15506 paragraph_embedding, and from_disp_prop_p.
15507 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
15508 (bidi_shelve_cache, bidi_unshelve_cache):
15509 Declare prototypes.
0bb23927
EZ
15510
15511 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15512 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15513 and vector-like objects.
15514
15515 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15516 cache around display iteration.
15517
15518 * window.c (Fwindow_end, window_scroll_pixel_based)
15519 (displayed_window_lines, Frecenter): Save and restore the bidi
15520 cache around display iteration.
15521
3bbd2265
LMI
155222011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15523
15524 * editfns.c (Fdelete_region): Clarify the use of the named
15525 parameters (bug#6788).
15526
adc47434
MR
155272011-07-14 Martin Rudalics <rudalics@gmx.at>
15528
15529 * indent.c (Fvertical_motion): Set and restore w->pointm when
15530 saving and restoring the window's buffer (Bug#9006).
15531
837c31f8
LMI
155322011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15533
15534 * editfns.c (Fstring_to_char): Clarify just what is returned
15535 (bug#6576). Text by Eli Zaretskii.
15536
ac389d0c
JB
155372011-07-13 Juanma Barranquero <lekktu@gmail.com>
15538
15539 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15540
0be0ce47
EZ
155412011-07-13 Eli Zaretskii <eliz@gnu.org>
15542
15543 * buffer.c (mmap_find): Fix a typo.
15544
cd18e7e3
JB
155452011-07-13 Johan Bockgård <bojohan@gnu.org>
15546
15547 Fix execution of x selection hooks.
15548 * xselect.c (Qx_lost_selection_functions)
15549 (Qx_sent_selection_functions): New vars.
15550 (syms_of_xselect): DEFSYM them.
15551 (x_handle_selection_request): Pass Qx_sent_selection_functions
15552 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15553 (x_handle_selection_clear,x_clear_frame_selections):
15554 Pass Qx_lost_selection_functions rather than
15555 Vx_lost_selection_functions to Frun_hook_with_args.
15556
47ea7f44
PE
155572011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15558
ac389d0c 15559 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
15560 The old code sometimes used this field without initializing it.
15561
47ea7f44
PE
15562 * alloc.c (gc_sweep): Don't read past end of array.
15563 In theory, the old code could also have corrupted Emacs internals,
15564 though it'd be very unlikely.
15565
bc985c87
AS
155662011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15567
15568 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 15569 argument. (Bug#4026)
bc985c87 15570
0cf34688
LMI
155712011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15572
b3dadd76
LMI
15573 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15574 key" (bug#4257).
15575
0cf34688
LMI
15576 * window.c (Fset_window_start): Doc fix (bug#4199).
15577 (Fset_window_hscroll): Ditto.
15578
270768cd
PE
155792011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15580
077e3dda 15581 Fix minor new problems caught by GCC 4.6.1.
270768cd 15582 * term.c (init_tty): Remove unused local.
490011a6 15583 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 15584 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 15585 not used otherwise.
270768cd 15586
b1f58454
CY
155872011-07-12 Chong Yidong <cyd@stupidchicken.com>
15588
15589 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15590
22b9578d
LMI
155912011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15592
6e70ab07
LMI
15593 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15594 are the mini-buffer and the echo area (bug#3320).
15595
22b9578d
LMI
15596 * term.c (init_tty): Remove support for supdup, c10 and perq
15597 terminals, which are no longer supported (bug#1482).
15598
8974cc9f
JB
155992011-07-10 Johan Bockgård <bojohan@gnu.org>
15600
15601 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15602
a560d974
JD
156032011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15604
15605 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15606 for non-popups (Bug#3642).
15607
1dae0f0a
AS
156082011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15609
268c2c36 15610 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 15611 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
15612 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15613 * cm.c (losecursor): Likewise.
1dae0f0a
AS
15614 * data.c (fmod): Likewise.
15615 * dispnew.c (swap_glyphs_in_rows): Likewise.
15616 * emacs.c (memory_warning_signal): Likewise.
15617 * floatfns.c (float_error): Likewise.
15618 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15619 (otf_open, font_otf_capability, generate_otf_features)
15620 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15621 Likewise.
15622 * image.c (pbm_read_file): Likewise.
15623 * indent.c (string_display_width): Likewise.
15624 * intervals.c (check_for_interval, search_for_interval)
15625 (inc_interval_count, count_intervals, root_interval)
15626 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15627 * lread.c (defalias): Likewise.
268c2c36 15628 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
15629 * regex.c (set_image_of_range_1, set_image_of_range)
15630 (regex_grow_registers): Likewise.
15631 * sysdep.c (strerror): Likewise.
15632 * termcap.c (valid_filename_p, tprint, main): Likewise.
15633 * tparam.c (main): Likewise.
15634 * unexhp9k800.c (run_time_remap, save_data_space)
15635 (update_file_ptrs, read_header, write_header, calculate_checksum)
15636 (copy_file, copy_rest, display_header): Likewise.
15637 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15638 Likewise.
15639 * xdisp.c (check_it): Likewise.
15640 * xfaces.c (register_color, unregister_color, unregister_colors):
15641 Likewise.
15642 * xfns.c (print_fontset_result): Likewise.
15643 * xrdb.c (member, fatal, main): Likewise.
15644
99033785
PE
156452011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15646
15647 Fix minor problems found by static checking (Bug#9031).
15648 * chartab.c (char_table_set_range, map_sub_char_table):
15649 Remove unused locals.
15650 (uniprop_table): Now static.
15651 * composite.c (_work_char): Remove unused static var.
15652
9cb2ac56
JB
156532011-07-09 Juanma Barranquero <lekktu@gmail.com>
15654
15655 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15656
f25661f0
JD
156572011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15658
15659 * gtkutil.c (qttip_cb): Remove code without function.
15660
8278c4fe
EZ
156612011-07-09 Eli Zaretskii <eliz@gnu.org>
15662
15663 * w32.c (pthread_sigmask): New stub.
15664
1692ae2d 156652011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 15666
8a6ebd58 15667 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
15668 sigprocmask is portable only for single-threaded applications, and
15669 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
15670 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15671 (LIBES): Use it.
15672 * callproc.c (Fcall_process):
15673 * process.c (create_process):
15674 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15675 Use pthread_sigmask, not sigprocmask.
123403e4 15676
1b854618
JD
156772011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15678
15679 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15680 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15681 wrong (Bug#8591).
15682
3fe4b549
JD
156832011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15684
0ce7e563
JD
15685 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15686 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15687 (xg_hide_tooltip): Fix comment.
15688
3fe4b549
JD
15689 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15690 in registerServicesMenuSendTypes.
15691 (validRequestorForSendType): Don't check ns_return_types.
15692
15693 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15694 ns_return_type.
15695
5df75e47
JR
156962011-07-08 Jason Rumney <jasonr@gnu.org>
15697
22610910
JR
15698 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15699 SH_SHOW for hidden windows (Bug#5482).
15700
5df75e47
JR
15701 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15702 frame struct members of non-existent frames (Bug#6284).
15703
699c10bd
JD
157042011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15705
4393663b
JD
15706 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15707 variable firstTime not needed on OSX >= 10.6.
15708 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15709 >= 10.5. Use setKnobProportion, setDoubleValue.
15710
15711 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15712 (MAC_OS_X_VERSION_10_5): Define if not defined.
15713 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15714 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15715 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15716
15717 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 15718 cString and lossyCString on OSX >= 10.4.
4393663b 15719
58179cce 15720 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
15721 sizeToFit on OSX >= 10.2.
15722
15723 * nsimage.m (allocInitFromFile): Don't use deprecated method
15724 bestRepresentationForDevice on OSX >= 10.6.
15725
15726 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15727 to avoid warning.
15728
15729 * emacs.c: Declare unexec_init_emacs_zone.
15730
a63e0781
JD
15731 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15732
699c10bd
JD
15733 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15734
15735 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15736 on svcsMenu (Bug#8842).
15737
15738 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15739 ns_return_types.
15740 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15741
15742 * nsterm.m (QUTF8_STRING): Declare.
15743 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15744 (validRequestorForSendType): Return type is (id).
15745 Change indexOfObjectIdenticalTo to indexOfObject.
15746 Check if we have local selection before returning self (Bug#8842).
15747 (writeSelectionToPasteboard): Put local selection into paste board
15748 if we have a local selection (Bug#8842).
15749 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15750
15751 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15752 (ns_get_local_selection): Declare.
15753
54e10184
LMI
157542011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15755
9888ff71
LMI
15756 * keymap.c (describe_map_tree): Don't insert a double newline at
15757 the end of the buffer (bug#1169) and return whether we inserted
15758 something.
15759
54e10184
LMI
15760 * callint.c (Fcall_interactively): Change "reading args" to
15761 "providing args" to try to clarify what it does (bug#1010).
15762
15fa4783
KH
157632011-07-07 Kenichi Handa <handa@m17n.org>
15764
15765 * composite.c (composition_compute_stop_pos): Ignore a static
15766 composition starting before CHARPOS (Bug#8915).
15767
15768 * xdisp.c (handle_composition_prop): Likewise.
15769
a8815b00
EZ
157702011-07-07 Eli Zaretskii <eliz@gnu.org>
15771
15772 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15773 (Bug#9015)
15774
ef7b981d 157752011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
15776
15777 * character.h (unicode_category_t): New enum type.
15778
15779 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15780 (Qchar_code_property_table): New variable.
15781 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15782 (UNIPROP_COMPRESSED_FORM_P): New macros.
15783 (char_table_ascii): Uncompress the compressed values.
15784 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15785 Uncompress the compressed values.
ac389d0c 15786 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
15787 (char_table_ref_and_range): Uncompress the compressed values.
15788 (sub_char_table_set): New arg is_uniprop. Callers changed.
15789 Uncompress the compressed values.
15790 (sub_char_table_set_range): Args changed. Callers changed.
15791 (char_table_set_range): Adjuted for the above change.
15792 (map_sub_char_table): Delete args default_val and parent. Add arg
15793 top. Give decoded values to a Lisp function.
640c8776 15794 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
15795 values to a Lisp function. Gcpro more variables.
15796 (uniprop_table_uncompress)
15797 (uniprop_decode_value_run_length): New functions.
15798 (uniprop_decoder, uniprop_decoder_count): New variables.
15799 (uniprop_get_decoder, uniprop_encode_value_character)
15800 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15801 New functions.
15802 (uniprop_encoder, uniprop_encoder_count): New variables.
15803 (uniprop_get_encoder, uniprop_table)
15804 (Funicode_property_table_internal, Fget_unicode_property_internal)
15805 (Fput_unicode_property_internal): New functions.
15806 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15807 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 15808 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
15809 char-code-property-alist.
15810
640c8776 15811 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
15812 Vunicode_category_table.
15813
640c8776 15814 * font.c (font_range): Adjust for the change of
c805dec0
KH
15815 Vunicode_category_table.
15816
76b397fb
DN
158172011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15818
15819 * m/iris4d.h: Remove file, move contents ...
15820 * s/irix6-5.h: ... here.
15821
22b4128e
PE
158222011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15823
15824 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
15825 * alloc.c (mark_buffer):
15826 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15827 (clone_per_buffer_values): Don't assume that
22b4128e
PE
15828 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15829 This isn't true in general, and it's particularly not true
15830 if Emacs is configured with --with-wide-int.
15831 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15832 New macros, used in the buffer.c change.
15833
869795d6
JD
158342011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15835
15836 * xsettings.c: Use both GConf and GSettings if both are available.
15837 (store_config_changed_event): Add comment.
15838 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15839 (store_tool_bar_style_changed): New functions.
5e617bc2 15840 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
15841 (struct xsettings): Move font inside HAVE_XFT.
15842 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 15843 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 15844 Move inside HAVE_XFT.
640c8776 15845 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
15846 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15847 also.
15848 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 15849 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 15850 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
15851 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15852 (parse_settings): Move check for font inside HAVE_XFT.
15853 (read_settings, apply_xft_settings): Add comment.
15854 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15855 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15856 call store_font_name_changed.
15857 (xft_settings_event): Add comment.
15858 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15859 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15860 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15861 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15862 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
15863 (xsettings_get_system_font, xsettings_get_system_normal_font):
15864 Add comment.
869795d6 15865
d8ed26bd
PE
158662011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15867
15868 Random fixes. E.g., (random) never returned negative values.
15869 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15870 subseconds part to the entropy, as that's a bit more random.
15871 Prefer signed to unsigned, since the signedness doesn't matter and
15872 in general we prefer signed. When given a limit, use a
15873 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15874 latter isn't right if USE_2_TAGS_FOR_INTS.
15875 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15876 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15877
cabf1cac
SM
158782011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15879
15880 * textprop.c (text_property_stickiness):
15881 Obey Vtext_property_default_nonsticky.
15882 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15883 * w32fns.c (syms_of_w32fns):
15884 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15885
6e9b2be9
PE
158862011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15887
15888 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15889 This is more efficient than Ffile_directory_p and avoids a minor race.
15890
90186c68
LMI
158912011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15892
7c301272
LMI
15893 * buffer.c (Foverlay_put): Say what the return value is
15894 (bug#7835).
15895
c4f2d8d4
LMI
15896 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15897 is a directory before asking whether to use the file name
15898 (bug#7564).
ad637907
LMI
15899 (barf_or_query_if_file_exists): Make the "File is a directory"
15900 error be more correct.
c4f2d8d4 15901
90186c68
LMI
15902 * fns.c (Frequire): Remove the mention of the .gz files, since
15903 that's installation-specific, but keep the mention of
15904 `get-load-suffixes'.
15905
da64016e
PE
159062011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15907
15908 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15909 Report string overflow if the output is too long.
15910
7d47b580
JB
159112011-07-04 Juanma Barranquero <lekktu@gmail.com>
15912
a555cb87
JB
15913 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15914 (syms_of_gnutls): Remove duplicate DEFSYM for
15915 Qgnutls_bootprop_verify_hostname_error, an error for
15916 Qgnutls_bootprop_verify_error (which is no longer used).
15917
7d47b580
JB
15918 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15919 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15920 Also (re)move comments that are misplaced or no longer relevant.
15921
1e49bfab
LMI
159222011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15923
15924 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15925
1485f4c0
CY
159262011-07-03 Chong Yidong <cyd@stupidchicken.com>
15927
15928 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15929 and background color parameters if they have been changed.
15930
a9ab721e
LMI
159312011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15932
15933 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15934
cf7cff57
PE
159352011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15936
2e13213d
PE
15937 * xsettings.c (SYSTEM_FONT): Define only when used.
15938 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15939
cf7cff57
PE
15940 * keymap.c (access_keymap_1): Now static.
15941
7a8e04f7
CY
159422011-07-02 Chong Yidong <cyd@stupidchicken.com>
15943
15944 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15945 leave any prefix arg for the up event (Bug#1586).
15946
61352f62
LMI
159472011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15948
69bb1ef7
LMI
15949 * lread.c (syms_of_lread): Mention single symbols defined by
15950 `defvar' or `defconst' (bug#7154).
15951
61352f62 15952 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 15953 (Frequire): Mention get-load-suffixes.
61352f62 15954
28545e04
MR
159552011-07-02 Martin Rudalics <rudalics@gmx.at>
15956
15957 * window.h (window): Remove clone_number slot.
15958 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15959 Remove.
15960 (make_parent_window, make_window, saved_window)
15961 (Fset_window_configuration, save_window_save): Don't deal with
15962 clone numbers.
15963 * buffer.c (Qclone_number): Remove declaration.
15964 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15965
3349e122
SM
159662011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15967
15968 Add multiple inheritance to keymaps.
15969 * keymap.c (Fmake_composed_keymap): New function.
15970 (Fset_keymap_parent): Simplify.
15971 (fix_submap_inheritance): Remove.
15972 (access_keymap_1): New function extracted from access_keymap to handle
15973 embedded parents and handle lists of maps.
15974 (access_keymap): Use it.
15975 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15976 (Fcopy_keymap): Handle embedded parents.
15977 (Fcommand_remapping, define_as_prefix): Simplify.
15978 (Fkey_binding): Simplify.
15979 (syms_of_keymap): Move minibuffer-local-completion-map,
15980 minibuffer-local-filename-completion-map,
15981 minibuffer-local-must-match-map, and
15982 minibuffer-local-filename-must-match-map to Elisp.
15983 (syms_of_keymap): Defsubr make-composed-keymap.
15984 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15985 (parse_menu_item): Trivial simplification.
15986
3279eb87
GM
159872011-07-01 Glenn Morris <rgm@gnu.org>
15988
15989 * Makefile.in (SETTINGS_LIBS): Fix typo.
15990
39cb9e56 159912011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
15992
15993 * coding.c (Fencode_coding_string): Record the last coding system
15994 used, as the function doc string says (bug#8738).
15995
0949d2b6
JD
159962011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15997
15998 * xsettings.c (store_monospaced_changed): Take new font as arg and
15999 check for change against current_mono_font.
16000 (EMACS_TYPE_SETTINGS): Remove this and related defines.
16001 (emacs_settings_constructor, emacs_settings_get_property)
16002 (emacs_settings_set_property, emacs_settings_class_init)
16003 (emacs_settings_init, gsettings_obj): Remove.
16004 (something_changedCB): New function for HAVE_GSETTINGS.
16005 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
16006 with value as argument.
16007 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
16008 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 16009 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
16010 "changed".
16011
16012 * xgselect.c: Add defined (HAVE_GSETTINGS).
16013 (xgselect_initialize): Ditto.
16014
16015 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
16016 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
16017 xg_select.
16018
bbc6b304
PE
160192011-07-01 Paul Eggert <eggert@cs.ucla.edu>
16020
16021 * eval.c (struct backtrace): Simplify and port the data structure.
16022 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
16023 signed bit field, as this assumption is not portable and it makes
16024 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
16025 "char debug_on_exit : 1" as this is not portable either; instead,
16026 use the portable "unsigned int debug_on_exit : 1". Remove unused
16027 member evalargs. Remove obsolete comments about cc bombing out.
16028
9851bfc5
JD
160292011-06-30 Jan Djärv <jan.h.d@swipnet.se>
16030
51bb811f 16031 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
16032 Let HAVE_GSETTINGS override HAVE_GCONF.
16033 (store_monospaced_changed): New function.
16034 (EMACS_SETTINGS): A new type derived from GObject to handle
16035 GSettings notifications.
16036 (emacs_settings_constructor, emacs_settings_get_property)
16037 (emacs_settings_set_property, emacs_settings_class_init):
16038 New functions.
16039 (gsettings_client, gsettings_obj): New variables.
16040 (GSETTINGS_SCHEMA): New define.
16041 (something_changedCB): Call store_monospaced_changed.
16042 (init_gsettings): New function.
16043 (xsettings_initialize): Call init_gsettings.
16044 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
16045 to NULL.
16046
640c8776 16047 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
16048 GCONF_CFLAGS/LIBS.
16049
5386012d
MR
160502011-06-29 Martin Rudalics <rudalics@gmx.at>
16051
16052 * window.c (resize_root_window, grow_mini_window)
16053 (shrink_mini_window): Rename Qresize_root_window to
16054 Qwindow_resize_root_window and Qresize_root_window_vertically to
16055 Qwindow_resize_root_window_vertically.
16056
f13e0b08
PE
160572011-06-28 Paul Eggert <eggert@cs.ucla.edu>
16058
16059 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
16060
94515237
JB
160612011-06-27 Juanma Barranquero <lekktu@gmail.com>
16062
16063 * makefile.w32-in: Redesign dependencies so they reflect more
16064 clearly which files are directly included by each source file,
16065 and not through other includes.
16066
e43b6e43
MR
160672011-06-27 Martin Rudalics <rudalics@gmx.at>
16068
16069 * buffer.c (Qclone_number): Declare static and DEFSYM it.
16070 (sort_overlays, overlay_strings): When an overlay's clone number
16071 matches the window's clone number process the overlay even if
16072 the overlay's window property doesn't match the current window.
16073
d68443dc
MR
16074 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
16075 (Fwindow_hchild): Rename to Fwindow_left_child.
16076 (Fwindow_next): Rename to Fwindow_next_sibling.
16077 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
16078 (resize_window_check): Rename to window_resize_check.
16079 (resize_window_apply): Rename to window_resize_apply.
16080 (Fresize_window_apply): Rename to Fwindow_resize_apply.
16081 (Fdelete_other_windows_internal, resize_frame_windows)
16082 (Fsplit_window_internal, Fdelete_window_internal)
16083 (grow_mini_window, shrink_mini_window)
16084 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 16085
c7e73be5
JD
160862011-06-26 Jan Djärv <jan.h.d@swipnet.se>
16087
16088 * emacsgtkfixed.h: State that this is only used with Gtk+3.
16089 (emacs_fixed_set_min_size): Remove.
16090 (emacs_fixed_new): Take frame as argument.
16091
16092 * emacsgtkfixed.c: State that this is only used with Gtk+3.
16093 (_EmacsFixedPrivate): Remove minwidth/height.
16094 Add struct frame *f.
16095 (emacs_fixed_init): Initialize priv->f.
16096 (get_parent_class, emacs_fixed_set_min_size): Remove.
16097 (emacs_fixed_new): Set priv->f to argument.
16098 (emacs_fixed_get_preferred_width)
16099 (emacs_fixed_get_preferred_height): Use min_width/height from
16100 frames size_hint to set minimum and natural (Bug#8919).
16101 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
16102 and use min_width/height from frames size_hint to set
16103 min_width/height (Bug#8919).
16104
16105 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
16106 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
16107 Fix indentation.
c7e73be5 16108
cf99dcf8
EZ
161092011-06-26 Eli Zaretskii <eliz@gnu.org>
16110
16111 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
16112 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
16113 called at ZV.
16114
029529ac
CY
161152011-06-26 Chong Yidong <cyd@stupidchicken.com>
16116
16117 * process.c (wait_reading_process_output): Bypass select if
16118 waiting for a cell while ignoring keyboard input, and input is
16119 pending. Suggested by Jan Djärv (Bug#8869).
16120
7a7ef429
PE
161212011-06-25 Paul Eggert <eggert@cs.ucla.edu>
16122
16123 Use gnulib's dup2 module instead of rolling our own.
16124 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
16125
11fdef7d 161262011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
16127
16128 * dispnew.c (scrolling_window): Before scrolling, turn off a
16129 mouse-highlight in the window being scrolled.
16130
cd3520a4
JB
161312011-06-24 Juanma Barranquero <lekktu@gmail.com>
16132
16133 Move DEFSYM to lisp.h and use everywhere.
16134
16135 * character.h (DEFSYM): Move declaration...
16136 * lisp.h (DEFSYM): ...here.
16137
16138 * gnutls.c:
16139 * minibuf.c:
16140 * w32menu.c:
16141 * w32proc.c:
16142 * w32select.c: Don't include character.h.
16143
16144 * alloc.c (syms_of_alloc):
16145 * buffer.c (syms_of_buffer):
16146 * bytecode.c (syms_of_bytecode):
16147 * callint.c (syms_of_callint):
16148 * casefiddle.c (syms_of_casefiddle):
16149 * casetab.c (init_casetab_once):
16150 * category.c (init_category_once, syms_of_category):
16151 * ccl.c (syms_of_ccl):
16152 * cmds.c (syms_of_cmds):
16153 * composite.c (syms_of_composite):
16154 * dbusbind.c (syms_of_dbusbind):
16155 * dired.c (syms_of_dired):
16156 * dispnew.c (syms_of_display):
16157 * doc.c (syms_of_doc):
16158 * editfns.c (syms_of_editfns):
16159 * emacs.c (syms_of_emacs):
16160 * eval.c (syms_of_eval):
16161 * fileio.c (syms_of_fileio):
16162 * fns.c (syms_of_fns):
16163 * frame.c (syms_of_frame):
16164 * fringe.c (syms_of_fringe):
16165 * insdel.c (syms_of_insdel):
16166 * keymap.c (syms_of_keymap):
16167 * lread.c (init_obarray, syms_of_lread):
16168 * macros.c (syms_of_macros):
16169 * msdos.c (syms_of_msdos):
16170 * print.c (syms_of_print):
16171 * process.c (syms_of_process):
16172 * search.c (syms_of_search):
16173 * sound.c (syms_of_sound):
16174 * syntax.c (init_syntax_once, syms_of_syntax):
16175 * terminal.c (syms_of_terminal):
16176 * textprop.c (syms_of_textprop):
16177 * undo.c (syms_of_undo):
16178 * w32.c (globals_of_w32):
16179 * window.c (syms_of_window):
16180 * xdisp.c (syms_of_xdisp):
16181 * xfaces.c (syms_of_xfaces):
16182 * xfns.c (syms_of_xfns):
16183 * xmenu.c (syms_of_xmenu):
16184 * xsettings.c (syms_of_xsettings):
16185 * xterm.c (syms_of_xterm): Use DEFSYM.
16186
4228cf16
TZ
161872011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
16188
cd3520a4 16189 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 16190
7fcccf1e
PE
161912011-06-23 Paul Eggert <eggert@cs.ucla.edu>
16192
7efb4e0e
PE
16193 Integer and buffer overflow fixes (Bug#8873).
16194
ff5844ad
PE
16195 * print.c (printchar, strout): Check for string overflow.
16196 (PRINTPREPARE, printchar, strout):
16197 Don't set size unless allocation succeeds.
16198
90532f02
PE
16199 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
16200 for sizes. Check for string overflow more accurately.
16201 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
16202
6d84508d
PE
16203 * macros.c: Integer and buffer overflow fixes.
16204 * keyboard.h (struct keyboard.kbd_macro_bufsize):
16205 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
16206 Use ptrdiff_t, not int, for sizes.
16207 Don't increment bufsize until after realloc succeeds.
16208 Check for size-calculation overflow.
16209 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
16210
437b2cb4
PE
16211 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
16212
8b9ac8b4
PE
16213 * lread.c: Integer overflow fixes.
16214 (read_integer): Radix is now EMACS_INT, not int,
16215 to improve quality of diagnostics for out-of-range radices.
16216 Calculate buffer size correctly for out-of-range radices.
16217 (read1): Check for integer overflow in radices, and in
16218 read-circle numbers.
82cb60d3
PE
16219 (read_escape): Avoid int overflow.
16220 (Fload, openp, read_buffer_size, read1)
16221 (substitute_object_recurse, read_vector, read_list, map_obarray):
16222 Use ptrdiff_t, not int, for sizes.
16223 (read1): Use EMACS_INT, not int, for sizes.
20270765 16224 Check for size overflow.
8b9ac8b4 16225
7fcccf1e
PE
16226 * image.c (cache_image): Check for size arithmetic overflow.
16227
bfbbd7e7
PE
16228 * lread.c: Integer overflow issues.
16229 (saved_doc_string_size, saved_doc_string_length)
16230 (prev_saved_doc_string_size, prev_saved_doc_string_length):
16231 Now ptrdiff_t, not int.
16232 (read1): Don't assume doc string length fits in int. Check for
16233 out-of-range doc string lengths.
16234 (read_list): Don't assume file position fits in int.
39019e54 16235 (read_escape): Check for hex character overflow.
bfbbd7e7 16236
4e323265
LL
162372011-06-22 Leo Liu <sdl.web@gmail.com>
16238
16239 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
16240 Move to minibuffer.el.
16241
85fece3e
PE
162422011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16243
20b84ce9 16244 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
16245 The following patches are for when GLYPH_DEBUG && !XASSERT.
16246 * dispextern.h (trace_redisplay_p, dump_glyph_string):
16247 * dispnew.c (flush_stdout):
16248 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
16249 Mark as externally visible.
16250 * dispnew.c (check_window_matrix_pointers): Now static.
16251 * dispnew.c (window_to_frame_vpos):
16252 * xfns.c (unwind_create_frame):
16253 * xterm.c (x_check_font): Remove unused local.
16254 * scroll.c (CHECK_BOUNDS):
16255 * xfaces.c (cache_fache): Rename local to avoid shadowing.
16256 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
16257 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
16258 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
16259 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
16260 Now static.
16261 (debug_method_add): Use va_list and vsprintf rather than relying
16262 on undefined behavior with wrong number of arguments.
16263 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
16264 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
16265 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
16266 since we're not interested in debugging glyphs with old libraries.
16267 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
16268 GCC 4.6.0's static checking.
16269
0766b489
PE
162702011-06-22 Paul Eggert <eggert@cs.ucla.edu>
16271
31fd4b32
PE
16272 Integer overflow and signedness fixes (Bug#8873).
16273 A few related buffer overrun fixes, too.
16274
b79e8648
PE
16275 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16276
0766b489
PE
16277 * dispextern.h (struct face.stipple):
16278 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16279 (x_bitmap_mask, x_allocate_bitmap_record)
16280 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16281 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16282 (x_create_bitmap_from_xpm_data):
16283 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16284 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16285 (.bitmaps_last):
16286 * xfaces.c (load_pixmap):
16287 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16288 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16289 (.bitmaps_last, struct x_output.icon_bitmap):
16290 Use ptrdiff_t, not int, for bitmap indexes.
16291 (x_allocate_bitmap_record): Check for size overflow.
16292 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16293
b081724f
PE
16294 Use ptrdiff_t, not int, for overlay counts.
16295 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16296 * editfns.c (overlays_around, get_pos_property):
16297 * textprop.c (get_char_property_and_overlay):
16298 * xdisp.c (next_overlay_change, note_mouse_highlight):
16299 * xfaces.c (face_at_buffer_position):
21514da7
PE
16300 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16301 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16302 (Fnext_overlay_change, Fprevious_overlay_change)
16303 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 16304 Use ptrdiff_t, not int, for sizes.
21514da7 16305 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 16306
3de73e5e
PE
16307 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16308
2606c57b
PE
16309 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16310 (x_session_initialize): Do not assume string length fits in int.
16311
aaafe47a
PE
16312 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16313 This is unlikely, but can occur if DPI is outlandish.
16314
2674ddc8 16315 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
16316 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16317
28154962
PE
16318 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16319 * xrdb.c (magic_file_p, search_magic_path):
16320 Omit last arg SUFFIX; it was always 0. All callers changed.
16321 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16322
7de51af5
PE
16323 * xfont.c (xfont_match): Avoid need for strlen.
16324
25ed6cc3
PE
16325 * xfns.c: Don't assume strlen fits in int.
16326 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16327
4eab31dd
PE
16328 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16329 not unsigned long, as we prefer signed integers. All callers changed.
16330 Detect integer overflow in repeat count.
16331 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 16332 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 16333
171e2a58
PE
16334 * termcap.c: Don't assume sizes fit in int and never overflow.
16335 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16336 (gobble_line): Check for size-calculation overflow.
16337
ad39faca 16338 * minibuf.c (Fread_buffer):
6e5bb2dc 16339 * lread.c (intern, intern_c_string):
74ca2eb3
PE
16340 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16341 Don't assume string length fits in int.
16342
52c61c22 16343 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
16344 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16345
b5b8c9e5
PE
16346 * font.c: Don't assume string length fits in int.
16347 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16348 Use ptrdiff_t, not int.
ccd6111c
PE
16349 (font_intern_prop): Don't assume string length fits in int.
16350 Don't assume integer property fits in fixnum.
16351 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 16352
882f0d81 16353 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 16354 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
16355 Reformulate so as not to need the command string.
16356 Invoke gzip -cd rather than gunzip, as it's more portable.
16357 (lock_info_type, lock_file_1, lock_file):
16358 Don't assume pid_t and time_t fit in unsigned long.
16359 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16360 (current_lock_owner): Prefer signed type for sizes.
16361 Use memcpy, not strncpy, where memcpy is what is really wanted.
16362 Don't assume (via atoi) that time_t and pid_t fit in int.
16363 Check for time_t and/or pid_t out of range, e.g., via a network share.
16364 Don't alloca where an auto var works fine.
16365
93f4cf88
PE
16366 * fileio.c: Fix some integer overflow issues.
16367 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16368 Don't assume string length fits in int.
16369 (directory_file_name): Don't assume string length fits in long.
16370 (make_temp_name): Don't assume pid fits in int, or that its print
16371 length is less than 20.
16372
f3e92b69
PE
16373 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16374
1bfdaf10
PE
16375 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16376
35016e9a
PE
16377 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16378
3d1e65a1
PE
16379 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16380 We prefer signed integers, even for size calculations.
16381
0b963a93
PE
16382 * emacs.c: Don't assume string length fits in 'int'.
16383 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16384 (main): Don't invoke strlen when not needed.
16385
573f4b54
PE
16386 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16387 (XD_DEBUG_MESSAGE): Don't waste a byte.
16388
989f33ba
PE
16389 * callproc.c (getenv_internal_1, getenv_internal)
16390 (Fgetenv_internal):
965d34eb
PE
16391 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16392
e4d29b33
PE
16393 * lread.c (invalid_syntax): Omit length argument.
16394 All uses changed. This doesn't fix a bug, but it simplifies the
16395 code away from its former Hollerith-constant appearance, and it's
16396 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 16397 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 16398
eb49b136
PE
16399 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16400 This didn't break anything, but it didn't help either.
16401 It's confusing to put a bogus integer in a place where the actual
16402 value does not matter.
9f62aeb1 16403 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 16404 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 16405
15375a22
PE
16406 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16407 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16408 implementation.
b61cc01c
PE
16409 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16410 We prefer signed types, and the value cannot exceed the EMACS_INT
16411 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
16412 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16413 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16414 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 16415
53b2623d
PE
16416 * indent.c (sane_tab_width): New function.
16417 (current_column, scan_for_column, Findent_to, position_indentation)
16418 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 16419 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 16420
51cab52b 16421 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 16422
f2ed8a70
PE
16423 * lisp.h (lint_assume): New macro.
16424 * composite.c (composition_gstring_put_cache):
16425 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16426
abe80cc6
PE
16427 * editfns.c, insdel.c:
16428 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 16429
b02c740e
PE
16430 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16431
ebc96716
PE
16432 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16433
b4e50fa0 16434 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 16435 Use much-faster test for byte-length change.
311d5d7c 16436 Don't assume string byte-length fits in 'int'.
a4cf38e4 16437 Check that character arg fits in 'int'.
85461888 16438 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 16439
c0c1ee9f
PE
16440 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16441
a498d7f4
PE
16442 * fns.c (concat): Catch string overflow earlier.
16443 Do not rely on integer wraparound.
16444
51cab52b
PE
16445 * dispextern.h (struct it.overlay_strings_charpos)
16446 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
16447 * xdisp.c (forward_to_next_line_start)
16448 (back_to_previous_visible_line_start)
16449 (reseat_at_next_visible_line_start, next_element_from_buffer):
16450 Don't arbitrarily truncate the value of 'selective' to int.
16451
76031fad
PE
16452 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16453
5eb55db9
PE
16454 * composite.c: Don't truncate sizes to 'int'.
16455 (composition_gstring_p, composition_reseat_it)
16456 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
16457 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16458 not EMACS_UINT, for indexes.
5eb55db9 16459
0703a717
PE
16460 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16461
d6202519
PE
16462 * buffer.c: Include <verify.h>.
16463 (struct sortvec.priority, struct sortstr.priority):
8961a454 16464 Now EMACS_INT, not int.
c20998a7 16465 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
16466 (struct sortstr.size, record_overlay_string)
16467 (struct sortstrlist.size, struct sortlist.used):
16468 Don't truncate size to int.
16469 (record_overlay_string): Check for size-calculation overflow.
d6202519 16470 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 16471
d5a19415
JM
164722011-06-22 Jim Meyering <meyering@redhat.com>
16473
029529ac 16474 Don't leak an XBM-image-sized buffer
d5a19415
JM
16475 * image.c (xbm_load): Free the image buffer after using it.
16476
a9041e6c
PE
164772011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16478
16479 Port to Sun C.
16480 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16481 that Sun C diagnosed.
16482 * fns.c (secure_hash): Fix pointer signedness issue.
16483 * intervals.c (static_offset_intervals): New function.
16484 (offset_intervals): Use it.
16485
7f3f739f
LL
164862011-06-21 Leo Liu <sdl.web@gmail.com>
16487
16488 * deps.mk (fns.o):
16489 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16490 sha512.h.
16491
16492 * fns.c (secure_hash): Rename from crypto_hash_function and change
16493 the first arg to accept symbols.
5b66d427 16494 (Fsecure_hash): New primitive.
7f3f739f
LL
16495 (syms_of_fns): New symbols.
16496
76147d94
DD
164972011-06-20 Deniz Dogan <deniz@dogan.se>
16498
16499 * process.c (Fset_process_buffer): Clarify return value in
16500 docstring.
16501
7d7d0045
CY
165022011-06-18 Chong Yidong <cyd@stupidchicken.com>
16503
16504 * dispnew.c (add_window_display_history): Use BVAR.
16505
16506 * xdisp.c (debug_method_add): Use BVAR.
16507 (check_window_end, dump_glyph_matrix, dump_glyph)
16508 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16509
16510 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16511 Likewise.
16512
16513 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16514 check till after the cache is created in init_frame_faces.
16515
ff2bc410
SM
165162011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16517
16518 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16519
28177add
PE
165202011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16521
dd3482fe
PE
16522 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16523 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16524 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16525
393d71f3 16526 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
16527 * fileio.c (Finsert_file_contents):
16528 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16529 Remove the old (too-loose) buffer overflow checks.
16530 They weren't needed, since make_gap checks for buffer overflow.
16531 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16532 The old code merely checked for Emacs fixnum overflow, and relied
16533 on undefined (wraparound) behavior. The new code avoids undefined
16534 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16535
2e6813b0 16536 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
16537 Tune. Don't use wider integers than needed. Don't use alloca.
16538 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 16539
599a9e4f
PE
16540 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16541
99561444
PE
16542 * insdel.c, lisp.h (buffer_overflow): New function.
16543 (insert_from_buffer_1, replace_range, replace_range_2):
16544 * insdel.c (make_gap_larger):
16545 * editfns.c (Finsert_char):
16546 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16547
28177add
PE
16548 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16549
e69dafad
PE
165502011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16551
4baa020d 16552 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 16553
b1c46f02
PE
16554 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16555 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16556
e69dafad
PE
16557 * fileio.c: Don't assume EMACS_INT fits in off_t.
16558 (emacs_lseek): New static function.
16559 (Finsert_file_contents, Fwrite_region): Use it.
16560 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16561
566684ea
PE
16562 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16563
e6966cd6
PE
16564 * fns.c: Don't overflow int when computing a list length.
16565 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16566 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16567 truncation on 64-bit hosts. Check for QUIT every
16568 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16569 faster and is responsive enough.
16570 (Flength): Report an error instead of overflowing an integer.
16571 (Fsafe_length): Return a float if the value is not representable
16572 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 16573 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 16574 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 16575
dd0b0efb
PE
16576 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16577 (header_size, word_size): New constants.
16578 (allocate_vectorlike): Don't check size overflow here.
16579 (allocate_vector): Check it here instead, since this is the only
16580 caller of allocate_vectorlike that could cause overflow.
16581 Check that the new vector's length is representable as a fixnum.
16582
86fe5cfe
PE
16583 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16584 The previous code was bogus. For example, next_almost_prime (32)
16585 returned 39, which is undesirable as it is a multiple of 3; and
16586 next_almost_prime (24) returned 25, which is a multiple of 5 so
16587 why was the code bothering to check for multiples of 7?
16588
80e88859
PE
16589 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16590
4a2f0ad6
PE
16591 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16592
f66c7cf8
PE
16593 Variadic C functions now count arguments with ptrdiff_t.
16594 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16595 Back then I didn't know that the Emacs coding style prefers signed int.
16596 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
16597 were being counted with int, which may truncate counts on 64-bit
16598 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
16599 * lisp.h (struct Lisp_Subr.function.aMANY)
16600 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16601 Arg counts are now ptrdiff_t, not size_t.
16602 All variadic functions and their callers changed accordingly.
16603 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16604 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16605 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16606 * callint.c (Fcall_interactively): Check arg count for overflow,
16607 to avoid potential buffer overrun. Use signed char, not 'int',
16608 for 'varies' array, so that we needn't bother to check its size
16609 calculation for overflow.
16610 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16611 * eval.c (apply_lambda):
16612 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16613 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16614 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16615
a1759b76
PE
16616 * callint.c (Fcall_interactively): Don't use index var as event count.
16617
d96be9fc
PE
16618 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16619 * mem-limits.h (SIZE): Remove; no longer used.
16620
a690a978 16621 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 16622
578c21e6
PE
16623 Remove unnecessary casts.
16624 * xterm.c (x_term_init):
16625 * xfns.c (x_set_border_pixel):
16626 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16627 These aren't needed now that we assume ANSI C.
16628
96f53c6c
PE
16629 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16630 It's more likely to cause problems (due to unsigned overflow)
16631 than to cure them.
16632
83c77d31
PE
16633 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16634
ee2079f1
PE
16635 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16636
6da65536
PE
16637 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16638
7147c4a4
PE
16639 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16640
193e32d9
PE
16641 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16642
e5533da6
PE
16643 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16644
9910e595
PE
16645 GLYPH_CODE_FACE returns EMACS_INT, not int.
16646 * dispextern.h (merge_faces):
16647 * xfaces.c (merge_faces):
01103c44
PE
16648 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16649 Don't assume EMACS_INT fits in int.
9910e595 16650
2638320e
PE
16651 * character.h (CHAR_VALID_P): Remove unused parameter.
16652 * fontset.c, lisp.h, xdisp.c: All uses changed.
16653
045eb8d9
PE
16654 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16655
c1f134b5
PE
16656 * fns.c (concat): Minor tuning based on overflow analysis.
16657 This doesn't fix any bugs. Use int to hold character, instead
16658 of constantly refetching from Emacs object. Use XFASTINT, not
16659 XINT, for value known to be a character. Don't bother comparing
16660 a single byte to 0400, as it's always less.
16661
395fcb93 16662 * floatfns.c (Fexpt):
327eeec8
PE
16663 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16664
abbd3d23
PE
16665 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16666 for characters.
16667
684a03ef
PE
16668 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16669
0fed43f3
PE
16670 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16671 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16672 incorrectly succeed when S was a string, because 4294967386 was
16673 truncated before it was used.
16674
8fd02eb7
PE
16675 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16676 Otherwise, an out-of-range integer could cause undefined behavior
16677 on a 64-bit host.
16678
f8c86b69
PE
16679 * composite.c: Use int, not EMACS_INT, for characters.
16680 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16681 EMACS_INT, for values that are known to be in character range.
16682 This doesn't fix any bugs but is the usual style inside Emacs and
16683 may generate better code on 32-bit machines.
16684
34206dd2
PE
16685 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16686 This is for reasons similar to the recent CHAR_STRING fix.
16687 * charset.c (Fencode_char): Check that character arg is actually
16688 a character. Pass an int to ENCODE_CHAR.
16689 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16690 wider than 'int', as a compile-time check to prevent future regressions
16691 in this area.
16692
c5958d4c 16693 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
16694
16695 Make sure a 64-bit char is never passed to CHAR_STRING.
16696 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16697 by silently ignoring the top 32 bits, allowing some values
16698 that were far too large to be valid characters.
16699 * character.h: Include <verify.h>.
16700 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16701 arguments are no wider than unsigned, as a compile-time check
16702 to prevent future regressions in this area.
16703 * data.c (Faset):
01103c44 16704 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
16705 (Fsubst_char_in_region):
16706 * fns.c (concat):
16707 * xdisp.c (decode_mode_spec_coding):
16708 Adjust to CHAR_STRING's new requirement.
16709 * editfns.c (Finsert_char, Fsubst_char_in_region):
16710 * fns.c (concat): Check that character args are actually
16711 characters. Without this test, these functions did the wrong
16712 thing with wildly out-of-range values on 64-bit hosts.
16713
d37ca623
PE
16714 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16715 These casts should not be needed on 32-bit hosts, either.
16716 * keyboard.c (read_char):
16717 * lread.c (Fload): Remove casts to unsigned.
16718
ea204efb
PE
16719 * lisp.h (UNSIGNED_CMP): New macro.
16720 This fixes comparison bugs on 64-bit hosts.
16721 (ASCII_CHAR_P): Use it.
16722 * casefiddle.c (casify_object):
01103c44 16723 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
16724 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16725 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16726 * dispextern.h (FACE_FROM_ID):
16727 * keyboard.c (read_char): Use UNSIGNED_CMP.
16728
41cb286c
PE
16729 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16730 not to EMACS_INT, to avoid GCC warning.
16731
4a1b9832
PE
16732 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16733
55daad71
PE
16734 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16735 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16736 isn't needed on 32-bit machines.
8f95c75c 16737
01103c44
PE
16738 * buffer.c (Fgenerate_new_buffer_name):
16739 Use EMACS_INT for count, not int.
0ceccced 16740 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
16741
16742 * data.c (Qcompiled_function): Now static.
16743
c6f072e7
PE
16744 * window.c (window_body_lines): Now static.
16745
20ce5912
PE
16746 * image.c (gif_load): Rename local to avoid shadowing.
16747
9c4c5f81
PE
16748 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16749 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16750 * alloc.c (make_save_value): Integer argument is now of type
16751 ptrdiff_t, not int.
16752 (mark_object): Use ptrdiff_t, not int.
16753 * lisp.h (pD): New macro.
16754 * print.c (print_object): Use it.
16755
c0c5c8ae
PE
16756 * alloc.c: Use EMACS_INT, not int, to count objects.
16757 (total_conses, total_markers, total_symbols, total_vector_size)
16758 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
16759 (total_free_floats, total_floats, total_free_intervals)
16760 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
16761 Now EMACS_INT, not int. All uses changed.
16762 (Fgarbage_collect): Compute overall total using a double, so that
16763 integer overflow is less likely to be a problem. Check for overflow
16764 when converting back to an integer.
5a25e253
PE
16765 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16766 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16767 These were 'int' variables that could overflow on 64-bit hosts;
16768 they were never used, so remove them instead of repairing them.
211a0b2a 16769 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
16770 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16771 Previously, this ceilinged at INT_MAX, but that doesn't work on
16772 64-bit machines.
e46bb31a 16773 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 16774
c78baabf 16775 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 16776 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
16777 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16778 when a (possibly-narrower) signed value would do just as well.
16779 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 16780
c9d624c6
PE
16781 * alloc.c: Catch some string size overflows that we were missing.
16782 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16783 for convenience in STRING_BYTES_MAX.
16784 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16785 The definition here is exact; the one in lisp.h was approximate.
16786 (allocate_string_data): Check for string overflow. This catches
16787 some instances we weren't catching before. Also, it catches
16788 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16789 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16790 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 16791
c9d624c6
PE
16792 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16793 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 16794 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 16795
353032ce
PE
16796 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16797
2bccce07
PE
16798 * alloc.c (Fmake_string): Check for out-of-range init.
16799
0ac30604
SM
168002011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16801
16802 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16803
c195f2de
JD
168042011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16805
16806 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16807 xg_get_default_scrollbar_width.
16808
16809 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16810 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16811 (style_changed_cb): Call update_theme_scrollbar_width and call
16812 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16813 all frames (Bug#8505).
16814 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16815 Call gtk_window_set_resizable if HAVE_GTK3.
16816 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16817 and height if HAVE_GTK3 (Bug#8505).
16818 (scroll_bar_width_for_theme): New variable.
16819 (update_theme_scrollbar_width): New function.
16820 (xg_get_default_scrollbar_width): Move code to
16821 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16822 (xg_initialize): Call update_theme_scrollbar_width.
16823
16824 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16825
16826 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16827
e10ac9f1
MR
168282011-06-12 Martin Rudalics <rudalics@gmx.at>
16829
16830 * frame.c (make_frame): Call other_buffer_safely instead of
16831 other_buffer.
16832
16833 * window.c (temp_output_buffer_show): Call display_buffer with
16834 second argument Vtemp_buffer_show_specifiers and reset latter
16835 immediately after the call.
16836 (Vtemp_buffer_show_specifiers): New variable.
16837 (auto_window_vscroll_p, next_screen_context_lines)
16838 (Vscroll_preserve_screen_position): Remove leading asterisks from
16839 doc-strings.
16840
2d3c217e 168412011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 16842
7b7f97e8 16843 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
16844 * buffer.c (Qclone_number): Remove for now, as it's unused.
16845 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16846 (record_buffer): Remove unused local.
16847 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16848 (set_frame_buffer_list): Remove; unused.
16849 * frame.h (other_visible_frames): Remove decl.
16850 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16851 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16852 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16853 if HAVE_GPM.
16854 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16855 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16856 Define only if HAVE_GPM.
16857 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16858 (update_hints_inhibit): Remove; never set. All uses removed.
16859 * widgetprv.h (emacsFrameClassRec): Remove decl.
16860 * window.c (delete_deletable_window): Now returns void, since it
16861 wasn't returning anything.
16862 (compare_window_configurations): Remove unused locals.
16863 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16864 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
16865 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16866 the same widths as pointers. This follows up on the 2011-05-06 patch.
16867 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16868 * xterm.h: Likewise.
16869 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16870
1384b89e
JB
168712011-06-12 Juanma Barranquero <lekktu@gmail.com>
16872
16873 * makefile.w32-in: Update dependencies.
16874 (LISP_H): Add lib/intprops.h.
16875
1100a63c
CY
168762011-06-11 Chong Yidong <cyd@stupidchicken.com>
16877
16878 * image.c (gif_load): Add animation frame delay to the metadata.
16879 (syms_of_image): Use DEFSYM. New symbol `delay'.
16880
6198ccd0
MR
168812011-06-11 Martin Rudalics <rudalics@gmx.at>
16882
16883 * window.c (delete_deletable_window): Re-add.
16884 (Fset_window_configuration): Rewrite to handle dead buffers and
16885 consequently deletable windows.
16886 (window_tree, Fwindow_tree): Remove. Supply functionality in
16887 window.el.
16888 (compare_window_configurations): Simplify code.
16889
b6e3633c
AS
168902011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16891
1ab0dee5
AS
16892 * image.c (imagemagick_load_image): Fix type mismatch.
16893 (Fimagemagick_types): Likewise.
16894
b6e3633c
AS
16895 * window.h (replace_buffer_in_windows): Declare.
16896
9397e56f
MR
168972011-06-11 Martin Rudalics <rudalics@gmx.at>
16898
16899 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16900 Qclone_number. Remove external declaration of Qdelete_window.
16901 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16902 code.
640c8776
SM
16903 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16904 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
16905 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16906 buffer list implementation.
16907 (other_buffer_safely): New function.
16908 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16909 calls to replace_buffer_in_windows and
16910 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16911 if allowed.
16912 (record_buffer): Inhibit quitting and rewrite using quittable
16913 functions. Run Qbuffer_list_update_hook if allowed.
16914 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
16915 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16916 Move switch-to-buffer to window.el.
9397e56f
MR
16917 (bury-buffer): Move to window.el.
16918 (Vbuffer_list_update_hook): New variable.
16919
16920 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16921 section.
16922
16923 * window.h (resize_frame_windows): Move up in code.
16924 (Fwindow_frame): Remove EXFUN.
16925 (replace_buffer_in_all_windows): Remove prototype.
16926 (replace_buffer_in_windows_safely): Add prototype.
16927
16928 * window.c: Declare Qdelete_window static again. Move down
16929 declaration of select_count.
16930 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16931 (Fother_window): Move to window.el.
16932 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16933 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16934 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16935 window.el.
16936 (replace_buffer_in_windows): Implement by calling
16937 Qreplace_buffer_in_windows.
16938 (replace_buffer_in_all_windows): Remove with some functionality
16939 moved into replace_buffer_in_windows_safely.
16940 (replace_buffer_in_windows_safely): New function.
16941 (select_window_norecord, select_frame_norecord): Move in front
16942 of run_window_configuration_change_hook. Remove now obsolete
16943 declarations.
640c8776
SM
16944 (Fset_window_buffer): Rewrite doc-string.
16945 Call Qrecord_window_buffer.
9397e56f
MR
16946 (keys_of_window): Move binding for other-window to window.el.
16947
b50691aa
CY
169482011-06-11 Chong Yidong <cyd@stupidchicken.com>
16949
16950 * dispextern.h (struct image): Replace data member, whose int_val
16951 and ptr_val fields were not used by anything, with a single
16952 lisp_val object.
16953
16954 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16955 (gif_clear_image, gif_load, imagemagick_load_image)
16956 (gs_clear_image, gs_load): Callers changed.
16957
3f754b86
PE
169582011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16959
cca69397
PE
16960 * buffer.h: Include <time.h>, for time_t.
16961 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16962
109e28d0
PE
16963 Fix minor problems found by static checking.
16964
60737f02
PE
16965 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16966
4b66faf3
PE
16967 Make identifiers static if they are not used in other modules.
16968 * data.c (Qcompiled_function, Qframe, Qvector):
16969 * image.c (QimageMagick, Qsvg):
16970 * minibuf.c (Qmetadata):
16971 * window.c (resize_window_check, resize_root_window): Now static.
16972 * window.h (resize_window_check, resize_root_window): Remove decls.
16973
109e28d0
PE
16974 * window.c (window_deletion_count, delete_deletable_window):
16975 Remove; unused.
46a4ce9e
PE
16976 (window_body_lines): Now static.
16977 (Fdelete_other_windows_internal): Mark vars as initialized.
16978 Make sure 'resize_failed' is initialized.
16979 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16980 (resize_window_apply): Remove unused local.
16981 * window.h (delete_deletable_window): Remove decl.
16982
109e28d0 16983 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
16984 (imagemagick_load_image): Fix pointer signedness problem by changing
16985 last arg from unsigned char * to char *. All uses changed.
16986 Also, fix a local for similar reasons.
16987 Remove unused locals. Remove locals to avoid shadowing.
16988 (fn_rsvg_handle_free): Remove; unused.
16989 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 16990 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 16991
3f754b86
PE
16992 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16993
2547adb1
CY
169942011-06-10 Chong Yidong <cyd@stupidchicken.com>
16995
16996 * image.c (gif_load): Fix omitted cast error introduced by
16997 2011-06-06 change.
16998
2c8e37d4
MR
169992011-06-10 Martin Rudalics <rudalics@gmx.at>
17000
17001 * window.h (resize_proportionally, orig_total_lines)
17002 (orig_top_line): Remove from window structure.
17003 (set_window_height, set_window_width, change_window_heights)
17004 (Fdelete_window): Remove prototypes.
17005 (resize_frame_windows): Remove duplicate declaration.
17006
440a42e3
EZ
170072011-06-10 Eli Zaretskii <eliz@gnu.org>
17008
17009 * window.h (resize_frame_windows, resize_window_check)
17010 (delete_deletable_window, resize_root_window)
17011 (resize_frame_windows): Declare prototypes.
17012
17013 * window.c (resize_window_apply): Make definition be "static" to
17014 match the prototype.
17015
562dd5e9
MR
170162011-06-10 Martin Rudalics <rudalics@gmx.at>
17017
17018 * window.c: Remove declarations of Qwindow_size_fixed,
17019 window_min_size_1, window_min_size_2, window_min_size,
17020 size_window, window_fixed_size_p, enlarge_window, delete_window.
17021 Remove static from declaration of Qdelete_window, it's
17022 temporarily needed by Fbury_buffer.
17023 (replace_window): Don't assign orig_top_line and
17024 orig_total_lines.
17025 (Fdelete_window, delete_window): Remove. Window deletion is
17026 handled by window.el.
640c8776
SM
17027 (window_loop): Remove DELETE_OTHER_WINDOWS case.
17028 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
17029 (Fdelete_other_windows): Remove. Deleting other windows is
17030 handled by window.el.
17031 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
17032 handled in window.el.
17033 (window_min_size_2, window_min_size_1, window_min_size): Remove.
17034 Window minimum sizes are handled in window.el.
17035 (shrink_windows, size_window, set_window_height)
17036 (set_window_width, change_window_heights, window_height)
17037 (window_width, CURBEG, CURSIZE, enlarge_window)
17038 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
17039 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
17040 handled in window.el.
17041 (make_dummy_parent): Rename to make_parent_window and give it a
17042 second argument horflag.
17043 (make_window): Don't set resize_proportionally any more.
17044 (Fsplit_window): Remove. Windows are split in window.el.
17045 (save_restore_action, save_restore_orig_size)
17046 (shrink_window_lowest_first, save_restore_orig_size): Remove.
17047 Resize mini windows in window.el.
17048 (grow_mini_window, shrink_mini_window): Implement by calling
17049 Qresize_root_window_vertically, resize_window_check and
17050 resize_window_apply.
640c8776
SM
17051 (saved_window, Fset_window_configuration, save_window_save):
17052 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
17053 resize_proportionally.
17054 (window_min_height, window_min_width): Move to window.el.
17055 (keys_of_window): Move bindings for delete-other-windows,
17056 split-window, delete-window and enlarge-window to window.el.
17057
17058 * buffer.c: Temporarily extern Qdelete_window.
17059 (Fbury_buffer): Temporarily call Qdelete_window instead of
17060 Fdelete_window (Fbury_buffer will move to window.el soon).
17061
17062 * frame.c (set_menu_bar_lines_1): Remove code handling
17063 orig_top_line and orig_total_lines.
17064
17065 * dispnew.c (adjust_frame_glyphs_initially): Don't use
17066 set_window_height but set heights directly.
17067 (change_frame_size_1): Use resize_frame_windows.
17068
17069 * xdisp.c (init_xdisp): Don't use set_window_height but set
17070 heights directly.
17071
640c8776
SM
17072 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
17073 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
17074 run_window_configuration_change_hook.
17075
17076 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
17077 instead of change_window_heights and run
17078 run_window_configuration_change_hook.
17079
1a13852e
MR
170802011-06-09 Martin Rudalics <rudalics@gmx.at>
17081
17082 * window.c (replace_window): Rename second argument REPLACEMENT to
17083 NEW. New third argument SETFLAG. Rewrite.
17084 (delete_window, make_dummy_parent): Call replace_window with
17085 third argument 1.
17086 (window_list_1): Move down in code.
17087 (run_window_configuration_change_hook): Move set_buffer part
17088 before select_frame_norecord part in order to unwind correctly.
17089 Rename count1 to count.
17090 (recombine_windows, delete_deletable_window, resize_root_window)
17091 (Fdelete_other_windows_internal)
17092 (Frun_window_configuration_change_hook, make_parent_window)
17093 (resize_window_check, resize_window_apply, Fresize_window_apply)
17094 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
17095 (Fdelete_window_internal, Fresize_mini_window_internal):
17096 New functions.
1a13852e
MR
17097 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
17098
f3d1777e
MR
170992011-06-08 Martin Rudalics <rudalics@gmx.at>
17100
496e208e
MR
17101 * window.h (window): Add some new members to window structure -
17102 normal_lines, normal_cols, new_total, new_normal, clone_number,
17103 splits, nest, prev_buffers, next_buffers.
17104 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 17105 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 17106
f3d1777e
MR
17107 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
17108 Remove.
496e208e
MR
17109 (make_dummy_parent): Set new members of windows structure.
17110 (make_window): Move down in code. Handle new members of window
17111 structure.
17112 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
17113 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
17114 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
17115 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
17116 (Fset_window_next_buffers, Fset_window_clone_number):
17117 New functions.
496e208e
MR
17118 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
17119 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
17120 Doc-string fixes.
17121 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
17122 Argument WINDOW can be now internal window too.
17123 (Fwindow_use_time): Move up in code.
17124 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
17125 Rewrite doc-string.
17126 (Fset_window_configuration, saved_window)
17127 (Fcurrent_window_configuration, save_window_save): Handle new
17128 members of window structure.
b9e809c2
MR
17129 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
17130 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
17131 (syms_of_window): New Lisp objects Qrecord_window_buffer,
17132 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
17133 Qget_mru_window, Qresize_root_window,
17134 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
17135 Qauto_buffer_name; staticpro them.
f3d1777e 17136
abde8f8c
MR
171372011-06-07 Martin Rudalics <rudalics@gmx.at>
17138
17139 * window.c (Fwindow_total_size, Fwindow_left_column)
17140 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
17141 (Fwindow_list_1): New functions.
17142 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
17143 (Fwindow_width, Fscroll_left, Fscroll_right):
17144 Use window_body_cols instead of window_box_text_cols.
17145 (delete_window, Fset_window_configuration):
17146 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
17147 (delete_all_subwindows): Take a window as argument and not a
17148 structure. Rewrite.
190b47e6
MR
17149 (window_loop): Remove handling of GET_LRU_WINDOW and
17150 GET_LARGEST_WINDOW.
17151 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
17152
17153 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
17154 window_box_text_cols. delete_all_subwindows now takes a
17155 Lisp_Object as argument.
abde8f8c 17156
640c8776
SM
17157 * indent.c (compute_motion, Fcompute_motion):
17158 Use window_body_cols instead of window_box_text_cols.
abde8f8c 17159
fa8a67e6
MR
17160 * frame.c (delete_frame): Call delete_all_subwindows with root
17161 window as argument.
17162
a54e3482
DC
171632011-06-07 Daniel Colascione <dan.colascione@gmail.com>
17164
17165 * fns.c (Fputhash): Document return value.
17166
60002bf5
CY
171672011-06-06 Chong Yidong <cyd@stupidchicken.com>
17168
17169 * image.c (gif_load): Implement gif89a spec "no disposal" method.
17170
0c671da6 171712011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 17172
b862a52a 17173 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 17174
be44ca6c
PE
17175 Check for overflow when converting integer to cons and back.
17176 * charset.c (Fdefine_charset_internal, Fdecode_char):
17177 Use cons_to_unsigned to catch overflow.
17178 (Fencode_char): Use INTEGER_TO_CONS.
17179 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
17180 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
17181 * data.c (long_to_cons, cons_to_long): Remove.
17182 (cons_to_unsigned, cons_to_signed): New functions.
17183 These signal an error for invalid or out-of-range values.
17184 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
17185 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
17186 * font.c (Ffont_variation_glyphs):
17187 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
17188 * lisp.h: Include <intprops.h>.
17189 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
17190 (cons_to_signed, cons_to_unsigned): New decls.
17191 (long_to_cons, cons_to_long): Remove decls.
17192 * undo.c (record_first_change): Use INTEGER_TO_CONS.
17193 (Fprimitive_undo): Use CONS_TO_INTEGER.
17194 * xfns.c (Fx_window_property): Likewise.
17195 * xselect.c: Include <limits.h>.
17196 (x_own_selection, selection_data_to_lisp_data):
17197 Use INTEGER_TO_CONS.
17198 (x_handle_selection_request, x_handle_selection_clear)
17199 (x_get_foreign_selection, Fx_disown_selection_internal)
17200 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
17201 (lisp_data_to_selection_data): Use cons_to_unsigned.
17202 (x_fill_property_data): Use cons_to_signed.
17203 Report values out of range.
17204
d1f3d2af
PE
17205 Check for buffer and string overflow more precisely.
17206 * buffer.h (BUF_BYTES_MAX): New macro.
17207 * lisp.h (STRING_BYTES_MAX): New macro.
17208 * alloc.c (Fmake_string):
17209 * character.c (string_escape_byte8):
17210 * coding.c (coding_alloc_by_realloc):
17211 * doprnt.c (doprnt):
17212 * editfns.c (Fformat):
17213 * eval.c (verror):
17214 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
17215 since they may not be the same number.
17216 * editfns.c (Finsert_char):
17217 * fileio.c (Finsert_file_contents):
17218 Likewise for BUF_BYTES_MAX.
17219
dd52fcea
PE
17220 * image.c: Use ptrdiff_t, not int, for sizes.
17221 (slurp_file): Switch from int to ptrdiff_t.
17222 All uses changed.
17223 (slurp_file): Check that file size fits in both size_t (for
17224 malloc) and ptrdiff_t (for sanity and safety).
17225
7f9bbdbb
PE
17226 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
17227 if b->modtime has its maximal value.
17228
dfe18f82
PE
17229 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
17230
84acfcf0
PE
17231 Don't assume time_t can fit into int.
17232 * buffer.h (struct buffer.modtime): Now time_t, not int.
17233 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
17234 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
17235
ccd9a01a
PE
17236 Minor fixes for signed vs unsigned integers.
17237 * character.h (MAYBE_UNIFY_CHAR):
17238 * charset.c (maybe_unify_char):
17239 * keyboard.c (read_char, reorder_modifiers):
17240 XINT -> XFASTINT, since the integer must be nonnegative.
17241 * ftfont.c (ftfont_spec_pattern):
17242 * keymap.c (access_keymap, silly_event_symbol_error):
17243 XUINT -> XFASTINT, since the integer must be nonnegative.
17244 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
17245 since it makes no difference and we prefer signed.
17246 * keyboard.c (record_char): Use XUINT when all the neighbors do.
17247 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
17248 nonnegative.
17249
d6d100dd
SM
172502011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
17251
17252 * window.h (Fwindow_frame): Declare.
17253
2b6148e4
PE
172542011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17255
17256 * alloc.c: Simplify handling of large-request failures (Bug#8800).
17257 (SPARE_MEMORY): Always define.
17258 (LARGE_REQUEST): Remove.
17259 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
17260
f230ecc9
MR
172612011-06-06 Martin Rudalics <rudalics@gmx.at>
17262
727e958e
MR
17263 * lisp.h: Move EXFUNS for Fframe_root_window,
17264 Fframe_first_window and Fset_frame_selected_window to window.h.
17265
17266 * window.h: Move EXFUNS for Fframe_root_window,
17267 Fframe_first_window and Fset_frame_selected_window here from
17268 lisp.h.
17269
17270 * frame.c (Fwindow_frame, Fframe_first_window)
17271 (Fframe_root_window, Fframe_selected_window)
17272 (Fset_frame_selected_window): Move to window.c.
17273 (Factive_minibuffer_window): Move to minibuf.c.
17274 (Fother_visible_frames_p): New function.
17275
17276 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17277
f230ecc9
MR
17278 * window.c (decode_window, decode_any_window): Move up in code.
17279 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17280 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
17281 (Fwindow_buffer): Move up and rewrite doc-string.
17282 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17283 (Fwindow_prev): New functions.
727e958e
MR
17284 (Fwindow_frame): Move here from frame.c. Accept any window as
17285 argument.
17286 (Fframe_root_window, Fframe_first_window)
17287 (Fframe_selected_window): Move here from frame.c. Accept frame
17288 or arbitrary window as argument. Update doc-strings.
17289 (Fminibuffer_window): Move up in code.
17290 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
17291 (Fset_frame_selected_window): Move here from frame.c.
17292 Marginal rewrite.
727e958e
MR
17293 (Fselected_window, select_window, Fselect_window): Move up in
17294 code. Minor doc-string fixes.
f230ecc9 17295
4d09bcf6
PE
172962011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17297
17298 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17299 Do not assume that spare memory exists; that assumption is valid
17300 only if SYSTEM_MALLOC.
17301 (LARGE_REQUEST): New macro, so that the issue of large requests
17302 is separated from the issue of spare memory.
17303
810928a2
AS
173042011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17305
172418ad
AS
17306 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17307 format. (Bug#8806)
17308
43f862f7
AS
17309 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17310
810928a2
AS
17311 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17312 before statements.
17313
a059fe24
JD
173142011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17315
17316 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17317
17318 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17319
17320 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17321 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17322
989bf368
JB
173232011-06-05 Juanma Barranquero <lekktu@gmail.com>
17324
17325 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17326
4b80f674
CY
173272011-06-04 Chong Yidong <cyd@stupidchicken.com>
17328
17329 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17330 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
17331 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17332 New error handlers.
4b80f674
CY
17333 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17334 Obey Vx_select_enable_clipboard_manager. Catch errors in
17335 x_clipboard_manager_save (Bug#8779).
17336 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 17337 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 17338
99a33b77 173392011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
17340
17341 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17342
99a33b77 173432011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
17344
17345 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17346 in the current matrix if keep_current_p is non-zero.
17347
8264569d
EZ
173482011-06-04 Eli Zaretskii <eliz@gnu.org>
17349
17350 * bidi.c (bidi_level_of_next_char): Fix last change.
17351
57f97249
EZ
173522011-06-03 Eli Zaretskii <eliz@gnu.org>
17353
fec2107c 17354 Support bidi reordering of text covered by display properties.
57f97249 17355
fec2107c
EZ
17356 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17357 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17358 (bidi_cache_search, bidi_cache_iterator_state)
17359 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
17360 (bidi_level_of_next_char, bidi_move_to_visually_next):
17361 Support character positions inside a run of characters covered by a
fec2107c
EZ
17362 display string.
17363 (bidi_paragraph_init, bidi_resolve_explicit_1)
17364 (bidi_level_of_next_char): Call bidi_fetch_char and
17365 bidi_fetch_char_advance instead of FETCH_CHAR and
17366 FETCH_CHAR_ADVANCE.
17367 (bidi_init_it): Initialize new members.
17368 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17369 definitions.
17370 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17371 instead of using explicit *_CHAR codes.
d6d100dd
SM
17372 (bidi_resolve_explicit, bidi_resolve_weak):
17373 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
17374 bidirectional text is supported only in multibyte buffers.
17375 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17376 it to initialize the frame_window_p member of struct bidi_it.
17377 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17378 (bidi_resolve_explicit, bidi_resolve_weak)
17379 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17380 bidi_it->nchars is non-positive.
17381 (bidi_level_of_next_char): Don't try to lookup the cache for the
17382 next/previous character if nothing is cached there yet, or if we
17383 were just reseat()'ed to a new position.
c40e2fb2 17384
0e14fe90
EZ
17385 * xdisp.c (set_cursor_from_row): Set start and stop points
17386 according to the row's direction when priming the loop that looks
17387 for the glyph on which to display cursor.
17388 (single_display_spec_intangible_p): Function deleted.
17389 (display_prop_intangible_p): Reimplement to call
17390 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
17391 Accept 3 additional arguments needed by handle_display_spec.
17392 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
17393 values: lists, `(when COND...)' forms, etc.
17394 (single_display_spec_string_p): Support property values that are
17395 lists with the argument STRING its top-level element.
17396 (display_prop_string_p): Fix the condition for processing a
17397 property that is a list to be consistent with handle_display_spec.
fec2107c 17398 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
17399 last portion of handle_display_prop.
17400 (compute_display_string_pos): Accept additional argument
17401 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17402 value of a `display' property is a "replacing spec".
17403 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17404 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17405 the display property, but just return a value indicating whether
17406 the display property will replace the characters it covers.
17407 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17408 frame_window_p members of struct bidi_it.
d6d100dd
SM
17409 (compute_display_string_pos, compute_display_string_end):
17410 New functions.
fec2107c
EZ
17411 (push_it): Accept second argument POSITION, where pop_it should
17412 jump to continue iteration.
17413 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 17414
fec2107c
EZ
17415 * keyboard.c (adjust_point_for_property): Adjust the call to
17416 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
17417
17418 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
17419 (bidi_init_it): Update prototypes.
17420 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
17421 (compute_display_string_pos, compute_display_string_end):
17422 Declare prototypes.
fec2107c
EZ
17423 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17424 EMACS_INT.
fc6f18ce 17425
40087514 174262011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 17427
57f53182
PE
17428 Malloc failure behavior now depends on size of allocation.
17429 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17430 * lisp.h: Change signatures accordingly.
17431 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17432 All callers changed. (Bug#8762)
17433
17434 * gnutls.c: Use Emacs's memory allocators.
17435 Without this change, the gnutls library would invoke malloc etc.
17436 directly, which causes problems on non-SYNC_INPUT hosts, and which
17437 runs afoul of improving memory_full behavior. (Bug#8761)
17438 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17439 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17440 xfree instead of the default malloc, realloc, free.
17441 (Fgnutls_boot): No need to check for memory allocation failure,
17442 since xmalloc does that for us.
17443
ac32cd99 17444 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
17445 * category.c (hash_get_category_set):
17446 * ccl.c (ccl_driver):
17447 * charset.c (Fdefine_charset_internal):
17448 * charset.h (struct charset.hash_index):
17449 * composite.c (get_composition_id, gstring_lookup_cache)
17450 (composition_gstring_put_cache):
17451 * composite.h (struct composition.hash_index):
17452 * dispextern.h (struct image.hash):
17453 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17454 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17455 (hashfn_equal, hashfn_user_defined, make_hash_table)
17456 (maybe_resize_hash_table, hash_lookup, hash_put)
17457 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17458 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17459 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17460 * image.c (make_image, search_image_cache, lookup_image)
17461 (xpm_put_color_table_h):
17462 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 17463 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 17464 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 17465 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
17466 * alloc.c (allocate_vectorlike):
17467 Check for overflow in vector size calculations.
17468 * ccl.c (ccl_driver):
17469 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
17470 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17471 need to be updated by these changes.
40087514
PE
17472 * fns.c (make_hash_table, maybe_resize_hash_table):
17473 Check for integer overflow with large hash tables.
0de4bb68
PE
17474 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17475 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17476 (SXHASH_REDUCE): New macro.
17477 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17478 Use it instead of discarding useful hash info with large hash values.
17479 (sxhash_float): New function.
17480 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17481 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
17482 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17483 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
17484 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17485 Adjust signatures to match updated version of code.
17486 (consing_since_gc): Now EMACS_INT, since a single hash table can
17487 use more than INT_MAX bytes.
17488
698d32e2
DN
174892011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17490
17491 Make it possible to build with GCC-4.6+ -O2 -flto.
17492
17493 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17494
fd6fa53f
SM
174952011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17496
17497 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17498 Call minibuffer-inactive-mode.
17499
864db017
JB
175002011-05-31 Juanma Barranquero <lekktu@gmail.com>
17501
17502 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17503 Update dependencies.
17504
2ad0baf4
DN
175052011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17506
17507 * data.c (init_data): Remove code for UTS, this system is not
17508 supported anymore.
17509
4fcc2638
DN
175102011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17511
17512 Don't force ./temacs to start in terminal mode.
17513
17514 * frame.c (make_initial_frame): Initialize faces in all cases, not
17515 only when CANNOT_DUMP is defined.
17516 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17517
c56e0fd5
DN
175182011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17519
17520 * dispnew.c (add_window_display_history): Use const for the string
17521 pointer. Remove declaration, not needed.
17522
333d54da 175232011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 17524
55d4c1b2 17525 Use 'inline', not 'INLINE'.
333d54da 17526 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
17527 * alloc.c, fontset.c (INLINE): Remove.
17528 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17529 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17530 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17531 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17532 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17533
738db178
DN
175342011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17535
17536 Make it possible to run ./temacs.
17537
17538 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17539 syms_of_callproc does the same thing. Remove test for
17540 "initialized", do it in the caller.
17541 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17542
620c53a6
SM
175432011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17544
17545 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17546 (read_minibuf): Use get_minibuffer.
17547 (syms_of_minibuf): Use DEFSYM.
17548 (Qmetadata): New var.
17549 * data.c (Qbuffer): Don't make it static.
17550 (syms_of_data): Use DEFSYM.
17551
e003a292
PE
175522011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17553
17554 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17555 (CCL_CODE_MIN): New macro.
17556
ed008a6d
PE
175572011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17558
3687c2ef
PE
17559 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17560
ed008a6d
PE
17561 * eval.c (Qdebug): Now static.
17562 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17563 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17564 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17565
d66c4c7c
CY
175662011-05-29 Chong Yidong <cyd@stupidchicken.com>
17567
17568 * image.c: Various fixes to ImageMagick code comments.
17569 (Fimagemagick_types): Doc fix.
17570
5fbc2025
PE
175712011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17572
0196f88a
PE
17573 Minor fixes prompted by GCC 4.6.0 warnings.
17574
17575 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17576
5fbc2025
PE
17577 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17578 (x_clipboard_manager_save_all): Move extern decl to ...
17579 * xterm.h: ... here, so that it can be checked for consistency.
17580
1dd3c2d9
CY
175812011-05-29 Chong Yidong <cyd@stupidchicken.com>
17582
17583 * xselect.c (x_clipboard_manager_save_frame)
17584 (x_clipboard_manager_save_all): New functions.
17585 (Fx_clipboard_manager_save): Lisp function deleted.
17586
17587 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17588 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17589
17590 * xterm.h: Update prototype.
17591
5ba6571d
WX
175922011-05-28 William Xu <william.xwl@gmail.com>
17593
17594 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17595 exiting (Bug#8239).
17596
3eaff834
JM
175972011-05-28 Jim Meyering <meyering@redhat.com>
17598
e1900994 17599 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
17600 * fns.c (to_uchar): Define.
17601 (crypto_hash_function): Use it to convert some newly-signed
17602 variables to unsigned, to avoid sign-extension bugs. For example,
17603 without this change, (md5 "truc") would evaluate to
17604 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17605 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 17606 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 17607
0f6990a7
PE
176082011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17609
17610 Integer overflow fixes.
c8a9ca5a 17611
08686060
PE
17612 * dbusbind.c: Serial number integer overflow fixes.
17613 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
17614 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17615 to hold a serial number that is too large for a fixnum.
17616 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17617 Check for serial numbers out of range. Decode any serial number
59568bf0 17618 that was so large that it became a float. (Bug#8722)
08686060 17619
2d1fc3c7
PE
17620 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17621 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17622 Use XFASTINT rather than XUINT when numbers are nonnegative.
17623 (xd_append_arg, Fdbus_method_return_internal):
17624 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17625 arguments, check that Lisp number is nonnegative, rather than
59568bf0 17626 silently wrapping negative numbers around. (Bug#8722)
30217ff0 17627 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 17628 (Bug#8722)
2d1fc3c7 17629
c8a9ca5a
PE
17630 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17631
519e1d69
PE
17632 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17633
6df6ae42 17634 ccl: Add integer overflow checks.
30569699
PE
17635 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17636 (IN_INT_RANGE): New macros.
17637 (ccl_driver): Use them to check for integer overflow when
17638 decoding a CCL program. Many of the new checks are whether XINT (x)
17639 fits in int; it doesn't always, on 64-bit hosts. The new version
17640 doesn't catch all possible integer overflows, but it's an
847044ea 17641 improvement. (Bug#8719)
30569699 17642
c11285dc
PE
17643 * alloc.c (make_event_array): Use XINT, not XUINT.
17644 There's no need for unsigned here.
17645
fdccd48e
PE
17646 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17647 This follows up to the 2011-05-06 change that substituted uintptr_t
17648 for EMACS_INT. This case wasn't caught back then.
17649
37910ab2
PE
17650 Rework Fformat to avoid integer overflow issues.
17651 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17652 now (part of C89). Include <verify.h>.
17653 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17654 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17655 (Fformat): Avoid the prepass trying to compute sizes; it was only
17656 approximate and thus did not catch overflow reliably. Instead, walk
17657 through the format just once, formatting and computing sizes as we go,
17658 checking for integer overflow at every step, and allocating a larger
17659 buffer as needed. Keep track separately whether the format is
17660 multibyte. Keep only the most-recently calculated precision, rather
17661 than them all. Record whether each argument has been converted to
17662 string. Use EMACS_INT, not int, for byte and char and arg counts.
17663 Support field widths and precisions larger than INT_MAX. Avoid
17664 sprintf's undefined behavior with conversion specifications such as %#d
17665 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17666 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17667 formatting out-of-range floating point numbers with int
9173deec 17668 formats. (Bug#8668)
37910ab2 17669
2e6578fb
PE
17670 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17671
0ae6bdee
PE
17672 * data.c: Avoid integer truncation in expressions involving floats.
17673 * data.c: Include <intprops.h>.
17674 (arith_driver): When there's an integer overflow in an expression
17675 involving floating point, convert the integers to floating point
17676 so that the resulting value does not suffer from catastrophic
17677 integer truncation. For example, on a 64-bit host (* 4
17678 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17679 Do not rely on undefined behavior after integer overflow.
17680
de883a70
PE
17681 merge count_size_as_multibyte, parse_str_to_multibyte
17682 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 17683 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
17684 Check for integer overflow.
17685 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17686 since it's now a duplicate of the other. This is more of
17687 a character than a buffer op, so better that it's in character.c.
17688 * fns.c, print.c: Adjust to above changes.
17689
2ff916cb
PE
176902011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17691
17692 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17693
f1b54466
PE
176942011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17695
fb1ac845
PE
17696 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17697 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17698 (x_clipboard_manager_save): Now static.
17699 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17700
f1b54466
PE
17701 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17702 (crypto_hash_function): Now static.
17703 Fix pointer signedness problems. Avoid unnecessary initializations.
17704
a9f737ee
CY
177052011-05-27 Chong Yidong <cyd@stupidchicken.com>
17706
17707 * termhooks.h (Vselection_alist): Make it terminal-local.
17708
17709 * terminal.c (create_terminal): Initialize it.
17710
17711 * xselect.c: Support for clipboard managers.
17712 (Vselection_alist): Move to termhooks.h as terminal-local var.
17713 (LOCAL_SELECTION): New macro.
17714 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17715 (symbol_to_x_atom): Remove gratuitous arg.
17716 (x_handle_selection_request, lisp_data_to_selection_data)
17717 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
17718 (x_own_selection, x_get_local_selection, x_convert_selection):
17719 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
17720 (some_frame_on_display): Delete unused function.
17721 (Fx_own_selection_internal, Fx_get_selection_internal)
17722 (Fx_disown_selection_internal, Fx_selection_owner_p)
17723 (Fx_selection_exists_p): New optional frame arg.
17724 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17725 (x_handle_selection_clear): Don't treat other terminals with the
17726 same keyboard specially. Use the terminal-local Vselection_alist.
17727 (x_clear_frame_selections): Use Frun_hook_with_args.
17728
17729 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17730
17731 * xterm.h: Add support for those atoms.
17732
e067f0c1
CY
177332011-05-26 Chong Yidong <cyd@stupidchicken.com>
17734
17735 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17736 (converted_selections, conversion_fail_tag): New global variables.
17737 (x_selection_request_lisp_error): Free the above.
17738 (x_get_local_selection): Remove unnecessary code.
17739 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
17740 of converted selections stored in converted_selections.
17741 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
17742 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17743 (x_convert_selection): New function.
17744 (x_handle_selection_event): Simplify.
17745 (x_get_foreign_selection): Don't ignore incoming requests while
17746 waiting for an answer; this will fail when we implement
17747 SAVE_TARGETS, and seems unnecessary anyway.
17748 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17749 (Vx_sent_selection_functions): Doc fix.
17750
0f4aebc0
LL
177512011-05-26 Leo Liu <sdl.web@gmail.com>
17752
17753 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17754
e61124cd
YM
177552011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17756
17757 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17758
17759 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17760 for fringe update if it has periodic bitmap.
ac389d0c 17761 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
17762 and fringe_bitmap_periodic_p.
17763
17764 * fringe.c (get_fringe_bitmap_data): New function.
17765 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17766 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17767 row. Mark glyph row for fringe update if periodicity changed.
17768
17769 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17770 for fringe update unless it has periodic bitmap.
17771
f16d9837
KH
177722011-05-25 Kenichi Handa <handa@m17n.org>
17773
17774 * xdisp.c (get_next_display_element): Set correct it->face_id for
17775 a static composition.
17776
e1b90ef6
LL
177772011-05-24 Leo Liu <sdl.web@gmail.com>
17778
17779 * deps.mk (fns.o):
17780 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17781
17782 * fns.c (crypto_hash_function, Fsha1): New function.
17783 (Fmd5): Use crypto_hash_function.
17784 (syms_of_fns): Add Ssha1.
17785
7400048f
PE
177862011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17787
17788 * gnutls.c: Remove unused macros.
17789 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17790 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17791 Remove macros that are defined and never used.
17792 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17793
abb71cf4
CY
177942011-05-22 Chong Yidong <cyd@stupidchicken.com>
17795
17796 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17797 (Fx_get_selection_internal): Minor cleanup.
17798 (Fx_own_selection_internal): Rename arguments for consistency with
17799 select.el.
17800
6307db39
PE
178012011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17802
17803 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17804
f3d4e0a4
CY
178052011-05-22 Chong Yidong <cyd@stupidchicken.com>
17806
17807 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17808
4d8ade89
YM
178092011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17810
17811 * dispnew.c (scrolling_window): Don't exclude the case that the
17812 last enabled row in the desired matrix touches the bottom boundary.
17813
32078c8d
GM
178142011-05-21 Glenn Morris <rgm@gnu.org>
17815
17816 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
17817 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17818 and add some more files.
32078c8d 17819
7285dc67
EZ
178202011-05-20 Eli Zaretskii <eliz@gnu.org>
17821
17822 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17823 report_file_error introduced by the change from 2011-05-07.
17824
89d1bd22
PE
178252011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17826
17827 * systime.h (Time): Define only if emacs is defined.
17828 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17829 where the include path doesn't have X11/X.h by default. See
17830 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17831
cd394be1 178322011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
17833
17834 * composite.c (find_automatic_composition): Fix previous change.
17835
b9704ad9
GM
178362011-05-20 Glenn Morris <rgm@gnu.org>
17837
17838 * lisp.mk: New file, split from Makefile.in.
17839 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17840 (shortlisp): Remove.
17841 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17842
4a720484
GM
178432011-05-19 Glenn Morris <rgm@gnu.org>
17844
17845 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17846 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17847 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17848 (lisp): Set the order to that of loadup.el.
17849 (shortlisp): Make it a copy of $lisp.
17850 (SOME_MACHINE_LISP): Remove.
17851 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17852 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17853
a28d4396
KH
178542011-05-18 Kenichi Handa <handa@m17n.org>
17855
17856 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17857 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17858 (find_automatic_composition): Mostly rewrite for efficiency.
17859
a2b1fa8e
JB
178602011-05-18 Juanma Barranquero <lekktu@gmail.com>
17861
17862 * makefile.w32-in: Update dependencies.
17863
8e1f5610
CS
178642011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17865
17866 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 17867 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 17868
7025ee00 178692011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 17870
cdfa6eab
PE
17871 Fix some integer overflow issues, such as string length overflow.
17872
06d6db33
PE
17873 * insdel.c (count_size_as_multibyte): Check for string overflow.
17874
2b4560a8
PE
17875 * character.c (lisp_string_width): Check for string overflow.
17876 Use EMACS_INT, not int, for string indexes and lengths; in
17877 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17878 the resulting string length overflows an EMACS_INT; instead,
17879 report a string overflow if no precision given. When checking for
17880 precision exhaustion, use a check that cannot possibly have
17881 integer overflow. (Bug#8675)
17882 * character.h (lisp_string_width): Adjust to new signature.
17883
cb93f9be
PE
17884 * alloc.c (string_overflow): New function.
17885 (Fmake_string): Use it. This doesn't change behavior, but saves
17886 a few bytes and will simplify future changes.
17887 * character.c (string_escape_byte8): Likewise.
17888 * lisp.h (string_overflow): New decl.
17889
1a1f3366
PE
17890 Fixups, following up to the user-interface timestamp change.
17891 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17892 for UI timestamps, instead of unsigned long.
9fbd6841
PE
17893 * msdos.c (mouse_get_pos): Likewise.
17894 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
17895 * w32gui.h (Time): Define by including "systime.h" rather than by
17896 declaring it ourselves. (Bug#8664)
17897
d4e3e4d3
PE
17898 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17899 * image.c (clear_image_cache): Likewise.
17900
f6a24d19
PE
17901 * term.c (term_mouse_position): Don't assume time_t wraparound.
17902
08dc5ae6
PE
17903 Be more systematic about user-interface timestamps.
17904 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
17905 and sometimes 'EMACS_UINT', to represent these timestamps.
17906 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
17907 This makes the code easier to follow, and makes it easier to catch
17908 integer overflow bugs such as Bug#8664.
17909 * frame.c (Fmouse_position, Fmouse_pixel_position):
17910 Use Time, not unsigned long, for user-interface timestamps.
17911 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17912 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17913 * keyboard.h (last_event_timestamp): Likewise.
17914 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17915 * menu.h (xmenu_show): Likewise.
17916 * term.c (term_mouse_position): Likewise.
17917 * termhooks.h (struct input_event.timestamp): Likewise.
17918 (struct terminal.mouse_position_hook): Likewise.
17919 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17920 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17921 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17922 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17923 what it was before.
17924 * menu.h, termhooks.h: Include "systime.h", for Time.
17925
8e55734a
PE
17926 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17927 Don't assume that the difference between two unsigned long values
17928 can fit into an integer. At this point, we know button_down_time
17929 <= event->timestamp, so the difference must be nonnegative, so
17930 there's no need to cast the result if double-click-time is
17931 nonnegative, as it should be; check that it's nonnegative, just in
17932 case. This bug is triggered when events are more than 2**31 ms
86db42d2 17933 apart (about 25 days). (Bug#8664)
8e55734a 17934
841f1b75 17935 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 17936 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 17937
3e26f69c
PE
17938 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17939 that always fit in int. Use a sentinel instead of a counter, to
17940 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
17941 * frame.h (struct frame): Use int for menu_bar_items_used
17942 instead of EMACS_INT, since it always fits in int.
3e26f69c 17943
5cc152c0
PE
17944 * menu.c (grow_menu_items): Check for int overflow.
17945
d89eb65e
PE
17946 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17947
5235bd3e
PE
17948 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17949 Before, the code was not consistent. These values cannot exceed
17950 2**31 - 1 so there's no need to make them unsigned.
17951 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17952 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17953 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17954 as modifiers.
17955 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17956
bc827e23
PE
17957 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17958 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17959 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17960 presumably because the widths might not match.
17961
78eb494e
PE
17962 * window.c (size_window): Avoid needless test at loop start.
17963
04f2d78b
CB
179642011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17965
17966 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17967
d2fc7e3d 179682011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
17969
17970 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17971
d2fc7e3d 179722011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
17973
17974 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17975 `width' to `bar_area_x' and `bar_area_width', respectively.
17976 (x_scroll_run): Take account of fringe background extension.
17977
04f2d78b
CB
17978 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17979 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
17980 `bar_area_width', respectively.
17981 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17982 background extension.
17983
79b70037
GM
179842011-05-10 Jim Meyering <meyering@redhat.com>
17985
17986 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17987
2f142cc5
JB
179882011-05-10 Juanma Barranquero <lekktu@gmail.com>
17989
17990 * image.c (Finit_image_library): Return t for built-in image types,
17991 like pbm and xbm. (Bug#8640)
17992
57679c86
AS
179932011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17994
17995 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17996
888c9e86
EZ
179972011-05-07 Eli Zaretskii <eliz@gnu.org>
17998
b0512a1d
EZ
17999 * w32console.c (Fset_screen_color): Doc fix.
18000 (Fget_screen_color): New function.
18001 (syms_of_ntterm): Defsubr it.
18002
7285dc67
EZ
18003 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
18004 unlink the temporary file if Fcall_process didn't create it in the
18005 first place.
18006 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
18007 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
18008 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
18009 cue to call_process_cleanup not to close that handle.
18010
4d3fcc8e
BK
180112011-05-07 Ben Key <bkey76@gmail.com>
18012
18013 * makefile.w32-in: The bootstrap-temacs rule now makes use of
18014 one of two shell specific rules, either bootstrap-temacs-CMD or
18015 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
18016 to the previous implementation of the bootstrap-temacs rule.
18017 The bootstrap-temacs-CMD rule is similar to the previous
18018 implementation of the bootstrap-temacs rule except that it
18019 makes use of the ESC_CFLAGS variable instead of the CFLAGS
18020 variable.
18021
18022 These changes, along with some changes to nt/configure.bat,
18023 nt/gmake.defs, and nt/nmake.defs, are required to extend my
18024 earlier fix to add support for --cflags and --ldflags options
18025 that include quotes so that it works whether make uses cmd or
18026 sh as the shell.
18027
b4289b64
MA
180282011-05-06 Michael Albinus <michael.albinus@gmx.de>
18029
18030 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
18031 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
18032 is a constant.
18033 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
18034 a string. Handle both cases.
18035 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
18036 (Fdbus_register_method): Use Qinvalid_function.
18037
af4c0e28
JB
180382011-05-06 Juanma Barranquero <lekktu@gmail.com>
18039
18040 * makefile.w32-in: Update dependencies.
18041 (LISP_H): Add inttypes.h and stdin.h.
18042 (PROCESS_H): Add unistd.h.
18043
c51453d9
EZ
180442011-05-06 Eli Zaretskii <eliz@gnu.org>
18045
18046 * lread.c: Include limits.h (fixes the MS-Windows build broken by
18047 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
18048
8ff0ac3c 180492011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 18050
4c4b566b
PE
18051 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
18052
aab2b9b5
PE
18053 * term.c (vfatal): Remove stray call to va_end.
18054 It's not needed and the C Standard doesn't allow it here anyway.
18055
c378da0b
PE
18056 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
18057 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
18058
288b08c7
PE
18059 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
18060 bytes.
18061
e3601888
PE
18062 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
18063
db6c0e74
PE
18064 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18065
dd5963ea
PE
18066 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
18067
88c9450f
PE
18068 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
18069
2f9442b8
PE
18070 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
18071
c032b5f8
PE
18072 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
18073 * charset.c (Fdefine_charset_internal): Don't initialize
18074 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 18075 32-bit int (Bug#8600).
a108c10b
PE
18076
18077 * lread.c (read_integer): Be more consistent with string-to-number.
18078 Use string_to_number to do the actual conversion; this avoids
18079 rounding errors and fixes some other screwups. Without this fix,
18080 for example, #x1fffffffffffffff was misread as -2305843009213693952.
18081 (digit_to_number): Move earlier, for benefit of read_integer.
18082 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 18083 not a digit in any supported base. (Bug#8602)
a108c10b 18084
ad5f9eea
PE
18085 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
18086
aec1708a
PE
18087 * dispnew.c (scrolling_window): Return 1 if we scrolled,
18088 to match comment at start of function. This also removes a
18089 GCC warning about overflow in a 32+64-bit port.
18090
47be4ab5
PE
18091 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
18092
371cac43
PE
18093 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
18094 Reported by Stefan Monnier in
18095 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
18096 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18097 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 18098
d01a7826
PE
18099 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
18100 (EMACS_UINTPTR): Likewise, with uintptr_t.
18101
7fd47d5c
PE
18102 * lisp.h: Prefer 64-bit EMACS_INT if available.
18103 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
18104 on 32-bit hosts that have 64-bit int, so that they can access
18105 large files.
122b0c86
PE
18106 However, temporarily disable this change unless the temporary
18107 symbol WIDE_EMACS_INT is defined.
7fd47d5c 18108
8727937b
PE
18109 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
18110
8ac068ac
PE
18111 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
18112 This removes an assumption that EMACS_INT and long are the same
18113 width as pointers. The assumption is true for Emacs porting targets
18114 now, but we want to make other targets possible.
18115 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
18116 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
18117 In the rest of the code, change types of integers that hold casted
18118 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
18119 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
18120 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
18121 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
18122 No need to cast type when ORing.
18123 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
18124 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
18125 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
18126 assume EMACS_INT is the same width as char *.
18127 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
18128 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
18129 Remove no-longer-needed casts.
18130 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
18131 (xg_tool_bar_help_callback, xg_make_tool_item):
18132 Use EMACS_INTPTR to hold an integer
18133 that will be cast to void *; this can avoid a GCC warning
18134 if EMACS_INT is not the same width as void *.
18135 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
18136 * xdisp.c (display_echo_area_1, resize_mini_window_1):
18137 (current_message_1, set_message_1):
18138 Use a local to convert to proper width without a cast.
18139 * xmenu.c (dialog_selection_callback): Likewise.
18140
ede49d71
PE
18141 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
18142 Also, don't assume VALBITS / RAND_BITS is less than 5,
18143 and don't rely on undefined behavior when shifting a 1 left into
18144 the sign bit.
18145 * lisp.h (get_random): Change signature to match.
18146
2f30ecd0
PE
18147 * lread.c (hash_string): Use size_t, not int, for hash computation.
18148 Normally we prefer signed values; but hashing is special, because
18149 it's better to use unsigned division on hash table sizes so that
18150 the remainder is nonnegative. Also, size_t is the natural width
18151 for hashing into memory. The previous code used 'int', which doesn't
18152 retain enough info to hash well into very large tables.
18153 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
18154
2a866e7b
PE
18155 * dbusbind.c: Don't possibly lose pointer info when converting.
18156 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
18157 Use XPNTR rather than XHASH, so that the high-order bits of
18158 the pointer aren't lost when converting through void *.
18159
51639eac
PE
18160 * eval.c (Fautoload): Don't double-shift a pointer.
18161
92394119
PE
18162 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
18163
dbdb9a7c
JB
181642011-05-06 Juanma Barranquero <lekktu@gmail.com>
18165
18166 * gnutls.c (DEF_GNUTLS_FN):
18167 * image.c (DEF_IMGLIB_FN): Make function pointers static.
18168
db7a0b4f
AS
181692011-05-05 Andreas Schwab <schwab@linux-m68k.org>
18170
18171 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
18172 marker. (Bug#8610)
18173
cd394be1 181742011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
18175
18176 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
18177 New version that can reserve upto 2GB of heap space.
18178
f7ff1b0f 181792011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
18180
18181 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
18182
639c109b
TZ
181832011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
18184
18185 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
18186 `gnutls_certificate_set_x509_key_file'.
18187
d2127135
JB
181882011-05-05 Juanma Barranquero <lekktu@gmail.com>
18189
18190 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
18191 Update dependencies.
18192
e968f4f3
JB
181932011-05-04 Juanma Barranquero <lekktu@gmail.com>
18194
18195 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
18196 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
18197 Remove unused parameter `fildes'.
18198 * process.c (read_process_output, send_process): Don't pass it.
18199
84d358f0
JB
182002011-05-04 Juanma Barranquero <lekktu@gmail.com>
18201
18202 Fix previous change: the library cache is defined in w32.c.
18203 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
18204 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
18205
0898ca10
JB
182062011-05-04 Juanma Barranquero <lekktu@gmail.com>
18207
18208 Implement dynamic loading of GnuTLS on Windows.
18209
18210 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
18211 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
18212 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18213 Declare.
18214
18215 * gnutls.c (Qgnutls_dll): Define.
18216 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
18217 (gnutls_*): Declare function pointers.
18218 (init_gnutls_functions): New function to initialize function pointers.
18219 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
18220 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
18221 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
18222 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
18223 (emacs_gnutls_write, emacs_gnutls_read)
18224 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
18225 (Fgnutls_available_p): New function.
18226 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
18227 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
18228 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
18229
18230 * image.c: Include w32.h.
18231 (Vimage_type_cache): Delete.
18232 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
18233 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
18234 (w32_delayed_load): Move to w32.c.
18235
18236 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
18237
18238 * w32.c (QCloaded_from, Vlibrary_cache): Define.
18239 (w32_delayed_load): Move from image.c. When loading a library, record
18240 its filename in the :loaded-from property of the library id.
18241 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
18242 Initialize and staticpro them.
18243 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
18244
18245 * process.c: Include lisp.h before w32.h, not after.
18246 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
18247 instead of gnutls_record_check_pending.
18248
18249 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
18250
ff4de4aa
TZ
182512011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
18252
18253 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
18254 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
18255 as passed in.
18256
abe95abb
JD
182572011-05-03 Jan Djärv <jan.h.d@swipnet.se>
18258
18259 * xterm.c (x_set_frame_alpha): Do not set property on anything
18260 else than FRAME_X_OUTER_WINDOW (Bug#8608).
18261
e16e55d4
JB
182622011-05-02 Juanma Barranquero <lekktu@gmail.com>
18263
18264 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
18265
bafcf6a5
JB
182662011-05-02 Juanma Barranquero <lekktu@gmail.com>
18267
18268 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
18269 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
18270 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
18271 (gnutls_global_initialized, Qgnutls_bootprop_priority)
18272 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
18273 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
18274 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18275 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18276 (Qgnutls_bootprop_callbacks_verify): Make static.
18277
e7a6747f
AS
182782011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18279
19ed11ba
AS
18280 * callproc.c: Indentation fixup.
18281
e7a6747f 18282 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
18283 (wait_for_termination, interruptible_wait_for_termination):
18284 Move after wait_for_termination_1.
e7a6747f 18285
1ef14cb4
LMI
182862011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18287
18288 * sysdep.c (interruptible_wait_for_termination): New function
18289 which is like wait_for_termination, but allows keyboard
18290 interruptions.
18291
18292 * callproc.c (Fcall_process): Add (:file "file") as an option for
18293 the STDOUT buffer.
18294 (Fcall_process_region): Ditto.
18295
330d880c
EZ
182962011-04-30 Eli Zaretskii <eliz@gnu.org>
18297
8db90b73
EZ
18298 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18299 rather than `XVECTOR (FOO)->size'.
18300
330d880c
EZ
18301 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18302 inttypes.h, as a gnulib replacement is used if it not available in
18303 system headers.
18304
15cbd324
EZ
183052011-04-21 Eli Zaretskii <eliz@gnu.org>
18306
18307 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18308 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18309 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18310
18311 * coding.c (coding_alloc_by_realloc): Error out if destination
18312 will grow beyond MOST_POSITIVE_FIXNUM.
18313 (decode_coding_emacs_mule): Abort if there isn't enough place in
18314 charbuf for the composition carryover bytes. Reserve an extra
18315 space for up to 2 characters produced in a loop.
18316 (decode_coding_iso_2022): Abort if there isn't enough place in
18317 charbuf for the composition carryover bytes.
18318
183192011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 18320
ae940cca
EZ
18321 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18322 aborting when %lld or %lll format is passed.
18323 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18324 %llo or %llx format is passed. (Bug#8545)
18325
03ab8921
EZ
18326 * window.c (window_scroll_line_based): Use a marker instead of
18327 simple variables to record original value of point. (Bug#7952)
18328
afda1437
EZ
18329 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18330 produced by %s or %c overflows available buffer space. (Bug#8545)
18331
f76dee0c
PE
183322011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18333
18334 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 18335 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 18336
fdc5744d
JB
183372011-04-28 Juanma Barranquero <lekktu@gmail.com>
18338
18339 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18340
638f053a
JB
183412011-04-28 Juanma Barranquero <lekktu@gmail.com>
18342
18343 * keyboard.c (Qdelayed_warnings_hook): Define.
18344 (command_loop_1): Run `delayed-warnings-hook'
18345 if Vdelayed_warnings_list is non-nil.
18346 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18347 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18348
d178f871
EZ
183492011-04-28 Eli Zaretskii <eliz@gnu.org>
18350
18351 * doprnt.c (doprnt): Don't return value smaller than the buffer
18352 size if the message was truncated. (Bug#8545).
18353
b124fd93
JB
183542011-04-28 Juanma Barranquero <lekktu@gmail.com>
18355
18356 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18357 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18358
e810457d
PE
183592011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18360
18361 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18362
ea51cceb
JB
183632011-04-27 Juanma Barranquero <lekktu@gmail.com>
18364
18365 * makefile.w32-in: Update dependencies.
18366
94dcfacf
EZ
183672011-04-27 Eli Zaretskii <eliz@gnu.org>
18368
18369 Improve `doprnt' and its usage. (Bug#8545)
18370 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18371 `format_end'. Remove support for %l as a conversion specifier.
18372 Don't use xrealloc. Improve diagnostics when the %l size modifier
18373 is used. Update the commentary.
18374
18375 * eval.c (verror): Simplify calculation of size_t.
18376
18377 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18378 messages.
18379
f61f41d7
PE
183802011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18381
18382 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18383 change.
18384
96fb4434
PE
183852011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18386
18387 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18388 This makes this file independent of the recent pseudovector change.
18389
671875da 183902011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 18391
69e9b5a3
PE
18392 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18393
b5f869a7 18394 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 18395 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 18396 Remove unused local.
c8926152 18397 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 18398
841a1577 18399 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
18400 GCC 4.6.0 optimizes based on type-based alias analysis.
18401 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
18402 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18403 != &v->size, and therefore "v->size = 1; b->size = 2; return
18404 v->size;" must therefore return 1. This assumption is incorrect
18405 for Emacs, since it type-puns struct Lisp_Vector * with many other
18406 types. To fix this problem, this patch adds a new type struct
f904488f 18407 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
18408 and pseudovectors, and helps optimizing compilers not get fooled
18409 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18410 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
18411 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18412 the size member.
eab3844f
PE
18413 (XSETPVECTYPE): Rewrite in terms of new macro.
18414 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18415 This is a bit clearer, and further avoids the possibility of
18416 undesirable aliasing.
18417 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 18418 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
18419 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18420 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
18421 (ASIZE): Now uses header.size rather than size.
18422 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
18423 to avoid the hassle of writing XVECTOR (foo)->header.size.
18424 (struct vectorlike_header): New type.
eab3844f
PE
18425 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18426 object, to help avoid aliasing.
18427 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18428 (SUBRP): Likewise, since Lisp_Subr is a special case.
18429 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18430 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18431 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 18432 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
18433 changed to be "header.size" and "header.next".
18434 * buffer.h (struct buffer): Likewise.
18435 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18436 * frame.h (struct frame): Likewise.
18437 * process.h (struct Lisp_Process): Likewise.
18438 * termhooks.h (struct terminal): Likewise.
18439 * window.c (struct save_window_data, struct saved_window): Likewise.
18440 * window.h (struct window): Likewise.
18441 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18442 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18443 * buffer.c (init_buffer_once): Likewise.
18444 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18445 special case.
18446 * process.c (Fformat_network_address): Use local var for size,
18447 for brevity.
18448
0df1eac5
PE
18449 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18450
847ab9d1 18451 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
18452 * data.c (atof): Remove decl; no longer used or needed.
18453 (digit_to_number): Move to lread.c.
18454 (Fstring_to_number): Use new string_to_number function, to be
18455 consistent with how the Lisp reader treats infinities and NaNs.
18456 Do not assume that floating-point numbers represent EMACS_INT
18457 without losing information; this is not true on most 64-bit hosts.
18458 Avoid double-rounding errors, by insisting on integers when
18459 parsing non-base-10 numbers, as the documentation specifies.
18460 * lisp.h (string_to_number): New decl, replacing ...
18461 (isfloat_string): Remove.
bc0a5c13 18462 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 18463 (read1): Do not accept +. and -. as integers; this
452f4150
PE
18464 appears to have been a coding error. Similarly, do not accept
18465 strings like +-1e0 as floating point numbers. Do not report
18466 overflow for integer overflows unless the base is not 10 which
18467 means we have no simple and reliable way to continue.
18468 Break out the floating-point parsing into a new
18469 function string_to_number, so that Fstring_to_number parses
18470 floating point numbers consistently with the Lisp reader.
04f2d78b 18471 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
18472 (E_CHAR, EXP_INT): Remove, replacing with ...
18473 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18474 (string_to_number): New function, replacing isfloat_string.
18475 This function checks for valid syntax and produces the resulting
18476 Lisp float number too. Rework it so that string-to-number
bc0a5c13 18477 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
18478 so that overflow for non-base-10 numbers is reported only when
18479 there's no portable and simple way to convert to floating point.
452f4150 18480
67769ffc
PE
18481 * textprop.c (set_text_properties_1): Rewrite for clarity,
18482 and to avoid GCC warning about integer overflow.
18483
c20db43f
PE
18484 * intervals.h (struct interval): Use EMACS_INT for members
18485 where EMACS_UINT might cause problems. See
18486 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18487 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18488 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18489 All uses changed.
37aa2f85
PE
18490 (offset_intervals): Tell GCC not to worry about length overflow
18491 when negating a negative length.
c20db43f 18492
2538aa2f
PE
18493 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18494 (overrun_check_free): Likewise.
18495
f2d3008d
PE
18496 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18497 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18498 word size.
18499
ec8df744
PE
18500 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18501 (gnutls_make_error): Rename local to avoid shadowing.
18502 (gnutls_emacs_global_deinit): ifdef out; not used.
18503 (Fgnutls_boot): Use const for pointer to readonly storage.
18504 Comment out unused local. Fix pointer signedness problems.
18505
640ee02d
PE
18506 * lread.c (openp): Don't stuff size_t into an 'int'.
18507 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18508 about possible signed overflow.
18509
6048fb2a
PE
18510 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18511 (GDK_KEY_g): Don't define if already defined.
18512 (xg_prepare_tooltip): Avoid pointer signedness problem.
18513 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18514
fa3c87e1
PE
18515 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18516 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18517
2172544b
PE
18518 * xfns.c (Fx_window_property): Simplify a bit,
18519 to make a bit faster and to avoid GCC 4.6.0 warning.
18520 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18521
9b821a21
PE
18522 * fns.c (internal_equal): Don't assume size_t fits in int.
18523
3c616cfa
PE
18524 * alloc.c (compact_small_strings): Tighten assertion a little.
18525
c2982e87
PE
18526 Replace pEd with more-general pI, and fix some printf arg casts.
18527 * lisp.h (pI): New macro, generalizing old pEd macro to other
18528 conversion specifiers. For example, use "...%"pI"d..." rather
18529 than "...%"pEd"...".
18530 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 18531 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
18532 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18533 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18534 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18535 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18536 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18537 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18538 64-bit hosts.
18539 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18540 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18541 * print.c (safe_debug_print, print_object): Likewise.
18542 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18543 to int.
6f04d126
PE
18544 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18545 avoiding the 0 flag, which is not portable.
c2982e87
PE
18546 * process.c (Fmake_network_process): Use pI to avoid cast.
18547 * region-cache.c (pp_cache): Likewise.
18548 * xdisp.c (decode_mode_spec): Likewise.
18549 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18550 behavior on 64-bit hosts with printf arg.
6f04d126 18551 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
18552 (x_stop_queuing_selection_requests): Likewise.
18553 (x_get_window_property): Don't truncate byte count to an 'int'
18554 when tracing.
0b432f21 18555
5e073ec7
PE
18556 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18557 here, since it parses constructs like leading '-' and spaces,
18558 which are not wanted; and it overflows with large numbers.
18559 Instead, simply match F[0-9]+, which is what is wanted anyway.
18560
36372bf9
PE
18561 * alloc.c: Remove unportable assumptions about struct layout.
18562 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18563 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18564 (allocate_vectorlike, make_pure_vector): Use the new macros,
18565 plus offsetof, to remove unportable assumptions about struct layout.
18566 These assumptions hold on all porting targets that I know of, but
18567 they are not guaranteed, they're easy to remove, and removing them
18568 makes further changes easier.
18569
0b432f21
PE
18570 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18571 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
18572 (string_overrun_cookie): Now const. Use initializers that
18573 don't formally overflow signed char, to avoid warnings.
000098c1
PE
18574 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18575 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
18576 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18577 multiple of sizeof (EMACS_INT); it need not be, if
18578 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 18579 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 18580
895009e1
JB
185812011-04-26 Juanma Barranquero <lekktu@gmail.com>
18582
18583 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18584
6a7a1b0b
TZ
185852011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18586
18587 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 18588 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
18589 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18590
841a1577 185912011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
18592
18593 * lisp.h (Qdebug): List symbol.
895009e1 18594 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
18595 * keyboard.c (debug-on-event): New variable.
18596 (handle_user_signal): Break into debugger when debug-on-event
18597 matches the current signal symbol.
18598
f2d3ba6f
DN
185992011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18600
18601 * alloc.c (check_sblock, check_string_bytes)
18602 (check_string_free_list): Convert to standard C.
18603
42ce4c63
TZ
186042011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18605
18606 * w32.c (emacs_gnutls_push): Fix typo.
18607
825cd63c
EZ
186082011-04-25 Eli Zaretskii <eliz@gnu.org>
18609
fb11d64d
EZ
18610 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18611 "cast to pointer from integer of different size".
18612
825cd63c
EZ
18613 Improve doprnt and its use in verror. (Bug#8545)
18614 * doprnt.c (doprnt): Document the set of format control sequences
18615 supported by the function. Use SAFE_ALLOCA instead of always
18616 using `alloca'.
18617
18618 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18619 is one byte too soon. Don't use xrealloc; instead xfree and
18620 xmalloc anew.
18621
e061a11b
TZ
186222011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18623
18624 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18625 callbacks stage.
18626
18627 * gnutls.c: Renamed global_initialized to
18628 gnutls_global_initialized. Added internals for the
18629 :verify-hostname-error, :verify-error, and :verify-flags
18630 parameters of `gnutls-boot' and documented those parameters in the
18631 docstring. Start callback support.
9173deec
JB
18632 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18633 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18634 on error. Return error code.
e061a11b
TZ
18635 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18636 (emacs_gnutls_read): Likewise.
18637 (Fgnutls_boot): Return handshake error code.
18638 (emacs_gnutls_handle_error): New function.
18639 (wsaerror_to_errno): Likewise.
18640
18641 * w32.h (emacs_gnutls_pull): Add prototype.
18642 (emacs_gnutls_push): Likewise.
18643
18644 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18645 (emacs_gnutls_push): Likewise.
18646
186472011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18648
18649 * process.c (wait_reading_process_output): Check if GnuTLS
18650 buffered some data internally if no FDs are set for TLS
18651 connections.
18652
18653 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18654 (LIBS): Link to USER_LIBS.
18655 ($(BLD)/gnutls.$(0)): New target.
18656
fa6996bc
EZ
186572011-04-24 Eli Zaretskii <eliz@gnu.org>
18658
eb35682e
EZ
18659 * xdisp.c (handle_single_display_spec): Rename the
18660 display_replaced_before_p argument into display_replaced_p, to
18661 make it consistent with the commentary. Fix typos in the
18662 commentary.
18663
e2ad650c
EZ
18664 * textprop.c (syms_of_textprop): Remove dead code.
18665 (copy_text_properties): Delete obsolete commentary about an
18666 interface that was deleted long ago. Fix typos in the description
18667 of arguments.
18668
1b2de274
EZ
18669 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18670 to changes in oldXMenu/XMenu.h from 2011-04-16.
18671 <menu_help_message, prev_menu_help_message>: Constify.
18672 (IT_menu_make_room): menu->help_text is now `const char **';
18673 adjust.
18674
18675 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18676 to changes in oldXMenu/XMenu.h from 2011-04-16.
18677 (struct XMenu): Declare `help_text' `const char **'.
18678
18679 * xfaces.c <Qunspecified>: Make extern again.
18680
18681 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 18682 required by POSIX.
1b2de274 18683
762b15be
EZ
18684 * doc.c (get_doc_string): Improve the format passed to `error'.
18685
18686 * doprnt.c (doprnt): Improve commentary.
18687
18688 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18689
18690 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18691 them with etags.
18692
f1052e5d
EZ
18693 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18694 changes in globals.h immediately force recompilation.
762b15be
EZ
18695 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18696 $(CURDIR)/s/ms-w32.h.
18697 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 18698
fa6996bc
EZ
18699 * character.c (Fchar_direction): Function deleted.
18700 (syms_of_character): Don't defsubr it.
18701 <char-direction-table>: Deleted.
18702
e6c3da20
EZ
187032011-04-23 Eli Zaretskii <eliz@gnu.org>
18704
18705 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18706 * doprnt.c: Include limits.h.
18707 (SIZE_MAX): New macro.
04f2d78b
CB
18708 (doprnt): Return a size_t value. 2nd arg is now size_t.
18709 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
18710 Improve overflow protection. Support `l' modifier for integer
18711 conversions. Support %l conversion. Don't assume an EMACS_INT
18712 argument for integer conversions and for %c.
18713
18714 * lisp.h (doprnt): Restore prototype.
18715
18716 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18717 $(SRC)/character.h.
18718
18719 * Makefile.in (base_obj): Add back doprnt.o.
18720
18721 * deps.mk (doprnt.o): Add back prerequisites.
18722 (callint.o): Depend on character.h.
18723
18724 * eval.c (internal_lisp_condition_case): Include the handler
18725 representation in the error message.
18726 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18727 when breaking from the loop.
18728
18729 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18730
18731 * callint.c (Fcall_interactively): When displaying error message
18732 about invalid control letter, pass the character's codepoint, not
18733 a pointer to its multibyte form. Improve display of the character
18734 in octal and display also its hex code.
18735
18736 * character.c (char_string): Use %x to display the (unsigned)
18737 codepoint of an invalid character, to avoid displaying a bogus
18738 negative value.
18739
18740 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18741 `error', not SYMBOL_NAME itself.
18742
18743 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18744 character arguments to `error'.
18745
18746 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18747 to `error' in error message about FINAL_CHAR argument. Make sure
18748 FINAL_CHAR is a character, and use %c when it is passed as
18749 argument to `error'.
18750
4ffd0d6b 187512011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
18752
18753 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18754
18755 * w32.c: Include <time.h>.
18756 (sys_localtime): New function.
18757
4ffd0d6b 187582011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
18759
18760 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18761
4ffd0d6b 18762 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 18763
4ffd0d6b 187642011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 18765
4ffd0d6b
GM
18766 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18767 zombies (Bug#8467).
aac0c6e3 18768
04c56954
EZ
187692011-04-19 Eli Zaretskii <eliz@gnu.org>
18770
18771 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18772 gl_state.e_property when gl_state.object is Qt.
18773
18774 * insdel.c (make_gap_larger): Remove limitation of buffer size
18775 to <= INT_MAX.
18776
16a43933
CY
187772011-04-18 Chong Yidong <cyd@stupidchicken.com>
18778
18779 * xdisp.c (lookup_glyphless_char_display)
18780 (produce_glyphless_glyph): Handle cons cell entry in
18781 glyphless-char-display.
18782 (Vglyphless_char_display): Document it.
18783
18784 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18785 glyphless-char-display.
18786
4581706e
CY
187872011-04-17 Chong Yidong <cyd@stupidchicken.com>
18788
18789 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18790
18791 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18792
18793 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18794 definition for no-X builds.
18795
4887c6e2 187962011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 18797
fd35b6f9
PE
18798 Static checks with GCC 4.6.0 and non-default toolkits.
18799
5c1ccb01
PE
18800 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18801
006c5daa
PE
18802 * process.c (keyboard_bit_set): Define only if SIGIO.
18803 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18804 (send_process): Repair possible setjmp clobbering.
18805
efc736d3
PE
18806 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18807
4e2fe2e6
PE
18808 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18809
f97334a2
PE
18810 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18811
4e75f29d
PE
18812 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18813 Define only if needed.
18814
90efadd1
PE
18815 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18816 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 18817 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 18818
3c647824
PE
18819 * dispextern.h (struct redisplay_interface): Rename param
18820 to avoid shadowing.
e264f262 18821 * termhooks.h (struct terminal): Likewise.
761383f4 18822 * xterm.c (xembed_send_message): Likewise.
3c647824 18823
b58c5c4a
PE
18824 * insdel.c (make_gap_smaller): Define only if
18825 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18826
cad59032
PE
18827 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18828 it.
18829
c339dc2e
PE
18830 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18831 so that we aren't warned about unused symbols.
18832
91a3e27b
PE
18833 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18834
399c71d3 18835 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 18836
8ffc96f5
PE
18837 * xfns.c (x_real_positions): Mark locals as initialized.
18838
eef9bc79
PE
18839 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18840
098db9dd
PE
18841 * xterm.c: Fix problems found by static analysis with other toolkits.
18842 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
18843 (x_dispatch_event): Declare static if USE_GTK, and
18844 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 18845 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 18846 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
18847 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18848 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 18849
eb18f6cc
PE
18850 * xmenu.c (menu_help_callback): Pointer type fixes.
18851 Use const pointers when pointing at readonly data. Avoid pointer
18852 signedness clashes.
18853 (FALSE): Remove unused macro.
18854 (update_frame_menubar): Remove unused decl.
18855
1fe72bf8
PE
18856 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18857
60d9e1db
PE
18858 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18859 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18860 (single_menu_item): Rename local to avoid shadowing.
18861
39261c26
PE
18862 * keyboard.c (make_lispy_event): Remove unused local var.
18863
018c5e19
PE
18864 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18865 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18866
63d2b86e
PE
18867 * bitmaps: Change bitmaps from unsigned char back to the X11
18868 compatible char. Avoid the old compiler warnings about
18869 out-of-range initializers by using, for example, '\xab' rather
18870 than 0xab.
18871
aefd87e1
PE
18872 * xgselect.c (xgselect_initialize): Check vs interface
18873 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18874
bf501fb9
PE
18875 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18876
e9829fdf
PE
18877 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18878 to read-only memory.
18879
1086c095
PE
18880 * fns.c (vector): Remove; this old hack is no longer needed.
18881
2baccd04 18882 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 18883 Remove unused var.
dde42981 18884 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 18885
72391843 18886 * xrdb.c (x_load_resources): Omit unused local.
3565b346 18887
436c16df 18888 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 18889 (x_window): Rename locals to avoid shadowing.
dc5ddd85 18890 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 18891
92bb796d 18892 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 18893 (x_term_init): Remove local to avoid shadowing.
92bb796d 18894
764430a3 18895 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
18896
18897 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18898 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18899
d1dfb56c
EZ
189002011-04-16 Eli Zaretskii <eliz@gnu.org>
18901
c4354cb4
EZ
18902 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18903
d1dfb56c
EZ
18904 Fix regex.c, syntax.c and friends for buffers > 2GB.
18905 * syntax.h (struct gl_state_s): Declare character position members
18906 EMACS_INT.
18907
18908 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18909
04f2d78b
CB
18910 * textprop.c (verify_interval_modification, interval_of):
18911 Declare arguments EMACS_INT.
d1dfb56c
EZ
18912
18913 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18914 EMACS_INT.
18915
18916 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18917
18918 * indent.c (Fvertical_motion): Local variable it_start is now
18919 EMACS_INT.
18920
18921 * regex.c (re_match, re_match_2, re_match_2_internal)
18922 (bcmp_translate, regcomp, regexec, print_double_string)
18923 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18924 (re_compile_pattern, re_exec): Declare arguments and local
18925 variables `size_t' and `ssize_t' and return values `regoff_t', as
18926 appropriate.
18927 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18928 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18929 <compile_stack_type>: `size' and `avail' are now `size_t'.
18930
18931 * regex.h <regoff_t>: Use ssize_t, not int.
18932 (re_search, re_search_2, re_match, re_match_2): Arguments that
18933 specify buffer/string position and length are now ssize_t and
18934 size_t. Return type is regoff_t.
18935
613052cd
BK
189362011-04-16 Ben Key <bkey76@gmail.com>
18937
18938 * nsfont.m: Fixed bugs in ns_get_family and
18939 ns_descriptor_to_entity that were caused by using free to
18940 deallocate memory blocks that were allocated by xmalloc (via
18941 xstrdup). This caused Emacs to crash when compiled with
18942 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18943 --enable-checking=xmallocoverrun). xfree is now used to
18944 deallocate these memory blocks.
18945
4170f62f 189462011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 18947
71b41406
PE
18948 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18949
9587a89d
PE
18950 emacs_write: Accept and return EMACS_INT for sizes.
18951 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18952 et seq.
18953 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18954 Accept and return EMACS_INT.
18955 (emacs_gnutls_write): Return the number of bytes written on
18956 partial writes.
18957 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
18958 (emacs_read, emacs_write): Remove check for negative size, as the
18959 Emacs source code has been audited now.
9587a89d
PE
18960 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18961 (emacs_read, emacs_write): Use it.
273a5f82
PE
18962 * process.c (send_process): Adjust to the new signatures of
18963 emacs_write and emacs_gnutls_write. Do not attempt to store
18964 a byte offset into an 'int'; it might overflow.
9587a89d 18965 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 18966
3e047f51
PE
18967 * sound.c: Don't assume sizes fit in 'int'.
18968 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 18969 Return EMACS_INT, not int.
3e047f51 18970 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
18971 Accept EMACS_INT, not int.
18972 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
18973 record read return values.
18974
cc39a9db
BK
189752011-04-15 Ben Key <bkey76@gmail.com>
18976
c9d0ec6d
JB
18977 * keyboard.c (Qundefined): Don't declare static since it is used
18978 in nsfns.m.
18979 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18980 static since they are used in nsfont.m.
cc39a9db 18981
6c60eb9f
SM
189822011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18983
18984 * process.c (Qprocessp): Don't declare static.
18985 * lisp.h (Qprocessp): Declare again.
18986
7990b61a
JB
189872011-04-15 Juanma Barranquero <lekktu@gmail.com>
18988
18989 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18990
5d4cb038
PE
189912011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18992
8bd7b830 18993 Improve C-level modularity by making more things 'static'.
cd64ea1d 18994
e3b27b31
PE
18995 Don't publish debugger-only interfaces to other modules.
18996 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18997 (verify_bytepos, count_markers): Move decls to the only modules
18998 that need them.
18999 * region-cache.h (pp_cache): Likewise.
19000 * window.h (check_all_windows): Likewise.
19001 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
19002
5d4cb038
PE
19003 * sysdep.c (croak): Now static, if
19004 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
19005 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
19006
19007 * alloc.c (refill_memory_reserve): Now static if
19008 !defined REL_ALLOC || defined SYSTEM_MALLOC.
19009 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 19010
e87b6180
PE
19011 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
19012 Define only if USE_LUCID.
19013
ac64929e
PE
19014 * xrdb.c (x_customization_string, x_rm_string): Now static.
19015
6f37259d
PE
19016 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
19017 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
19018
1683e3ab
PE
19019 * xdisp.c (draw_row_with_mouse_face): Now static.
19020 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
19021
de9c2632
PE
19022 * window.h (check_all_windows): Mark externally visible.
19023
2b96acb7
PE
19024 * window.c (window_deletion_count): Now static.
19025
19026 * undo.c: Make symbols static if they're not exported.
19027 (last_undo_buffer, last_boundary_position, pending_boundary):
19028 Now static.
19029
50436f33
PE
19030 * textprop.c (interval_insert_behind_hooks): Now static.
19031 (interval_insert_in_front_hooks): Likewise.
19032
64520e5c
PE
19033 * term.c: Make symbols static if they're not exported.
19034 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
19035 (max_frame_lines, tty_set_terminal_modes):
19036 (tty_reset_terminal_modes, tty_turn_off_highlight):
19037 (get_tty_terminal): Now static.
19038 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
19039 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 19040 HAVE_WINDOW_SYSTEM.
64520e5c
PE
19041 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
19042 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
19043
1fa53021
PE
19044 * sysdep.c: Make symbols static if they're not exported.
19045 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
19046 Now static.
19047 (sigprocmask_set, full_mask): Remove; unused.
19048 (wait_debugging): Mark as visible.
19049 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
19050 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
19051
d4b43b22
PE
19052 * syntax.c (syntax_temp): Define only if !__GNUC__.
19053
b7c513d0
PE
19054 * sound.c (current_sound_device, current_sound): Now static.
19055
989b29ad
PE
19056 * search.c (searchbufs, searchbuf_head): Now static.
19057
13a55a78
PE
19058 * scroll.c (scroll_cost): Remove; unused.
19059 * dispextern.h (scroll_cost): Remove decl.
19060
de68a1fc
PE
19061 * region-cache.h (pp_cache): Mark as externally visible.
19062
40ccffa6
PE
19063 * process.c: Make symbols static if they're not exported.
19064 (process_tick, update_tick, create_process, chan_process):
19065 (Vprocess_alist, proc_buffered_char, datagram_access):
19066 (fd_callback_data, send_process_frame, process_sent_to): Now static.
19067 (deactivate_process): Mark defn as static, as well as decl.
19068 * lisp.h (create_process): Remove decl.
19069 * process.h (chan_process, Vprocess_alist): Remove decls.
19070
ad64fc97
PE
19071 * print.c: Make symbols static if they're not exported.
19072 (print_depth, new_backquote_output, being_printed, print_buffer):
19073 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
19074 (print_interval, print_number_index, initial_stderr_stream):
19075 Now static.
19076 * lisp.h (Fprinc): Remove decl.
19077 (debug_output_compilation_hack): Mark as externally visible.
19078
adddb265
PE
19079 * sysdep.c (croak): Move decl from here to syssignal.h.
19080 * syssignal.h (croak): Put it here, so the API can be checked when
19081 'croak' is called from dissociate_if_controlling_tty.
19082
1717ede2
PE
19083 * minibuf.c: Make symbols static if they're not exported.
19084 (minibuf_save_list, choose_minibuf_frame): Now static.
19085 * lisp.h (choose_minibuf_frame): Remove decl.
19086
fa5fb2bc
PE
19087 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
19088
1e3890d1
PE
19089 * lread.c: Make symbols static if they're not exported.
19090 (read_objects, initial_obarray, oblookup_last_bucket_number):
19091 Now static.
19092 (make_symbol): Remove; unused.
19093 * lisp.h (initial_obarray, make_symbol): Remove decls.
19094
8a1414fa
PE
19095 * keyboard.c: Make symbols static if they're not exported.
19096 (single_kboard, recent_keys_index, total_keys, recent_keys):
19097 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
19098 (this_single_command_key_start, echoing, last_auto_save):
19099 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
19100 (command_loop, echo_now, keyboard_init_hook, help_char_p):
19101 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
19102 (Vlispy_mouse_stem, double_click_count):
19103 Now static.
19104 (force_auto_save_soon): Define only if SIGDANGER.
19105 (ignore_mouse_drag_p): Now static if
19106 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
19107 (print_help): Remove; unused.
19108 (stop_character, last_timer_event): Mark as externally visible.
19109 * keyboard.h (ignore_mouse_drag_p): Declare only if
19110 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
19111 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
19112 * lisp.h (echoing): Remove decl.
19113 (force_auto_save_soon): Declare only if SIGDANGER.
19114 * xdisp.c (redisplay_window): Simplify code, to make it more
19115 obvious that ignore_mouse_drag_p is not accessed if !defined
19116 USE_GTK && !defined HAVE_NS.
19117
93ea6e8f
PE
19118 * intervals.c: Make symbols static if they're not exported.
19119 (merge_properties_sticky, merge_interval_right, delete_interval):
19120 Now static.
19121 * intervals.h (merge_interval_right, delete_interval): Remove decls.
19122
77382fcc
PE
19123 * insdel.c: Make symbols static if they're not exported.
19124 However, leave prepare_to_modify_buffer alone. It's never
19125 called from outside this function, but that appears to be a bug.
19126 (combine_after_change_list, combine_after_change_buffer):
4889fc82 19127 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
19128 (adjust_after_replace_noundo): Remove; unused.
19129 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 19130 (signal_before_change): Remove decls.
77382fcc 19131
9306c32e
PE
19132 * indent.c (val_compute_motion, val_vmotion): Now static.
19133
cd44d2eb
PE
19134 * image.c: Make symbols static if they're not exported.
19135 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
19136 if USE_GTK.
19137 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
19138 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
19139
ad9a7a06
PE
19140 * fringe.c (standard_bitmaps): Now static.
19141 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
19142
81626931
PE
19143 * frame.c: Make symbols static if they're not exported.
19144 (x_report_frame_params, make_terminal_frame): Now static.
19145 (get_frame_param): Now static, unless HAVE_NS.
19146 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
19147 (x_get_resource_string): Remove; not used.
19148 * frame.h (make_terminal_frame, x_report_frame_params):
19149 (x_get_resource_string); Remove decls.
19150 (x_fullscreen_adjust): Declare only if WINDOWSNT.
19151 * lisp.h (get_frame_param): Declare only if HAVE_NS.
19152
239f9db9
PE
19153 * font.c, fontset.c: Make symbols static if they're not exported.
19154 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
19155 (FACE_SUITABLE_FOR_CHAR_P): Use it.
19156 * font.c (font_close_object): Now static.
19157 * font.h (font_close_object): Remove.
19158 * fontset.c (FONTSET_OBJLIST): Remove.
19159 (free_realized_fontset) #if-0 the body, which does nothing.
19160 (face_suitable_for_char_p): #if-0, as it's never called.
19161 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
19162 * xfaces.c (face_at_string_position):
19163 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
19164 since 0 is always ASCII.
19165
dfcf3579
PE
19166 * fns.c (weak_hash_tables): Now static.
19167
5045092b
PE
19168 * fileio.c: Make symbols static if they're not exported.
19169 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
19170 (Vwrite_region_annotation_buffers): Now static.
19171
57a96f5c
PE
19172 * eval.c: Make symbols static if they're not exported.
19173 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
19174 * lisp.h (backtrace_list): Remove decl.
19175
35f08c38
PE
19176 * emacs.c: Make symbols static if they're not exported.
19177 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
19178 (fatal_error_code, fatal_error_signal_hook, standard_args):
19179 Now static.
19180 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
19181 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
19182 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
19183 * lisp.h (fatal_error_signal_hook): Remove decl.
19184 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
19185
f44bd759
PE
19186 * editfns.c: Move a (normally-unused) function to its only use.
19187 * editfns.c, lisp.h (get_operating_system_release): Remove.
19188 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
19189 worth the hassle of breaking this out.
19190
b532497d
PE
19191 * xterm.c: Make symbols static if they're not exported.
19192 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
19193 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
19194 (x_destroy_window, x_delete_display):
19195 Now static.
19196 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
19197 (x_mouse_leave): Remove; unused.
19198 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
19199 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
19200 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
19201 Remove decls.
19202 (x_mouse_leave): Declare only if WINDOWSNT.
19203 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
19204 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
19205 USE_X_TOOLKIT.
19206
1675728f
PE
19207 * ftxfont.c: Make symbols static if they're not exported.
19208 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
19209 HAVE_FREETYPE.
19210 * font.h (ftxfont_driver): Likewise.
19211
e4cebfca
PE
19212 * xfns.c: Make symbols static if they're not exported.
19213 (x_last_font_name, x_display_info_for_name):
19214 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
19215 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
19216 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
19217 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
19218 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
19219 (last_show_tip_args): Now static.
19220 (xic_defaut_fontset, xic_create_fontsetname): Define only if
19221 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
19222 (x_screen_planes): Remove; unused.
19223 * dispextern.h (x_screen_planes): Remove decl.
19224
5bf46f05
PE
19225 * dispnew.c: Make symbols static if they're not exported.
19226 * dispextern.h (redraw_garbaged_frames, scrolling):
19227 (increment_row_positions): Remove.
19228 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
19229 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
19230 Now static.
19231 (redraw_garbaged_frames): Remove; unused.
19232
435f4c28
PE
19233 * xfaces.c: Make symbols static if they're not exported.
19234 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
19235 Remove decls.
19236 * xterm.h (defined_color): Remove decls.
19237 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
19238 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
19239 (menu_face_changed_default, defined_color, free_realized_face):
19240 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
19241 (ascii_face_of_lisp_face): Remove; unused.
19242
8524aef3
PE
19243 * xdisp.c: Make symbols static if they're not exported.
19244 * dispextern.h (scratch_glyph_row, window_box_edges):
19245 (glyph_to_pixel_coords, set_cursor_from_row):
19246 (get_next_display_element, set_iterator_to_next):
19247 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
19248 (show_mouse_face): Remove decls
19249 * frame.h (message_buf_print): Likewise.
19250 * lisp.h (pop_message, set_message, check_point_in_composition):
19251 Likewise.
19252 * xterm.h (set_vertical_scroll_bar): Likewise.
19253 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
19254 (message_buf_print, scratch_glyph_row, displayed_buffer):
19255 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
19256 (get_next_display_element, show_mouse_face, window_box_edges):
19257 (frame_to_window_pixel_xy, check_point_in_composition):
19258 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
19259 (glyph_to_pixel_coords): Remove; unused.
19260
16390cd2
PE
19261 * dired.c (file_name_completion): Now static.
19262
19263 * dbusbind.c (xd_in_read_queued_messages): Now static.
19264
a25f4dfa
PE
19265 * lisp.h (circular_list_error, FOREACH): Remove; unused.
19266 * data.c (circular_list_error): Remove.
19267
14a9c8df
PE
19268 * commands.h (last_point_position, last_point_position_buffer):
19269 (last_point_position_window): Remove decls.
19270 * keyboard.c: Make these variables static.
19271
04f2d78b
CB
19272 * coding.h (coding, code_convert_region, encode_coding_gap):
19273 Remove decls.
74ab6df5
PE
19274 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19275 (iso_code_class, detect_coding, code_convert_region): Now static.
19276 (encode_coding_gap): Remove; unused.
19277
38dfbee1
PE
19278 * chartab.c (chartab_chars, chartab_bits): Now static.
19279
a2cb4e63
PE
19280 * charset.h (charset_iso_8859_1): Remove decl.
19281 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19282 Now static.
19283
127198fd
PE
19284 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19285 * ccl.c (Vccl_program_table): Now static.
19286 (check_ccl_update): Remove; unused.
19287
d85b608f
PE
19288 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19289 * category.h: ... from here.
19290 * category.c (check_category_table, set_category_set): Now static.
19291
31cd66f3
PE
19292 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19293 * lisp.h: Remove these decls.
19294
c358e587
PE
19295 * buffer.c (buffer_count): Remove unused var.
19296
e78aecca
PE
19297 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19298 so that it's not optimized away.
19299 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19300 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19301 exported only to the debugger.
19302
e192d7d3 19303 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 19304 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 19305
92470028
PE
19306 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19307 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19308 was inaccessible from Lisp.
19309 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19310 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19311
244ed907
PE
19312 alloc.c: Import and export fewer symbols, and remove unused items.
19313 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19314 is defined.
19315 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19316 it's not optimized away by whole-program optimization.
19317 (message_enable_multibyte, free_misc): Remove.
19318 (catchlist, handlerlist, mark_backtrace):
19319 Declare only if BYTE_MARK_STACK.
19320 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19321 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19322 (message_enable_multibyte): Remove decl.
19323 (free_misc, interval_free_list, float_block, float_block_index):
19324 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19325 (cons_free_list, last_marked_index):
19326 Now static.
19327 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19328 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19329 (mark_backtrace): Define only if BYTE_MARK_STACK.
19330 * xdisp.c (message_enable_multibyte): Now static.
19331
61c2b50e 19332 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
19333 This makes it easier for human readers (and static analyzers)
19334 to see whether these variables are used from other modules.
19335 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19336 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19337 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19338 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19339 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19340 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19341 * xmenu.c, xselect.c:
19342 Declare Q* vars static if they are not used in other modules.
19343 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19344 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19345 Remove decls of unexported vars.
19346 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19347
95c82688
PE
19348 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19349
16a97296
PE
19350 Make Emacs functions such as Fatom 'static' by default.
19351 This makes it easier for human readers (and static analyzers)
19352 to see whether these functions can be called from other modules.
19353 DEFUN now defines a static function. To make the function external
19354 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
19355 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19356 (Finit_image_library):
16a97296
PE
19357 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19358 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19359 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19360 Remove decls, since these functions are now static.
19361 (Funintern, Fget_internal_run_time): New decls, since these functions
19362 were already external.
95c82688 19363
16a97296
PE
19364 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19365 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19366 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19367 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19368 * keyboard.c, keymap.c, lread.c:
19369 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19370 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19371 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19372 Mark functions with DEFUE instead of DEFUN,
19373 if they are used in other modules.
19374 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19375 decls for now-static functions.
19376 * buffer.h (Fdelete_overlay): Remove decl.
19377 * callproc.c (Fgetenv_internal): Mark as internal.
19378 * composite.c (Fremove_list_of_text_properties): Remove decl.
19379 (Fcomposition_get_gstring): New forward static decl.
19380 * composite.h (Fcomposite_get_gstring): Remove decl.
19381 * dired.c (Ffile_attributes): New forward static decl.
19382 * doc.c (Fdocumntation_property): New forward static decl.
19383 * eval.c (Ffetch_bytecode): New forward static decl.
19384 (Funintern): Remove extern decl; now in .h file where it belongs.
19385 * fileio.c (Fmake_symbolic_link): New forward static decl.
19386 * image.c (Finit_image_library): New forward static decl.
19387 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19388 * intervals.h (Fprevious_property_change):
19389 (Fremove_list_of_text_properties): Remove decls.
19390 * keyboard.c (Fthis_command_keys): Remove decl.
19391 (Fcommand_execute): New forward static decl.
19392 * keymap.c (Flookup_key): New forward static decl.
19393 (Fcopy_keymap): Now static.
19394 * keymap.h (Flookup_key): Remove decl.
19395 * process.c (Fget_process): New forward static decl.
19396 (Fprocess_datagram_address): Mark as internal.
19397 * syntax.c (Fsyntax_table_p): New forward static decl.
19398 (skip_chars): Remove duplicate decl.
19399 * textprop.c (Fprevious_property_change): New forward static decl.
19400 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19401 Now internal.
19402 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19403 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19404
785bbd42
PE
19405 * editfns.c (Fformat): Remove unreachable code.
19406
8b913b57
AS
194072011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19408
19409 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19410 change. (Bug#8496)
19411
a6744a35
EZ
194122011-04-13 Eli Zaretskii <eliz@gnu.org>
19413
19414 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19415 when at ZV. (Bug#8487)
19416
e7974947
AS
194172011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19418
baad03f0
AS
19419 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19420 (Bug#8437)
19421 * keyboard.c (parse_tool_bar_item): Likewise.
19422 * sound.c (sound_cleanup, alsa_close): Likewise.
19423 * termcap.c (tgetent): Likewise.
19424 * xfns.c (x_default_font_parameter): Likewise.
19425 * xsettings.c (read_and_apply_settings): Likewise.
19426
e7974947
AS
19427 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19428 (overrun_check_free): Protoize.
19429
28272684
PE
194302011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19431
19432 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19433 since callers should never pass a negative size.
19434 Change the signature to match that of plain 'read' and 'write'; see
19435 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19436 * lisp.h: Update prototypes of emacs_write and emacs_read.
19437
11997c76
EZ
194382011-04-11 Eli Zaretskii <eliz@gnu.org>
19439
19440 * xdisp.c (redisplay_window): Don't try to determine the character
19441 position of the scroll margin if the window start point w->startp
e896f03c 19442 is outside the buffer's accessible region. (Bug#8468)
11997c76 19443
8a2cbd72
EZ
194442011-04-10 Eli Zaretskii <eliz@gnu.org>
19445
19446 Fix write-region and its subroutines for buffers > 2GB.
19447 * fileio.c (a_write, e_write): Modify declaration of arguments and
19448 local variables to support buffers larger than 2GB.
19449 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19450
19451 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19452 argument, local variables, and return value.
19453
19454 * lisp.h: Update prototypes of emacs_write and emacs_read.
19455
19456 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19457
4073e537 194582011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 19459
1ebfdcb6
PE
19460 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19461
b2ded58d
PE
19462 Fix more problems found by GCC 4.6.0's static checks.
19463
7d66342c
PE
19464 * xdisp.c (vmessage): Use a better test for character truncation.
19465
bbf47d44
PE
19466 * charset.c (load_charset_map): <, not <=, for optimization,
19467 and to avoid potential problems with integer overflow.
9248994d 19468 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 19469 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 19470 * editfns.c (Fformat): Likewise.
1e69125e 19471 * syntax.c (skip_chars): Likewise.
3befa583 19472
e3019616
PE
19473 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19474 This also lets GCC 4.6.0 generate slightly better loop code.
19475
becfa255
PE
19476 * callint.c (Fcall_interactively): <, not <=, for optimization.
19477 (Fcall_interactively): Count the number of arguments produced,
19478 not the number of arguments given. This is simpler and lets GCC
19479 4.6.0 generate slightly better code.
19480
dae0cd48
PE
19481 * ftfont.c: Distingish more carefully between FcChar8 and char.
19482 The previous code passed unsigned char * to a functions like
19483 strlen and xstrcasecmp that expect char *, which does not
19484 conform to the C standard.
19485 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19486 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19487 char * when the C standard requires it.
19488
76032d70
PE
19489 * keyboard.c (read_char): Remove unused var.
19490
eb3f1cc8
PE
19491 * eval.c: Port to Windows vsnprintf (Bug#8435).
19492 Include <limits.h>.
19493 (SIZE_MAX): Define if the headers do not.
19494 (verror): Do not give up if vsnprintf returns a negative count.
19495 Instead, grow the buffer. This ports to Windows vsnprintf, which
19496 does not conform to C99. Problem reported by Eli Zaretskii.
19497 Also, simplify the allocation scheme, by avoiding the need for
19498 calling realloc, and removing the ALLOCATED variable.
19499
70476b54
PE
19500 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19501
12020a9e
PE
19502 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19503 But keep the doprint source code for now, as we might revamp it
19504 and use it again (Bug#8435).
ea6c7ae6
PE
19505 * lisp.h (doprnt): Remove.
19506 * Makefile.in (base_obj): Remove doprnt.o.
19507 * deps.mk (doprnt.o): Remove.
19508
5fdb398c
PE
19509 error: Print 32- and 64-bit integers portably (Bug#8435).
19510 Without this change, on typical 64-bit hosts error ("...%d...", N)
19511 was used to print both 32- and 64-bit integers N, which relied on
19512 undefined behavior.
61bdb816 19513 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
19514 * lisp.h (error, verror): Mark as printf-like functions.
19515 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19516 Report overflow in size calculations when allocating printf buffer.
19517 Do not truncate output string at its first null byte.
19518 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19519 Truncate the output at a character boundary, since vsnprintf does not
19520 do that.
19521 * charset.c (check_iso_charset_parameter): Convert internal
19522 character to string before calling 'error', since %c now has the
19523 printf meaning.
19524 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19525 overflow when computing char to be passed to 'error'. Do not
19526 pass Lisp_Object to 'error'; pass the integer instead.
19527 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19528 formatted with plain %d.
19529
b189fa66
PE
19530 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19531
bff87ef0
PE
19532 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19533
7e2cac20
PE
19534 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19535
ce4d90b5
PE
19536 * xterm.c (x_catch_errors): Remove duplicate declaration.
19537
266c9547
PE
19538 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19539
79c49ad2
PE
19540 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19541
368f4090
JM
195422011-04-10 Jim Meyering <meyering@redhat.com>
19543
19544 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19545 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19546 return ssize_t not "int", and use size_t as the buffer length.
19547 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19548 * gnutls.h: Update declarations.
19549 * process.c (read_process_output): Use ssize_t, to match.
19550 (send_process): Likewise.
19551
a32d4040
CY
195522011-04-09 Chong Yidong <cyd@stupidchicken.com>
19553
19554 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19555
8546720e 195562011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 19557
04f2d78b
CB
19558 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19559 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 19560
8546720e
GM
19561 * xterm.c (handle_one_xevent):
19562 * xmenu.c (create_and_show_popup_menu):
19563 * xselect.c (x_decline_selection_request)
19564 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 19565
0a2f5c1a 195662011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
19567
19568 Fix some uses of `int' instead of EMACS_INT.
19569 * search.c (string_match_1, fast_string_match)
19570 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19571 (scan_buffer, find_next_newline_no_quit)
19572 (find_before_next_newline, search_command, Freplace_match)
19573 (Fmatch_data): Make some `int' variables be EMACS_INT.
19574
19575 * xdisp.c (display_count_lines): 3rd argument and return value now
19576 EMACS_INT. All callers changed.
19577 (pint2hrstr): Last argument is now EMACS_INT.
19578
19579 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19580 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19581 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19582 (decode_coding_utf_16, decode_coding_emacs_mule)
19583 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19584 (decode_coding_ccl, decode_coding_charset)
19585 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19586 (decode_coding_iso_2022, decode_coding_emacs_mule)
19587 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19588 <char_offset, last_offset>: Declare EMACS_INT.
19589 (encode_coding_utf_8, encode_coding_utf_16)
19590 (encode_coding_emacs_mule, encode_invocation_designation)
19591 (encode_designation_at_bol, encode_coding_iso_2022)
19592 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19593 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19594 Declare EMACS_INT.
19595 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19596 (encode_invocation_designation): Last argument P_NCHARS is now
19597 EMACS_INT.
19598 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19599 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19600
19601 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19602 All users changed.
19603
19604 * ccl.c (Fccl_execute_on_string): Declare some variables
19605 EMACS_INT.
19606
8546720e 196072011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
19608
19609 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19610
4e19a977
CS
196112011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19612
19613 * process.c (Fformat_network_address): Doc fix.
19614
87302331
R
196152011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19616
ee7683eb 19617 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 19618
cbb59342
CY
196192011-04-08 Chong Yidong <cyd@stupidchicken.com>
19620
19621 * keyboard.c (read_char): Call Lisp function help-form-show,
19622 instead of using internal_with_output_to_temp_buffer.
19623 (Qhelp_form_show): New var.
e0d38eeb 19624 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
19625
19626 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19627
19628 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19629
e67a13ab
CY
196302011-04-06 Chong Yidong <cyd@stupidchicken.com>
19631
04f2d78b
CB
19632 * process.c (Flist_processes): Remove to Lisp.
19633 (list_processes_1): Delete.
e67a13ab 19634
973f782d
EZ
196352011-04-06 Eli Zaretskii <eliz@gnu.org>
19636
7c106b1e
EZ
19637 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19638
973f782d
EZ
19639 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19640
41cf7d1a 196412011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 19642
ca23cc88
PE
19643 Fix more problems found by GCC 4.6.0's static checks.
19644
f390e2d5
PE
19645 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19646
42eea0d0
PE
19647 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19648
b69769da 19649 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 19650
f9541e84
PE
19651 * xdisp.c (vmessage): Mark as a printf-like function.
19652
13841b55
PE
19653 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19654
c136c10f
PE
19655 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19656
5e2d4a30
PE
19657 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19658 printf-like functions.
19659 (tiff_load): Add casts to remove these marks before passing them
19660 to system-supplied API.
19661
583f48b9
PE
19662 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19663
b25d760e
PE
19664 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19665 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
19666 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19667 directly, rather than having caller test rule sign. This avoids
19668 some unnecessary tests.
19669 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19670 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19671 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 19672
bc7b6697 19673 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 19674 (xfont_open): Avoid unnecessary tests.
bc7b6697 19675
27ccc379
PE
19676 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19677
dcd5c89a
PE
19678 * composite.h, composite.c (composition_gstring_put_cache):
19679 Use EMACS_INT, not int, for length.
19680
b13a45c6
PE
19681 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19682 breaking out part of COMPOSITION_DECODE_RULE.
19683 (COMPOSITION_DECODE_RULE): Use it.
19684 * composite.c (get_composition_id): Remove unused local vars,
19685 by using the new macro.
19686
1e792e4d
PE
19687 * textprop.c (set_text_properties_1): Change while to do-while,
19688 since the condition is always true at first.
19689
dc6c6455 19690 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
19691 (interval_deletion_adjustment): Return unsigned value.
19692 All uses changed.
dc6c6455 19693
aba7731a
PE
19694 * process.c (list_processes_1, create_pty, read_process_output):
19695 (exec_sentinel): Remove vars that were set but not used.
afd4052b 19696 (create_pty): Remove unnecessary "volatile"s.
bc57d757 19697 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 19698 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 19699 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 19700
fdfc4bf3
PE
19701 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19702
fca8fe46 19703 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 19704 (update_syntax_table): Use unsigned instead of int.
fca8fe46 19705
06a0259a 19706 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 19707 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 19708 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 19709
e7b9e80f
PE
19710 * print.c (print_error_message): Avoid int overflow.
19711
56201685
PE
19712 * font.c (font_list_entities): Redo for clarity,
19713 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19714
78834453 19715 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 19716 (font_score): Avoid potential overflow in diff calculation.
78834453 19717
0bc0b309 19718 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 19719 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 19720
e610eaca
PE
19721 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19722
b895abce
PE
19723 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19724 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19725 can always succeed if overflow has undefined behavior.
19726
1f1d9321 19727 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 19728 (wordify): Omit three unnecessary tests.
1f1d9321 19729
c59478bc
PE
19730 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19731 All callers changed. This avoids the need for an unused var.
19732
79b73827
PE
19733 * casefiddle.c (casify_region): Remove var that is set but not used.
19734
a4db5dfe
PE
19735 * dired.c (file_name_completion): Remove var that is set but not used.
19736
43aae36e
PE
19737 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19738
2a47c44d 19739 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 19740 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 19741
a37c69bf
PE
19742 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19743 Check for integer overflow on size calculations.
19744
328ab8e7
PE
19745 * buffer.c (Fprevious_overlay_change): Remove var that is set
19746 but not used.
19747
e5a2a5cb
PE
19748 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19749 Remove vars that are set but not used.
8d84a6eb 19750 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 19751 (timer_check_2): Mark vars as initialized.
e5a2a5cb 19752
a60e5f68
PE
19753 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19754
f661cb61 19755 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 19756 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 19757
f0397f5a
PE
19758 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19759 that are set but not used.
19760
8664db06 19761 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 19762 if XCreateBitmapFromData fails (Bug#8410).
8664db06 19763
6abdaa4a
PE
19764 * xselect.c (x_get_local_selection, x_handle_property_notify):
19765 Remove vars that are set but not used.
19766
0ce7538d 19767 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 19768 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 19769
9ae848fc
PE
19770 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19771 Remove var that is set but not used.
0b918413
PE
19772 (scroll_bar_windows_size): Now size_t, not int.
19773 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19774 Check for overflow.
9ae848fc 19775
a5a62657
PE
19776 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19777 (map_tty_color) [!defined MSDOS]: Likewise.
19778
5c5cdd39
PE
19779 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19780
66ebf983
PE
19781 * coding.c: Remove vars that are set but not used.
19782 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19783 All callers changed.
19784 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19785 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19786 (decode_coding_charset): Remove vars that are set but not used.
19787
1be4d761
PE
19788 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19789 that is set but not used.
19790
47553fa8
PE
19791 * print.c (print_object): Remove var that is set but not used.
19792
1f7196bf 19793 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
19794 The gnulib version avoids calling malloc in the usual case,
19795 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19796 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19797 * filelock.c (current_lock_owner): Likewise.
19798 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19799 * sysdep.c: Include allocator.h, careadlinkat.h.
19800 (emacs_no_realloc_allocator): New static constant.
19801 (emacs_readlink): New function.
fdb61804
PE
19802 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19803 ../lib/careadlinkat.h.
d1fdcab7 19804
f84c17c7
SM
198052011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19806
19807 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19808 first non-nil return value).
19809
ef3862ad
JD
198102011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19811
19812 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19813 if not defined (Bug#8403).
19814
376a7006
JB
198152011-04-02 Juanma Barranquero <lekktu@gmail.com>
19816
19817 * xdisp.c (display_count_lines): Remove parameter `start',
19818 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19819 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19820 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19821 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19822 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19823 and thereabouts. All callers changed.
19824 (get_per_char_metric): Remove parameter `f', unused since
19825 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19826
6ca3801d
JM
198272011-04-02 Jim Meyering <meyering@redhat.com>
19828
19829 do not dereference NULL upon failed strdup
19830 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19831 (ns_get_family): Likewise.
19832
d8e2b5ba
JB
198332011-04-02 Juanma Barranquero <lekktu@gmail.com>
19834
19835 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19836
8c74fcbd
JD
198372011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19838
19839 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19840 later (Bug#8403).
19841
7200d79c
SM
198422011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19843
03408648 19844 Add lexical binding.
7200d79c 19845
03408648
SM
19846 * window.c (Ftemp_output_buffer_show): New fun.
19847 (Fsave_window_excursion):
19848 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19849
19850 * lread.c (lisp_file_lexically_bound_p): New function.
19851 (Fload): Bind Qlexical_binding.
19852 (readevalloop): Remove `evalfun' arg.
19853 Bind Qinternal_interpreter_environment.
19854 (Feval_buffer): Bind Qlexical_binding.
19855 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19856 Mark as dynamic.
19857 (syms_of_lread): Declare `lexical-binding'.
19858
19859 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19860
19861 * keyboard.c (eval_dyn): New fun.
19862 (menu_item_eval_property): Use it.
ca105506
SM
19863
19864 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 19865
03408648
SM
19866 * fns.c (concat, mapcar1): Accept byte-code-functions.
19867
19868 * eval.c (Fsetq): Handle lexical vars.
19869 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19870 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19871 (FletX, Flet): Obey lexical binding.
19872 (Fcommandp): Handle closures.
19873 (Feval): New `lexical' arg.
19874 (eval_sub): New function extracted from Feval. Use it almost
19875 everywhere where Feval was used. Look up vars in lexical env.
19876 Handle closures.
19877 (Ffunctionp): Move from subr.el.
19878 (Ffuncall): Handle closures.
19879 (apply_lambda): Remove `eval_flags'.
19880 (funcall_lambda): Handle closures and new byte-code-functions.
19881 (Fspecial_variable_p): New function.
19882 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19883 but without exporting it to Lisp.
23aba0ea 19884
23aba0ea 19885 * doc.c (Fdocumentation, store_function_docstring):
03408648 19886 * data.c (Finteractive_form): Handle closures.
23aba0ea 19887
03408648
SM
19888 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19889 interactive spec.
ba83908c 19890
04f2d78b
CB
19891 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19892 New byte-codes.
03408648
SM
19893 (exec_byte_code): New function extracted from Fbyte_code to handle new
19894 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 19895
03408648 19896 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 19897
03408648 19898 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 19899
e2abce01
JB
199002011-03-31 Juanma Barranquero <lekktu@gmail.com>
19901
19902 * xdisp.c (redisplay_internal): Fix prototype.
19903
63696a73 199042011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 19905
63696a73 19906 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
19907 (try_scrolling): Use it when setting scroll_limit.
19908 Limit scrolling to 100 screen lines.
63696a73
EZ
19909 (redisplay_window): Even when falling back on "recentering",
19910 position point in the window according to scroll-conservatively,
19911 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19912
19913 (try_scrolling): When point is above the window, allow searching
19914 as far as scroll_max, or one screenful, to compute vertical
19915 distance from PT to the scroll margin position. This prevents
19916 try_scrolling from unnecessarily failing when
19917 scroll-conservatively is set to a value slightly larger than the
19918 window height. Clean up the case of PT below the margin at bottom
19919 of window: scroll_max can no longer be INT_MAX. When aggressive
19920 scrolling is in use, don't let point enter the opposite scroll
19921 margin as result of the scroll.
19922 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
19923 threshold of 100 lines for never-recentering scrolling.
19924
e4cc2dfc
JB
199252011-03-31 Juanma Barranquero <lekktu@gmail.com>
19926
19927 * dispextern.h (move_it_by_lines):
19928 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19929 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19930 (message_log_check_duplicate): Remove parameters `prev_bol' and
19931 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19932 (redisplay_internal): Remove parameter `preserve_echo_area',
19933 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19934
19935 * indent.c (Fvertical_motion):
19936 * window.c (window_scroll_pixel_based, Frecenter):
19937 Don't pass `need_y_p' to `move_it_by_lines'.
19938
1c470562
SM
199392011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19940
44f230aa
SM
19941 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19942 steal a few bits to be more compact.
19943 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19944 Remove unneeded casts.
19945
1c470562
SM
19946 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19947
888adce9
ZK
199482011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19949
19950 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19951 binding" message (bug#7967).
19952
f838ed7b
PE
199532011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19954
77861b95
PE
19955 Fix more problems found by GCC 4.6.0's static checks.
19956
de6dbc14
PE
19957 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19958 Remove unused local var.
19959
f838ed7b
PE
19960 * editfns.c (Fmessage_box): Remove unused local var.
19961
792c7b2b
PE
19962 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19963 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19964 Omit unused local vars.
c499e557 19965 * window.c (shrink_windows): Omit unused local var.
b01a1c29 19966 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
19967 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19968 Omit unused local var.
19969
ba0165e1
PE
19970 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19971 Don't assume string length fits in int.
32ad8845 19972 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 19973 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 19974
3c59b4c9
PE
19975 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19976 instead of alloca (Bug#8344).
19977
a3eed478 19978 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 19979 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 19980
eb4d412d
PE
19981 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19982
1658b401
PE
19983 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19984 concerns.
19985
19986 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19987
19988 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 19989
9a2c6e05
PE
19990 * keyboard.c (syms_of_keyboard): Use the same style as later
19991 in this function when indexing through an array. This also
19992 works around GCC bug 48267.
19993
03d0a109
PE
19994 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19995
44f730c8
PE
19996 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19997
fe75f926
PE
19998 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19999 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
20000
ffa8c828
PE
20001 * keyboard.c, keyboard.h (num_input_events): Now size_t.
20002 This avoids undefined behavior on integer overflow, and is a bit
20003 more convenient anyway since it is compared to a size_t variable.
20004
c5101a77
PE
20005 Variadic C functions now count arguments with size_t, not int.
20006 This avoids an unnecessary limitation on 64-bit machines, which
20007 caused (substring ...) to crash on large vectors (Bug#8344).
20008 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
20009 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 20010 All variadic functions and their callers changed accordingly.
c5101a77
PE
20011 (struct gcpro.nvars): Now size_t, not int. All uses changed.
20012 * data.c (arith_driver, float_arith_driver): Likewise.
20013 * editfns.c (general_insert_function): Likewise.
20014 * eval.c (struct backtrace.nargs, interactive_p)
20015 (internal_condition_case_n, run_hook_with_args, apply_lambda)
20016 (funcall_lambda, mark_backtrace): Likewise.
20017 * fns.c (concat): Likewise.
20018 * frame.c (x_set_frame_parameters): Likewise.
20019 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
20020 0 if not found, not -1. All callers changed.
20021
dd3f25f7
PE
20022 * alloc.c (garbage_collect): Don't assume stack size fits in int.
20023 (stack_copy_size): Now size_t, not int.
20024 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
20025
461c2ab9
JB
200262011-03-28 Juanma Barranquero <lekktu@gmail.com>
20027
20028 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
20029 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20030 All callers changed.
20031
20032 * lisp.h (multibyte_char_to_unibyte):
20033 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
20034 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
20035 * character.h (CHAR_TO_BYTE8):
20036 * cmds.c (internal_self_insert):
20037 * editfns.c (general_insert_function):
20038 * keymap.c (push_key_description):
20039 * search.c (Freplace_match):
20040 * xdisp.c (message_dolog, set_message_1): All callers changed.
20041
f6d62986
SM
200422011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
20043
20044 * keyboard.c (safe_run_hook_funcall): New function.
20045 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
20046 don't set the hook to nil, but remove the offending function instead.
20047 (Qcommand_hook_internal): Remove, unused.
20048 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
20049 Vcommand_hook_internal.
20050
20051 * eval.c (enum run_hooks_condition): Remove.
20052 (funcall_nil, funcall_not): New functions.
20053 (run_hook_with_args): Call each function through a `funcall' argument.
20054 Remove `cond' argument, now redundant.
20055 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
20056 (Frun_hook_with_args_until_failure): Adjust accordingly.
20057 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
20058
1db5b1ad
JB
200592011-03-28 Juanma Barranquero <lekktu@gmail.com>
20060
20061 * dispextern.h (string_buffer_position): Remove declaration.
20062
20063 * print.c (strout): Remove parameter `multibyte', unused since
20064 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
20065
20066 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
20067 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
20068 All callers changed.
20069
20070 * w32.c (_wsa_errlist): Use braces for struct initializers.
20071
20072 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
20073 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
20074 All callers changed.
20075 (string_buffer_position): Likewise. Also, make static (it's never
20076 used outside xdisp.c).
20077 (cursor_row_p): Remove parameter `w', unused since
20078 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
20079 (decode_mode_spec): Remove parameter `precision', introduced during
20080 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
20081 All callers changed.
20082
5ffb62aa
JD
200832011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20084
20085 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
20086
461c2ab9 200872011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
20088
20089 * nsterm.m (ns_menu_bar_is_hidden): New variable.
20090 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
20091 (ns_update_auto_hide_menu_bar): New functions.
20092 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
20093 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
20094 ns_constrain_all_frames.
20095 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
20096 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
20097
5c380ffb
JD
200982011-03-27 Jan Djärv <jan.h.d@swipnet.se>
20099
20100 * nsmenu.m (runDialogAt): Remove argument to timer_check.
20101
9af30bdf
GM
201022011-03-27 Glenn Morris <rgm@gnu.org>
20103
20104 * syssignal.h: Replace RETSIGTYPE with void.
20105 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
20106 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
20107 Replace SIGTYPE with void everywhere.
20108 * s/usg5-4-common.h (SIGTYPE): Remove definition.
20109 * s/template.h (SIGTYPE): Remove commented out definition.
20110
e2abce01
JB
201112011-03-26 Eli Zaretskii <eliz@gnu.org>
20112
20113 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
20114 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
20115
f868cd8a
JB
201162011-03-26 Juanma Barranquero <lekktu@gmail.com>
20117
59eb0929
JB
20118 * w32.c (read_unc_volume): Use parameter `henum', instead of
20119 global variable `wget_enum_handle'.
20120
20121 * keymap.c (describe_vector): Remove parameters `indices' and
20122 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
20123 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
20124
f868cd8a
JB
20125 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
20126
20127 * keyboard.c (timer_check): Remove parameter `do_it_now',
20128 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
20129 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
20130 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
20131
20132 * keyboard.c (read_char):
20133 * w32menu.c (w32_menu_display_help):
20134 * xmenu.c (show_help_event, menu_help_callback):
20135 Adjust calls to `show_help_echo'.
20136
20137 * gtkutil.c (xg_maybe_add_timer):
20138 * keyboard.c (readable_events):
20139 * process.c (wait_reading_process_output):
20140 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
20141
20142 * insdel.c (adjust_markers_gap_motion):
20143 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
20144 (gap_left, gap_right): Don't call it.
20145
2ecf6fdb
CY
201462011-03-25 Chong Yidong <cyd@stupidchicken.com>
20147
20148 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
20149 incurred during fontification.
20150
6b1f9ba4
JB
201512011-03-25 Juanma Barranquero <lekktu@gmail.com>
20152
20153 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
20154 (DEFVAR_PER_BUFFER): Don't pass it.
20155
20156 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
20157 (scrolling_window): Don't pass it.
20158
0f4a96b5
JB
201592011-03-25 Juanma Barranquero <lekktu@gmail.com>
20160
20161 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
20162
20163 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
20164 and `suffix'.
20165 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
20166 of variables specific to SELinux and computation of `encoded_absname'.
20167
20168 * image.c (XPutPixel): Remove unused variable `height'.
20169
20170 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
20171
20172 * unexw32.c (get_section_info): Remove unused variable `section'.
20173
20174 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
20175 (system_process_attributes): Remove unused variable `sess'.
20176 (sys_read): Remove unused variable `err'.
20177
20178 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
20179 (w32_wnd_proc): Remove unused variable `isdead'.
20180 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
20181 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
20182 (x_create_tip_frame): Remove unused variable `tem'.
20183
20184 * w32inevt.c (w32_console_read_socket):
20185 Remove unused variable `no_events'.
20186
20187 * w32term.c (x_draw_composite_glyph_string_foreground):
20188 Remove unused variable `width'.
20189
1149507c
JB
201902011-03-24 Juanma Barranquero <lekktu@gmail.com>
20191
20192 * w32term.c (x_set_glyph_string_clipping):
20193 Don't pass uninitialized region to CombineRgn.
20194
9c88f339
JB
201952011-03-23 Juanma Barranquero <lekktu@gmail.com>
20196
20197 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
20198 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
20199 (Fx_close_connection): Remove unused variable `i'.
20200
20201 * w32font.c (w32font_draw): Return number of glyphs.
20202 (w32font_open_internal): Remove unused variable `i'.
20203 (w32font_driver): Add missing initializer.
20204
20205 * w32menu.c (utf8to16): Remove unused variable `utf16'.
20206 (fill_in_menu): Remove unused variable `items_added'.
20207
20208 * w32term.c (last_mouse_press_frame): Remove static global variable.
20209 (w32_clip_to_row): Remove unused variable `f'.
20210 (x_delete_terminal): Remove unused variable `i'.
20211
20212 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
20213 (NOTHING): Remove unused static global variable.
20214 (uniscribe_check_otf): Remove unused variable `table'.
20215 (uniscribe_font_driver): Add missing initializers.
20216
dee091a3
JD
202172011-03-23 Julien Danjou <julien@danjou.info>
20218
20219 * term.c (Fsuspend_tty, Fresume_tty):
20220 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
20221 * window.c (temp_output_buffer_show):
20222 * insdel.c (signal_before_change):
20223 * frame.c (Fhandle_switch_frame):
20224 * fileio.c (Fdo_auto_save):
20225 * emacs.c (Fkill_emacs):
20226 * editfns.c (save_excursion_restore):
20227 * cmds.c (internal_self_insert):
20228 * callint.c (Fcall_interactively):
20229 * buffer.c (Fkill_all_local_variables):
20230 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
20231 Use Frun_hooks.
0f4a96b5 20232 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 20233 unconditionally since it does the check itself.
dee091a3 20234
2c520ab5 202352011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 20236
c9c49752
PE
20237 Fix more problems found by GCC 4.5.2's static checks.
20238
8abc3f12
PE
20239 * coding.c (encode_coding_raw_text): Avoid unnecessary test
20240 the first time through the loop, since we know p0 < p1 then.
20241 This also avoids a gcc -Wstrict-overflow warning.
20242
a2d26660
PE
20243 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
20244 leading to a memory leak, possible in functions like
20245 load_charset_map_from_file that can allocate an unbounded number
b12ef411 20246 of objects (Bug#8318).
a2d26660 20247
916c72e9
PE
20248 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
20249 that could (at least in theory) be that large.
20250
19ab8a18
PE
20251 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
20252 This is less likely to overflow, and avoids undefined behavior if
20253 overflow does occur. All callers changed. Use strtoul to scan
20254 for the unsigned long integer.
b7cbbd6f
PE
20255 (pint2hrstr): Simplify and tune code slightly.
20256 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 20257
f0641eff
PE
20258 * scroll.c (do_scrolling): Work around GCC bug 48228.
20259 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
20260
7f650bb9
PE
20261 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
20262 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
20263 (validate_x_resource_name): Simplify count usage.
20264 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 20265
37dd57d1
PE
20266 * fileio.c (Fcopy_file): Report error if fchown or fchmod
20267 fail (Bug#8306).
81e56e61 20268
699979fc 20269 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 20270
401bf9b4
PE
20271 * process.c (Fmake_network_process): Use socklen_t, not int,
20272 where POSIX says socklen_t is required in portable programs.
20273 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 20274 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
20275 (Fmake_network_process, server_accept_connection):
20276 (wait_reading_process_output, read_process_output):
20277 Likewise.
20278
b93aacde
PE
20279 * process.c: Rename or move locals to avoid shadowing.
20280 (list_processes_1, Fmake_network_process):
20281 (read_process_output_error_handler, exec_sentinel_error_handler):
20282 Rename or move locals.
4dc343ee 20283 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 20284 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 20285 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 20286 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 20287 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 20288
af8a867c 20289 Make tparam.h and terminfo.c consistent.
44f230aa
SM
20290 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20291 Include tparam.h instead, since it declares them.
af8a867c
PE
20292 * cm.h (PC): Remove extern decl; tparam.h now does this.
20293 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20294 * terminfo.c: Include tparam.h, to check interfaces.
20295 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20296 (tparam): Adjust signature to match interface in tparam.h;
20297 this removes some undefined behavior. Check that outstring and len
20298 are zero, which they always are with Emacs.
20299 * tparam.h (PC, BC, UP): New extern decls.
20300
0248044d 20301 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 20302 (xftfont_open): Rename locals to avoid shadowing.
0248044d 20303
8ff096c1 20304 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
20305 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20306 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 20307 (ftfont_list): Remove unused local.
49eaafba
PE
20308 (get_adstyle_property, ftfont_pattern_entity):
20309 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20310 Rename locals to avoid shadowing.
8ff096c1 20311
e2be39f6
PE
20312 * xfont.c (xfont_list_family): Mark var as initialized.
20313
c9735e30
PE
20314 * xml.c (make_dom): Now static.
20315
8f5201ae
PE
20316 * composite.c (composition_compute_stop_pos): Rename local to
20317 avoid shadowing.
b246f932
PE
20318 (composition_reseat_it): Remove unused locals.
20319 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 20320 (composition_update_it): Mark var as initialized.
11b61122
PE
20321 (find_automatic_composition): Mark vars as initialized,
20322 with a FIXME (Bug#8290).
8f5201ae 20323
760fbc2c
PE
20324 character.h: Rename locals to avoid shadowing.
20325 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20326 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20327 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20328 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20329 to avoid shadowing.
20330
ff08eb85
PE
20331 * textprop.c (property_change_between_p): Remove; unused.
20332
fc7bf025
PE
20333 * intervals.c (interval_start_pos): Now static.
20334
235d7abc
PE
20335 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20336
44f230aa
SM
20337 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20338 Rename locals to avoid shadowing.
3e7d6594 20339
50060332
PE
20340 * sound.c (wav_play, au_play, Fplay_sound_internal):
20341 Fix pointer signedness.
d01f234b 20342 (alsa_choose_format): Remove unused local var.
c83b8872
PE
20343 (wav_play): Initialize a variable to 0, to prevent undefined
20344 behavior (Bug#8278).
50060332 20345
c4fc4e30
PE
20346 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20347
918436ed
PE
20348 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20349
c939f91b
PE
20350 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20351 clobbering (Bug#8298).
b9c7f648
PE
20352 * sysdep.c (sys_subshell): Likewise.
20353 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 20354
6bd8c144
PE
20355 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20356 This should get cleaned up, so that child_setup has the
20357 same signature on all platforms.
20358
7710357c 20359 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 20360 (relocate_fd): Rename locals to avoid shadowing.
7710357c 20361
c59da222
CY
203622011-03-22 Chong Yidong <cyd@stupidchicken.com>
20363
20364 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20365 not to be necessary, and produces flickering.
20366
66b87493
GM
203672011-03-20 Glenn Morris <rgm@gnu.org>
20368
20369 * config.in: Remove file.
20370
45b6f6d5
JB
203712011-03-20 Juanma Barranquero <lekktu@gmail.com>
20372
20373 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20374 are now in src/globals.h.
20375 (syms_of_minibuf): Remove spurious & from previous change.
20376
cd394be1 203772011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
20378
20379 * minibuf.c (completing-read-function): New variable.
20380 (completing-read-default): Rename from completing-read.
20381 (completing-read): Call completing-read-function.
20382
b14e3e21
CY
203832011-03-19 Juanma Barranquero <lekktu@gmail.com>
20384
20385 * xfaces.c (Fx_load_color_file):
20386 Read color file from absolute filename (bug#8250).
20387
f2b726e6
JB
203882011-03-19 Juanma Barranquero <lekktu@gmail.com>
20389
20390 * makefile.w32-in: Update dependencies.
20391
09f6ff02
EZ
203922011-03-17 Eli Zaretskii <eliz@gnu.org>
20393
20394 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20395
29a6015a
PE
203962011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20397
a3a6c54e
PE
20398 Fix more problems found by GCC 4.5.2's static checks.
20399
b766f867
PE
20400 * process.c (make_serial_process_unwind, send_process_trap):
20401 (sigchld_handler): Now static.
20402
be02381c
PE
20403 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20404 That way, the code declares only the vars that it needs.
20405 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20406 * s/cygwin.h (PTY_ITERATION): Likewise.
20407 * s/darwin.h (PTY_ITERATION): Likewise.
20408 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20409
57048744
PE
20410 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20411 * process.c (allocate_pty): Don't declare stb unless it's needed.
20412
7914961c 20413 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
20414 (CONSTANTLIM): Remove; unused.
20415 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20416 Define only if needed.
7914961c 20417
b3967b18
PE
20418 * unexelf.c (unexec): Name an expression,
20419 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
20420 Use a different way to cause a compilation error if anyone uses
20421 n rather than nn, a way that does not involve shadowing.
73366a00 20422 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 20423
29a6015a
PE
20424 * deps.mk (unexalpha.o): Remove; unused.
20425
43cfc33e 20426 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 20427 * unexec.h: New file.
ce701a33
PE
20428 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20429 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20430 Depend on unexec.h.
20431 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20432 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20433 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 20434 Change as necessary to match prototype in unexec.h.
ce701a33 20435
01f44d5a
PE
20436 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20437 shadowing.
4f63c6bb 20438 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 20439
a6670b0b
PE
20440 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20441 Rename locals to avoid shadowing.
20442
cef2010d 20443 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 20444 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 20445
d4d7173a
PE
20446 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20447
f08b802a
PE
20448 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20449 warning when compiling print.c.
20450
3ddb0639
PE
20451 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20452 instead of using an uninitialized var.
5ad03b97 20453 (font_sort_entities): Mark var as initialized.
3ddb0639 20454
170a2692
PE
20455 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20456
e663c700
PE
20457 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20458 pointers to constants.
89bc529a 20459 (font_parse_fcname): Remove unused vars.
7b81e2d0 20460 (font_delete_unmatched): Now static.
ea838e10 20461 (font_get_spec): Remove; unused.
13a547c6
PE
20462 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20463 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20464 Rename or move locals to avoid shadowing.
e663c700 20465
2a80c887 20466 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 20467 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 20468
1384fa33 20469 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 20470 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 20471
8b2c52e9
PE
20472 * alloc.c (mark_backtrace): Move decl from here ...
20473 * lisp.h: ... to here, so that it can be checked.
20474
475545b5 20475 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 20476 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
20477 (lisp_indirect_variable): Name an expression,
20478 to avoid gcc -Wbad-function-cast warning.
1faed8ae 20479 (Fdefvar): Rename locals to avoid shadowing.
475545b5 20480
b1349114 20481 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 20482 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 20483 Use const pointer when appropriate.
b1349114 20484
a2928364
PE
20485 * lisp.h (get_system_name, get_operating_system_release):
20486 Move decls here, to check interfaces.
20487 * process.c (get_operating_system_release): Move decl to lisp.h.
20488 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
20489 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20490 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20491 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
20492 (Fformat_time_string, Fencode_time, Finsert_char):
20493 (Ftranslate_region_internal, Fformat):
20494 Rename or remove local vars to avoid shadowing.
9710023e 20495 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 20496
a415e694
PE
20497 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20498 avoid shadowing.
20499
8ef4622d
PE
20500 * lisp.h (eassert): Check that the argument compiles, even if
20501 ENABLE_CHECKING is not defined.
20502
946f9a5b
PE
20503 * data.c (Findirect_variable): Name an expression, to avoid
20504 gcc -Wbad-function-cast warning.
112396d6 20505 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 20506 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
20507 (Fmake_variable_buffer_local, Fmake_local_variable):
20508 Mark variables as initialized.
52746918 20509 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 20510
e5aab7e7 20511 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
20512 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20513 Rename locals to avoid shadowing.
dff45157
PE
20514 (mark_stack): Move local variables into the #ifdef region where
20515 they're used.
7bc26fdb
PE
20516 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20517 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20518 needed otherwise.
20519 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20520 (GC_STRING_CHARS): Remove; not used.
d40d4be1 20521 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 20522
e5aab7e7
PE
20523 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20524 avoids undefined behavior in theory.
20525
4da60324
PE
20526 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20527
88043301
PE
20528 Use functions, not macros, for up- and down-casing (Bug#8254).
20529 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20530 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20531 to use the following functions instead of these macros.
20532 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20533 EMACS_INT, since callers assume the returned value fits in int.
20534 (upcase1): Likewise, for UPCASE_TABLE.
20535 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 20536 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 20537 the race-condition problem in the old DOWNCASE.
88043301 20538
19ed5445
PE
20539 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20540 Rename locals to avoid shadowing.
20541 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
20542 (regex_compile, re_search_2, re_match_2_internal):
20543 Remove unused local vars.
952db0d7
PE
20544 (FREE_VAR): Rewrite so as not to use empty "else",
20545 which gcc can warn about.
da053e48 20546 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
20547 (RETALLOC_IF): Define only if needed.
20548 (WORDCHAR_P): Likewise. This one is never needed, but is used
20549 only in a comment talking about a compiler bug, so put inside
20550 the #if 0 of that comment.
20551 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20552 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20553 Remove; unused.
19ed5445 20554
1f3561e4 20555 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
20556 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20557 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 20558
ded6f8f7
PE
20559 * search.c (simple_search): Remove unused var.
20560
dbd37a95
PE
20561 * dired.c (compile_pattern): Move decl from here ...
20562 * lisp.h: ... to here, so that it can be checked.
20563 (struct re_registers): New forward decl.
20564
7e47afad
PE
20565 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20566
85f24f61
PE
20567 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20568 All uses changed.
20569 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20570 Rename locals to avoid shadowing.
5671df8f 20571 (Fvertical_motion): Mark locals as initialized.
85f24f61 20572
181aa2be 20573 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 20574 (casify_region): Mark local as initialized.
181aa2be 20575
930d429c
PE
20576 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20577
7082eac6
PE
20578 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20579 New macros, so that the caller can use some names other than
20580 gcpro1, gcpro2, etc.
20581 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20582 of the new macros.
20583 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20584 argument, for consistency with GCPRO2_VAR, etc: it is now the
20585 prefix of the variable, not the variable itself. All uses
20586 changed.
38b2c076
PE
20587 * dired.c (directory_files_internal, file_name_completion):
20588 Rename locals to avoid shadowing.
20589
15206ed9
PE
20590 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20591 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20592 dired.c's scmp function, had undefined behavior.
20593 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20594 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20595 * buffer.h: ... to here, because these macros use current_buffer,
20596 and the new implementation with inline functions needs to have
20597 current_buffer in scope now, rather than later when the macros
20598 are used.
20599 (downcase, upcase1): New static inline functions.
20600 (DOWNCASE, UPCASE1): Reimplement using these functions.
20601 This avoids undefined behavior in expressions like
20602 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20603 from race conditions in accessing the global variables
20604 case_temp1 and case_temp2.
20605 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20606 * lisp.h (case_temp1, case_temp2): Remove their decls.
20607 * character.h (ASCII_CHAR_P): Move from here ...
20608 * lisp.h: ... to here, so that the inline functions mentioned
20609 above can use them.
20610
4a6bea26
PE
20611 * dired.c (directory_files_internal_unwind): Now static.
20612
f14b7e14
PE
20613 * fileio.c (file_name_as_directory, directory_file_name):
20614 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20615 Now static.
2893f146
PE
20616 (file_name_as_directory): Use const pointers when appropriate.
20617 (Fexpand_file_name): Likewise. In particular, newdir might
20618 point at constant storage, so make it a const pointer.
fd4ead52 20619 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
20620 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20621 signedness issues.
f839df0c
PE
20622 (Fset_file_times, Finsert_file_contents, auto_save_error):
20623 Rename locals to avoid shadowing.
f14b7e14 20624
5716756e 20625 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
20626 (Ftry_completion, Fall_completions): Rename or remove locals
20627 to avoid shadowing.
5716756e 20628
b4c3046a
PE
20629 * marker.c (bytepos_to_charpos): Remove; unused.
20630
b45db522
PE
20631 * lisp.h (verify_bytepos, count_markers): New decls,
20632 so that gcc does not warn that these functions aren't declared.
20633
85876d07
PE
20634 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20635 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 20636 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 20637 (copy_text): Remove unused local var.
85876d07 20638
03d78a21 20639 * filelock.c (within_one_second): Now static.
b3dd38ab 20640 (lock_file_1): Rename local to avoid shadowing.
03d78a21 20641
5df8f01b
PE
20642 * buffer.c (fix_overlays_before): Mark locals as initialized.
20643 (fix_start_end_in_overlays): Likewise. This function should be
20644 simplified by using pointers-to-pointers, but that's a different
20645 matter.
b1d876f1 20646 (switch_to_buffer_1): Now static.
8f54f30a
PE
20647 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20648 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 20649
a70072c9 20650 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 20651 Fix pointer signedness issue.
edced198
PE
20652 (sys_subshell): Mark local as volatile if checking for lint,
20653 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 20654 (MAXPATHLEN): Define only if needed.
a70072c9 20655
a0977c44
PE
20656 * process.c (serial_open, serial_configure): Move decls from here ...
20657 * systty.h: ... to here, so that they can be checked.
20658
a884fdcc
PE
20659 * fns.c (get_random, seed_random): Move extern decls from here ...
20660 * lisp.h: ... to here, so that they can be checked.
20661
604efe86 20662 * sysdep.c (reset_io): Now static.
b8950c94 20663 (wait_for_termination_signal): Remove; unused.
604efe86 20664
38fc62d9
PE
20665 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20666 (copy_keymap_item, append_key, push_text_char_description):
20667 Now static.
1004a21a 20668 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 20669 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
20670 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20671 (describe_map_tree):
20672 Rename locals to avoid shadowing.
38fc62d9 20673
2f2650da
PE
20674 * keyboard.c: Declare functions static if they are not used elsewhere.
20675 (echo_char, echo_dash, cmd_error, top_level_2):
20676 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
20677 (read_char, kbd_buffer_get_event, make_lispy_position):
20678 (make_lispy_event, make_lispy_movement, apply_modifiers):
20679 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20680 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20681 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 20682 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 20683 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 20684
a053e86c 20685 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
20686 (mark_kboards): Move decl here ...
20687 * alloc.c (mark_kboards): ... from here.
a053e86c 20688
4752793e
PE
20689 * lisp.h (force_auto_save_soon): New decl.
20690
74f10ca7 20691 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
20692 (DEFINE_DUMMY_FUNCTION): New macro.
20693 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20694 Use it.
c03cd23f
PE
20695 (main): Add casts to avoid warnings
20696 if GCC considers string literals to be constants.
74f10ca7 20697
022e70d4
PE
20698 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20699
59d6fe83
PE
20700 * dbusbind.c: Pointer signedness fixes.
20701 (xd_signature, xd_append_arg, xd_initialize):
20702 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20703 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20704 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20705 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20706
78320123
PE
20707 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20708 if GCC considers string literals to be constants.
49cebcca 20709 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 20710
35ac2a97
SM
207112011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20712
fb103ca9
SM
20713 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20714 (print_preprocess, print_object): New macro to fix last change.
20715
35ac2a97
SM
20716 * print.c (print_preprocess): Don't forget font objects.
20717
62973b41
JB
207182011-03-16 Juanma Barranquero <lekktu@gmail.com>
20719
20720 * emacs.c (USAGE3): Doc fixes.
20721
0e48bb22
AS
207222011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20723
20724 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20725 structure.
20726
7684e57b
JB
207272011-03-14 Juanma Barranquero <lekktu@gmail.com>
20728
20729 * lisp.h (VWindow_system, Qfile_name_history):
20730 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20731 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20732 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20733
20734 * w32select.c: Don't #include "keyboard.h".
c96bbc66 20735 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
20736
20737 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20738 * w32console.c (detect_input_pending, read_input_pending)
20739 (encode_terminal_code):
20740 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20741 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20742 (w32_system_caret_y, Qfile_name_history):
20743 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20744 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20745 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20746 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20747 * w32proc.c (Qlocal, report_file_error):
20748 * w32term.c (Vwindow_system, updating_frame):
20749 * w32uniscribe.c (initialized, uniscribe_font_driver):
20750 Remove unneeded extern declarations.
20751
2aa46d6c
CY
207522011-03-14 Chong Yidong <cyd@stupidchicken.com>
20753
c96bbc66 20754 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 20755
cffc6f3b
CY
207562011-03-13 Chong Yidong <cyd@stupidchicken.com>
20757
20758 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20759 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20760 These macros can no longer be used for assignment.
20761
44f230aa
SM
20762 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20763 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
20764 (record_buffer_markers, fetch_buffer_markers): New functions for
20765 recording and fetching special buffer markers.
20766 (set_buffer_internal_1, set_buffer_temp): Use them.
20767
20768 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20769
20770 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20771
20772 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20773 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20774
20775 * xdisp.c (hscroll_window_tree):
20776 (reconsider_clip_changes): Use PT instead of BUF_PT.
20777
d251f04b
EZ
207782011-03-13 Eli Zaretskii <eliz@gnu.org>
20779
20780 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20781 $(EMACS_ROOT)/lib/intprops.h.
20782
f0c77cd1
PE
207832011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20784
3eca4629
PE
20785 Fix more problems found by GCC 4.5.2's static checks.
20786
7c86ee98
PE
20787 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20788 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
20789 (xg_free_frame_widgets): Make it clear that a local variable is
20790 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
20791 (gdk_window_get_screen): Make it clear that this macro is needed
20792 only if USE_GTK_TOOLTIP.
1e5524e7
PE
20793 (int_gtk_range_get_value): New function, which avoids a diagnostic
20794 from gcc -Wbad-function-cast.
20795 (xg_set_toolkit_scroll_bar_thumb): Use it.
20796 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20797 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
20798 (get_utf8_string, xg_get_file_with_chooser):
20799 Rename locals to avoid shadowing.
20800 (create_dialog): Move locals to avoid shadowing.
7c86ee98 20801
41729b81
PE
20802 * xgselect.c (xg_select): Remove unused var.
20803
f0c77cd1
PE
20804 * image.c (four_corners_best): Mark locals as initialized.
20805 (gif_load): Initialize transparent_p to zero (Bug#8238).
20806 Mark another local as initialized.
ec6cf4c6 20807 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 20808
ce0ad53d 20809 * image.c (clear_image_cache): Now static.
d5d5a617 20810 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 20811 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
20812 (x_edge_detection): Remove unnecessary cast that
20813 gcc -Wbad-function-cast diagnoses.
2037898d 20814 (gif_load): Fix pointer signedness.
6ae141d6
PE
20815 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20816 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 20817
33383987 208182011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 20819
d32df629
PE
20820 Improve quality of tests for time stamp overflow.
20821 For example, without this patch (encode-time 0 0 0 1 1
20822 1152921504606846976) returns the obviously-bogus value (-948597
20823 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20824 reports time overflow. See
20825 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
20826 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20827 * editfns.c: Include limits.h and intprops.h.
20828 (TIME_T_MIN, TIME_T_MAX): New macros.
20829 (time_overflow): Move earlier, to before first use.
20830 (hi_time, lo_time): New functions, for an accurate test for
20831 out-of-range times.
20832 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20833 (Fget_internal_run_time): Don't assume time_t fits in int.
20834 (make_time): Use list2 instead of Fcons twice.
20835 (Fdecode_time): More accurate test for out-of-range times.
20836 (check_tm_member): New function.
20837 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
20838 (lisp_time_argument): Don't rely on undefined left-shift and
20839 right-shift behavior when checking for time stamp overflow.
8be6f318 20840
fe31d94c
PE
20841 * editfns.c (time_overflow): New function, refactoring common code.
20842 (Fformat_time_string, Fdecode_time, Fencode_time):
20843 (Fcurrent_time_string): Use it.
20844
8be6f318
PE
20845 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20846 * dired.c (make_time): Move to ...
20847 * editfns.c (make_time): ... here.
20848 * systime.h: Note the move.
20849
09d9db2c 208502011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 20851
126bc0dc
YM
20852 * fringe.c (update_window_fringes): Remove unused variables.
20853
c47cbdfd
YM
20854 * unexmacosx.c (copy_data_segment): Also copy __got section.
20855 (Bug#8223)
20856
7ac80be9
EZ
208572011-03-12 Eli Zaretskii <eliz@gnu.org>
20858
c96bbc66 20859 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
20860 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20861 Constify `char *' arguments and their references according to
20862 prototypes in tparam.h.
20863
ecb0f94d 20864 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 20865
7ac80be9
EZ
20866 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20867 Adapt all references accordingly.
20868
20869 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20870
ef1fd07e
TT
208712011-03-11 Tom Tromey <tromey@redhat.com>
20872
20873 * buffer.c (syms_of_buffer): Remove obsolete comment.
20874
7ef4b50c
EZ
208752011-03-11 Eli Zaretskii <eliz@gnu.org>
20876
20877 * termhooks.h (encode_terminal_code): Declare prototype.
20878
20879 * msdos.c (encode_terminal_code): Don't declare prototype.
20880
20881 * term.c (encode_terminal_code): Now external again, used by
20882 w32console.c and msdos.c.
20883
44f230aa
SM
20884 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20885 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 20886
4b1ec863 208872011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 20888
1714f52b 20889 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 20890
4b1ec863
PE
20891 * fringe.c (update_window_fringes): Mark locals as initialized
20892 (Bug#8227).
20893 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 20894
524c7aa6
PE
20895 * alloc.c (mark_fringe_data): Move decl from here ...
20896 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20897 to check its interface.
20898 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20899
a5c0af81 20900 * fontset.c (free_realized_fontset): Now static.
7519b8cd 20901 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 20902 (fontset_font): Mark local as initialized.
a9a06e0b 20903 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 20904
b4716021
PE
20905 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20906
811e9bac 20907 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 20908 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
20909 (x_own_selection, Fx_disown_selection_internal): Rename locals
20910 to avoid shadowing.
20911 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 20912
7e3ab302
PE
20913 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20914 so that the caller can use some name other than gcpro1.
20915 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
20916 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20917 (Fx_backspace_delete_keys_p):
20918 Use them to avoid shadowing, and rename vars to avoid shadowing.
20919 (x_decode_color, x_set_name, x_window): Now static.
6b437900 20920 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 20921 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
20922 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20923 Remove unused locals.
7e3ab302
PE
20924 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20925 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20926 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20927 macros.
f78faa98 20928
e2b13473
PE
20929 * xterm.h (x_mouse_leave): New decl.
20930
77f23912
PE
20931 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20932 Remove unused functions.
cdf4ba58
PE
20933 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20934 (x_calc_absolute_position): Now static.
7411c686 20935 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 20936 Don't declare local "event" unless it's used.
ed7bf3a5
PE
20937 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20938 unless they are used.
38d0b34a
PE
20939 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20940 (x_fatal_error_signal): Remove; not used.
a6067996
PE
20941 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20942 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20943 (x_error_catcher, x_connection_closed, x_error_handler):
20944 (x_error_quitter, xembed_send_message, x_iconify_frame):
20945 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 20946 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 20947 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 20948
44f230aa
SM
20949 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20950 Rename or move locals to avoid shadowing.
6b463e58 20951 (tty_defined_color, merge_face_heights): Now static.
5967d051 20952 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
20953 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20954 does not deduce is never used uninitialized.
73719eba
PE
20955 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20956 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 20957
426994c3 20958 * terminal.c (store_terminal_param): Now static.
5489860b 20959
032f1620 20960 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 20961 (set_frame_menubar): Remove unused local.
d4323972 20962 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
20963 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20964 since they might point to immutable storage.
281585b0
PE
20965 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20966 since it's unused otherwise.
032f1620 20967
367c19e5 20968 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 20969 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
20970 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20971 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 20972 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
20973 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20974 does not deduce are never used uninitialized.
70739cbe 20975
07b48fa9
PE
20976 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20977
8868a238 20978 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
20979 * window.c (window_loop, size_window):
20980 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 20981
7e5cf297 20982 * window.c (display_buffer): Now static.
d6550a9f
PE
20983 (size_window): Mark variables that gcc -Wuninitialized
20984 does not deduce are never used uninitialized.
a586633d
PE
20985 * window.h (check_all_windows): New decl, to forestall
20986 gcc -Wmissing-prototypes diagnostic.
5b555da1 20987 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 20988
f6095868
PE
20989 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20990 shadowing.
20991 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
20992 Include <limits.h>.
20993 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20994 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
20995 (load_charset_map): Mark variables that gcc -Wuninitialized
20996 does not deduce are never used uninitialized.
53df7c11 20997 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 20998
f38b440c
PE
20999 * coding.c (coding_set_source, coding_set_destination):
21000 Use "else { /* comment */ }" rather than "else /* comment */;"
21001 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
21002 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
21003 a block, when the outer 'i' will do.
21004 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
21005 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
21006 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
21007 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
21008 (Fdecode_sjis_char, Fdefine_coding_system_internal):
21009 Rename locals to avoid shadowing.
21010 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
21011 * coding.c (emacs_mule_char, encode_invocation_designation):
21012 Now static, since they're not used elsewhere.
413bb2db 21013 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 21014 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
21015 (decode_coding_emacs_mule): Mark variables that gcc
21016 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
21017 (detect_coding_iso_2022): Initialize a local variable that might
21018 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 21019 this initialization is needed. (Bug#8211)
5f58e762
PE
21020 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
21021 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
21022 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
21023 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
21024 Remove unused macros.
f38b440c 21025
232b38b9 21026 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 21027 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 21028 * character.c (string_count_byte8): Likewise.
232b38b9 21029
fb90da1b
PE
21030 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
21031 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
21032
fb93dbc2
PE
21033 * chartab.c (copy_sub_char_table): Now static, since it's not used
21034 elsewhere.
5c156ace
PE
21035 (sub_char_table_ref_and_range, char_table_ref_and_range):
21036 Rename locals to avoid shadowing.
bbcd0949 21037 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 21038
7d3b3862 21039 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 21040 (BIDI_BOB): Remove unused macro.
7d3b3862 21041
6be7d3da
PE
21042 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
21043 deduce are never used uninitialized.
c2ed9c8b 21044 * term.c (encode_terminal_code): Likewise.
6be7d3da 21045
75f8807f 21046 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 21047
50938595
PE
21048 * tparam.h: New file.
21049 * term.c, tparam.h: Include it.
21050 * deps.mk (term.o, tparam.o): Depend on tparam.h.
21051 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
21052 Move these decls to tparam.h, and make them agree with what
21053 is actually in tparam.c. The previous trick of using incompatible
21054 decls in different modules does not conform to the C standard.
21055 All callers of tparam changed to use tparam's actual API.
21056 * tparam.c (tparam1, tparam, tgoto):
21057 Use const pointers where appropriate.
21058
fbceeba2
PE
21059 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
21060 * cm.h (struct cm): Likewise.
21061 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
21062 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
21063 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
21064 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
21065 (turn_on_face, init_tty): Likewise.
21066 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 21067
7f3f1250
PE
21068 * term.c (term_mouse_position): Rename local to avoid shadowing.
21069
e6ca6543
PE
21070 * alloc.c (mark_ttys): Move decl from here ...
21071 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
21072
c40f8d15
AS
210732011-03-11 Andreas Schwab <schwab@linux-m68k.org>
21074
21075 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
21076
cfe0661d
JB
210772011-03-09 Juanma Barranquero <lekktu@gmail.com>
21078
21079 * search.c (compile_pattern_1): Remove argument regp, unused since
21080 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
21081 (compile_pattern): Don't pass it.
21082
0afb4571
J
210832011-03-08 Jan Djärv <jan.h.d@swipnet.se>
21084
21085 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
21086 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
21087 for ! HAVE_GTK3.
21088 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
21089
21090 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
21091
21092 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
21093 gdk_window_get_screen, gdk_window_get_geometry,
21094 gdk_x11_window_lookup_for_display and GDK_KEY_g.
21095 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
21096 (xg_get_pixbuf_from_pixmap): New function.
21097 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
21098 to Pixmap, take frame as parameter, remove GdkColormap parameter.
21099 Call xg_get_pixbuf_from_pixmap instead of
21100 gdk_pixbuf_get_from_drawable.
21101 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
21102 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
21103 (xg_check_special_colors): Use GtkStyleContext and its functions
21104 for HAVE_GTK3.
21105 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
21106 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
21107 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
21108 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
21109 Call gtk_widget_get_preferred_size.
0afb4571
J
21110 (xg_frame_resized): gdk_window_get_geometry only takes 5
21111 parameters.
44f230aa
SM
21112 (xg_win_to_widget, xg_event_is_for_menubar):
21113 Call gdk_x11_window_lookup_for_display.
0afb4571
J
21114 (xg_set_widget_bg): New function.
21115 (delete_cb): New function.
895009e1 21116 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 21117 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
21118 (xg_set_background_color): Call xg_set_widget_bg.
21119 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
21120 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
21121 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
21122 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
21123 if ! HAVE_GTK3.
21124 (update_frame_tool_bar): Call gtk_widget_hide.
21125 (xg_initialize): Use GDK_KEY_g.
21126
21127 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
21128 if ! HAVE_GTK3
21129 (x_session_initialize): Call gdk_x11_set_sm_client_id.
21130
21131 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
21132 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
21133 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
21134
1c2cc4ef
JB
211352011-03-08 Juanma Barranquero <lekktu@gmail.com>
21136
21137 * w32xfns.c (select_palette): Check success of RealizePalette against
21138 GDI_ERROR, not zero.
21139
33383987 21140See ChangeLog.11 for earlier changes.
aac0c6e3
MR
21141
21142;; Local Variables:
21143;; coding: utf-8
aac0c6e3
MR
21144;; End:
21145
2f097256 21146 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
21147
21148 This file is part of GNU Emacs.
21149
21150 GNU Emacs is free software: you can redistribute it and/or modify
21151 it under the terms of the GNU General Public License as published by
21152 the Free Software Foundation, either version 3 of the License, or
21153 (at your option) any later version.
21154
21155 GNU Emacs is distributed in the hope that it will be useful,
21156 but WITHOUT ANY WARRANTY; without even the implied warranty of
21157 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21158 GNU General Public License for more details.
21159
21160 You should have received a copy of the GNU General Public License
21161 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.