* fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
d20704ef
PE
12012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2
3 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
4 fstat shouldn't fail, and if it does fail copy-file should not proceed.
5 Remove unnecessary S_ISLNK test, as (contra the comments) this
6 function can't copy symlinks. Improve quality of error message
7 when attempting to copy files that are neither regular files nor
8 directories.
9
2dd61a9b
DA
102012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
11
12 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
13 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
14 * window.c (Frecenter):
15 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
16 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
17
cc98b684
DC
182012-12-12 Daniel Colascione <dancol@dancol.org>
19
20 * unexcw.c (fixup_executable): use posix_fallocate to ensure that
21 the dumped Emacs is not a sparse file, greatly improving Cygwin
22 "make bootstrap" performance.
23
38e791fd
MA
242012-12-11 Michael Albinus <michael.albinus@gmx.de>
25
26 * inotify.c (inotify_callback): Generate an Emacs event for every
27 incoming inotify event.
28
f9d1448f
EZ
292012-12-11 Eli Zaretskii <eliz@gnu.org>
30
31 * xdisp.c (handle_face_prop): Fix logic of computing
32 it->start_of_box_run_p.
33 (append_space_for_newline): If the glyph row is R2L, reset the
34 iterator's end_of_box_run_p flag before prepending the space glyph.
35 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
36 iterator's start_of_box_run_p flag before prepending the stretch.
37 (append_glyph, produce_image_glyph, append_composite_glyph)
38 (append_stretch_glyph, append_glyphless_glyph): Reverse the
39 left_box_line_p and right_box_line_p flags of the glyph for R2L
40 glyph rows. (Bug#13011)
41
c6afe371
DA
422012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
43
44 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
45 if changed buffer is not shown in a window.
46 * insdel.c (prepare_to_modify_buffer): Likewise.
47 * window.c (replace_buffer_in_windows_safely): Do nothing
48 if buffer is not shown in a window.
49 (Fforce_window_update): Likewise if string or buffer argument
50 is passed.
51
1b47babd
EZ
522012-12-11 Eli Zaretskii <eliz@gnu.org>
53
54 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
55 encoded_file_name, which is what it is.
56
4c1acb95
DA
572012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
58
59 Consistently use marker_position and marker_byte_position.
60 * fringe.c (Ffringe_bitmaps_at_pos):
61 * indent.c (Fvertical_motion):
62 * insdel.c (prepare_to_modify_buffer):
63 * keyboard.c (make_lispy_position):
64 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
65 (window_scroll_pixel_based, displayed_window_lines)
66 (Fset_window_configuration):
67 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
68 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
69 Replace direct access to marker fields with calls
70 to marker_position and/or marker_byte_position.
71
0eeb69fe
JB
722012-12-11 Juanma Barranquero <lekktu@gmail.com>
73
74 * makefile.w32-in (SIG2STR_H): New macro.
75 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
76 ($(BLD)/w32notify.$(O)): Update dependencies.
77
1cf1bbd5
DC
782012-12-10 Daniel Colascione <dancol@dancol.org>
79
8db4b52f
DC
80 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
81 Windows file notification functionality unless WINDOWSNT.
82
1cf1bbd5
DC
83 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
84 declarations.
85
86 * w32fns.c (cache_system_info): Initialize the global hinst
87 variable here so various initialization calls DTRT.
88
89 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused
90 variables.
91 (hinst): Remove unneeded extern declaration.
92 (_start): Remove initialization of above variables; remove
93 initialization of hinst, as cache_system_info now does that.
94
95 * emacs.c (main): Call cache_system_info early in startup; we
96 previously weren't calling it in Cygwin builds.
97
98 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK): Teach
99 the autoconf build system how to compile a Windows resource file
100 and link it to Emacs.
101
98a07056
DA
1022012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
103
104 Per-buffer window counters.
105 * buffer.h (struct buffer): New member window_count.
106 (buffer_window_count): New function.
107 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
108 Initialize window_count.
109 (Fkill_buffer): Verify window_count for the buffer being killed.
110 (modify_overlay): Do not force redisplay if buffer is not shown
111 in any window.
112 (init_buffer_once): Initialize window_count for buffer_defaults
113 and buffer_local_symbols.
114 * window.h (buffer_shared): Remove declaration.
115 (wset_buffer): Convert from inline ...
116 * window.c (wset_buffer): ... to an ordinary function.
117 (adjust_window_count): New function.
118 (make_parent_window): Use it.
119 * xdisp.c (buffer_shared): Remove.
120 (redisplay_internal, redisplay_window): Adjust users.
121 (buffer_shared_and_changed): Use per-buffer window counter.
122
2b8c9064
EZ
1232012-12-10 Eli Zaretskii <eliz@gnu.org>
124
125 Support for filesystem notifications on MS-Windows.
126 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
127 and this is a TTY frame, signal the caller that keyboard input is
128 available.
129
130 * w32xfns.c (drain_message_queue): Now returns an int: an
131 indication whether any WM_EMACS_FILENOTIFY messages were found in
132 the queue.
133
134 * w32inevt.c (handle_file_notifications): New function.
135 (w32_console_read_socket): Call it to process file notifications.
136
137 * w32console.c (initialize_w32_display): Record the main thread ID
138 in dwMainThreadId.
139
140 * deps.mk (inotify.o): New dependency list.
141
142 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
143
144 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
145 (WM_EMACS_END): Bump value by 1.
146 (notification_buffer_in_use, file_notifications)
147 (notifications_size, notifications_desc): Declare.
148 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
149 Add prototypes.
150
151 * w32term.c (lispy_file_action, queue_notifications): New functions.
152 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
153 <Qrenamed_to>: New symbols.
154 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
155
156 * w32notify.c: New file, implements file event notifications for
157 MS-Windows.
158
159 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
160 by posting it to the w32_read_socket queue.
161
162 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support
163 FILE_NOTIFY_EVENT.
164
165 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
166 (GLOBAL_SOURCES): Add w32notify.c
167 ($(BLD)/w32notify.$(O)): New set of dependencies.
168
169 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
170
171 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]: Handle
172 FILE_NOTIFY_EVENT.
173 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
174 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
175 w32notify-handle-event by default.
176
177 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
178 syms_of_w32notify.
179
81606b10
RS
1802012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
181
2b8c9064 182 Support for filesystem notifications on GNU/Linux via inotify.
81606b10
RS
183 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add
184 FILE_NOTIFY_EVENT.
185
186 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
187
188 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
189 (syms_of_keyboard): DEFSYM it.
190 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
191 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
192 Qfile_inotify events.
193 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
194 special-event-map to inotify-handle-event.
195
196 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
197
198 * Makefile.in (base_obj): Add inotify.o.
199
200 * inotify.c: New file.
201
265c2fbf 2022012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
203
204 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
205
265c2fbf 2062012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
207
208 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
209 DWORD_PTR, for compatibility with 64-bit builds.
210
a06ae17d 211 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
212 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
213 (system_process_attributes): Use SIZE_T rather than DWORD, for
214 compatibility with 64-bit builds.
215
265c2fbf 2162012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
217
218 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
219
265c2fbf 2202012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
221
222 * indent.c (Fvertical_motion): If a display string will be
223 displayed on the left or the right margin, don't consider it as a
224 factor in cursor positioning. (Bug#13108)
225
265c2fbf 2262012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
227
228 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
229
5f460827
PE
2302012-12-10 Paul Eggert <eggert@cs.ucla.edu>
231
232 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
233 for string length.
234
a16e75cd
EZ
2352012-12-08 Eli Zaretskii <eliz@gnu.org>
236
237 * w32.c (unsetenv): Return 0 if the input string is too long.
238
5745a7df
PE
2392012-12-08 Paul Eggert <eggert@cs.ucla.edu>
240
241 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
242 * alloc.c (xputenv): New function.
243 * dbusbind.c (Fdbus_init_bus):
244 * emacs.c (main):
245 * xterm.c (x_term_init):
246 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
247 * editfns.c (initial_tz): Move static var decl up.
248 (tzvalbuf_in_environ): New static var.
249 (init_editfns): Initialize these two static vars.
250 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
251 Save old TZ value on stack, if it's small.
252 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
253 instead, use xputenv+unsetenv to set and restore TZ.
254 (environbuf): Remove static var. All uses removed.
255 (Fset_time_zone_rule): Do not save TZ and environ;
256 no longer needed here.
257 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
258 Move to inside set_time_zone_rule; they don't need file scope any more.
259 (set_time_zone_rule): Maintain the TZ=value string separately.
260 (syms_of_editfns): Don't initialize initial_tz;
261 init_editfns now does it.
262 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
263 * lisp.h (xputenv): New decl.
264
c56efa40
FP
2652012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
266
267 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
268
75ceee05
EZ
2692012-12-08 Eli Zaretskii <eliz@gnu.org>
270
271 * w32.c (unsetenv, sys_putenv): New functions.
272
1b6dbfeb
CY
2732012-12-08 Chong Yidong <cyd@gnu.org>
274
275 * editfns.c (Finsert_char): Make the error message more
276 informative (Bug#12992).
277
d983a10b
PE
2782012-12-08 Paul Eggert <eggert@cs.ucla.edu>
279
7be78020
PE
280 Simplify get_lim_data.
281 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
282 Remove USG and vlimit methods; no longer used these days.
283 Add #error catchall just in case.
284
d983a10b
PE
285 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
286 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
287 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
288 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
289 (deleted_pid_list, Fdelete_process, create_process)
290 (record_child_status_change, handle_child_signal, deliver_child_signal)
291 (init_process_emacs, syms_of_process):
292 Assume SIGCHLD is defined.
293 (parse_signal): Remove. All uses removed.
294 (abbr_to_signal): New static function.
295 (Fsignal_process): Use it to convert signal names to ints.
296 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
297 kill (getpgrp (), ...).
298 (emacs_sigaction_init): Assume SIGCHLD is defined.
299 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
300 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
301 * syssignal.h (EMACS_KILLPG): Remove.
302 All uses replaced by 'kill' with a negative pid.
303 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
304 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
305
9cdde1e2
PE
3062012-12-07 Paul Eggert <eggert@cs.ucla.edu>
307
308 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
309 This will cause a production Emacs to dump core instead of
310 infinite-looping.
311
822995f8
DA
3122012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
313
314 * frame.c (make_frame): Do not set window's buffer to t.
315 * window.c (Fsplit_window_internal): Likewise. Previously it was
316 used to indicate that the window is being set up. Now we use
317 set_window_buffer for all new windows, so the condition in ...
318 (Fset_window_buffer): ... is always true and can be removed.
319
ed08365b
DA
3202012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
321
322 Convenient macro to check whether the buffer is hidden.
323 * buffer.h (BUFFER_HIDDEN_P): New macro.
324 * frame.c (make_frame): Use it. Adjust comment.
325 * buffer.c (candidate_buffer): New function.
326 (Fother_buffer, other_buffer_safely): Use it.
327
e86f5134
EZ
3282012-12-06 Eli Zaretskii <eliz@gnu.org>
329
330 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
331 if the child process is still running. Instead, exit the wait
332 loop and return zero. (Bug#13086)
333
1700db3c
DA
3342012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
335
336 * frame.h (x_char_width, x_char_height): Remove prototypes.
337 * w32term.h (x_char_width, x_char_height): Likewise.
338 * xfns.c (x_char_width, x_char_height): Remove.
339 * w32fns.c (x_char_width, x_char_height): Likewise.
340 * nsfns.c (x_char_width, x_char_height): Likewise.
341 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
342 all window frames.
343 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
344 * keyboard.c (command_loop_1): Remove prototype.
345 (command_loop_2, top_level_1): Add static to match prototype.
346
35fb8050
PE
3472012-12-06 Paul Eggert <eggert@cs.ucla.edu>
348
349 Fix a recently-introduced delete-process race condition.
350 * callproc.c, process.h (record_kill_process):
351 New function, containing part of the old call_process_kill.
352 (call_process_kill): Use it.
353 This does not change call_process_kill's behavior.
354 * process.c (Fdelete_process): Use record_kill_process to fix a
355 race condition that could cause Emacs to lose track of a child.
356
565212e5
DA
3572012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
358
359 Avoid code duplication between prev_frame and next_frame.
360 * frame.c (candidate_frame): New function. Add comment.
361 (prev_frame, next_frame): Use it. Adjust comment.
362
d8ad4d3f 3632012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
364
365 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
366 fails, signal an error instead of continuing with an empty
367 string. (Bug#13079)
7c2fcf9b
EZ
368 Encode expanded temp file pattern before passing it to mkstemp or
369 mktemp.
d3cefd13 370
2e7cddd3
EZ
371 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
372 Encode the file name before passing it to dostounix_filename, in
373 case it will downcase it (under w32-downcase-file-names).
374 (Bug#12933)
375
644d3f0d
PE
3762012-12-05 Paul Eggert <eggert@cs.ucla.edu>
377
378 Minor call-process cleanups.
379 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
380 at the same time as other platforms, to simplify analysis.
381 No need for fd0_volatile since we have synch_process_fd.
382 Avoid needless emacs_close; arg is always negative.
383
396376f1
AS
3842012-12-04 Andreas Schwab <schwab@linux-m68k.org>
385
386 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
387 processes.
388
350f51ad
DA
3892012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
390
391 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
392 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
393 and mouse_face_hidden members to a bitfields.
394 * frame.h (struct frame): Remove set-but-not-used space_width member.
395 (FRAME_SPACE_WIDTH): Remove.
396 * nsterm.m, w32term.c, xterm.c: Adjust users.
397 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
398 member. Adjust users. Convert term_initted, delete_in_insert_mode,
399 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
400 members to a bitfields.
401
bc9dbce6
PE
4022012-12-03 Paul Eggert <eggert@cs.ucla.edu>
403
bb5f74ee
PE
404 Don't let call-process be a zombie factory (Bug#12980).
405 Fixing this bug required some cleanup of the signal-handling code.
406 As a side effect, this change also fixes a longstanding rare race
407 condition whereby Emacs could mistakenly kill unrelated processes,
408 and it fixes a bug where a second C-g does not kill a recalcitrant
409 synchronous process in GNU/Linux and similar platforms.
410 The patch should also fix the last vestiges of Bug#9488,
411 a bug which has mostly been fixed on the trunk by other changes.
412 * callproc.c, process.h (synch_process_alive, synch_process_death)
413 (synch_process_termsig, sync_process_retcode):
414 Remove. All uses removed, to simplify analysis and so that
415 less consing is done inside critical sections.
416 * callproc.c (call_process_exited): Remove. All uses replaced
417 with !synch_process_pid.
418 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
419 These take the role of what used to be in unwind-protect arg.
420 All uses changed.
421 (block_child_signal, unblock_child_signal):
422 New functions, to avoid races that could kill innocent-victim processes.
423 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
424 (call_process_kill): Record killed processes as deleted, so that
425 zombies do not clutter up the system. Do this inside a critical
426 section, to avoid a race that would allow the clutter.
427 (call_process_cleanup): Fix code so that the second C-g works again
428 on common platforms such as GNU/Linux.
429 (Fcall_process): Create the child process in a critical section,
430 to fix a race condition. If creating an asynchronous process,
431 record it as deleted so that zombies do not clutter up the system.
432 Do unwind-protect for WINDOWSNT too, as that's simpler in the
433 light of these changes. Omit unnecessary call to emacs_close
434 before failure, as the unwind-protect code does that.
435 * callproc.c (call_process_cleanup):
436 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
437 * process.c (record_deleted_pid): New function, containing
438 code refactored out of Fdelete_process.
439 (Fdelete_process): Use it.
440 (process_status_retrieved): Remove. All callers changed to use
441 child_status_change.
442 (record_child_status_change): Remove, folding its contents into ...
443 (handle_child_signal): ... this signal handler. Now, this
444 function is purely a handler for SIGCHLD, and is not called after
445 a synchronous waitpid returns; the synchronous code is moved to
446 wait_for_termination. There is no need to worry about reaping
447 more than one child now.
448 * sysdep.c (get_child_status, child_status_changed): New functions.
449 (wait_for_termination): Now takes int * status and bool
450 interruptible arguments, too. Do not record child status change;
451 that's now the caller's responsibility. All callers changed.
452 Reimplement in terms of get_child_status.
453 (wait_for_termination_1, interruptible_wait_for_termination):
454 Remove. All callers changed to use wait_for_termination.
455 * syswait.h: Include <stdbool.h>, for bool.
456 (record_child_status_change, interruptible_wait_for_termination):
457 Remove decls.
458 (record_deleted_pid, child_status_changed): New decls.
459 (wait_for_termination): Adjust to API changes noted above.
460
bc9dbce6
PE
461 * bytecode.c, lisp.h (Qbytecode): Remove.
462 No longer needed after 2012-11-20 interactive-p changes.
463
3cf3c607
EZ
4642012-12-03 Eli Zaretskii <eliz@gnu.org>
465
466 * xdisp.c (redisplay_window): If the cursor is visible, but inside
467 the scroll margin, move point outside the margin. (Bug#13055)
468
005c8d13
JD
4692012-12-03 Jan Djärv <jan.h.d@swipnet.se>
470
471 * gtkutil.c (my_log_handler): New function.
472 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
473
20edc1c9
DA
4742012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
475
476 * lisp.h (modify_region): Rename to...
477 (modify_region_1): ...new prototype.
478 * textprop.c (modify_region): Now static. Adjust users.
479 * insdel.c (modify_region): Rename to...
480 (modify_region_1): ...new function to work with current buffer.
481 Adjust comment and users. Use true and false for booleans.
482
62c2e5ed
DA
4832012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
484
485 * alloc.c (free_save_value): New function.
486 (safe_alloca_unwind): Use it.
487 * lisp.h (free_save_value): New prototype.
488 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
489 Add comment.
490 (save_excursion_restore): Adjust to match saved data structure.
491 Use free_save_value to offload some work from GC. Drop obsolete
492 #if 0 code.
493
c5bc2d1d 4942012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
495
496 * fileio.c (Vauto_save_list_file_name): Doc fix.
497
c5bc2d1d 4982012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
499
500 * w32fns.c: Remove prototype of atof.
501 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
502 builds.
503 (file_dialog_callback): Declared UINT_PTR.
504
505 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
506 with 64-bit builds.
507
508 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
509 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
510 defined.
511
c5bc2d1d 5122012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 513
a9de9f0c 514 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 515
21e54a94
PE
5162012-12-02 Paul Eggert <eggert@cs.ucla.edu>
517
2dd2e622
PE
518 Fix xpalloc confusion after memory is exhausted.
519 * alloc.c (xpalloc): Comment fix.
520 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
521 and signals an error, do not clear charset_table_size, as
522 charset_table is still valid.
523 * doprnt.c (evxprintf): Clear *BUF after freeing it.
524
21e54a94
PE
525 Use execve to avoid need to munge environ (Bug#13054).
526 * callproc.c (Fcall_process):
527 * process.c (create_process):
528 Don't save and restore environ; no longer needed.
529 * callproc.c (child_setup):
530 Use execve, not execvp, to preserve environ.
531
3e5490f7
PE
5322012-12-01 Paul Eggert <eggert@cs.ucla.edu>
533
534 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
535
75b4f59c
YM
5362012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
537
538 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
539 display for sliced images (Bug#10500).
540
541 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
542
f8aff4c6
JB
5432012-11-30 Juanma Barranquero <lekktu@gmail.com>
544
545 * doc.c (Fdocumentation): Re-add handling of function-documentation,
546 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
547
3940b924
DA
5482012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
549
550 * xdisp.c (window_outdated): Remove eassert since it hits
551 some suspicious corner cases (see Bug#13007 and Bug#13012).
552 (mode_line_update_needed): New function.
553 (redisplay_internal, redisplay_window): Use it.
554 (ensure_selected_frame): New function.
555 (redisplay_internal, unwind_redisplay): Use it.
556 (redisplay_internal): Move comment about buffer_shared...
557 (buffer_shared_and_changed): ...near to its real use.
558
4a9204fe
PE
5592012-11-29 Paul Eggert <eggert@cs.ucla.edu>
560
561 * callproc.c (Fcall_process): Don't misreport vfork failure.
562
60aeceb8
PE
5632012-11-28 Paul Eggert <eggert@cs.ucla.edu>
564
565 * callproc.c (Fcall_process): Fix vfork portability problems.
566 Do not assume that fd[0], count, filefd, and save_environ survive
567 vfork. Fix bug whereby wrong errno value could be reported for
568 pipe failure. Some minor cleanups, too, as follows. Move buf and
569 bufsize to the context where they're needed. Change new_argv to
570 be of type char **, as this is more convenient and avoids casts.
571 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
572 Now local constants, not macros.
573
00dc3ead
KH
5742012-11-18 Kenichi Handa <handa@gnu.org>
575
576 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
577 for the variable "f".
578
e1bf05c1
KH
5792012-11-13 Kenichi Handa <handa@gnu.org>
580
581 * font.c (font_unparse_xlfd): Exclude special characters from the
582 generating XLFD name.
583
22626a85
PE
5842012-11-27 Paul Eggert <eggert@cs.ucla.edu>
585
350e0088
PE
586 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
587 * dired.c (stat_uname, stat_gname):
588 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
589
22626a85
PE
590 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
591 * dired.c (directory_files_internal, file_name_completion):
592 Assume EAGAIN and EINTR are defined.
350e0088 593
22626a85
PE
594 * fileio.c (Fcopy_file): Assume EISDIR is defined.
595 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
596 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
597 * lread.c (readbyte_from_file): Assume EINTR is defined.
598 * process.c (wait_reading_process_output, send_process) [subprocesses]:
599 Assume EIO and EAGAIN are defined.
600 * unexcoff.c (write_segment): Assume EFAULT is defined.
601
5c9cf0a3 6022012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
603
604 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
605 (Bug#11964)
606
22294a56
EZ
607 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
608 highlighting on the frame was cleared. Prevents assertion
609 violations when repeatedly clicking on the "Top" link of the
610 "bread-crumbs" in Info buffers.
611
5fbab051
PE
6122012-11-25 Paul Eggert <eggert@cs.ucla.edu>
613
614 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
615
bcd77a2b
KB
6162012-11-24 Ken Brown <kbrown@cornell.edu>
617
618 * keyboard.c (HAVE_MOUSE):
619 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
620 were always defined.
621
d125ca15 6222012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 623
24becea4
EZ
624 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
625 between bpos_covered and bpos_max. This fixes cursor display when
626 several display strings follow each other.
627
8654a41b
EZ
628 * .gdbinit (pgx): If the glyph's object is a string, display the
629 pointer to string data, rather than the value of the string object
630 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
631
cb5867b1
EZ
632 * indent.c (Fvertical_motion): If the starting position is covered
633 by a display string, return to one position before that, to avoid
634 overshooting it inside move_it_to. (Bug#12930)
635
f418b22e
DA
6362012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
637
638 * frame.h (struct frame): Remove display_preempted member
639 since all users are dead long ago.
640 * nsterm.h (struct x_output): Use the only dummy member.
641 * w32menu.c (pending_menu_activation): Remove since not
642 really used.
643 (set_frame_menubar): Adjust user.
644 * w32term.h (struct x_output): Drop outdated #if 0 code.
645 (struct w32_output): Use bitfields for explicit_parent,
646 asked_for_visible and menubar_active members. Drop
647 unused pending_menu_activation member.
648 * xterm.h (struct x_output): Drop outdated #if 0 code.
649 Use bitfields for explicit_parent, asked_for_visible,
650 has_been_visible and net_wm_state_hidden_seen members.
651
a879f0ea
EZ
6522012-11-23 Eli Zaretskii <eliz@gnu.org>
653
654 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
655 of a literal "/". (Bug#12955)
656 (gl-stamp): Invoke fc.exe directly, not through cmd.
657
95ef7787
PE
6582012-11-23 Paul Eggert <eggert@cs.ucla.edu>
659
660 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
661 * dired.c: Assume HAVE_DIRENT_H.
662 (NAMLEN): Remove, replacing with ...
663 (dirent_namelen): New function. All uses changed. Use the GNU macro
664 _D_EXACT_NAMELEN if available, as it's faster than strlen.
665 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
666 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
667 * makefile.w32-in (DIR_H): Remove. All uses replaced with
668 $(NT_INC)/dirent.h.
669 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
670 * ndir.h: Rename to ../nt/inc/dirent.h.
671 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
672 Do not include <dirent.h>; no longer needed.
673 * w32.c: Include <dirent.h> rather than "ndir.h".
674
12645ae6
CY
6752012-11-23 Chong Yidong <cyd@gnu.org>
676
677 * xftfont.c (xftfont_open): Remove duplicate assignment.
678
5c747675
DA
6792012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
680
681 * alloc.c (Fgarbage_collect): Unblock input after clearing
682 gc_in_progress to avoid note_mouse_highlight glitch with GC.
683 * frame.h (FRAME_MOUSE_UPDATE): New macro.
684 * msdos.c (IT_frame_up_to_date): Use it here...
685 * w32term.c (w32_frame_up_to_date): ...here...
686 * xterm.c (XTframe_up_to_date): ...and here...
687 * nsterm.m (ns_frame_up_to_date): ...but not here.
688 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
689 Adjust users.
690 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
691 Do not check whether GC is in progress.
692
6ceeb5f1
DA
6932012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
694
695 * xdisp.c (window_buffer_changed): New function.
696 (update_menu_bar, update_tool_bar): Use it to
697 simplify large 'if' statements.
698 (redisplay_internal): Generalize commonly used
699 'tail' and 'frame' local variables.
700
ec84768f
EZ
7012012-11-22 Eli Zaretskii <eliz@gnu.org>
702
703 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
704 with Windows system header.
705
9239d970
PE
7062012-11-21 Paul Eggert <eggert@cs.ucla.edu>
707
708 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
709 * alloc.c: Assume unistd.h exists.
710 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
711 * sysdep.c (get_current_dir_name): Assume getcwd exists.
712 (getwd) [USG]: Remove; no longer needed.
713 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
714 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
715 * w32.h (getcwd): Remove decl.
716
954bba56
SM
7172012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
718
719 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
720 Make it set selected_window as well.
721 (update_tool_bar): Use it.
722
6ef2e5ef 7232012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
724
725 * emacs.c (main): Set the G_SLICE environment variable for all
726 Cygwin builds, not just GTK builds. See
727 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
728
6ef2e5ef 7292012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
730
731 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
732 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
733 Define for the MSVC compiler.
734
6ef2e5ef 735 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
736
737 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
738 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
739 dostounix_filename. Prevents crashes down the road, because
740 dostounix_filename assumes it gets a unibyte string. Reported by
741 Michel de Ruiter <michel@sentient.nl>, see
742 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
743
eadf1faa
SM
7442012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
745
746 Conflate Qnil and Qunbound for `symbol-function'.
747 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
748 * lread.c (init_obarray): Set `function' fields to Qnil.
749 * eval.c (Fcommandp): Ignore Qunbound.
750 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
751 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
752 Test NILP rather than Qunbound.
753 (Ffmakunbound): Set to Qnil.
754 (Fsymbol_function): Never signal an error.
755 (Finteractive_form): Ignore Qunbound.
756
b83fdfa9
PE
7572012-11-20 Paul Eggert <eggert@cs.ucla.edu>
758
759 * eval.c (interactive_p): Remove no-longer-used decl.
760
952580c5
DA
7612012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
762
763 * xdisp.c (buffer_shared): Adjust comment.
764 (buffer_shared_and_changed): New function.
765 (prepare_menu_bars, redisplay_internal): Use it to
766 decide whether all windows or frames should be updated.
ea6de9b1
DA
767 (window_outdated): New function.
768 (text_outside_line_unchanged_p, redisplay_window): Use it.
769 (redisplay_internal): Likewise. Fix indentation.
952580c5 770
23ba2705
SM
7712012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
772
773 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
774 (syms_of_eval): Remove corresponding defsubr.
775 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
776
6e9f7997
DC
7772012-11-19 Daniel Colascione <dancol@dancol.org>
778
779 * w32fns.c (Fx_file_dialog):
780 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
781 cygwin_convert_file_name*.
782
783 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
784 Rename cygwin_convert_path* to cygwin_convert_file_name*.
785
552a1590
PE
7862012-11-18 Paul Eggert <eggert@cs.ucla.edu>
787
788 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
789
2ac9538d 7902012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
791
792 * w32select.c: Include w32common.h before w32term.h, so that
793 windows.h gets included before w32term.h uses some of its
794 features, see below.
795
23ba2705
SM
796 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
797 New typedefs.
798 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
799 New prototypes.
d8715cdf
EZ
800 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
801
2ac9538d 8022012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
803
804 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
805 (ns_select): Return at once if events are held (Bug#12834).
806
2ac9538d 8072012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 808
809 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
810 Needed following 2012-10-20 change. (Bug#12902)
811
c1f7ba3a
JB
8122012-11-18 Juanma Barranquero <lekktu@gmail.com>
813
814 * w32proc.c (waitpid): Remove unused label get_result.
815
a75ce9d3
JB
8162012-11-17 Juanma Barranquero <lekktu@gmail.com>
817
818 * makefile.w32-in (SYSWAIT_H): New macro.
819 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
820 ($(BLD)/sysdep.$(O)): Update dependencies.
821
49cdacda
PE
8222012-11-17 Paul Eggert <eggert@cs.ucla.edu>
823
824 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
825 * callproc.c (relocate_fd): Assume F_DUPFD.
826 * emacs.c, term.c (O_RDWR): Remove.
827 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
828 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
829 * nsterm.m: Assume <fcntl.h> exists.
830 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
831 (create_pty, Fmake_network_process, server_accept_connection)
832 (wait_reading_process_output, init_process_emacs):
833 Assume O_NONBLOCK.
834 (wait_reading_process_output): Put in a special case for WINDOWSNT
835 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
836 It's not clear this is needed, but it's a more-conservative change.
837 (create_process): Assume FD_CLOEXEC.
838 (create_process, create_pty): Assume O_NOCTTY.
839 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
840 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
841 Omit if not DOS_NT, since F_GETFL is not defined there.
842 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
843 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
844 (O_NOCTTY): Remove.
845 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
846 lack it, since gnulib guarantees this.
847 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
848
22bae83f
EZ
8492012-11-17 Eli Zaretskii <eliz@gnu.org>
850
6ad30855
EZ
851 * w32.c (faccessat): Pretend that directories have the execute bit
852 set. Emacs expects that, e.g., in files.el:cd-absolute.
853
22bae83f
EZ
854 * w32proc.c (create_child): Don't clip the PID of the child
855 process to fit into an Emacs integer, as this is no longer a
856 restriction.
857 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
858 reaping only the process specified by PID argument, if that is
859 positive. Use PID instead of dead_child to know which process to
860 reap. Wait for the child to die only if WNOHANG is not in
861 OPTIONS.
862 (sys_select): Don't set dead_child.
863
864 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
865 as it is no longer needed.
866
867 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
868 no longer needed.
869 (record_child_status_change): Remove the setting of
870 record_at_most_one_child for the !WNOHANG case.
871
a631d0e0
PE
8722012-11-17 Paul Eggert <eggert@cs.ucla.edu>
873
874 Fix problems in ns port found by static checking.
875 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
876 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
877 not to process group.
878 (ns_select): Use emacs_write, not write, as that's more robust
879 in the presence of signals.
880 (fd_handler:): Check for read errors.
881
d56f2e49
GM
8822012-11-16 Glenn Morris <rgm@gnu.org>
883
884 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
885
96e05507 8862012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
887
888 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
889
96e05507 8902012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
891
892 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
893 use the same value of thread handle.
894 (start_timer_thread): If the timer thread exited (due to error),
895 clean up by closing the two handles it used. Duplicate the caller
896 thread's handle here, so it gets duplicated only once, when
897 launching the timer thread. Set priority of the timer thread, not
898 the caller thread.
899 (getitimer): Don't duplicate the caller thread's handle here.
900 (Bug#12832)
901
96e05507 9022012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
903
904 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
905 called (Bug#12834).
906
3d082a26
PE
9072012-11-16 Paul Eggert <eggert@cs.ucla.edu>
908
909 Remove no-longer-used pty_max_bytes variable.
910 * process.c (pty_max_bytes): Remove; unused.
911 (send_process): Do not set it.
912
b72c161c
JB
9132012-11-15 Juanma Barranquero <lekktu@gmail.com>
914
915 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
916 Update dependencies.
917
bf20ea80
PE
9182012-11-15 Paul Eggert <eggert@cs.ucla.edu>
919
920 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
921 This follows up on the 2012-09-29 patch that removed indirection
922 for the 'function' field. Reported by Sergey Vinokurov in
923 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
924
14f20728
EZ
9252012-11-14 Eli Zaretskii <eliz@gnu.org>
926
927 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
928 different name, as the MS runtime does not have such a function,
929 and probably never will.) All callers changed. Ignore DIRFD
930 value if PATH is an absolute file name, to match Posix spec
931 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
932 symlinks.
933
77731919
DA
9342012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
935
936 * xdisp.c (echo_area_display, redisplay_internal):
937 Omit redundant check whether frame_garbaged is set.
938
73dcdb9f
PE
9392012-11-14 Paul Eggert <eggert@cs.ucla.edu>
940
941 Use faccessat, not access, when checking file permissions (Bug#12632).
942 This fixes a bug that has been present in Emacs since its creation.
943 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
944 which must set some sort of record. (Torek's bug report was against
945 a predecessor of GNU Emacs, but GNU Emacs happened to have the
946 same common flaw.) See Torek's Usenet posting
947 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
948 Posted: Fri Apr 8 14:18:56 1983.
949 * Makefile.in (LIB_EACCESS): New macro.
950 (LIBES): Use it.
951 * callproc.c (init_callproc):
952 * charset.c (init_charset):
953 * fileio.c (check_existing, check_executable, check_writable)
954 (Ffile_readable_p):
955 * lread.c (openp, load_path_check):
956 * process.c (allocate_pty):
957 * xrdb.c (file_p):
958 Use effective UID when checking permissions, not real UID.
959 * callproc.c (init_callproc):
960 * charset.c (init_charset):
961 * lread.c (load_path_check, init_lread):
962 Test whether directories are accessible, not merely whether they exist.
963 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
964 * fileio.c (check_existing, check_executable, check_writable)
965 (Ffile_readable_p):
966 Use symbolic names instead of integers for the flags, as they're
967 portable now.
968 (check_writable): New arg AMODE. All uses changed.
969 Set errno on failure.
970 (Ffile_readable_p): Use faccessat, not stat + open + close.
971 (Ffile_writable_p): No need to call check_existing + check_writable.
972 Just call check_writable and then look at errno. This saves a syscall.
973 dir should never be nil; replace an unnecessary runtime check
974 with an eassert. When checking the parent directory of a nonexistent
975 file, check that the directory is searchable as well as writable, as
976 we can't create files in unsearchable directories.
977 (file_directory_p): New function, which uses 'stat' on most platforms
978 but faccessat with D_OK (for efficiency) if WINDOWSNT.
979 (Ffile_directory_p, Fset_file_times): Use it.
980 (file_accessible_directory_p): New function, which uses a single
981 syscall for efficiency.
982 (Ffile_accessible_directory_p): Use it.
983 * xrdb.c (file_p): Use file_directory_p.
984 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
985 * lread.c (openp): When opening a file, use fstat rather than
986 stat, as that avoids a permissions race. When not opening a file,
987 use file_directory_p rather than stat.
988 (dir_warning): First arg is now a usage string, not a format.
989 Use errno. All uses changed.
990 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
991 that merely introduced a race.
992 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
993 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
994 and similarly for the other O_* flags.
995 * w32.c (sys_faccessat): Rename from sys_access and switch to
996 faccessat's API. All uses changed.
997 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
998 (magic_db): Rename from magic_file_p.
999 (magic_db, search_magic_path): Return an XrmDatabase rather than a
1000 char *, so that we don't have to test for file existence
1001 separately from opening the file for reading. This removes a race
1002 fixes a permission-checking problem, and simplifies the code.
1003 All uses changed.
1004 (file_p): Remove; no longer needed.
1005
2a14f83b
DA
10062012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
1007
1008 Omit glyphs initialization at startup.
1009 * dispnew.c (glyphs_initialized_initially_p): Remove.
1010 (adjust_frame_glyphs_initially): Likewise. Adjust users.
1011 (Fredraw_frame): Move actual code from here...
c7085245 1012 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
1013 (Fredraw_display): Use redraw_frame.
1014 * xdisp.c (clear_garbaged_frames): Likewise.
1015
f78ee6af 10162012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
1017
1018 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
1019 passed to pint2str and pint2hrstr to be at most the size of the
1020 frame's decode_mode_spec_buffer. This avoids crashes with very
1021 large values of FIELD_WIDTH argument to decode_mode_spec.
1022 (Bug#12867)
1023
b95a9c0c
PE
10242012-11-13 Paul Eggert <eggert@cs.ucla.edu>
1025
1026 Fix a race with verify-visited-file-modtime (Bug#12863).
1027 Since at least 1991 Emacs has ignored an mtime difference of no
1028 more than one second, but my guess is that this was to work around
1029 file system bugs that were fixed long ago. Since the race is
1030 causing problems now, let's remove that code.
1031 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
1032 whose time stamp is off by no more than a second. Insist that the
1033 file time stamps match exactly.
1034
be49ba74
DA
10352012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1036
1037 * frame.h (struct frame): Convert external_tool_bar member to
1038 1-bit unsigned bitfield.
1039 * termhooks.h (struct terminal): Remove mouse_moved member since
1040 all users are long dead. Adjust comment on mouse_position_hook.
1041
5b04e9f9
DA
10422012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
1043
1044 Simplify by using FOR_EACH_FRAME here and there.
1045 * frame.c (next_frame, prev_frame, other_visible_frames)
1046 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
1047 * w32term.c (x_window_to_scroll_bar): Likewise.
1048 * window.c (window_list): Likewise.
1049 * xdisp.c (x_consider_frame_title): Likewise.
1050 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
1051 * xfns.c (x_window_to_frame, x_any_window_to_frame)
1052 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
1053 * xmenu.c (menubar_id_to_frame): Likewise.
1054 * xselect.c (frame_for_x_selection): Likewise.
1055 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
1056 (x_window_to_menu_bar): Likewise.
1057 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
1058
76ae24d7
PE
10592012-11-12 Paul Eggert <eggert@cs.ucla.edu>
1060
12cc4337
PE
1061 * data.c (Qdefalias_fset_function): Now static.
1062
76ae24d7
PE
1063 Another tweak to vectorlike_header change.
1064 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
1065 Remove, and replace all uses with ...
1066 (next_in_free_list, set_next_in_free_list):
1067 New functions, which respect C's aliasing rules better.
1068
1479c557
PE
10692012-11-11 Paul Eggert <eggert@cs.ucla.edu>
1070
1071 * window.c (list4i): Rename from 'quad'. All uses changed.
1072 Needed because <sys/types.h> defines 'quad' on Solaris 10.
1073
11235c03
JB
10742012-11-11 Juanma Barranquero <lekktu@gmail.com>
1075
1076 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
1077 warning about mixing declarations and code in ISO C90.
1078
6baf66d5 10792012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
1080
1081 * window.c (Fsplit_window_internal): Set combination limit of
1082 new parent window to t iff Vwindow_combination_limit is t;
1083 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 1084 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 1085
6baf66d5 10862012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
1087
1088 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
1089 amount when the scroll margins are too large. When scrolling
1090 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
1091 scroll margin within a reasonable number of screen lines.
1092 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
1093 point is positioned many lines beyond the window top/bottom.
1094 (Bug#12811)
1095
508f51f5
EZ
1096 * ralloc.c (relinquish): If real_morecore fails to return memory
1097 to the system, don't crash; instead, leave the last heap
1098 unchanged and return. (Bug#12774)
1099
32e5c58c
SM
11002012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1101
1102 * lisp.h (AUTOLOADP): New macro.
1103 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
1104 * data.c (Ffset): Remove special ad-advice-info handling.
1105 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
1106 (Fsubr_arity): CSE.
1107 (Finteractive_form): Simplify.
1108 (Fquo): Don't insist on having at least 2 arguments.
1109 (Qdefalias_fset_function): New var.
1110
719b0aa5
JD
11112012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1112
4ab15c3e
JD
1113 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
1114
719b0aa5
JD
1115 * nsfont.m (Qcondensed, Qexpanded): New variables.
1116 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
1117 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
1118
535cc8e9
DA
11192012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1120
1121 Fix recently introduced crash on MS-Windows (Bug#12839).
1122 * w32term.h (struct scroll_bar): Use convenient header.
1123 (SCROLL_BAR_VEC_SIZE): Remove.
1124 * w32term.c (x_scroll_bar_create): Use VECSIZE.
1125
7d377c48
DA
11262012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
1127
1128 Tweak last vectorlike_header change.
1129 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
1130 vectorlike object on the free list. This is introduced to avoid
1131 some (but not all) pointer casting and aliasing problems, see
1132 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
1133 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
1134 objects.
1135 (xvectype, xvecsize): Use them to examine Lisp_Object values.
1136
7ad27466
JD
11372012-11-09 Jan Djärv <jan.h.d@swipnet.se>
1138
32e5c58c 1139 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
1140 been removed, so remove them here also.
1141
57618ecf
SM
11422012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
1143
1144 * doc.c (Fdocumentation): Handle new property
1145 dynamic-docstring-function to replace the old ad-advice-info.
1146
53371430
PE
11472012-11-09 Paul Eggert <eggert@cs.ucla.edu>
1148
1149 * fns.c (Qeql, hashtest_eq): Now static.
1150
61ddb1b9
SM
11512012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1152
1153 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
1154 * fns.c (hashfn_eq, hashfn_eql, sxhash):
1155 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
1156 * buffer.c (compare_overlays): Use XLI rather than XHASH.
1157
04a2d0d3
PE
11582012-11-08 Paul Eggert <eggert@cs.ucla.edu>
1159
1160 Use same hash function for hashfn_profiler as for hash_string etc.
1161 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
1162 * lisp.h (sxhash_combine): New inline function, with the contents
1163 of the old SXHASH_COMBINE.
1164 * profiler.c (hashfn_profiler): Use it, instead of having a
1165 special hash function containing a comparison that always yields 1.
1166
de5ef41a
SM
11672012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1168
1169 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
1170 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
1171 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
1172 Remove unused vars.
1173
a23c4171
JD
11742012-11-08 Jan Djärv <jan.h.d@swipnet.se>
1175
1176 * image.c (xpm_make_color_table_h): Fix compiler error because
1177 make_hash_table changed.
1178
074d7bb0
JD
11792012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
1180
1181 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
1182
b7432bb2
SM
11832012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
1184
1185 Use ad-hoc comparison function for the profiler's hash-tables.
1186 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
1187 (make_log): Use them.
1188 (handle_profiler_signal): Don't inhibit quit any longer since we don't
1189 call Fequal any more.
1190 (Ffunction_equal): New function.
1191 (cmpfn_profiler, hashfn_profiler): New functions.
1192 (syms_of_profiler): Initialize them.
1193 * lisp.h (struct hash_table_test): New struct.
1194 (struct Lisp_Hash_Table): Use it.
1195 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
1196 * fns.c (make_hash_table): Take a struct to describe the test.
1197 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
1198 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
1199 (hash_lookup, hash_remove_from_table): Move assertion checking of
1200 hashfn result here. Check hash-equality before calling cmpfn.
1201 (Fmake_hash_table): Adjust call to make_hash_table.
1202 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
1203 (syms_of_fns): Initialize them.
1204 * emacs.c (main): Move syms_of_fns earlier.
1205 * xterm.c (syms_of_xterm):
1206 * category.c (hash_get_category_set): Adjust call to make_hash_table.
1207 * print.c (print_object): Adjust to new hash-table struct.
1208 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
1209
88002743
EZ
12102012-11-08 Eli Zaretskii <eliz@gnu.org>
1211
1212 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
1213 value of w32-scroll-lock-modifier is neither nil nor one of the
1214 known key modifiers. (Bug#12806)
1215
914adc42
DA
12162012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1217
1218 Shrink struct vectorlike_header to the only size field.
1219 * lisp.h (enum pvec_type): Avoid explicit enum member values.
1220 Adjust comment.
1221 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
1222 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
1223 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
1224 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
1225 information from the vector header. Adjust comment.
1226 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
1227 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
1228 layout.
1229 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
1230 (struct vectorlike_header): Remove next member. Adjust comment.
1231 (struct Lisp_Subr): Add convenient header. Adjust comment.
1232 (allocate_pseudovector): Adjust prototype.
1233 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
1234 (sweep_string, lisp_malloc): Remove useless prototypes.
1235 (enum mem_type): Adjust comment.
1236 (NEXT_IN_FREE_LIST): New macro.
1237 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
1238 (Fmake_bool_vector): Likewise.
1239 (struct large_vector): New type to represent allocation unit for
1240 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
1241 (large_vectors): Change type to struct large_vector.
1242 (allocate_vector_from_block): Simplify.
1243 (PSEUDOVECTOR_NBYTES): Replace with...
1244 (vector_nbytes): ...new function. Adjust users.
1245 (sweep_vectors): Adjust processing of large vectors.
1246 (allocate_vectorlike): Likewise.
1247 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
1248 Add easserts. Adjust XSETPVECTYPESIZE usage.
1249 (allocate_buffer): Use BUFFER_PVEC_INIT.
1250 (live_vector_p): Adjust to match large vector.
1251 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
1252 * buffer.h (struct buffer): Add next member.
1253 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
1254 New macros.
1255 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
1256 * fns.c (internal_equal): Adjust to match enum pvec_type change.
1257 (copy_hash_table): Adjust to match vector header change.
1258 * lread.c (defsubr): Use XSETPVECTYPE.
1259 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
1260 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
1261 (xvecsize): New command.
1262
c66f21ea
DA
12632012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
1264
1265 * keyboard.c (event_to_kboard): Do not dereference
1266 frame_or_window field of SELECTION_REQUEST_EVENT
1267 and SELECTION_CLEAR_EVENT events (Bug#12814).
1268 * xterm.h (struct selection_input_event): Adjust comment.
1269
eb147960
EZ
12702012-11-07 Eli Zaretskii <eliz@gnu.org>
1271
dab72075
EZ
1272 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
1273 such as Scroll Lock, if the respective keys are treated as
1274 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 1275 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 1276
5890e400
DA
12772012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
1278
1279 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
1280
b6b3b294
PE
12812012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1282
1283 Restore some duplicate definitions (Bug#12814).
1284 This undoes part of the 2012-11-03 changes. Some people build
1285 with plain -g rather than with -g3, and they need the duplicate
1286 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
1287 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
1288 Define as macros, as well as as enums or as constants.
1289
e770aad5
JD
12902012-11-06 Jan Djärv <jan.h.d@swipnet.se>
1291
1292 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
1293 to keypad keys (Bug#12816).
1294
68f8f1c0
PE
12952012-11-06 Paul Eggert <eggert@cs.ucla.edu>
1296
1297 Minor adjustments of recently-changed frame functions.
1298 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
1299 known to be a frame (we're in the FRAMEP branch).
1300 * lisp.h (Qframep): Remove decl. frame.h declares this.
1301 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
1302 since they're meant for Lisp fixnum values.
1303
72f94d4b
DA
13042012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1305
1306 * window.c (Fwindow_combination_limit): Revert to the only
1307 required argument and adjust docstring as suggested in
1308 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
1309 by Martin Rudalics <rudalics@gmx.at>.
1310
d9f07150
DA
13112012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1312
1313 Widely used frame validity and checking functions.
1314 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
1315 * frame.c (decode_live_frame, decode_any_frame): New functions.
1316 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
1317 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
1318 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
1319 (Fframe_pointer_visible_p): Use decode_any_frame.
1320 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
1321 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
1322 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
1323 (Fframe_focus): Likewise. Allow zero number of arguments.
1324 Adjust docstring.
1325 (frame_buffer_list, frame_buffer_predicate): Remove.
1326 * lisp.h (frame_buffer_predicate): Remove prototype.
1327 * buffer.c (Fother_buffer): Use decode_any_frame.
1328 * xdisp.c (Ftool_bar_lines_needed): Likewise.
1329 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
1330 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
1331 (Fclose_font, Ffont_info): Use decode_live_frame.
1332 * fontset.c (check_fontset_name): Likewise.
1333 * terminal.c (Fframe_terminal): Likewise.
1334 * w32fns.c (check_x_frame): Likewise.
1335 * window.c (Fminibuffer_window, Fwindow_at)
1336 (Fcurrent_window_configuration): Likewise.
1337 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
1338 Likewise. Allow zero number of arguments. Adjust docstring.
1339 * dispnew.c (Fredraw_frame): Likewise.
1340 * xfaces.c (frame_or_selected_frame): Remove.
1341 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
1342 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
1343 (Fframe_face_alist): Use decode_live_frame.
1344 * xfns.c (check_x_frame): Likewise.
1345
89bc0592
DA
13462012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
1347
1348 * window.c (quad): New function.
1349 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
1350 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
1351 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
1352 (Fwindow_line_height): Use it.
1353 (Fwindow_fringes): Use list3.
1354 (Fwindow_scroll_bars): Use list4.
1355 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
1356 (Fwindow_combination_limit): Allow zero number of arguments.
1357
c8e3a9c3
EZ
13582012-11-05 Eli Zaretskii <eliz@gnu.org>
1359
1360 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
1361
8e2417bf 1362 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 1363 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 1364 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 1365
209c6a58
CY
13662012-11-05 Chong Yidong <cyd@gnu.org>
1367
1368 * process.c (wait_reading_process_output): Revert previous change.
1369
8148369c
PE
13702012-11-05 Paul Eggert <eggert@cs.ucla.edu>
1371
dd0333b6
PE
1372 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
1373 This removes code that has been obsolete since around 1990.
1374 * callproc.c (Fcall_process):
1375 * emacs.c (main):
1376 * process.c (create_process):
1377 * term.c (dissociate_if_controlling_tty):
1378 Assume setsid exists.
1379 * callproc.c (child_setup): Assume setpgid exists and behaves as
1380 per POSIX.1-1988 or later.
1381 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
1382 * emacs.c (shut_down_emacs):
1383 * sysdep.c (sys_suspend, init_foreground_group):
1384 Assume getpgrp behaves as per POSIX.1-1998 or later.
1385 * msdos.c (setpgrp): Remove.
1386 (tcgetpgrp, setpgid, setsid): New functions.
1387 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
1388 * term.c (no_controlling_tty): Remove; unused.
1389 * w32proc.c (setpgrp): Remove.
1390 (setsid, tcgetpgrp): New functions.
1391
8148369c
PE
1392 Simplify by assuming __fpending.
1393 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
1394 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
1395 Do not assume that __fpending's result fits in int.
1396
76abf5e5
PE
13972012-11-04 Paul Eggert <eggert@cs.ucla.edu>
1398
06b63c9b
PE
1399 Remove EMACS_OUTQSIZE+sleep hack.
1400 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
1401 than 2400 bps, which throttled Emacs by having it sleep.
1402 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
1403 was added, and anyway those old terminals are long dead.
1404 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
1405 without the dispnew.c change, as dispnew.c doesn't include systty.h.
1406
76abf5e5
PE
1407 Fix data-loss with --version (Bug#9574).
1408 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
1409 as we can't assume that emacs_strerror is initialized, and strerror
1410 is good enough here.
1411 (main): Invoke atexit earlier, to catch earlier instances of
1412 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
1413
8f31e74b
MM
14142012-11-04 Michael Marchionna <tralfaz@pacbell.net>
1415
1416 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
1417 (keyDown): Remap keypad keys to X11 virtual key codes.
1418
0d879dca
PE
14192012-11-03 Paul Eggert <eggert@cs.ucla.edu>
1420
7ccfb720
PE
1421 Fix data-loss with --batch (Bug#9574).
1422 * emacs.c: Include <close-stream.h>.
1423 (close_output_streams): New function.
1424 (main): Pass it to atexit, so that Emacs closes stdout and stderr
1425 and handles errors appropriately.
1426 (Fkill_emacs): Don't worry about flushing, as close_output_stream
1427 does that now.
1428
0b3d4a47
PE
1429 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
1430 The symptom is a diagnostic "GLib-WARNING **: In call to
1431 g_spawn_sync(), exit status of a child process was requested but
1432 SIGCHLD action was set to SIG_IGN and ECHILD was received by
1433 waitpid(), so exit status can't be returned." The diagnostic
1434 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
1435 The real bug is a race condition between Emacs and glib: Emacs
1436 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
1437 so that glib can't find it. Work around the bug by invoking
1438 waitpid only on subprocesses that Emacs itself creates.
1439 * process.c (create_process, record_child_status_change):
1440 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
1441 know the pid rather than having the callee infer it.
1442 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
1443 (create_process): Set new 'alive' member if child is created.
1444 (process_status_retrieved): New function.
1445 (record_child_status_change): Use it.
1446 Accept negative 1st argument, which means to wait for the
1447 processes that Emacs already knows about. Move special-case code
1448 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
1449 processes that have already been waited for, by testing and
1450 clearing new 'alive' member.
1451 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
1452 now does this internally.
1453 (handle_child_signal): Let record_child_status_change do all
1454 the work, since we do not want to reap all exited child processes,
1455 only the child processes that Emacs itself created.
1456 * process.h (Lisp_Process): New boolean member 'alive'.
1457
0d879dca
PE
1458 Omit duplicate definitions no longer needed with gcc -g3.
1459 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
1460 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
1461 Define only as macros. There's no longer any need to also define
1462 these symbols as enums or as constants, since we now assume
1463 gcc -g3 when debugging.
1464
3478f4b5
EZ
14652012-11-03 Eli Zaretskii <eliz@gnu.org>
1466
1467 * lisp.mk: Adjust comments to the fact that term/internal is now
1468 loaded from loadup.el.
1469
1470 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
1471 (msdos_fatal_signal): New function.
1472 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
1473 its argument list.
1474
1475 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
1476 for GCC versions before 4.
1477 (emacs_raise): Define to call msdos_fatal_signal.
1478
1479 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
1480 iterator when starting in the middle of a display or overlay
1481 string. (Bug#12745)
1482
85fabcb7
CY
14832012-11-03 Chong Yidong <cyd@gnu.org>
1484
1485 * process.c (wait_reading_process_output): Clean up the last
1486 change.
1487
893cc455
CY
14882012-11-03 Jim Paris <jim@jtan.com> (tiny change)
1489
1490 * process.c (wait_reading_process_output): Avoid a race condition
1491 with SIGIO delivery (Bug#11536).
1492
0f7b074f
CY
14932012-11-03 Chong Yidong <cyd@gnu.org>
1494
1495 * buffer.c (cursor_type): Untabify docstring.
1496
3737fee7
DA
14972012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1498
1499 * frame.h (struct frame): Drop can_have_scroll_bars member
1500 which is meaningless for a long time. Adjust comments.
1501 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
1502 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
1503
b6a9e8b1
DA
15042012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
1505
1506 * window.c (decode_next_window_args): Update window arg after
1507 calling decode_live_window and so fix crash reported at
1508 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
1509 by Juanma Barranquero <lekktu@gmail.com>.
1510 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
1511 * font.c (Ffont_at): Likewise.
1512
600d4768
JD
15132012-11-01 Jan Djärv <jan.h.d@swipnet.se>
1514
1515 * widget.c (resize_cb): New function.
1516 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
1517 (EmacsFrameResize): Check if all is up to date before changing frame
1518 size.
1519
1005b4b9
EZ
15202012-11-02 Eli Zaretskii <eliz@gnu.org>
1521
1522 Implement backtrace output for fatal errors on MS-Windows.
1523 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
1524 (BACKTRACE_LIMIT_MAX): New macro.
1525 (w32_backtrace): New function.
1526 (emacs_abort): Use w32_backtrace when the user chooses not to
1527 attach a debugger. Update the text of the abort dialog.
1528
b9e9df47
DA
15292012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1530
1531 Window-related stuff cleanup here and there.
1532 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
1533 Use decode_any_window.
1534 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
1535 * xdisp.c (Fformat_mode_line): Likewise.
1536 * font.c (Ffont_at): Use decode_live_window.
1537 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
1538 * window.c (decode_next_window_args): Likewise.
1539 (decode_any_window): Remove static.
1540 * window.h (decode_any_window): Add prototype.
1541 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
1542 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
1543 respectively.
1544
2b371ff7
DA
15452012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
1546
1547 Remove pad from struct input_event.
1548 * termhooks.h (struct input_event): Remove padding field.
1549 Adjust comment.
1550 * keyboard.c (event_to_kboard): Simplify because frame_or_window
1551 member is never cons for a long time. Adjust comment.
1552 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
1553 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
1554 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
1555 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
1556
7e8b50d9
EZ
15572012-11-01 Eli Zaretskii <eliz@gnu.org>
1558
1559 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
1560
322aea6d
PE
15612012-10-31 Paul Eggert <eggert@cs.ucla.edu>
1562
1563 Fix crash when using Emacs as commit editor for git (Bug#12697).
1564 * callproc.c (setpgrp): Remove macro, as we now use setpgid
1565 and it is configured in conf_post.h.
1566 (Fcall_process): Don't invoke both setsid and setpgid; the former
1567 is enough, if it exists.
1568 * callproc.c (Fcall_process, child_setup):
1569 * process.c (create_process): Use setpgid.
1570 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
1571 for the real thing.
1572 * dispnew.c (init_display): Initialize the foreground group
1573 if we are running a tty display.
1574 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
1575 * lisp.h (init_foreground_group): New decl.
1576 * sysdep.c (inherited_pgroup): New static var.
1577 (init_foreground_group, tcsetpgrp_without_stopping)
1578 (narrow_foreground_group, widen_foreground_group): New functions.
1579 (init_sys_modes): Narrow foreground group.
1580 (reset_sys_modes): Widen foreground group.
1581
220cb2bd
MA
15822012-10-31 Michael Albinus <michael.albinus@gmx.de>
1583
1584 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
1585
218e997a
MR
15862012-10-31 Martin Rudalics <rudalics@gmx.at>
1587
1588 * minibuf.c (read_minibuf): Restore current buffer since
1589 choose_minibuf_frame calling Fset_frame_selected_window may
1590 change it (Bug#12766).
1591
02615da0
JD
15922012-10-30 Jan Djärv <jan.h.d@swipnet.se>
1593
1594 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
1595
aee5b18e
KH
15962012-10-30 Kenichi Handa <handa@gnu.org>
1597
1598 * font.c (Ffont_at): If WINDOW is specified and it is not
1599 displaying the current buffer, signal an error.
1600
ba116008
DC
16012012-10-29 Daniel Colascione <dancol@dancol.org>
1602
de5ef41a
SM
1603 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
1604 In preparation for fixing bug#12739, move these functions from
ba116008
DC
1605 here...
1606
1607 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
1608 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
1609 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 1610
640bf8ad
EZ
16112012-10-28 Eli Zaretskii <eliz@gnu.org>
1612
1613 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
1614 (timer_loop, getitimer, setitimer): Use it instead of
1615 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
1616 'clock'.
1617 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
1618 literal 10000.
1619
64ccff5f
JD
16202012-10-28 Jan Djärv <jan.h.d@swipnet.se>
1621
1622 * nsterm.m (NO_APPDEFINED_DATA): New define.
1623 (last_appdefined_event_data): New variable
1624 (last_appdefined_event): Remove.
1625 (ns_select): Initialize t from last_appdefined_event_data instead
1626 of [last_appdefined_event data1].
1627 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
1628 remove last_appdefined_event (Bug#12698).
1629
e483264c
SM
16302012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
1631
1632 * frame.c (x_set_font): Catch internal error.
1633
6c16c13e
EZ
16342012-10-27 Eli Zaretskii <eliz@gnu.org>
1635
e483264c
SM
1636 Avoid overflow in w32 implementation of interval timers.
1637 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
1638 actually executes.
1639 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
1640 'volatile ULONGLONG' types. All the other data which was
1641 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
1642 (GetThreadTimes_Proc): New typedef.
1643 (w32_get_timer_time): New function, returns a suitable time value
1644 for the timer.
1645 (timer_loop): Enter critical section when accessing ULONGLONG
1646 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
1647 atomic. Call 'w32_get_timer_time' instead of 'clock'.
1648 Remove unused variable.
6c16c13e
EZ
1649 (init_timers): Initialize s_pfn_Get_Thread_Times.
1650 (start_timer_thread): Don't assign itimer->caller_thread here.
1651 (getitimer): Assign itimer->caller_thread here.
1652 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 1653 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 1654
ccc83f50
EZ
16552012-10-26 Eli Zaretskii <eliz@gnu.org>
1656
1657 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
1658 mouse movement events if the menu bar is active. This avoids
1659 producing a busy "hour-glass" cursor by Windows if the mouse
1660 pointer is positioned over a tooltip shown for some menu item.
1661
69deda53
PE
16622012-10-25 Paul Eggert <eggert@cs.ucla.edu>
1663
1664 Don't assume process IDs fit in int.
1665 * emacs.c (shut_down_emacs) [!DOS_NT]:
1666 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
1667 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
1668 Use pid_t, not int, to store process IDs, as 'int'
1669 is not wide enough on a few platforms (e.g., AIX and IRIX).
1670
7e70a152
KH
16712012-10-23 Kenichi Handa <handa@gnu.org>
1672
1673 The following change is to make face-font-rescale-alist work
1674 correctly for non-ASCII fonts.
1675
1676 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
1677 (font_open_for_lface): Handle Vface_font_rescale_alist.
1678
49238e7f
CY
16792012-10-23 Chong Yidong <cyd@gnu.org>
1680
1681 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
1682
5ec86886
JD
16832012-10-21 Jan Djärv <jan.h.d@swipnet.se>
1684
ef446959
JD
1685 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
1686 for screen font.
1687 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
1688
5ec86886
JD
1689 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
1690 event (Bug#12681).
1691
ee7a418d
GM
16922012-10-21 Glenn Morris <rgm@gnu.org>
1693
1694 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
1695
4973679b
PE
16962012-10-20 Paul Eggert <eggert@cs.ucla.edu>
1697
1698 Port to OpenBSD 5.1.
1699 * frame.c (Fmouse_position, Fmouse_pixel_position):
1700 * xdisp.c (produce_stretch_glyph):
1701 Declare local vars only when they're needed.
1702 This is clearer and avoids a warning on OpenBSD about unused vars.
1703 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
1704 This is safer, and avoids OpenBSD warnings about unused vars.
1705 * keyboard.c (record_menu_key): Remove unnecessary decl.
1706 (poll_timer): Define only if POLL_FOR_INPUT is defined.
1707 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
1708 as our definition clashes with OpenBSD's.
1709 * xfaces.c (load_face_colors, check_lface_attrs)
1710 (get_lface_attributes_no_remap, get_lface_attributes)
1711 (lface_fully_specified_p, x_supports_face_attributes_p)
1712 (tty_supports_face_attributes_p, face_fontset, realize_face)
1713 (realize_x_face, realize_tty_face):
1714 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
1715 merely Lisp_Object *. This is more informative and avoids
1716 a warning on OpenBSD about accessing beyond an object's size.
1717
c664f463
CY
17182012-10-20 Chong Yidong <cyd@gnu.org>
1719
1720 * lread.c (Fload): Doc fix (Bug#12592).
1721
6ec83f92 17222012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
1723
1724 * font.c (Ffont_at): Fix previous change.
1725
d2824928
EZ
17262012-10-19 Eli Zaretskii <eliz@gnu.org>
1727
e483264c
SM
1728 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
1729 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
1730 for the reasons.
1731
d2824928
EZ
1732 * alloc.c (NSTATICS): Decrease to 0x800.
1733
f60d391f
SM
17342012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
1735
4a0e1924 1736 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
1737 error (bug#12677).
1738
1a9327d5
JD
17392012-10-18 Jan Djärv <jan.h.d@swipnet.se>
1740
1741 * nsterm.m (ns_select): Check writefds before call to
1742 FD_ISSET (Bug#12668).
1743
14145a1e
DC
17442012-10-18 Daniel Colascione <dancol@dancol.org>
1745
1746 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
1747 (staticpro): If we run out of staticpro slots, die with an
1748 informative error instead of just calling emacs_abort.
1749
1f76f6f5
MR
17502012-10-18 Martin Rudalics <rudalics@gmx.at>
1751
1752 Fix two flaws reported by Dmitry Antipov.
1753 * window.c (Ftemp_output_buffer_show): Remove.
1754 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
1755 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
1756
fcf14875
EZ
17572012-10-17 Eli Zaretskii <eliz@gnu.org>
1758
1f76f6f5
MR
1759 * makefile.w32-in ($(BLD)/w32.$(O)):
1760 ($(BLD)/vm-limit.$(O)):
1761 ($(BLD)/term.$(O)):
1762 ($(BLD)/unexw32.$(O)):
1763 ($(BLD)/fileio.$(O)):
a68089e4
EZ
1764 ($(BLD)/dispnew.$(O)): Update dependencies.
1765
1766 * w32term.h (w32_initialize_display_info, initialize_w32_display):
1767 Add prototypes.
1768
1769 * w32proc.c: Include ctype.h.
1770
1771 * w32.h (init_environment, check_windows_init_file)
1772 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
1773 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
1774 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
1775 (sys_link): Add prototypes.
1776
1777 * w32.c: Include w32select.h.
1778 (sys_access, e_malloc, sys_select): Add prototypes.
1779 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
1780
1781 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
1782
1783 * unexw32.c: Include lisp.h and w32.h.
1784
1785 * term.c [WINDOWSNT]: Include w32term.h.
1786
1787 * process.c [WINDOWSNT]: Add prototype of sys_select.
1788
1789 * fileio.c [WINDOWSNT]: Include w32.h.
1790
1791 * dispnew.c [WINDOWSNT]: Include w32.h.
1792
fcf14875
EZ
1793 * cygw32.c (Fcygwin_convert_path_to_windows)
1794 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
1795 Lisp_Object values. (Bug#12661)
1796
1797 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
1798 to Lisp_Object. (Bug#12661)
1799
fe0b1ec4
KH
18002012-10-17 Kenichi Handa <handa@gnu.org>
1801
1802 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
1803 invalidate.
1804
d556ebf9
DA
18052012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1806
1807 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 1808 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 1809
f0863a54
DA
18102012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
1811
1812 Do not verify indirection counters of killed buffers (Bug#12579).
1813 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
1814 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
1815
12fbe755
DA
18162012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1817
1818 * alloc.c (Fmake_byte_code): Fix typo in comment.
1819 * print.c (print_interval): Define as static to match prototype.
1820 * indent.c (disptab_matches_widthtab, recompute_width_table):
1821 Convert to eassert.
1822
61655b89
DA
18232012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
1824
1825 * editfns.c (get_system_name): Remove.
1826 * lisp.h (get_system_name): Remove prototype.
1827 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
1828 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
1829
9520f2f2
DC
18302012-10-15 Daniel Colascione <dancol@dancol.org>
1831
1832 * dbusbind.c: Add comment explaining reason for previous change.
1833
dca778d5
MR
18342012-10-15 Martin Rudalics <rudalics@gmx.at>
1835
1836 * window.c (Fwindow_end): Rewrite check whether cached position
1837 can be used (Bug#12600).
1838 (resize_frame_windows, grow_mini_window, shrink_mini_window):
1839 Set windows_or_buffers_changed.
1840
3e0341b0
DC
18412012-10-15 Daniel Colascione <dancol@dancol.org>
1842
1843 * dbusbind.c: Fix cygw32 build break when compiling with dbus
1844 enabled by undefining the symbol "interface", which the platform
1845 headers define to something incompatible.
1846
33d4113c
DC
18472012-10-14 Daniel Colascione <dancol@dancol.org>
1848
1849 * image.c (init_tiff_functions, init_imagemagick_functions)
1850 (init_svg_functions): Fix cygw32 build break by using these
1851 functions only when WINDOWSNT _and_ HAVE_NTGUI.
1852
a36fb15e
JD
18532012-10-14 Jan Djärv <jan.h.d@swipnet.se>
1854
1855 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
1856
537f336d
JD
18572012-10-13 Jan Djärv <jan.h.d@swipnet.se>
1858
1859 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
1860
0ba06a77
KH
18612012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
1862
1863 * coding.c (detect_coding): Set coding->id before calling
1864 this->detector.
1865
ce2fe65a
AS
18662012-10-13 Andreas Schwab <schwab@linux-m68k.org>
1867
1868 * fileio.c: Formatting fixes.
1869
d6453ce4
PE
18702012-10-13 Paul Eggert <eggert@cs.ucla.edu>
1871
1872 Fix some stat-related races.
1873 * fileio.c (Fwrite_region): Avoid race condition if a file is
1874 removed or renamed by some other process immediately after Emacs
1875 writes it but before Emacs stats it. Do not assume that stat (or
1876 fstat) succeeds.
1877 * image.c (slurp_file): Resolve the file name with fopen + fstat
1878 rather than stat + fopen.
1879 (pbm_read_file) [0]: Remove unused code with stat race.
1880 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
1881 Remove ineffective code with stat race.
1882
06485aa8
SM
18832012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
1884
1885 * doc.c (get_doc_string): Don't signal an error if the file is missing.
1886
167e3640
JD
18872012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1888
1889 * nsterm.m (hold_event_q): New static variable.
1890 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
1891 ! q_event_ptr.
1892 (hold_event): New function.
1893 (ns_read_socket): If hold_event_q have events, store them and
1894 return (Bug#12384).
1895 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
1896 is zero (Bug#12384).
1897
c40239df
JB
18982012-10-12 Juanma Barranquero <lekktu@gmail.com>
1899
1900 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
1901
bb385a92
EZ
19022012-10-12 Eli Zaretskii <eliz@gnu.org>
1903
2a9f1099
EZ
1904 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
1905
bb385a92
EZ
1906 * fileio.c (check_existing): New function.
1907 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
1908 instead of calling 'stat', when what's needed is to check whether
1909 a file exists. This avoids expensive system calls on MS-Windows.
1910 (Bug#12587)
1911
8599b23a 1912 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
1913
1914 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
1915 determine whether a file exists and is not a directory.
1916
1917 * lisp.h (check_existing): Add prototype.
1918
2b9c2e68
JD
19192012-10-12 Jan Djärv <jan.h.d@swipnet.se>
1920
1921 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
1922
81749a23
GM
19232012-10-12 Glenn Morris <rgm@gnu.org>
1924
1925 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
1926
5253a5fd
SM
19272012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
1928
389a94a5
SM
1929 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
1930
5253a5fd
SM
1931 * eval.c (Fautoload): Remember previous autoload status in load-history.
1932
7cded46f
PE
19332012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1934
1935 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
1936 * lread.c (load_each_byte, new_backquote_flag, readchar)
1937 (read_filtered_event, lisp_file_lexically_bound_p)
1938 (safe_to_load_version, Fload, complete_filename_p, openp)
1939 (build_load_history, readevalloop, read_escape, read1)
1940 (string_to_number, read_vector, read_list):
1941 * macros.c (Fstart_kbd_macro):
1942 * marker.c (CONSIDER):
1943 * menu.c (parse_single_submenu, digest_single_submenu)
1944 (find_and_return_menu_selection, Fx_popup_menu):
1945 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
1946 (Ftry_completion):
1947 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
1948 (ns_menu_show):
1949 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
1950 (xmenu_show, xdialog_show):
1951 Use bool for booleans.
1952 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
1953 as it's not a predicate. All uses changed. Omit unnecessary
1954 buffer termination.
1955
549c3414
DA
19562012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
1957
1958 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
1959 (save_excursion_restore): Do not restore mark if it was not saved.
1960
e85aafe7
PE
19612012-10-11 Paul Eggert <eggert@cs.ucla.edu>
1962
fd2f90cf
PE
1963 * marker.c (cached_modiff): EMACS_INT, not int.
1964
c1af190b
PE
1965 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
1966 instead of having a wrong decl.
e85aafe7
PE
1967 * nsmenu.m (waiting_for_input): Remove wrong decl.
1968
e738ca56
PE
19692012-10-10 Paul Eggert <eggert@cs.ucla.edu>
1970
9fa1de30
PE
1971 keyboard.c, keymap.c: Use bool for booleans.
1972 * dispnew.c (sit_for): Distinguish between 3-way display_option
1973 and boolean do_display.
1974 * keyboard.c (single_kboard, this_command_key_count_reset)
1975 (waiting_for_input, echoing, immediate_quit, input_pending)
1976 (interrupt_input, interrupts_deferred, pop_kboard)
1977 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
1978 (command_loop_1, adjust_point_for_property)
1979 (safe_run_hooks_error, input_polling_used, read_char):
1980 (help_char_p, readable_events, kbd_buffer_events_waiting)
1981 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
1982 (lucid_event_type_list_p, get_input_pending):
1983 (gobble_input, menu_separator_name_p, menu_bar_item)
1984 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
1985 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
1986 (keyremap_step, test_undefined, read_key_sequence)
1987 (detect_input_pending, detect_input_pending_ignore_squeezables)
1988 (detect_input_pending_run_timers, requeued_events_pending_p)
1989 (quit_throw_to_read_char, Fset_input_interrupt_mode):
1990 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
1991 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
1992 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
1993 (accessible_keymaps_1, Fkey_description, push_key_description):
1994 (shadow_lookup, struct where_is_internal_data)
1995 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
1996 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
1997 (describe_map, describe_vector):
1998 * menu.c (single_menu_item):
1999 * nsmenu.m (ns_update_menubar):
2000 * process.c (wait_reading_process_output):
2001 * search.c (scan_buffer, scan_newline):
2002 Use bool for boolean.
2003 * keyboard.c (timers_run, swallow_events)
2004 (detect_input_pending_run_timers):
2005 * process.c (wait_reading_process_output):
2006 Use unsigned for counter where wraparound-on-overflow is desired,
2007 since unsigned is guaranteed to have that behavior and signed is not.
2008 (read_char): Use ptrdiff_t for string length.
2009 (get_input_pending): Remove first argument, since it was always
2010 the same pointer-to-int (now pointer-to-boolean) &input_pending,
2011 and behave as if it had that value. Return new value of
2012 input_pending. All callers changed.
2013 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
2014 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
2015 a string length.
2016 * keymap.c (push_key_description): Omit last arg, which was always 1.
2017 All callers changed.
2018
e738ca56
PE
2019 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
2020
29f21cdf
JB
20212012-10-10 Juanma Barranquero <lekktu@gmail.com>
2022
2023 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
2024 ($(BLD)/term.$(O)): Update dependencies.
2025
6aea7528
DA
20262012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2027
2028 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
2029 * lisp.h (enum pvec_type): Adjust comments and omit explicit
2030 initializer for PVEC_NORMAL_VECTOR.
2031
5f3f57be
PE
20322012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2033
2034 Clean out old termopts cruft.
2035 * termopts.h (flow_control, meta_key): Remove unused decls.
2036 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
2037 Don't include termopts.h.
2038
3e98c68e
DA
20392012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
2040
2041 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
2042
77e344e5
PE
20432012-10-10 Paul Eggert <eggert@cs.ucla.edu>
2044
2045 * commands.h (immediate_quit): Remove duplicate decl.
2046
5683d7cd
JD
20472012-10-09 Jan Djärv <jan.h.d@swipnet.se>
2048
2049 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
2050 caching.
2051 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 2052 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 2053
cf5fc6db
EZ
20542012-10-09 Eli Zaretskii <eliz@gnu.org>
2055
b15736e6
EZ
2056 * w32fns.c (w32_last_error): Change the return value to DWORD, to
2057 match what GetLastError returns. Explain why the function is
2058 needed.
2059
cf5fc6db
EZ
2060 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
2061 'is_tooltip_frame', to avoid confusion with its global namesake.
2062
f99714ce
DC
20632012-10-08 Daniel Colascione <dancol@dancol.org>
2064
2065 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
2066 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
2067 build that caused Emacs to display the hourglass cursor forever.
f99714ce 2068
fd59cb29
GM
2069 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
2070 which is broken under remote desktop, calculate the number of
2071 colors available for a display based on the display's number of
2072 planes and number of bits per pixel per plane. (bug#10397).
2073
62c480c9 20742012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 2075
62c480c9
JD
2076 * nsfont.m (Vfonts_in_cache): New variable.
2077 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
2078 are used. Add cached fonts to Vfonts_in_cache.
2079 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
2080
607446ba
JB
20812012-10-08 Juanma Barranquero <lekktu@gmail.com>
2082
fd5125ad
JB
2083 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
2084 in nt/config.nt.
46979e0b
JB
2085 (FONT_H): Define after FRAME_H.
2086 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
2087 Update dependencies.
fd5125ad 2088
607446ba
JB
2089 * w32term.c: Remove leftover declaration of keyboard_codepage.
2090
b6f4e300
EZ
20912012-10-08 Eli Zaretskii <eliz@gnu.org>
2092
c54ebba4
EZ
2093 * makefile.w32-in (FONT_H): Add $(FRAME_H).
2094 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
2095 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
2096 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
2097 ($(BLD)/unexw32.$(O)):
2098 ($(BLD)/w32.$(O)):
2099 ($(BLD)/w32console.$(O)):
2100 ($(BLD)/w32fns.$(O)):
2101 ($(BLD)/w32heap.$(O)):
2102 ($(BLD)/w32menu.$(O)):
15c720a3 2103 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 2104
b6f4e300
EZ
2105 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
2106 'const char *'.
2107 (x_to_w32_color): Don't modify the argument, modify a copy instead.
2108
501199a3
DC
21092012-10-08 Daniel Colascione <dancol@dancol.org>
2110
2111 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
2112 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
2113 accidental message numbering hole. Change other messages to
2114 match.
2115
2116 * w32select.h (HAVE_W32SELECT): Remove.
2117
2118 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 2119 w32common.h instead of w32heap.h.
501199a3
DC
2120
2121 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
2122 (get_allocation_unit, get_processor_type, get_w32_major_version)
2123 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2124 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2125 (OS_NT, os_subtype, cache_system_info): Move declarations to
2126 w32common.
2127
2128 * w32heap.c: Include w32common.h.
2129 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
2130 (w32_minor_version, w32_build_number, w32_subtype):
2131 Remove duplicate definitions.
501199a3
DC
2132
2133 * w32fns.c: Include w32common.h; include w32heap.h only in
2134 WINDOWSNT.
2135
2136 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
2137 Use `report_file_error' instead of `error' in order to better
2138 inform users of what went wrong. Increase NTGUI_UNICODE file
2139 dialog box file name length to 32k, the maximum allowed by the NT
2140 kernel.
2141
2142 * w32common.h: New file.
2143 (ROUND_UP, ROUND_DOWN, get_page_size)
2144 (get_allocation_unit, get_processor_type, get_w32_major_version)
2145 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
2146 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
2147 (OS_NT, os_subtype, cache_system_info): Move here.
2148
2149 * unexw32.c, unexcw.c: Include w32common.h.
2150
2151 * emacs.c (main): Use (defined (WINDOWSNT) || defined
2152 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
2153 to call syms_of_w32select.
2154
2155 * cygw32.h: Remove obsolete EXFUN declarations.
2156
2157 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
2158
2159 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
2160 of w32inevt.o from SOME_MACHINE_OBJECTS.
2161
93aa5c81
DC
21622012-10-08 Daniel Colascione <dancol@dancol.org>
2163
2164 * image.c: Permanent fix for JPEG compilation issue --- limit
2165 jpeglib `boolean' redefinition to Cygwin builds.
2166
d424f3d8
EZ
21672012-10-08 Eli Zaretskii <eliz@gnu.org>
2168
8ee4c6ce
EZ
2169 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
2170
d424f3d8
EZ
2171 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
2172 Cygwin.
2173
e08348a0
DC
21742012-10-08 Daniel Colascione <dancol@dancol.org>
2175
2176 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
2177 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
2178 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
2179 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
2180 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
2181 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
2182 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
2183 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
2184 now a supported configuration.
2185
2186 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 2187 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
2188
2189 * conf_post.h:
2190 (_DebPrint) declare tracing facility for W32 debugging. We need
2191 to unify tracing later.
2192
2193 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
2194 unconditional use of W32 Unicode functions. Cygwin runs only on
2195 100% Unicode operating systems.
2196
2197 * cygw32.c: New file. Define Cygwin-specific facilities.
2198 (Fcygwin_convert_path_to_windows)
2199 (Fcygwin_convert_path_from_windows): New user functions for
2200 accessing Cygwin path-munging routines.
2201
2202 * cygw32.h: New file.
2203 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
2204 UTF-16LE strings temporarily inside non-Lisp-visible string
2205 objects.
2206
2207 (w32_strerror): Just what it says on the tin.
2208
2209 * emacs.c: Make the NS fork-then-exec code for daemon-launching
2210 also run for Cygwin; both systems have the same problem with using
2211 GUI facilities in a forked child. Also call syms_of_cygw32,
2212 syms_of_w32select in correct places.
2213
2214 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
2215 needs fork-then-exec for daemon launching.
2216
2217 * font.h: Include frame.h.
2218
2219 * image.c: Use the image library cache machinery only when we're
2220 compiling for native WINDOWSNT; Cygwin can use shared libraries
2221 like any other Unixlike system.
2222
2223 * keyboard.c: Clarify a comment regarding the input loop.
2224
2225 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
2226 functions directly instead of trying to detect at runtime that our
2227 host operating system supports them. We make this change for two
2228 reasons: Cygwin lacks support for the multibyte character
2229 conversion functions used by the legacy menu code, and Cygwin
2230 never needs to rely on non-Unicode APIs.
2231
2232 * unexw32.c (hinst): Declare extern.
2233
2234 * w32.c: Change header order;
2235 (w32_strerror): Move to w32fns.c because we need it for
2236 non-WINDOWSNT builds.
2237
2238 * w32.h: Add #error macro to make sure we don't include w32.h for
2239 Cygwin builds. Remove w32select declarations.
2240
2241 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 2242 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
2243
2244 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
2245 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
2246 POSIXy alternative.
2247 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
2248 (w32_major_version, w32_minor_version, w32_build_number)
2249 (os_subtype, sound_type): Define here
2250 (w32_defined_color): Make color parameter const for consistency
2251 with other _defined_color functions.
2252 (w32_createwindow): Unconditionally call w32_init_class instead of
2253 doing so only when hprevinst is non-NULL. Plumbing hprevinst
2254 through the code is complex and unnecessary because class
2255 registration is practically free.
2256 (w32_name_of_message): New EMACSDEBUG-only function.
2257 (Fset_message_beep): Move here
2258 (Fx_open_connection): Require that the display name for Windows be
2259 "w32" for consistency, emacsclient disambiguation, and maybe, one
2260 day, multi-window-system support.
2261 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
2262 Cygwin files for W32 GUI facilities, since these clearly don't
2263 expect Cygwin names.
2264 (_DebPrint): Define.
2265 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
2266 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
2267 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
2268 (w32_last_error): Remove.
2269
2270 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
2271
2272 * w32heap.c (syspage_mask): Declare here.
2273 (cache_system_info): Remove.
2274
2275 * w32inevt.c (faked_key): Define globally, not statically.
2276 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
2277 (w32_console_toggle_lock_key): Move to w32fns.c.
2278
2279 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
2280
2281 * w32proc.c (_DebPrint): Move to w32fns.c.
2282 * w32select.c: Include string.h, stdio.h for Cygwin.
2283 * w32select.h: New File.
2284
2285 * w32term.c: Include io.h for non-CYGWIN builds; needed for
2286 get_osfhandle.
2287 (w32_message_fd): New variable. Under Cygwin, holds the file
2288 descriptor the system used to tell us about pending thread
2289 messages.
2290
2291 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
2292 that prevented compilation under non-WINDOWSNT systems.
2293
2294 (w32_initialize): Open /dev/windows and assign it to
2295 w32_message_fd. Provide w32 feature.
2296
2297 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
2298 (WM_EMACS_INPUT_READY): add.
2299 (prepend_msg, w32_message_fd): Declare globally.
2300
2301 * w32xfns.c:
2302 (keyboard_handle): Use only when WINDOWSNT.
2303 (notify_msg_ready): New function. Posts a message to the main
2304 thread's message queue under CYGWIN, which wakes up the main
2305 thread from select(2) by making the /dev/windows file descriptor
2306 ready. Under WINDOWSNT, it sets an event the same way the old
2307 code did.
2308
2309 (post, prepend_msg): Actually call notify_msg_ready instead of
2310 setting the input event directly.
2311
98daa893
EZ
23122012-10-07 Eli Zaretskii <eliz@gnu.org>
2313
2314 * ralloc.c (relinquish): If a heap is ready to be relinquished,
2315 but it still has blocs in it, don't return it to the system,
2316 instead of aborting. (Bug#12402)
2317
3bc0a2f7
JD
23182012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2319
8ad5b73b 2320 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 2321
335f5ae4
JD
2322 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
2323 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
2324 (syms_of_nsterm): Remove comment about Panther and above for
2325 ns-antialias-text.
335f5ae4
JD
2326 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
2327 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
2328 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
2329
2330 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
2331 MAC_OS_X_VERSION_10_4.
2332
8ad5b73b
JD
2333 * nsmenu.m (fillWithWidgetValue:): Remove code for <
2334 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
2335
2336 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
2337
2338 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
2339 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
2340
3bc0a2f7
JD
2341 * nsterm.m (ns_in_resize): Remove (Bug#12479).
2342 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
2343 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
2344 Remove ns_in_resize check.
3bc0a2f7
JD
2345 (ns_clear_frame_area): Remove resize handle code.
2346
2347 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
2348 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
2349 Remove ns_in_resize check.
3bc0a2f7 2350
c622b48f
PE
23512012-10-07 Paul Eggert <eggert@cs.ucla.edu>
2352
2353 Improve sys_siglist detection.
2354 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
2355 defined as a macro, as is done in Solaris.
2356 (sys_siglist_entries): New macro.
2357 (save_strsignal): Use it.
2358 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
2359 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
2360
04fafa46
JD
23612012-10-06 Jan Djärv <jan.h.d@swipnet.se>
2362
2363 * nsfns.m (Fx_create_frame): Call x_default_parameter with
2364 fullscreen/Fullscreen.
2365
2366 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
2367 tobar_height is new.
2368
2369 * nsterm.m (x_make_frame_visible): Check for fullscreen.
2370 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
2371 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
2372 (windowDidResize:): Check for correct window if old style fullscreen.
2373 Capitalize word in comment. Remove incorrect comment.
2374 (initFrameFromEmacs:): tbar_height renamed tibar_height.
2375 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
2376 error in drawing background.
1f9f395d 2377 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
2378 Set toolbar values to zero, save old height in tobar_height.
2379 Restore tool bar height when leaving fullscreen.
2380 (canBecomeMainWindow): New function.
2381
c6e21c03
PE
23822012-10-06 Paul Eggert <eggert@cs.ucla.edu>
2383
2384 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
2385
0d9f584b
EZ
23862012-10-05 Eli Zaretskii <eliz@gnu.org>
2387
a65fbb5f
EZ
2388 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
2389
0d9f584b 2390 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
2391 that time stamps of directories could also be changed.
2392 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
2393 FILE_WRITE_ATTRIBUTES access rights.
2394
2395 * fileio.c (Fset_file_times): Special-case ignoring errors for
2396 directories only on MSDOS, not on MS-Windows.
2397
e8757f09 23982012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
2399
2400 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
2401
7604f298
EZ
24022012-10-04 Eli Zaretskii <eliz@gnu.org>
2403
2404 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
2405 see whether CreateFile failed.
2406
88d69b7d
PE
24072012-10-04 Paul Eggert <eggert@cs.ucla.edu>
2408
2409 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
2410 to avoid similar races.
2411 * keyboard.c (pending_signals): Now bool, not int.
2412
7509f454
PE
2413 Port timers to OpenBSD, plus check for timer failures.
2414 OpenBSD problem reported by Han Boetes.
2415 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
2416 and/or setitimer.
2417 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
2418 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
2419 like OpenBSD, which has timer_settime but does not declare it.
2420 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
2421 whether to use itimerspec-related primitives. All uses of
2422 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
2423
a3c5c0c5
PE
24242012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2425
2426 * profiler.c (handle_profiler_signal): Fix a malloc race
2427 that caused Emacs to hang on Fedora 17 when profiling Lisp.
2428
914e743b
JD
24292012-10-02 Jan Djärv <jan.h.d@swipnet.se>
2430
2431 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
2432
d8ab37a8
EZ
24332012-10-02 Eli Zaretskii <eliz@gnu.org>
2434
2435 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
2436 consistent with the change in return value of 'safe_strsignal'.
2437
b3ecad33
PE
24382012-10-02 Paul Eggert <eggert@cs.ucla.edu>
2439
0a99eee1
PE
2440 Prefer plain 'static' to 'static inline' (Bug#12541).
2441 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
2442 (bidi_set_sor_type, bidi_push_embedding_level)
2443 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
2444 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
2445 (bidi_cache_search, bidi_cache_ensure_space)
2446 (bidi_cache_iterator_state, bidi_cache_find)
2447 (bidi_peek_at_next_level, bidi_set_paragraph_end)
2448 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2449 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
2450 Now 'static', not 'static inline'.
2451
b3ecad33
PE
2452 Count overruns when profiling; change units to ns.
2453 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
2454 Give extra weight to samples after overruns, to attempt to count
2455 the time more accurately.
2456 (setup_cpu_timer): Change sampling interval units from ms to ns, since
2457 the underlying primitives nominally do ns.
2458 (Fprofiler_cpu_start): Document the change. Mention that
2459 the sampling intervals are only approximate.
2460
090cf9db
SM
24612012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2462
2463 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
2464
2465 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
2466 case for the special 0 coding-system.
2467
2468 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
2469 (Fmake_overlay): Remove redundant tests.
64edc777 2470 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 2471
81550bf4
JB
24722012-10-02 Juanma Barranquero <lekktu@gmail.com>
2473
2474 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
2475 Update dependencies.
2476
aa1ba90e
PE
24772012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2478
2479 Fix a malloc race condition involving strsignal.
2480 A signal can arrive in the middle of a malloc, and Emacs's signal
2481 handler can invoke strsignal, which can invoke malloc, which is
2482 not portable. This race condition bug makes Emacs hang on GNU/Linux.
2483 Fix it by altering the signal handler so that it does not invoke
2484 strsignal.
2485 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
2486 * process.c (status_message): Use const pointer, in case strsignal
2487 is #defined to safe_strsignal.
2488 * sysdep.c (sys_siglist, init_signals): Always define and
2489 initialize a substitute sys_siglist if the system does not define
2490 one, even if HAVE_STRSIGNAL.
2491 (safe_strsignal): Rename from strsignal. Always define,
2492 using sys_siglist. Return a const pointer.
2493 * syssignal.h (safe_strsignal): New decl.
2494 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
2495
ace917bd
EZ
24962012-10-01 Eli Zaretskii <eliz@gnu.org>
2497
2498 * w32proc.c (timer_loop): Fix code that waits for timer
2499 expiration, to avoid high CPU usage.
2500
9eb71b9c
SM
25012012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
2502
2503 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
2504 (sweep_weak_table): Remove redundant prototypes.
2505
b3317662
FP
25062012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
2507
2508 * emacs.c: Move the inclusion of TERM_HEADER after including
2509 windows.h on WINDOWSNT. This avoids compilation problems with
2510 MSVC.
2511
f0e5f225
EZ
25122012-10-01 Eli Zaretskii <eliz@gnu.org>
2513
2d7d1608
EZ
2514 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
2515 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
2516 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
2517 as the previous version used 'void *'.
2518
2519 * ralloc.c (ROUNDUP): Fix last change.
2520 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
2521 'size_t'.
2522
f0e5f225
EZ
2523 * w32proc.c <disable_itimers>: New static flag.
2524 (init_timers): Initialize it to zero, after creating the critical
2525 sections used by the timer threads.
2526 (term_timers): Set to 1 before deleting the critical sections.
2527 (getitimer, setitimer): If disable_itimers is non-zero, return an
2528 error indication without doing anything. Reported by Fabrice
2529 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
2530 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
2531 return results.
2532 [!HAVE_SETITIMER]: Behave as the previous version that didn't
2533 support timers.
f0e5f225
EZ
2534
2535 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
2536 term_ntproc after all the other bookkeeping, to get timers working
2537 as long as possible.
2538
82ef37c1
PE
25392012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2540
b3a4c387
PE
2541 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
2542 Suggested by Juri Linkov in
2543 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
2544
b0ab8123
PE
2545 Prefer plain 'static' to 'static inline' (Bug#12541).
2546 With static functions, modern compilers inline pretty well by
2547 themselves; advice from programmers often hurts as much as it helps.
2548 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
2549 this change shrinks the text size of the Emacs executable by 1.1%
2550 without affecting CPU significantly in my benchmark.
2551 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
2552 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
2553 (mark_maybe_object, mark_maybe_pointer, bounded_number):
2554 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
2555 (bset_auto_fill_function, bset_auto_save_file_format)
2556 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
2557 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
2558 (bset_cache_long_line_scans, bset_case_fold_search)
2559 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
2560 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
2561 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
2562 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
2563 (bset_header_line_format, bset_indicate_buffer_boundaries)
2564 (bset_indicate_empty_lines, bset_invisibility_spec)
2565 (bset_left_fringe_width, bset_major_mode, bset_mark)
2566 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
2567 (bset_name, bset_overwrite_mode, bset_pt_marker)
2568 (bset_right_fringe_width, bset_save_length)
2569 (bset_scroll_bar_width, bset_scroll_down_aggressively)
2570 (bset_scroll_up_aggressively, bset_selective_display)
2571 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
2572 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
2573 (set_buffer_overlays_after):
2574 * category.c (bset_category_table):
2575 * charset.c (read_hex):
2576 * coding.c (produce_composition, produce_charset)
2577 (handle_composition_annotation, handle_charset_annotation)
2578 (char_encodable_p):
2579 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
2580 (assign_row, set_frame_matrix_frame, make_current)
2581 (add_row_entry):
2582 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
2583 * fns.c (maybe_resize_hash_table):
2584 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
2585 * gmalloc.c (register_heapinfo):
2586 * image.c (lookup_image_type):
2587 * intervals.c (set_interval_object, set_interval_left)
2588 (set_interval_right, copy_interval_parent, rotate_right)
2589 (rotate_left, balance_possible_root_interval):
2590 * keyboard.c (kset_echo_string, kset_kbd_queue)
2591 (kset_keyboard_translate_table, kset_last_prefix_arg)
2592 (kset_last_repeatable_command, kset_local_function_key_map)
2593 (kset_overriding_terminal_local_map, kset_real_last_command)
2594 (kset_system_key_syms, clear_event, set_prop):
2595 * lread.c (digit_to_number):
2596 * marker.c (attach_marker, live_buffer, set_marker_internal):
2597 * nsterm.m (ns_compute_glyph_string_overhangs):
2598 * process.c (pset_buffer, pset_command)
2599 (pset_decode_coding_system, pset_decoding_buf)
2600 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
2601 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
2602 (pset_status, pset_tty_name, pset_type, pset_write_queue):
2603 * syntax.c (bset_syntax_table, dec_bytepos):
2604 * terminal.c (tset_param_alist):
2605 * textprop.c (interval_has_some_properties)
2606 (interval_has_some_properties_list):
2607 * window.c (wset_combination_limit, wset_dedicated)
2608 (wset_display_table, wset_hchild, wset_left_fringe_width)
2609 (wset_left_margin_cols, wset_new_normal, wset_new_total)
2610 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
2611 (wset_right_fringe_width, wset_right_margin_cols)
2612 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
2613 (wset_vertical_scroll_bar_type, wset_window_parameters):
2614 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2615 (wset_column_number_displayed, wset_region_showing)
2616 (window_box_edges, run_window_scroll_functions)
2617 (append_glyph_string_lists, prepend_glyph_string_lists)
2618 (append_glyph_string, set_glyph_string_background_width)
2619 (append_glyph, append_composite_glyph)
2620 (take_vertical_position_into_account):
2621 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
2622 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
2623 (lface_hash, lface_same_font_attributes_p, lookup_face):
2624 * xml.c (libxml2_loaded_p):
2625 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
2626 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
2627 Now 'static', not 'static inline'.
2628
05584c31
PE
2629 * bidi.c: Tune.
2630 (bidi_copy_it): Do the whole copy with a single memcpy.
2631 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
2632
86ec63ba
PE
2633 Revert the FOLLOW-SYMLINKS change for file-attributes.
2634 Doing it right would require several changes to Tramp, and there's
2635 not enough time to get that tested before the freeze today.
2636 * dired.c (directory_files_internal, Ffile_attributes):
2637 Undo last change.
2638
82ef37c1
PE
2639 * frame.c (x_report_frame_params): Port better to wider ints.
2640 Do not assume that EMACS_UINT is the same width as uprintmax_t,
2641 or that pointers can be printed in 15 decimal digits.
2642 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
2643
62aba0d4
FP
26442012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
2645
2646 Support x64 build on MS-Windows.
2647 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
2648 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
2649 compatibility with x64.
5e4daaf3 2650 (x_get_focus_frame): Add prototype.
62aba0d4
FP
2651
2652 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
2653 defining an XRectangle structure.
2654
2655 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
2656 arithmetics for compatibility with x64.
2657
2658 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
2659 compatibility with x64.
2660
2661 * w32heap.h: Adjust prototypes and declarations.
2662
2663 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
2664 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
2665 DWORD, long, and unsigned long, for compatibility with x64.
2666 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
2667 (sbrk): Argument is now of type ptrdiff_t.
2668
2669 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
2670 less than 0x0500.
2671 (w32_msg_pump): Use WPARAM type for 'result'.
2672
2673 * w32.c (init_environment, get_emacs_configuration): Support AMD64
2674 architecture.
2675 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
2676 compatibility with x64.
2677
2678 * vm-limit.c (lim_data): Now size_t.
2679 (check_memory_limits): Adjust prototypes of real_morecore and
2680 __morecore to receive argument of type ptrdiff_t. Use size_t for
2681 five_percent and data_size.
2682
2683 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
2684 variables, for compatibility with x64.
2685 (rva_to_section, offset_to_section, relocate_offset)
2686 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
2687 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
2688 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
2689 for compatibility with x64.
2690
2691 * sysdep.c (STDERR_FILENO): Define if not already defined.
2692
2693 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
2694 (__morecore): Argument type is now ptrdiff_t.
2695 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
2696 (relinquish): Use ptrdiff_t type for 'excess'.
2697 (r_alloc_sbrk): Argument type is now ptrdiff_t.
2698
2699 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
2700 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
2701 instead of a literal number.
2702
2703 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
2704 (min): Define only if not already defined.
2705
2706 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
2707 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
2708 hosts.
2709
2710 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
2711 'bitmaps' is a pointer.
2712
2713 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
2714
2715 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
2716
e7a2937b
PE
27172012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 file-attributes has a new optional arg FOLLOW-SYMLINKS.
2720 * dired.c (directory_files_internal, Ffile_attributes):
2721 New arg follow_symlinks. All uses changed.
2722
b43d62ae
SM
27232012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2724
2725 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
2726
c06c382a
EZ
27272012-09-30 Eli Zaretskii <eliz@gnu.org>
2728
2729 Support atimers and CPU profiler via profile.c on MS-Windows.
2730 * w32proc.c (sig_mask, crit_sig): New static variables.
2731 (sys_signal): Support SIGALRM and SIGPROF.
2732 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 2733 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
2734 sigfillset, and sigprocmask are no longer no-ops.
2735 (sigismember): New function.
2736 (struct itimer_data): New definition.
2737 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
2738 (crit_prof): New static variables.
2739 (MAX_SINGLE_SLEEP): New definition.
2740 (timer_loop, stop_timer_thread, term_timers, init_timers)
2741 (start_timer_thread, getitimer, setitimer): New functions.
2742 (alarm): No longer a no-op, calls setitimer.
2743
2744 * w32.c (term_ntproc): Call term_timers.
2745 (init_ntproc): Make sure all signals are unblocked at startup, to
2746 erase any traces of dumping. Call init_timers.
2747
2748 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
2749 Windows-specific code to display the hourglass mouse pointer is no
2750 longer used.
2751 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
2752 to hourglass timer expiration.
2753 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
2754 Remove, no longer used.
b43d62ae
SM
2755 (w32_note_current_window, show_hourglass, hide_hourglass):
2756 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
2757 window systems.
2758 (syms_of_w32fns): Don't initialize hourglass_timer.
2759
2760 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
2761 WINDOWSNT as well.
2762 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
2763
2764 * w32.h (init_timers, term_timers): Add prototypes.
2765
95402d5f
KH
27662012-09-30 Kenichi Handa <handa@gnu.org>
2767
2768 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
2769 to the buffer relocation which may be caused by ccl_driver.
2770
dd946752
JD
27712012-09-30 Jan Djärv <jan.h.d@swipnet.se>
2772
d7e642cc
JD
2773 * xfns.c (Fx_file_dialog): Update comment.
2774
2775 * w32fns.c (Fx_file_dialog): Update comment.
2776
2777 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
2778 Initialize panel name field if OSX >= 10.6.
2779
2780 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
2781
dd946752
JD
2782 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
2783
2784 * nsterm.m (NEW_STYLE_FS): New define.
2785 (ns_fullscreen_hook, windowWillEnterFullScreen)
2786 (windowDidEnterFullScreen, windowWillExitFullScreen)
2787 (windowDidExitFullScreen, toggleFullScreen, handleFS)
2788 (setFSValue): New functions.
2789 (EmacsFSWindow): New implementation.
2790 (canBecomeKeyWindow): New function for EmacsFSWindow.
2791 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
2792 (dealloc): Release nonfs_window if in fullscreen.
2793 (updateFrameSize:): Call windowDidMove to update top/left.
2794 (windowWillResize:toSize:): Check if frame is still maximized.
2795 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
2796 next_maximized, maximized_width, maximized_height and nonfs_window.
2797 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
2798 tbar_height.
2799 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 2800 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
2801
2802 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
2803 (EmacsView): Add variables for fullscreen.
2804 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
2805 (EmacsFSWindow): New interface for fullscreen.
2806
427730eb
JB
28072012-09-30 Juanma Barranquero <lekktu@gmail.com>
2808
2809 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2810
48de8b12
CY
28112012-09-30 Chong Yidong <cyd@gnu.org>
2812
2813 * fns.c (Frandom): Doc fix.
2814
5938d519
MR
28152012-09-30 Martin Rudalics <rudalics@gmx.at>
2816
2817 * window.c (Vwindow_combination_limit): New default value.
2818 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
2819
cb5b0266
PE
28202012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2821
2822 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
2823 Suggested by Eli Zaretskii in
2824 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
2825
84f72efd
EZ
28262012-09-30 Eli Zaretskii <eliz@gnu.org>
2827
2828 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
2829 HAVE_TIMER_SETTIME is defined.
2830
9d4dcdc9
PE
28312012-09-30 Paul Eggert <eggert@cs.ucla.edu>
2832
d89460ed
PE
2833 Profiler improvements: more-accurate timers, overflow checks.
2834 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
2835 signal.h, setjmp.h. Include systime.h instead.
2836 (saturated_add): New function.
2837 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
2838 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
2839 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
2840 New static vars.
84f72efd 2841 (enum profiler_cpu_running): New enum.
d89460ed
PE
2842 (profiler_cpu_running): Now of that enum type, not bool.
2843 All uses changed to store the new value.
2844 (handle_profiler_signal): Rename from sigprof_handler_1,
2845 for consistency with other handlers. Do not check whether
2846 cpu_log is a hash-table if garbage collecting, since it
2847 doesn't matter in that case.
2848 (deliver_profiler_signal): Rename from sigprof_handler,
2849 for consistency with other handlers.
2850 (setup_cpu_timer): New function, with much of what used to be in
2851 Fprofiler_cpu_start. Check for out-of-range argument.
2852 Prefer timer_settime if available, and prefer
2853 thread cputime clocks, then process cputime clocks, then
2854 monotonic clocks, to the old realtime clock. Use make_timeval
2855 to round more-correctly when falling back to setitimer.
2856 (Fprofiler_cpu_start): Use it.
2857 (Fprofiler_cpu_stop): Prefer timer_settime if available.
2858 Don't assume that passing NULL as the 2nd argument of setitimer
2859 is the same as passing a pointer to all-zero storage.
2860 Ignore SIGPROF afterwards.
2861 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
2862 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
2863 non-fatal signal handlers. Ignore SIGPROF on startup.
2864 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
2865 in profiler.c, since sysdep.c now uses it.
2866
9d4dcdc9
PE
2867 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
2868 Suggested by Eli Zaretskii in
2869 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2870
8e5691a0
JB
28712012-09-29 Juanma Barranquero <lekktu@gmail.com>
2872
2873 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2874
e7c1b6ef
SM
28752012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
2876
2877 * lisp.h (struct backtrace): Remove indirection for `function' field.
2878 * xdisp.c (redisplay_internal):
2879 * profiler.c (record_backtrace, sigprof_handler_1):
2880 * alloc.c (Fgarbage_collect):
2881 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
2882 (Fbacktrace_frame): Adjust accordingly.
2883
e61d39cd 28842012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
2885
2886 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
2887 (Frun_hook_with_args_until_failure): Doc fixes.
2888
404043ea
EZ
28892012-09-28 Eli Zaretskii <eliz@gnu.org>
2890
2891 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
2892 Qautomatic_redisplay and change the symbol name. All users changed.
2893
704d3f45
TM
28942012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
2895
2896 * profiler.c (sigprof_handler): Fix race condition.
2897
757140ff
GM
28982012-09-28 Glenn Morris <rgm@gnu.org>
2899
2900 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
2901
a615a3ae
PE
29022012-09-27 Paul Eggert <eggert@cs.ucla.edu>
2903
2904 Check more robustly for timer_settime.
89d17fd0
PE
2905 * Makefile.in (LIB_TIMER_TIME): New macro.
2906 (LIBES): Add it.
a615a3ae
PE
2907 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
2908 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
2909 call timer_settime.
2910
3670daf7
TM
29112012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2912
2913 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
2914
6a586b7f
JB
29152012-09-26 Juanma Barranquero <lekktu@gmail.com>
2916
2917 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
2918
41c8bfcf
PE
29192012-09-26 Paul Eggert <eggert@cs.ucla.edu>
2920
2921 * character.h (MAYBE_UNIFY_CHAR): Remove.
2922 * charset.c, charset.h (maybe_unify_char): Now static.
2923 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
2924 Since this stuff is now private to charset.c, there's no need for
2925 a public macro and no need to inline by hand.
2926
3a880af4
SM
29272012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
2928 Stefan Monnier <monnier@iro.umontreal.ca>
2929 Juanma Barranquero <lekktu@gmail.com>
611b7507 2930
3a880af4
SM
2931 * profiler.c: New file.
2932 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
2933 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
2934 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
2935 * emacs.c (main): Call syms_of_profiler.
2936 * alloc.c (Qautomatic_gc): New constant.
2937 (MALLOC_PROBE): New macro.
2938 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
2939 (total_bytes_of_live_objects): New function.
2940 (Fgarbage_collect): Use it. Record itself in backtrace_list.
2941 Call malloc_probe for the memory profiler.
2942 (syms_of_alloc): Define Qautomatic_gc.
2943 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
2944 race condition.
2945 (struct backtrace): Move definition...
2946 * lisp.h (struct backtrace): ..here.
2947 (Qautomatic_gc, profiler_memory_running): Declare vars.
2948 (malloc_probe, syms_of_profiler): Declare functions.
2949 * xdisp.c (Qautomatic_redisplay): New constant.
2950 (redisplay_internal): Record itself in backtrace_list.
2951 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 2952
5938d519 29532012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
29542012-09-25 Juanma Barranquero <lekktu@gmail.com>
2955
2956 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
2957
e26fd2e4
PE
29582012-09-25 Paul Eggert <eggert@cs.ucla.edu>
2959
2960 Prefer POSIX timers if available.
2961 They avoid a race if the timer is too close to the current time.
2962 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
2963 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 2964 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 2965
eedec3ee
EZ
29662012-09-25 Eli Zaretskii <eliz@gnu.org>
2967
2968 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
2969 CHAR_STRING_ADVANCE.
2970 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
2971 STRING_CHAR_ADVANCE.
2972
aa15c6bb
JB
29732012-09-25 Juanma Barranquero <lekktu@gmail.com>
2974
2975 Move Vlibrary_cache to emacs.c and reset before dumping.
2976
2977 * lisp.h (reset_image_types): Declare.
2978 [WINDOWSNT] (Vlibrary_cache): Declare.
2979
2980 * image.c (reset_image_types): New function.
2981
2982 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
2983 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
2984 (Fdump_emacs): Reset Vlibrary_cache and image_types.
2985
2986 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
2987 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
2988
2989 * w32.h (Vlibrary_cache): Do not declare.
2990
54d629be
EZ
29912012-09-25 Eli Zaretskii <eliz@gnu.org>
2992
16b22fef
EZ
2993 * w32proc.c (sys_signal): Handle all signals defined by the
2994 MS-Windows runtime, not just SIGCHLD. Actually install the signal
2995 handlers for signals supported by Windows. Don't override
2996 term_ntproc as the handler for SIGABRT.
2997 (sigaction): Rewrite to call sys_signal instead of duplicating its
2998 code.
2999 (sys_kill): Improve commentary.
3000
3001 * w32.c (term_ntproc): Accept (and ignore) one argument, for
3002 consistency with a signature of a signal handler. All callers
3003 changed.
3004 (init_ntproc): Accept an argument DUMPING. If dumping, don't
3005 install term_ntproc as a signal handler for SIGABRT, as that
3006 should be done by the dumped Emacs.
3007
3008 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
3009
3010 * w32select.c (term_w32select): Protect against repeated
3011 invocation by setting clipboard_owner to NULL after calling
3012 DestroyWindow.
3013
3014 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
3015 and term_ntproc to their modified signatures.
3016
54d629be
EZ
3017 * character.c (char_string, string_char): Remove calls to
3018 MAYBE_UNIFY_CHAR. See the discussion starting at
3019 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
3020 for the details.
3021
59f7af81
CY
30222012-09-25 Chong Yidong <cyd@gnu.org>
3023
3024 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
3025
22e8cf4a
SM
30262012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
3027
3028 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
3029 when encountering an unknown bytecode.
3030
578098f3
PE
30312012-09-24 Paul Eggert <eggert@cs.ucla.edu>
3032
3033 image.c, indent.c: Use bool for booleans.
3034 * dispextern.h (struct image_type): Members valid_p, load, init
3035 now return bool, not int. All uses changed.
3036 * image.c: Omit unnecessary static decls.
3037 (x_create_bitmap_mask, x_build_heuristic_mask):
3038 Return void, not int, since callers don't care about the return value.
3039 (x_create_bitmap_mask, define_image_type, valid_image_p)
3040 (struct image_keyword, parse_image_spec, image_spec_value)
3041 (check_image_size, image_background)
3042 (image_background_transparent, x_clear_image_1)
3043 (postprocess_image, lookup_image, x_check_image_size)
3044 (x_create_x_image_and_pixmap, xbm_image_p)
3045 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
3046 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
3047 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
3048 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
3049 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
3050 (png_image_p, init_png_functions, png_load_body, png_load)
3051 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
3052 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
3053 (init_gif_functions, gif_load, imagemagick_image_p)
3054 (imagemagick_load_image, imagemagick_load, svg_image_p)
3055 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
3056 (gs_load):
3057 * nsimage.m (ns_load_image):
3058 * nsterm.m (ns_defined_color):
3059 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
3060 * xfns.c (x_defined_color):
3061 * xterm.c (x_alloc_lighter_color_for_widget)
3062 (x_alloc_nearest_color_1, x_alloc_nearest_color)
3063 (x_alloc_lighter_color):
3064 * indent.c (disptab_matches_widthtab, current_column)
3065 (scan_for_column, string_display_width, indented_beyond_p)
3066 (compute_motion, vmotion, Fvertical_motion):
3067 Use bool for booleans.
3068
a5f2b6ec
CY
30692012-09-24 Chong Yidong <cyd@gnu.org>
3070
3071 * chartab.c (Fset_char_table_default): Obsolete function removed.
3072
18e27ea8
PE
30732012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3074
afea8a8a
PE
3075 Move pid_t related decls out of lisp.h.
3076 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
3077 (interruptible_wait_for_termination):
3078 Move these decls from lisp.h to syswait.h, since they use pid_t.
3079 Needed on FreeBSD; see Herbert J. Skuhra in
3080 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
3081 * callproc.c: Include syswait.h.
3082
18e27ea8
PE
3083 gnutls.c, gtkutil.c: Use bool for boolean.
3084 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
3085 (emacs_gnutls_handle_error):
3086 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
3087 (xg_hide_tooltip, xg_create_frame_widgets)
3088 (create_dialog, xg_uses_old_file_dialog)
3089 (xg_get_file_with_chooser, xg_get_file_with_selection)
3090 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
3091 (xg_item_label_same_p, xg_update_menubar)
3092 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
3093 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
3094 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
3095 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
3096 (update_frame_tool_bar, free_frame_tool_bar):
3097 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
3098 * nsmenu.m (ns_update_menubar):
3099 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
3100 * xfns.c (Fx_show_tip) [USE_GTK]:
3101 Use bool for boolean.
3102 * gtkutil.c (xg_update_frame_menubar):
3103 * xmenu.c (update_frame_menubar):
3104 Return void, not int, since caller ignores return value.
3105 * gtkutil.c (xg_change_toolbar_position):
3106 Return void, not 1.
3107
af0e9f75
JB
31082012-09-23 Juanma Barranquero <lekktu@gmail.com>
3109
3110 * makefile.w32-in (BLOCKINPUT_H): Remove.
3111 (SYSSIGNAL_H): New macro.
3112 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
3113 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
3114 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
3115 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
3116 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
3117 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
3118 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
3119 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
3120 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
3121 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
3122 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
3123 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
3124 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
3125 ($(BLD)/w32xfns.$(O)): Update dependencies.
3126
5101529e
EZ
31272012-09-23 Eli Zaretskii <eliz@gnu.org>
3128
3129 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
3130 fatal_error_backtrace.
3131
3132 * w32proc.c (sys_kill): Undo last change: don't do anything when
3133 invoked to deliver SIGABRT to our own process. This is now
3134 handled by emacs_raise.
3135
2c3ee0ad
JB
31362012-09-23 Juanma Barranquero <lekktu@gmail.com>
3137
3138 * w32term.c (w32_read_socket): Remove leftover reference to
3139 interrupt_input_pending.
3140
62a1d661
PE
31412012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3142
3143 Do not use SA_NODEFER.
3144 Problem reported by Dani Moncayo in
3145 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
3146 * alloc.c (die):
3147 * sysdep.c (emacs_abort): Do not reset signal handler.
3148 * emacs.c (terminate_due_to_signal): Reset signal handler here.
3149 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
3150 wanted even on POSIXish hosts, and it doesn't work on Windows.
3151
a0942b9a
JD
31522012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3153
3154 * xterm.c (x_term_init): Call fixup_locale before and after calling
3155 gtk_init (Bug#12392).
3156
d07ff9db
CY
31572012-09-23 Chong Yidong <cyd@gnu.org>
3158
3159 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
3160 Vdynamic_library_alist.
3161
3162 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
3163 (Fgnutls_available_p): Caller changed.
3164
3165 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
3166 (Flibxml_parse_xml_region): Likewise.
3167
3168 * dispextern.h (struct image_type): Remove arg from init function.
3169
3170 * image.c (Finit_image_library, lookup_image_type)
3171 (define_image_type): Remove now-unneeded second arg.
3172 (init_xpm_functions, init_png_functions, init_jpeg_functions)
3173 (init_tiff_functions, init_gif_functions, init_svg_functions):
3174 Arglist and w32_delayed_load calling convention changed.
3175 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 3176 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 3177
4d7e6e51
PE
31782012-09-23 Paul Eggert <eggert@cs.ucla.edu>
3179
3180 Simplify and avoid signal-handling races (Bug#12471).
3181 * alloc.c (die):
3182 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
3183 Avoid recursive loop if there's a fatal error in the function itself.
3184 * atimer.c (pending_atimers):
3185 * blockinput.h: Don't include "atimer.h"; no longer needed.
3186 (interrupt_input_pending): Remove. All uses removed.
3187 pending_signals now counts both atimers and ordinary interrupts.
3188 This is less racy than having three separate pending-signal flags.
3189 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
3190 (input_blocked_p):
3191 Rename from their upper-case counterparts BLOCK_INPUT,
3192 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
3193 INPUT_BLOCKED_P, and turn into functions. All uses changed.
3194 This makes it easier to access volatile variables more accurately.
3195 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
3196 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
3197 that's more reliable if the code is buggy and sets
3198 interrupt_input_blocked to a negative value. All uses changed.
3199 * atimer.c (deliver_alarm_signal):
3200 Remove. No need to deliver this to the parent; any thread can
3201 handle this signal now. All uses replaced by underlying handler.
3202 * atimer.c (turn_on_atimers):
3203 * dispnew.c (handle_window_change_signal):
3204 * emacs.c (handle_danger_signal):
3205 * keyboard.c (kbd_buffer_get_event):
3206 Don't reestablish signal handler; not needed with sigaction.
3207 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
3208 (UNBLOCK_INPUT_TO):
3209 Rework to avoid unnecessary accesses to volatile variables.
3210 (UNBLOCK_INPUT_TO): Now a function.
3211 (totally_unblock_input, unblock_input): New decls.
3212 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
3213 (init_data): Remove. Necessary stuff now done in init_signal.
3214 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
3215 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
3216 (fatal_error_code): Remove; no longer needed.
3217 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
3218 it doesn't always backtrace. All uses changed. No need to reset
3219 signal to default, since sigaction and/or die does that for us now.
3220 Use emacs_raise (FOO), not kill (getpid (), FOO).
3221 (main): Check more-accurately whether we're dumping.
3222 Move fatal-error setup to sysdep.c
3223 * floatfns.c: Do not include "syssignal.h"; no longer needed.
3224 * gtkutil.c (xg_get_file_name, xg_get_font):
3225 Remove no-longer-needed signal-mask manipulation.
3226 * keyboard.c, process.c (POLL_FOR_INPUT):
3227 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
3228 * keyboard.c (read_avail_input): Remove.
3229 All uses replaced by gobble_input.
3230 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
3231 (kbd_buffer_store_event_hold, gobble_input):
3232 (record_asynch_buffer_change) [USABLE_SIGIO]:
3233 (store_user_signal_events):
3234 No need to mess with signal mask.
3235 (gobble_input): If blocking input and there are terminals, simply
3236 set pending_signals to 1 and return. All hooks changed to not
3237 worry about whether input is blocked.
3238 (process_pending_signals): Clear pending_signals before processing
3239 them, in case a signal comes in while we're processing.
3240 By convention callers now test pending_signals before calling us.
3241 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
3242 New functions, to support changes to blockinput.h.
3243 (handle_input_available_signal): Now extern.
3244 (reinvoke_input_signal): Remove. All uses replaced by
3245 handle_async_input.
3246 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
3247 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
3248 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
3249 Clear sigmask reliably, even if Fsignal returns, which it can.
3250 Omit unnecessary accesses to volatile var.
3251 (quit_throw_to_read_char): No need to restore sigmask.
3252 * keyboard.c (gobble_input, handle_user_signal):
3253 * process.c (wait_reading_process_output):
3254 Call signal-handling code rather than killing ourselves.
3255 * lisp.h: Include <float.h>, for...
3256 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
3257 (pending_signals): Now volatile.
3258 (syms_of_data): Now const if IEEE floating point.
3259 (handle_input_available_signal) [USABLE_SIGIO]:
3260 (terminate_due_to_signal, record_child_status_change): New decls.
3261 * process.c (create_process): Avoid disaster if memory is exhausted
3262 while we're processing a vfork, by tightening the critical section
3263 around the vfork.
3264 (send_process_frame, process_sent_to, handle_pipe_signal)
3265 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
3266 ignores SIGPIPE.
3267 (send_process): No need for setjmp/longjmp any more, since the
3268 SIGPIPE stuff is now gone. Instead, report an error if errno
3269 is EPIPE.
3270 (record_child_status_change): Now extern. PID and W are now args.
3271 Return void, not bool. All callers changed.
3272 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
3273 Remove. All uses removed. This bug should be fixed now in a
3274 different way.
3275 (wait_for_termination_1): Use waitpid rather than sigsuspend,
3276 and record the child status change directly. This avoids the
3277 need to futz with the signal mask.
3278 (process_fatal_action): Move here from emacs.c.
3279 (emacs_sigaction_flags): New function, containing
3280 much of what used to be in emacs_sigaction_init.
3281 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
3282 caught by emacs, to make races less likely.
3283 (deliver_process_signal): Rename from handle_on_main_thread.
3284 All uses changed.
3285 (BACKTRACE_LIMIT_MAX): Now at top level.
3286 (thread_backtrace_buffer, threadback_backtrace_pointers):
3287 New static vars.
3288 (deliver_thread_signal, deliver_fatal_thread_signal):
3289 New functions, for more-accurate delivery of thread-specific signals.
3290 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
3291 (deliver_arith_signal): Handle in this thread, not
3292 in the main thread, since it's triggered by this thread.
3293 (maybe_fatal_sig): New function.
3294 (init_signals): New arg DUMPING so that we can be more accurate
3295 about whether we're dumping. Caller changed.
3296 Treat thread-specific signals differently from process-general signals.
3297 Block all signals while handling fatal error; that's safer.
3298 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
3299 on IEEE hosts.
3300 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
3301 Ignore SIGPIPE unless batch.
3302 (emacs_backtrace): Output backtrace for the appropriate thread,
3303 which is not necessarily the main thread.
3304 * syssignal.h: Include <stdbool.h>.
3305 (emacs_raise): New macro.
3306 * xterm.c (x_connection_signal): Remove; no longer needed
3307 now that we use sigaction.
3308 (x_connection_closed): No need to mess with sigmask now.
3309 (x_initialize): No need to reset SIGPIPE handler here, since
3310 init_signals does this for us now.
3311
8f4635e9
JD
33122012-09-23 Jan Djärv <jan.h.d@swipnet.se>
3313
3314 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 3315 background rect may be larger (Bug#12245).
8f4635e9 3316
3296976d
CY
33172012-09-23 Chong Yidong <cyd@gnu.org>
3318
3319 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
3320
d41e491e
PE
33212012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3322
3323 * .gdbinit: Just stop at fatal_error_backtrace.
3324 See Stefan Monnier's request in
3325 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
3326 Remove no-longer-used query of system type.
3327
c88b867f
CY
33282012-09-22 Chong Yidong <cyd@gnu.org>
3329
3330 * search.c (Freplace_match): Doc fix (Bug#12325).
3331
3332 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
3333
3334 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
3335 (Fline_end_position): Doc fix.
3336
3337 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
3338
bb4d86b4
CY
33392012-09-22 Chong Yidong <cyd@gnu.org>
3340
3341 * dispextern.h (struct image_type): Add new slot, storing a type
3342 initialization function.
3343
3344 * image.c (define_image_type): Call the image initializer function
3345 if it is defined. Arguments and return value changed.
3346 (valid_image_p, make_image): Callers changed.
3347 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
3348 (gif_type, imagemagick_type, svg_type, gs_type):
3349 Add initialization functions.
bb4d86b4
CY
3350 (Finit_image_library): Call lookup_image_type.
3351 (CHECK_LIB_AVAILABLE): Macro deleted.
3352 (lookup_image_type): Call define_image_type here, rather than via
3353 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
3354 (syms_of_image): Move define_image_type calls for xbm_type and
3355 pbm_type to lookup_image_type.
3356
df9685f3
EZ
33572012-09-22 Eli Zaretskii <eliz@gnu.org>
3358
3359 * keyboard.c (timer_check_2): Move calculation of 'timers' and
3360 'idle_timers' from here ...
3361 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
3362 lists, to avoid infloops when the timer does something stupid,
3363 like reinvoke itself with the same or smaller time-out.
3364 (Bug#12447)
3365
8e17c9ba
MR
33662012-09-22 Martin Rudalics <rudalics@gmx.at>
3367
3368 * window.c (Fsplit_window_internal): Handle only Qt value of
3369 Vwindow_combination_limit separately.
3370 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
3371 (Vwindow_combination_limit): New default value.
3372 Rewrite doc-string.
8e17c9ba 3373
589bd69b
EZ
33742012-09-22 Eli Zaretskii <eliz@gnu.org>
3375
3376 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
3377 the new overlay string. (Bug#10159)
3378
01108e3f
PE
33792012-09-22 Paul Eggert <eggert@cs.ucla.edu>
3380
3381 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
3382 or that fprintf is async-signal-safe. POSIX doesn't require
3383 either assumption.
3384
82f8cd94
CY
33852012-09-22 Chong Yidong <cyd@gnu.org>
3386
3387 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
3388 (Bug#8207).
3389
3cccbd87
KH
33902012-09-22 Kenichi Handa <handa@gnu.org>
3391
3392 * composite.c (composition_reseat_it): Handle the case that a
3393 grapheme cluster is not covered by a single font (Bug#12352).
3394
09c01941
CY
33952012-09-21 Chong Yidong <cyd@gnu.org>
3396
3397 * image.c (define_image_type): Avoid adding duplicate types to
3398 image_types (Bug#12463). Suggested by Jörg Walter.
3399
acfa068f 34002012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
3401
3402 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
3403 (print_load_command_name): Add case LC_DATA_IN_CODE.
3404 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
3405
acfa068f 34062012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
3407
3408 * eval.c (Frun_hook_with_args_until_success)
3409 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
3410
acfa068f 34112012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
3412
3413 * fileio.c (Ffile_selinux_context): Only call freecon when
3414 lgetfilecon succeeded.
3415 (Fset_file_selinux_context): Likewise. (Bug#12444)
3416
acfa068f 34172012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
3418
3419 * xdisp.c (try_window_reusing_current_matrix): Under bidi
3420 reordering, locate the cursor by calling set_cursor_from_row; if
3421 that fails, clear the desired glyph matrix before returning a
3422 failure indication to the caller. Fixes leaving garbled display
3423 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
3424 (compute_stop_pos_backwards): Fix a typo that caused crashes while
3425 scrolling through multibyte text.
aa36e4d2 3426
e99f70c8
SM
34272012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
3428
3429 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
3430 calling mark_vectorlike since that's the one that marks the window.
3431 (mark_discard_killed_buffers): Mark the final cdr.
3432 * window.h (struct window): Move prev/next_buffers to the
3433 non-standard fields.
3434 * window.c (make_window): Initialize prev/next_buffers manually.
3435
f75beb47
PE
34362012-09-20 Paul Eggert <eggert@cs.ucla.edu>
3437
3438 Omit unused arg EXPECTED from socket hooks.
3439 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
3440 * nsterm.m (ns_term_init):
3441 * termhooks.h (struct terminal.read_socket_hook):
3442 * w32inevt.c (w32_console_read_socket):
3443 * w32term.c (w32_read_socket):
3444 * xterm.c (XTread_socket):
3445 Omit unused arg EXPECTED. All callers changed.
3446 (store_user_signal_events): Return void, not int, since callers no
3447 longer care about the return value. All uses changed.
3448
b019b76a
JB
34492012-09-20 Juanma Barranquero <lekktu@gmail.com>
3450
3451 * w32gui.h (XParseGeometry): Do not declare.
3452
05642592
PE
34532012-09-19 Paul Eggert <eggert@cs.ucla.edu>
3454
e4bce92a 3455 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 3456 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
3457 <http://bugs.gnu.org/12471#8> (last line).
3458
05642592
PE
3459 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
3460 (XParseGeometry): Now static. Substitute extremal values for
3461 values that are out of range.
3462
e543ae91
JD
34632012-09-19 Jan Djärv <jan.h.d@swipnet.se>
3464
3465 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
3466
3467 * nsfns.m (XParseGeometry): Remove.
3468 (Fx_create_frame): Call x_set_offset to correctly interpret
3469 top_pos in geometry.
3470
3a880af4 3471 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
3472 (Fx_parse_geometry): If there is a space in string, call
3473 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
3474
45ba16c7
EZ
34752012-09-17 Eli Zaretskii <eliz@gnu.org>
3476
c8b9f1bc
EZ
3477 * search.c (scan_buffer): Use character positions in calls to
3478 region_cache_forward and region_cache_backward, not byte
3479 positions. (Bug#12196)
3480
b4c932a2
EZ
3481 * w32term.c (w32_read_socket): Set pending_signals to 1, like
3482 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
3483
45ba16c7
EZ
3484 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
3485 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
3486 emacs_blocked_malloc, now deleted.
3487
eeceac93
PE
34882012-09-17 Paul Eggert <eggert@cs.ucla.edu>
3489
3490 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
3491 The workaround was for improving performance on Solaris 2.4, but
3492 is getting in the way now. Emacs will still work if someone is
3493 still running Solaris 2.4 in a museum somewhere; Sun dropped
3494 support for Solaris 2.4 in 2003.
3495 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
3496 * process.c (create_process) [HAVE_WORKING_VFORK]:
3497 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
3498 since Emacs no longer uses vfork on that platform.
3499
78f83752
GM
35002012-09-17 Glenn Morris <rgm@gnu.org>
3501
3502 * emacs.c: Use COPYRIGHT.
3503
634b8cac
PE
35042012-09-16 Paul Eggert <eggert@cs.ucla.edu>
3505
0caaedb1
PE
3506 Remove configure's --without-sync-input option (Bug#12450).
3507 When auditing signal-handling in preparation for cleaning it up,
3508 I found that SYNC_INPUT has race conditions and would be a real
3509 pain to fix. Since it's an undocumented and deprecated
3510 configure-time option, now seems like a good time to remove it.
3511 Also see <http://bugs.gnu.org/11080#16>.
3512 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
3513 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
3514 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3515 (malloc_hysteresis):
3516 (check_depth) [XMALLOC_OVERRUN_CHECK]:
3517 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
3518 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
3519 (dont_register_blocks, bytes_used_when_reconsidered)
3520 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
3521 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
3522 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 3523 Remove. All uses removed.
0caaedb1
PE
3524 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
3525 implementation, one that depends on whether the new macro
3526 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
3527 is defined.
3528 * atimer.c (run_timers, handle_alarm_signal):
3529 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
3530 (handle_async_input, process_pending_signals)
3531 (handle_input_available_signal, init_keyboard):
3532 * nsterm.m (ns_read_socket):
3533 * process.c (wait_reading_process_output):
3534 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
3535 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
3536 (emacs_write):
3537 * xterm.c (XTread_socket):
3538 Assume SYNC_INPUT.
3539 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
3540 * eval.c (handling_signal): Remove. All uses removed.
3541 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
3542 All uses replaced with the SYNC_INPUT version.
3543 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
3544 Remove decls.
3545 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3546 Now static.
3547
634b8cac
PE
3548 * font.c (Ffont_shape_gstring): Remove unused local.
3549
83da1b55
GM
35502012-09-16 Glenn Morris <rgm@gnu.org>
3551
518650a5
GM
3552 * Makefile.in (clean): No longer run nextstep's clean.
3553
83da1b55
GM
3554 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
3555 (ns_frag): Remove.
3556 (ns-app): Move here from ns.mk, and simplify.
3557 (clean): Simplify nextstep entry.
3558 * ns.mk: Remove file.
3559
85a43e2e
KH
35602012-09-17 Kenichi Handa <handa@gnu.org>
3561
3562 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
3563 not covert the last few charactes.
3564
ba13e616 35652012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
3566
3567 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
3568 here, but just check the validity of glyphs in the glyph-string.
3569
a8c729af
MR
35702012-09-16 Martin Rudalics <rudalics@gmx.at>
3571
3a880af4
SM
3572 * window.c (Fwindow_parameter, Fset_window_parameter):
3573 Accept any window as argument (Bug#12452).
a8c729af 3574
c077c059
JD
35752012-09-16 Jan Djärv <jan.h.d@swipnet.se>
3576
3577 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
3578 to ns_term_init to avoid memory leak.
3579
3580 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
3581 explicit retain/release.
3582 (ns_term_init): Only allow one display. Initialize outerpool and
3583 ns_*_types.
3584
39a57ad0
PE
35852012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 Port _setjmp fix to POSIXish hosts as well as Microsoft.
3588 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
3589 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
3590 the Microsoft problem in a different way, by altering ../nt/config.nt.
3591
7105c8cb
EZ
35922012-09-15 Eli Zaretskii <eliz@gnu.org>
3593
3594 * w32xfns.c:
3595 * w32uniscribe.c:
3596 * w32term.c:
3597 * w32select.c:
3598 * w32reg.c:
3599 * w32proc.c:
3600 * w32menu.c:
3601 * w32inevt.c:
3602 * w32heap.c:
3603 * w32font.c:
3604 * w32fns.c:
3605 * w32console.c:
3606 * w32.c:
3607 * w16select.c: Remove inclusion of setjmp.h, as it is now included
3608 by lisp.h. This completes removal of setjmp.h inclusion
3609 erroneously announced in the previous commit. (Bug#12446)
3610
3611 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
3612 more accurate.
3613
3614 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
3615 not defined as a macro. The latter happens on MS-Windows.
3616 (Bug#12446)
3617
0328b6de
PE
36182012-09-15 Paul Eggert <eggert@cs.ucla.edu>
3619
3620 Port better to POSIX hosts lacking _setjmp (Bug#12446).
3621 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 3622 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
3623 only reason for the instance was because "lisp.h" was included.
3624 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
3625 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
3626 and _longjmp with the new symbols. Emacs already uses _setjmp if
3627 available, so this change affects only POSIXish hosts that have
3628 sigsetjmp but not _setjmp, such as some versions of Solaris and
3629 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
3630 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
3631 (png_load_body) [HAVE_PNG]:
3632 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
3633 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
3634 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
3635 since PNG requires jmp_buf. This is the only exception to the
3636 general rule that we now use sys_setjmp and sys_longjmp.
3637 This exception is OK since this code does not change the signal
3638 mask or longjmp out of a signal handler.
3639
2af03429
PE
36402012-09-14 Paul Eggert <eggert@cs.ucla.edu>
3641
3642 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
3643 Include "syssignal.h", for 'main_thread'.
3644
2f294edf
DA
36452012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
3646
3647 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
3648 * insdel.c (replace_range, replace_range_2):
3649 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
3650 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
3651 Remove redundant check before calling offset_intervals.
3652
6b533e9c
MR
36532012-09-14 Martin Rudalics <rudalics@gmx.at>
3654
3655 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
3656 current buffer (Bug#12387).
3657
2a7931e3
JB
36582012-09-14 Juanma Barranquero <lekktu@gmail.com>
3659
3660 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
3661
c18e885b
PE
36622012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3663
3664 Use a more backwards-compatible timer format (Bug#12430).
3665 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
3666 vector element, not from the 4th, since PSECS is now at the end.
3667 (Fcurrent_idle_time): Doc fix.
3668
d59a1afb
DA
36692012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
3670
3671 Function to mark objects and remove killed buffers at once.
3672 * alloc.c (discard_killed_buffers): Rename to ...
3673 (mark_discard_killed buffers) ... new name. Add marking
3674 of remaining objects. Fix comment. Adjust users.
3675 (mark_object): Do not touch frame buffer lists here.
3676 * frame.c (delete_frame): Reset frame buffer lists here.
3677
5f0cb45a
PE
36782012-09-13 Paul Eggert <eggert@cs.ucla.edu>
3679
8ea47e3a
PE
3680 Better workaround for GNOME bug when --enable-gcc-warnings.
3681 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
3682 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
3683 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
3684
4a4bbad2
PE
3685 Simplify SIGIO usage (Bug#12408).
3686 The code that dealt with SIGIO was crufty and confusing, e.g., it
3687 played tricks like "#undef SIGIO" but these tricks were not used
3688 consistently. Simplify mostly by not #undeffing standard symbols,
3689 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
3690 or not as we please) rather than "defined SIGIO" (standard symbol
3691 that we probably shouldn't #undef).
3692 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
3693 Modules that need it can include it.
3694 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
3695 * dispextern.h (ignore_sigio): New decl.
3696 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
3697 unconditionally, since it's now a no-op if !USABLE_SIGIO.
3698 * emacs.c (shut_down_emacs):
3699 * keyboard.c (kbd_buffer_store_event_hold):
3700 Use ignore_sigio rather than invoking 'signal' directly.
3701 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
3702 for FIONREAD.
3703 (FIONREAD, SIGIO): Do not #undef.
3704 (tty_read_avail_input): Use #error rather than a syntax error.
3705 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
3706 for I_PIPE, used by SETUP_SLAVE_PTY.
3707 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
3708 * sysdep.c (croak): Remove; no longer needed. This bit of
3709 temporary code, with Fred N. Fish's comment that it's temporary,
3710 has been in Emacs since at least 1992!
3711 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
3712 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
3713 * syssignal.h (croak): Remove decl.
3714 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
3715 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
3716 now that we're termios-only.
3717 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
3718 * term.c (dissociate_if_controlling_tty): Use #error rather than
3719 a run-time error.
3720
5f0cb45a
PE
3721 Work around GCC and GNOME bugs when --enable-gcc-warnings.
3722 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
3723 to work around GNOME bug 683906.
3724 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
3725 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
3726 This works around GCC bug 54561.
3727
40bce90b
PE
37282012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3729
3730 More fixes for 'volatile' and setjmp/longjmp.
3731 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
3732 * image.c (struct png_load_context) [HAVE_PNG]: New type.
3733 (png_load_body) [HAVE_PNG]:
3734 (jpeg_load_body) [HAVE_JPEG]:
3735 New function, with most of the old parent function's body.
3736 (png_load) [HAVE_PNG]:
3737 (jpeg_load) [HAVE_JPEG]:
3738 Invoke the new function, to avoid longjmp munging our locals.
3739 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
3740 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
3741 longjmp is passed 2, as the C standard doesn't guarantee this.
3742 Instead, store the failure code into mgr->failure_code.
3743
bfeae2cf
SM
37442012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3745
3746 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
3747 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
3748 (syms_of_keyboard): Remove support for unread-command-char.
3749
8099e36b
EZ
37502012-09-12 Eli Zaretskii <eliz@gnu.org>
3751
3752 * w32proc.c (sys_kill): If PID is our process ID and the signal is
3753 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
3754 violation. (Bug#12426)
3755
92547ff9
PE
37562012-09-12 Paul Eggert <eggert@cs.ucla.edu>
3757
3758 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
3759
45b82ad0
SM
37602012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3761
3762 * eval.c: Add `inhibit-debugger'.
3763 (Qinhibit_debugger): New symbol.
3764 (call_debugger): Bind it instead of Qdebug_on_error.
3765 (maybe_call_debugger): Test Vinhibit_debugger.
3766 (syms_of_eval): Define inhibit-debugger.
3767 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
3768 (syms_of_xdisp): Remove inhibit-debug-on-message.
3769
5779a1dc
PE
37702012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3771
50f2e553
PE
3772 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
3773 If a nonvolatile local variable is written before a _longjmp to
3774 the frame containing the variable, and is read after the _longjmp,
3775 the value read is indeterminate. Some local variables of type
3776 'struct handler' and 'struct catchtag' are used in this way, so
3777 mark each of their slots as volatile if the slot can be set before
3778 _longjmp and read afterwards.
3779 * lisp.h (struct handler): var and chosen_clause are now volatile.
3780 (struct catchtag): val, next, and pdlcount are now volatile.
3781
ae1d87e2
PE
3782 * bidi.c (bidi_push_it, bidi_pop_it):
3783 * fns.c (copy_hash_table):
3784 * image.c (define_image_type):
3785 * keyboard.c (kbd_buffer_store_event_hold):
3786 * process.c (Fprocess_send_eof):
3787 * xfaces.c (x_create_gc) [HAVE_NS]:
3788 * xgselect.c (xg_select):
3789 Prefer assignment to memcpy when either will do.
3790
5779a1dc
PE
3791 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
3792 Use pointer-to-a-pointer to simplify and avoid a NILP check each
3793 time an item is removed. No need to mark this function 'inline';
3794 the compiler knows better than we do.
3795
c4c9756b
JD
37962012-09-11 Jan Djärv <jan.h.d@swipnet.se>
3797
3798 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
3799 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
3800 to change_frame_size (Bug#12388).
3801 (windowDidResize:): Pass YES to updateFrameSize.
3802
3803 * nsterm.h: Add delay parameter to updateFrameSize.
3804
d73e321c
DA
38052012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3806
3807 Discard killed buffers from deleted window and frame objects.
3808 This reduces an amount of references to killed buffers and
3809 helps GC to reclaim them faster.
3810 * alloc.c (discard_killed_buffers): New function.
3811 (mark_object): Use it for deleted windows and frames.
3812 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 3813 or deleted frame, restore its global binding.
d73e321c
DA
3814 * data.c (swap_in_global_binding): Add GC notice.
3815 (swap_in_symval_forwarding): Use convenient set_blv_where.
3816 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
3817 * window.h: ... to here.
3818
e578f381
DA
38192012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
3820
3821 Convenient macro to check whether the buffer is live.
3822 * buffer.h (BUFFER_LIVE_P): New macro.
3823 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
3824 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
3825
3057e615
YM
38262012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3827
3828 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
3829 composition cases (Bug#12364).
3830
3831 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
3832 overhang of succeeding glyphs overlapping box cursor.
3833
3834 * w32term.c (x_draw_glyph_string): Likewise.
3835
6fda35f2
PE
38362012-09-11 Paul Eggert <eggert@cs.ucla.edu>
3837
c990426a
PE
3838 Simplify, document, and port floating-point (Bug#12381).
3839 The porting part of this patch fixes bugs on non-IEEE platforms
3840 with frexp, ldexp, logb.
3841 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
3842 Now static.
3843 * floatfns.c: Simplify discussion of functions that Emacs doesn't
3844 support, by removing commented-out code and briefly listing the
3845 C89 functions excluded. The commented-out stuff was confusing
3846 maintenance, e.g., we thought we needed cbrt but it was commented out.
3847 (logb): Remove decl; no longer needed.
3848 (isfinite): New macro, if not already supplied.
3849 (isnan): Don't replace any existing macro.
3850 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
3851 are present on all C89 platforms.
3852 (Ffrexp): Do not special-case zero, as frexp does the right thing
3853 for that case.
3854 (Flogb): Do not use logb, as it doesn't have the desired meaning
3855 on hosts that use non-base-2 floating point. Instead, stick with
3856 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
3857 frexp, to avoid getting an unspecified result.
3858
6fda35f2
PE
3859 * xdisp.c (Qinhibit_debug_on_message): Now static.
3860
16130a58
JD
38612012-09-10 Jan Djärv <jan.h.d@swipnet.se>
3862
3863 * nsterm.m (ns_update_begin): Set clip path to whole view by using
3864 NSBezierPath (Bug#12131).
3865
d105a573
CY
38662012-09-10 Chong Yidong <cyd@gnu.org>
3867
3868 * fns.c (Fdelq, Fdelete): Doc fix.
3869
ff55dfe8
PE
38702012-09-10 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
3873 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
3874
e7032e7c
SM
38752012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
3876
3877 * lisp.h (make_lisp_ptr): New macro to replace XSET.
3878 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
3879 Use it.
3880
e9957956
EZ
38812012-09-09 Eli Zaretskii <eliz@gnu.org>
3882
aba05ce9
EZ
3883 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
3884 left fringe if the window has a left margin. This avoids leaving
3885 traces of the cursor because its leftmost pixel is not drawn over.
3886
e9957956
EZ
3887 * dispnew.c (update_window_line): When the left margin area of a
3888 screen line is updated, set the redraw_fringe_bitmaps_p flag of
3889 that screen line. (Bug#12277)
3890
f6196b87
PE
38912012-09-09 Paul Eggert <eggert@cs.ucla.edu>
3892
3893 Assume C89 or later for math functions (Bug#12381).
3894 This simplifies the code, and makes it a bit smaller and faster,
3895 and (most important) makes it easier to clean up signal handling
3896 since we can stop worring about floating-point exceptions in
3897 library code. That was a problem before C89, but the problem
3898 went away many years ago on all practical Emacs targets.
3899 * data.c, image.c, lread.c, print.c:
3900 Don't include <math.h>; no longer needed.
3901 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
3902 might be autoconfigured, as that never happens.
3903 * data.c (fmod):
3904 * doprnt.c (DBL_MAX_10_EXP):
3905 * print.c (DBL_DIG):
3906 Remove. C89 or later always defines these.
3907 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
3908 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
3909 (arith_error, domain_error, domain_error2):
3910 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
3911 no longer needed -- we simply return what C returns. All uses removed.
3912 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
3913 the wrapped code.
3914 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
3915 Remove. All uses expanded, as these macros are no longer used
3916 more than once and are now more trouble than they're worth.
3917 (Ftan): Use tan, not sin / cos.
3918 (Flogb): Assume C89 frexp.
3919 (fmod_float): Assume C89 fmod.
3920 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
3921 (init_floatfns): Remove. All uses removed.
3922
9d7f1863
JD
39232012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3924
3925 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
3926 compositeToPoint for OSX < 10.6 (Bug#12390).
3927
eabf0404
PE
39282012-09-08 Paul Eggert <eggert@cs.ucla.edu>
3929
3930 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
3931 This produces more-accurate results.
3932
0b3b1d23
JD
39332012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3934
3935 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
3936 changes (Bug#12088).
3937
6dcef6ec
CY
39382012-09-08 Chong Yidong <cyd@gnu.org>
3939
3940 * syntax.c (Fstring_to_syntax): Doc fix.
3941
aa7d57c5
JD
39422012-09-08 Jan Djärv <jan.h.d@swipnet.se>
3943
3944 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
3945 in the internal border.
3946 (x_set_window_size): Remove static variables and their usage.
3947 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
3948 (ns_after_update_window_line, ns_draw_fringe_bitmap):
3949 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
3950 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
3951 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
3952 (ns_fix_rect_ibw): Remove.
3953 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
3954 (ns_dumpglyphs_box_or_relief): Ditto.
3955 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
3956 adjustment.
3957 (ns_dumpglyphs_image): Ditto.
fc0c31f8 3958 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
3959 border adjustment.
3960 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
3961 their usage. Add fringe_extended_p and its use as in other terms.
3962 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
3963 scroll bar was removed.
3964 (updateFrameSize): New function.
3965 (windowDidResize): Move code to updateFrameSize and call it.
3966
3967 * nsterm.h (EmacsView): Add updateFrameSize.
3968
1a5432bc
CY
39692012-09-07 Chong Yidong <cyd@gnu.org>
3970
b4f5313e
CY
3971 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
3972
1a5432bc
CY
3973 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
3974
1a4f1e9b
PE
39752012-09-07 Paul Eggert <eggert@cs.ucla.edu>
3976
3977 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
3978 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
3979 Problem introduced when merging patches. Noted by Eli Zaretskii in
3980 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
3981 * floatfns.c: Comment fix.
3982 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
3983 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
3984 and anyway the declaration is harmless even if SIGDANGER is not defined.
3985 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
3986 defined BROKEN_FIONREAD). systty.h formerly did this, but other
3987 source files not surprisingly expected syssignal.h to define, or
3988 not define, SIGIO, and it's cleaner to do it that way, for consistency.
3989 Include <sys/ioctl.h>, for FIONREAD.
3990 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
3991 This eliminates a problem whereby other files mysteriously had
3992 to include "syssignal.h" before including "systty.h" if they
3993 wanted to use "#ifdef SIGIO".
3994
bc8000ff
EZ
39952012-09-07 Eli Zaretskii <eliz@gnu.org>
3996
3e6d6928
EZ
3997 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
3998
3999 * w32.c (sigemptyset): Empty the set.
4000 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
4001
bc8000ff
EZ
4002 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
4003
b4fa72f2
DA
40042012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
4005
4006 * alloc.c (mark_buffer): Revert unsafe marking optimization.
4007 (mark_object): Likewise for frame objects.
4008
30730c93
PE
40092012-09-07 Paul Eggert <eggert@cs.ucla.edu>
4010
4011 * syssignal.h (handle_on_main_thread): Always declare,
4012 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
4013 This ports to platforms without HAVE_PTHREAD.
4014
2fe28299
PE
40152012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4016
4017 Signal-handler cleanup (Bug#12327).
4018 Emacs's signal handlers were written in the old 4.2BSD style with
4019 sigblock and sigmask and so forth, and this led to some
4020 inefficiencies and confusion. Rewrite these to use
4021 pthread_sigmask etc. without copying signal sets around. Also,
4022 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
4023 'signal', and instead use functions that do not attempt to take
4024 over the system name space. This patch causes Emacs's text
4025 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
4026 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
4027 Do not include <signal.h> or "syssignal.h", as these
4028 modules do not use signals.
4029 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
4030 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
4031 Do not include <signal.h>, as "syssignal.h" does that for us now.
4032 * atimer.c (sigmask_atimers): New function.
4033 (block_atimers, unblock_atimers): New functions,
4034 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
4035 All uses replaced.
4036 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
4037 no longer needed here.
4038 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 4039 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
4040 * sysdep.c (struct save_signal): New member 'action', replacing
4041 old member 'handler'.
4042 (save_signal_handlers, restore_signal_handlers):
4043 Use sigaction instead of 'signal' to save and restore.
4044 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
4045 New function. All users of 'signal' modified to use set_sighandler
4046 if they're writeonly, and to use sys_signal if they're read+write.
4047 (emacs_sigaction_init, forwarded_signal): New functions.
4048 (sys_signal): Remove. All uses replaced by calls to sigaction
4049 and emacs_sigaction_init, or by direct calls to 'signal'.
4050 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
4051 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
4052 all uses replaced by pthread_sigmask etc. calls.
4053 * syssignal.h: Include <signal.h>.
4054 (emacs_sigaction_init, forwarded_signal): New decls.
4055 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
4056 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
4057 (sigmask, sys_sigmask): Remove; no longer needed.
4058 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
4059 (sigblock, sigunblock, sigfree):
4060 (sigsetmask) [!defined sigsetmask]:
4061 Remove. All uses replaced by pthread_sigmask.
4062 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
4063 no longer need to be replaced, and its typical old uses
4064 are now done via emacs_sigaction_init and sigaction.
4065 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
4066 (sys_sigdel): Remove; unused.
4067 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
4068
0216c128
EZ
40692012-09-06 Eli Zaretskii <eliz@gnu.org>
4070
4071 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
4072 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
4073
c752cfa9
DA
40742012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4075
4076 Explicitly mark buffer_defaults and buffer_local_symbols.
4077 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
4078 mark_local_symbols here.
4079 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
4080 since special buffers aren't marked here any more.
4081 (allocate_buffer): Chain new buffer with all_buffers here...
4082 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
4083 not here.
4084 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
4085 (syms_of_buffer): Remove staticpro of the above.
4086 (init_buffer_once): Set names for buffer_defaults and
4087 buffer_local_symbols.
4088
a864ef14
PE
40892012-09-06 Paul Eggert <eggert@cs.ucla.edu>
4090
4091 Use bool for booleans in font-related modules.
4092 * font.c (font_intern_prop, font_style_to_value)
4093 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
4094 (generate_otf_features, font_check_otf_features, font_check_otf)
4095 (font_match_p, font_list_entities, font_at):
4096 * fontset.c (fontset_id_valid_p, reorder_font_vector
4097 (fontset_find_font, Fset_fontset_font)
4098 (face_suitable_for_char_p) [0]:
4099 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
4100 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
4101 (m17n_flt_initialized, ftfont_shape_by_flt):
4102 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
4103 * nsfont.m (nsfont_draw):
4104 * w32font.c (w32font_draw):
4105 * w32term.c (x_draw_glyphless_glyph_string_foreground):
4106 Use bool for booleans.
4107 * font.h: Adjust to above API changes.
4108 (struct font, struct font_driver, struct font_driver_list):
4109 Use bool for booleans.
4110 (struct font): Remove useless member encoding_type.
4111 All users removed.
4112 * fontset.c, xftfont.c: Omit unnecessary static decls.
4113
0699fc18
DA
41142012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
4115
4116 * alloc.c (mark_object): Revert window marking code
4117 since it's unsafe for the Fset_window_configuration.
4118
20ef56db
PE
41192012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4120
2fe28299 4121 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
4122 Be more systematic about preserving errno whenever a signal
4123 handler returns, even if it's not in the main thread. Do this by
4124 renaming signal handlers to distinguish between signal delivery
4125 and signal handling. All uses changed.
4126 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
4127 * data.c (deliver_arith_signal): Rename from arith_error.
4128 * dispnew.c (deliver_window_change_signal): Rename from
4129 window_change_signal.
4130 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
4131 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
4132 * keyboard.c (deliver_input_available_signal): Rename from
4133 input_available_signal.
4134 (deliver_user_signal): Rename from handle_user_signal.
4135 (deliver_interrupt_signal): Rename from interrupt_signal.
4136 * process.c (deliver_pipe_signal): Rename from send_process_trap.
4137 (deliver_child_signal): Rename from sigchld_handler.
4138 * atimer.c (handle_alarm_signal):
4139 * data.c (handle_arith_signal):
4140 * dispnew.c (handle_window_change_signal):
4141 * emacs.c (handle_fatal_signal, handle_danger_signal):
4142 * keyboard.c (handle_input_available_signal):
4143 * keyboard.c (handle_user_signal, handle_interrupt_signal):
4144 * process.c (handle_pipe_signal, handle_child_signal):
4145 New functions, with the actual signal-handling code taken from the
4146 original respective signal handlers, sans the sporadic attempts to
4147 preserve errno, since that's now done by handle_on_main_thread.
4148 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
4149 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
4150 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4151 Move to sysdep.c.
4152 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4153 Move initialization of main_thread to sysdep.c's init_signals.
4154 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
4155 our usage, and simplifies the mainline code.
4156 (record_child_status_change): New static function, as a helper
4157 for handle_child_signal, and with most of the old child handler's
4158 contents.
4159 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
4160 (handle_child_signal): Use the above.
4161 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
4162 Moved here from emacs.c.
4163 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
4164 code moved here from emacs.c's main function.
4165 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
4166 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
4167 This lets callers save and restore errno properly.
20ef56db 4168
e3ccf108
DA
41692012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4170
4171 Remove redundant or unused things here and there.
4172 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
4173 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
4174 * editfns.c (Fcompare_buffer_substrings): Likewise.
4175 * frame.h (struct terminal, struct font_driver_list):
4176 Remove redundant declarations.
4177 * window.h (Qleft, Qright): Likewise.
4178
697e1e39
DA
41792012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4180
4181 Do not mark objects from deleted buffers, windows and frames.
4182 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
4183 (mark_object): Likewise for windows and frames.
4184
c1ca42ca
DA
41852012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
4186
4187 * alloc.c (valid_lisp_object_p): Treat killed buffers,
4188 buffer_defaults and buffer_local_symbols as valid objects.
4189 Return special value to denote them.
4190
014d93be
PE
41912012-09-05 Paul Eggert <eggert@cs.ucla.edu>
4192
f75d7a91
PE
4193 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
4194 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
4195 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
4196 (file_name_absolute_p, Fsubstitute_in_file_name):
4197 (check_executable, check_writable, Ffile_accessible_directory_p)
4198 (Fset_file_selinux_context, Fdefault_file_modes)
4199 (Finsert_file_contents, choose_write_coding_system)
4200 (Fwrite_region, build_annotations, a_write, e_write)
4201 (Fdo_auto_save):
4202 * filelock.c (boot_time_initialized, get_boot_time)
4203 (get_boot_time_1, lock_file_1, within_one_second):
4204 * floatfns.c (in_float):
4205 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
4206 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
4207 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
4208 * lisp.h (struct Lisp_Hash_Table.cmpfn):
4209 * window.c (compare_window_configurations):
4210 Use bool for booleans.
4211 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
4212 (Fdefault_file_modes): Now mode_t, not int, for modes.
4213 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
4214 (internal_delete_file): Now returns void, not a (boolean) int,
4215 since nobody was looking at the return value.
4216 * lisp.h, window.h: Adjust to above API changes.
4217
014d93be
PE
4218 * xdisp.c (set_message): Simplify and reindent last change.
4219
776f29e1
JB
42202012-09-05 Juanma Barranquero <lekktu@gmail.com>
4221
4222 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
4223
7f7e0167
LI
42242012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
4225
4226 * eval.c (call_debugger): Make the function non-static so that we
4227 can call it from set_message.
4228
4229 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
4230 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
4231
cf29dd84
PE
42322012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4233
4234 Give more-useful info on a fatal error (Bug#12328).
4235 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
4236 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
4237 of doing the work ourselves.
4238 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
4239 do most of the work.
4240 (fatal_error_backtrace): New function, taken from the guts
4241 of the old fatal_error_signal, but with a new option to output
4242 a backtrace.
4243 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
4244 info about the signal than just its number.
4245 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
4246 * sysdep.c: Include <execinfo.h>
4247 (emacs_backtrace): New function, taken partly from the previous
4248 code of the 'die' function.
4249 (emacs_abort): Call fatal_error_backtrace rather than abort.
4250
972debf2
SM
42512012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
4252
4253 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
4254 eager (load-time) macro-expansion.
4255 * lisp.mk (lisp): Add macroexp.
4256
1088b922
PE
42572012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4258
4259 Simplify redefinition of 'abort' (Bug#12316).
4260 Do not try to redefine the 'abort' function. Instead, redo
4261 the code so that it calls 'emacs_abort' rather than 'abort'.
4262 This removes the need for the NO_ABORT configure-time macro
4263 and makes it easier to change the abort code to do a backtrace.
4264 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
4265 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
4266 Remove; sysdep.c's emacs_abort now takes its place.
4267 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
4268 'abort' changed to use 'emacs_abort'.
4269 * msdos.c (dos_abort) [defined abort]: Remove; not used.
4270 (abort) [!defined abort]: Rename to ...
4271 (emacs_abort): ... new name.
4272 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
4273 the place of the old 'abort' in emacs.c.
4274 * w32.c, w32fns.c (abort): Do not #undef.
4275 * w32.c (emacs_abort): Rename from w32_abort.
4276
30934d33
EZ
42772012-09-04 Eli Zaretskii <eliz@gnu.org>
4278
4279 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
4280 offsets[j].dv, since the y axis of the screen coordinates points
4281 down, while the y axis of the font definition coordinates points
4282 up. This fixes display of Arabic diacritics such as KASRA and
4283 KASRATAN. (Bug#11860)
4284
af26b72c
PE
42852012-09-04 Paul Eggert <eggert@cs.ucla.edu>
4286
4287 Be more systematic about _setjmp vs setjmp.
4288 * alloc.c (test_setjmp, mark_stack):
4289 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
4290 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
4291 (png_load, my_error_exit, jpeg_load):
4292 * process.c (send_process_trap, send_process):
4293 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
4294 The underscored versions are up to 30x faster on some hosts.
4295 Formerly, the code used setjmp+longjmp sometimes and
4296 _setjmp+_longjmp at other times, with no particular reason to
4297 prefer setjmp+longjmp.
4298
26d4541d
PE
42992012-09-03 Paul Eggert <eggert@cs.ucla.edu>
4300
d42f4f0f 4301 Fix minor problem found by static checking.
26d4541d 4302 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 4303
c5e28e39
MR
43042012-09-03 Martin Rudalics <rudalics@gmx.at>
4305
4306 * buffer.c (Fdelete_all_overlays): New function.
4307
3eab3ca9
CY
43082012-09-03 Chong Yidong <cyd@gnu.org>
4309
4310 * gtkutil.c: Add extern decl for Qxft.
4311
c04889f8
PE
43122012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4313
1882aa38
PE
4314 * emacs.c, eval.c: Use bool for boolean.
4315 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
4316 (malloc_using_checking) [DOUG_LEA_MALLOC]:
4317 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
4318 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
4319 (main, decode_env_path, Fdaemon_initialized):
4320 * eval.c (call_debugger, Finteractive_p, interactive_p):
4321 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
4322 (maybe_call_debugger, Fbacktrace):
4323 * process.c (read_process_output, exec_sentinel):
4324 Use bool for booleans.
4325 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
4326 All callers changed.
4327 * eval.c (interactive_p): Omit always-true boolean argument
4328 EXCLUDE_SUBRS_P. All callers changed.
4329 * dispextern.h, lisp.h: Reflect above API changes.
4330 * firstfile.c (dummy): Use the address of 'main', whose signature
4331 won't change, instead of the address of 'initialize', whose
4332 signature just changed from int to bool.
4333 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
4334 * msdos.c (fatal_error_in_progress): ... from here.
4335 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
4336 of incrementing it.
4337 (redisplay_internal, unwind_redisplay): Simply clear
4338 REDISPLAYING_P when unwinding, instead of saving its previous,
4339 always-false value and then restoring it.
4340
a411ac43
PE
4341 Clean up some extern decls.
4342 Mostly, this hoists extern decls out of .c files and into .h files.
4343 That way, we're more likely to catch errors if the interfaces change.
4344 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
4345 declare xg_mark_data.
4346 * dispextern.h (x_frame_parm_handlers):
4347 * font.h (Qxft):
4348 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
4349 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
4350 (Qultra_bold, Qoblique, Qitalic):
4351 Move extern decl here from .c file.
4352 * alloc.c (xg_mark_data) [USE_GTK]:
4353 * doc.c (Qclosure):
4354 * eval.c (Qlexical_binding):
4355 * fns.c (time) [!HAVE_UNISTD_H]:
4356 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
4357 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
4358 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
4359 * lread.c (Qinternal_interpreter_environment):
4360 * minibuf.c (Qbuffer):
4361 * process.c (QCfamily, QCfilter):
4362 * widget.c (free_frame_faces):
4363 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
4364 * xfont.c (x_clear_errors):
4365 * xterm.c (x_frame_parm_handlers):
4366 Remove now-redundant extern decls.
4367 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
4368 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
4369 Now static.
4370 * xfaces.c: Remove unnecessary static decls.
4371 * xterm.c (updating_frame): Remove decl of nonexistent object.
4372
c04889f8
PE
4373 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
4374 when building globals.h, as the objects that are not built on
4375 this host are not needed to compile C files on this host.
4376
8b339673
JD
43772012-09-02 Jan Djärv <jan.h.d@swipnet.se>
4378
4379 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
4380
4381 * frame.h: Add missing prototype for x_wm_set_size_hint.
4382
a08d4ba7
PE
43832012-09-02 Paul Eggert <eggert@cs.ucla.edu>
4384
4385 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
4386 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
4387 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
4388 (Fsubstitute_command_keys):
4389 * editfns.c (region_limit, find_field, Fconstrain_to_field)
4390 (save_excursion_save, save_excursion_restore)
4391 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
4392 (format_time_string, general_insert_function)
4393 (make_buffer_string, make_buffer_string_both)
4394 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
4395 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
4396 (copy_text, insert_1, insert_1_both, insert_from_string)
4397 (insert_from_string_before_markers, insert_from_string_1)
4398 (insert_from_buffer, insert_from_buffer_1, replace_range)
4399 (replace_range_2, del_range_1, del_range_byte, del_range_both)
4400 (del_range_2, modify_region):
4401 * intervals.c (intervals_equal, balance_possible_root_interval)
4402 (adjust_intervals_for_insertion, merge_properties_sticky)
4403 (graft_intervals_into_buffer, lookup_char_property)
4404 (adjust_for_invis_intang, set_point_both)
4405 (get_property_and_range, compare_string_intervals)
4406 (set_intervals_multibyte_1, set_intervals_multibyte):
4407 * keyboard.c (decode_timer):
4408 Use bool for boolean.
4409 * intervals.h, lisp.h, systime.h: Reflect above API changes.
4410 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
4411
48c948de
CY
44122012-09-02 Chong Yidong <cyd@gnu.org>
4413
4414 * keymap.c (push_key_description): Print M-TAB as C-M-i
4415 (Bug#11758).
4416
6c49a40b
JB
44172012-09-02 Juanma Barranquero <lekktu@gmail.com>
4418
4419 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
4420 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
4421 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
4422 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
4423 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
4424 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
4425 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4426
4dfbd238
EZ
44272012-09-01 Eli Zaretskii <eliz@gnu.org>
4428
7e510e28
EZ
4429 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
4430 more than one grapheme cluster passed to the shaper: compute the
4431 offset adjustment values separately for each cluster. (Bug#11860)
4432
4dfbd238
EZ
4433 * image.c: Restore mistakenly removed inclusion of w32.h. Without
4434 it, GCC doesn't see prototypes of w32_delayed_load, and complains
4435 about implicit conversions from integer to pointer.
4436
86571ae0
DC
44372012-09-01 Daniel Colascione <dancol@dancol.org>
4438
4439 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
4440 system used too early.
4441
0e23ef9d
PE
44422012-09-01 Paul Eggert <eggert@cs.ucla.edu>
4443
4444 Better seed support for (random).
4445 * emacs.c (main): Call init_random.
4446 * fns.c (Frandom): Set the seed from a string argument, if given.
4447 Remove long-obsolete Gentzel cruft.
4448 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
4449 (init_random): New function.
4450
17a2cbbd
DC
44512012-09-01 Daniel Colascione <dancol@dancol.org>
4452
4453 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
4454 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
4455 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
4456 x_wm_set_size_hint, x_query_colors, x_real_positions,
4457 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
4458 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
4459 all of which have been moved to common code.
4460
4461 * xfaces.c: Include TERM_HEADER instead of listing all possible
4462 window-system headers.
4463
4464 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
4465 to match header.
4466
4467 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
4468 directly accessing frame internals.
4469
f18cbb28 4470 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
4471 globals_of_w32font.
4472
4473 * process.c: Include TERM_HEADER instead of listing all possible
4474 window-system headers.
4475
3a880af4
SM
4476 * nsterm.h: Remove declarations now in frame.h.
4477 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
4478
4479 * menu.c: Include TERM_HEADER instead of listing all possible
4480 window-system headers.
4481
4482 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
4483 window system.
4484
4485 * keyboard.c: Include TERM_HEADER instead of listing all possible
4486 window-system headers.
4487
4488 * image.c: Include TERM_HEADER instead of listing all possible
4489 window-system headers. Declare Vlibrary_cache when compiling for
4490 Windows.
4491
4492 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
4493 window system declarations.
4494
4495 * frame.h: Move common functions here: set_frame_menubar,
4496 x_set_window_size, x_sync, x_get_focus_frame,
4497 x_set_mouse_position, x_set_mouse_pixel_position,
4498 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
4499 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
4500 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
4501 x_activate_menubar, x_real_positions, x_bitmap_icon,
4502 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
4503 and x_query_colors.
4504
4505 * frame.c: Include TERM_HEADER instead of listing all possible
4506 window-system headers.
4507
4508 * font.c: Include TERM_HEADER instead of listing all possible
4509 window-system headers.
4510
4511 * emacs.c: Include TERM_HEADER.
4512
f18cbb28
EZ
4513 * dispnew.c: Include TERM_HEADER instead of listing all possible
4514 window-system headers.
17a2cbbd 4515
f18cbb28 4516 * ccl.h: Include character.h.
17a2cbbd
DC
4517
4518 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
4519 the current window system; include in list of objects to link into
4520 Emacs.
4521
c650a5de
DA
45222012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4523
4524 Remove mark_ttys function and fix tty_display_info initialization.
4525 * lisp.h (mark_ttys): Remove prototype.
4526 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
4527 to mark_ttys because all possible values of 'top_frame' slot are
4528 the frames which are reachable from Vframe_list.
4529 * term.c (mark_ttys): Remove.
4530 (init_tty): Safely initialize 'top_frame' slot with Qnil.
4531
4e0f6479
DA
45322012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4533
4534 Change struct frame bitfields from unsigned char to unsigned.
4535 * frame.h (struct frame): Change type of 'display_preempted',
4536 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
4537 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
4538 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
4539 bitfields from unsigned char to unsigned.
4540
8b96a52c
DA
45412012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
4542
4543 Remove unused member of struct x_output and struct w32_output.
4544 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
4545 * w32term.h (struct w32_output): Likewise.
4546
b4444c8a
JD
45472012-08-30 Jan Djärv <jan.h.d@swipnet.se>
4548
4549 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
4550 does not become zero (Bug#12234).
4551
b98521db
PE
45522012-08-30 Paul Eggert <eggert@cs.ucla.edu>
4553
4554 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
4555 for GCC 4.7.1 x86-64.
4556
31d02438
GM
45572012-08-30 Glenn Morris <rgm@gnu.org>
4558
4559 * lread.c (init_lread): For out-of-tree builds, only add the
4560 source directory's site-lisp dir to the load-path if it exists,
4561 consistent with in-tree builds. (Bug#12302)
4562
7f8941d8
JD
45632012-08-28 Jan Djärv <jan.h.d@swipnet.se>
4564
4565 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 4566 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
4567 (windowShouldClose:): Set window_closed.
4568 (dealloc): New member, free button_values.
fc0c31f8
JB
4569 (process_dialog:): Make member function. Remove window argument,
4570 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
4571 in button_values.
4572 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 4573 with tag. Remove return self, declare return value as void.
7f8941d8
JD
4574 (addString:row:): Remove return self, declare return value as void.
4575 (addSplit): Remove return self, declare return value as void.
4576 (clicked:): Remove return self, declare return value as void.
fc0c31f8 4577 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
4578 (initFromContents:isQuestion:): Adjust call to process_dialog.
4579 Code formatting change.
4580 (timeout_handler:): Set timer_fired to YES.
4581 (runDialogAt:): Set timer_fired to NO.
4582 Handle click on close button as quit.
4583
4584 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
4585 Add window_closed and button_values. Add void as return value for
4586 add(Button|String|Split). addButton takes int instead of Lisp_Object.
4587 Add process_dialog as new member.
4588
eada0861 45892012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 4590
eada0861
GM
4591 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
4592 is not one of the heaps we manage. (Bug#12242)
4593
45942012-08-28 Glenn Morris <rgm@gnu.org>
4595
4596 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
4597
457294dd
MR
45982012-08-28 Martin Rudalics <rudalics@gmx.at>
4599
4600 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
4601 auto-buffer-name window parameter. Install revision of reverted
4602 fix.
457294dd 4603
4f2daf31
DA
46042012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4605
4606 Do not allow to set major mode for a dead buffer.
4607 * buffer.c (Fset_buffer_major_mode): Signal an error
4608 if the buffer is dead.
4609 (Fother_buffer, other_buffer_safely): Remove redundant
4610 nested declaration.
4611
66322887
DA
46122012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4613
4614 Always use set_buffer_if_live to restore original buffer at unwind.
4615 * buffer.h (record_unwind_current_buffer): New function.
4616 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
4617 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
4618 * undo.c, window.c: Adjust users.
4619 * buffer.c (set_buffer_if_live): Fix comment.
4620
a3d794a1
DA
46212012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
4622
4623 Fix usage of set_buffer_internal.
4624 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
4625 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
4626 * coding.c (decode_coding): Omit redundant test.
4627 * fileio.c (decide_coding_unwind): Likewise.
4628 * fns.c (secure_hash): Likewise.
4629 * insdel.c (modify_region): Likewise.
4630 * keyboard.c (command_loop_1): Likewise.
4631 * print.c (PRINTFINISH): Likewise.
4632 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
4633
59ea14cd
PE
46342012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4635
4636 * dispnew.c: Use bool for boolean.
4637 (frame_garbaged, display_completed, delayed_size_change)
4638 (fonts_changed_p, add_window_display_history)
4639 (add_frame_display_history, verify_row_hash)
4640 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
4641 (row_equal_p, realloc_glyph_pool)
4642 (allocate_matrices_for_frame_redisplay)
4643 (showing_window_margins_p)
4644 (adjust_frame_glyphs_for_frame_redisplay)
4645 (build_frame_matrix_from_leaf_window, make_current)
4646 (mirrored_line_dance, mirror_line_dance, update_frame)
4647 (update_window_tree, update_single_window)
4648 (check_current_matrix_flags, update_window, update_text_area)
4649 (update_window_line, set_window_update_flags, scrolling_window)
4650 (update_frame_1, scrolling, buffer_posn_from_coords)
4651 (do_pending_window_change, change_frame_size)
4652 (change_frame_size_1, sit_for):
4653 Use bool for boolean.
4654 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
4655 and remove last int (actually boolean) argument, which was always 0.
4656 All callers changed.
4657 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
4658 * dispextern.h (struct composition_it): Use bool for boolean.
4659 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
4660 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
4661 * dired.c (file_name_completion):
4662 Use bool for boolean. (This was missed in an earlier change.)
4663
95072a94
MR
46642012-08-27 Martin Rudalics <rudalics@gmx.at>
4665
4666 * window.c (Fset_window_configuration): Revert first part of
4667 last change.
4668
0f19feff
JD
46692012-08-27 Jan Djärv <jan.h.d@swipnet.se>
4670
4671 * nsterm.h (NSPanel): New class variable dialog_return.
4672
3a880af4
SM
4673 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
4674 Initialize dialog_return.
0f19feff
JD
4675 (windowShouldClose:): Use stop instead of stopModalWithCode.
4676 (clicked:): Ditto, and also set dialog_return (Bug#12258).
4677 (timeout_handler:): Use stop instead of abortModal. Send a dummy
4678 event.
4679 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
4680 modal loop returns.
4681
f10fe38f
PE
46822012-08-27 Paul Eggert <eggert@cs.ucla.edu>
4683
de1339b0
PE
4684 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
4685 * composite.c (find_composition, composition_gstring_p)
4686 (composition_reseat_it, find_automatic_composition):
4687 * data.c (let_shadows_buffer_binding_p)
4688 (let_shadows_global_binding_p, set_internal, make_blv)
4689 (Fmake_variable_buffer_local, Fmake_local_variable)
4690 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
4691 (cons_to_signed, arith_driver):
4692 * dbusbind.c (xd_in_read_queued_messages):
4693 * dired.c (directory_files_internal, file_name_completion):
4694 Use bool for booleans.
4695 * dired.c (file_name_completion):
4696 * process.h (fd_callback):
4697 Omit int (actually boolean) argument. It wasn't being used.
4698 All uses changed.
4699 * composite.h, lisp.h: Reflect above API changes.
4700
f10fe38f
PE
4701 * cmds.c, coding.c: Use bool for booleans.
4702 * cmds.c (move_point, Fself_insert_command):
4703 * coding.h (struct composition status, struct coding_system):
4704 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
4705 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
4706 (emacs_mule_char, decode_coding_emacs_mule)
4707 (encode_coding_emacs_mule, detect_coding_iso_2022)
4708 (decode_coding_iso_2022, encode_invocation_designation)
4709 (encode_designation_at_bol, encode_coding_iso_2022)
4710 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
4711 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
4712 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
4713 (encode_coding_raw_text, detect_coding_charset)
4714 (decode_coding_charset, encode_coding_charset, detect_eol)
4715 (detect_coding, get_translation_table, produce_chars)
4716 (consume_chars, reused_workbuf_in_use)
4717 (make_conversion_work_buffer, code_conversion_save)
4718 (decode_coding_object, encode_coding_object)
4719 (detect_coding_system, char_encodable_p)
4720 (Funencodable_char_position, code_convert_region)
4721 (code_convert_string, code_convert_string_norecord)
4722 (Fset_coding_system_priority):
4723 * fileio.c (Finsert_file_contents):
4724 Use bool for booleans.
4725 * coding.h, lisp.h: Reflect above API changes.
4726 * coding.c: Remove unnecessary static function decls.
4727 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
4728 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
4729 not a boolean 'int', since callers never look at the return value.
4730 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
4731 * coding.h (decoding_buffer_size, encoding_buffer_size)
4732 (emacs_mule_string_char): Remove unused extern decls.
4733 (struct iso_2022_spec, struct coding_system):
4734 Use 'unsigned int : 1' for boolean fields, since there's more than one.
4735 (struct emacs_mule_spec): Remove unused field 'full_support'.
4736 All initializations removed.
4737 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
4738
5474c384
DA
47392012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4740
f10fe38f 4741 Fix spare memory change (Bug#12286).
5474c384
DA
4742 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
4743 (valid_lisp_object_p): Likewise.
4744
c4b6914d
MR
47452012-08-27 Martin Rudalics <rudalics@gmx.at>
4746
4747 * window.c (Fset_window_configuration): Record any window's old
4748 buffer if it's replaced (see Bug#8789). If the new current
4749 buffer doesn't appear in the selected window, go to its old
4750 point (Bug#12208).
4751
35aaa1ea
DA
47522012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
4753
4754 Special MEM_TYPE_SPARE to denote reserved memory.
4755 * alloc.c (enum mem_type): New memory type.
4756 (refill_memory_reserve): Use new type for spare memory.
4757 This prevents live_cons_p and live_string_p from incorrect
4758 detection of uninitialized objects from spare memory as live.
4759
6af64513
PE
47602012-08-26 Paul Eggert <eggert@cs.ucla.edu>
4761
8b2e00a3
PE
4762 Spelling fixes.
4763 * Makefile.in (.PHONY): versioclean -> versionclean.
4764
b52d6985
PE
4765 Remove unused external symbols.
4766 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
4767 * window.c (Qwindow_valid_p, decode_valid_window):
4768 Now static, not extern.
4769 * data.c (Qinterval): Remove; unused.
4770 (syms_of_data): Do not define 'interval'.
4771 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
4772 * window.h (decode_valid_window):
4773 Remove decls.
4774
d5172d4f
PE
4775 * character.c, charset.c, chartab.c: Use bool for booleans.
4776 * character.c (lisp_string_width, string_count_byte8)
4777 (string_escape_byte8):
4778 * charset.c (charset_map_loaded, load_charset_map, read_hex):
4779 (load_charset_map_from_file, map_charset_chars)
4780 (Fdefine_charset_internal, define_charset_internal)
4781 (Fdeclare_equiv_charset, find_charsets_in_text)
4782 (Ffind_charset_region, char_charset, Fiso_charset):
4783 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
4784 (sub_char_table_set, sub_char_table_set_range)
4785 (char_table_set_range, optimize_sub_char_table)
4786 (map_sub_char_table):
4787 Use bool for boolean.
4788 * character.c (str_to_unibyte): Omit last boolean argument; it was
4789 always 0. All callers changed.
4790 * character.h, charset.h: Adjust to match previous changes.
4791 * character.h (char_printable_p): Remove decl of nonexistent function.
4792 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
4793 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
4794 are all boolean, so make them single-bit bitfields.
4795
6af64513
PE
4796 * lisp.h (ASET): Remove attempt to detect side effects.
4797 It was meant to be temporary and it often doesn't work,
4798 because when IDX has side effects the behavior of IDX==IDX
4799 is undefined. See Stefan Monnier in
4800 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
4801
e1f29348
BR
48022012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4803
4804 * lisp.h (functionp): New function (extracted from Ffunctionp).
4805 (FUNCTIONP): Use it.
4806 * eval.c (Ffunctionp): Use it.
4807
17c05d74
PE
48082012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4809
0f46bc75
PE
4810 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
4811 as that's faster and simpler than static storage. Don't bother
4812 with the g_main_context_query overhead if g_main_context_pending
4813 says no events are pending.
4814 (gfds, gfds_size): Remove these static vars.
4815 (xgselect_initialize): Remove; no longer needed.
4816 All uses and decls removed.
4817
ee4c0f69
PE
4818 * emacs.c (fatal_error_signal_hook): Remove.
4819 All uses removed. This leftover from old code was always 0.
4820
17c05d74
PE
4821 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
4822 * casefiddle.c (casify_object, casify_region):
4823 * casetab.c (set_case_table):
4824 * category.c, category.h (word_boundary_p):
4825 * category.h (CHAR_HAS_CATEGORY):
4826 Use bool for booleans, instead of int.
4827
391ceac5
EZ
48282012-08-25 Eli Zaretskii <eliz@gnu.org>
4829
4830 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
4831
2f221583
PE
48322012-08-25 Paul Eggert <eggert@cs.ucla.edu>
4833
f4a681b0
PE
4834 On assertion failure, print backtrace if available.
4835 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
4836 (die) [ENABLE_CHECKING]: Print a backtrace if available.
4837 * Makefile.in (LIB_EXECINFO): New macro.
4838 (LIBES): Use it.
4839
2f221583
PE
4840 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
4841 * bytecode.c (exec_byte_code):
4842 * callint.c (check_mark, Fcall_interactively):
4843 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
4844 (getenv_internal, sync_process_alive, call_process_exited):
4845 * lisp.h (USE_SAFE_ALLOCA):
4846 Use bool for booleans, instead of int.
4847 * lisp.h, process.h: Adjust prototypes to match above changes.
4848 * callint.c (Fcall_interactively): Don't assume the mark's
4849 offset fits in 'int'.
4850
37ef52bb
PE
48512012-08-24 Paul Eggert <eggert@cs.ucla.edu>
4852
4853 * buffer.c, buffer.h: Use bool for boolean.
4854 * buffer.c (reset_buffer_local_variables)
4855 (buffer_lisp_local_variables, Fset_buffer_modified_p)
4856 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
4857 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
4858 (overlay_touches_p, overlay_strings, Foverlay_put)
4859 (report_overlay_modification, call_overlay_mod_hooks):
4860 (mmap_enlarge, mmap_set_vars):
4861 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
4862 Use bool for booleans, instead of int.
4863 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
4864 since the 1-or-0 return value is always ignored anyway.
4865 (mmap_initialized_p):
4866 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
4867 * buffer.h, lisp.h: Adjust prototypes to match above changes.
4868
2cc21167
PE
48692012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4870
4871 * bidi.c: Use bool for boolean.
4872 This is a bit more readable, and makes the text segment of bidi.o
4873 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
4874 Presumably it's faster too.
4875 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
4876 Now bool.
4877 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4878 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
4879 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
4880 (bidi_explicit_dir_char, bidi_level_of_next_char)
4881 (bidi_find_other_level_edge, bidi_move_to_visually_next):
4882 Use bool for booleans, instead of int.
4883 * dispextern.h (bidi_init_it, bidi_paragraph_init)
4884 (bidi_unshelve_cache): Adjust decls to match code.
4885
7db4ddf4
MR
48862012-08-23 Martin Rudalics <rudalics@gmx.at>
4887
4888 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
4889 argument.
4890
b1bb8011
PE
48912012-08-23 Paul Eggert <eggert@cs.ucla.edu>
4892
4893 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
4894 * atimer.h: Include <stdbool.h>.
4895
ff687885
DN
48962012-08-22 Dan Nicolaescu <dann@gnu.org>
4897
4898 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
4899 compile time tests instead of run time tests on systems that do
4900 not use them.
4901 (FRAME_MAC_P): Remove leftover from deleted code.
4902 * frame.c (syms_of_frame): Remove leftover from deleted code.
4903
4ce7a138
JD
49042012-08-22 Jan Djärv <jan.h.d@swipnet.se>
4905
4906 * nsterm.m (insertText:): Don't clear modifiers if code is space.
4907
d733ec6d
PE
49082012-08-22 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
4911 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 4912 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
4913 (fontset_add): Return void, for FONTSET_ADD.
4914
d0d2d26f
PE
49152012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4916
fce31d69
PE
4917 * alloc.c: Use bool for booleans.
4918 (gc_in_progress, abort_on_gc)
4919 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4920 (dont_register_blocks) [GC_MALLOC_CHECK]:
4921 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
4922 (check_string_bytes, make_specified_string, memory_full)
4923 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
4924 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
4925 (mark_stack, valid_pointer_p, make_pure_string)
4926 (Fgarbage_collect, survives_gc_p, gc_sweep):
4927 Use bool for booleans, instead of int.
4928 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
4929 Remove unused local.
4930 * alloc.c (PURE_POINTER_P):
4931 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
4932 * editfns.c (Fformat):
4933 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
4934 (Fdo_auto_save):
4935 * fns.c (sweep_weak_table):
4936 * lisp.h (suppress_checking, push_message, survives_gc_p)
4937 (make_pure_string, gc_in_progress, abort_on_gc):
4938 * lread.c (readchar, read1):
4939 * print.c (Fprin1_to_string):
4940 * xdisp.c (push_message):
4941 Use bool for booleans affected directly or indirectly by
4942 alloc.c's changes.
4943
d0d2d26f
PE
4944 Make recently-introduced setters macros.
4945 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
4946 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
4947 (set_fontset_default, set_fontset_fallback): Rename from their
4948 upper-case counterparts, and make them functions rather than macros.
4949 This is more consistent with the other recently-introduced setters.
4950 These don't need to be inline, since they're local.
4951
d18e2bb6
JD
49522012-08-21 Jan Djärv <jan.h.d@swipnet.se>
4953
4954 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
4955 the loop (Bug#12247).
4956
1b9d9d16
PE
49572012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4958
4959 * lisp.h (vcopy): Use memcpy rather than our own loop.
4960 This fixes a performance regression introduced by the recent
4961 addition of vcopy. This means 'vcopy' will need to be modified
4962 for a copying collector, but that's OK. Also, tighten the
4963 checking in the assertion.
4964
b2f09701
EZ
49652012-08-21 Eli Zaretskii <eliz@gnu.org>
4966
4967 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
4968 components for RTL text (Bug#11860). Adjust X-OFFSET of each
4969 non-base glyph for the width of the base character, according to
e1f29348
BR
4970 what x_draw_composite_glyph_string_foreground expects.
4971 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
4972 expectations, to produce correct width of the composed character.
4973 Reverse the sign of the DU offset produced by ScriptPlace.
4974
9b994fed
PE
49752012-08-21 Paul Eggert <eggert@cs.ucla.edu>
4976
4977 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
4978
086ca913
DA
49792012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
4980
4981 Avoid direct writes to contents member of struct Lisp_Vector.
4982 * lisp.h (vcopy): New function to copy data into vector.
4983 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
4984 * fns.c (Ffillarray): Use ASET.
4985 * keyboard.c (timer_check_2): Use AREF and ASET.
4986 (append_tool_bar_item, Frecent_keys): Use vcopy.
4987 * lread.c (read_vector): Use ASET.
4988 * msdos.c (Frecent_doskeys): Use vcopy.
4989 * xface.c (Finternal_copy_lisp_face): Use vcopy.
4990 (Finternal_merge_in_global_face): Use ASET and vcopy.
4991 * xfont.c (xfont_list_pattern): Likewise.
4992
5481664a
MR
49932012-08-21 Martin Rudalics <rudalics@gmx.at>
4994
4995 * window.c (Fwindow_point): For the selected window always return
4996 the position of its buffer's point.
4997 (Fset_window_point): For the selected window always go in its
4998 buffer to the specified position.
4999
6d470bdd
DA
50002012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
5001
5002 Setter macros for fontsets.
5003 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
5004 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
5005 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
5006 Adjust users.
5007
24564fe1
GM
50082012-08-20 Glenn Morris <rgm@gnu.org>
5009
5010 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5011 Don't assume that `ln -f' works.
5012
0a05a035
EZ
50132012-08-20 Eli Zaretskii <eliz@gnu.org>
5014
5015 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
5016 and later about non-assignments with no effect. See discussion at
5017 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
5018 details.
5019
e46f2325
DA
50202012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5021
5022 Inline setter functions for Lisp_Objects slots of struct specbinding.
5023 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
5024 Adjust users.
5025
734fbd86
MR
50262012-08-20 Martin Rudalics <rudalics@gmx.at>
5027
5028 * window.c (select_window): Always make selected window's buffer
5029 current.
5030
f1a95992
DA
50312012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5032
5033 Use AREF and ASET for docstrings of category tables.
5034 * category.h (CATEGORY_DOCSTRING): Use AREF.
5035 (SET_CATEGORY_DOCSTRING): Use ASET.
5036 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
5037
e83064be
DA
50382012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5039
5040 Inline setter functions for hash table members.
5041 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
5042 (set_hash_hash, set_hash_index): Rename with _slot suffix.
5043 (set_hash_key_and_value, set_hash_index, set_hash_next)
5044 (set_hash_hash): New functions.
5045 * charset.c, fns.c: Adjust users.
5046
4ce60d2e
DA
50472012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
5048
5049 Inline getter and setter functions for per-buffer values.
5050 * buffer.h (per_buffer_default, set_per_buffer_default)
5051 (per_buffer_value, set_per_buffer_value): New functions.
5052 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
5053 * buffer.c, data.c: Adjust users.
5054
c06c9690
JB
50552012-08-20 Juanma Barranquero <lekktu@gmail.com>
5056
5057 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
5058
32bd4250
PE
50592012-08-19 Paul Eggert <eggert@cs.ucla.edu>
5060
bad03192 5061 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
5062 as gnulib does this if the system doesn't.
5063 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
5064 Remove declaration. MS-Windows declares it on stdlib.h which is
5065 included by conf_post.h.
b69a6d22
PE
5066 * emacs.c (environ) [DOUG_LEA_MALLOC]:
5067 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
5068 * vm-limit.c: Include <unistd.h>, for 'environ'.
5069
22d7feb2
PE
5070 * unexaix.c, unexcoff.c: Include "mem-limits.h".
5071 (start_of_data): Remove decl; mem-limits.h provides it.
5072
32bd4250
PE
5073 * xdisp.c (handle_invisible_prop): Make it a bit faster
5074 and avoid a gcc -Wmaybe-uninitialized diagnostic.
5075
450809af
CY
50762012-08-19 Chong Yidong <cyd@gnu.org>
5077
5078 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
5079 ends (Bug#3874).
5080
9e677988
AS
50812012-08-19 Andreas Schwab <schwab@linux-m68k.org>
5082
6b1319ce
AS
5083 * .gdbinit: Use call instead of set when calling a function in the
5084 inferior.
5085
9e677988
AS
5086 * data.c (set_internal): Don't use set_blv_found.
5087 (Fkill_local_variable): Likewise.
5088
d7191076
AA
50892012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
5090
5091 * nsfont.m (ns_ascii_average_width): Ensure the string
5092 ascii_printable is initialized with a null-terminated character
5093 array. Otherwise, it can contain undesired extra characters.
5094
e757f1c6
PE
50952012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5096
5097 port new setting code to Sun C 5.8 2005/10/13
5098 * chartab.c, lisp.h (char_table_set, char_table_set_range):
5099 Return void, not Lisp_Object. Otherwise, the compiler
5100 complains about (A?B:C) where B is void and C is Lisp_Object
5101 when compiling CHAR_TABLE_SET, due to the recent change to
5102 the API of sub_char_table_set_contents.
5103
a999ce26
CY
51042012-08-18 Chong Yidong <cyd@gnu.org>
5105
5106 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
5107 for the string case (Bug#3874).
5108
3f22b86f
PE
51092012-08-18 Paul Eggert <eggert@cs.ucla.edu>
5110
39eb03f1
PE
5111 * buffer.h (BSET): Remove (Bug#12215).
5112 Replace all uses with calls to new setter functions.
5113 (bset_bidi_paragraph_direction, bset_case_canon_table)
5114 (bset_case_eqv_table, bset_directory, bset_display_count)
5115 (bset_display_time, bset_downcase_table)
5116 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
5117 (bset_last_selected_window, bset_local_var_alist)
5118 (bset_mark_active, bset_point_before_scroll, bset_read_only)
5119 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
5120 (bset_width_table):
5121 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5122 (bset_auto_fill_function, bset_auto_save_file_format)
5123 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5124 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5125 (bset_cache_long_line_scans, bset_case_fold_search)
5126 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5127 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5128 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5129 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5130 (bset_header_line_format, bset_indicate_buffer_boundaries)
5131 (bset_indicate_empty_lines, bset_invisibility_spec)
5132 (bset_left_fringe_width, bset_major_mode, bset_mark)
5133 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5134 (bset_name, bset_overwrite_mode, bset_pt_marker)
5135 (bset_right_fringe_width, bset_save_length)
5136 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5137 (bset_scroll_up_aggressively, bset_selective_display)
5138 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5139 (bset_word_wrap, bset_zv_marker):
5140 * category.c (bset_category_table):
5141 * syntax.c (bset_syntax_table):
5142 New setter functions.
5143
6a09a33b
PE
5144 * process.h (PSET): Remove (Bug#12215).
5145 Replace all uses with calls to new setter functions.
5146 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5147 (PROCESS_INLINE): New macro.
5148 (pset_childp): New setter function.
5149 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
5150 * process.c (PROCESS_INLINE):
5151 Define to EXTERN_INLINE, so that the corresponding functions
5152 are compiled into code.
5153 (pset_buffer, pset_command, pset_decode_coding_system)
5154 (pset_decoding_buf, pset_encode_coding_system)
5155 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
5156 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
5157 (pset_type, pset_write_queue): New setter functions.
5158
e8c17b81
PE
5159 * window.h (WSET): Remove (Bug#12215).
5160 Replace all uses with calls to new setter functions.
5161 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5162 (WINDOW_INLINE): New macro.
5163 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
5164 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
5165 (wset_total_lines, wset_vertical_scroll_bar)
5166 (wset_window_end_pos, wset_window_end_valid)
5167 (wset_window_end_vpos): New setter functions.
5168 * window.c (WINDOW_INLINE):
5169 Define to EXTERN_INLINE, so that the corresponding functions
5170 are compiled into code.
5171 (wset_combination_limit, wset_dedicated, wset_display_table)
5172 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
5173 (wset_new_normal, wset_new_total, wset_next_buffers)
5174 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5175 (wset_prev_buffers, wset_right_fringe_width)
5176 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
5177 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
5178 (wset_window_parameters):
5179 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5180 (wset_column_number_displayed, wset_region_showing):
5181 New setter functions.
5182
3f22b86f
PE
5183 * termhooks.h (TSET): Remove (Bug#12215).
5184 Replace all uses with calls to new setter functions.
5185 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5186 (TERMHOOKS_INLINE): New macro.
5187 (tset_charset_list, tset_selection_alist): New setter functions.
5188 * terminal.c (TERMHOOKS_INLINE):
5189 Define to EXTERN_INLINE, so that the corresponding functions
5190 are compiled into code.
5191 (tset_param_alist): New setter function.
5192
742af32f
PE
51932012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5194
15dbb4d6
PE
5195 * keyboard.h (KSET): Remove (Bug#12215).
5196 Replace all uses with calls to new setter functions.
5197 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5198 (KEYBOARD_INLINE): New macro.
5199 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
5200 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
5201 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
5202 New setter functions.
5203 * keyboard.c (KEYBOARD_INLINE):
5204 Define to EXTERN_INLINE, so that the corresponding functions
5205 are compiled into code.
5206 (kset_echo_string, kset_kbd_queue)
5207 (kset_keyboard_translate_table, kset_last_prefix_arg)
5208 (kset_last_repeatable_command, kset_local_function_key_map)
5209 (kset_overriding_terminal_local_map, kset_real_last_command)
5210 (kset_system_key_syms): New setter functions.
5211
f00af5b1
PE
5212 * frame.h (FSET): Remove (Bug#12215).
5213 Replace all uses with calls to new setter functions.
5214 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
5215 (FRAME_INLINE): New macro.
5216 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
5217 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
5218 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
5219 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
5220 (fset_param_alist, fset_root_window, fset_scroll_bars)
5221 (fset_selected_window, fset_title, fset_tool_bar_items)
5222 (fset_tool_bar_position, fset_tool_bar_window): New functions.
5223 * frame.c (FRAME_INLINE):
5224 Define to EXTERN_INLINE, so that the corresponding functions
5225 are compiled into code.
5226 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
5227
0c94c8d6
PE
5228 A few more naming-convention fixes for getters and setters.
5229 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
5230 and rename from buffer_overlays_set_before.
5231 (set_buffer_overlays_after): Move here from buffer.h, and rename
5232 from buffer_overlays_set_after.
5233 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
5234 All uses changed.
5235 (set_buffer_intervals): Rename from buffer_set_intervals.
5236 * intervals.c (set_interval_object): Move here from intervals.h,
5237 and rename from interval_set_object.
5238 (set_interval_left): Move here from intervals.h, and rename from
5239 interval_set_left.
5240 (set_interval_right): Move here from intervals.h, and rename from
5241 interval_set_right.
5242 (copy_interval_parent): Move here from intervals.h, and rename from
5243 interval_copy_parent.
5244 * intervals.h (set_interval_parent): Rename from interval_set_parent.
5245 (set_interval_plist): Rename from interval_set_plist.
5246 Return void, not Lisp_Object, since no caller uses the result.
5247 * lisp.h (string_intervals): Rename from string_get_intervals.
5248 (set_string_intervals): Rename from string_set_intervals.
5249
34dabdb7
PE
5250 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
5251 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 5252 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
5253 All uses changed. See the end of
5254 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
5255
742af32f
PE
5256 * lisp.h (CSET): Remove (Bug#12215).
5257 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
5258 (set_char_table_purpose): New functions,
5259 replacing CSET. All uses changed. For example, replace
5260 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 5261 "set_char_table_parent (char_table, parent);".
742af32f
PE
5262 The old version was confusing because it used the same name
5263 'parent' for two different things.
5264
a04e2c62
DA
52652012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5266
5267 Functions to get and set Lisp_Object fields of buffer-local variables.
5268 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
5269 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
5270 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
5271 * data.c, eval.c, frame.c: Adjust users.
5272
383dcbf9
CY
52732012-08-17 Chong Yidong <cyd@gnu.org>
5274
5275 * xfaces.c (merge_face_vectors): If the target font specfies a
5276 font spec, make the font's attributes take precedence over
5277 directly-specified attributes.
5278 (merge_face_ref): Recognize :font.
5279
44386687
DA
52802012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
5281
5282 Do not use memcpy for copying intervals.
5283 * intervals.c (reproduce_interval): New function.
5284 (reproduce_tree, reproduce_tree_obj): Use it.
5285 (reproduce_tree_obj): Remove prototype.
5286
927c7216
PE
52872012-08-17 Paul Eggert <eggert@cs.ucla.edu>
5288
5289 * lisp.h (duration_to_sec_usec): Remove unused decl.
5290
93044f7b
AA
52912012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
5292
5293 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
5294 to an allocated instance of NSString, not to the class itself.
5295
9851e4a5
JB
52962012-08-17 Juanma Barranquero <lekktu@gmail.com>
5297
5298 * makefile.w32-in (C_CTYPE_H): New macro.
5299 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
5300 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
5301 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
5302
620f13b0
PE
53032012-08-16 Paul Eggert <eggert@cs.ucla.edu>
5304
5305 Use ASCII tests for character types.
5306 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
5307 * xfns.c, xterm.c:
5308 Don't include <ctype.h>; was not needed.
5309 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
5310 * sysdep.c, xfaces.c:
5311 Include <c-ctype.h> instead of <ctype.h>.
5312 * nsterm.m: Include <c-ctype.h>.
5313 * charset.c (read_hex):
5314 * doc.c (Fsnarf_documentation):
5315 * fileio.c (IS_DRIVE) [WINDOWSNT]:
5316 (DRIVE_LETTER) [DOS_NT]:
5317 (Ffile_name_directory, Fexpand_file_name)
5318 (Fsubstitute_in_file_name):
5319 * font.c (font_parse_xlfd, font_parse_fcname):
5320 * frame.c (x_set_font_backend):
5321 * gtkutil.c (xg_get_font):
5322 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
5323 * nsimage.m (hexchar):
5324 * nsterm.m (ns_xlfd_to_fontname):
5325 * sysdep.c (system_process_attributes):
5326 * xfaces.c (hash_string_case_insensitive):
5327 Use C-locale tests instead of locale-specific tests for character
5328 types, since we want the ASCII interpretation here, not the
5329 interpretation suitable for whatever happens to be the current locale.
5330
52162052
MR
53312012-08-16 Martin Rudalics <rudalics@gmx.at>
5332
5333 Consistently check windows for validity/liveness
5334 (Bug#11984, Bug#12025, Bug#12026).
5335 * lisp.h (CHECK_VALID_WINDOW): New macro.
5336 * window.c (decode_window): Rename to decode_live_window.
5337 (decode_valid_window, Fwindow_valid_p): New functions.
5338 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
5339 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
5340 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
5341 (Fwindow_prev_sibling, Fwindow_combination_limit)
5342 (Fset_window_combination_limit, Fwindow_use_time)
5343 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
5344 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
5345 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
5346 (Fwindow_hscroll, Fset_window_hscroll)
5347 (Fwindow_redisplay_end_trigger)
5348 (Fset_window_redisplay_end_trigger, Fwindow_edges)
5349 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
5350 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5351 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
5352 (Fwindow_end, Fset_window_point, Fset_window_start)
5353 (Fpos_visible_in_window_p, Fwindow_line_height)
5354 (Fwindow_dedicated_p, Fset_window_dedicated_p)
5355 (Fwindow_prev_buffers, Fset_window_prev_buffers)
5356 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
5357 (Fset_window_parameter, Fwindow_display_table)
5358 (Fset_window_display_table, Fdelete_other_windows_internal)
5359 (Fset_window_buffer, Fset_window_new_total)
5360 (Fset_window_new_normal, Fdelete_window_internal)
5361 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
5362 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
5363 (Fwindow_scroll_bars): Check whether argument window is a valid or
5364 live window. Update doc-strings.
5365 (syms_of_window): New symbol Qwindow_valid_p.
5366 * keyboard.c (Fposn_at_x_y): Check whether argument
5367 frame_or_window denotes a valid window.
5368
2751c80f
DA
53692012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5370
5371 Fix previous char table change.
5372 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
5373 * chartab.c (optimize_sub_char_table): Likewise.
5374
032a42c8
CY
53752012-08-16 Chong Yidong <cyd@gnu.org>
5376
a2d19368
CY
5377 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5378
032a42c8
CY
5379 * xfont.c (xfont_open):
5380 * xftfont.c (xftfont_open): Set the font's max_width field.
5381
5382 * nsfont.m (nsfont_open): Similar to the Xft backend, set
5383 min_width to space_width and average_width to the average over
5384 printable ASCII characters.
5385 (ns_char_width): Code cleanup.
5386 (ns_ascii_average_width): New utility function.
5387
5388 * font.h (struct font): Update comments.
5389
a098c930
DA
53902012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
5391
032a42c8 5392 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
5393 * lisp.h (CSET): New macro.
5394 (char_table_set_extras, char_table_set_contents)
5395 (sub_char_table_set_contents): New function.
5396 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
5397 * syntax.c: Adjust users.
5398
8be3a09c
SM
53992012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
5400
5401 * eval.c (eval_sub): Bind lexical-binding.
5402 * lread.c (Qlexical_binding): Make non-static.
5403
ac4845a6
JD
54042012-08-15 Jan Djärv <jan.h.d@swipnet.se>
5405
ddee6515
JD
5406 * nsmenu.m (popupSession): Remove.
5407 (pop_down_menu): Remove endModalSession.
5408 (timeout_handler:): New method.
5409 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
5410 Call runModalForWindow. Check timer_fired when it returns.
5411 If not set, cancel timer and break out of loop.
5412 Otherwise loop again, with a new timeout.
5413
5414 * nsterm.m: Include fcntl.h if present.
5415 (fd_entry, t_readfds, inNsSelect): Remove.
5416 (select_writefds, select_valid, select_timeout, selfds)
5417 (select_mutex, apploopnr): Add.
5418 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
5419 Otherwise call kbd_buffer_store_event.
5420 (ns_send_appdefined): Remove release of fd_entry.
5421 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
5422 Increment and decrement apploopnr.
5423 (ns_select): If no file descriptors, just do a NSTimer.
5424 Otherwise copy read/write masks and start select thread (fd_handler).
5425 Start main loop and wait for application defined event.
5426 Inform select thread to stop selecting after main loop is exited.
5427 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 5428 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
5429 (fd_handler:): Loop forever, wait for info from the main thread
5430 to either start or stop selecting. When select returns, send
5431 and appdefined event.
5432 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
5433 If not call kbd_buffer_store_event.
5434
5435 * nsterm.h (EmacsApp): fd_handler takes id argument.
5436 (EmacsDialogPanel): Add timer_fired and timeout_handler.
5437
ac4845a6
JD
5438 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
5439
eb424fe3
EZ
54402012-08-15 Eli Zaretskii <eliz@gnu.org>
5441
5442 * region-cache.c (move_cache_gap): Update gap_len using the actual
5443 growth of the boundaries array. Do not change cache_len.
5444 (Bug#12196)
5445
4e6a86c6
DA
54462012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5447
5448 Generalize and cleanup font subsystem checks.
5449 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
5450 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
5451 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 5452
5bf192ca
DA
54532012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
5454
5455 * gtkutil.c (xg_get_font): Use pango_units_to_double.
5456
f2045622
CY
54572012-08-15 Chong Yidong <cyd@gnu.org>
5458
8be3a09c
SM
5459 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
5460 When using the new font chooser, use gtk_font_chooser_get_font_desc to
5461 extract the font descriptor instead of just the font name.
5462 In that case, return a font spec instead of a string.
f2045622
CY
5463 (x_last_font_name): Move to this file from xfns.c.
5464
5465 * xfns.c (Fx_select_font): The return value can also be a font
5466 spec. Move x_last_font_name management to gtkutil.c.
5467
5468 * xfaces.c: Make font weight and style symbols non-static.
5469
7f6feb56
SM
54702012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
5471
5472 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
5473 (bug#12117).
5474
fecbd8ff
SM
54752012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
5476
5477 * alloc.c (Fgarbage_collect): Use plural form consistently.
5478
9b8d5165
EZ
54792012-08-14 Eli Zaretskii <eliz@gnu.org>
5480
5481 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
5482 iteration through the command loop. Fixes a problem whereby mouse
5483 movements are ignored until the first mouse click.
5484
f5d9e83a
PE
54852012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5486
5487 Use bool, not int, for Lisp booleans.
5488 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
5489 makes Emacs a bit smaller and presumably a bit faster.
5490 * lisp.h: Include <stdbool.h>.
5491 (struct Lisp_Boolfwd, defvar_bool):
5492 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
5493 * regex.c [!emacs]: Include <stdbool.h>.
5494 (false, true): Remove; <stdbool.h> does this for us now.
5495
55802e4a
CY
54962012-08-14 Chong Yidong <cyd@gnu.org>
5497
4abcdac8
CY
5498 * character.c (Fcharacterp): Doc fix (Bug#12076).
5499
5500 * data.c (Findirect_variable): Doc fix (Bug#11040).
5501
55802e4a
CY
5502 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
5503
5504 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 5505 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 5506
8e99d072
BR
55072012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
5508
5509 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
5510 (bug#12022).
5511
08908aca
MR
55122012-08-14 Martin Rudalics <rudalics@gmx.at>
5513
5514 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
5515 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
5516 * minibuf.c (choose_minibuf_frame, read_minibuf):
5517 * w32fns.c (x_create_tip_frame):
5518 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
5519 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
5520
56120d6f
PE
55212012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5522
5523 * intervals.c (offset_intervals): Remove obsolete comment.
5524
67b77c0b
AS
55252012-08-14 Andreas Schwab <schwab@linux-m68k.org>
5526
5527 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
5528
f48b82fd
GR
55292012-08-14 Gergely Risko <gergely@risko.hu>
5530
5531 * coding.c (decode_coding): Record buffer modification before
5532 disabling undo_list (Bug#11773).
5533
fd318b54
DA
55342012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5535
5536 Revert and cleanup some recent overlay changes.
5537 * buffer.h (enum overlay_type): Remove.
5538 (buffer_get_overlays, buffer_set_overlays): Likewise.
5539 (buffer_set_overlays_before, buffer_set_overlays_after):
5540 New function. Adjust users.
5541 (unchain_both): Add eassert.
5542
41a62dd9
DA
55432012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
5544
5545 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
5546
5884c324
PE
55472012-08-14 Paul Eggert <eggert@cs.ucla.edu>
5548
5549 * gtkutil.c (xg_mark_data): Don't assume C99.
5550
ca06f160
JD
55512012-08-13 Jan Djärv <jan.h.d@swipnet.se>
5552
5553 * gtkutil.c (xg_frame_tb_info): New struct.
5554 (TB_INFO_KEY): New define.
5555 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
5556 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
5557 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
5558 if not present.
5559 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 5560 is up to date. Otherwise store new data.
ca06f160
JD
5561 (free_frame_tool_bar): Free xg_frame_tb_info if present.
5562
7864a3f7
DA
55632012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5564
5565 Use KSET for write access to Lisp_Object members of struct kboard.
5566 * keyboard.h (KSET): New macro.
5567 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
5568 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
5569 * xterm.c: Adjust users.
5570
4c31be61
DA
55712012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
5572
5573 Use BSET for write access to Lisp_Object members of struct buffer.
5574 * buffer.h (BSET): New macro.
5575 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
5576 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
5577 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
5578 * window.c, xdisp.c, xfns.c: Adjust users.
5579
14ae4239
BT
55802012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
5581
5582 * lread.c (syms_of_lread): Initialize Vlexical_binding.
5583
32bcadb4
JD
55842012-08-11 Jan Djärv <jan.h.d@swipnet.se>
5585
3d29b2ce 5586 * nsterm.m (not_in_argv): New function.
fc0c31f8 5587 (application:openFile, application:openTempFile:):
3d29b2ce
JD
5588 (application:openFileWithoutUI:, application:openFiles:): Open file
5589 if not_in_argv returns non-zero (bug#12171).
5590
32bcadb4 5591 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
5592 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
5593 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
5594 (xg_get_font_name): Use those functions/macros here.
5595 Reported by Frans Oilinki <moilinki@gmail.com>.
5596
9ff9402d 55972012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
5598
5599 * unexmacosx.c (copy_data_segment): Copy initialized data in
5600 statically linked libraries from input file rather than memory.
5601
db74a5fc
YM
5602 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
5603 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
5604 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
5605
25e65510
GM
56062012-08-10 Glenn Morris <rgm@gnu.org>
5607
5608 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
5609 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
5610
7961135c
DA
56112012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5612
5613 Fix last change to allow compilation with low optimization levels.
5614 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
5615 Reported by Jan Djärv <jan.h.d@swipnet.se>.
5616
42b3a444
DA
56172012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5618
5619 Use common inline syntax in intervals.h.
5620 * intervals.h (INTERVALS_INLINE): New macro.
5621 Change all users from LISP_INLINE.
5622
9fb0c957
DA
56232012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5624
5625 Define Qnone once for all platforms.
5626 * frame.c (Qnone): Define here.
5627 (syms_of_frame): DEFSYM it.
5628 * lisp.h (Qnone): New declaration.
5629 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
5630 * xfns.c: Remove duplication. Adjust users.
5631
65e8ee52
DA
56322012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
5633
5634 Remove unused macros from intervals.h.
5635 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
5636 * intervals.c: Adjust comment.
5637
9b855fd6
EZ
56382012-08-10 Eli Zaretskii <eliz@gnu.org>
5639
5640 * w32fns.c <w32_unicode_gui>: New static variable.
5641 (globals_of_w32fns): Initialize it according to os_subtype.
5642 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
5643 testing os_subtype.
5644
39cb9e56 56452012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
5646 Eli Zaretskii <eliz@gnu.org>
5647
5648 Fix bug #10299 with Unicode characters sent by customized
5649 keyboards created by MSKLC.
5650 * w32fns.c (INIT_WINDOW_CLASS): New macro.
5651 (w32_init_class): Use it to initialize the Emacs class with either
5652 ANSI or Unicode API calls.
5653 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
5654 later.
5655 (w32_wnd_proc): If the character code sent by WM_CHAR or
5656 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
5657 original message. Call DefWindowProcW on NT and later.
5658
9374581a
GM
56592012-08-10 Glenn Morris <rgm@gnu.org>
5660
4b94e8cf
GM
5661 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
5662
9374581a
GM
5663 * lisp.h (DIRECTORY_SEP): Let configure set it.
5664
a2752828
DA
56652012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
5666
5667 Use TSET for write access to Lisp_Object slots of struct terminal.
5668 * termhooks.h (TSET): New macro.
5669 * coding.c, terminal.c, xselect.c: Adjust users.
5670
cc92c454
SM
56712012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
5672
5673 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
5674 the failing expression, include them in the error message.
5675 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
5676 * lisp.h (internal_condition_case_n): Update declaration.
5677
4cb3e6b3
DA
56782012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5679
5680 Inline functions to examine and change buffer overlays.
5681 * buffer.c (unchain_both): New function.
5682 * buffer.h (buffer_get_overlays, buffer_set_overlays):
5683 (buffer_has_overlays): New function.
5684 (enum overlay_type): New enum.
5685 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
5686 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
5687
8707c1e5
DA
56882012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5689
5690 Inline functions to examine and change buffer intervals.
5691 * alloc.c (mark_interval_tree): Remove.
5692 (MARK_INTERVAL_TREE): Simplify.
5693 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
5694 * intervals.c (buffer_balance_intervals): New function.
5695 (graft_intervals_into_buffer): Adjust indentation.
5696 (set_intervals_multibyte): Simplify.
5697 * buffer.h (BUF_INTERVALS): Remove.
5698 (buffer_get_intervals, buffer_set_intervals): New function.
5699 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
5700 * intervals.c, textprop.c: Adjust users.
5701
ad8c997f
DA
57022012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5703
5704 Inline functions to examine and change string intervals.
5705 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
5706 (string_get_intervals, string_set_intervals): New function.
5707 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5708 * lread.c, print.c, textprop.c: Adjust users.
5709
32ac3a6b
GM
57102012-08-08 Glenn Morris <rgm@gnu.org>
5711
5712 * lisp.mk (lisp): Remove language/persian.elc.
5713
77c7bcb1
DA
57142012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5715
5716 Cleanup intervals.
5717 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
5718 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
5719 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
5720 Adjust comment. Move under #if 0.
77c7bcb1
DA
5721 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
5722 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
5723
9c08a8d4
DA
57242012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
5725
5726 Check total length of intervals with eassert.
5727 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
5728 * intervals.c: Change all users to eassert.
5729
26d16b35
EZ
57302012-08-07 Eli Zaretskii <eliz@gnu.org>
5731
14ae4239
BT
5732 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
5733 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
5734 INTERNAL_FIELD in Lisp_Cons.
5735
c644523b
DA
57362012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5737
5738 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
5739 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
5740 name since all xname users are fixed long time ago. Do not
5741 use INTERNAL_FIELD.
5742 (set_symbol_name, set_symbol_function, set_symbol_plist):
5743 (set_symbol_next, set_overlay_plist): New function.
5744 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
5745 (struct Lisp_Overlay): Likewise.
5746 (CVAR, MVAR, SVAR): Remove.
5747 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
5748 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
5749 * xterm.c: Adjust users.
5750 * .gdbinit: Change to use name field of struct Lisp_Symbol
5751 where appropriate.
5752
6a3d20cc
DA
57532012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5754
5755 Basic functions to set Lisp_Object and pointer slots of intervals.
5756 * intervals.h (interval_set_parent, interval_set_object):
5757 (interval_set_left, interval_set_right, interval_set_plist):
5758 (interval_copy_parent): New function.
5759 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
5760 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
5761 Adjust indentation.
6a3d20cc
DA
5762 (INTERVAL_SIZE): Remove. Adjust users.
5763 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
5764
4d2b044c
DA
57652012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5766
5767 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
5768 * process.h (PGET): Remove.
5769 (struct Lisp_Process): Do not use INTERNAL_FIELD.
5770 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5771
d3d50620
DA
57722012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5773
5774 Drop WGET and revert read access to Lisp_Objects slots of struct window.
5775 * window.h (WGET): Remove.
5776 (struct window): Do not use INTERNAL_FIELD.
5777 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5778 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5779 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5780 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5781 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5782 Adjust users.
5783
d10a51dc
CY
57842012-08-07 Chong Yidong <cyd@gnu.org>
5785
5786 * window.c (Fwindow_edges, Fwindow_pixel_edges)
5787 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
5788 (Fdelete_window_internal): Signal an error if the window is not on
5789 a live frame (Bug#12025).
5790
e69b0960
DA
57912012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
5792
5793 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
5794 * frame.h (FGET): Remove.
5795 (struct frame): Do not use INTERNAL_FIELD.
5796 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5797 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5798 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5799 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5800
25a20a3a
JB
58012012-08-06 Juanma Barranquero <lekktu@gmail.com>
5802
5803 * w32.c: Silence compiler warnings.
5804 (map_w32_filename): Remove unused variable `is_fat'.
5805 (chase_symlinks): Add parentheses around expression.
5806
1c6f11f4
GM
58072012-08-06 Glenn Morris <rgm@gnu.org>
5808
1db4583a
GM
5809 * sysdep.c: Respect BROKEN_GETWD.
5810
1c6f11f4
GM
5811 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
5812 Let configure handle it.
5813 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
5814
2b90362b
DA
58152012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5816
5817 Use GCALIGNMENT where appropriate.
5818 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
5819 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
5820 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
5821
5f50daf2
EZ
58222012-08-06 Eli Zaretskii <eliz@gnu.org>
5823
14ae4239
BT
5824 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
5825 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 5826
cbcc7007
SM
58272012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
5828
5829 * buffer.h (struct buffer): Revert `indirections' to a simple int;
5830 that should be sufficient for everyone.
5831
4d365fa4
JD
58322012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5833
5834 * keyboard.c (timer_check_2): Add break so timer_check returns next
5835 timeout.
5836
dd86bd82
DA
58372012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5838
5839 Fix Windows build errors introduced after converting to WGET and WSET.
5840 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
5841 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5842
054e1668
JD
58432012-08-06 Jan Djärv <jan.h.d@swipnet.se>
5844
5845 * nsterm.m (ns_frame_rehighlight): Use FSET.
5846
5847 * nsmenu.m (ns_update_menubar): Use FSET.
5848
21238f11
DA
58492012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5850
5851 Separate read and write access to Lisp_Object slots of Lisp_Process.
5852 * process.h (PGET, PSET): New macros similar to AREF and ASET.
5853 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
5854
077288cf
DA
58552012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5856
5857 Separate read and write access to Lisp_Object slots of struct window.
5858 * window.h (WGET, WSET): New macros similar to AREF and ASET.
5859 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5860 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5861 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
5862 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
5863 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
5864 Adjust users.
5865
71688bd7
DA
58662012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5867
5868 Fix Windows build errors introduced after converting to FGET and FSET.
5869 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
5870 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
5871 (w32_judge_scroll_bars): Change to use FSET.
5872 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
5873
f99bac93
DA
58742012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5875
5876 Fix replacement typo.
5877 * window.c (replace_window): Set root_window instead of
5878 selected_window. This fixes a total window subsystem
5879 malfunction reported by Bastien Guerry <bzg@gnu.org>.
5880
8c2a0f2d
GM
58812012-08-06 Glenn Morris <rgm@gnu.org>
5882
5883 * lisp.mk (lisp): Add language/persian.elc.
5884
edd74c35
DA
58852012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
5886
5887 Separate read and write access to Lisp_Object slots of struct frame.
5888 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
5889 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
5890 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
5891 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
5892 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
5893
8671676c
AS
58942012-08-05 Andreas Schwab <schwab@linux-m68k.org>
5895
5896 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
5897
663e2b3f
DA
58982012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
5899
5900 Generalize common compile-time constants.
5901 * lisp.h (header_size, bool_header_size, word_size): Now here.
5902 (struct Lisp_Vector): Add comment.
5903 (struct Lisp_Bool_Vector): Move up to define handy constants.
5904 (VECSIZE, PSEUDOVECSIZE): Simplify.
5905 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
5906 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
5907 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
5908 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
5909 * xfont.c, xmenu.c: Use word_size where appropriate.
5910
d32e47af
LM
59112012-08-05 Lawrence Mitchell <wence@gmx.li>
5912
5913 * search.c (Freplace_match): Treat \? in the replacement text
5914 literally (Bug#8161).
5915
e5d9c0d1
CY
59162012-08-05 Chong Yidong <cyd@gnu.org>
5917
5918 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
5919 * frame.c (Vdelete_frame_functions):
5920 * emacs.c (Vkill_emacs_hook): Doc fix.
5921
8da0576b
EZ
59222012-08-04 Eli Zaretskii <eliz@gnu.org>
5923
5924 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
5925 --with-x-toolkit=no builds.
5926 Reported by Carsten Mattner <carstenmattner@gmail.com>.
5927
02676e5d
CY
59282012-08-04 Chong Yidong <cyd@gnu.org>
5929
5930 * syntax.c (Fmodify_syntax_entry): Doc fix.
5931
97147da9
EZ
59322012-08-04 Eli Zaretskii <eliz@gnu.org>
5933
76151e2c
EZ
5934 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
5935 * w32.c (init_environment): Change the default values of many
5936 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
5937 them into environment when they were not already defined.
5938 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 5939 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
5940 (check_windows_init_file): Now external, not static.
5941 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
5942 called when Vload_path is already set up.
5943
5944 * w32.h (check_windows_init_file): Add prototype.
5945
5946 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
5947 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
5948 compatibility with Posix platforms.
5949 (main): Move the call to check_windows_init_file to here from
5950 w32.c.
5951 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
5952 any, in the DEFALT argument into the root of the Emacs build or
5953 installation tree, as appropriate.
5954
5955 * callproc.c (init_callproc_1): Call decode_env_path instead of
5956 doing its equivalent by hand.
5957 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
5958 the code that sets Vexec_path run on MS-Windows.
5959
5960 * lread.c (init_lread): Add comments to #ifdef's.
5961
97147da9
EZ
5962 * msdos.c (dos_set_window_size, IT_update_begin)
5963 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
5964 instead of direct references.
5965
185ee146
PE
59662012-08-04 Paul Eggert <eggert@cs.ucla.edu>
5967
5968 Export DEFAULT_REHASH_* to GDB.
5969 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
5970 Now constants, not macros.
5971
8834c57a
PE
59722012-08-03 Paul Eggert <eggert@cs.ucla.edu>
5973
98c6f1e3
PE
5974 Remove unnecessary casts involving pointers.
5975 These casts are no longer needed now that we assume C89 or later,
5976 since they involve casting to or from void *.
5977 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
5978 (make_pure_float, make_pure_vector):
5979 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
5980 * macros.c (Fstart_kbd_macro):
5981 * menu.c (find_and_return_menu_selection):
5982 * minibuf.c (read_minibuf_noninteractive):
5983 * sysdep.c (closedir):
5984 * xdisp.c (x_produce_glyphs):
5985 * xfaces.c (compare_fonts_by_sort_order):
5986 * xfns.c (x_real_positions, select_visual):
5987 * xselect.c (x_stop_queuing_selection_requests)
5988 (x_get_window_property, x_get_window_property_as_lisp_data):
5989 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
5990 Remove unnecessary pointer casts.
5991 * alloc.c (record_xmalloc): New function.
5992 * lisp.h (record_xmalloc): New decl.
5993 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
5994 more like a function. This is because the pointer cast is not
5995 needed. All uses changed.
5996 * print.c (print_string, print_error_message): Avoid length recalc.
5997
8834c57a
PE
5998 Improve fix for macroexp crash with debugging (Bug#12118).
5999 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
6000 ARRAY_MARK_FLAG when checking subscripts, because ASET is
6001 not supposed to be invoked from the garbage collector.
6002 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
6003 (gc_aset): New function, which is like ASET but can be
6004 used in the garbage collector.
6005 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6006 (set_hash_index): Use it instead of ASET.
6007
6dad7178
EZ
60082012-08-03 Eli Zaretskii <eliz@gnu.org>
6009
6010 Support symlinks on latest versions of MS-Windows.
6011 * w32.c: Include winioctl.h and aclapi.h.
6012 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
6013 (revert_to_self): Forward declarations of static functions.
6014 <static BOOL g_b_init_get_security_info>:
6015 <g_b_init_create_symbolic_link>: New static flags.
6016 (globals_of_w32): Initialize them to zero.
6017 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
6018 (map_w32_filename): Improve commentary. Simplify switch.
6019 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
6020 headers (most versions of MinGW w32api don't).
6021 (get_security_info, create_symbolic_link)
6022 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
6023 New functions.
6024 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
6025 in the argument file name.
6026 (sys_access): Call unc_volume_file_attributes only if
6027 GetFileAttributes fails with network-related error codes.
6028 (sys_rename): Diagnose renaming of a symlink when the user doesn't
6029 have the required privileges.
14ae4239 6030 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
6031 get_file_security_desc.
6032 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
6033 with addition of handling of symlinks and support for 'lstat'.
6034 If possible, get file's attributes and security information by
6dad7178
EZ
6035 handle, not by name. Produce S_IFLNK bit for symlinks, when
6036 called from 'lstat'.
6037 (stat, lstat): New functions, call 'stat_worker'.
6038 (symlink, readlink, careadlinkat): Rewritten to create and resolve
6039 symlinks when the underlying filesystem supports them.
6040
f162bcc3
PE
60412012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6042
79ea6c20
PE
6043 Fix macroexp crash on Windows with debugging (Bug#12118).
6044 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
6045 checking subscripts; problem introduced with the recent
6046 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
6047 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
6048 since it's used in non-static inline functions now.
6049
c0ce93fd
PE
6050 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
6051 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 6052
f162bcc3
PE
6053 Use C99-style 'extern inline' if available.
6054 * buffer.h (BUFFER_INLINE):
6055 * category.h (CATEGORY_INLINE):
6056 * character.h (CHARACTER_INLINE):
6057 * charset.h (CHARSET_INLINE):
6058 * composite.h (COMPOSITE_INLINE):
6059 * dispextern.h (DISPEXTERN_INLINE):
6060 * lisp.h (LISP_INLINE):
6061 * systime.h (SYSTIME_INLINE):
6062 New macro, replacing 'static inline' in this header.
6063 * buffer.h, category.h, character.h, charset.h, composite.h:
6064 * dispextern.h, lisp.h, systime.h:
6065 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
6066 * alloc.c (LISP_INLINE):
6067 * buffer.c (BUFFER_INLINE):
6068 * category.c (CATEGORY_INLINE):
6069 * character.c (CHARACTER_INLINE):
6070 * charset.c (CHARSET_INLINE):
6071 * composite.c (COMPOSITE_INLINE):
6072 * dispnew.c (DISPEXTERN_INLINE):
6073 * sysdep.c (SYSTIME_INLINE):
6074 Define to EXTERN_INLINE, so that the corresponding functions
6075 are compiled into code.
6076 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
6077 (INLINE_HEADER_END): New macros.
6078 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
6079 since it's used in non-static inline functions now.
a8333d03 6080 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 6081
837b365b
GM
60822012-08-02 Glenn Morris <rgm@gnu.org>
6083
d66b744d
GM
6084 * s/: Remove empty directory.
6085
837b365b
GM
6086 * s/ms-w32.h: Move to ../nt/inc.
6087 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
6088 Update for new ms-w32.h location.
6089
13294f95
PE
60902012-08-02 Paul Eggert <eggert@cs.ucla.edu>
6091
6092 Port to Solaris 8.
6093 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
6094
90df0db3
GM
60952012-08-02 Glenn Morris <rgm@gnu.org>
6096
6097 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
6098 hard-coding the path separator.
6099
4939150c
PE
61002012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6101
6102 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
6103 This how ASET and AREF are supposed to work, and makes
6104 it easier to think about future improvements. See
6105 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
6106 * charset.h (set_charset_attr): New function.
6107 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
6108 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
6109 (aref_addr): New function. All uses of &AREF(...) changed.
6110 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
6111 (set_hash_index): New functions. All lvalue-style uses of
6112 HASH_KEY etc. changed.
6113 * keyboard.c (set_prop): New function. All lvalue-style uses
6114 of PROP changed.
6115
947b2afd
AA
61162012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
6117
6118 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
6119 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 6120 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
6121 * nsfns.m (ns_set_name_as_filename): Likewise.
6122 * nsmenu.m (ns_update_menubar): Likewise.
6123 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
6124
4f5d0325
EZ
61252012-08-01 Eli Zaretskii <eliz@gnu.org>
6126
2008beae
EZ
6127 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
6128 Adapt to latest changes in field names of the corresponding Lisp
288479f6 6129 objects.
2008beae 6130
4f5d0325
EZ
6131 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
6132
fe3cc771
GM
61332012-08-01 Glenn Morris <rgm@gnu.org>
6134
6135 * s/msdos.h: Remove file.
6136 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
6137 * Makefile.in (S_FILE): Remove.
6138 (config_h): Remove S_FILE.
6139
c90acc54
JB
61402012-08-01 Juanma Barranquero <lekktu@gmail.com>
6141
6142 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
6143 Remove; moved to nt/config.nt.
6144
d8a05828
DA
61452012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6146
6147 Use INTERNAL_FIELD for conses and overlays.
6148 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
6149 Remove obsolete comment.
6150 (MVAR): New macro.
6151 (struct Lisp_Overlay): Use INTERNAL_FIELD.
6152 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
6153
8271d590
DA
61542012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6155
6156 Use INTERNAL_FIELD for symbols.
6157 * lisp.h (SVAR): New macro. Adjust users.
6158 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
6159 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
6160
3193acd2
DA
61612012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6162
6163 Use INTERNAL_FIELD for processes.
6164 * process.h (PVAR): New macro. Adjust style.
6165 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
6166 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
6167
3a45383a
DA
61682012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
6169
6170 Use INTERNAL_FIELD for windows.
6171 * window.h (WVAR): New macro.
6172 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
6173 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
6174 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
6175 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
6176 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
6177 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6178
c1dbc63c
PE
61792012-08-01 Paul Eggert <eggert@cs.ucla.edu>
6180
6181 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
6182
5c0c0e8a
GM
61832012-08-01 Glenn Morris <rgm@gnu.org>
6184
6185 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
6186 Move to configure.ac.
6187
552a99b4
JB
61882012-08-01 Juanma Barranquero <lekktu@gmail.com>
6189
6190 * makefile.w32-in (CONFIG_H): Update dependencies.
6191 (CONF_POST_H): New macro.
6192
6193 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
6194
8d8e2dfe
GM
61952012-07-31 Glenn Morris <rgm@gnu.org>
6196
bc96620a
GM
6197 * Makefile.in (S_FILE): No longer set by configure.
6198
476b1b2d
GM
6199 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
6200 is available.
6201 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
6202
b2c7a106
GM
6203 * process.h (NULL_DEVICE):
6204 * emacs.c (SEPCHAR):
6205 * editfns.c (USER_FULL_NAME): Let configure set them.
6206
d53d062a
GM
6207 * s/README, s/template.h: Remove files.
6208
4515017f
GM
6209 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
6210
8d8e2dfe
GM
6211 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
6212 Move to configure.ac.
6213
5b20b3cc
EZ
62142012-07-31 Eli Zaretskii <eliz@gnu.org>
6215
1e0afd9a
EZ
6216 * .gdbinit (xframe): Adapt to introduction of FVAR and the
6217 resulting renaming of 'struct frame' members.
6218
5b20b3cc
EZ
6219 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
6220
6221 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
6222 after introduction of FVAR.
6223
f1310128
JD
62242012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6225
79e721e0
JD
6226 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
6227
6228 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
6229 instead of compositeToPoint.
6230 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
6231
8d7c7eed 6232 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 6233
e34f7f79
DA
62342012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6235
6236 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
6237 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 6238 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
6239 (BVAR): Change to use INTERNAL_FIELD.
6240 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
6241 (KVAR): Change to use INTERNAL_FIELD.
6242 * frame.h (FVAR): New macro.
6243 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
6244 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
6245 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
6246 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
6247 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
6248
c09bfb2f
DA
62492012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
6250
6251 Miscellaneous fixes for non-default X toolkits.
6252 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
6253 * xterm.c (x_frame_of_widget): Remove redundant prototype.
6254 Move under #ifdef USE_LUCID.
6255 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
6256 definition and usage to avoid warnings.
6257
14c114ae
JD
62582012-07-31 Jan Djärv <jan.h.d@swipnet.se>
6259
6260 * nsterm.m (openFiles): Fix previous checkin.
6261
3bd21e82
PE
62622012-07-31 Paul Eggert <eggert@cs.ucla.edu>
6263
6264 * indent.c (compute_motion): Remove unused local.
6265
c1529ded
GM
62662012-07-31 Glenn Morris <rgm@gnu.org>
6267
400d5621
GM
6268 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
6269
268e2432
GM
6270 * conf_post.h [USG5_4]:
6271 Move remaining contents of s/usg5-4-common.h here.
6272 * s/usg5-4-common.h: Remove file.
6273
7552f3ee
GM
6274 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
6275 * s/irix6-5.h: Remove file.
6276
6a381852
GM
6277 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
6278 * s/darwin.h: Remove file.
6279
c1529ded
GM
6280 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
6281 * s/hpux10-20.h: Remove file, which is now empty.
6282
b429a4ee
GM
62832012-07-30 Glenn Morris <rgm@gnu.org>
6284
6285 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
6286 * Makefile.in (config_h): Add conf_post.h.
6287 * makefile.w32-in (CONFIG_H): Add conf_post.h.
6288
adff3182
JD
62892012-07-30 Jan Djärv <jan.h.d@swipnet.se>
6290
6291 * nsterm.m (ns_do_open_file): New variable.
b9031d69 6292 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
6293 (openFile, openTempFile, openFileWithoutUI, openFiles):
6294 Open files only if ns_do_open_file.
adff3182 6295
c32af1e4
PE
62962012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6297
7393bcbb
PE
6298 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
6299 This no-op macro hasn't been needed for many years.
6300 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6301
c32af1e4
PE
6302 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
6303 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
6304 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
6305 gdb_make_enums_visible.
6306 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
6307 (DIRECTORY_SEP): Now a constant, not a macro.
6308
302fc036
EZ
63092012-07-30 Eli Zaretskii <eliz@gnu.org>
6310
6311 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
6312 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
6313
6314 * w32term.c <w32_keyboard_codepage>: Renamed from
6315 keyboard_codepage and now external. All users changed.
6316
6317 * w32term.h: Add declaration of w32_keyboard_codepage.
6318
6319 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
6320 the codepage to translate keys to Unicode. If this argument is
6321 -1, use the value returned by GetConsoleCP. All callers changed.
6322
88fb40b4
PE
63232012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6324
0aee6912
PE
6325 Update .PHONY listings in makefiles.
6326 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
6327 bootstrap-clean, distclean, maintainer-clean, versioclean,
6328 extraclean, frc.
6329
88fb40b4
PE
6330 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
6331 This is a bit clearer. Fix some commentary typos.
6332
0a763bd1
GM
63332012-07-30 Glenn Morris <rgm@gnu.org>
6334
32bac6d6
GM
6335 * s/netbsd.h: Let configure include signal.h if needed.
6336 Remove file, which is now empty.
6337
b65e7c46
GM
6338 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
6339 Let configure set them.
6340 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
6341 No more need to undefine.
0a763bd1 6342
169304bd
AS
63432012-07-30 Andreas Schwab <schwab@linux-m68k.org>
6344
6345 * keymap.c (Fkey_description): Don't remove 0x80 bit from
6346 non-single-byte char when adding meta modifier. (Bug#12090)
6347
6cd7a139
DA
63482012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6349
6350 Convert safe_call to use variable number of arguments.
6351 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
6352 (safe_call2): Fix comment.
6353 * lisp.h (safe_call): Adjust prototype.
6354 * coding.c (encode_coding_object): Change to use safe_call2.
6355 * xfaces.c (merge_face_heights): Change to use safe_call1.
6356
d34d6ffc
GM
63572012-07-30 Glenn Morris <rgm@gnu.org>
6358
7b8a48e4 6359 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 6360 does that unconditionally. Remove file, which is now empty.
7b8a48e4 6361
d34d6ffc
GM
6362 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
6363 Remove empty files.
6364
03a660a6
PE
63652012-07-30 Paul Eggert <eggert@cs.ucla.edu>
6366
6367 Export to GDB most of lisp.h's remaining object-like macros.
6368 * lisp.h (min, max): Move earlier, because they're used earlier now.
6369 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
6370 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
6371 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
6372 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
6373 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
6374 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
6375 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
6376 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
6377 Now constants, for GDB. They need not be macros.
6378 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
6379 Now constants, for GDB, as well as macros, for static initializers.
6380 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
6381 Move to after the definition of struct Lisp_Char_Table,
6382 since the former now needs that type defined.
6383 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
6384 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
6385 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
6386 New enums, for gdb_make_enums_visible.
6387 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 6388 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
6389 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
6390 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
6391 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
6392 enum maxargs, enum MAX_ALLOCA.
6393 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
6394 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
6395 no longer needed, now that they are done in lisp.h.
6396
e499d0ee
DA
63972012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
6398
6399 Cleanup string bytes checking.
6400 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
6401 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
6402 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
6403 (check_sblock, compact_small_strings): Simplify.
6404
d5040d2d
PE
64052012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6406
6407 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
6408 These macros are confusing and no longer need to be defined, as
6409 the enum values now suffice. All uses replaced with definiens.
6410 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
6411
7f259ae6
JB
64122012-07-29 Juanma Barranquero <lekktu@gmail.com>
6413
6414 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
6415 ($(BLD)/w32console.$(O)): Update dependencies.
6416
7e63e0c3
DA
64172012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6418
6419 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
6420 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
6421 time. Adjust users.
6422 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
6423
ffd817eb
JD
64242012-07-29 Jan Djärv <jan.h.d@swipnet.se>
6425
6426 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
6427 setting sitelisp (Bug#12010).
6428
417a7a0e
EZ
64292012-07-29 Eli Zaretskii <eliz@gnu.org>
6430
14ae4239 6431 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
6432
6433 * w32heap.c (cache_system_info):
6434 * w32.c (sys_rename):
6435 * w32proc.c (find_child_console, sys_kill): All users changed.
6436
387d4d92
PE
64372012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6438
6439 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
6440
55a6cca6
EZ
64412012-07-29 Eli Zaretskii <eliz@gnu.org>
6442
6443 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
6444
dbcf001c
DA
64452012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6446
6447 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
6448 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
6449 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 6450
e2688e4a
DA
64512012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
6452
6453 Generalize marker debugging code under MARKER_DEBUG and use eassert.
6454 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
6455 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
6456 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
6457 (replace_range, replace_range_2, del_range_2): Change to eassert.
6458 * marker.c (byte_char_debug_check): Adjust style.
6459
b46a6a83
PE
64602012-07-29 Paul Eggert <eggert@cs.ucla.edu>
6461
6462 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
6463 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
6464 long-ago-commented-out code that talks about "WIN32".
6465 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
6466 All uses changed.
6467
e32a5799
PE
64682012-07-28 Paul Eggert <eggert@cs.ucla.edu>
6469
6470 Use Gnulib stdalign module (Bug#9772, Bug#9960).
6471 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
6472 Simplify by using alignof.
6473 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
6474 * lisp.h: Include <stdalign.h>.
6475 (GCALIGNMENT): New macro and constant.
6476 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
6477 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
6478 (stdalign): New macro, if not already defined.
6479
df81cd29
EZ
64802012-07-28 Eli Zaretskii <eliz@gnu.org>
6481
01bd1b0d
EZ
6482 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
6483 * w32inevt.c: Include w32inevt.h.
6484 (w32_read_console_input): New inline function, calls either
6485 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
6486 w32_console_unicode_input.
6487 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
6488 (w32_kbd_patch_key, key_event): Use the codepage returned by
6489 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
6490 (key_event): use uChar.UnicodeChar only if
6491 w32_console_unicode_input is non-zero.
6492
6493 * w32console.c: Include w32heap.h.
6494 <w32_console_unicode_input>: New global variable.
6495 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
6496 family of Windows, zero otherwise.
6497
6498 * w32inevt.h: Declare w32_console_unicode_input.
6499
df81cd29
EZ
6500 * xdisp.c (init_iterator): Don't reference tip_frame in a build
6501 --without-x. (Bug#11742)
6502
c20fdd9e
PE
65032012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6504
6505 Adjust GDB to reflect pvec_type changes (Bug#12036).
6506 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
6507 2012-07-04 changes to pseudovector representation.
6508 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 6509
32770973 65102012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
6511
6512 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
6513 bus address.
6514 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
6515
3438fe21
EZ
65162012-07-27 Eli Zaretskii <eliz@gnu.org>
6517
bcfbc9de
EZ
6518 * alloc.c (listn): Fix the order the arguments are consed onto the
6519 list.
6520
3438fe21
EZ
6521 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
6522 enumeration constants, as PURE and HEAP are too general, and clash
6523 with other headers and sources, such as gmalloc.c and the
6524 MS-Windows system headers. All users changed.
6525
eeaea515
DA
65262012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6527
6528 Revert last save_excursion_save and save_excursion_restore changes.
6529 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
6530 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
6531
073c88c2
DA
65322012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6533
6534 Fix recently-introduced typos in Windows port.
6535 Reported by Martin Rudalics <rudalics@gmx.at>.
6536 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 6537 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 6538
4706125e
PE
65392012-07-27 Paul Eggert <eggert@cs.ucla.edu>
6540
6541 Improve GDB symbol export (Bug#12036).
6542 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
6543 arms of an 'if', not using conditional expressions; otherwise GDB
6544 complains about the types in the unevaluated arm when the argument
6545 is an integer literal.
6546 (xgetint): Simplify expression.
6547 * alloc.c (gdb_make_enums_visible): New constant. This ports to
6548 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
6549 Zaretskii in <http://bugs.gnu.org/12036#13>.
6550 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
6551 needed now that we have gdb_make_enums_visible.
6552 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
6553 (enum enum_USE_LSB_TAG):
6554 New enum types, packaging up enums that need to be exported to GDB.
6555
694b6c97
DA
65562012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6557
6558 Utility function to make a list from specified amount of objects.
6559 * lisp.h (enum constype): New datatype.
6560 (listn): New prototype.
6561 * alloc.c (listn): New function.
6562 (Fmemory_use_count, syms_of_alloc): Use it.
6563 * buffer.c (syms_of_buffer): Likewise.
6564 * callint.c (syms_of_callint): Likewise.
6565 * charset.c (define_charset_internal): Likewise.
6566 * coding.c (syms_of_coding): Likewise.
6567 * keymap.c (syms_of_keymap): Likewise.
6568 * search.c (syms_of_search): Likewise.
6569 * syntax.c (syms_of_syntax): Likewise.
6570 * w32.c (init_environment): Likewise.
6571 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
6572 * xdisp.c (syms_of_xdisp): Likewise.
6573 * xfns.c (syms_of_xfns): Likewise.
6574
6195f384
DA
65752012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
6576
6577 Fast save_excursion_save and save_excursion_restore.
6578 * lisp.h (struct Lisp_Excursion): New data type.
6579 (PVEC_EXCURSION): New pseudovector type.
6580 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
6581 to deal with it. Adjust comments.
6582 (init_marker, attach_marker): New prototype.
6583 (unchain_marker): Adjust prototype.
6584 * marker.c (attach_marker): Change to global.
6585 (init_marker): New function.
6586 * alloc.c (Fmake_marker, build_marker): Use it.
6587 (build_marker): More easserts.
6588 (mark_object): Handle struct Lisp_Excursion.
6589 * editfns.c (save_excursion_save, save_excursion_restore):
6590 Reimplement to use struct Lisp_Excursion. Add comments.
6591
5eceb8fb
PE
65922012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6593
6594 Fix export of symbols to GDB (Bug#12036).
6595 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
6596 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
6597 emacs.c, as this is a more-suitable home. Had this been done earlier
6598 the fix for 12036 would have avoided some of the problems noted in
6599 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
6600 would have been more obvious.
562157c8
PE
6601 * emacs.c: Do not include <verify.h>; no longer needed.
6602 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
6603 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
6604 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6605 Remove; now done in lisp.h.
6606 * lisp.h (PUBLISH_TO_GDB): New macro.
6607 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
6608 (DATA_SEG_BITS): Use it.
6609 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
6610 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
6611 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
6612 not be usable in #if. This simplifies things.
6613
d6749401
JB
66142012-07-26 Juanma Barranquero <lekktu@gmail.com>
6615
6616 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
6617
1781b9e9
PE
66182012-07-26 Paul Eggert <eggert@cs.ucla.edu>
6619
d89518db 6620 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
6621 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
6622 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
6623 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
6624 Adjust to changes in lisp.h and emacs.c, by using
6625 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
6626 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
6627 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
6628 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
6629 instead of gdb_valbits.
6630 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
6631 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
6632 instead of gdb_array_mark_flag.
6633 (xboolvector): Get size from $->size, not $->header.size.
6634 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
6635 (xreload, hook-run, hookpost-run): Remove.
6636 * emacs.c: Include <verify.h>.
6637 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
6638 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
6639 Remove.
6640 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
6641 (gdb_USE_LSB_TAG): New enum constants.
6642 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
6643 Also define these as enum constants, so they're visible to GDB.
6644 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
6645 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
6646 as constants, so they're visible to GDB.
6647 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
6648 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
6649 Now enum constants, not macros, so they're visible to GDB.
6650 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
6651 more convenient now. All uses changed.
6652 (VALMASK) [USE_LSB_TAG]: Also define in this case.
6653 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
6654
3628596a
DA
66552012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
6656
6657 Explicitly free restriction data that are not needed anymore.
6658 * editfns.c (save_restriction_restore): Free restriction data.
6659
7abaf5cc
SM
66602012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
6661
6662 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
6663 add argument, tune behavior, and adjust all callers.
6664
71f88e00
PE
66652012-07-25 Paul Eggert <eggert@cs.ucla.edu>
6666
6667 Use typedef for EMACS_INT, EMACS_UINT.
6668 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
6669 than macros. This simplifies debugging in the usual case, since
6670 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
6671 and it allows expressions involving EMACS_INT casts.
6672 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
6673
57ec3034
JD
66742012-07-25 Jan Djärv <jan.h.d@swipnet.se>
6675
6676 * nsterm.m (ns_read_socket): Return early if there is a modal
6677 window (Bug#12043).
6678
8137e7b3
MR
66792012-07-25 Martin Rudalics <rudalics@gmx.at>
6680
6681 * frame.c (Fredirect_frame_focus): In doc-string don't mention
6682 that FOCUS-FRAME can be omitted.
6683
04e9897c
DA
66842012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
6685
6686 Adjust buffer text indirection counters at the end of Fkill_buffer.
6687 * buffer.c (Fkill_buffer): Adjust indirection counters when the
6688 buffer is definitely dead. This should really fix an issue reported
6689 by Christoph Scholtes again. (Bug#12007).
6690 (init_buffer_once): Initialize indirection counters of
6691 buffer_defaults and buffer_local_symbols (for sanity and safety).
6692
8a0484e1
EZ
66932012-07-24 Eli Zaretskii <eliz@gnu.org>
6694
6695 * xdisp.c (init_iterator): Don't compute dimensions of truncation
6696 and continuation glyphs on tooltip frames, leave them at zero.
6697 Avoids continued lines in tooltips. (Bug#11832)
6698
fa691a83
DA
66992012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
6700
6701 Simplify copy_overlay.
04e9897c 6702 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
6703 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
6704
436bc8e0
EZ
67052012-07-23 Eli Zaretskii <eliz@gnu.org>
6706
6707 * print.c (print_object): Don't crash when a frame's name is nil
6708 or invalid. (Bug#12025)
6709
6710 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
6711 it signals an error when a tooltip frame is being created.
6712
d7a7fda3
DA
67132012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
6714
6715 Cleanup miscellaneous objects allocation and initialization.
6716 * alloc.c (allocate_misc): Change to static. Add argument to
6717 specify the subtype. Adjust comment and users.
6718 (build_overlay): New function.
6719 * buffer.c (copy_overlays, Fmake_overlay): Use it.
6720 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
6721 (allocate_misc): Remove prototype.
6722 (build_overlay): Add prototype.
6723
67242012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
6725
6726 Swap buffer text indirection counters in Fbuffer_swap_text.
6727 * buffer.c (Fbuffer_swap_text): Swap indirections too.
6728 This avoids crash reported by Christoph Scholtes at
6729 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
6730
9d7fa573
JD
67312012-07-22 Jan Djärv <jan.h.d@swipnet.se>
6732
6733 * nsmenu.m (Popdown_data): New struct.
6734 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
6735 free Popdown_data.
6736 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
6737 (initWithContentRect): Make imgView and contentView non-static
6738 and autorelease them. Also autorelease img and matrix (Bug#12005).
6739 (dealloc): Remove (Bug#12005).
6740
0dd6d66d
DA
67412012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6742
6743 Adjust consing_since_gc when objects are explicitly freed.
6744 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
6745 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
6746 (free_cons, free_misc): Subtract object size from consing_since_gc.
6747
d36d71df
DA
67482012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
6749
6750 Simplify and cleanup markers positioning code.
6751 * marker.c (attach_marker): More useful eassert.
6752 (live_buffer, set_marker_internal): New function.
6753 (Fset_marker, set_marker_restricted): Use set_marker_internal.
6754 (set_marker_both, set_marker_restricted_both): Use live_buffer.
6755
fb9ea40f
PE
67562012-07-22 Paul Eggert <eggert@cs.ucla.edu>
6757
6758 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
6759 as it's limited by the amount of memory, not by INT_MAX.
6760
2d5c5f7d
EZ
67612012-07-21 Eli Zaretskii <eliz@gnu.org>
6762
07fb592e
EZ
6763 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
6764 in special-event-map. See the discussion at
6765 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
6766 for the reasons.
6767
37a9eac8 6768 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
6769 info.dwItemData. Fixes crashes on 64-bit Windows.
6770 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 6771
c4328746
JD
67722012-07-21 Jan Djärv <jan.h.d@swipnet.se>
6773
fc0c31f8 6774 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 6775 (conversationIdentifier): Return value is NSInteger.
784051c4 6776 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 6777
6e5d1c12
CY
67782012-07-21 Chong Yidong <cyd@gnu.org>
6779
6780 * window.c (decode_any_window): Signal an error if the window is
6781 on a dead frame (Bug#11984).
6782
9928463d
DA
67832012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6784
6785 Add indirection counting to speed up Fkill_buffer.
6786 * buffer.h (struct buffer): New member.
6787 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
6788 (Fmake_indirect_buffer): Set indirection counter to -1, increment
6789 base buffer indirection counter.
6790 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
6791 (Fkill_buffer): Adjust indirection counters as needed, don't walk
6792 through buffer list if indirection counter is 0.
6793
f8643a6b
DA
67942012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6795
6796 Extend the value returned by Fgarbage_collect with heap statistics.
6797 * alloc.c (Qheap): New symbol.
6798 (syms_of_alloc): DEFSYM it.
6799 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
6800 (Fmemory_free): Remove.
6801 (syms_of_alloc): Don't defsubr it.
6802 * buffer.c (Fcompact_buffer): Remove.
6803 (syms_of_buffer): Don't defsubr it.
6804
dac616ff
DA
68052012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6806
6807 Make maybe_gc inline.
6808 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
6809 * lisp.h (consing_since_gc, gc_relative_threshold)
6810 (memory_full_cons_threshold): Revert declaration.
6811 (maybe_gc): Remove prototype, define as inline.
6812 * alloc.c: Remove old commented-out code.
6813 (consing_since_gc, gc_relative_threshold)
6814 (memory_full_cons_threshold): Revert to global.
6815 (maybe_gc): Remove.
6816
d7ea76b4
DA
68172012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6818
6819 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
6820 * lisp.h (build_unibyte_string): New function.
6821 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
6822 * sysdep.c, w32fns.c, xfns.c: Use it.
6823 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
6824 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
6825 Adjust users accordingly.
6826 * font.h (font_open_by_name): Adjust prototype.
6827
765e61e3
DA
68282012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
6829
6830 Cleanup calls to Fgarbage_collect.
6831 * lisp.h (maybe_gc): New prototype.
6832 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6833 Remove declarations.
6834 * alloc.c (maybe_gc): New function.
6835 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
6836 Make them static.
6837 * bytecode.c (MAYBE_GC): Use maybe_gc.
6838 * eval.c (eval_sub, Ffuncall): Likewise.
6839 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
6840 to avoid dependency from auto-save feature.
6841
52b852c7
PE
68422012-07-19 Paul Eggert <eggert@cs.ucla.edu>
6843
6844 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
6845 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
6846 'for_each_per_buffer_object_at'.
6847 All uses changed. It's better to use upper-case for macros that
6848 cannot be implemented as functions, to give the reader a clue
6849 that they're special.
6850
5db81e33
SM
68512012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
6852
6853 * alloc.c (Fgarbage_collect): Tweak docstring.
6854
5b835e1d
DA
68552012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6856
6857 Tweak the value returned from Fgarbage_collect again.
6858 * alloc.c (Fgarbage_collect): New return value, as confirmed in
6859 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
6860 Adjust documentation.
6861 (total_vector_bytes): Rename to total_vector_slots, adjust
6862 accounting.
6863 (total_free_vector_bytes): Rename to total_free_vector_slots,
6864 adjust accounting.
6865 (Qstring_bytes, Qvector_slots): New symbols.
6866 (syms_of_alloc): DEFSYM them.
6867
9cd47b72
DA
68682012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6869
6870 Buffer compaction primitive which may be used from Lisp.
6871 * buffer.c (compact_buffer, Fcompact_buffer): New function.
6872 (syms_of_buffer): Register Fcompact_buffer.
6873 * alloc.c (Fgarbage_collect): Use compact_buffer.
6874 * buffer.h (compact_buffer): New prototype.
6875 (struct buffer_text): New member.
6876
d17337e5
DA
68772012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
6878
6879 New macro to iterate over all buffers, miscellaneous cleanups.
6880 * lisp.h (all_buffers): Remove declaration.
6881 * buffer.h (all_buffers): Add declaration, with comment.
6882 (for_each_buffer): New macro.
6883 * alloc.c (Fgarbage_collect, mark_object): Use it.
6884 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
6885 (init_buffer): Likewise.
6886 * data.c (Fset_default): Likewise.
6887 * coding.c (code_conversion_restore): Remove redundant check
6888 for dead buffer.
6889 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
6890
60cfd278
AS
68912012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6892
6893 Fix bug that created negative-length intervals.
6894 * intervals.c (merge_interval_right, merge_interval_left):
6895 Do not zero out this interval if it is absorbed by its children,
6896 as this interval's total length doesn't change in that case. See
6897 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
6898
d06714cb
PE
68992012-07-18 Paul Eggert <eggert@cs.ucla.edu>
6900
83713154
PE
6901 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
6902 when invoking (make-bool-vector N t) and N is a positive
6903 multiple of 8 -- the last 8 bits were mistakenly cleared.
6904
d06714cb
PE
6905 Remove some struct layout assumptions in bool vectors.
6906 * alloc.c (bool_header_size): New constant.
6907 (header_size, word_size): Move earlier, as they're now used earlier.
6908 Use 'word_size' in a few more places, where it's appropriate.
6909 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
6910 padding before the data member of a bool vector.
6911 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
6912 than doing the check by hand with an abort ().
6913
464d5a5e
SM
69142012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6915
5fbc0409
SM
6916 * eval.c (Fdefvar): Don't check constants since we only set the var if
6917 it's not yet defined anyway (bug#11904).
6918
464d5a5e
SM
6919 * lisp.h (last_undo_boundary): Declare new var.
6920 * keyboard.c (command_loop_1): Set it.
6921 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6922 were auto-added by the command loop (bug#11774).
6923
8dc2e44a
AS
69242012-07-18 Andreas Schwab <schwab@linux-m68k.org>
6925
6926 * w32font.c (Qsymbol): Remove local definition.
6927 (syms_of_w32font): Don't DEFSYM it.
6928
169925ec
DA
69292012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6930
6931 Fix sweep_vectors to handle large bool vectors correctly.
6932 * alloc.c (sweep_vectors): Account total_vector_bytes for
6933 bool vectors larger than VBLOCK_BYTES_MAX.
6934
5fbfb018
CY
69352012-07-18 Chong Yidong <cyd@gnu.org>
6936
6937 * frame.c (x_set_frame_parameters): Revert bogus change introduced
6938 in 2012-05-25 commit by Paul Eggert (Bug#11738).
6939
3ab6e069
DA
69402012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
6941
6942 Return more descriptive data from Fgarbage_collect.
6943 Suggested by Stefan Monnier in
6944 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
6945 * alloc.c (bounded_number): New function.
6946 (total_buffers, total_vectors): New variable.
6947 (total_string_size): Rename to total_string_bytes, adjust users.
6948 (total_vector_size): Rename to total_vector_bytes, adjust users.
6949 (sweep_vectors): Account total_vectors and total_vector_bytes.
6950 (Fgarbage_collect): New return value. Adjust documentation.
6951 (gc_sweep): Account total_buffers.
6952 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
6953 (VECTOR_SIZE): Remove.
6954 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
6955 (Qinterval, Qmisc): New symbols.
6956 (syms_of_data): Initialize them.
6957 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
6958 (Qcons, Qbuffer): New declarations.
6959
6d02fe5b
PE
69602012-07-17 Paul Eggert <eggert@cs.ucla.edu>
6961
6962 * alloc.c (Fmemory_free): Account for memory-free's own storage.
6963 Round up, not down. Improve doc.
6964
b7ffe040
DA
69652012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
6966
6967 Restore old code in allocate_string_data to avoid Faset breakage.
6968 Reported by Julien Danjou <julien@danjou.info> in
6969 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
6970 * alloc.c (allocate_string_data): Restore old code with minor
6971 adjustments, fix comment to explain this subtle issue.
6972
4dc7c8d5
SM
69732012-07-17 Eli Zaretskii <eliz@gnu.org>
6974
6975 Remove FILE_SYSTEM_CASE.
6976 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
6977
6978 * fileio.c (FILE_SYSTEM_CASE): Don't define.
6979 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
6980 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
6981 call-process-region passes it through expand-file-name.
6982
6983 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
6984
69852012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6986
6987 Fix crash when creating indirect buffer (Bug#11917)
6988 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
6989 Don't handle unbound variables specially if non-zero.
6990 (Fbuffer_local_variables): Pass zero.
6991 (clone_per_buffer_values): Pass non-zero.
6992
69932012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6994
6995 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
6996 to make the loop interruptible.
6997
69982012-07-17 Andreas Schwab <schwab@linux-m68k.org>
6999
7000 * gnutls.c (emacs_gnutls_handshake): Only retry if
7001 GNUTLS_E_INTERRUPTED.
7002
cce7fefc
DA
70032012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7004
7005 Cleanup and convert miscellaneous checks to eassert.
7006 * alloc.c (mark_interval): Fix comment, partially rephrase
7007 old comment from intervals.h (see below).
7008 * intervals.c (find_interval, adjust_intervals_for_insertion)
7009 (delete_interval, adjust_intervals_for_deletion)
7010 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
7011 Convert to eassert.
7012 (adjust_intervals_for_insertion, make_new_interval):
7013 Remove obsolete and unused code.
7014 * intervals.h (struct interval): Remove obsolete comment.
7015 * textprotp.c (erase_properties): Remove unused code.
7016 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
7017 (Fremove_list_of_text_properties): Convert to eassert.
7018
9ea10cc3
CY
70192012-07-17 Chong Yidong <cyd@gnu.org>
7020
7021 * editfns.c (Finsert_char): Doc fix.
7022
3900d5de
DA
70232012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7024
7025 Fix previous change to make Fmemory_free always accurate.
7026 * alloc.c (make_interval): Update total_free_intervals.
7027 (make_float): Likewise for total_free_floats.
7028 (free_cons, Fcons): Likewise for total_free_conses.
7029 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
7030 Likewise for total_free_vector_bytes.
7031 (Fmake_symbol): Likewise for total_free_symbols.
7032 (bytes_free): Remove.
7033
7098646f
DA
70342012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7035
7036 Simple free memory accounting feature.
7037 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
7038 (sweep_vectors): Accumulate size of free vectors.
7039 (Fgarbage_collect): Setup bytes_free.
7040 (Fmemory_free): New function.
7041 (syms_of_alloc): Register it.
7042
22657b40
DA
70432012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
7044
7045 Cleanup overlays checking.
7046 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
7047 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
7048 eassert and OVERLAYP.
7049 (sort_overlays): Change to use OVERLAYP.
7050
ddfc8813
RK
70512012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
7052
7053 * editfns.c (Finsert_char): Make it interactive, and make the
7054 second arg optional. Copy interactive spec and docstring from
7055 ucs-insert.
7056
7c26cf3c
PE
70572012-07-17 Paul Eggert <eggert@cs.ucla.edu>
7058
7059 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
7060 Unlike the other wrapped functions, fabs has an unspecified
7061 effect on errno.
7062
5d127af9
JD
70632012-07-16 Jan Djärv <jan.h.d@swipnet.se>
7064
7065 * nsterm.m (keyDown): Interpret flags without left/right bits
7066 as the left key (Bug#11670).
7067
6a0dd1d7
DA
70682012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7069
7070 Remove empty and useless init functions.
7071 * lisp.h (init_character_once, init_fns, init_image)
7072 (init_filelock, init_sound): Remove prototype.
7073 * character.c (init_character_once): Remove.
7074 * filelock.c (init_filelock): Likewise.
7075 * fns.c (init_fns): Likewise.
7076 * image.c (init_image): Likewise.
7077 * sound.c (init_sound): Likewise.
7078 * emacs.c (main): Adjust accordingly.
7079
7a6136fd
DA
70802012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
7081
7082 * gtkutil.h: Tiny cleanups.
7083 (use_old_gtk_file_dialog): Remove useless declaration.
7084 (xg_uses_old_file_dialog): Add suggested const attribute.
7085
ce811ad9
EZ
70862012-07-15 Eli Zaretskii <eliz@gnu.org>
7087
7088 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
7089 (bidi_paragraph_init): Use it to limit search forward for a strong
7090 directional character in abnormally large paragraphs full of
7091 neutral or weak characters. (Bug#11943)
7092
c9adfeaa
SF
70932012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
7094
7095 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
7096 the toolbar (Bug#9451).
7097 (xg_make_tool_item): Give the widget event box a transparent
7098 background.
7099
fff62aa9
DA
71002012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7101
7102 Cleanup basic allocation variables and functions.
7103 * alloc.c (ignore_warnings, init_intervals, init_float)
7104 (init_cons, init_symbol, init_marker): Remove.
7105 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
7106 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
7107 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
7108 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
7109 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
7110 (staticidx, init_alloc_once, init_strings, free_ablock):
7111 Remove redundant initialization.
7112 * fns.c (init_weak_hash_tables): Remove.
7113 * lisp.h (init_weak_hash_tables): Remove prototype.
7114
9730daca
DA
71152012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
7116
7117 Use zero_vector where appropriate.
7118 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
7119 accordingly.
7120 * lisp.h (zero_vector): New declaration.
7121 * font.c (null_vector): Remove.
7122 (syms_of_font): Remove initialization and staticpro.
7123 (font_list_entities, font_find_for_lface): Change to use zero_vector.
7124 * keymap.c (Faccessible_keymaps): Likewise.
7125
2e2d2a13
LL
71262012-07-15 Leo Liu <sdl.web@gmail.com>
7127
7128 * fringe.c: Fix typo in comments.
7129
cd276f6e
LL
71302012-07-14 Leo Liu <sdl.web@gmail.com>
7131
7132 * fringe.c: Add a new bitmap exclamation-mark.
7133
5a1131d9
EZ
71342012-07-14 Eli Zaretskii <eliz@gnu.org>
7135
7136 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
7137
7138 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
7139 (HAVE_MENUS): Don't define, defined by editing config.in with
7140 msdos/sed2v2.inp.
7141 (GMALLOC_INHIBIT_VALLOC): Don't define.
7142 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
7143
22e983b7
JB
71442012-07-14 Juanma Barranquero <lekktu@gmail.com>
7145
7146 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
7147
5b3f250f
GM
71482012-07-14 Glenn Morris <rgm@gnu.org>
7149
7150 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
7151 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
7152 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
7153
33d63ff4
GM
71542012-07-13 Glenn Morris <rgm@gnu.org>
7155
5b633342
GM
7156 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
7157
33d63ff4
GM
7158 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
7159 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7160
b55b9f85
JD
71612012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7162
0dc8cf50
JD
7163 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
7164 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
7165 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
7166 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
7167 where appropriate.
7168 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
7169 as boolean expression.
7170 (x_set_window_size): Remove unused variable toolbar.
7171 (ns_get_color_default, ns_mod_to_lisp): Remove.
7172 (ns_mouse_position): Remove unused variables xchar and ychar.
7173 (ns_compute_glyph_string_overhangs): Remove unused variable face.
7174 (ns_set_vertical_scroll_bar): Remove unused variable count.
7175 (ns_delete_terminal): Remove unused variable i.
7176 (ns_term_init): Remove unused variables r, g and b.
7177 (mouseDown): Remove unused variable window.
7178 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
7179 (initFrameFromEmacs): Remove unused variable vbextra.
7180 (mouseEntered): Remove unused variables p and dpyinfo.
7181 (mouseExited): Remove unused variables p and r.
7182 (ns_define_frame_cursor, ns_clear_frame_area)
7183 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
7184 (menuDown): Assign [sender tag] to variable and cast the variable.
7185
7186 * nsterm.h (menuDown): Add id as type to argument sender.
7187 (ns_display_info_for_name): Add Lisp_Object argument.
7188 (ns_term_init): Add Lisp_Object argument.
7189 (ns_map_event_to_object): Add void argument.
7190 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
7191 prototype with arguments and only declare if __OBJC__.
7192 (nxatoms_of_nsselect): Add void argument.
7193 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
7194 (ns_alloc_autorelease_pool): Add void argument.
7195 (ns_release_autorelease_pool): Add void* argument.
7196 (ns_get_defaults_value): Add const char* argument.
7197
7198 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
7199 (initFromContents): Use SSDATA where appropriate.
7200 (ns_update_menubar): Add braces to ambigous if-else.
7201 (initWithTitle): Put () around assignment in if statement.
7202 (ns_menu_show): Remove unused variables window and keymap.
7203 (update_frame_tool_bar): Remove unused variable selected_p.
7204 (initWithContentRect): Remove unused variable this_cmd_name.
7205
7206 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
7207 appropriate.
7208 (setXBMColor): Remove unused variable len.
7209 (setPixmapData): Put () around assignment in loop statement.
7210
7211 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
7212 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
7213 where appropriate.
7214 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
7215 around assignment in loop statement.
7216 (nsfont_open): Remove unused variable i.
7217 (nsfont_open): Remove unused variable len.
7218 (nsfont_draw): Remove unused variable cs.
7219
7220 * nsfns.m (x_set_icon_name, ns_set_name_internal)
7221 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
7222 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
7223 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
7224 (Fns_font_name, Fns_perform_service)
7225 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
7226 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
7227 (ns_set_name): Remove unused variable view.
7228 (x_set_menu_bar_lines): Remove unused variable olines.
7229 (x_set_tool_bar_lines): Remove unused variable root_window.
7230 (Fns_list_colors): Put () around assignment in while statement.
7231 (Fns_perform_service): Remove unused variable len.
7232 (Fns_display_usable_bounds): Remove unused variable top.
7233 (syms_of_nsfns): Remove unused variable i.
7234
b55b9f85
JD
7235 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
7236 memcpy (Bug#11907).
7237
ed9265fc 72382012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
7239
7240 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
7241 and free it with DestroyExceptionInfo (Bug#11558).
7242
ef099b57
JB
72432012-07-13 Juanma Barranquero <lekktu@gmail.com>
7244
7245 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
7246 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
7247 Set here, not in nt/config.nt.
7248
ea814a5d
EZ
72492012-07-13 Eli Zaretskii <eliz@gnu.org>
7250
7251 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
7252 cursor overflow into the last glyph on display line when the right
7253 fringe is off. (Bug#11832)
7254
1a952767
PE
72552012-07-13 Paul Eggert <eggert@cs.ucla.edu>
7256
7257 * xdisp.c (produce_special_glyphs): Now static.
7258 * dispextern.h (produce_special_glyphs): Remove decl.
7259
983188fd
GM
72602012-07-13 Glenn Morris <rgm@gnu.org>
7261
8d7c7eed 7262 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
7263 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
7264
983188fd
GM
7265 * s/usg5-4-common.h (USG, USG5):
7266 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
7267 * s/sol2-6.h (SOLARIS2):
7268 * s/irix6-5.h (IRIX6_5):
7269 * s/hpux10-20.h (USG, USG5, HPUX):
7270 * s/gnu-linux.h (USG, GNU_LINUX):
7271 * s/freebsd.h (BSD_SYSTEM):
7272 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
7273 * s/cygwin.h (CYGWIN):
7274 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
7275 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
7276
d1e68667 72772012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
7278
7279 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 7280
6de0e799
GM
72812012-07-13 Glenn Morris <rgm@gnu.org>
7282
739ae010
GM
7283 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
7284
dbee5793
GM
7285 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
7286
6de0e799
GM
7287 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
7288 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
7289
b82da769
GM
72902012-07-12 Glenn Morris <rgm@gnu.org>
7291
4fae5a7a 7292 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
7293
7294 * process.c (init_process_emacs): Rename from init_process.
7295 The old name is also the name of a Mach system call.
7296 * lisp.h, emacs.c: Update for this name change.
7297 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
7298 longer needed.
7299
5a979817
EZ
73002012-07-12 Eli Zaretskii <eliz@gnu.org>
7301
7302 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
7303 memmove call that removes glyphs covered by the left truncation
7304 glyph. Improve commentary.
7305 (display_line): Fix display of continuation glyphs on GUI frames
7306 when the right fringe is turned off and variable-size fonts are
7307 used in the window. Move the code that appends a stretch glyph to
7308 produce_special_glyphs, so that it could be used for truncation
7309 and continuation glyphs alike.
7310 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
7311 glyph of a suitably computed width, to align the special glyphs at
7312 the window margin. Code moved from display_line. (Bug#11832)
7313
3e91a053
GM
73142012-07-12 Glenn Morris <rgm@gnu.org>
7315
ba9e4b84
GM
7316 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
7317
7318 * s/gnu-linux.h, s/hpux10-20.h:
7319 Do not unconditionally define HAVE_XRMSETDATABASE.
7320
3e91a053
GM
7321 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
7322
b300b1f4
PE
73232012-07-12 Paul Eggert <eggert@cs.ucla.edu>
7324
7325 Fix typos that broke OS X build.
7326 Reported by Randal L. Schwartz in
7327 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
7328 * nsterm.m (ns_timeout): Add missing local decl.
7329 (ns_get_color): snprintf -> sprintf, to fix typo.
7330
6e777848
GM
73312012-07-12 Glenn Morris <rgm@gnu.org>
7332
3f922c37
GM
7333 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
7334 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
7335 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
7336 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
7337
0ab7b23a
GM
7338 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
7339 Move PTY_OPEN to configure.
7340
6e777848
GM
7341 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7342 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
7343 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
7344
4a7edc24
DA
73452012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
7346
7347 Use empty_unibyte_string where applicable.
7348 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
7349 * lread.c (read1): Likewise.
7350 * xsettings.c (syms_of_xsettings): Likewise.
7351
308aab79
GM
73522012-07-12 Glenn Morris <rgm@gnu.org>
7353
42bd1719
GM
7354 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
7355 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
7356 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
7357 * s/hpux10-20.h (RUN_TIME_REMAP):
7358 * s/bsd-common.h (TABDLY): Move to configure.
7359
7360 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
7361
7362 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
7363
ea0bbd17 7364 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 7365 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
7366
7367 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 7368
308aab79
GM
7369 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
7370 * s/template.h: Move NARROWPROTO to configure.
7371
ee1cf5cf
GM
73722012-07-11 Glenn Morris <rgm@gnu.org>
7373
30fe9bf4
GM
7374 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
7375 unused since 2011-01-17 change to systty.h.
7376
ee1cf5cf
GM
7377 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
7378 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7379 Move HAVE_PTYS and HAVE_SOCKETS to configure.
7380
63e47e07
PE
73812012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7382
7383 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
7384
c43fb4c3
GM
73852012-07-11 Glenn Morris <rgm@gnu.org>
7386
7387 * s/darwin.h, s/gnu-linux.h, s/template.h:
7388 Move INTERRUPT_INPUT to configure.
7389
e8df9267
DA
73902012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7391
7392 Minor adjustments to interning code.
7393 * lisp.h (intern, intern_c_string): Redefine as static inline
7394 wrappers for intern_1 and intern_c_string_1, respectively.
7395 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
7396 * lread.c (intern_1, intern_c_string_1, oblookup):
7397 Simplify Vobarray checking.
e8df9267
DA
7398 * font.c (font_intern_prop): Likewise. Adjust comment.
7399 * w32font.c (intern_font_name): Likewise.
7400
34348bd4
AS
74012012-07-11 Andreas Schwab <schwab@linux-m68k.org>
7402
d96a1e0c
AS
7403 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
7404
34348bd4
AS
7405 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
7406 of Fcar/Fcdr if possible.
7407 * font.c (check_otf_features): Likewise.
7408 * fontset.c (Fnew_fontset): Likewise.
7409 * gnutls.c (Fgnutls_boot): Likewise.
7410 * minibuf.c (read_minibuf): Likewise.
7411 * msdos.c (IT_set_frame_parameters): Likewise.
7412 * xmenu.c (Fx_popup_dialog): Likewise.
7413 * w32menu.c (Fx_popup_dialog): Likewise.
7414
c8add24e
GM
74152012-07-11 Glenn Morris <rgm@gnu.org>
7416
4b575b3c
GM
7417 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
7418 since nothing has defined it on these platforms.
7419
09f4e3b0
GM
7420 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
7421 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
7422
172bedef
GM
7423 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7424 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
7425 Move CLASH_DETECTION to configure.
7426
249685df
GM
7427 * s/gnu.h: Remove file, which is now empty.
7428
c8add24e
GM
7429 * s/gnu.h, s/gnu-linux.h:
7430 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
7431
b41253a3
JW
74322012-07-11 John Wiegley <johnw@newartisans.com>
7433
7434 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
7435 function attribute, so we only use it if it exists in the
7436 compiler.
7437
d923b542
DA
74382012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7439
7440 Avoid call to strlen in fast_c_string_match_ignore_case.
7441 * search.c (fast_c_string_match_ignore_case): Change to use
7442 length argument. Adjust users accordingly.
7443 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7444
5ebbef1d
PE
74452012-07-11 Paul Eggert <eggert@cs.ucla.edu>
7446
bb352260
PE
7447 Assume mkdir, rmdir.
7448 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
7449 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
7450
57054ddd
PE
7451 Assume rename.
7452 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
7453
b747d3f7
PE
7454 Assume perror.
7455 * s/hpux10-20.h (HAVE_PERROR): Remove.
7456 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
7457 Remove dummy definition, as this problem was obsolete long ago.
7458
5ebbef1d
PE
7459 Assume strerror.
7460 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
7461
984e7f30
DA
74622012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
7463
7464 Avoid calls to strlen in font processing functions.
7465 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
7466 (font_open_by_name): Change to use length argument.
7467 Adjust users accordingly.
d923b542
DA
7468 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
7469 Adjust prototypes.
7470 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
7471 Change to return ptrdiff_t.
984e7f30
DA
7472 (xfont_list_pattern, xfont_match): Use length returned by
7473 xfont_decode_coding_xlfd.
7474 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
7475
20e94fdd
GM
74762012-07-11 Glenn Morris <rgm@gnu.org>
7477
9d596af3
GM
7478 * s/darwin.h, s/freebsd.h, s/netbsd.h:
7479 Move DONT_REOPEN_PTY to configure.
7480
20e94fdd
GM
7481 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
7482 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
7483
e99a530f
PE
74842012-07-10 Paul Eggert <eggert@cs.ucla.edu>
7485
22ffb973
PE
7486 Remove "#define unix" that is no longer needed (Bug#11905).
7487 * s/aix4-2.h (unix): Remove; no longer needed.
7488
e9a9ae03
PE
7489 EMACS_TIME simplification (Bug#11875).
7490 This replaces macros (which typically do not work in GDB)
7491 with functions, typedefs and enums, making the code easier to debug.
7492 The functional style also makes code easier to read and maintain.
7493 * systime.h: Include <sys/time.h> on all hosts, not just if
7494 WINDOWSNT, since 'struct timeval' is needed in general.
7495 (EMACS_TIME): Now a typedef, not a macro.
7496 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
7497 not macros.
7498 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
7499 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
7500 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
7501 (EMACS_TIME_LE): Now functions, not macros.
7502 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
7503 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
7504 which are not functions. All uses rewritten to use:
7505 (make_emacs_time): New function.
7506 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
7507 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
7508 not functions. All uses rewritten to use the following, respectively:
7509 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
7510 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 7511 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
7512 * fileio.c (Fcopy_file):
7513 * xterm.c (XTflash): Get the current time closer to when it's used.
7514 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
7515
ffacb126
PE
7516 * bytecode.c (targets): Suppress -Woverride-init warnings.
7517
e99a530f
PE
7518 Simplify by avoiding confusing use of strncpy etc.
7519 * doc.c (Fsnarf_documentation):
7520 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
7521 * frame.c (Fmake_terminal_frame):
7522 * gtkutil.c (get_utf8_string):
7523 * lread.c (openp):
7524 * nsmenu.m (ns_update_menubar):
7525 * regex.c (regerror):
7526 Prefer memcpy to strncpy and strncat when either will do.
7527 * fileio.c (Fsubstitute_in_file_name):
7528 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
7529 (menu_separator_name_p):
7530 * nsmenu.m (ns_update_menubar):
7531 Prefer memcmp to strncmp when either will do.
7532 * nsterm.m: Include <ftoastr.h>.
7533 (ns_get_color):
7534 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
7535 Prefer snprintf to strncpy.
7536 * nsterm.m (ns_term_init):
7537 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
7538 * nsterm.m (ns_term_init):
7539 Avoid the need for strncpy, by using build_string or
7540 make_unibyte_string directly. Use dtoastr, not snprintf.
7541 * process.c (Fmake_network_process): Diagnose service names that
7542 are too long, rather than silently truncating them or creating
7543 non-null-terminated names.
7544 (Fnetwork_interface_info): Likewise, for interface names.
7545 * sysdep.c (system_process_attributes) [GNU_LINUX]:
7546 Prefer sprintf to strncat.
7547 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
7548 Prefer vsnprintf to vsprintf + strncpy.
7549
c59592b3
GM
75502012-07-10 Glenn Morris <rgm@gnu.org>
7551
7552 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
7553 Clarify fallback case.
7554
7d7bbefd
DA
75552012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7556
7557 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
7558 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
7559 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 7560 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
7561 where argument type is known to be a Lisp_Cons.
7562
3a4c8000
TT
75632012-07-10 Tom Tromey <tromey@redhat.com>
7564
7565 * bytecode.c (BYTE_CODE_THREADED): New macro.
7566 (BYTE_CODES): New macro. Replaces all old byte-code defines.
7567 (enum byte_code_op): New type.
7568 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
7569 (exec_byte_code): Use them. Use token threading when applicable.
7570
2a0213a6
DA
75712012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7572
7573 Optimize pure C strings initialization.
7574 * lisp.h (make_pure_string): Fix prototype.
7575 (build_pure_c_string): New function, defined as static inline. This
7576 provides a better opportunity to optimize away calls to strlen when
7577 the function is called with compile-time constant argument.
7578 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
7579 argument, adjust users accordingly. Use build_pure_c_string where
7580 appropriate.
7581 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
7582 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
7583 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
7584
cb1caeaf
DA
75852012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7586
7587 Avoid calls to strlen in miscellaneous functions.
7588 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
7589 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
7590 * lread.c (openp): Likewise.
7591
c293e30c
DA
75922012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
7593
7594 Avoid calls to strlen in path processing functions.
7595 * fileio.c (file_name_as_directory): Add comment. Change to add
7596 srclen argument and return the length of result. Adjust users
7597 accordingly.
7598 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
7599 swap 1st and 2nd arguments to obey the common convention.
7600 Adjust users accordingly.
c293e30c
DA
7601 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
7602
9e059e3f
GM
76032012-07-10 Glenn Morris <rgm@gnu.org>
7604
d02eb359
GM
7605 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
7606 Move PENDING_OUTPUT_COUNT definition to configure.
7607
882cf227
GM
7608 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
7609 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
7610 * s/gnu.h (DATA_START): Move definitions to configure.
7611
af6e839f
GM
7612 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
7613 We include usg5-4-common.h, which defines them both.
7614
40289a12
GM
7615 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
7616 O_RDONLY already includes it).
7617
9e059e3f
GM
7618 Stop ns builds setting the EMACSLOADPATH environment variable.
7619 * nsterm.m (ns_load_path): Rename from ns_init_paths.
7620 Now it does not set EMACSLOADPATH, just returns the load-path string.
7621 * nsterm.h: Update accordingly.
7622 * lread.c [HAVE_NS]: Include nsterm.h.
7623 (init_lread) [HAVE_NS]: Use ns_load_path.
7624 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
7625
7c4e8ec0
GM
76262012-07-09 Glenn Morris <rgm@gnu.org>
7627
d4f600ff
GM
7628 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
7629 since the included bsd-common.h does so.
7630
cbb31951
GM
7631 Stop ns builds setting the EMACSPATH environment variable.
7632 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
7633 (ns_init_paths): Do not set EMACSPATH.
7634 * nsterm.h (ns_exec_path): Add it.
7635 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
7636 Use ns_exec_path.
7637
7c4e8ec0
GM
7638 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
7639
26bccfae
PE
76402012-07-09 Paul Eggert <eggert@cs.ucla.edu>
7641
a0bee46f
PE
7642 * process.c (wait_reading_process_output): 'waitchannels' was unset
7643 when read_kbd || !NILP (wait_for_cell); fix this.
7644
5994c183
PE
7645 Add GCC-style 'const' attribute to functions that can use it.
7646 * character.h (char_resolve_modifier_mask):
7647 * keyboard.h (make_ctrl_char):
7648 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
7649 (init_character_once, next_almost_prime, init_fns, init_image)
7650 (flush_pending_output, init_sound):
7651 * mem-limits.h (start_of_data):
7652 * menu.h (finish_menu_items):
7653 Add ATTRIBUTE_CONST.
7654 * emacs.c (DEFINE_DUMMY_FUNCTION):
7655 Declare the dummy function with ATTRIBUTE_CONST.
7656 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
7657 Add decls with ATTRIBUTE_CONST.
7658
26bccfae
PE
7659 Minor improvements to make_formatted_string.
7660 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
7661 where int is good enough, as vsprintf returns an int.
7662 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
7663
a8290ec3
DA
76642012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7665
7666 Use make_formatted_string to avoid double length calculation.
7667 * lisp.h (make_formatted_string): New prototype.
7668 * alloc.c (make_formatted_string): New function.
7669 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 7670 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
7671 * editfns.c (Fcurrent_time_zone): Likewise.
7672 * filelock.c (get_boot_time): Likewise.
7673 * frame.c (make_terminal_frame, set_term_frame_name)
7674 (x_report_frame_params): Likewise.
7675 * image.c (gs_load): Likewise.
7676 * minibuf.c (get_minibuffer): Likewise.
7677 * msdos.c (dos_set_window_size): Likewise.
7678 * process.c (make_process): Likewise.
7679 * xdisp.c (ensure_echo_area_buffers): Likewise.
7680 * xsettings.c (apply_xft_settings): Likewise.
7681
d01ba2f1
GM
76822012-07-09 Glenn Morris <rgm@gnu.org>
7683
7684 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
7685 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
7686 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
7687 * nsterm.h (ns_etc_directory): Add it.
7688 * callproc.c [HAVE_NS]: Include nsterm.h.
7689 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
7690
f1f924b6
DA
76912012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
7692
7693 Move marker debugging code under MARKER_DEBUG.
7694 * marker.c (MARKER_DEBUG): Move marker debugging code under
7695 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
7696 for bootstrap with --enable-checking (~3x slowdown reported
7697 by Juanma Barranquero <lekktu@gmail.com>).
7698 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
7699
ab531b66
PE
77002012-07-08 Paul Eggert <eggert@cs.ucla.edu>
7701
7702 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
7703 See <http://bugs.gnu.org/11825#29>.
7704
c4b3bc8a
EZ
77052012-07-08 Eli Zaretskii <eliz@gnu.org>
7706
7707 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
7708 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
7709 (display_line): Add commentary about displaying truncation glyphs
7710 on GUI frames.
7711 (produce_special_glyphs): Move here from term.c.
7712
7713 * term.c (produce_special_glyphs): Move to xdisp.c.
7714
7715 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
7716 section.
c4b3bc8a 7717
b676b881
AS
77182012-07-07 Andreas Schwab <schwab@linux-m68k.org>
7719
f17c5273
AS
7720 * xdisp.c (display_line): Avoid warning about implicit declaration
7721 of FRAME_FONT.
7722
298819b9
AS
7723 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
7724
b676b881
AS
7725 * lisp.h: Remove empty conditional.
7726
6045c4fd
PE
77272012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7728
b3350bf9
PE
7729 * lread.c (load_path_check): Now static.
7730
6045c4fd
PE
7731 Fix some minor --with-ns problems found by static checking.
7732 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
7733 (x_set_font) [!HAVE_X_WINDOWS]:
7734 * image.c (xpm_load_image) [HAVE_NS]:
7735 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
7736 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
7737 Remove unused local.
7738 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
7739 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
7740 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
7741 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
7742 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
7743 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
7744 Fix pointer signedness problem.
7745 * xfaces.c (FRAME_X_FONT_TABLE):
7746 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
7747
929e7845
GM
77482012-07-07 Glenn Morris <rgm@gnu.org>
7749
7750 * lread.c (load_path_check): New function, split from init_lread.
7751 (init_lread): Reorganize. Motivation:
7752 If EMACSLOADPATH is set, check/warn about that rather than the
7753 defaults, which we are not going to use. Hence we can remove
7754 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
7755 Don't warn if site-lisp directories are missing.
7756 If not installed, start from a blank load-path, since
7757 PATH_LOADSEARCH refers to the eventual installation directories.
7758
58dd0aa4
EZ
77592012-07-07 Eli Zaretskii <eliz@gnu.org>
7760
7761 Support truncation and continuation glyphs on GUI frames, when
7762 fringes are disabled. (Bug#11832)
7763 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
7764 continuation glyphs even if on GUI frames.
7765 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
7766 or both, are absent.
7767 (start_display, move_it_in_display_line_to): Handle the case of a
7768 GUI frame without a fringe to display continuation or truncation
7769 glyphs.
7770 (insert_left_trunc_glyphs): Support GUI frames: make sure
7771 truncation glyphs overwrite enough glyphs from the current line to
7772 have sufficient space in pixels.
7773 (display_line): Support truncation and continuation glyphs on GUI
7774 frames. If some spare pixels are left on the line after inserting
7775 the truncation glyphs, fill that space with a stretch glyph of a
7776 suitably computed width.
7777
7778 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
7779 produce_glyphs, to support GUI sessions.
7780
31571fd7
PE
77812012-07-07 Paul Eggert <eggert@cs.ucla.edu>
7782
5a16b9bc
PE
7783 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
7784
f3047c75
PE
7785 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
7786
31571fd7
PE
7787 Do not require float-time's arg to fit in time_t (Bug#11825).
7788 This works better on hosts where time_t is unsigned, and where
7789 float-time is applied to the (negative) difference between two times.
7790 * editfns.c (decode_time_components): Last arg is now double *,
7791 not int *, and means to store all the result as a double, without
7792 worrying about whether the seconds part fits in time_t.
7793 All callers changed.
7794 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
7795 All callers changed.
7796 (Ffloat_time): Do not fail merely because the specified time falls
7797 outside of time_t range.
7798
4516fbef
GM
77992012-07-07 Glenn Morris <rgm@gnu.org>
7800
7801 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
7802 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
7803 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
7804
07adc2c6
JB
78052012-07-07 Juanma Barranquero <lekktu@gmail.com>
7806
7807 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
7808 Update dependencies.
7809
7810 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
7811
fd573f31
PE
78122012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7813
fee5959d
PE
7814 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
7815 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
7816 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
7817 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
7818 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
7819 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
7820
fd573f31
PE
7821 * xfont.c (compare_font_names): Redo to omit the need for casts.
7822
ddadbc0e
AS
78232012-07-06 Andreas Schwab <schwab@linux-m68k.org>
7824
fca8d6b6
AS
7825 * xfns.c (Fx_change_window_property): Doc fix.
7826 * w32fns.c (Fx_change_window_property): Doc fix.
7827
ddadbc0e
AS
7828 * w32fns.c (Fx_window_property): Accept the same arguments as the
7829 X Windows version. Doc fix.
7830 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
7831
ed9265fc 78322012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
7833 Eli Zaretskii <eliz@gnu.org>
7834
7835 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
7836 Windows-specific code from nt/config.nt moved here.
7837 Obsolete settings removed.
7838
216ee680
PE
78392012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7840
7841 * process.c: Avoid unnecessary calls to gettime.
7842 (wait_reading_process_output): Don't get the time of day
7843 when gobbling data immediately and not waiting, as there's no need
7844 for it in that case. This removes a FIXME.
7845
bdd091e4
JD
78462012-07-06 Jan Djärv <jan.h.d@swipnet.se>
7847
7848 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
7849 is defined (Bug#11768).
7850
9d44f8ce
DA
78512012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7852
7853 Fix marker debugging code.
7854 * marker.c (byte_char_debug_check): Do not perform the check
7855 if buffer is not multibyte.
090bd7cb
JB
7856 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7857 Call byte_char_debug_check with correct arguments.
9d44f8ce 7858
90fc4786
DA
78592012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7860
7861 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
7862 * marker.c (byte_char_debug_check, count_markers):
7863 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
7864 (byte_debug_flag): Remove.
7865 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
7866 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
7867
7b7ae965
DA
78682012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7869
4e57b342
DA
7870 Avoid code repetition in marker-related functions.
7871 * marker.c (attach_marker): New function.
7872 (Fset_marker, set_marker_restricted, set_marker_both)
7873 (set_marker_restricted_both): Use it.
7874 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
7875 Consistently rename charno to charpos.
7876 (marker_position): Add eassert.
7877 (marker_byte_position): Convert to eassert.
7878
78792012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7880
7881 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 7882 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 7883 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 7884
657924ff
DA
78852012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7886
7887 Introduce fast path for the widely used marker operation.
7888 * alloc.c (build_marker): New function.
7889 * lisp.h (build_marker): New prototype.
7890 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
7891 * composite.c (autocmp_chars): Likewise.
7892 * editfns.c (buildmark): Remove.
7893 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
7894 (save_restriction_save): Use build_marker.
7895 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
7896 * window.c (save_window_save): Likewise.
7897
041a49a6
DA
78982012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
7899
7900 Do not use Fdelete_overlay in delete_all_overlays
7901 to avoid redundant calls to unchain_overlay.
7902 * buffer.c (drop_overlay): New function.
7903 (delete_all_overlays, Fdelete_overlay): Use it.
7904 * minibuf.c (get_minibuffer): Fix comment.
7905
7dca65a4
PE
79062012-07-06 Paul Eggert <eggert@cs.ucla.edu>
7907
7908 Port to OpenBSD 5.1 amd64.
7909 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
7910 This is needed for OpenBSD, and should be harmless on all BSD systems.
7911 Also, include <sys/sysctl.h>, as it should be available on all
7912 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
7913 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
7914 use p_pid member, not kp_proc.pid.
7915
8eb876e2
GM
79162012-07-06 Glenn Morris <rgm@gnu.org>
7917
7918 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
7919
38182d90
PE
79202012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7921
7922 More xmalloc and related cleanup.
7923 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
7924 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
7925 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
7926 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
7927 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
7928 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
7929 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
7930 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
7931 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
7932 * xterm.c:
7933 Omit needless casts involving void * pointers and allocation.
7934 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
7935 as the former is more robust if P's type is changed.
7936 Prefer xzalloc to xmalloc + memset 0.
7937 Simplify malloc-or-realloc to realloc.
7938 Don't worry about xmalloc returning a null pointer.
7939 Prefer xstrdup to xmalloc + strcpy.
7940 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
7941 growing it.
7942 * keyboard.c (apply_modifiers_uncached): Prefer local array to
7943 alloca of a constant.
7944
6dd5a677
EZ
79452012-07-05 Eli Zaretskii <eliz@gnu.org>
7946
7947 * xdisp.c (display_line): Fix horizontal pixel coordinates when
7948 hscroll is larger than the line width. Fixes long and futile
7949 looping inside extend_face_to_end_of_line (on a TTY) producing
7950 glyphs that are not needed and thrown away.
7951
6b312f0f
DA
79522012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7953
7954 * marker.c (set_marker_restricted_both): Simplify by using
7955 clip_to_bounds.
7956
f520ef9b
PE
79572012-07-05 Paul Eggert <eggert@cs.ucla.edu>
7958
7959 * editfns.c (region_limit): Simplify by using clip_to_bounds.
7960
383b7c95
JD
79612012-07-05 Jan Djärv <jan.h.d@swipnet.se>
7962
7963 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
7964 not defined (Bug#11768).
7965 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
7966 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
7967 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
7968 followed by gtk_box_set_homogeneous (Bug#11768).
7969 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
7970 (update_theme_scrollbar_width, xg_create_scroll_bar):
7971 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
7972 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
7973 (is_box_type): New function (Bug#11768).
7974 (xg_tool_item_stale_p): Call is_box_type.
5293d758 7975 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
7976 with default display (Bug#11768).
7977
d6e7bf45
EZ
79782012-07-05 Eli Zaretskii <eliz@gnu.org>
7979
7980 * xdisp.c (window_hscroll_limited): New function.
7981 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
7982 coordinates when window's hscroll is set to insanely large
7983 values. (Bug#11857)
7984
431391ec
JB
79852012-07-05 Juanma Barranquero <lekktu@gmail.com>
7986
7987 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
7988 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
7989
23f86fce
DA
79902012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
7991
7992 Cleanup xmalloc.
7993 * lisp.h (xzalloc): New prototype. Omit needless casts.
7994 * alloc.c (xzalloc): New function. Omit needless casts.
7995 * charset.c: Omit needless casts. Convert all calls to
7996 xmalloc with following memset to xzalloc.
7997 * dispnew.c: Likewise.
7998 * fringe.c: Likewise.
7999 * image.c: Likewise.
8000 * sound.c: Likewise.
8001 * term.c: Likewise.
8002 * w32fns.c: Likewise.
8003 * w32font.c: Likewise.
8004 * w32term.c: Likewise.
8005 * xfaces.c: Likewise.
8006 * xfns.c: Likewise.
8007 * xterm.c: Likewise.
8008 * atimer.c: Omit needless casts.
8009 * buffer.c: Likewise.
8010 * callproc.c: Likewise.
8011 * ccl.c: Likewise.
8012 * coding.c: Likewise.
8013 * composite.c: Likewise.
8014 * doc.c: Likewise.
8015 * doprnt.c: Likewise.
8016 * editfns.c: Likewise.
8017 * emacs.c: Likewise.
8018 * eval.c: Likewise.
8019 * filelock.c: Likewise.
8020 * fns.c: Likewise.
8021 * gtkutil.c: Likewise.
8022 * keyboard.c: Likewise.
8023 * lisp.h: Likewise.
8024 * lread.c: Likewise.
8025 * minibuf.c: Likewise.
8026 * msdos.c: Likewise.
8027 * print.c: Likewise.
8028 * process.c: Likewise.
8029 * region-cache.c: Likewise.
8030 * search.c: Likewise.
8031 * sysdep.c: Likewise.
8032 * termcap.c: Likewise.
8033 * terminal.c: Likewise.
8034 * tparam.c: Likewise.
8035 * w16select.c: Likewise.
8036 * w32.c: Likewise.
8037 * w32reg.c: Likewise.
8038 * w32select.c: Likewise.
8039 * w32uniscribe.c: Likewise.
8040 * widget.c: Likewise.
8041 * xdisp.c: Likewise.
8042 * xmenu.c: Likewise.
8043 * xrdb.c: Likewise.
8044 * xselect.c: Likewise.
8045
0497dc44
PE
80462012-07-05 Paul Eggert <eggert@cs.ucla.edu>
8047
8048 * fileio.c (time_error_value): Check the right error number.
8049 Problem reported by Troels Nielsen in
8050 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
8051
356e7178
PE
80522012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8053
4e71fd89
PE
8054 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
8055 This should be fixed in a better way; see Eli Zaretskii in
8056 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
8057 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
8058
f0941253
PE
8059 * fileio.c (time_error_value): Rename from special_mtime.
8060 The old name's problems were noted by Eli Zaretskii in
8061 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
8062
065c9eb4
PE
8063 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
8064 This variable's comment says Emacs needs at least one GDB-visible
8065 symbol of type enum pvec_type, to work around GDB problems.
8066 The symbol's value doesn't matter.
8067
356e7178
PE
8068 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
8069 that causes compilation to fail on pre-C99 compilers.
8070
ed9265fc 80712012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
8072
8073 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
8074 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
8075
3884d954
DA
80762012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8077
d209e2fb 8078 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
8079 headers for buffer_defaults and buffer_local_symbols.
8080 Reported by Juanma Barranquero <lekktu@gmail.com>.
8081
ee28be33
SM
80822012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8083
8084 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
8085 * lisp.h (enum pvec_type): Use fewer bits.
8086 (PSEUDOVECTOR_SIZE_BITS): New constant.
8087 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
8088 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
8089 change in pvec_type.
8090 (PSEUDOVECTOR_TYPEP): New macro.
8091 (TYPED_PSEUDOVECTORP): Use it.
8092 * fns.c (internal_equal): Adapt code to extract pvectype.
8093 * emacs.c (gdb_pvec_type): Update type.
8094 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
8095 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
8096 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
8097 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
8098 (sweep_vectors): Use it. Use local var `total_bytes' instead of
8099 abusing vector->header.next.nbytes.
8100 (live_vector_p): Use PVEC_TYPE.
8101 (mark_object): Adapt code to extract pvectype. Use switch.
8102
c7f2cd7f
PE
81032012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8104
8105 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
8106 Tighten new eassert a bit.
8107
8ce70ed2
DA
81082012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8109
8110 Fix compilation with --enable-gcc-warnings and -O1
8111 optimization level.
8112 * doprnt.c (doprnt): Change type of tem to int, initialize
8113 to avoid compiler warning. Add eassert.
8114 * search.c (simple_search): Initialize match_byte to avoid
8115 compiler warning. Add eassert.
8116
dea7f1e5
PE
81172012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8118
24a212eb
PE
8119 Avoid weird behavior with large horizontal scrolls.
8120 Without this change, for example, large hscroll values would
8121 mess up Emacs's display on Fedora 15 x86, presumably due to
8122 overflows in int calculations in the display code.
8123 Also, if buffers had long lines, Emacs would freeze.
8124 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
8125 (set_window_hscroll): New function, containing the old guts of
8126 Fset_window_hscroll. Return the clipped value.
8127 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
8128 This avoids the need to check against PTRDIFF_MAX.
8129
dea7f1e5
PE
8130 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
8131
76046526
DA
81322012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8133
8134 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
8135
39adff0d
PE
81362012-07-04 Paul Eggert <eggert@cs.ucla.edu>
8137
63807d47
PE
8138 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
8139 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
8140 since GCC 4.4.6 issues a bogus warning for them.
8141
39adff0d
PE
8142 Fix bugs in file timestamp newness comparisons.
8143 * fileio.c (Ffile_newer_than_file_p):
8144 * lread.c (Fload): Use full timestamp resolution of files,
8145 not just the 1-second resolution, so that files that are only
8146 slightly newer still count as newer.
8147 * fileio.c (Ffile_newer_than_file_p): Don't assume file
8148 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
8149
dbeed9a6
PE
81502012-07-03 Paul Eggert <eggert@cs.ucla.edu>
8151
8152 * fileio.c: Improve handling of file time marker. (Bug#11852)
8153 (special_mtime): New function.
8154 (Finsert_file_contents, Fverify_visited_file_modtime):
8155 Use it to set special mtime values consistently.
8156
636334d6
AS
81572012-07-03 Andreas Schwab <schwab@linux-m68k.org>
8158
8159 * fileio.c (Finsert_file_contents): Properly handle st_mtime
8160 marker for non-existing file. (Bug#11852)
8161
e2017fe2
GM
81622012-07-03 Glenn Morris <rgm@gnu.org>
8163
8164 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
8165 and did not make it into globals.h).
8166
404dbd37
TT
81672012-07-03 Tom Tromey <tromey@redhat.com>
8168
8169 * window.c (Fset_window_margins, Fset_window_fringes)
8170 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
8171 * textprop.c (Fprevious_property_change): No longer static.
8172 * syntax.c (Fsyntax_table_p): No longer static.
8173 * process.c (Fget_process, Fprocess_datagram_address): No longer
8174 static.
8175 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
8176 * keyboard.c (Fcommand_execute): No longer static.
8177 Remove EXFUN.
8178 * insdel.c (Fcombine_after_change_execute): No longer static.
8179 * image.c (Finit_image_library): No longer static.
8180 * fileio.c (Fmake_symbolic_link): No longer static.
8181 * eval.c (Ffetch_bytecode): No longer static.
8182 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
8183 * doc.c (Fdocumentation_property, Fsnarf_documentation):
8184 No longer static.
404dbd37
TT
8185 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
8186 static.
8187 * dired.c (Ffile_attributes): No longer static.
8188 * composite.c (Fcomposition_get_gstring): No longer static.
8189 * callproc.c (Fgetenv_internal): No longer static.
8190
8191 * ccl.h: Remove EXFUNs.
8192 * buffer.h: Remove EXFUNs.
8193 * dispextern.h: Remove EXFUNs.
8194 * intervals.h: Remove EXFUNs.
8195 * fontset.h: Remove EXFUN.
8196 * font.h: Remove EXFUNs.
8197 * dosfns.c (system_process_attributes): Remove EXFUN.
8198 * keymap.h: Remove EXFUNs.
8199 * lisp.h: Remove EXFUNs.
8200 * w32term.h: Remove EXFUNs.
8201 * window.h: Remove EXFUNs.
8202 * xsettings.h: Remove EXFUN.
8203 * xterm.h: Remove EXFUN.
8204
8e4fd1e1
GM
82052012-07-03 Glenn Morris <rgm@gnu.org>
8206
8207 * lisp.h (Frandom): Make it visible to C.
8208 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
8209 buffer for invisible buffers. (Bug#1229)
8210
ca95b3eb
DA
82112012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8212
8213 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
8214 values which aren't power of 2.
14ae4239 8215 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 8216 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
8217 accordingly.
8218
7555c33f
SM
82192012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
8220
8221 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
8222
8223 * alloc.c (mark_object): Revert part of last patch to use `switch'.
8224
d12e8f5a
DA
82252012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8226
8227 * alloc.c (allocate_vector_block): Remove redundant
8228 calls to mallopt if DOUG_LEA_MALLOC is defined.
8229 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
8230 avoid calls to mallopt if zero_vector is returned.
8231
296094c3
DA
82322012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8233
8234 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
8235 is enabled, avoid dereferencing NULL current_sblock if
8236 running undumped.
8237
36429c89
DA
82382012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
8239
8240 Cleanup basic buffer management.
8241 * buffer.h (struct buffer): Change layout to use generic vector
8242 marking code. Fix some comments. Change type of 'clip_changed'
8243 to bitfield. Remove unused #ifndef old.
8244 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
8245 (GET_OVERLAYS_AT): Fix indentation.
8246 (for_each_per_buffer_object_at): New macro.
8247 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
8248 (Fbuffer_local_variables): Use it.
8249 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
8250 * alloc.c (allocate_buffer): Adjust to match new layout of
8251 struct buffer. Fix comment.
8252 (mark_overlay): New function.
8253 (mark_buffer): Use it. Use mark_vectorlike to mark normal
8254 Lisp area of struct buffer.
8255 (mark_object): Use it. Adjust marking of misc objects
8256 and related comments.
8257
3b3e4cac
PE
82582012-07-02 Paul Eggert <eggert@cs.ucla.edu>
8259
8260 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
8261 wrapper that is not needed because the wrapped code is a no-op (zero
8262 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
8263 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
8264
cf5c0175
DA
82652012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
8266
8267 * alloc.c (mark_buffer): Simplify. Remove prototype.
8268 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 8269 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
8270 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
8271 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 8272
ca26824c
GM
82732012-06-30 Glenn Morris <rgm@gnu.org>
8274
2e4c5312
GM
8275 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
8276
ca26824c
GM
8277 * epaths.in (PATH_SITELOADSEARCH): New.
8278 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
8279 This is rather than relying on --enable-locallisppath elements
8280 having "site-lisp" in their names. (Bug#10208#25, 11658)
8281
0d23c240
EZ
82822012-06-30 Eli Zaretskii <eliz@gnu.org>
8283
c9240d7a
EZ
8284 * w32proc.c (sys_select): Accept and ignore one more argument.
8285
8286 * w32.c (emacs_gnutls_pull): Call select with one more argument.
8287
0d23c240 8288 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 8289 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
8290
8291 * sysdep.c: Don't include dos.h and dosfns.h.
8292
8293 * process.c (sys_select):
8294 * msdos.c (sys_select): Accept one more argument and ignore it.
8295
8296 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
8297 adapt data types and code to that.
8298
8299 * dosfns.c:
8300 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
8301 which clashes with the gnulib function of the same name.
8302
af5a5a98
AS
83032012-06-30 Andreas Schwab <schwab@linux-m68k.org>
8304
c5e4379c
AS
8305 * font.c (font_style_to_value, font_style_symbolic)
8306 (font_prop_validate_style): Add type checks for values in
8307 font_style_table.
8308
af5a5a98
AS
8309 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
8310 argument.
8311 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
8312 uses.
8313
8d38f461
EZ
83142012-06-29 Eli Zaretskii <eliz@gnu.org>
8315
2e5a6631
EZ
8316 * xdisp.c (try_window_id): Undo last change.
8317
8d38f461
EZ
8318 * w32.c (getwd): Adjust commentary about startup_dir.
8319 (init_environment): Always call sys_access, even in non-MSVC
8320 builds. Don't chdir to the directory of the Emacs executable.
8321 This undoes code from 1997 which was justified by the need to
8322 "avoid conflicts when removing and renaming directories". But its
8323 downside was that every relative file name was being interpreted
8324 relative to the directory of the Emacs executable, which can never
8325 be TRT. In particular, it broke sys_access when called with
8326 relative file names.
8327 (sys_access): Map GetLastError to errno.
8328
2af3565e
DA
83292012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8330
8331 * window.h (struct window): Change type of 'fringes_outside_margins'
8332 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 8333 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
8334 Adjust comment.
8335 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
8336 to ptrdiff_t.
8337
c8d3a25c 83382012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 8339
c8d3a25c
GM
8340 * gnutls.c (emacs_gnutls_handshake):
8341 Add QUIT to make the loop interruptible.
57570cd3 8342
c8d3a25c 83432012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 8344
c8d3a25c
GM
8345 * charset.c (init_charset): Make lack of etc/charsets fatal.
8346
3e984ee8
DA
83472012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8348
8349 * editfns.c (region_limit): Fix type mismatch.
8350
ef884f23
DA
83512012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
8352
8353 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
8354 undefined. Convert from xassert to eassert.
8355 * nsmenu.m: Convert from xassert to eassert.
8356 * nsterm.m: Likewise.
8357
7d7e0027
SM
83582012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
8359
8360 * editfns.c (region_limit): Clip to narrowing (bug#11770).
8361
aa754e6a
PE
83622012-06-28 Paul Eggert <eggert@cs.ucla.edu>
8363
8364 Avoid integer overflow on scroll-left and scroll-right.
8365 * window.c (HSCROLL_MAX): New macro.
8366 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
8367 overflow when requested scroll falls outside ptrdiff_t range.
8368
80b00b08
DA
83692012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8370
8371 * window.h (struct window): Change type of 'hscroll',
8372 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
8373 'last_modified' and 'last_overlay_modified' to EMACS_INT.
8374 Adjust users accordingly.
8375 * xdisp.c (try_cursor_movement): Replace type check with eassert.
8376 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
8377 from EMACS_INT to ptrdiff_t.
8378 (make_window): Omit redundant initialization.
8379
62b2bcf6
JB
83802012-06-28 Juanma Barranquero <lekktu@gmail.com>
8381
8382 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
8383
45942c7d
DA
83842012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8385
8386 * window.h (struct window): Change type of 'use_time' and
8387 'sequence_number' from Lisp_Object to int.
8388 * frame.c (make_frame): Adjust users accordingly.
8389 * print.c (print_object): Likewise.
8390 * window.c (select_window, Fwindow_use_time, make_parent_window)
8391 (make_window): Likewise.
8392
e509cfa6
DA
83932012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8394
8395 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
8396 enabled with --enable-checking=[all,glyphs] configure option.
8397 Fix GLYPH_DEBUG usage assuming that it may be undefined,
8398 adjust comments accordingly.
8399 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
8400 undefined, adjust comments accordingly.
8401 * image.c: Likewise.
8402 * scroll.c: Likewise.
8403 * w32fns.c: Likewise.
8404 * w32term.c: Likewise.
8405 * xdisp.c: Likewise.
8406 * xfaces.c: Likewise.
8407 * xfns.c: Likewise.
8408 * xterm.c: Likewise.
8409
a54e2c05
DA
84102012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
8411
8412 Generalize run-time debugging checks.
8413 * dispextern.h (XASSERTS): Remove.
8414 * fontset.c (xassert): Remove.
8415 Convert from xassert to eassert.
8416 * alloc.c: Convert from xassert to eassert.
8417 * bidi.c: Likewise.
8418 * dispnew.c: Likewise.
8419 * fns.c: Likewise.
8420 * fringe.c: Likewise.
8421 * ftfont.c: Likewise.
8422 * gtkutil.c: Likewise.
8423 * image.c: Likewise.
8424 * keyboard.c: Likewise.
8425 * menu.c: Likewise.
8426 * process.c: Likewise.
8427 * scroll.c: Likewise.
8428 * sound.c: Likewise.
8429 * term.c: Likewise.
8430 * w32console.c: Likewise.
8431 * w32fns.c: Likewise.
8432 * w32term.c: Likewise.
8433 * window.c: Likewise.
8434 * xdisp.c: Likewise.
8435 * xfaces.c: Likewise.
8436 * xfns.c: Likewise.
8437 * xselect.c: Likewise.
8438 * xterm.c: Likewise.
8439
1ec4b7b2
SM
84402012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
8441
8442 * fns.c (maybe_resize_hash_table): Output message when growing the
8443 purify-hashtable.
8444
2014308a
DA
84452012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8446
8447 * alloc.c (allocate_string_data): Remove dead code.
8448 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
8449 avoid GCC warning about unused macro.
8450
246155eb
DA
84512012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8452
8453 * alloc.c (allocate_string): Omit intervals initialization.
8454 * alloc.c (make_uninit_multibyte_string): Initialize intervals
8455 as in make_pure_string and make_pure_c_string.
8456
43184b7b
DA
84572012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8458
d209e2fb 8459 * alloc.c (allocate_string): Fix last change.
43184b7b 8460
3fe6dd74
DA
84612012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8462
d209e2fb 8463 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
8464 to memset, add explicit initialization where appropriate.
8465
1ba6038a
GM
84662012-06-27 Glenn Morris <rgm@gnu.org>
8467
8468 * lisp.mk (lisp): Remove paths.elc.
8469
c89926a5
CY
84702012-06-27 Chong Yidong <cyd@gnu.org>
8471
8472 * doc.c (Fsubstitute_command_keys): Fix punctuation.
8473
ed6b3510
JW
84742012-06-26 John Wiegley <johnw@newartisans.com>
8475
1ec4b7b2 8476 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
8477 on Mac OS X Lion: __mod_init_func and __mod_term_func.
8478
ed6b3510
JW
8479 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
8480 when building with Clang.
8481
8edd4a2b
SM
84822012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
8483
8484 * eval.c (Fapply): Allow calling it with a single argument.
8485
f6f62d1b
EZ
84862012-06-26 Eli Zaretskii <eliz@gnu.org>
8487
8488 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8489 _stricmp and _strnicmp.
8490 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
8491
62efea5e
DA
84922012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8493
8494 * alloc.c (allocate_window): Zero out non-Lisp part of newly
8495 allocated window.
8496 (allocate_process): Likewise for new process.
8edd4a2b 8497 (allocate_terminal): Change to use offsetof.
62efea5e
DA
8498 (allocate_frame): Likewise.
8499 * frame.c (make_frame): Omit redundant initialization.
8500 * window.c (make_parent_window): Use memset.
8501 (make_window): Omit redundant initialization.
8502 * process.c (make_process): Omit redundant initialization.
8503 * terminal.c (create_terminal): Likewise.
8504
42997f4d
DA
85052012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8506
8507 * term.c (delete_tty): Remove redundant call to memset.
8508
1130ecfc
DA
85092012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
8510
8511 * alloc.c: Remove build_string.
8512 * lisp.h: Define build_string as static inline. This provides
8513 a better opportunity to optimize away calls to strlen when the
8514 function is called with compile-time constant argument.
8515 * image.c (imagemagick_error): Convert to build_string.
8516 * w32proc.c (sys_spawnve): Likewise.
8517 * xterm.c (x_term_init): Likewise.
8518
cf38a720
PE
85192012-06-26 Paul Eggert <eggert@cs.ucla.edu>
8520
99027bdd
PE
8521 Use sprintf return value instead of invoking strlen on result.
8522 In the old days this wasn't portable, since some sprintf
8523 implementations returned char *. But they died out years ago and
8524 Emacs already assumes sprintf returns int.
8525 Similarly for float_to_string.
8526 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
8527 * ccl.c (ccl_driver):
8528 * character.c (string_escape_byte8):
8529 * data.c (Fnumber_to_string):
8530 * doprnt.c (doprnt):
8531 * print.c (print_object):
8532 * xdisp.c (message_dolog):
8533 * xfns.c (syms_of_xfns):
8534 Use sprintf or float_to_string result to avoid need to call strlen.
8535 * data.c (Fnumber_to_string):
8536 Use make_unibyte_string, since the string must be ASCII.
8537 * lisp.h, print.c (float_to_string): Now returns int length.
8538 * term.c (produce_glyphless_glyph):
8539 Use sprintf result rather than recomputing it.
8540
cf38a720
PE
8541 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
8542 * Makefile.in (ALL_CFLAGS):
8543 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
8544 * gmalloc.c, regex.c: Include <config.h> unconditionally.
8545
3511c784
DA
85462012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8547
0a08eb21 8548 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
8549 strcasecmp if available.
8550 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
8551
fb7da12e
AS
85522012-06-25 Andreas Schwab <schwab@linux-m68k.org>
8553
8554 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
8555 Avoid comma operator.
8556 * menu.c (push_submenu_start, push_submenu_end)
8557 (push_left_right_boundary, push_menu_pane): Likewise.
8558 * msdos.c (dos_rawgetc): Likewise.
8559
afa2ffd8
DA
85602012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8561
8562 * xfns.c (xic_create_fontsetname): Remove redundant calls
8563 to memset.
8564
b3b4476b
PE
85652012-06-25 Paul Eggert <eggert@cs.ucla.edu>
8566
4495ff38
PE
8567 * gtkutil.c (get_utf8_string): Remove redundant assignment.
8568 sprintf already null-terminates its output.
8569
b3b4476b
PE
8570 * xfns.c (x_window): Remove redundant cast.
8571
b00876c9
DA
85722012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
8573
8574 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
8575 `const char *' to `char *' to avoid compiler warning.
8576
d188e26b
PE
85772012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8578
885d1d74
PE
8579 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
8580 instead of truncating it to 63 (admittedly a generous limit).
8581
d188e26b
PE
8582 * process.c: Fix spelling and caps in comments.
8583
e2f560b1
DN
85842012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
8585
e86db54b 8586 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
8587 * sysdep.c (setpgrp): Remove definition, not used in this file.
8588
7583a3a1
JB
85892012-06-24 Juanma Barranquero <lekktu@gmail.com>
8590
8591 * makefile.w32-in: Update dependencies.
8592
696056c2
EZ
85932012-06-24 Eli Zaretskii <eliz@gnu.org>
8594
8595 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
8596 (SYSTIME_H): Add nt/inc/sys/time.h.
8597
8598 * systime.h [WINDOWSNT]: Include sys/time.h.
8599
8600 * s/ms-w32.h (struct timespec): Definition moved from
8601 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
8602
845ca893
PE
86032012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8604
8605 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
8606 * buffer.h (buffer_slot_type_mismatch):
8607 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8608 * eval.c (unwind_to_catch):
8609 * image.c (my_png_error, my_error_exit):
8610 * keyboard.c (quit_throw_to_read_char, user_error)
8611 (Fexit_recursive_edit, Fabort_recursive_edit):
8612 * lisp.h (die, args_out_of_range, args_out_of_range_3)
8613 (wrong_type_argument, buffer_overflow, __executable_start)
8614 (memory_full, buffer_memory_full, string_overflow, Fthrow)
8615 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
8616 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
8617 (fatal):
8618 (child_setup) [!DOS_NT]:
8619 * lread.c (end_of_file_error, invalid_syntax):
8620 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
8621 * puresize.h (pure_write_error):
8622 * search.c (matcher_overflow):
8623 * sound.c (sound_perror, alsa_sound_perror):
8624 * sysdep.c, syssignal.h (croak):
8625 * term.c (maybe_fatal, vfatal):
8626 * textprop.c (text_read_only):
8627 * undo.c (user_error):
8628 * unexmacosx.c (unexec_error):
8629 * xterm.c (x_ins_del_lines, x_delete_glyphs):
8630 Use _Noreturn rather than NO_RETURN.
8631 No need for separate decl merely because of _Noreturn.
8632 * sound.c (sound_warning, parse_sound):
8633 Remove unnecessary forward decls.
8634
f1dd8073
PE
86352012-06-24 Paul Eggert <eggert@cs.ucla.edu>
8636
8637 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
8638 * lisp.h (WAIT_READING_MAX): New macro.
8639 * dispnew.c (Fsleep_for, sit_for):
8640 * keyboard.c (kbd_buffer_get_event):
8641 * process.c (Faccept_process_output):
8642 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
8643 This improves on the previous patch, which introduced a bug
8644 when time_t is unsigned and as wide as intmax_t.
8645 See <http://bugs.gnu.org/9000#51>.
8646
b82c1755
EZ
86472012-06-23 Eli Zaretskii <eliz@gnu.org>
8648
8649 * dispnew.c (sit_for, Fsleep_for):
8650 * keyboard.c (kbd_buffer_get_event):
8651 * process.c (Faccept_process_output): Avoid compiler warnings when
8652 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
8653
ca300656
JB
86542012-06-23 Juanma Barranquero <lekktu@gmail.com>
8655
049ec95b
JB
8656 * makefile.w32-in: Update dependencies.
8657
ca300656
JB
8658 * w32.c (ltime): Add return type and declare static.
8659 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
8660
db7b8d06
PE
86612012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8662
8663 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
8664 Privately reported by Herbert J. Skuhra.
8665 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
8666 All uses changed.
8667 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
8668 not make_lisp_timeval, when the argument is of type EMACS_TIME.
8669
0bd8297f
EZ
86702012-06-23 Eli Zaretskii <eliz@gnu.org>
8671
96512555
EZ
8672 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
8673 last argument of make_unibyte_string.
8674
0bd8297f
EZ
8675 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
8676 language ID in the event parameters.
8677
8678 * w32term.c (w32_read_socket): Put the new keyboard codepage into
8679 event.code, not the obscure "character set ID".
8680
63def6b6
CY
86812012-06-23 Chong Yidong <cyd@gnu.org>
8682
8683 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
8684
e8a02204
EZ
86852012-06-23 Eli Zaretskii <eliz@gnu.org>
8686
388cdec0
EZ
8687 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
8688 * w32.c (fdutimens): New function.
8689
8690 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
8691
8692 * s/ms-w32.h (pselect): Redirect to sys_select.
8693
8694 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
8695
e8a02204
EZ
8696 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
8697 in the logic of incrementing and decrementing the value of
8698 use_relocatable_buffers.
8699
d054f3fb
PE
87002012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8701
8702 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
8703 Privately reported by Herbert J. Skuhra.
8704 [__FreeBSD__]: Remove "*/" typo after "#include".
8705 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
8706 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
8707 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
8708 Don't assume EMACS_TIME and struct timeval are the same type.
8709
d35af63c
PE
87102012-06-22 Paul Eggert <eggert@cs.ucla.edu>
8711
8712 Support higher-resolution time stamps (Bug#9000).
8713 The time stamps are only nanosecond-resolution at the C level,
8714 since that's the best that any real-world system supports now.
8715 But they are picosecond-resolution at the Lisp level, as that's
8716 easy, and leaves room for future OS improvements.
8717
8718 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
8719 (LIBES): Use it.
8720
8721 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
8722 Don't get current time unless it's needed.
8723
8724 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
8725 now provides it if it's absent.
8726 (start_atimer): Port to higher-res time stamps.
8727 Check for time stamp overflow. Don't get current time more
8728 often than is needed.
8729
8730 * buffer.h (struct buffer): Buffer modtime now has high resolution.
8731 Include systime.h, not time.h.
8732 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
8733
8734 * dired.c: Include stat-time.h.
8735 (Ffile-attributes): File times now have higher resolution.
8736
8737 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
8738 (struct image): Timestamp now has higher resolution.
8739
8740 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
8741 has at least microseconds now. All uses removed.
8742 (update_frame, update_single_window, update_window, update_frame_1)
8743 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 8744 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
8745
8746 * editfns.c (time_overflow): Now extern.
8747 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
8748 (float-time, Fformat_time_string, Fcurrent_time_string)
8749 (Fcurrent_time_zone): Accept and generate higher-resolution
8750 time stamps.
8751 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
8752 (decode_time_components, lisp_seconds_argument): New functions.
8753 (make_time): Now static.
8754 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
8755 Report an error if the time is invalid, rather than having the caller
8756 do that.
8757
8758 * fileio.c: Include <stat-time.h>
8759 (Fcopy_file): Copy higher-resolution time stamps.
8760 Prefer to set the time stamp via a file descriptor if that works.
8761 (Fset_file_times, Finsert_file_contents, Fwrite_region)
8762 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
8763 (Fvisited_file_modtime, Fset_visited_file_modtime):
8764 Support higher-resolution time stamps.
8765
8766 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
8767
8768 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
8769
8770 * image.c (prepare_image_for_display, clear_image_cache)
8771 (lookup_image): Port to higer-resolution time stamps.
8772
8773 * keyboard.c (start_polling, bind_polling_period):
8774 Check for time stamp overflow.
8775 (read_char, kbd_buffer_get_event, timer_start_idle)
8776 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
8777 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
8778 Port to higher-resolution time stamps. Do not assume time_t is signed.
8779 (decode_timer): New function. Timers are now vectors of length 9,
8780 not 8, to accommodate the picosecond component.
8781 (timer_check_2): Use it.
8782
8783 * nsterm.m (select_timeout, timeval_subtract): Remove.
8784 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
8785 as they're a bit more accurate and handle overflow better.
8786 (ns_select): Change prototype to be compatible with pselect.
8787 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
8788 * nsterm.h (ns_select): Adjust prototype.
8789
8790 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
8791 us-resolution time stamps.
8792 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
8793
8794 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
8795
8796 * lisp.h (time_overflow): New decl.
8797 (wait_reading_process_output): First arg is now intmax_t, not int,
8798 to accommodate larger waits.
8799
8800 * process.h (struct Lisp_Process.read_output_delay):
8801 Now counts nanoseconds, not microseconds.
8802 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
8803 EMACS_HAS_USECS.
8804 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
8805 (wait_reading_process_output):
8806 Port to ns-resolution time stamps.
8807 (Faccept_process_output, wait_reading_process_output):
8808 Check for time stamp overflow. Do not assume time_t is signed.
8809 (select_wrapper): Remove; we now use pselect.
8810 (Fprocess_attributes): Now generates ns-resolution time stamps.
8811
8812 * sysdep.c: Include utimens.h. Don't include utime.h
8813 or worry about struct utimbuf; gnulib does that for us now.
8814 (gettimeofday): Remove; gnulib provides a substitute.
8815 (make_timeval): New function.
8816 (set_file_times): Now sets ns-resolution time stamps.
8817 New arg FD; all uses changed.
8818 (time_from_jiffies, ltime_from_jiffies, get_up_time)
8819 (system_process_attributes):
8820 Now returns ns-resolution time stamp. All uses changed.
8821 Check for time stamp overflow.
8822
8823 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
8824 provides a substitute now.
8825
8826 * systime.h: Include timespec.h rather than sys/time.h and time.h,
8827 since it guarantees struct timespec.
8828 (EMACS_TIME): Now struct timespec, so that we can support
8829 ns-resolution time stamps.
8830 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
8831 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
8832 (EMACS_USECS): Remove.
8833 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
8834 so multiply the arg by 1000 before storing it.
8835 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
8836 New macros.
8837 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
8838 Port to ns-resolution time stamps.
8839 (EMACS_TIME_NEG_P): Remove; replaced by....
8840 (EMACS_TIME_SIGN): New macro.
8841 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
8842 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
8843 (set_file_times, make_time, lisp_time_argument): Adjust signature.
8844 (make_timeval, make_lisp_time, decode_time_components): New decls.
8845 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
8846 that it mishandled time_t overflow. You can't compare by subtracting!
8847 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
8848 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
8849
8850 * term.c: Include <sys/time.h>.
8851 (timeval_to_Time): New function, for proper overflow wraparound.
8852 (term_mouse_position, term_mouse_click): Use it.
8853
8854 * undo.c (record_first_change): Support higher-resolution time stamps
8855 in the undo buffer.
8856 (Fprimitive_undo): Use them when restoring time stamps.
8857
8858 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
8859 (w32_get_internal_run_time):
8860 Port to higher-resolution Emacs time stamps.
8861 (ltime): Now accepts single 64-bit integer, as that's more convenient
8862 for callers.
8863
8864 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
8865
8866 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
8867 for compatibility with pselect. Support ns-resolution time stamps.
8868
8869 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
8870
8871 * xselect.c (wait_for_property_change, x_get_foreign_selection):
8872 Check for time stamp overflow, and support ns-resolution time stamps.
8873
8874 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
8875 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
8876 (timeval_subtract): Remove; no longer needed.
8877 (XTflash, XTring_bell, x_wait_for_event):
8878 Port to ns-resolution time stamps. Don't assume time_t is signed.
8879
b6a92dfe
CY
88802012-06-22 Chong Yidong <cyd@gnu.org>
8881
8882 * xdisp.c (x_consider_frame_title): Revert last change.
8883
d251c37c
EZ
88842012-06-22 Eli Zaretskii <eliz@gnu.org>
8885
8886 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
8887 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
8888 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
8889 staticidx goes up to 1597 out of 1600 = 0x640.)
8890
f10deafb
PE
88912012-06-20 Paul Eggert <eggert@cs.ucla.edu>
8892
8893 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
8894 Otherwise, the umask might be mistakenly 0 while handling input signals.
8895
ec6de1e2
SM
88962012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
8897
8898 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
8899
28be1ada
DA
89002012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
8901
8902 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
8903 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
8904 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
8905 access to `contents' member of Lisp_Vector objects with AREF and ASET
8906 where appropriate.
8907
c6bf3022
CY
89082012-06-19 Chong Yidong <cyd@gnu.org>
8909
8910 * frame.c (delete_frame): When selecting a frame on a different
8911 text terminal, do not alter the terminal's top-frame.
8912
8913 * xdisp.c (format_mode_line_unwind_data): Record the target
8914 frame's selected window and its terminal's top-frame.
8915 (unwind_format_mode_line): Restore them.
8916 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
8917 Callers changed.
8918 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
8919 since tty frames can be explicitly named.
8920 (prepare_menu_bars): Likewise.
8921
8922 * term.c (Ftty_top_frame): New function.
8923
defd4196
PE
89242012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8925
8926 Port byte-code-meter to modern targets.
8927 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
8928 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 8929 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
8930 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
8931 (METER_1, METER_2): Simplify.
8932
1053a871
SM
89332012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
8934
8935 * data.c (Fdefalias): Return `symbol' (bug#11686).
8936
b7e8d081
MR
89372012-06-18 Martin Rudalics <rudalics@gmx.at>
8938
8939 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
8940 gets killed during executing of this function (Bug#11665).
8941 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
8942 (Vkill_buffer_query_functions): In doc-string say that functions
8943 run by this hook should not change the current buffer.
8944
7ea2b339
PE
89452012-06-18 Paul Eggert <eggert@cs.ucla.edu>
8946
8947 Fix recently-introduced process.c problems found by static checking.
8948 * process.c (write_queue_push, write_queue_pop, send_process):
8949 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
8950 (write_queue_pop): Fix pointer signedness problem.
8951 (send_process): Remove unused local.
8952
96a313a1
CY
89532012-06-17 Chong Yidong <cyd@gnu.org>
8954
8955 * xdisp.c (redisplay_internal): No need to redisplay terminal
8956 frames that are not on top.
8957
20ca2e94
TN
89582012-06-17 Troels Nielsen <bn.troels@gmail.com>
8959
8960 * process.c (make_process): Initialize write_queue.
8961 (write_queue_push, write_queue_pop): New functions.
8962 (send_process): Use them to maintain correct ordering of process
8963 writes (Bug#10815).
8964
9a900ca9
PE
89652012-06-17 Paul Eggert <eggert@cs.ucla.edu>
8966
310fbfa8
PE
8967 * lisp.h (eassert): Assume C89 or later.
8968 This removes the need for CHECK.
8969 (CHECK): Remove. Its comments about always evaluating its
8970 argument were confusing, as 'eassert' typically does not evaluate
8971 its argument.
8972
27bb1ca4
PE
8973 * coding.c (produce_chars): Use ptrdiff_t, not int.
8974
9a900ca9
PE
8975 * xterm.c (x_draw_underwave): Check for integer overflow.
8976 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
8977
41b7f8bc 89782012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
8979
8980 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
8981 referenced (Bug#11583).
8982
9b0e3eba
AA
89832012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
8984
8985 Implement wave-style variant of underlining.
8986 * dispextern.h (face_underline_type): New enum.
8987 (face): Add field for underline type.
8988 * nsterm.m (ns_draw_underwave): New function.
8989 (ns_draw_text_decoration): Use it.
8990 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
8991 New functions.
8992 (x_draw_glyph_string): Use them.
8993 * xfaces.c (Qline, Qwave): New Lisp objects.
8994 (check_lface_attrs, merge_face_ref)
1053a871
SM
8995 (Finternal_set_lisp_face_attribute, realize_x_face):
8996 Handle wave-style underline face attributes.
9b0e3eba
AA
8997 * xterm.c (x_draw_underwave): New function.
8998 (x_draw_glyph_string): Use it.
8999
0fb52f11
JB
90002012-06-16 Juanma Barranquero <lekktu@gmail.com>
9001
9002 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
9003 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
9004 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
9005 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
9006 ($(BLD)/w32select.$(O)): Update dependencies.
9007
e5560ff7
AS
90082012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9009
9010 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
9011 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
9012 * character.c (_fetch_multibyte_char_p): Remove.
9013 * alloc.c: Include "character.h" before "buffer.h".
9014 * bidi.c: Likewise.
9015 * buffer.c: Likewise.
9016 * bytecode.c: Likewise.
9017 * callint.c: Likewise.
9018 * callproc.c: Likewise.
9019 * casefiddle.c: Likewise.
9020 * casetab.c: Likewise.
9021 * category.c: Likewise.
9022 * cmds.c: Likewise.
9023 * coding.c: Likewise.
9024 * composite.c: Likewise.
9025 * dired.c: Likewise.
9026 * dispnew.c: Likewise.
9027 * doc.c: Likewise.
9028 * dosfns.c: Likewise.
9029 * editfns.c: Likewise.
9030 * emacs.c: Likewise.
9031 * fileio.c: Likewise.
9032 * filelock.c: Likewise.
9033 * font.c: Likewise.
9034 * fontset.c: Likewise.
9035 * fringe.c: Likewise.
9036 * indent.c: Likewise.
9037 * insdel.c: Likewise.
9038 * intervals.c: Likewise.
9039 * keyboard.c: Likewise.
9040 * keymap.c: Likewise.
9041 * lread.c: Likewise.
9042 * macros.c: Likewise.
9043 * marker.c: Likewise.
9044 * minibuf.c: Likewise.
9045 * nsfns.m: Likewise.
9046 * nsmenu.m: Likewise.
9047 * print.c: Likewise.
9048 * process.c: Likewise.
9049 * regex.c: Likewise.
9050 * region-cache.c: Likewise.
9051 * search.c: Likewise.
9052 * syntax.c: Likewise.
9053 * term.c: Likewise.
9054 * textprop.c: Likewise.
9055 * undo.c: Likewise.
9056 * unexsol.c: Likewise.
9057 * w16select.c: Likewise.
9058 * w32fns.c: Likewise.
9059 * w32menu.c: Likewise.
9060 * window.c: Likewise.
9061 * xdisp.c: Likewise.
9062 * xfns.c: Likewise.
9063 * xmenu.c: Likewise.
9064 * xml.c: Likewise.
9065 * xselect.c: Likewise.
9066
2f07e6af
EZ
90672012-06-16 Eli Zaretskii <eliz@gnu.org>
9068
1053a871
SM
9069 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
9070 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 9071 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
9072 row.
9073 (handle_face_prop): Use chunk-relative overlay string index when
9074 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
9075 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
9076 the rightmost. (Bug#11720)
2f07e6af 9077
29b83cec
AS
90782012-06-16 Andreas Schwab <schwab@linux-m68k.org>
9079
9080 * category.h (CHAR_HAS_CATEGORY): Define as inline.
9081 (CATEGORY_MEMBER): Enforce 1/0 value.
9082 * category.c (_temp_category_set): Remove.
9083
4c5501e9
EZ
90842012-06-16 Eli Zaretskii <eliz@gnu.org>
9085
9086 * window.c (Fdelete_other_windows_internal)
9087 (Fdelete_window_internal): Don't access frame's mouse highlight
9088 info of the initial frame. (Bug#11677)
9089
2b570124
PE
90902012-06-14 Paul Eggert <eggert@cs.ucla.edu>
9091
e93864f9
PE
9092 * .gdbinit (xgetint): Fix recently-introduced paren typo.
9093 Assume USE_2_TAGS_FOR_INTS.
9094 (xreload): Adjust $tagmask width to match recent lisp.h change.
9095
2b570124
PE
9096 Simplify lisp.h in minor ways that should not affect code.
9097 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
9098 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
9099 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
9100 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
9101 (INTTYPEBITS): New macro, for clarity.
9102 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
9103 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
9104 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
9105 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
9106 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
9107
81755f69
JB
91082012-06-13 Juanma Barranquero <lekktu@gmail.com>
9109
9110 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
9111
16192a57
GM
91122012-06-13 Glenn Morris <rgm@gnu.org>
9113
9114 * s/bsd-common.h (BSD4_3):
9115 * s/usg5-4-common.h (USG5_4): No longer define; unused.
9116
646b5f55
AS
91172012-06-13 Andreas Schwab <schwab@linux-m68k.org>
9118
9119 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
9120 instead of union.
9121 (XLI, XIL): Define.
1053a871
SM
9122 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
9123 Use them.
9124 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 9125 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 9126 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
9127 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
9128 * frame.c (delete_frame): Remove outdated comment.
9129 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
9130 USE_LISP_UNION_TYPE.
9131 (Fw32_unregister_hot_key): Likewise.
9132 (Fw32_toggle_lock_key): Likewise.
9133 * w32menu.c (add_menu_item): Likewise.
9134 (w32_menu_display_help): Use XIL instead of checking
9135 USE_LISP_UNION_TYPE.
9136 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
9137 (init_heap): Likewise.
9138 * w32term.c (w32_read_socket): Update comment.
9139
1d3823c9
GM
91402012-06-13 Glenn Morris <rgm@gnu.org>
9141
c62ff706
GM
9142 * s/usg5-4-common.h, src/s/unixware.h:
9143 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
9144
1d3823c9
GM
9145 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
9146
bfe3e0a2
PE
91472012-06-13 Paul Eggert <eggert@cs.ucla.edu>
9148
9149 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
9150 * alloc.c (make_number) [!defined make_number]:
9151 Remove, as lisp.h always defines this now.
9152 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
9153 (roundup_size): Verify that it is a power of 2.
9154 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
9155 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
9156 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
9157 -DUSE_LSB_TAG=0, to override the automatically-selected default.
9158 USE_LSB_TAG now is always defined to be either 0 or 1.
9159 All uses changed.
9160 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
9161 code works fine either way, and efficiency is not a concern here,
9162 as the union type is for debugging, not for production.
9163 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
9164 Use an inline function on all platforms when using the union type,
9165 since this is simpler and 'static inline' can be used portably
9166 within Emacs now.
9167 (LISP_INITIALLY_ZERO): New macro.
9168 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
9169 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
9170
45fa9c0f
GM
91712012-06-12 Glenn Morris <rgm@gnu.org>
9172
b4492cba
GM
9173 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
9174
9175 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 9176
45fa9c0f
GM
9177 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
9178 Move BROKEN_SIGIO to configure.
9179
9180 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
9181 Move NO_TERMIO to configure.
9182
0e25d334
CY
91832012-06-12 Chong Yidong <cyd@gnu.org>
9184
9185 * image.c (imagemagick_load_image): Use MagickFlattenImage if
9186 MagickMergeImageLayers is undefined. Use pixel pusher loop if
9187 MagickExportImagePixels is undefined.
9188
43682bb6
PE
91892012-06-12 Paul Eggert <eggert@cs.ucla.edu>
9190
9191 * image.c (imagemagick_load_image): Remove unused label.
9192
a9be7d2b
GM
91932012-06-11 Glenn Morris <rgm@gnu.org>
9194
9195 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9196 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
9197 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
9198 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
9199
3017f87f
SM
92002012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
9201
9202 * alloc.c (make_byte_code): New function.
9203 (Fmake_byte_code): Use it. Don't purify here.
9204 * lread.c (read1): Use it as well to avoid extra allocation.
9205
1b9b4cf4
CY
92062012-06-11 Chong Yidong <cyd@gnu.org>
9207
9208 * image.c (imagemagick_load_image): Implement transparency.
9209
95988fcf
AS
92102012-06-10 Andreas Schwab <schwab@linux-m68k.org>
9211
9212 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
9213 account for preceding backslashes. (Bug#11663)
9214
cd4eb164
CY
92152012-06-09 Chong Yidong <cyd@gnu.org>
9216
9217 * term.c: Support italics in capable terminals (Bug#9652).
9218 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
9219 (turn_on_face): Output using TS_enter_italic_mode if available.
9220 Don't handle unused blinking and alt-charset cases.
9221 (turn_off_face): Handle italic case; discard unused tty_blinking_p
9222 and tty_alt_charset_p cases.
9223 (tty_capable_p, init_tty): Support italics.
9224
9225 * termchar.h (struct tty_display_info): Add field for italics.
9226 Remove unused blink field.
9227
9228 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
9229 Handle slant.
9230
9231 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
9232 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
9233 tty_alt_charset_p. Add tty_italic_p.
9234
ff88beb8
MA
92352012-06-09 Michael Albinus <michael.albinus@gmx.de>
9236
9237 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
9238 dbus_type_is_basic if available.
9239 (xd_extract_signed, xd_extract_unsigned): Rename from
9240 extract_signed and extract_unsigned, respectively. Adapt callers.
9241
44286096
CY
92422012-06-09 Chong Yidong <cyd@gnu.org>
9243
1682701f
CY
9244 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
9245
44286096
CY
9246 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
9247 case (Bug#9752).
9248
d86feb17
PE
92492012-06-08 Paul Eggert <eggert@cs.ucla.edu>
9250
9251 * xdisp.c (vmessage): Treat frame message as multibyte.
9252 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
9253 would generate the diagnostic "Making \302\247 buffer-local while
9254 let-bound!".
9255
d5c20fe8
EZ
92562012-06-08 Eli Zaretskii <eliz@gnu.org>
9257
9258 * dispnew.c (showing_window_margins_p): Undo last change, which
9259 was done due to an inadvertent commit.
9260 (adjust_frame_glyphs_for_frame_redisplay): Do call
9261 showing_window_margins_p.
9262
513749ee
SM
92632012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9264
9265 * eval.c (Fmake_var_non_special): New primitive.
9266 (syms_of_eval): Defsubr it.
9267 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
9268
d4a8f5c1
JB
92692012-06-08 Juanma Barranquero <lekktu@gmail.com>
9270
9271 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
9272 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
9273
8bbbc977
EZ
92742012-06-08 Eli Zaretskii <eliz@gnu.org>
9275
9276 * alloc.c (allocate_vectorlike): Fix last change.
9277
f3372c87
DA
92782012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
9279
9280 Block-based vector allocation of small vectors.
9281 * lisp.h (struct vectorlike_header): New field `nbytes',
9282 adjust comment accordingly.
9283 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 9284 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
9285 mark_maybe_pointer, valid_lisp_object_p) accordingly.
9286 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
9287 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
9288 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
9289 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
9290 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
9291 (roundup_size): New constant.
9292 (struct vector_block): New data type.
9293 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 9294 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
9295 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
9296 (sweep_vectors): New functions.
9297 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 9298 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
9299 or equal to VBLOCK_BYTES_MAX.
9300 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
9301 (init_alloc_once): Add call to init_vectors.
9302
4f18a4ed
SM
93032012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
9304
9305 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
9306
86f158bc
PE
93072012-06-07 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 * doprnt.c (doprnt): Truncate multibyte char correctly.
9310 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
9311 would mishandle a string argument "Xc" if X was a multibyte
9312 character of length 2: it would truncate after X's first byte
9313 rather than including all of X.
9314
c5cfcbe0
CY
93152012-06-06 Chong Yidong <cyd@gnu.org>
9316
9317 * buffer.c (word_wrap): Doc fix.
9318
c05cf390
PE
93192012-06-04 Paul Eggert <eggert@cs.ucla.edu>
9320
9321 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
9322
0c3461de
GM
93232012-06-03 Glenn Morris <rgm@gnu.org>
9324
9325 * xdisp.c (tool-bar-style): Doc fix.
9326
c71232db
UM
93272012-06-03 Ulrich Müller <ulm@gentoo.org>
9328
9329 * Makefile.in (PAXCTL): Define.
9330 (temacs$(EXEEXT)): Disable memory randomization for the temacs
9331 binary via PaX flags if the paxctl utility is available.
9332 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
9333 Restore PaX flags to their default. (Bug#11398)
9334
383f7350
CY
93352012-06-03 Chong Yidong <cyd@gnu.org>
9336
9337 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
9338 buffer (Bug#11226).
9339
5f2c76c6
CY
93402012-06-03 Chong Yidong <cyd@gnu.org>
9341
9342 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
9343 (note_mode_line_or_margin_highlight): If there is no help echo,
9344 use mode-line-default-help-echo. Handle the case where the mouse
9345 position is past the end of the mode line string.
9346
9347 * buffer.c (buffer_local_value_1): New function, split from
9348 Fbuffer_local_value; can return Qunbound.
9349 (Fbuffer_local_value): Use it.
9350 (Vmode_line_format): Docstring tweaks.
9351
773d47f6
PE
93522012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9353
9354 * sysdep.c (system_process_attributes): Improve comment.
9355
f2d6a3df
SM
93562012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
9357
9358 * keyboard.c: Export real-this-command to Elisp.
9359 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
9360 and DEFVAR it. Update all users.
9361
63810350
PE
93622012-06-02 Paul Eggert <eggert@cs.ucla.edu>
9363
7bd5c1f4
PE
9364 * minibuf.c (Fassoc_string): Remove duplicate declaration.
9365
63810350
PE
9366 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
9367 Convert pctcpu and pctmem to Lisp float properly.
9368 Let the compiler fold better, as 100.0/0x8000 is exact.
9369
a2821611
AS
93702012-06-02 Andreas Schwab <schwab@linux-m68k.org>
9371
9372 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
9373 cons_block.
9374
5fceba1d
PE
93752012-06-01 Paul Eggert <eggert@cs.ucla.edu>
9376
9377 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
9378
c98ff5dd
DA
93792012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
9380
9381 For a 'struct window', replace some Lisp_Object fields to
9382 bitfields where appropriate, remove unused fields.
9383 * window.h (struct window): Remove unused 'last_mark_x' and
9384 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 9385 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
9386 Change type of 'force_start', 'optional_new_start',
9387 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 9388 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 9389
ca34e0be
PE
93902012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9391
9392 Pacify gcc -Wdouble-precision when using Xaw.
9393 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
9394 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
9395 Use 'float' consistently, rather than 'float' in most places
9396 and 'double' in a couple of places.
9397
efc00ab1 93982012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
9399
9400 * xdisp.c (handle_stop): Detect whether we have overlay strings
9401 loaded by testing it->current.overlay_string_index to be
9402 non-negative, instead of checking whether n_overlay_strings is
9403 positive. (Bug#11587)
9404
efc00ab1 94052012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
9406
9407 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
9408
9409 * doc.c (Fsubstitute_command_keys): Doc fix.
9410
efc00ab1 94112012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
9412
9413 * search.c (search_buffer): Remove calls to
9414 r_alloc_inhibit_buffer_relocation, as it is now called by
9415 maybe_unify_char, which was the cause of relocation of buffer text
9416 in bug#11519.
9417
efc00ab1 94182012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
9419
9420 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
9421 for the duration of call to load_charset, to avoid problems with
9422 callers of maybe_unify_char that access buffer text through C
9423 pointers.
9424
9425 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
9426 decrement the inhibition flag, instead of just setting or
9427 resetting it.
9428
ba93a187
PE
94292012-05-31 Paul Eggert <eggert@cs.ucla.edu>
9430
9431 Remove obsolete '#define static' cruft.
9432 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
9433 This #undef was "temporary" in 2000; it is no longer needed
9434 now that '#define static' has gone away.
9435 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
9436 (gray_bitmap_bits): Remove; no longer needed.
9437 All uses replaced with definiens.
9438 * xterm.c: Include "bitmaps/gray.xbm".
9439
9e4bf381
PE
94402012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9441
9442 Clean up __executable_start, monstartup when --enable-profiling.
9443 The following changes affect the code only when profiling.
9444 * dispnew.c (__executable_start): Rename from safe_bcopy.
9445 Define only on platforms that need it.
9446 * emacs.c: Include <sys/gmon.h> when profiling.
9447 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
9448 (__executable_start): Remove decl, since lisp.h does it now.
9449 (safe_bcopy): Remove decl; no longer has that name.
9450 (main): Coalesce #if into single bit of code, for simplicity.
9451 Cast pointers to uintptr_t, since standard libraries want integers
9452 and not pointers.
9453 * lisp.h (__executable_start): New decl.
9454
32d72c2f
GM
94552012-05-31 Glenn Morris <rgm@gnu.org>
9456
9457 * image.c (Fimagemagick_types): Doc fix.
9458
baac5bc7
JM
94592012-05-30 Jim Meyering <meyering@redhat.com>
9460
9461 * callproc.c (Fcall_process_region): Include directory component
9462 in mkstemp error message (Bug#11586).
9463
72cb32cf
PE
94642012-05-30 Paul Eggert <eggert@cs.ucla.edu>
9465
9466 * alloc.c, lisp.h (make_pure_vector): Now static.
9467
61b108cc
SM
94682012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
9469
9470 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
9471 Move to byte-run.el.
9472 (Fautoload): Do the hash-doc more carefully.
9473 * data.c (Fdefalias): Purify definition, except for keymaps.
9474 (Qdefun): Move from eval.c.
9475 * lisp.h (Qdefun): Remove.
9476 * lread.c (read1): Tiny simplification.
9477
471fe23d
TN
94782012-05-29 Troels Nielsen <bn.troels@gmail.com>
9479
934f3f58 9480 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
9481 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
9482 Bug#9642, but explicitly check that the buffer the overlay would
9483 be moved to is live and rearrange lines to make sure that errors
9484 will not put the overlay in an inconsistent state.
9485 (Fdelete_overlay): Cosmetics.
9486
85d0efd1
EZ
94872012-05-28 Eli Zaretskii <eliz@gnu.org>
9488
9489 * w32term.c (my_bring_window_to_top): New function.
9490 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
9491 could be different from the original one.
9492 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
9493 (Bug#11513)
9494
9495 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
9496 by calling BringWindowToTop.
9497
9498 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
9499 (WM_EMACS_END): Increase by one.
9500
da92a98c
PE
95012012-05-28 Paul Eggert <eggert@cs.ucla.edu>
9502
9503 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
9504 This avoids undefined behavior that might cause the eassert
9505 to not catch an out-of-range value.
9506
74d1f848
JB
95072012-05-28 Juanma Barranquero <lekktu@gmail.com>
9508
9509 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
9510 Update dependencies.
9511
9e1a06fc
EZ
95122012-05-27 Eli Zaretskii <eliz@gnu.org>
9513
9514 * bidi.c (bidi_mirror_char): Fix last change.
9515
f3dd7312
AS
95162012-05-27 Andreas Schwab <schwab@linux-m68k.org>
9517
9518 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
9519 when referring to sectname field in printf format.
9520
81899c91
PE
95212012-05-27 Paul Eggert <eggert@cs.ucla.edu>
9522
57b81a9f
PE
9523 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
9524 Only r_alloc_inhibit_buffer_relocation needed to be added;
9525 the others were already declared.
9526
81899c91
PE
9527 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
9528 before checking whether it's out of range. Put the check inside
9529 eassert. See
9530 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
9531
33017faf 95322012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
9533
9534 * callproc.c (Fcall_process): Restore a line that was accidentally
9535 commented out in the 2011-02-13 change (bug#11547).
9536
33017faf 95372012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
9538
9539 * lisp.h [REL_ALLOC]: Add prototypes for external functions
9540 defined on ralloc.c.
9541
9542 * buffer.c [REL_ALLOC]: Remove prototypes of
9543 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
9544 they are now on lisp.h.
9545
9546 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
9547
9548 * search.c (search_buffer): Use it to inhibit relocation of buffer
9549 text while re_search_2 is doing its job, because re_search_2 is
9550 passed C pointers to buffer text. (Bug#11519)
9551
23415acf
EZ
9552 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
9553 Update value to 24.
9554
44e27368
EZ
9555 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
9556 state after an additional call to move_it_in_display_line_to, keep
9557 the values of it->max_ascent and it->max_descent found for the
9558 entire line.
9559 (pos_visible_p): Revert the comparison against bottom_y to what it
9560 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
9561 (Bug#11464)
9562
c1892f11
PE
95632012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9564
9565 Fix coding-related core dumps with gcc -ftrapv.
9566 The code was computing A - B, where A and B are pointers, and B is
9567 random garbage. This can lead to core dumps on platforms that
9568 have special pointer registers, and it also leads to core dumps on
9569 x86-64 when compiled with gcc -ftrapv. The fix is to compute
9570 A - B only when B is initialized properly.
9571 * coding.c (coding_set_source, coding_set_destination): Return void.
9572 (coding_change_source, coding_change_destinations): New functions,
9573 with the old behaviors of coding_set_source and coding_set_destination.
9574 All callers that need an offset changed to use these new functions.
9575
eb7afdad
GM
95762012-05-26 Glenn Morris <rgm@gnu.org>
9577
9578 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
9579
f12fdf02
EZ
95802012-05-26 Eli Zaretskii <eliz@gnu.org>
9581
53a63be6 9582 Extend mouse support on W32 text-mode console.
61b108cc
SM
9583 * xdisp.c (draw_row_with_mouse_face):
9584 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 9585
eb3f6f01 9586 * w32console.c: Include window.h.
61b108cc
SM
9587 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
9588 New functions.
eb3f6f01
EZ
9589 (initialize_w32_display): Initialize mouse-highlight data.
9590
53a63be6
EZ
9591 * w32inevt.c: Include termchar.h and window.h.
9592 (do_mouse_event): Support mouse-autoselect-window. When the mouse
9593 moves, call note_mouse_highlight. If help_echo changed, call
9594 gen_help_event to produce help-echo message in the echo area.
9595 Call clear_mouse_face if mouse_face_hidden is set in the mouse
9596 highlight info.
9597
4cfd81f6
PE
95982012-05-26 Paul Eggert <eggert@cs.ucla.edu>
9599
9600 * lread.c (read1): Simplify slightly to avoid an overflow warning
9601 with GCC 4.7.0 on x86-64.
9602
4446092a
EZ
96032012-05-26 Eli Zaretskii <eliz@gnu.org>
9604
9605 * bidi.c (bidi_mirror_char): Revert last change: an int is
9606 definitely wide enough here.
9607
42b2a986 96082012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 9609
42b2a986 9610 Fix integer width and related bugs (Bug#9874).
eb106a49 9611 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
9612 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9613 (string_bytes, check_sblock, allocate_string_data):
9614 (compact_small_strings, Fmake_bool_vector, make_string)
9615 (make_unibyte_string, make_multibyte_string)
9616 (make_string_from_bytes, make_specified_string)
9617 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
9618 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
9619 (mark_vectorlike):
9620 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9621 (allocate_pseudovector):
9622 Use int, not EMACS_INT, where int is wide enough.
9623 (inhibit_garbage_collection, Fgarbage_collect):
9624 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9625 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
9626 int might not be wide enough.
9627 (bidi_cache_search, bidi_cache_find, bidi_init_it)
9628 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
9629 (bidi_at_paragraph_end, bidi_find_paragraph_start)
9630 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9631 (bidi_level_of_next_char, bidi_move_to_visually_next):
9632 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9633 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
9634 (Fkill_buffer, Fset_buffer_major_mode)
9635 (advance_to_char_boundary, Fbuffer_swap_text)
9636 (Fset_buffer_multibyte, overlays_at, overlays_in)
9637 (overlay_touches_p, struct sortvec, record_overlay_string)
9638 (overlay_strings, recenter_overlay_lists)
9639 (adjust_overlays_for_insert, adjust_overlays_for_delete)
9640 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
9641 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
9642 (Foverlay_recenter, last_overlay_modification_hooks_used)
9643 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
9644 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
9645 (validate_region): Omit unnecessary test for b <= e,
9646 since that's guaranteed by the previous test.
d311d28c
PE
9647 (adjust_overlays_for_delete): Avoid pos + length overflow.
9648 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
9649 (report_overlay_modification):
9650 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9651 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
9652 Omit pointer cast, which isn't needed anyway, and doesn't work
9653 after the EMACS_INT -> ptrdiff_t change.
02481186 9654 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
9655 * buffer.h: Adjust decls to match defn changes elsewhere.
9656 (struct buffer_text, struct buffer):
9657 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9658 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
9659 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
9660 not int, to avoid needless 32-bit limit on 64-bit hosts.
9661 (exec_byte_code): Use tighter memory-full test, one that checks
9662 for alloca overflow. Don't compute the address of the object just
9663 before an array, as that's not portable. Use EMACS_INT, not
9664 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
9665 * callint.c (Fcall_interactively):
9666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9667 * callproc.c (call_process_kill, Fcall_process):
9668 Don't assume pid_t fits into an Emacs fixnum.
9669 (call_process_cleanup, Fcall_process, child_setup):
9670 Don't assume pid_t fits into int.
9671 (call_process_cleanup, Fcall_process, delete_temp_file)
9672 (Fcall_process_region):
9673 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9674 (Fcall_process): Simplify handling of volatile integers.
9675 Use int, not EMACS_INT, where int will do.
9676 * casefiddle.c (casify_object, casify_region, operate_on_word)
9677 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
9678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9679 (casify_object): Avoid integer overflow when overallocating buffer.
9680 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 9681 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
9682 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
9683 * category.h (CATEGORYP): Don't assume arg is nonnegative.
9684 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
9685 integers are now checked earlier. All uses replaced with XINT.
9686 (ccl_driver):
9687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9688 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
9689 (ccl_driver, Fregister_code_conversion_map):
9690 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
9691 (resolve_symbol_ccl_program): Check that vector header is in range.
9692 Always copy the vector, so that we can check its contents reliably
9693 now rather than having to recheck each instruction as it's being
9694 executed. Check that vector words fit in 'int'.
9695 (ccl_get_compiled_code, Fregister_ccl_program)
9696 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
9697 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
9698 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
9699 contents are in range.
9700 (Fccl_execute_on_string): Check that status is in range.
9701 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
9702 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
9703 Accept and return EMACS_INT, not int, because callers can pass values
9704 out of 'int' range.
9705 (c_string_width, strwidth, lisp_string_width, chars_in_text)
9706 (multibyte_chars_in_text, parse_str_as_multibyte)
9707 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
9708 (str_as_unibyte, str_to_unibyte, string_count_byte8)
9709 (string_escape_byte8, Fget_byte):
9710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 9711 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
9712 avoid mishandling large integers.
9713 * character.h: Adjust decls to match defn changes elsewhere.
9714 * charset.c (load_charset_map_from_file, find_charsets_in_text)
9715 (Ffind_charset_region):
9716 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9717 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
9718 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 9719 Don't assume fixnum fits in int.
d311d28c
PE
9720 (load_charset_map_from_vector, Fmap_charset_chars):
9721 Remove now-unnecessary CHECK_NATNUMs.
9722 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
9723 Don't rely on undefined behavior with signed left shift overflow.
9724 Don't assume unsigned int fits into fixnum, or that fixnum fits
9725 into unsigned int. Don't require max_code to be a valid fixnum;
9726 that's not true for gb10830 4-byte on a 32-bit host. Allow
9727 invalid_code to be a cons, for the same reason. Require code_offset
9728 to be a character. Avoid int overflow if max_char is close
9729 to INT_MAX.
9730 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
9731 this is intended anyway and avoids some undefined behavior.
9732 (load_charset_map): Pass unsigned, not int, as 2nd arg of
9733 INDEX_TO_CODE_POINT, as that's what it expects.
9734 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
9735 * charset.h (DECODE_CHAR): Return int, not unsigned;
9736 this is what was intended anyway, and it avoids undefined behavior.
9737 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
9738 integer-overflow issues.
9739 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
9740 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
9741 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
9742 * chartab.c (Fmake_char_table, Fset_char_table_range)
9743 (uniprop_get_decoder, uniprop_get_encoder):
9744 Don't assume fixnum fits in int.
9745 * cmds.c (move_point): New function, that does the gist of
9746 Fforward_char and Fbackward_char, but does so while checking
9747 for integer overflow more accurately.
c96e5d6a 9748 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
9749 (Fforward_line, Fend_of_line, internal_self_insert)
9750 (internal_self_insert):
9751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9752 Fix a FIXME, by checking for integer overflow when calculating
9753 target_clm and actual_clm.
9754 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 9755 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
9756 (ASSURE_DESTINATION, coding_alloc_by_realloc)
9757 (coding_alloc_by_making_gap, alloc_destination)
9758 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
9759 (encode_coding_utf_16, detect_coding_emacs_mule)
9760 (decode_coding_emacs_mule, encode_coding_emacs_mule)
9761 (detect_coding_iso_2022, decode_coding_iso_2022)
9762 (encode_invocation_designation, encode_designation_at_bol)
9763 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9764 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
9765 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
9766 (encode_coding_ccl, encode_coding_raw_text)
9767 (detect_coding_charset, decode_coding_charset)
9768 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
9769 (produce_composition, produce_charset, produce_annotation)
9770 (decode_coding, handle_composition_annotation)
9771 (handle_charset_annotation, consume_chars, decode_coding_gap)
9772 (decode_coding_object, encode_coding_object, detect_coding_system)
9773 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
9774 (code_convert_region, code_convert_string)
8f50130c
PE
9775 (Fdefine_coding_system_internal)
9776 (coding_set_source, coding_set_destination):
d311d28c
PE
9777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9778 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
9779 (Fdefine_coding_system_internal):
9780 Don't assume fixnums fit in int.
9781 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 9782 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
9783 (Funencodable_char_position, Fcheck_coding_systems_region)
9784 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 9785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 9786 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 9787 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 9788 Don't access memory outside of the args array.
d311d28c 9789 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
9790 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
9791 result of ENCODE_CHAR.
d311d28c
PE
9792 * coding.h: Adjust decls to match defn changes elsewhere.
9793 (struct coding_system):
9794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9795 * composite.c (get_composition_id, find_composition)
9796 (run_composition_function, update_compositions)
9797 (compose_text, composition_gstring_put_cache)
9798 (composition_gstring_p, composition_gstring_width)
9799 (fill_gstring_header, fill_gstring_body, autocmp_chars)
9800 (composition_compute_stop_pos, composition_reseat_it)
9801 (composition_update_it, struct position_record)
9802 (find_automatic_composition, composition_adjust_point)
9803 (Fcomposition_get_gstring, Ffind_composition_internal):
9804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9805 (update_compositions):
9806 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9807 * composite.h: Adjust decls to match defn changes elsewhere.
9808 (struct composition):
9809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9810 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
9811 Do not attempt to compute the address of the object just before a
9812 buffer; this is not portable.
9813 (Faref, Faset):
9814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9815 (Faset): Use int, not EMACS_INT, where int is wide enough.
9816 (Fstring_to_number): Don't assume fixnums fit in int.
9817 (Frem): Don't assume arg is nonnegative.
9818 * dbusbind.c (xd_append_arg): Check for integers out of range.
9819 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 9820 (extract_signed, extract_unsigned): New functions.
243e0530
PE
9821 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
9822 (xd_get_connection_references): Return ptrdiff_t, not int.
9823 All uses changed.
9824 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
9825 (xd_read_message_1):
9826 Use int, not unsigned, where the dbus API uses int.
9827 (Fdbus_message_internal): Don't overflow mtype.
9828 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
9829 * dired.c (directory_files_internal, file_name_completion, scmp)
9830 (file_name_completion_stat):
9831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9832 (file_name_completion): Don't overflow matchcount.
9833 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
9834 * dispextern.h: Adjust decls to match defn changes elsewhere.
9835 (struct text_pos, struct glyph, struct bidi_saved_info)
9836 (struct bidi_string_data, struct bidi_it, struct composition_it)
9837 (struct it):
9838 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9839 (struct display_pos, struct composition_it, struct it):
9840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9841 * dispnew.c (increment_matrix_positions)
9842 (increment_row_positions, mode_line_string)
9843 (marginal_area_string):
9844 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 9845 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
9846 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9847 (duration_to_sec_usec): New function, to check for overflow better.
9848 (Fsleep_for, sit_for): Use it.
9849 * doc.c (get_doc_string, store_function_docstring):
9850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9851 (get_doc_string, Fsnarf_documentation):
9852 Use int, not EMACS_INT, where int is wide enough.
9853 (get_doc_string):
9854 Use SAFE_ALLOCA, not alloca.
9855 Check for overflow when converting EMACS_INT to off_t.
9856 * doprnt.c (doprnt):
9857 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9858 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
9859 Don't assume uid_t fits into fixnum.
9860 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
9861 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
9862 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
9863 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
9864 (general_insert_function)
9865 (Finsert_char, make_buffer_string, make_buffer_string_both)
9866 (update_buffer_properties, Fbuffer_substring)
9867 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
9868 (Fsubst_char_in_region, check_translation)
9869 (Ftranslate_region_internal, save_restriction_restore, Fformat)
9870 (transpose_markers, Ftranspose_regions):
9871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9872 (clip_to_bounds): Move to lisp.h as an inline function).
9873 (Fconstrain_to_field): Don't assume integers are nonnegative.
9874 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
9875 (Fsubst_char_in_region, Fsave_restriction):
9876 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9877 (Femacs_pid): Don't assume pid_t fits into fixnum.
9878 (lo_time): Use int, not EMACS_INT, when int suffices.
9879 (lisp_time_argument): Check for usec out of range.
9880 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
9881 (Fuser_login_name, Fuser_full_name): Signal an error
9882 if a uid argument is out of range, rather than relying on
9883 undefined behavior.
c8d5c857
PE
9884 (Fformat_time_string): Remove now-unnecessary check.
9885 lisp_time_argument checks for out-of-range usec now.
243e0530 9886 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
9887 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
9888 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
9889 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
9890 (init_cmdargs, Fdump_emacs):
9891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9892 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
9893 the bottom (typically) 32 bits of the fixnum.
9894 * eval.c (specpdl_size, call_debugger):
9895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9896 (when_entered_debugger, Fbacktrace_debug):
9897 Don't assume fixnum can fit in int.
9898 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
9899 the object just before a buffer; this is not portable.
9900 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
9901 (grow_specpdl, unbind_to):
9902 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9903 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
9904 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 9905 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
9906 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
9907 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
9908 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9909 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
9910 (a_write, e_write):
9911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9912 (Fcopy_file, non_regular_nbytes, read_non_regular)
9913 (Finsert_file_contents):
9914 Use int, not EMACS_INT, where int is wide enough.
9915 (READ_BUF_SIZE): Verify that it fits in int.
9916 (Finsert_file_contents): Check that counts are in proper range,
9917 rather than assuming fixnums fit into ptrdiff_t etc.
9918 Don't assume fixnums fit into int.
125b3835 9919 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
9920 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
9921 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
9922 (string_char_to_byte, string_byte_to_char)
9923 (string_make_multibyte, string_to_multibyte)
9924 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
9925 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
9926 (substring_both, Fdelete, internal_equal, Ffillarray)
9927 (Fclear_string, mapcar1)
9928 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
9929 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
9930 (larger_vector, make_hash_table, maybe_resize_hash_table)
9931 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
9932 (Fmaphash, secure_hash):
9933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9934 (concat): Check for string index and length overflow.
9935 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
9936 (Frequire):
9937 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9938 (larger_vector): New API (vec, incr_min, size_max) replaces old
9939 one (vec, new_size, init). This catches size overflow.
9940 INIT was removed because it was always Qnil.
9941 All callers changed.
9942 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
9943 the upper bound on a hash table index size.
9944 (make_hash_table, maybe_resize_hash_table): Use it.
9945 (secure_hash): Computer start_byte and end_byte only after
9946 they're known to be in ptrdiff_t range.
9947 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
9948 (Ffont_get_glyphs, Ffont_at):
9949 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9950 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
9951 (Flist_fonts, Fopen_font):
9952 Don't assume fixnum can fit in int.
9953 (check_gstring): Don't assume index can fit in int.
9954 (font_match_p): Check that fixnum is a character, not a nonnegative
9955 fixnum, since the later code needs to stuff it into an int.
9956 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
9957 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
9958 conversion overflow issues.
9959 (Fopen_font): Check for integer out of range.
9960 (Ffont_get_glyphs): Don't assume index can fit in int.
9961 * font.h: Adjust decls to match defn changes elsewhere.
9962 * fontset.c (reorder_font_vector): Redo score calculation to avoid
9963 integer overflow.
9964 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
9965 printmax_t, where ptrdiff_t is wide enough.
9966 (Finternal_char_font):
9967 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9968 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
9969 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
9970 (Fset_frame_position, x_set_frame_parameters)
9971 (x_set_line_spacing, x_set_border_width)
9972 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
9973 Check that fixnums are in proper range for system types.
9974 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
9975 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9976 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
9977 Use SAFE_ALLOCA_LISP, not alloca.
9978 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
9979 intptr_t is wide enough.
9980 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
9981 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
9982 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
9983 Check for fixnum out of range.
9984 * ftfont.c (ftfont_list): Don't assume index fits in int.
9985 Check that fixnums are in proper range for system types.
9986 (ftfont_shape_by_flt):
9987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
9988 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9990 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
9991 Check that fixnums are in proper range for system types.
9992 * gnutls.h: Adjust decls to match defn changes elsewhere.
9993 * gtkutil.c (xg_dialog_run):
9994 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9995 (update_frame_tool_bar):
9996 Check that fixnums are in proper range for system types.
9997 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 9998 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
9999 * indent.c (last_known_column, last_known_column_point):
10000 (current_column_bol_cache):
10001 (skip_invisible, current_column, check_display_width):
10002 (check_display_width, scan_for_column, current_column_1)
10003 (Findent_to, Fcurrent_indentation, position_indentation)
10004 (indented_beyond_p, Fmove_to_column, compute_motion):
10005 (Fcompute_motion, Fvertical_motion):
10006 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10007 (last_known_column_modified): Use EMACS_INT, not int.
10008 (check_display_width):
10009 (Fcompute_motion):
10010 Check that fixnums and floats are in proper range for system types.
10011 (compute_motion): Don't assume index or fixnum fits in int.
10012 (compute_motion, Fcompute_motion):
10013 Use int, not EMACS_INT, when it is wide enough.
10014 (vmotion): Omit local var start_hpos that is always 0; that way
10015 we don't need to worry about overflow in expressions involving it.
10016 * indent.h: Adjust decls to match defn changes elsewhere.
10017 (struct position):
10018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10019 Use int, not EMACS_INT, where int is wide enough.
10020 Remove unused members ovstring_chars_done and tab_offset;
10021 all uses removed.
10022 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
10023 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
10024 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
10025 (make_gap, copy_text, insert, insert_and_inherit)
10026 (insert_before_markers, insert_before_markers_and_inherit)
10027 (insert_1, count_combining_before, count_combining_after)
10028 (insert_1_both, insert_from_string)
10029 (insert_from_string_before_markers, insert_from_string_1)
10030 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
10031 (adjust_after_replace, adjust_after_insert, replace_range)
10032 (replace_range_2, del_range, del_range_1, del_range_byte)
10033 (del_range_both, del_range_2, modify_region)
10034 (prepare_to_modify_buffer, signal_before_change)
10035 (signal_after_change, Fcombine_after_change_execute):
10036 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10037 * intervals.c (traverse_intervals, rotate_right, rotate_left)
10038 (balance_an_interval, split_interval_right, split_interval_left)
10039 (find_interval, next_interval, update_interval)
10040 (adjust_intervals_for_insertion, delete_node, delete_interval)
10041 (interval_deletion_adjustment, adjust_intervals_for_deletion)
10042 (static_offset_intervals, offset_intervals)
10043 (merge_interval_right, merge_interval_left, make_new_interval)
10044 (graft_intervals_into_buffer, temp_set_point_both)
10045 (temp_set_point, set_point, adjust_for_invis_intang)
10046 (set_point_both, move_if_not_intangible, get_property_and_range)
10047 (get_local_map, copy_intervals, copy_intervals_to_string)
10048 (compare_string_intervals, set_intervals_multibyte_1):
10049 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10050 * intervals.h: Adjust decls to match defn changes elsewhere.
10051 (struct interval):
10052 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10053 * keyboard.c (this_command_key_count, this_single_command_key_start)
10054 (before_command_key_count, before_command_echo_length, echo_now)
10055 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
10056 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
10057 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
10058 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
10059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10060 (last_non_minibuf_size, last_point_position, echo_truncate)
10061 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
10062 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
10063 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
10064 (stuff_buffered_input):
10065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10066 (last_auto_save, command_loop_1, read_char):
10067 Use EMACS_INT, not int, to avoid integer overflow.
10068 (record_char): Avoid overflow in total_keys computation.
10069 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
10070 * keyboard.h: Adjust decls to match defn changes elsewhere.
10071 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
10072 (Fkey_description, Fdescribe_vector, Flookup_key):
10073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10074 (click_position): New function, to check that positions are in range.
10075 (Fcurrent_active_maps):
10076 (describe_command):
10077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10078 (Faccessible_keymaps, Fkey_description):
10079 (preferred_sequence_p):
10080 Don't assume fixnum can fit into int.
10081 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
10082 Check for integer overflow in size calculations.
10083 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
10084 avoid mishandling large integers.
10085 * lisp.h: Adjust decls to match defn changes elsewhere.
10086 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
10087 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
10088 (struct Lisp_Marker):
10089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10090 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
10091 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
10092 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
10093 All callers changed.
10094 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
10095 Assume the arg has valid form, since it always does.
10096 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
10097 unsigned integer system type.
10098 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
10099 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
10100 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10101 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
10102 (duration_to_sec_usec): New decl.
10103 * lread.c (read_from_string_index, read_from_string_index_byte)
10104 (read_from_string_limit, readchar, unreadchar, openp)
10105 (read_internal_start, read1, oblookup):
10106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10107 (Fload, readevalloop, Feval_buffer, Feval_region):
10108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10109 (openp): Check for out-of-range argument to 'access'.
10110 (read1): Use int, not EMACS_INT, where int is wide enough.
10111 Don't assume fixnum fits into int.
6efdadfd 10112 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
10113 (read_filtered_event): Use duration_to_sec_usec
10114 to do proper overflow checking on durations.
d311d28c
PE
10115 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
10116 in size calculation.
10117 (Fexecute_kbd_macro):
10118 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10119 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
10120 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
10121 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
10122 (set_marker_both, set_marker_restricted_both, marker_position)
10123 (marker_byte_position, Fbuffer_has_markers_at):
10124 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10125 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 10126 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
10127 It now merely ensures that the menu is large enough, without
10128 necessarily growing it, as this avoids some integer overflow issues.
10129 All callers changed.
10130 (keymap_panes, parse_single_submenu, Fx_popup_menu):
10131 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10132 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
10133 Use SAFE_ALLOCA_LISP, not alloca.
10134 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
10135 to EMACS_INT. Check that fixnums are in proper range for system types.
10136 * minibuf.c (minibuf_prompt_width, string_to_object)
10137 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
10138 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
10139 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10140 (get_minibuffer, read_minibuf_unwind):
10141 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10142 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
10143 this simplifies overflow checking. All callers changed.
10144 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
10145 (Ftest_completion):
10146 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10147 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
10148 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
10149 Check that fixnums are in proper range for system types.
10150 (Fx_create_frame, Fx_show_tip):
10151 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10152 * nsfont.m (ns_findfonts, nsfont_list_family):
10153 Don't assume fixnum fits in long.
10154 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
10155 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10156 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
10157 wide enough.
17fdb222 10158 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
10159 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10160 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
10161 (PRINTDECLARE, PRINTPREPARE):
10162 (strout, print_string):
10163 (print, print_preprocess, print_check_string_charset_prop)
10164 (print_object):
10165 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10166 (PRINTDECLARE):
10167 (temp_output_buffer_setup, Fprin1_to_string, print_object):
10168 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10169 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 10170 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 10171 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
10172 (print_error_message): Use SAFE_ALLOCA, not alloca.
10173 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
10174 (print_depth, new_backquote_output, print_number_index):
10175 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
10176 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
10177 (Fset_process_window_size, Fformat_network_address)
10178 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 10179 (sigchld_handler):
d311d28c 10180 Check that fixnums are in proper range for system types.
d44287d4 10181 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
10182 Check for process-ids out of pid_t range rather than relying on
10183 undefined behavior.
e4d81efc 10184 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
10185 (Fformat_network_address, read_process_output, send_process)
10186 (Fprocess_send_region, status_notify):
10187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10188 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
10189 (wait_reading_process_output, read_process_output, exec_sentinel):
10190 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10191 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
10192 (Faccept_process_output): Use duration_to_sec_usec to do proper
10193 overflow checking on durations.
dde14581
PE
10194 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
10195 Don't assume pid_t fits in int.
02481186
PE
10196 * process.h (struct Lisp_Process): Members tick and update_tick
10197 are now of type EMACS_INT, not int.
b62b53e8
PE
10198 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
10199 configured --with-wide-int.
d311d28c
PE
10200 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
10201 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
10202 * search.c (looking_at_1, string_match_1):
10203 (fast_string_match, fast_c_string_match_ignore_case)
10204 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
10205 (scan_newline, find_before_next_newline, search_command)
10206 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
10207 (set_search_regs, wordify):
10208 (Freplace_match):
10209 (Fmatch_data):
10210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10211 (string_match_1, search_buffer, set_search_regs):
10212 (Fmatch_data):
10213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10214 (wordify): Check for overflow in size calculation.
10215 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
10216 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
10217 Check that fixnums are in proper range for system types.
10218 * sound.c (struct sound_device)
10219 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
10220 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10221 (Fplay_sound_internal):
10222 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 10223 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
10224 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
10225 (Fparse_partial_sexp):
10226 Don't assume fixnums can fit in int.
10227 (struct lisp_parse_state, find_start_pos, find_start_value)
10228 (find_start_value_byte, find_start_begv)
10229 (update_syntax_table, char_quoted, dec_bytepos)
10230 (find_defun_start, prev_char_comend_first, back_comment):
10231 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
10232 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
10233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10234 (Finternal_describe_syntax_value): Check that match_lisp is a
10235 character, not an integer, since the code stuffs it into int.
10236 (scan_words, scan_sexps_forward):
10237 Check that fixnums are in proper range for system types.
10238 (Fforward_word):
10239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10240 (scan_sexps_forward):
10241 Use CHARACTERP, not INTEGERP, since the value must fit into int.
10242 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
10243 * syntax.h: Adjust decls to match defn changes elsewhere.
10244 (struct gl_state_s):
10245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
10246 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
10247 MOST_POSITIVE_FIXNUM.
d311d28c
PE
10248 * sysdep.c (wait_for_termination_1, wait_for_termination)
10249 (interruptible_wait_for_termination, mkdir):
10250 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
10251 (emacs_read, emacs_write):
10252 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
10253 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
10254 and double all fit in int.
d311d28c
PE
10255 * term.c (set_tty_color_mode):
10256 Check that fixnums are in proper range for system types.
10257 * termhooks.h (struct input_event):
10258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10259 * textprop.c (validate_interval_range, interval_of)
10260 (Fadd_text_properties, set_text_properties_1)
10261 (Fremove_text_properties, Fremove_list_of_text_properties)
10262 (Ftext_property_any, Ftext_property_not_all)
10263 (copy_text_properties, text_property_list, extend_property_ranges)
10264 (verify_interval_modification):
10265 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10266 (Fnext_single_char_property_change)
10267 (Fprevious_single_char_property_change):
10268 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
10269 (copy_text_properties):
10270 Check for integer overflow in index calculation.
d311d28c
PE
10271 * undo.c (last_boundary_position, record_point, record_insert)
10272 (record_delete, record_marker_adjustment, record_change)
10273 (record_property_change):
10274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10275 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
10276 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10277 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10278 (Fx_hide_tip, Fx_file_dialog):
10279 * w32menu.c (set_frame_menubar):
10280 Use ptrdiff_t, not int, for consistency with rest of code.
10281 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
10282 (select_window, Fdelete_other_windows_internal)
10283 (window_scroll_pixel_based, window_scroll_line_based)
10284 (Frecenter, Fset_window_configuration):
10285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10286 (Fset_window_hscroll, run_window_configuration_change_hook)
10287 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 10288 (Fscroll_other_window, Frecenter):
d311d28c
PE
10289 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10290 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
10291 Don't assume fixnum fits in int.
10292 (Fset_window_scroll_bars):
10293 Check that fixnums are in proper range for system types.
10294 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
10295 (string_pos, c_string_pos, number_of_chars, init_iterator)
10296 (in_ellipses_for_invisible_text_p, init_from_display_pos)
10297 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
10298 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
10299 (face_before_or_after_it_pos, handle_invisible_prop)
10300 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
10301 (display_prop_intangible_p, string_buffer_position_lim)
10302 (string_buffer_position, handle_composition_prop, load_overlay_strings)
10303 (get_overlay_strings_1, get_overlay_strings)
10304 (iterate_out_of_display_property, forward_to_next_line_start)
10305 (back_to_previous_visible_line_start, reseat, reseat_to_string)
10306 (get_next_display_element, set_iterator_to_next)
10307 (get_visually_first_element, compute_stop_pos_backwards)
10308 (handle_stop_backwards, next_element_from_buffer)
10309 (move_it_in_display_line_to, move_it_in_display_line)
10310 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10311 (add_to_log, message_dolog, message_log_check_duplicate)
10312 (message2, message2_nolog, message3, message3_nolog
10313 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
10314 (current_message_1, truncate_echo_area, truncate_message_1)
10315 (set_message, set_message_1, store_mode_line_noprop)
10316 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
10317 (text_outside_line_unchanged_p, check_point_in_composition)
10318 (reconsider_clip_changes)
10319 (redisplay_internal, set_cursor_from_row, try_scrolling)
10320 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
10321 (redisplay_window, find_last_unchanged_at_beg_row)
10322 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
10323 (trailing_whitespace_p, find_row_edges, display_line)
10324 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
10325 (display_mode_element, store_mode_line_string)
10326 (pint2str, pint2hrstr, decode_mode_spec)
10327 (display_count_lines, display_string, draw_glyphs)
10328 (x_produce_glyphs, x_insert_glyphs)
10329 (rows_from_pos_range, mouse_face_from_buffer_pos)
10330 (fast_find_string_pos, mouse_face_from_string_pos)
10331 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10333 (safe_call, init_from_display_pos, handle_fontified_prop)
10334 (handle_single_display_spec, load_overlay_strings)
10335 (with_echo_area_buffer, setup_echo_area_for_printing)
10336 (display_echo_area, echo_area_display)
10337 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
10338 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
10339 (redisplay_window, dump_glyph_row, display_mode_line)
10340 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 10341 (handle_display_spec, display_prop_string_p):
d311d28c
PE
10342 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10343 (handle_single_display_spec, build_desired_tool_bar_string)
10344 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
10345 (get_specified_cursor_type):
10346 Check that fixnums are in proper range for system types.
10347 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
10348 (Flookup_image_map):
10349 Don't assume fixnums fit in int.
10350 (compare_overlay_entries):
10351 Avoid mishandling comparisons due to subtraction overflow.
10352 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
10353 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
10354 (handle_tool_bar_click):
10355 Use int, not unsigned, since we prefer signed and the signedness
10356 doesn't matter here.
10357 (get_next_display_element, next_element_from_display_vector):
10358 Use int, not EMACS_INT, when int is wide enough.
10359 (start_hourglass): Use duration_to_sec_usec to do proper
10360 overflow checking on durations.
10361 * xfaces.c (Fbitmap_spec_p):
10362 Check that fixnums are in proper range for system types.
10363 (compare_fonts_by_sort_order):
10364 Avoid mishandling comparisons due to subtraction overflow.
10365 (Fx_family_fonts, realize_basic_faces):
10366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10367 (Fx_family_fonts):
10368 Don't assume fixnum fits in int.
10369 Use SAFE_ALLOCA_LISP, not alloca.
10370 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
10371 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
10372 (face_at_buffer_position, face_for_overlay_string)
10373 (face_at_string_position):
10374 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10375 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
10376 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
10377 (Fx_show_tip):
10378 Check that fixnums are in proper range for system types.
10379 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
10380 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
10381 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10382 (Fx_change_window_property): Don't assume fixnums fit in int.
10383 * xfont.c (xfont_chars_supported):
10384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10385 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
10386 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
10387 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10388 * xml.c (parse_region):
10389 * xrdb.c (magic_file_p):
10390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
10391 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
10392 (x_get_local_selection, x_reply_selection_request)
10393 (x_handle_selection_request, wait_for_property_change):
10394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10395 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
10396 short is wide enough.
10397 (x_send_client_event): Don't assume fixnum fits in int.
10398 * xterm.c (x_x_to_emacs_modifiers):
10399 Don't assume EMACS_INT overflows nicely into int.
10400 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
10401 may come from Lisp.
10402 (handle_one_xevent): NATNUMP can eval its arg twice.
10403 (x_connection_closed):
10404 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
10405 * xterm.h: Adjust decls to match defn changes elsewhere.
10406 (struct scroll_bar): Use struct vectorlike_header
10407 rather than rolling our own approximation.
10408 (SCROLL_BAR_VEC_SIZE): Remove; not used.
10409
c6574eb5
GM
104102012-05-25 Glenn Morris <rgm@gnu.org>
10411
10412 * lisp.mk (lisp): Update for more files being compiled now.
10413
e8d32c7e
SM
104142012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
10415
48def666
SM
10416 * lread.c: Remove `read_pure' which makes no difference.
10417 (read_pure): Remove var.
10418 (unreadpure): Remove function.
10419 (readevalloop): Don't call read_list with -1 flag.
10420 (read1, read_vector): Don't test read_pure any more.
10421 (read_list): Simplify.
10422
e8d32c7e
SM
10423 * fileio.c, character.h: Minor style tweaks.
10424
4b2addb7
DA
104252012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
10426
10427 * window.h (clip_changed): Remove useless declaration.
10428
584461b2
JB
104292012-05-22 Juanma Barranquero <lekktu@gmail.com>
10430
10431 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
10432 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
10433
34374650
PE
104342012-05-22 Paul Eggert <eggert@cs.ucla.edu>
10435
10436 Remove src/m/*.
10437 This directory predates autoconf and is no longer needed nowadays.
10438 Move its few remaining bits of functionality to where they're needed.
10439 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
10440 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
10441 * m/template.h: Remove.
10442 * Makefile.in (M_FILE): Remove. All uses removed.
10443 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
10444 * lisp.h (USE_LSB_TAG):
10445 * mem-limits.h (EXCEEDS_LISP_PTR):
10446 Use VAL_MAX, not VALBITS, in #if.
10447 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
10448 (EMACS_UINT): Define unconditionally now.
10449 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
10450 (BITS_PER_EMACS_INT): New constants, replacing
10451 what used to be in config.h, but not useful in #if.
10452 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
10453 define them any more.
10454 (VAL_MAX): New macro.
10455 (VALMASK): Use it.
10456 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
10457 BITS_PER_EMACS_INT, in #if.
10458 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10459 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
10460 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
10461 * s/ms-w32.h (DATA_START):
10462 Move here from removed file m/intel386.h.
10463 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
10464 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
10465
261cb4bb
PE
104662012-05-21 Paul Eggert <eggert@cs.ucla.edu>
10467
10468 Assume C89 or later.
10469 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
10470 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
10471 (xrealloc):
10472 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
10473 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
10474 * textprop.c, tparam.c (NULL): Remove.
10475 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
10476 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
10477 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
10478 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
10479 * xterm.c (input_signal_count): Assume volatile works.
10480
ff23cd9f
KB
104812012-05-21 Ken Brown <kbrown@cornell.edu>
10482
10483 * xgselect.c (xg_select): Fix first argument in call to 'select'
10484 (bug#11508).
10485
1b170bc6
KB
104862012-05-20 Ken Brown <kbrown@cornell.edu>
10487
10488 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 10489 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 10490
b2f4d39f
KB
104912012-05-19 Ken Brown <kbrown@cornell.edu>
10492
10493 * xfns.c (x_in_use): Remove `static' qualifier.
10494 * xterm.h (x_in_use): Declare.
10495 * xgselect.c: Include xterm.h.
10496 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
10497 and `display_arg' (bug#9754).
10498
003fdae2
PE
104992012-05-19 Paul Eggert <eggert@cs.ucla.edu>
10500
9232a6d9
PE
10501 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
10502
003fdae2
PE
10503 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
10504 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
10505
784b56e2
EZ
105062012-05-18 Eli Zaretskii <eliz@gnu.org>
10507
10508 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
10509
10510 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 10511 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
10512
10513 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
10514 reference to image_cache->refcount.
10515 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
10516
a0a79cde
JL
105172012-05-17 Juri Linkov <juri@jurta.org>
10518
10519 * search.c (Fword_search_regexp, Fword_search_backward)
10520 (Fword_search_forward, Fword_search_backward_lax)
10521 (Fword_search_forward_lax): Move functions to isearch.el
10522 (bug#10145, bug#11381).
10523
b0572523
PE
105242012-05-16 Paul Eggert <eggert@cs.ucla.edu>
10525
10526 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
10527
9660f5fc
SM
105282012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
10529
10530 * lread.c (init_obarray): Declare Qt and Qnil as special.
10531
4374de83
GM
105322012-05-14 Glenn Morris <rgm@gnu.org>
10533
10534 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 10535 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 10536
dc44c39a
PE
105372012-05-14 Paul Eggert <eggert@cs.ucla.edu>
10538
078c97cb
PE
10539 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
10540
dc44c39a
PE
10541 * unexaix.c: Port to more-recent AIX compilers.
10542 (report_error, report_error_1, make_hdr, copy_sym)
10543 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
10544 Make arguments const char *, not char *, to avoid violations of C
10545 standard and to fix some AIX warnings reported by Gilles Pion.
10546
e18afed7 105472012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
10548
10549 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
10550 already have overlays loaded.
10551 (handle_single_display_spec): Before returning without displaying
10552 fringe bitmap, synchronize the bidi iterator with the main display
10553 iterator, by calling iterate_out_of_display_property.
10554 (iterate_out_of_display_property): Detect buffer iteration by
10555 testing that it->string is a Lisp string.
10556 (get_next_display_element): When the current object is exhausted,
10557 and there's something on it->stack, call set_iterator_to_next to
10558 proceed with what's on the stack, instead of returning zero.
10559 (set_iterator_to_next): If called at the end of a Lisp string,
10560 proceed to consider_string_end without incrementing string
10561 position. Don't increment display vector index past the end of
10562 the display vector. (Bug#11417)
c8fb9dc6
EZ
10563 (pos_visible_p): Don't report a position visible when move_it_to
10564 stopped at the last line of window, which happens to be scanned
10565 backwards by the bidi iteration. (Bug#11464)
ac268e67 10566
e18afed7 105672012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
10568
10569 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
10570 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
10571 are on a TTY, and thus unable to display on the fringes.
10572 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
10573 so we need to signal to the caller that this is a "replacing"
10574 display spec. This fixes display when the spec is invalid or we
10575 are on a TTY.
10576
e18afed7 105772012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
10578
10579 * unexaix.c (make_hdr): Fix typo in prototype.
10580 This bug broke the build on AIX. Problem reported by Gilles Pion.
10581
9d0a235a
MA
105822012-05-14 Michael Albinus <michael.albinus@gmx.de>
10583
10584 * keyboard.c (kbd_buffer_get_event): Read special events also in
10585 batch mode. (Bug#11415)
10586
9e6b06ed
GM
105872012-05-12 Glenn Morris <rgm@gnu.org>
10588
10589 * ns.mk: Update for ns_appbindir no longer having trailing "/".
10590
c1a1d7a3
EZ
105912012-05-12 Eli Zaretskii <eliz@gnu.org>
10592
10593 * lisp.mk (lisp): Add newcomment.elc.
10594
3fe7cdc8
GM
105952012-05-12 Glenn Morris <rgm@gnu.org>
10596
10597 * Makefile.in (MKDIR_P): New, set by configure.
10598 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
10599
53f7d2c0
PE
106002012-05-11 Paul Eggert <eggert@cs.ucla.edu>
10601
10602 Remove unused function hourglass_started.
10603 * dispextern.h (hourglass_started):
10604 * w32fns.c (hourglass_started):
10605 * xdisp.c (hourglass_started): Remove.
10606
75aafb17
JB
106072012-05-10 Juanma Barranquero <lekktu@gmail.com>
10608
10609 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
10610 Update dependencies.
10611
12959e8e
PE
106122012-05-10 Paul Eggert <eggert@cs.ucla.edu>
10613
97107e2e
PE
10614 * xgselect.c (xg_select): Put maxfds+1 into a var.
10615 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
10616
12959e8e
PE
10617 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
10618
836d29b3
DA
106192012-05-10 Dave Abrahams <dave@boostpro.com>
10620
10621 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
10622 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
10623
5cb67954
MA
106242012-05-09 Michael Albinus <michael.albinus@gmx.de>
10625
10626 * dbusbind.c (xd_registered_buses): New internal Lisp object.
10627 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
10628 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
10629 Initialize xd_registered_buses.
10630
3478ec45
PE
106312012-05-09 Paul Eggert <eggert@cs.ucla.edu>
10632
b263a6b0
PE
10633 Untag more efficiently if USE_LSB_TAG.
10634 This is based on a proposal by YAMAMOTO Mitsuharu in
10635 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
10636 For an admittedly artificial (nth 8000 longlist) benchmark on
10637 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
10638 Emacs's overall text size by 1%.
10639 * lisp.h (XUNTAG): New macro.
10640 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
10641 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
10642 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
10643 * eval.c (Fautoload):
10644 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
10645 * frame.h (XFRAME): Use XUNTAG.
10646
3478ec45
PE
10647 Port recent dbusbind.c changes to 32-bit --with-wide-int.
10648 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
10649 Remove unportable assumptions about print widths of types like
10650 dbus_uint32_t.
10651 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
10652 intptr_t when converting between pointer and integer, to avoid GCC
10653 warnings about wrong width.
10654
666b903b 106552012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
10656
10657 * w32proc.c (new_child): Force Windows to reserve only 64KB of
10658 stack for each reader_thread, instead of defaulting to 8MB
10659 determined by the linker. This avoids failures in creating
10660 subprocesses on Windows 7, see the discussion in this thread:
10661 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
10662
b120cc17
JC
106632012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
10664
10665 Fix up display of the *Minibuf-0* buffer in the mini window.
10666 * keyboard.c (read_char): Don't clear the echo area if there's no
10667 message to clear.
10668 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 10669 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 10670
9a4b36f8
MA
106712012-05-07 Michael Albinus <michael.albinus@gmx.de>
10672
10673 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
10674 batch mode.
10675
e5f9458f
CY
106762012-05-06 Chong Yidong <cyd@gnu.org>
10677
10678 * lisp.mk (lisp): Update.
10679
eceeb5fc 106802012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
10681
10682 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
10683
71873e2b
SM
106842012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
10685
10686 * data.c (PUT_ERROR): New macro.
10687 (syms_of_data): Use it. Add new error type `user-error'.
10688 * undo.c (user_error): New function.
10689 (Fprimitive_undo): Use it.
10690 * print.c (print_error_message): Adjust print style for `user-error'.
10691 * keyboard.c (user_error): New function.
10692 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
10693
ab0fa4e4
PE
106942012-05-03 Paul Eggert <eggert@cs.ucla.edu>
10695
10696 Do not limit current-time-string to years 1000..9999.
10697 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
10698 (Fcurrent_time_string): Support any year that is supported by the
10699 underlying localtime representation. Don't use asctime, as it
10700 has undefined behavior for years outside the range -999..9999.
10701
7ed806a7
PE
107022012-05-02 Paul Eggert <eggert@cs.ucla.edu>
10703
10704 Fix race conditions involving setenv, gmtime, localtime, asctime.
10705 Without this fix, interrupts could mess up code that uses these
10706 nonreentrant functions, since setting TZ invalidates existing
10707 tm_zone or tzname values, and since most of these functions return
10708 pointers to static storage.
10709 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
10710 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10711 Grow the critical sections to include not just invoking
10712 localtime/gmtime, but also accessing these functions' results
10713 including their tm_zone values if any, and any related TZ setting.
10714 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
10715 so that the struct tm is saved in the critical section.
10716 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
10717 motivated by the fact that memory allocation needs to be outside
10718 the critical section.
10719
0c16dfed
DA
107202012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
10721
10722 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
10723 with RESET_INTERVAL.
10724
10725 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10726 Remove duplicated buffer name initialization.
10727
3f83ace8
JM
107282012-05-02 Jim Meyering <jim@meyering.net>
10729
10730 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
10731
c7b8541e
JM
10732 * xfns.c (x_window): Use xstrdup (Bug#11375).
10733
90207a15 107342012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
10735
10736 * xdisp.c (pos_visible_p): If already at a newline from the
10737 display string before the 'while' loop, don't walk back the glyphs
10738 from it3.glyph_row. Solves assertion violation when the display
10739 string begins with a newline (egg.el). (Bug#11367)
10740
b593d6a9
AH
107412012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
10742
10743 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
10744 Move to simple.el.
10745
4737362e
GM
107462012-05-01 Glenn Morris <rgm@gnu.org>
10747
99cf43f9
GM
10748 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
10749 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
10750 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
10751 All were removed before 23.1.
10752
9311dcff
GM
10753 * dispnew.c: Remove HAVE_LIBNCURSES test;
10754 it is always true on relevant platforms.
10755
4d5c6349
GM
10756 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
10757 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
10758
4737362e
GM
10759 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
10760
74dd3a6b
AS
107612012-04-30 Andreas Schwab <schwab@linux-m68k.org>
10762
10763 * .gdbinit (xpr): Remove checks for no longer existing misc types.
10764 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
10765 Remove.
10766
13c379ee
PE
107672012-04-28 Paul Eggert <eggert@cs.ucla.edu>
10768
10769 Do not avoid creating empty evaporating overlays (Bug#9642).
10770 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
10771 That is, do not delete an evaporating overlay if it becomes
10772 empty after its bounds are adjusted to fit within its buffer.
10773 This fix caused other problems, and I'm reverting it until we get
10774 to the bottom of them.
10775
a8e7d6d7 107762012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
10777
10778 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
10779
a8e7d6d7 107802012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
10781
10782 * xdisp.c (pos_visible_p): If the window start position is beyond
10783 ZV, start the display from buffer beginning. Prevents assertion
10784 violation in init_iterator when the minibuffer window is scrolled
10785 via the scroll bar.
10786
10787 * window.c (window_scroll_pixel_based): Likewise.
10788
a8e7d6d7 107892012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
10790
10791 * keymap.c (where_is_internal): Doc fix (Bug#10872).
10792
a8e7d6d7 107932012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
10794
10795 * fileio.c (Fcopy_file, Fset_file_selinux_context):
10796 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
10797
a8e7d6d7 107982012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 10799
b593d6a9
AH
10800 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
10801 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 10802
1c6900d9
EZ
108032012-04-26 Eli Zaretskii <eliz@gnu.org>
10804
4c3fa1d9
EZ
10805 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
10806 display element, check also the underlying string or buffer
10807 character. (Bug#11341)
10808
1c6900d9
EZ
10809 * w32menu.c: Include w32heap.h.
10810 (add_menu_item): If the call to AppendMenuW (via
10811 unicode_append_menu) fails, disable Unicode menus only if we are
10812 running on Windows 9X/Me.
10813
42bf8205
AS
108142012-04-24 Andreas Schwab <schwab@linux-m68k.org>
10815
10816 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
10817 (xgetint): Add missing shift for LSB tags.
10818
b1bac16e
MR
108192012-04-24 Martin Rudalics <rudalics@gmx.at>
10820
10821 * keyboard.c (read_char): Don't wipe echo area for select window
10822 events: These might get delayed via `mouse-autoselect-window'
10823 (Bug#11304).
10824
d69621cc
JB
108252012-04-24 Juanma Barranquero <lekktu@gmail.com>
10826
10827 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
10828 manipulation of :loaded-from data.
10829
02fd101b
JB
108302012-04-23 Juanma Barranquero <lekktu@gmail.com>
10831
10832 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
10833 now a cons (bug#11311).
10834
888bec30
PE
108352012-04-23 Paul Eggert <eggert@cs.ucla.edu>
10836
89a438bd
PE
10837 Do not create empty overlays with the evaporate property (Bug#9642).
10838 * buffer.c (Fmove_overlay): Delete an evaporating overlay
10839 if it becomes empty after its bounds are adjusted to fit within
10840 its buffer. Without this fix, in a nonempty buffer (let ((o
10841 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
10842 yields an empty overlay that has the evaporate property, which is
10843 not supposed to happen.
10844
1068fe4d
PE
10845 Fix minor GTK3 problems found by static checking.
10846 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10847 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10848 (struct _EmacsFixedClass, emacs_fixed_get_type):
10849 Move decls here from emacsgtkfixed.h, since they needn't be public.
10850 (emacs_fixed_get_type): Now static.
10851 (emacs_fixed_class_init): Omit unused local.
10852 (emacs_fixed_child_type): Remove; unused.
10853 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
10854 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
10855 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
10856 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
10857 (EMACS_FIXED_GET_CLASS): Remove; unused.
10858 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
10859
888bec30
PE
10860 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
10861 Problem reported by Juanma Barranquero for Windows -Wunused-function.
10862
de85e130
PE
108632012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10864
d0baac98 10865 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 10866 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
10867 (__malloc_size_t, __malloc_ptrdiff_t):
10868 Remove. All uses removed, replaced by the definiens if needed,
10869 since we can assume C89 or better now.
10870 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
10871 (protect_malloc_state, align, get_contiguous_space)
10872 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
10873 (malloc_atfork_handler_child, malloc_enable_thread)
10874 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
10875 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
10876 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
10877 (special_realloc, _realloc_internal_nolock, _realloc_internal)
10878 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
10879 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
10880 Define using prototypes, not old style.
10881 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
10882 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
10883 (align): Don't assume that signed integer overflow wraps around.
10884 Omit unused local var.
10885 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
10886 (_free_internal_nolock, memalign, mallochook, reallochook):
10887 Omit no-longer-needed casts.
10888 (valloc): Use getpagesize, not __getpagesize.
10889 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
10890 (struct hdr): The 'magic' member is now size_t, not unsigned long.
10891
de85e130
PE
10892 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
10893
dcbf5805
MA
108942012-04-22 Michael Albinus <michael.albinus@gmx.de>
10895
10896 Move functions from C to Lisp. Make non-blocking method calls
10897 the default. Implement further D-Bus standard interfaces.
10898
10899 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
10900 (QCdbus_request_name_allow_replacement)
10901 (QCdbus_request_name_replace_existing)
10902 (QCdbus_request_name_do_not_queue)
10903 (QCdbus_request_name_reply_primary_owner)
10904 (QCdbus_request_name_reply_in_queue)
10905 (QCdbus_request_name_reply_exists)
10906 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
10907 (QCdbus_registered_serial, QCdbus_registered_method)
10908 (QCdbus_registered_signal): New Lisp objects.
10909 (XD_DEBUG_MESSAGE): Use sizeof.
10910 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
10911 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
10912 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
10913 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
10914 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
10915 (xd_signature, xd_append_arg): Allow float for integer types.
10916 (xd_get_connection_references): New function.
b593d6a9
AH
10917 (xd_get_connection_address): Rename from xd_initialize.
10918 Return cached address.
dcbf5805
MA
10919 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
10920 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
10921 level.
10922 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 10923 Return number of refcounts.
dcbf5805
MA
10924 (Fdbus_get_unique_name): Make stronger parameter check.
10925 (Fdbus_message_internal): New defun.
10926 (Fdbus_call_method, Fdbus_call_method_asynchronously)
10927 (Fdbus_method_return_internal, Fdbus_method_error_internal)
10928 (Fdbus_send_signal, Fdbus_register_service)
10929 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
10930 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
10931 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
10932 (Vdbus_compiled_version, Vdbus_runtime_version)
10933 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
10934 (Vdbus_message_type_method_return, Vdbus_message_type_error)
10935 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
10936 (Vdbus_registered_buses, Vdbus_registered_objects_table):
10937 Adapt docstring.
dcbf5805 10938
52828e02
PE
109392012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10940
da05bc4c
PE
10941 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
10942 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
10943 Do not assume ptrdiff_t is the same width as 'int'.
10944
52828e02
PE
10945 * alloc.c: Handle unusual debugging option combinations.
10946 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
10947 since the two debugging options are incompatible.
10948 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
10949 is defined.
10950 (mem_init, mem_insert, mem_insert_fixup):
10951 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
10952 (NEED_MEM_INSERT): Remove; no longer needed.
10953
f01769f9
LL
109542012-04-22 Leo Liu <sdl.web@gmail.com>
10955
10956 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
10957
5790543d
PE
109582012-04-22 Paul Eggert <eggert@cs.ucla.edu>
10959
10960 * sysdep.c [__FreeBSD__]: Minor cleanups.
10961 (list_system_processes, system_process_attributes) [__FreeBSD__]:
10962 Use Emacs indenting style more consistently. Avoid some casts.
10963 Use 'double' consistently rather than mixing 'float' and 'double'.
10964
b91b7e4d
EW
109652012-04-21 Eduard Wiebe <usenet@pusto.de>
10966
b593d6a9
AH
10967 * sysdep.c (list_system_processes, system_process_attributes):
10968 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 10969
6114eb15
AS
109702012-04-21 Andreas Schwab <schwab@linux-m68k.org>
10971
10972 * lisp.mk (lisp): Update.
10973
2f38dff7
PE
109742012-04-20 Paul Eggert <eggert@cs.ucla.edu>
10975
10976 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
10977 It is never used otherwise.
10978
4ae29f89
SM
109792012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
10980
10981 * print.c (print_preprocess): Only check print_depth if print-circle
10982 is nil.
10983 (print_object): Check for cycles even when print-circle is nil and
10984 print-gensym is t, but only check print_depth if print-circle is nil.
10985
f30d612a
CY
109862012-04-20 Chong Yidong <cyd@gnu.org>
10987
10988 * process.c (wait_reading_process_output): If EIO occurs on a pty,
10989 set the status to "failed" and ensure that sentinel is run.
10990
c07a4c0b 109912012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
10992
10993 * process.c (Fset_process_inherit_coding_system_flag)
10994 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 10995 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 10996
c07a4c0b 109972012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
10998
10999 * xdisp.c (string_buffer_position_lim): Limit starting position to
11000 BEGV.
11001 (set_cursor_from_row): If called for a mode-line or header-line
11002 row, return zero immediately.
11003 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
11004 farther than the first row after the header line, if any.
11005 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
11006 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
11007
c07a4c0b 110082012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11009
4ae29f89
SM
11010 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
11011 (bug#11238).
ad3a2b41 11012
c07a4c0b 110132012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 110142012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
11015
11016 configure: new option --enable-gcc-warnings (Bug#11207)
11017 * Makefile.in (C_WARNINGS_SWITCH): Remove.
11018 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
11019 (ALL_CFLAGS): Use new macros rather than old.
11020 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
11021 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
11022 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
11023 -Wunused-result, -Wunused-variable. This should go away once
11024 the Emacs and Gnulib regex code is merged.
11025 (xmalloc, xrealloc): Now static.
11026
aba027e8
PE
110272012-04-17 Paul Eggert <eggert@cs.ucla.edu>
11028
11029 * dired.c (Fsystem_groups): Remove unused local.
11030
e5a36063
GM
110312012-04-17 Glenn Morris <rgm@gnu.org>
11032
11033 * dired.c (Fsystem_users): Doc fix.
11034
316411f0
DA
110352012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
11036
11037 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
11038 (syms_of_dired): Add them.
11039
9426aba4
PE
110402012-04-16 Paul Eggert <eggert@cs.ucla.edu>
11041
b62a57be
PE
11042 Fix minor alloc.c problems found by static checking.
11043 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
11044 New extern decls, to avoid calling undeclared functions.
11045 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
11046 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
11047 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
11048 (NEED_MEM_INSERT): New macro.
11049 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 11050 Remove one incorrect comment and fix another.
b62a57be 11051
3539f31f
PE
11052 Fix minor ralloc.c problems found by static checking.
11053 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11054 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
11055 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
11056 (r_alloc_sbrk): Now static.
11057
a041960a
PE
11058 Improve ralloc.c interface checking.
11059 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
11060 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
11061 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
11062 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
11063 [REL_ALLOC]: ... to here, to check interface.
11064 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
11065 Remove decls. This fixes an "It stinks!".
11066
9426aba4
PE
11067 * alloc.c (which_symbols): Fix alignment issue / type clash.
11068
d55c12ed
AS
110692012-04-15 Andreas Schwab <schwab@linux-m68k.org>
11070
11071 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
11072 (struct Lisp_Misc_Any): Likewise.
11073 (struct Lisp_Free): Likewise.
11074 * alloc.c (union aligned_Lisp_Symbol): Define.
11075 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
11076 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
11077 (union aligned_Lisp_Misc): Define.
11078 (MARKER_BLOCK_SIZE, struct marker_block): Use union
11079 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 11080 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 11081
b948ce8b
PE
110822012-04-14 Paul Eggert <eggert@cs.ucla.edu>
11083
11084 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
11085 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
11086 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
11087 * s/netbsd.h, s/sol2-6.h:
11088 Remove definition of GC_MARK_STACK, since the default now works.
11089 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
11090 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
11091 no longer the default.
11092 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
11093
35dc09a1 110942012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 11095
35dc09a1
GM
11096 * lread.c (lisp_file_lexically_bound_p):
11097 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 11098
35dc09a1
GM
110992012-04-14 Eli Zaretskii <eliz@gnu.org>
11100
11101 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
11102 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
11103
111042012-04-14 Jan Djärv <jan.h.d@swipnet.se>
11105
11106 * nsterm.m (constrainFrameRect): Always constrain when there is only
11107 one screen (Bug#10962).
11108
bcd86815
KB
111092012-04-13 Ken Brown <kbrown@cornell.edu>
11110
11111 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
11112
c25df26e
RT
111132012-04-13 Reuben Thomas <rrt@sc3d.org>
11114
11115 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
11116
0fc59f1e
DC
111172012-04-11 Daniel Colascione <dancol@dancol.org>
11118
11119 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
11120 against is gone. It's better to use vfork now so that when Cygwin
11121 gains a new, working vfork, we use it automatically (bug#10398).
11122
de8c03dc
SM
111232012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11124
11125 * window.c (save_window_save): Obey window-point-insertion-type.
11126
2f097256
GM
111272012-04-11 Glenn Morris <rgm@gnu.org>
11128
11129 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
11130
453b951e
SM
111312012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
11132
11133 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
11134
75f1671a 111352012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
11136
11137 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
11138 (force_quit_count): New var.
11139 (handle_interrupt): Use it.
11140
2a8ce227
JB
111412012-04-10 Juanma Barranquero <lekktu@gmail.com>
11142
11143 * w32.c (w32_delayed_load): Record the full path of the library
11144 being loaded (bug#10424).
11145
935396c0
GM
111462012-04-09 Glenn Morris <rgm@gnu.org>
11147
05920a43
GM
11148 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
11149 not just in the obarray, before snarfing them. (Bug#11036)
11150
935396c0
GM
11151 * Makefile.in ($(leimdir)/leim-list.el):
11152 Pass EMACS rather than BUILT_EMACS.
11153
a18ecafa
TZ
111542012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
11155
11156 * process.c (make_process):
11157 * process.h: Add integer `gnutls_handshakes_tried' member to
11158 process struct.
11159
6bbef4e5
JC
11160 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
11161 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
11162
11163 * gnutls.c (gnutls_log_function2i): Convenience log function.
11164 (emacs_gnutls_read): Use new log functions,
11165 `gnutls_handshakes_tried' process member, and
11166 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
11167 attempts per process (connection).
11168
b4d3bc10
CY
111692012-04-09 Chong Yidong <cyd@gnu.org>
11170
11171 * eval.c (Fuser_variable_p, user_variable_p_eh)
11172 (lisp_indirect_variable): Functions deleted.
11173 (Fdefvar): Caller changed.
11174
11175 * callint.c (Finteractive, Fcall_interactively):
11176 * minibuf.c (Fread_variable): Callers changed.
11177
70f4d973
EZ
111782012-04-09 Eli Zaretskii <eliz@gnu.org>
11179
11180 * xdisp.c (set_cursor_from_row): If the display string appears in
11181 the buffer at position that is closer to point than the position
11182 after the display string, display the cursor on the first glyph of
11183 the display string. Fixes cursor display when a 'display' text
11184 property immediately follows invisible text. (Bug#11094)
11185
cb3c2e3e
PE
111862012-04-09 Paul Eggert <eggert@cs.ucla.edu>
11187
11188 composite.c: use 'double' consistently
11189 * composite.c (get_composition_id): Use 'double' consistently
11190 instead of converting 'float' to 'double' and vice versa; this is
11191 easier to understand and avoids a GCC warning.
11192
fd06db5d
GM
111932012-04-09 Glenn Morris <rgm@gnu.org>
11194
50fe702a
GM
11195 * Makefile.in: Generate leim-list with bootstrap-emacs, in
11196 preparation for dumping it with emacs. (Bug#4789)
11197 (leimdir): New variable.
11198 ($(leimdir)/leim-list.el): New rule.
11199 (emacs$(EXEEXT)): Depend on leim-list.el.
11200
fd06db5d
GM
11201 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
11202 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
11203 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
11204
55c131ee
AS
112052012-04-08 Andreas Schwab <schwab@linux-m68k.org>
11206
11207 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
11208 proper alignment.
11209
9209588f
JB
112102012-04-07 Juanma Barranquero <lekktu@gmail.com>
11211
11212 * xml.c (init_libxml2_functions) [WINDOWSNT]:
11213 Remove unused local variable.
11214
e3fb2efb
PE
112152012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11216
11217 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
11218 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
11219 (mark_memory): Mark Lisp_Objects only if pointers might hide in
11220 objects, as mark_maybe_pointer will catch them otherwise.
11221 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
11222 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
11223
b5385551
PE
112242012-04-07 Paul Eggert <eggert@cs.ucla.edu>
11225
11226 Fix typo that broke non-Windows builds.
11227 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
11228
9078ead6
EZ
112292012-04-07 Eli Zaretskii <eliz@gnu.org>
11230
11231 Support building on MS-Windows with libxml2.
11232
11233 * makefile.w32-in (OBJ2): Add xml.$(O).
11234 (GLOBAL_SOURCES): Add xml.c.
11235 ($(BLD)/xml.$(O)): New dependency list.
11236
11237 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
11238 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
11239 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
11240 [!WINDOWSNT]: New macros.
11241 (init_libxml2_functions, libxml2_loaded_p): New functions.
11242 (parse_region): Call fn_xmlCheckVersion instead of using the macro
11243 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
11244 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
11245 Calls xmlCleanupParser only if libxml2 was loaded (or statically
11246 linked in).
6bbef4e5
JC
11247 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
11248 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
11249 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
11250
11251 * emacs.c: Don't include libxml/parser.h.
11252 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
11253 xmlCleanupParser directly.
11254
11255 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
11256
3811fdf3
EZ
112572012-04-07 Eli Zaretskii <eliz@gnu.org>
11258
11259 * indent.c (Fvertical_motion): If there is a display string at
11260 point, use it.vpos to compute how many lines to backtrack after
11261 move_it_to point. (Bug#11133)
11262
2f8e16b2
EZ
112632012-04-06 Eli Zaretskii <eliz@gnu.org>
11264
11265 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
11266 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
11267 about subtle differences between FETCH_CHAR* and STRING_CHAR*
11268 macros related to unification of CJK characters. For the details,
11269 see the discussion following the message here:
11270 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
11271
3d439cd1
CY
112722012-04-04 Chong Yidong <cyd@gnu.org>
11273
11274 * keyboard.c (Vdelayed_warnings_list): Doc fix.
11275
8bc53d00
EZ
112762012-04-01 Eli Zaretskii <eliz@gnu.org>
11277
11278 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
11279 instead of alloca. (Bug#11138)
11280
3b0512a3
AS
112812012-04-01 Andreas Schwab <schwab@linux-m68k.org>
11282
11283 * w32menu.c (is_simple_dialog): Properly check lisp types.
11284 (Bug#11141)
11285
8427ddd2
EZ
112862012-03-31 Eli Zaretskii <eliz@gnu.org>
11287
979022ef
EZ
11288 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
11289 position we get to after a call to move_it_to fails the
11290 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
11291 only if we wind up in a string from display property. (Bug#11063)
11292
a6b1c7cc
EZ
11293 * window.c (Fdelete_other_windows_internal): Invalidate the row
11294 and column information about mouse highlight, so that redisplay
11295 restores it after reallocating the glyph matrices. (Bug#7464)
11296
8427ddd2
EZ
11297 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
11298 string comes from a `display' text property, use the buffer
11299 position of that property as if we actually saw that position in
11300 the row's glyphs.
697ba24b
EZ
11301 (move_it_by_lines): Remove the assertion that
11302 "it->current_x == 0 && it->hpos == 0" which can be legitimately
11303 violated when there's a before-string at the beginning of a line.
11304 (Bug#11063)
8427ddd2 11305
65a0a738
EZ
113062012-03-30 Eli Zaretskii <eliz@gnu.org>
11307
11308 * xdisp.c (append_space_for_newline): If the default face was
11309 remapped, use the remapped face for the appended newline.
11310 (extend_face_to_end_of_line): Use the remapped default face for
11311 extending the face to the end of the line.
11312 (display_line): Call extend_face_to_end_of_line when the default
11313 face was remapped. (Bug#11068)
11314
581355cc
EZ
113152012-03-29 Eli Zaretskii <eliz@gnu.org>
11316
11317 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
11318
e8fc049f
SM
113192012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11320
11321 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
11322
4fb9a543
GM
113232012-03-27 Glenn Morris <rgm@gnu.org>
11324
11325 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
11326 Doc fixes.
11327
679910f1
KH
113282012-03-26 Kenichi Handa <handa@m17n.org>
11329
11330 * dispextern.h (struct glyph): Fix previous change. Change the
11331 bit length of glyphless.ch to 25 (Bug#11082).
11332
90d49b7f
CY
113332012-03-26 Chong Yidong <cyd@gnu.org>
11334
11335 * keyboard.c (Vselection_inhibit_update_commands): New variable.
11336 (command_loop_1): Use it; inhibit selection update for
11337 handle-select-window too (Bug#8996).
11338
f514f6f0
FP
113392012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
11340
e8fc049f 11341 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 11342
bf43fa51
KH
113432012-03-25 Kenichi Handa <handa@m17n.org>
11344
11345 * dispextern.h (struct glyph): Change the bit length of
11346 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
11347
8a0c01dd
EZ
113482012-03-24 Eli Zaretskii <eliz@gnu.org>
11349
11350 * s/ms-w32.h (tzname): Include time.h before redirecting to
11351 _tzname. Fixes the MSVC build. (Bug#9960)
11352
7d1c3a76
AS
113532012-03-24 Andreas Schwab <schwab@linux-m68k.org>
11354
8ed79523
AS
11355 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
11356 characters.
11357
7d1c3a76
AS
11358 * xterm.c (XTread_socket): Only modify handling_signal if
11359 !SYNC_INPUT. (Bug#11080)
11360
e99a9b8b
EZ
113612012-03-23 Eli Zaretskii <eliz@gnu.org>
11362
11363 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
11364 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
11365 when fetching a multibyte character consumes more bytes than
11366 CHAR_BYTES returns, due to unification of CJK characters in
11367 string_char. (Bug#11073)
11368
5063c0e1
TN
113692012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
11370
11371 * process.c (wait_reading_process_output): Handle pty disconnect
11372 by refraining from sending oneself a SIGCHLD (bug#10933).
11373
9f851fbd
CY
113742012-03-22 Chong Yidong <cyd@gnu.org>
11375
11376 * dispextern.h (struct it): New member string_from_prefix_prop_p.
11377
5063c0e1 11378 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
11379 Mark string as coming from a prefix property.
11380 (handle_face_prop): Use default face for prefix strings (Bug#4281).
11381 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
11382
fb5b8aca
CY
113832012-03-21 Chong Yidong <cyd@gnu.org>
11384
11385 * xfaces.c (Vface_remapping_alist): Doc fix.
11386
62356a1b
EZ
113872012-03-20 Eli Zaretskii <eliz@gnu.org>
11388
11389 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
11390 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
11391 Doc fixes.
62356a1b 11392
025de85b
CY
113932012-03-20 Chong Yidong <cyd@gnu.org>
11394
11395 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
11396 to reflect default non-nil value of redisplay-dont-pause.
11397
4827f94e
KH
113982012-03-19 Kenichi Handa <handa@m17n.org>
11399
11400 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
11401 it fit in a valid range (Bug#11003).
11402
e50a24a2
EZ
114032012-03-18 Eli Zaretskii <eliz@gnu.org>
11404
11405 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
11406 that is not from display property, accept the row as a "cursor
11407 row" if one of the string's character has a non-nil `cursor'
11408 property. Fixes cursor positioning when there are newlines in
11409 overlay strings, e.g. in icomplete.el. (Bug#11035)
11410
9af5ed87
PE
114112012-03-12 Paul Eggert <eggert@cs.ucla.edu>
11412
11413 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
11414
d1f55f16
CY
114152012-03-12 Chong Yidong <cyd@gnu.org>
11416
11417 * eval.c (inhibit_lisp_code): Rename from
11418 inhibit_window_configuration_change_hook; move from window.c.
11419
11420 * xfns.c (unwind_create_frame_1, Fx_create_frame):
11421 * window.c (run_window_configuration_change_hook)
11422 (syms_of_window): Callers changed.
11423
66c5eebd
CY
114242012-03-11 Chong Yidong <cyd@gnu.org>
11425
413df973
CY
11426 * keymap.c (Fkey_description): Doc fix (Bug#9700).
11427
66c5eebd
CY
11428 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
11429
1de11f56
CY
114302012-03-10 Chong Yidong <cyd@gnu.org>
11431
11432 * frame.c (other_visible_frames): Don't assume the selected frame
11433 is visible (Bug#10955).
11434
cae07000
SM
114352012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
11436
11437 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
11438
89c94350
JD
114392012-03-08 Jan Djärv <jan.h.d@swipnet.se>
11440
11441 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
11442 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
11443 zero (Bug#10954).
11444
999dd333
GM
114452012-03-03 Glenn Morris <rgm@gnu.org>
11446
01a6dcc8 11447 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 11448
de0100f2
EZ
114492012-03-02 Eli Zaretskii <eliz@gnu.org>
11450
11451 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
11452 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
11453 (redisplay_window, next_element_from_string): Fix typos in
11454 comments.
3e441275
EZ
11455 (redisplay_window): Pass to move_it_vertically the margin in
11456 pixels, not in screen lines.
de0100f2 11457
96a72ee9
GM
114582012-03-02 Glenn Morris <rgm@gnu.org>
11459
11460 * buffer.c (buffer-list-update-hook): Doc fix.
11461
312508d7
EZ
114622012-02-29 Eli Zaretskii <eliz@gnu.org>
11463
11464 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
11465 push_it before setting up the iterator for the first overlay
11466 string, even if we have an empty string loaded.
11467 (next_overlay_string): If there's an empty string on the iterator
11468 stack, pop the stack. (Bug#10903)
11469
27f3c637
PE
114702012-02-25 Paul Eggert <eggert@cs.ucla.edu>
11471
11472 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
11473 Suggested by Stefan Monnier in
11474 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
11475 * alloc.c (widen_to_Lisp_Object): New static function.
11476 (mark_memory): Also mark Lisp_Objects by fetching pointer words
11477 and widening them to Lisp_Objects. This would work even if
11478 USE_LSB_TAG is defined and wide integers are used, which might
11479 happen in a future version of Emacs.
11480
3c9dfce6
CY
114812012-02-25 Chong Yidong <cyd@gnu.org>
11482
fa74b241
CY
11483 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
11484 Doc fix.
11485
3c9dfce6
CY
11486 * xselect.c (Fx_selection_exists_p): Doc fix.
11487 (x_clipboard_manager_save_all): Print an informative message
11488 before saving to clipboard manager.
11489
9486df08
CY
114902012-02-24 Chong Yidong <cyd@gnu.org>
11491
11492 * keyboard.c (process_special_events): Handle all X selection
11493 requests in kbd_buffer, not just the next one (Bug#8869).
11494
f01d3321
CY
114952012-02-23 Chong Yidong <cyd@gnu.org>
11496
11497 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
11498 call when setting menu-bar-lines and tool-bar-lines parameters.
11499 (unwind_create_frame_1): New helper function.
11500
11501 * window.c (inhibit_window_configuration_change_hook): New var.
11502 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 11503 (syms_of_window): Initialize it.
f01d3321 11504
86b847b6
CY
115052012-02-22 Chong Yidong <cyd@gnu.org>
11506
11507 * xterm.c (x_draw_image_relief): Add missing type check for
11508 Vtool_bar_button_margin (Bug#10743).
11509
a59225b1
CY
115102012-02-21 Chong Yidong <cyd@gnu.org>
11511
11512 * fileio.c (Vfile_name_handler_alist): Doc fix.
11513
11514 * buffer.c (Fget_file_buffer): Protect against invalid file
11515 handler return value.
11516
310f5bd4
PE
115172012-02-20 Paul Eggert <eggert@cs.ucla.edu>
11518
cb3a28cc
PE
11519 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
11520 when computing $valmask.
11521
310f5bd4
PE
11522 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
11523 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
11524 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
11525 It's useless in that case, and it can cause problems on hosts
11526 that allocate halves of EMACS_INT values separately.
11527 Reported by Dan Horák. Diagnosed by Andreas Schwab in
11528 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
11529 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
11530 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
11531 it avoids undefined behavior on hosts where shifting right by more
11532 than the word width has undefined behavior.
11533
2375c96a
CY
115342012-02-19 Chong Yidong <cyd@gnu.org>
11535
11536 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
11537 (Funhandled_file_name_directory, Ffile_name_as_directory)
11538 (Fdirectory_file_name, Fexpand_file_name)
11539 (Fsubstitute_in_file_name): Protect against invalid file handler
11540 return values (Bug#10845).
11541
3eb49e71
EZ
115422012-02-18 Eli Zaretskii <eliz@gnu.org>
11543
11544 * .gdbinit (pitx): Fix incorrect references to fields of the
11545 iterator stack.
11546
7b926f3f
CY
115472012-02-17 Chong Yidong <cyd@gnu.org>
11548
11549 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
11550
11273115
PE
115512012-02-15 Paul Eggert <eggert@cs.ucla.edu>
11552
11553 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
11554 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
11555
c3a70e2b
CY
115562012-02-15 Chong Yidong <cyd@gnu.org>
11557
11558 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
11559 marked as special. Also, starting docstrings with * is obsolete.
11560
0ca43699
AS
115612012-02-13 Andreas Schwab <schwab@linux-m68k.org>
11562
11563 * gnutls.c (emacs_gnutls_write): Fix last change.
11564
2e8f3c56
LI
115652012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
11566
11567 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
11568 send_process.
11569
af70074f
SM
115702012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
11571
11572 * keymap.c (Fsingle_key_description): Handle char ranges.
11573
95986d52
CY
115742012-02-12 Chong Yidong <cyd@gnu.org>
11575
afd83bd1
CY
11576 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
11577 as that creates a dangerous corner case.
11578
95986d52
CY
11579 * window.c (Fdelete_window_internal): Invalidate the mouse
11580 highlight (Bug#9904).
11581
bd7da63e
GM
115822012-02-12 Glenn Morris <rgm@gnu.org>
11583
11584 * xselect.c (Fx_own_selection_internal)
11585 (Fx_get_selection_internal, Fx_disown_selection_internal)
11586 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
11587 * nsselect.m (Fx_own_selection_internal)
11588 (Fx_disown_selection_internal, Fx_selection_exists_p)
11589 (Fx_selection_owner_p, Fx_get_selection_internal):
11590 Sync docs and argument specs with the xselect.c versions.
11591
77abcbc2
LI
115922012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
11593
11594 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
11595
90b671e2
EZ
115962012-02-11 Eli Zaretskii <eliz@gnu.org>
11597
1c0ca0b7
EZ
11598 * w32select.c (Fx_selection_exists_p): Sync doc string and
11599 argument list with xselect.c. (Bug#10783)
11600
11601 * w16select.c (Fx_selection_exists_p): Sync doc string and
11602 argument list with xselect.c. (Bug#10783)
90b671e2 11603
49241268
GM
116042012-02-10 Glenn Morris <rgm@gnu.org>
11605
11606 * fns.c (Fsecure_hash): Doc fix.
11607
f998bbe7 116082012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
11609
11610 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
11611
0992bd9c
CY
116122012-02-07 Chong Yidong <cyd@gnu.org>
11613
11614 * buffer.c (Fbuffer_local_variables)
11615 (buffer_lisp_local_variables): Handle unbound vars correctly;
11616 don't let Qunbound leak into Lisp.
11617
af008560
GM
116182012-02-07 Glenn Morris <rgm@gnu.org>
11619
dd605cc4
GM
11620 * image.c (Fimagemagick_types): Doc fix.
11621
af008560
GM
11622 * image.c (imagemagick-render-type): Change it from a lisp object
11623 to an integer. Move the doc here from the lisp manual.
11624 Treat all values not equal to 0 the same.
11625
1449fa1d
CY
116262012-02-06 Chong Yidong <cyd@gnu.org>
11627
11628 * doc.c (store_function_docstring): Avoid applying docstring of
11629 alias to base function (Bug#2603).
11630
3723ec07
AS
116312012-02-04 Andreas Schwab <schwab@linux-m68k.org>
11632
11633 * .gdbinit (pp1, pv1): Remove redundant defines.
11634 (pr): Use pp.
11635
79c1cc1e
CY
116362012-02-04 Chong Yidong <cyd@gnu.org>
11637
11638 * nsterm.m: Declare a global (Bug#10694).
11639
d7f29f8e
EZ
116402012-02-04 Eli Zaretskii <eliz@gnu.org>
11641
cae07000
SM
11642 * w32.c (get_emacs_configuration_options):
11643 Include --enable-checking, if specified, in the return value.
d7f29f8e 11644
3b95a6f9
MR
116452012-02-04 Martin Rudalics <rudalics@gmx.at>
11646
11647 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
11648 after rounding frame sizes. (Bug#9723)
11649
d6fa96a6
EZ
116502012-02-04 Eli Zaretskii <eliz@gnu.org>
11651
11652 * keyboard.c (adjust_point_for_property): Don't position point
11653 before BEGV. (Bug#10696)
11654
df0b2940
PE
116552012-02-03 Paul Eggert <eggert@cs.ucla.edu>
11656
11657 Handle overflow when computing char display width (Bug#9496).
11658 * character.c (char_width): Return EMACS_INT, not int.
11659 (char_width, c_string_width): Check for overflow when
11660 computing the width; this is possible now that individual
11661 characters can have unbounded width. Problem introduced
11662 by merge from Emacs 23 on 2012-01-19.
11663
6bee44d6
MA
116642012-02-02 Michael Albinus <michael.albinus@gmx.de>
11665
11666 * dbusbind.c (Fdbus_register_method): Mention the return value
11667 :ignore in the docstring.
11668
44f92739
GM
116692012-02-02 Glenn Morris <rgm@gnu.org>
11670
1b9f60cc
GM
11671 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
11672
44f92739
GM
11673 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11674 Unconditionally set to t. (Bug#10673)
11675 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
11676 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
11677 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
11678
c5d3843c
KH
116792012-02-02 Kenichi Handa <handa@m17n.org>
11680
11681 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
11682 0, do not call append_composite_glyph.
11683
159462d4 116842012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
11685
11686 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
11687 NULL (Bug#6988).
11688 (x_produce_glyphs): If the component of a composition is a null
11689 string, set it->pixel_width to 1 to avoid zero-width glyph.
11690
78cef877
EZ
116912012-02-01 Eli Zaretskii <eliz@gnu.org>
11692
11693 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
11694 first 2 arguments are identical. This makes inserting large
11695 output from a subprocess an order of magnitude faster on
11696 MS-Windows, where all sbrk'ed memory is always contiguous.
11697
97897668
GM
116982012-01-31 Glenn Morris <rgm@gnu.org>
11699
11700 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 11701 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
11702 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
11703
31fd3586
GM
117042012-01-29 Glenn Morris <rgm@gnu.org>
11705
11706 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
11707
0e24a8b2
CY
117082012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
11709
11710 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
11711
cc0adcb0
CY
117122012-01-28 Chong Yidong <cyd@gnu.org>
11713
11714 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
11715
acc28cb9
CY
117162012-01-26 Chong Yidong <cyd@gnu.org>
11717
9c69cfb7
CY
11718 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
11719
acc28cb9
CY
11720 * search.c (Fsearch_forward, Fsearch_backward): Document negative
11721 repeat counts (Bug#10507).
11722
48da7392
GM
117232012-01-26 Glenn Morris <rgm@gnu.org>
11724
11725 * lread.c (syms_of_lread): Doc fix.
11726
14af5f7f
CY
117272012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
11728
11729 * coding.c (encode_designation_at_bol): Change return value to
11730 EMACS_INT.
11731
0b21c100
CY
117322012-01-25 Chong Yidong <cyd@gnu.org>
11733
11734 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
11735
3c2907f7
CY
117362012-01-21 Chong Yidong <cyd@gnu.org>
11737
11738 * floatfns.c (Fcopysign): Make the second argument non-optional,
11739 since nil is not allowed anyway.
11740
959ad23f
AS
117412012-01-21 Andreas Schwab <schwab@linux-m68k.org>
11742
11743 * process.c (read_process_output): Use p instead of XPROCESS (proc).
11744 (send_process): Likewise.
11745
34a02f46
MR
117462012-01-19 Martin Rudalics <rudalics@gmx.at>
11747
11748 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
11749 (Vwindow_persistent_parameters): Do not use Qstate.
11750 Rewrite doc-strings.
34a02f46 11751
1259009a 117522012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
11753
11754 * character.c (char_width): New function.
70d4fdf6
GM
11755 (Fchar_width, c_string_width, lisp_string_width):
11756 Use char_width (Bug#9496).
25ed9e61 11757
6a6ee00d
MR
117582012-01-16 Martin Rudalics <rudalics@gmx.at>
11759
11760 * window.c (Vwindow_persistent_parameters): New variable.
11761 (Fset_window_configuration, save_window_save): Handle persistent
11762 window parameters.
11763
c85efaf7
EZ
117642012-01-14 Eli Zaretskii <eliz@gnu.org>
11765
11766 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
11767 thrashing the stack of the thread. (Bug#9087)
11768
5944709e
PE
117692012-01-12 Paul Eggert <eggert@cs.ucla.edu>
11770
11771 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
11772
e71f5d99
EZ
117732012-01-11 Eli Zaretskii <eliz@gnu.org>
11774
11775 * xdisp.c (rows_from_pos_range): Handle the case where the
11776 highlight ends on a newline. (Bug#10464)
11777 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
11778 he end column for display of highlight that ends on a newline
11779 before a R2L line.
11780
ce316182
GM
117812012-01-11 Glenn Morris <rgm@gnu.org>
11782
11783 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
11784 from load-path also when installation-directory is nil. (Bug#10208)
11785
5b43da69
GM
117862012-01-10 Glenn Morris <rgm@gnu.org>
11787
74cc8ff9
GM
11788 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
11789
7d8d6e4e
GM
11790 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
11791 Update template values to be closer to their typical values these days.
5b43da69 11792
a0db8d43
EZ
117932012-01-09 Eli Zaretskii <eliz@gnu.org>
11794
11795 * xdisp.c (rows_from_pos_range): Accept additional argument
11796 DISP_STRING, and accept any glyph in a row whose object is that
11797 string as eligible for mouse highlight. Fixes mouse highlight of
11798 display strings from overlays. (Bug#10464)
11799
9a0115ab 118002012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 11801
b9110d6a 11802 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
11803 * fileio.c (auto_saving_dir_umask): New static var.
11804 (Fmake_directory_internal): Use it.
11805 (do_auto_save_make_dir): Set it, instead of invoking chmod after
11806 creating the directory. The old code temporarily assigns
11807 too-generous permissions to the directory.
11808 (do_auto_save_eh): Clear it.
b9110d6a 11809 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
11810 that the var is always cleared.
11811
6c1bd3f3
EZ
118122012-01-07 Eli Zaretskii <eliz@gnu.org>
11813
11814 * search.c (scan_buffer): Pass character positions to
11815 know_region_cache, not byte positions. (Bug#6540)
11816
069d2b50
L
118172012-01-07 LynX <_LynX@bk.ru> (tiny change)
11818
11819 * w32.c (sys_rename): Report EXDEV when rename of a directory
11820 fails because the target is on another logical disk. (Bug#10284)
11821
75bf0d33
DB
118222012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
11823
11824 * xterm.c (x_embed_request_focus): New function.
11825
11826 * xterm.h: Add prototype.
11827
11828 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
11829
1c6e5a32
GM
118302012-01-05 Glenn Morris <rgm@gnu.org>
11831
11832 * emacs.c (emacs_copyright): Update short copyright year to 2012.
11833
651e947e
EZ
118342012-01-01 Eli Zaretskii <eliz@gnu.org>
11835
11836 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
11837 Load gnutls_transport_set_lowat only if GnuTLS version is below
11838 2.11.1.
11839 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
11840 GnuTLS versions below 2.11.1.
11841
3778cdd8
AL
118422011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
11843
11844 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
11845 to the doc string advising against its use for altering the way
11846 windows are scrolled.
11847
0e5317f7
KH
118482011-12-28 Kenichi Handa <handa@m17n.org>
11849
11850 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
11851 coding-system ASCII compatible only when it does not produce BOM
11852 on encoding (Bug#10383).
11853
93d5ca1f
JD
118542011-12-26 Jan Djärv <jan.h.d@swipnet.se>
11855
11856 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
11857 can scroll.
11858 (create_and_show_popup_menu): Always use menu_position_func for
11859 Gtk3 (Bug#10361).
11860
ca22b785
AS
118612011-12-24 Andreas Schwab <schwab@linux-m68k.org>
11862
11863 * callint.c (Fcall_interactively): Don't truncate prompt string.
11864
d048e1e6
EZ
118652011-12-23 Eli Zaretskii <eliz@gnu.org>
11866
11867 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
11868 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 11869 resumed from there (after widening). (Bug#10360)
d048e1e6 11870
5ccaba1f
JD
118712011-12-22 Jan Djärv <jan.h.d@swipnet.se>
11872
11873 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
11874
204ee57f
JD
118752011-12-21 Jan Djärv <jan.h.d@swipnet.se>
11876
b81d40f0
JB
11877 * nsterm.m (x_free_frame_resources):
11878 Release f->output_data.ns->miniimage.
204ee57f
JD
11879 (ns_index_color): Fix indentation. Do not retain
11880 color_table->colors[i].
11881
11882 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
11883 before returning.
11884
11885 * nsfns.m (x_set_background_color): Assign return value from
11886 ns_index_color to face-background instead of NSColor*.
11887 (ns_implicitly_set_icon_type): Fix indentation.
11888 Change assignment in for loop to comparison.
11889
11890 * emacs.c (ns_pool): New variable.
11891 (main): Assign ns_pool.
11892 (Fkill_emacs): Call ns_release_autorelease_pool.
11893
11894 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
11895 autorelease fdesc, release fdAttrs and tdict.
11896 (ns_get_covering_families): Release charset.
11897 (ns_findfonts): Release NSFontDescriptor created with new.
11898 (ns_uni_to_glyphs): Fix indentation.
11899 (setString): Release attrStr before assigning new value.
11900
c803b2b7
JD
119012011-12-18 Jan Djärv <jan.h.d@swipnet.se>
11902
678f4426
JD
11903 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
11904 and NS_IMPL_COCOA.
11905 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
11906 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
11907
cd394be1 119082011-12-18 David Reitter <reitter@cmu.edu>
678f4426 11909
5fecd5fc
JD
11910 * nsterm.m (ns_term_init): Subscribe for notifications
11911 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
11912 to method trackingNotification in EmacsMenu.
11913
11914 * nsmenu.m (trackingMenu): New variable.
3771cb17 11915 (trackingNotification): New method (from Aquamacs).
5fecd5fc 11916 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 11917 from Aquamacs (Bug#7030).
678f4426
JD
11918
119192011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 11920
c803b2b7
JD
11921 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
11922 (symbol_to_nsstring): Fix indentation.
11923 (ns_symbol_to_pb): New function.
cae07000
SM
11924 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
11925 (Fns_rotate_cut_buffers_internal): Remove.
11926 (Fns_store_selection_internal): Rename from
c803b2b7
JD
11927 Fns_store_cut_buffer_internal.
11928 (ns_get_foreign_selection, Fx_own_selection_internal)
11929 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
11930 (Fns_get_selection_internal, Fns_store_selection_internal):
11931 Use ns_symbol_to_pb and check if return value is nil.
11932 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
11933 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
11934 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
11935 renamed to Sns_store_selection_internal.
11936 (ns_handle_selection_request): Move code to Fx_own_selection_internal
11937 and remove this function.
11938 (ns_handle_selection_clear): Remove, never used.
11939 (Fx_own_selection_internal): Move code from ns_handle_selection_request
11940 here.
11941
e1b01a3a
KB
119422011-12-17 Ken Brown <kbrown@cornell.edu>
11943
11944 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
11945 GID is unknown (Bug#10257).
11946
2adb6e85
PE
119472011-12-17 Paul Eggert <eggert@cs.ucla.edu>
11948
11949 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
11950 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
11951 which caused a build failure on GNU/Linux IA-64. This problem was
11952 introduced by my 2011-10-07 patch.
11953
d1d7b339
JL
119542011-12-15 Juri Linkov <juri@jurta.org>
11955
11956 * image.c (imagemagick_error): New function. (Bug#10112)
11957 (imagemagick_load_image): Comment out `MagickSetResolution' call.
11958 Use `imagemagick_error' where ImageMagick functions return
11959 `MagickFalse'.
11960 (Fimagemagick_types): Add `Fnreverse' to return the list in the
11961 proper order.
11962
100d5755
KH
119632011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11964
11965 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
11966 fill background (Bug#8992).
11967
454592a6
MR
119682011-12-13 Martin Rudalics <rudalics@gmx.at>
11969
11970 * window.c (Vwindow_combination_resize)
11971 (Vwindow_combination_limit): Use t instead of non-nil in
11972 doc-strings.
61d4b438
MR
11973 (Vrecenter_redisplay): Add first sentence of doc-string on
11974 separate line.
53524d93 11975 (Frecenter): Fix doc-string typo.
454592a6 11976
3633e3aa
KH
119772011-12-11 Kenichi Handa <handa@m17n.org>
11978
11979 * coding.c (Funencodable_char_position): Pay attention to the
11980 buffer text relocation (Bug#9389).
11981
7b9d523a 119822011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 11983
7b9d523a
JD
11984 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
11985 gtk_init (Bug#10100).
11986
b73189c6
EZ
119872011-12-10 Eli Zaretskii <eliz@gnu.org>
11988
11989 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
11990 IT->string is nil. (Bug#10263)
11991
f7dfe5d6
JD
119922011-12-10 Jan Djärv <jan.h.d@swipnet.se>
11993
83faebb4
JD
11994 * nsterm.h (x_free_frame_resources): Declare.
11995
f7dfe5d6
JD
11996 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
11997 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
11998
11999 * nsterm.h (ns_get_defaults_value): Declare.
12000
12001 * nsterm.m (ns_default): Call ns_get_defaults_value.
12002
7cd4e72c
EZ
120032011-12-09 Eli Zaretskii <eliz@gnu.org>
12004
12005 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
12006 (Bug#10170)
12007
b34d7317
YM
120082011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12009
12010 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
12011 that where the value of an _OBJC_* symbol points to is in the .bss
12012 section (Bug#10240).
12013
76470ad1
KH
120142011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12015
12016 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 12017 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 12018
745fff94
KH
120192011-12-08 Kenichi Handa <handa@m17n.org>
12020
12021 * ftfont.c (get_adstyle_property): Fix previous change
12022 (Bug#10233).
12023
6e44397c
JB
120242011-12-07 Juanma Barranquero <lekktu@gmail.com>
12025
12026 * w32.c (init_environment): If no_site_lisp, remove site-lisp
12027 dirs from the default value of EMACSLOADPATH (bug#10208).
12028
7efa6272
GM
120292011-12-07 Glenn Morris <rgm@gnu.org>
12030
12031 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
12032 installation and source directories as well. (Bug#10208)
12033
f6fc4d87
CY
120342011-12-06 Chong Yidong <cyd@gnu.org>
12035
12036 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
12037
2bf26180
GM
120382011-12-06 Glenn Morris <rgm@gnu.org>
12039
12040 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
12041 as an error, not just -1. (Bug#10217)
12042
3a6ad4f0
CY
120432011-12-05 Chong Yidong <cyd@gnu.org>
12044
12045 * keyboard.c (process_special_events): New function.
12046 (swallow_events, Finput_pending_p): Use it (Bug#10195).
12047
75a3b399
PE
120482011-12-05 Paul Eggert <eggert@cs.ucla.edu>
12049
12050 * coding.c (encode_designation_at_bol): Don't use uninitialized
12051 local variable (Bug#9318).
12052
c3c9e25e
KH
120532011-12-05 Kenichi Handa <handa@m17n.org>
12054
12055 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
12056 return Qnil (Bug#8046, Bug#10193).
12057
5eb05ea3
KH
120582011-12-05 Kenichi Handa <handa@m17n.org>
12059
12060 * coding.c (encode_designation_at_bol): New args charbuf_end and
12061 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
12062 (coding_set_source): Return how many bytes coding->source was
12063 relocated.
12064 (coding_set_destination): Return how many bytes
12065 coding->destination was relocated.
12066 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 12067 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
12068
120692011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12070
12071 * coding.c (CODING_CHAR_CHARSET_P): New macro.
12072 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
12073 macro (Bug#9318).
12074
120752011-12-05 Andreas Schwab <schwab@linux-m68k.org>
12076
12077 The following changes are to fix Bug#9318.
12078
a79703f5 12079 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
12080 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
12081 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 12082 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 12083
7dbda6df
JB
120842011-12-05 Juanma Barranquero <lekktu@gmail.com>
12085
12086 * lisp.h (process_quit_flag): Fix external declaration.
12087
6d5eb5b0
SM
120882011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
12089
12090 Don't macro-inline non-performance-critical code.
12091 * eval.c (process_quit_flag): New function.
12092 * lisp.h (QUIT): Use it.
12093
a0c3fad0
JD
120942011-12-04 Jan Djärv <jan.h.d@swipnet.se>
12095
12096 * nsfns.m (get_geometry_from_preferences): New function.
12097 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
12098
6c07aac2
AS
120992011-12-04 Andreas Schwab <schwab@linux-m68k.org>
12100
12101 * emacs.c (Qkill_emacs): Define.
12102 (syms_of_emacs): Initialize it.
12103 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
12104 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
12105 (quit_throw_to_read_char): Add parameter `from_signal'.
12106 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
12107 * lisp.h (QUIT): Call Fkill_emacs if requested.
12108
c052ead4
JD
121092011-12-03 Jan Djärv <jan.h.d@swipnet.se>
12110
12111 * widget.c (update_wm_hints): Return if wmshell is null.
12112 (widget_update_wm_size_hints): New function.
12113
12114 * widget.h (widget_update_wm_size_hints): Declare.
12115
12116 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
12117 widget_update_wm_size_hints (Bug#10104).
12118
9e49252b
EZ
121192011-12-03 Eli Zaretskii <eliz@gnu.org>
12120
12121 * xdisp.c (handle_invisible_prop): If the invisible text ends just
12122 before a newline, prepare the bidi iterator for consuming the
12123 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 12124 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 12125
02b16839
JL
121262011-12-02 Juri Linkov <juri@jurta.org>
12127
12128 * search.c (Fword_search_regexp): New Lisp function created from
12129 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
12130 (Fword_search_backward, Fword_search_forward)
12131 (Fword_search_backward_lax, Fword_search_forward_lax):
12132 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
12133 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
12134
0068070e
SM
121352011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
12136
12137 * fileio.c (Finsert_file_contents): Move after-change-function call
12138 to before the "handled:" label, since all "goto handled" appear in
12139 cases where the *-change-functions have already been properly called
12140 (bug#10117).
12141
3360a3fc
AS
121422011-12-01 Andreas Schwab <schwab@linux-m68k.org>
12143
12144 * keyboard.c (interrupt_signal): Don't call kill-emacs when
12145 waiting for input. (Bug#10169)
12146
73d6c093
EZ
121472011-11-30 Eli Zaretskii <eliz@gnu.org>
12148
12149 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
12150 verifies glyph row's hash code--we have just reallocated the
12151 glyphs, so their contents can be complete garbage. (Bug#10164)
12152
febe6bea
JB
121532011-11-30 Juanma Barranquero <lekktu@gmail.com>
12154
12155 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
12156
801a4313
EZ
121572011-11-30 Eli Zaretskii <eliz@gnu.org>
12158
12159 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
12160 attributes are tested _before_ calling verify_row_hash, to protect
12161 against GCC re-ordering of the tests. (Bug#10164)
12162
2b56b87e
JD
121632011-11-29 Jan Djärv <jan.h.d@swipnet.se>
12164
12165 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
12166
12167 * xterm.c (handle_one_xevent): Only set async_visible and friends
12168 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 12169 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
12170 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
12171
dbf31225
PE
121722011-11-28 Paul Eggert <eggert@cs.ucla.edu>
12173
12174 Remove GCPRO-related macros that exist only to avoid shadowing locals.
12175 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
12176 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
12177 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12178 All uses changed to use GCPRO1 etc.
12179 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
12180 Revert to old implementation (i.e., before 2011-03-11).
12181
1305621b
YM
121822011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12183
12184 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
12185 of scroll runs so as to avoid assigning disabled bogus rows and
12186 unnecessary graphics copy operations.
12187
8c9afb46
EZ
121882011-11-27 Eli Zaretskii <eliz@gnu.org>
12189
12190 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
12191 (snprintf) [_MSC_VER]: Redirect to _snprintf.
12192 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
12193 (malloc, free, realloc, calloc): Redirect to e_* only when
12194 compiling Emacs.
12195
12196 * lisp.h (GCTYPEBITS): Move before first use.
12197 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
12198 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
12199 this macro definition.
12200
12201 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
12202 _MSC_VER.
12203
54e9e3bf
JD
122042011-11-27 Jan Djärv <jan.h.d@swipnet.se>
12205
6d5eb5b0
SM
12206 * gtkutil.c (xg_create_frame_widgets):
12207 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
12208 present with Gtk+ 2.0.
12209
83aca1cb
PE
122102011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12211
12212 * fileio.c (Finsert_file_contents): Undo previous change; see
12213 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
12214
5b76caa4
PE
122152011-11-26 Paul Eggert <eggert@cs.ucla.edu>
12216
12217 Rename locals to avoid shadowing.
12218 * fileio.c (Finsert_file_contents):
12219 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
12220 * process.c (wait_reading_process_output):
12221 Rename inner 'proc' to 'p' to avoid shadowing.
12222 Indent for consistency with usual Emacs style.
12223
8c535114
EZ
122242011-11-25 Eli Zaretskii <eliz@gnu.org>
12225
12226 * xdisp.c (redisplay_window): If cursor row is not fully visible
12227 after recentering, and scroll-conservatively is set to a large
12228 number, scroll window by a few more lines to make the cursor fully
12229 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
12230 (start_display): Don't move to the next line if the display should
12231 start at a newline that is part of a display vector or an overlay
12232 string. (Bug#10119)
8c535114 12233
fa4fdb5c
JL
122342011-11-24 Juri Linkov <juri@jurta.org>
12235
12236 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
12237 after the `MagickPingImage' call. (Bug#10112)
12238
90ec88df
CY
122392011-11-23 Chong Yidong <cyd@gnu.org>
12240
12241 * window.c (Fcoordinates_in_window_p): Accept only live windows.
12242
56e2e794
MR
122432011-11-23 Martin Rudalics <rudalics@gmx.at>
12244
12245 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
12246 making another buffer current. (Bug#10114)
12247
b6e64c41
GM
122482011-11-23 Glenn Morris <rgm@gnu.org>
12249
12250 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
12251
6b21de18
CY
122522011-11-23 Chong Yidong <cyd@gnu.org>
12253
12254 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
12255 using it (Bug#5984).
12256
b12cd789
EZ
122572011-11-22 Eli Zaretskii <eliz@gnu.org>
12258
12259 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
12260 and header-lines, as they don't have one computed for them.
12261 (Bug#10098)
12262
12263 * .gdbinit (prow): Make displayed values more self-explaining.
12264 Add row's hash code.
12265
261b6fd4
LMI
122662011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
12267
12268 * process.c (wait_reading_process_output): Fix asynchrounous
12269 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 12270 (wait_reading_process_output): Add comment and URL.
261b6fd4 12271
e7cfd277
JD
122722011-11-21 Jan Djärv <jan.h.d@swipnet.se>
12273
12274 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
12275
a9b9b7f5
CY
122762011-11-21 Chong Yidong <cyd@gnu.org>
12277
12278 * window.c (Fnext_window, Fprevious_window): Doc fix.
12279
b0d15b4f
SM
122802011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12281
12282 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
12283
fe7a3057
JB
122842011-11-20 Juanma Barranquero <lekktu@gmail.com>
12285
12286 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
12287
d2999b1a
MR
122882011-11-20 Martin Rudalics <rudalics@gmx.at>
12289
12290 * window.c (Fset_window_combination_limit): Rename argument
12291 STATUS to LIMIT.
12292 (Vwindow_combination_limit): Remove "status" from doc-string.
12293
d5ff9cd0
AS
122942011-11-20 Andreas Schwab <schwab@linux-m68k.org>
12295
12296 * m/ibms390.h: Remove.
12297 * m/ibms390x.h: Don't include "ibms390.h".
12298
a5bb9bd3
SM
122992011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
12300
12301 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
12302 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
12303
cd1181db
JB
123042011-11-20 Juanma Barranquero <lekktu@gmail.com>
12305
12306 * casetab.c (Fset_case_table):
12307 * charset.c (Fcharset_after): Fix typos.
12308
615a3b8d 123092011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 12310
17e845af
PE
12311 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
12312 Otherwise, valgrind does not work on some platforms.
12313 Problem reported by Andreas Schwab in
6a0bf43d
PE
12314 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12315 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
12316 is set, removing the need for VIRT_ADDRESS_VARIES.
12317 (PURE_P): Use a more-efficient implementation that needs just one
12318 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
12319 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
12320 to 4 (xorl, subq, cmpq, setbe).
12321 * alloc.c (pure): Always extern now, since that's the
12322 VIRT_ADDR_VARIES behavior.
12323 (PURE_POINTER_P): Use a single comparison, not two, for
12324 consistency with the new puresize.h.
12325 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
12326 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
12327 Remove VIRT_ADDR_VARIES no longer needed.
12328
f8fe6f96
EZ
123292011-11-19 Eli Zaretskii <eliz@gnu.org>
12330
12331 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
12332 (erase_phys_cursor, update_window_cursor, show_mouse_face)
12333 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
12334 behave as if the cursor position were at the window margin.
12335
12336 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
12337 and the cursor position is out of bounds, behave as if the cursor
12338 position were at the window margin. (Bug#10075)
12339
df05a53c
CY
123402011-11-18 Chong Yidong <cyd@gnu.org>
12341
12342 * window.c (Fwindow_combination_limit): Make first argument
12343 non-optional, since it is meaningless for live windows like the
12344 selected window.
61ccba97 12345
2071918e
DA
123462011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
12347
12348 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
12349
b50a28de
SM
123502011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
12351
12352 * intervals.c: Fix grafting over the whole buffer (bug#10071).
12353 (graft_intervals_into_buffer): Simplify.
12354
015137db
EZ
123552011-11-18 Eli Zaretskii <eliz@gnu.org>
12356
12357 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
12358 hash values of the two rows.
12359 (copy_row_except_pointers): Preserve the used[] arrays and the
12360 hash values of the two rows. (Bug#10035)
68c95424 12361 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
12362
12363 * xdisp.c (row_hash): New function, body extracted from
12364 compute_line_metrics.
12365 (compute_line_metrics): Call row_hash, instead of computing the
12366 hash code inline.
12367
12368 * dispnew.c (verify_row_hash): Call row_hash for computing the
12369 hash code of a row, instead of duplicating code from xdisp.c.
12370
12371 * dispextern.h (row_hash): Add prototype.
12372
a2addb04
TH
123732011-11-18 Tassilo Horn <tassilo@member.fsf.org>
12374
12375 * frame.c (delete_frame): Don't delete the terminal when the last
12376 X frame is closed if emacs is built with GTK toolkit.
12377
df85d315
JB
123782011-11-17 Juanma Barranquero <lekktu@gmail.com>
12379
12380 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
12381
a0c2d0ae
MR
123822011-11-17 Martin Rudalics <rudalics@gmx.at>
12383
12384 * window.c (Vwindow_splits): Rename to
12385 Vwindow_combination_resize. Suggested by Juri Linkov.
12386 (Fsplit_window_internal): Use Vwindow_combination_resize instead
12387 of Vwindow_splits.
12388
58179cce
JB
123892011-11-16 Juanma Barranquero <lekktu@gmail.com>
12390
7877f373
JB
12391 * nsfns.m (Fns_font_name):
12392 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 12393
b6f67890
MR
123942011-11-16 Martin Rudalics <rudalics@gmx.at>
12395
12396 * window.h (window): Rename slot "nest" to "combination_limit".
12397 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
12398 (Fset_window_nest): Rename to Fset_window_combination_limit.
12399 (Vwindow_nest): Rename to Vwindow_combination_limit.
12400 (recombine_windows, make_parent_window, make_window)
12401 (Fsplit_window_internal, saved_window)
12402 (Fset_window_configuration, save_window_save): Rename all
12403 occurrences of window_nest to window_combination_limit.
12404
c7015153
JB
124052011-11-15 Juanma Barranquero <lekktu@gmail.com>
12406
12407 * image.c (imagemagick_load_image): Fix typo.
12408
322ad6ec
EZ
124092011-11-14 Eli Zaretskii <eliz@gnu.org>
12410
12411 * xdisp.c (display_line): Move the call to
12412 highlight_trailing_whitespace before the call to
12413 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
12414 faces of all the glyphs to compute ROW's hash value.
12415 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 12416
f067b8ec
JB
124172011-11-14 Juanma Barranquero <lekktu@gmail.com>
12418
12419 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
12420 just return (bug#10044).
12421
1e5b2111
EZ
124222011-11-12 Eli Zaretskii <eliz@gnu.org>
12423
7ef3cbd5
EZ
12424 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
12425 with user-defined heap size. Bump the default size of the temacs
12426 heap to 27MB, to avoid memory warning when running temacs.
12427 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
12428
1e5b2111
EZ
12429 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
12430 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
12431 (verify_row_hash) [XASSERTS]: New function.
12432 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
12433 that the hash value of glyph rows is correct.
1e5b2111 12434
89d61221
MR
124352011-11-12 Martin Rudalics <rudalics@gmx.at>
12436
12437 * window.h (window): Remove splits slot.
12438 * window.c (Fwindow_splits, Fset_window_splits): Remove.
12439 (Fdelete_other_windows_internal, make_parent_window)
12440 (make_window, Fsplit_window_internal, Fdelete_window_internal)
12441 (Fset_window_configuration, save_window_save): Don't deal with
12442 split status of windows.
12443 (saved_window): Remove splits slot.
12444 (Vwindow_splits): Rewrite doc-string.
12445
97f18cc8
JD
124462011-11-11 Jan Djärv <jan.h.d@swipnet.se>
12447
12448 * xfns.c (unwind_create_frame):
12449 * nsfns.m (unwind_create_frame):
12450 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
12451 Vframe_list (Bug#9999).
12452
22a648b4
DA
124532011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
12454
0b381c7e 12455 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 12456
659afede
KH
124572011-11-11 Kenichi Handa <handa@m17n.org>
12458
12459 * callproc.c (Fcall_process): Set the member dst_multibyte of
12460 process_coding.
12461
9ac0394b
KH
124622011-11-11 Johan Bockgård <bojohan@gnu.org>
12463
12464 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
12465 avoid a crash (bug#9496).
12466
2fbdc249
CY
124672011-11-09 Chong Yidong <cyd@gnu.org>
12468
12469 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
12470 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
12471
ac6b1f81
PE
124722011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12473
12474 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
12475
09db192c
PE
124762011-11-08 Paul Eggert <eggert@cs.ucla.edu>
12477
12478 Avoid some portability problems by eschewing 'extern inline' functions.
12479 The trivial performance wins aren't worth the portability hassles; see
12480 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
12481 et seq.
12482 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12483 (window_box_width, window_box_left, window_box_left_offset)
12484 (window_box_right, window_box_right_offset): Undo previous change,
12485 by removing the "extern"s.
12486 * intervals.c (adjust_intervals_for_insertion)
12487 (adjust_intervals_for_deletion): Undo previous change,
12488 making these static again.
12489 (offset_intervals, temp_set_point_both, temp_set_point)
12490 (copy_intervals_to_string): No longer inline.
12491 * xdisp.c (window_text_bottom_y, window_box_width)
12492 (window_box_height, window_box_left_offset)
12493 (window_box_right_offset, window_box_left, window_box_right)
12494 (window_box): No longer inline.
12495
105216ed
CY
124962011-11-08 Chong Yidong <cyd@gnu.org>
12497
12498 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
12499 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
12500 Signal an error if not a live window.
105216ed
CY
12501 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
12502 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
12503
ae9e237f
JB
125042011-11-07 Juanma Barranquero <lekktu@gmail.com>
12505
12506 * lisp.h (syms_of_abbrev): Remove declaration.
12507 Reported by CHENG Gao <chenggao@royau.me>.
12508
c7aa8333
EZ
125092011-11-07 Eli Zaretskii <eliz@gnu.org>
12510
12511 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
12512 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
12513 of temacs in GUI mode.
12514
be7f5545
MR
125152011-11-07 Martin Rudalics <rudalics@gmx.at>
12516
12517 * window.h: Declare delete_all_child_windows instead of
12518 delete_all_subwindows.
12519 * window.c (Fwindow_nest, Fset_window_nest)
12520 (Fset_window_new_total, Fset_window_new_normal)
12521 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
12522 (delete_all_subwindows): Rename to delete_all_child_windows.
12523 (Fdelete_other_windows_internal, Fset_window_configuration):
12524 Call delete_all_child_windows instead of delete_all_subwindows.
12525 * frame.c (delete_frame): Call delete_all_child_windows instead
12526 of delete_all_subwindows.
12527
ca78dc43
PE
125282011-11-07 Paul Eggert <eggert@cs.ucla.edu>
12529
12530 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
12531 This is also needed for porting to any host where GC_MARK_STACK is
12532 not GC_MAKE_GCPROS_NOOPS.
12533 (which_symbols): Use it.
12534
a0241d01
KH
125352011-11-07 Kenichi Handa <handa@m17n.org>
12536
12537 * coding.c (coding_set_destination): Check coding->src_pos only
12538 when coding->src_object is a buffer (bug#9910).
12539
12540 * process.c (send_process): Set the member src_multibyte of coding
12541 to 0 (bug#9911) when sending a unibyte text.
12542
12543 * callproc.c (Fcall_process): Set the member src_multibyte of
12544 process_coding to 0 (bug#9912).
12545
a64bfdfa 125462011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
12547
12548 * xmenu.c (cleanup_widget_value_tree): New function.
12549 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
12550 calling free_menubar_widget_value_tree directly (Bug#9830).
12551
cb41b32a
PE
125522011-11-06 Paul Eggert <eggert@cs.ucla.edu>
12553
12554 Fix some portability problems with 'inline'.
12555 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
12556 (window_box_width, window_box_left, window_box_left_offset)
12557 (window_box_right, window_box_right_offset): Declare extern.
12558 Otherwise, these inline functions do not conform to C99 and
12559 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
12560 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
12561 * intervals.c (adjust_intervals_for_insertion)
12562 (adjust_intervals_for_deletion): Now extern, because otherwise the
12563 extern inline functions 'offset_intervals' couldn't refer to it.
12564 (static_offset_intervals): Remove.
12565 (offset_intervals): Rewrite using the old contents of
12566 static_offset_intervals. The old version didn't conform to C99
12567 because an extern inline function contained a reference to an
12568 identifier with static linkage.
12569
b7041366
AS
125702011-11-06 Andreas Schwab <schwab@linux-m68k.org>
12571
12572 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
12573 GC.
12574
88a37c4d
EZ
125752011-11-06 Eli Zaretskii <eliz@gnu.org>
12576
12577 * xdisp.c (init_iterator, reseat_to_string): Don't set the
12578 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
12579 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
12580 return Qleft_to_right.
12581
49745b39
CY
125822011-11-06 Chong Yidong <cyd@gnu.org>
12583
12584 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
12585 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
12586 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
12587 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
12588 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
12589 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
12590 (Fwindow_vscroll): Doc fix.
12591 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
12592 argument, since it makes no sense to pass a live window and for
12593 consistency with window-child.
12594
1f05cd82
CS
125952011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
12596
12597 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
12598 support MSVC.
12599
22610910
JR
126002011-11-05 Jason Rumney <jasonr@gnu.org>
12601
12602 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
12603 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
12604 fonts (Bug#6029).
12605 (add_font_entity_to_list): Fix logic errors in mixed boolean and
12606 bitwise arithmetic preventing use of unicode-sip and non-truetype
12607 opentype fonts.
12608
a06776b2
EZ
126092011-11-05 Eli Zaretskii <eliz@gnu.org>
12610
3ad924ba
EZ
12611 * s/ms-w32.h (fstat, stat, utime): Move redirections to
12612 "emacs"-only part.
12613
a06776b2
EZ
12614 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
12615 initialization code to keep similarity to xfns.c after changes
12616 from 2011-11-05.
12617
c9e7db78
JD
126182011-11-05 Jan Djärv <jan.h.d@swipnet.se>
12619
a97f8f3f
JD
12620 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
12621 (unwind_create_frame): New function (Bug#9943).
12622 (Fx_create_frame): Restructure code to be more similar to the one in
12623 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
12624 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
12625 Move terminal->reference_count++ just before making the frame official
12626 (Bug#9943).
12627
12628 * nsterm.m (x_free_frame_resources): New function.
12629 (x_destroy_window): Move code to x_free_frame_resources.
12630
c9e7db78 12631 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
12632 (Fx_create_frame, x_create_tip_frame):
12633 Move terminal->reference_count++ just before making the frame
75f1671a 12634 official. Move initialization of image_cache_refcount and
c9e7db78
JD
12635 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
12636
a6fc3b5c
EZ
126372011-11-05 Eli Zaretskii <eliz@gnu.org>
12638
12639 Support MSVC build with newer versions of Visual Studio.
12640 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
12641 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
12642 nt/gmake.defs.
12643
12644 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
12645 which are not supported by MSVC.
12646 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
12647 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
12648 bitfields.
12649 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
12650 types in bitfields.
12651 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
12652
12653 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
12654
58179cce 126552011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
12656
12657 Support MSVC build with newer versions of Visual Studio.
12658 * w32.c: Don't include w32api.h for MSVC.
12659 (init_environment) [_MSC_VER]: Call sys_access, not _access.
12660
12661 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
12662 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
12663 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
12664 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
12665 e_* cousins.
12666 (alloca) [_MSC_VER]: Define to _alloca.
12667
12668 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
12669
12670 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
12671
a58c13ed
EZ
126722011-11-04 Eli Zaretskii <eliz@gnu.org>
12673
12674 * xdisp.c (note_mouse_highlight): If either of
12675 previous/next-single-property-change returns nil, treat that as
12676 the beginning or the end of the buffer. (Bug#9955)
12677
fe0b6370
JD
126782011-11-04 Jan Djärv <jan.h.d@swipnet.se>
12679
a58c13ed 12680 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
12681 label is not null (Bug#9951).
12682 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
12683 may be NULL.
12684
89bd5ee1
EZ
126852011-11-04 Eli Zaretskii <eliz@gnu.org>
12686
12687 * window.c (Fwindow_body_size): Mention in the doc string that the
12688 return value is in frame's canonical units. (Bug#9949)
12689
84c3edb9
EZ
126902011-11-03 Eli Zaretskii <eliz@gnu.org>
12691
4e2fb5c7
EZ
12692 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
12693
84c3edb9 12694 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 12695 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 12696 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 12697
bc17a887
EZ
126982011-11-01 Eli Zaretskii <eliz@gnu.org>
12699
12700 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
12701 Don't stop backward scan on the continuation glyph, even though
12702 its CHARPOS is positive.
6d5eb5b0
SM
12703 (mouse_face_from_buffer_pos, note_mouse_highlight):
12704 Rename cover_string to disp_string.
bc17a887 12705
4ee88440
MR
127062011-11-01 Martin Rudalics <rudalics@gmx.at>
12707
12708 * window.c (temp_output_buffer_show): Don't use
12709 Vtemp_buffer_show_specifiers.
12710 (Vtemp_buffer_show_specifiers): Remove unused variable.
12711
c2ff3c02
EZ
127122011-10-30 Eli Zaretskii <eliz@gnu.org>
12713
12714 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
12715 past the beginning of the current glyph matrix.
12716
58179cce 127172011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
12718
12719 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
12720 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
12721 HAVE_GTK3 (Bug#9869).
b77a6a7f 12722
3b574623
JD
12723 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
12724 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
12725
b77a6a7f
JD
12726 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
12727
12728 * xterm.c: Declare x_handle_net_wm_state to return int.
12729 (handle_one_xevent): Check if we are iconified but don't have
12730 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
12731 (get_current_wm_state): Return non-zero if not hidden,
12732 check for _NET_WM_STATE_HIDDEN (Bug#9893).
12733 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
12734 (x_handle_net_wm_state): Return what get_current_wm_state returns.
12735 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
12736
196e41e4
PE
127372011-10-29 Paul Eggert <eggert@cs.ucla.edu>
12738
12739 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
12740 so that this new function doesn't get optimized away by a
12741 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
12742
021f2e1a
AS
127432011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12744
12745 * frame.h (MOUSE_HL_INFO): Remove excess parens.
12746
8b058d44
EZ
127472011-10-29 Eli Zaretskii <eliz@gnu.org>
12748
12749 Fix the `xbytecode' command.
12750 * .gdbinit (xprintbytestr): New command.
b50a28de 12751 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
12752 (xbytecode): Print the byte-code string as well.
12753
4452fb80
EZ
127542011-10-29 Kim Storm <storm@cua.dk>
12755
8b058d44
EZ
12756 * alloc.c (which_symbols): New function.
12757
21b72067
AS
127582011-10-29 Andreas Schwab <schwab@linux-m68k.org>
12759
12760 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
12761 line. (Bug#9903)
12762
83ed7b5c
GM
127632011-10-29 Glenn Morris <rgm@gnu.org>
12764
12765 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
12766 Not clear what it was for, and it causes various bugs. (Bug#9839)
12767
5a7a728b
EZ
127682011-10-28 Eli Zaretskii <eliz@gnu.org>
12769
12770 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
12771 possible random value that matches one of those tested as
12772 condition to clear the mouse face.
12773
d3d0842f
CY
127742011-10-28 Chong Yidong <cyd@gnu.org>
12775
12776 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
12777
31b39d13
DN
127782011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
12779
12780 * window.c (make_window): Initialize phys_cursor_on_p.
12781
9aba6043
SM
127822011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
12783
12784 * lisp.h (struct Lisp_Symbol): Update comments.
12785
c20992f4
JB
127862011-10-28 Juanma Barranquero <lekktu@gmail.com>
12787
12788 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
12789
db4f02f2
EZ
127902011-10-28 Eli Zaretskii <eliz@gnu.org>
12791
12792 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
12793 <oslsachem@gmail.com> for helping to debug this.
12794
12795 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
12796 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
12797 (g_b_init_get_glyph_outline_w): New static variables.
12798 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
12799 (GetGlyphOutlineW_Proc): New typedefs.
12800 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
12801 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
12802 New functions.
12803 (w32font_open_internal, compute_metrics):
12804 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
12805 instead of calling the "wide" APIs directly.
12806
12807 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
12808
12809 * w32.h (syms_of_w32font): Add prototype.
12810
87e68db4
JB
128112011-10-27 Juanma Barranquero <lekktu@gmail.com>
12812
12813 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
12814 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
12815 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
12816 (Fmove_to_window_line): Doc fix.
12817
435c1d67
CY
128182011-10-27 Chong Yidong <cyd@gnu.org>
12819
12820 * process.c (make_process): Set gnutls_state to NULL.
12821
12822 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
12823 non-NULL, regardless of GNUTLS_INITSTAGE.
12824 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
12825 an error. Set process slots as soon as we allocate them.
12826
12827 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
12828
9c6c6f49
CY
128292011-10-27 Chong Yidong <cyd@gnu.org>
12830
9aba6043
SM
12831 * gnutls.c (emacs_gnutls_deinit): New function.
12832 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
12833 (Fgnutls_deinit, Fgnutls_boot): Use it.
12834
12835 * process.c (make_process): Initialize GnuTLS credentials to NULL.
12836 (deactivate_process): Call emacs_gnutls_deinit.
12837
657d08d3
JB
128382011-10-27 Juanma Barranquero <lekktu@gmail.com>
12839
12840 * image.c (x_create_x_image_and_pixmap):
12841 * w32.c (sys_rename, w32_delayed_load):
12842 * w32font.c (fill_in_logfont):
12843 * w32reg.c (x_get_string_resource): Silence compiler warnings.
12844
5430d399
JB
128452011-10-26 Juanma Barranquero <lekktu@gmail.com>
12846
12847 * w32fns.c (w32_default_color_map): New function,
12848 extracted from Fw32_default_color_map.
a7ef684b 12849 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 12850
fe0055fa
PE
128512011-10-25 Paul Eggert <eggert@cs.ucla.edu>
12852
12853 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
12854
e6346438
SM
128552011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
12856
12857 * keyboard.c (test_undefined): New function (bug#9751).
12858 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
12859
e112cc37
ET
128602011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
12861
12862 * sysdep.c (init_sys_modes): Fix the check for the controlling
12863 terminal (Bug#6649).
12864
7b5d6677
EZ
128652011-10-20 Eli Zaretskii <eliz@gnu.org>
12866
12867 * dispextern.h (struct bidi_it): New member next_en_type.
12868
12869 * bidi.c (bidi_line_init): Initialize the next_en_type member.
12870 (bidi_resolve_explicit_1): When next_en_pos is valid for the
12871 current character, check also for next_en_type being WEAK_EN.
12872 (bidi_resolve_weak): Don't enter the expensive loop if the current
12873 position is before next_en_pos. Record the bidi type of the first
12874 non-ET, non-BN character we find, in addition to its position.
12875 (bidi_level_of_next_char): Invalidate next_en_type when
12876 next_en_pos is over-stepped.
12877
7da0b018
PE
128782011-10-20 Paul Eggert <eggert@cs.ucla.edu>
12879
12880 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
12881 * editfns.c: Rewrite current-time-zone so that it invokes
12882 the equivalent of (format-time-string "%Z") to get the time zone name.
12883 This fixes a bug when the time zone name contains characters that
12884 need converting from the system time locale to Emacs internal format.
12885 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
12886 that patch fixed format-time-string to do the conversion, but
12887 I forgot to fix current-time-zone.
12888 (format_time_string): New function, containing most of
12889 what Fformat_time_string used to contain.
12890 (Fformat_time_string): Rewrite in terms of format_time_string.
12891 This doesn't change this function's behavior.
12892 (current-time-zone): Rewrite to use format_time_string.
12893 This fixes the bug reported by Michael Schierl in
12894 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
12895 Jason Rumney's 2007-06-07 change worked around this bug, but
12896 didn't fix it.
12897 * systime.h (tzname, timezone): Remove no-longer-used declarations.
12898
8547b010
EZ
128992011-10-19 Eli Zaretskii <eliz@gnu.org>
12900
12901 * xdisp.c (start_display): If the character at POS is displayed
12902 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
12903 (try_window_reusing_current_matrix): If a line ends in a display
12904 vector or the next line starts in a display vector, continue
12905 redrawing the window even though the character position of
12906 start_row was reached.
8547b010
EZ
12907 (Bug#9771, part 2)
12908
4e948d15
CY
129092011-10-18 Chong Yidong <cyd@gnu.org>
12910
12911 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
12912 with nobreak-char-display too.
12913
4787455f
EZ
129142011-10-18 Eli Zaretskii <eliz@gnu.org>
12915
12916 Fix part 3 of bug#9771.
12917 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
12918 (bidi_resolve_neutral): Don't enter the expensive loop looking for
12919 non-neutral characters if the current character is a paragraph
12920 separator (a.k.a. Newline). This avoids running the same
12921 expensive loop twice, once when we consume the preceding newline
12922 and the other time when the line actually needs to be displayed.
12923 Avoid the loop when we see neutrals on the base embedding level
12924 following a character whose directionality is the same as the
12925 paragraph's. This avoids running the expensive loop when a line
12926 ends in a long sequence of neutrals, like control characters.
12927 Add assertion against STRONG_AL type. Slightly rearrange code
12928 that determines the type of a neutral given the first non-neutral
12929 that follows it.
12930 (bidi_level_of_next_char): Set next_en_pos to zero when
12931 invalidating its info.
12932
2c91f553
EZ
129332011-10-17 Eli Zaretskii <eliz@gnu.org>
12934
12935 * xdisp.c (push_display_prop): Determine whether to record string
12936 or buffer position by IT->string, not by IT->method. Allow
12937 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
12938 (move_it_vertically_backward): Don't look for character position
12939 immediately after the newline when in a continuation line.
12940 (Bug#9771, part 1)
2c91f553 12941
c7b08b0d
MR
129422011-10-15 Martin Rudalics <rudalics@gmx.at>
12943
12944 * window.c (coordinates_in_window): Rewrite and delabelize
12945 vertical border check. (Bug#5357) (Bug#9618)
12946
6b02f655
SM
129472011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
12948
12949 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
12950 errors in XSetWindowBorder (bug#9310).
12951
81d40c92
DA
129522011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
12953
12954 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
12955 avoid crash when xmalloc overrun checking is enabled.
12956
d4172c3b
EZ
129572011-10-13 Eli Zaretskii <eliz@gnu.org>
12958
12959 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
12960 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
12961 cursor motion with <left> and <right> arrow keys.
12962
12963 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
12964 some callers set that themselves.
12965
b00eea75
EZ
129662011-10-12 Eli Zaretskii <eliz@gnu.org>
12967
12968 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
12969 display string and the previous row comes from the same string and
12970 is empty. (Bug#9739) (Bug#9738)
12971
8fe012c4
SM
129722011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
12973
12974 * doc.c (get_doc_string): Encode file name (bug#9735).
12975
0074aef2
EZ
129762011-10-12 Eli Zaretskii <eliz@gnu.org>
12977
79beb178
EZ
12978 * bidi.c (bidi_level_of_next_char):
12979 * xdisp.c (get_visually_first_element): Remove old incorrect
12980 comments regarding the Unicode Line Separator character.
12981
0074aef2
EZ
12982 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
12983
6e4b3fbe
DA
129842011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
12985
12986 * alloc.c (Fgc_status): Do not access beyond zombies array
12987 boundary if nzombies > MAX_ZOMBIES.
12988 * alloc.c (dump_zombies): Add missing format specifier.
12989
0324f3af
PE
129902011-10-12 Paul Eggert <eggert@cs.ucla.edu>
12991
b5525cac
PE
12992 * xdisp.c (set_cursor_from_row): Simplify conditionals,
12993 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
12994
0324f3af
PE
12995 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
12996 Some packages use them to denote characters with modifiers.
12997
e9b5f888
AS
129982011-10-11 Andreas Schwab <schwab@linux-m68k.org>
12999
13000 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
13001 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
13002 matching a pp-number. Rename parameter var to var1.
13003
127827c0
SM
130042011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
13005
13006 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
13007
c8fd3bd0
GM
130082011-10-08 Glenn Morris <rgm@gnu.org>
13009
13010 * callint.c (Fcall_interactively): Give a more explicit error for the
13011 'c' case with a non-character input. (Bug#8479)
13012
352ec8ff
EZ
130132011-10-08 Eli Zaretskii <eliz@gnu.org>
13014
03669ccb
EZ
13015 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
13016 lines.
7061c986
EZ
13017 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
13018 lines that are hscrolled on the left.
03669ccb 13019
352ec8ff
EZ
13020 * dispnew.c (buffer_posn_from_coords): Account for a possible
13021 presence of header-line. (Bug#4426)
13022
a66cfb1c
SM
130232011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
13024
6b02f655
SM
13025 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
13026 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 13027
7c5ee88e
PE
130282011-10-07 Paul Eggert <eggert@cs.ucla.edu>
13029
13030 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
13031 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
13032 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
13033 this makes Emacs dump core during garbage collection on rare
13034 occasions. sizeof is obviously inferior to offsetof here, so
13035 stick with offsetof.
13036 (GC_POINTER_ALIGNMENT): New macro.
13037 (mark_memory): Omit 3rd (offset) arg; caller changed.
13038 Don't assume EMACS_INT alignment is the same as pointer alignment.
13039
df1bbe5b
SM
130402011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
13041
13042 * keyboard.c (read_key_sequence_remapped): New var.
13043 (read_key_sequence): Compute remapping in the right buffer.
13044 (command_loop_1): Use read_key_sequence's remapping directly.
13045
51553db6
SM
130462011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
13047
32c1fffd
SM
13048 * dired.c (file_name_completion): Don't expand file name.
13049 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
13050 before checking file name handler.
13051
51553db6
SM
13052 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
13053 they've been requested explicitly (bug#9591).
13054
b6bd1599 130552011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
13056
13057 * keymap.c (Fsingle_key_description): Use make_specified_string
13058 instead of build_string to build string from push_key_description.
13059 (Bug#5193)
13060
f701dc2a
PE
130612011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13062
4222c55d
PE
13063 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
13064 This fixes a Y2038 bug on 64-bit hosts.
13065 * buffer.c (reset_buffer):
13066 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
13067 (Fclear_buffer_auto_save_failure):
13068 Use 0, not -1, to represent an unset failure time, since time_t
13069 might not be signed.
13070
f701dc2a
PE
13071 Remove dependency on glibc malloc internals.
13072 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13073 Move back here from lisp.h, but with their new implementations.
13074 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13075 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
13076 * charset.c (charset_table_init): New static var.
13077 (syms_of_charset): Use it instead of xmalloc. This removes a
13078 dependency on glibc malloc internals. See Eli Zaretskii's comment in
13079 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
13080 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13081 Move back to alloc.c.
13082 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13083 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
13084
9ceebf39
JD
130852011-09-30 Jan Djärv <jan.h.d@swipnet.se>
13086
13087 * nsterm.m (windowDidResize): Call x_set_window_size only when
13088 ns_in_resize is true. Otherwise set pixelwidth/height and
13089 call change_frame_size (Bug#9628).
13090
cb993c58
PE
130912011-09-30 Paul Eggert <eggert@cs.ucla.edu>
13092
3930c88b
PE
13093 Port --enable-checking=all to Fedora 14 x86-64.
13094 * charset.c (syms_of_charset): Also account for glibc malloc's
13095 internal overhead when calculating the initial malloc maximum.
13096
cb993c58
PE
13097 Port --enable-checking=all to Fedora 14 x86.
13098 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13099 Move to lisp.h.
13100 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
13101 (overrun_check_realloc, overrun_check_free):
13102 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
13103 That way, xmalloc returns a properly-aligned pointer even if
13104 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
13105 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
13106 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
13107 into account when calculating the initial malloc maximum.
13108 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
13109 Move here from alloc.c, so that charset.c can use it too.
13110 Properly align; the old code wasn't right for common 32-bit hosts
13111 when configured with --enable-checking=all.
13112 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
13113 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
13114
31bed486
EZ
131152011-09-29 Eli Zaretskii <eliz@gnu.org>
13116
04c70788 13117 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
13118 use EDOM.
13119
fbcaa2f3
EZ
131202011-09-28 Eli Zaretskii <eliz@gnu.org>
13121
13122 * xdisp.c (compute_display_string_end): If there's no display
13123 string at CHARPOS, return -1.
13124
13125 * bidi.c (bidi_fetch_char): When compute_display_string_end
13126 returns a negative value, treat the character as a normal
13127 character not covered by a display string. (Bug#9624)
13128
a239d4e9
JB
131292011-09-28 Juanma Barranquero <lekktu@gmail.com>
13130
13131 * lread.c (Fread_from_string): Fix typo in docstring.
13132
88652fd5
EZ
131332011-09-27 Eli Zaretskii <eliz@gnu.org>
13134
13135 * xdisp.c (handle_invisible_prop): If invisible text ends on a
13136 newline, reseat the iterator instead of bidi-iterating there one
13137 character at a time. (Bug#9610)
32c1fffd
SM
13138 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
13139 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 13140
ed497dd4
AS
131412011-09-27 Andreas Schwab <schwab@linux-m68k.org>
13142
13143 * lread.c (readevalloop): Use correct code for NBSP.
13144 (read1): Likewise. (Bug#9608)
13145
b2bf61aa
MA
131462011-09-25 Michael Albinus <michael.albinus@gmx.de>
13147
13148 * dbusbind.c (Fdbus_register_signal): When service is not
13149 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
13150
32bbb17c
GM
131512011-09-25 Glenn Morris <rgm@gnu.org>
13152
13153 * buffer.c (truncate-lines): Doc fix.
13154
94e0933e
CY
131552011-09-24 Chong Yidong <cyd@stupidchicken.com>
13156
13157 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
13158 (Fset_window_next_buffers): Doc fix.
13159
cddde921
GM
131602011-09-24 Glenn Morris <rgm@gnu.org>
13161
13162 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
13163
1260aef1
PE
131642011-09-24 Paul Eggert <eggert@cs.ucla.edu>
13165
25b4bfa0
PE
13166 Fix minor problems found by static checking.
13167 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
13168 * indent.c (Fvertical_motion): Fix == vs = typo.
13169
e3cbd34b
EZ
131702011-09-24 Eli Zaretskii <eliz@gnu.org>
13171
a66cfb1c
SM
13172 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
13173 Default value is now t. Doc fix.
6bf7006f 13174
e3cbd34b 13175 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 13176 logic when moving up, not only when moving down. Fix the
e3cbd34b 13177 confusing name and values of the it_overshoot_expected variable;
32c1fffd 13178 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
13179
13180 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
13181 CHARPOS is covered by a display string which includes newlines.
13182 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
13183 is covered by a display string with embedded newlines.
13184
a3de0cbd
MA
131852011-09-24 Michael Albinus <michael.albinus@gmx.de>
13186
13187 * dbusbind.c (Fdbus_register_signal): Add match rule to
13188 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
13189 (Fdbus_register_method, Vdbus_registered_objects_table):
13190 Fix docstring.
a3de0cbd 13191
b260039d
JM
131922011-09-24 Jim Meyering <meyering@redhat.com>
13193
32c1fffd 13194 do not ignore write error for any output size
b260039d
JM
13195 The previous change was incomplete.
13196 While it makes emacs --batch detect the vast majority of stdout
13197 write failures, errors were still ignored whenever the output size is
13198 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
13199 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
13200 && echo FAIL: ignored write error
13201 FAIL: ignored write error
13202 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
13203 && echo FAIL: ignored write error
13204 FAIL: ignored write error
13205 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
13206
8eca8a7c
AS
132072011-09-23 Andreas Schwab <schwab@linux-m68k.org>
13208
13209 * emacs.c (Fkill_emacs): In noninteractive mode exit
13210 non-successfully if a write error occurred on stdout. (Bug#9574)
13211
3341db62
EZ
132122011-09-21 Eli Zaretskii <eliz@gnu.org>
13213
13214 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
13215 the xassert test.
13216
13217 * dispextern.h (struct it): Update the comment documenting what
13218 can it->OBJECT be.
13219
8c203dbf
EZ
132202011-09-20 Eli Zaretskii <eliz@gnu.org>
13221
13222 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
13223 a display string, extend search for cursor position to end of row.
13224 (find_row_edges): If the row ends in a newline from a display
13225 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
13226 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
13227 (Fcurrent_bidi_paragraph_direction): Fix search for previous
13228 non-empty line. Fixes confusing cursor motion with arrow keys at
13229 the beginning of a line that starts with whitespace.
8c203dbf 13230
a4824228
LMI
132312011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13232
13233 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
13234 (bug#9493).
13235
33ed493b
CY
132362011-09-18 Chong Yidong <cyd@stupidchicken.com>
13237
13238 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
13239 boolean (Bug#9154).
13240
56cd55c8
EZ
132412011-09-18 Eli Zaretskii <eliz@gnu.org>
13242
13243 * xdisp.c (display_line): Record maximum and minimum buffer
13244 positions even if no glyphs were produced (e.g., by a zero-width
13245 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
13246 buffer positions that will be removed from the glyph row because
13247 they don't fit.
c02dcedf
EZ
13248 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
13249 column is beyond frame width: don't subtract 1 "pixel" when
13250 computing width of the stretch.
3e62b7e0
EZ
13251 (reseat_at_next_visible_line_start): Undo the change made on
13252 2011-09-17 that saved paragraph information and restored it after
13253 the call to `reseat'. (Bug#9545)
56cd55c8 13254
5ed99d36 132552011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
13256
13257 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
13258 and turn window cursor on if cleared (Bug#9415).
13259
5ed99d36 132602011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
13261
13262 * search.c (boyer_moore): Take unibyte characters from pattern
13263 literally. (Bug#9458)
13264
9bade7b2
EZ
132652011-09-18 Eli Zaretskii <eliz@gnu.org>
13266
13267 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
13268
e5e9d610
PE
132692011-09-18 Paul Eggert <eggert@cs.ucla.edu>
13270
87e4427a
PE
13271 Fix minor problem found by static checking.
13272 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
13273 initialized, to pacify gcc -Wuninitialized.
13274
e5e9d610
PE
13275 * fileio.c: Report proper errno when syscall falls.
13276 (Finsert_file_contents): Save and restore errno,
13277 so that report_file_error outputs the correct diagnostic.
13278 (Fwrite_region) [CLASH_DETECTION]: Likewise.
13279
a1674f0b
EZ
132802011-09-18 Eli Zaretskii <eliz@gnu.org>
13281
13282 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
13283
fbfb6dd4
EZ
132842011-09-17 Eli Zaretskii <eliz@gnu.org>
13285
13286 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
13287 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
13288
bb187662
EZ
132892011-09-17 Eli Zaretskii <eliz@gnu.org>
13290
1137e8b8 13291 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 13292 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
13293
13294 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
13295 (bidi_find_paragraph_start): Search back for paragraph beginning
13296 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
13297 (bidi_move_to_visually_next): Only trigger paragraph-related
13298 computations when the last character is a newline or at EOB, not
13299 just any NEUTRAL_B. (Bug#9470)
13300
bb187662
EZ
13301 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
13302 truncated lines if point is covered by a display string. (Bug#9524)
13303
2e621251
PE
133042011-09-16 Paul Eggert <eggert@cs.ucla.edu>
13305
13306 * xselect.c: Relax test for outgoing X longs (Bug#9498).
13307 (cons_to_x_long): New function.
13308 (lisp_data_to_selection_data): Use it. Correct the test for
13309 short-versus-long data; it was negated. Break out of vector
13310 loop, for efficiency, when a long datum is discovered.
13311
91a15bc6
SM
133122011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
13313
13314 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
13315
b41c3a35
EZ
133162011-09-16 Eli Zaretskii <eliz@gnu.org>
13317
13318 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
13319 GCC PR/17406) by declaring this function with external scope.
13320
7812ba2d
PE
133212011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13322
13323 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
13324 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
13325
cf7edc2a
AS
133262011-09-15 Andreas Schwab <schwab@linux-m68k.org>
13327
13328 * editfns.c (Fformat): Correctly handle text properties on "%%".
13329
bd01620e
EZ
133302011-09-15 Eli Zaretskii <eliz@gnu.org>
13331
13332 * xterm.c (x_draw_composite_glyph_string_foreground):
13333 * w32term.c (x_draw_composite_glyph_string_foreground):
13334 * term.c (encode_terminal_code):
13335 * composite.c (composition_update_it, get_composition_id):
13336 * xdisp.c (get_next_display_element)
13337 (fill_composite_glyph_string): Add comments about special meaning
13338 of TAB characters in a composition.
13339
a02719a3
PE
133402011-09-15 Paul Eggert <eggert@cs.ucla.edu>
13341
13342 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
13343 This occurs when processing a multibyte format.
13344 Problem reported by Wolfgang Jenker.
a02719a3 13345
72589a3c
JB
133462011-09-15 Johan Bockgård <bojohan@gnu.org>
13347
13348 * xdisp.c (try_cursor_movement): Only check for exact match if
13349 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
13350
1c14176c
PE
133512011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13352
13353 Remove unused external symbols.
13354 * dispextern.h (calc_pixel_width_or_height): Remove decl.
13355 * xdisp.c (calc_pixel_width_or_height): Now static.
13356 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
13357 * indent.c (check_display_width):
13358 * w32term.c: Fix comment to match code.
13359 * xterm.c, xterm.h (x_catching_errors): Remove.
13360
d2eea5b5
PE
133612011-09-14 Paul Eggert <eggert@cs.ucla.edu>
13362
13363 * xselect.c: Use signed conversions more consistently (Bug#9498).
13364 (selection_data_to_lisp_data): Assume incoming selection data are
13365 signed integers, not unsigned. This is to be consistent with
13366 outgoing selection data, which was modified to use signed integers
13367 in as part of the fix to Bug#9196 in response to Jan D.'s comment
13368 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
13369 expects long, not unsigned long.
13370
46888499
EZ
133712011-09-14 Eli Zaretskii <eliz@gnu.org>
13372
13373 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
13374 computation of loop end. Reported by Johan Bockgård
13375 <bojohan@gnu.org>.
13376
ef8ef9fb
CY
133772011-09-13 Chong Yidong <cyd@stupidchicken.com>
13378
13379 * frame.c (Fother_visible_frames_p): Function deleted.
13380
fa819fed
EZ
133812011-09-12 Eli Zaretskii <eliz@gnu.org>
13382
13383 * indent.c (compute_motion): Process display vector front to back
13384 rather than the other way around. (Bug#2496)
13385
2ba8e008
SM
133862011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
13387
13388 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
13389
20f53c69
CY
133902011-09-11 Chong Yidong <cyd@stupidchicken.com>
13391
13392 * minibuf.c (Fread_from_minibuffer): Doc fix.
13393
d562d7a4
EZ
133942011-09-11 Eli Zaretskii <eliz@gnu.org>
13395
13396 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
13397 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
13398
1c4d7f3d
LMI
133992011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13400
13401 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
13402 value for non-existent files.
13403
b885bf36
EZ
134042011-09-11 Eli Zaretskii <eliz@gnu.org>
13405
13406 * fileio.c (Finsert_file_contents): If the file cannot be opened,
13407 set its "size" to -1. This will set the modtime_size field of
13408 the corresponding buffer to -1, which is what
13409 verify-visited-file-modtime expects for files that do not exist.
13410 (Bug#9139)
13411
6612f0bf
PE
134122011-09-11 Paul Eggert <eggert@cs.ucla.edu>
13413
13414 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
13415 here ...
13416 * lisp.h: ... from here. push_key_description is no longer
13417 defined in keyboard.c, so its declaration should not be in
13418 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
13419 logically belongs with push_key_description.
13420
dfb3f755
PE
134212011-09-10 Paul Eggert <eggert@cs.ucla.edu>
13422
13423 * buffer.h: Include <sys/types.h> instead of <time.h>.
13424 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
13425 Problem reported by Herbert J. Skuhra.
13426
3134906c
LMI
134272011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
13428
13429 * xml.c (parse_region): Make the parsing work for
13430 non-comment-starting XML files again (bug#9144).
13431
8d903f4e
AS
134322011-09-10 Andreas Schwab <schwab@linux-m68k.org>
13433
13434 * image.c (gif_load): Fix calculation of bottom and right corner.
13435 (Bug#9468)
13436
80ad64f4
EZ
134372011-09-10 Eli Zaretskii <eliz@gnu.org>
13438
13439 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
13440 redisplay in small windows.
13441
208a048d
EZ
134422011-09-09 Eli Zaretskii <eliz@gnu.org>
13443
13444 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
13445
9b1c252e
MR
134462011-09-08 Martin Rudalics <rudalics@gmx.at>
13447
13448 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
13449 Operate on live windows only.
13450
2949f33b
JB
134512011-09-08 Juanma Barranquero <lekktu@gmail.com>
13452
13453 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
13454
e08dcafd
EZ
134552011-09-07 Eli Zaretskii <eliz@gnu.org>
13456
13457 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
13458 only under bidi iteration.
13459
115b96bd
JD
134602011-09-07 Jan Djärv <jan.h.d@swipnet.se>
13461
13462 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
13463
c8199d0f
PE
134642011-09-06 Paul Eggert <eggert@cs.ucla.edu>
13465
13466 isnan: Fix porting problem to Solaris 10 with bundled gcc.
13467 Without this fix, the command to link temacs failed due to an
13468 undefined symbol __builtin_isnan. This is because
13469 /usr/include/iso/math_c99.h #defines isnan(x) to
13470 __builtin_isnan(x), but the bundled gcc, which identifies itself
13471 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
13472 a __builtin_isnan.
13473 * floatfns.c (isnan): #undef, and then #define to a clone of
13474 what's in data.c.
13475 (Fisnan): Always define, since it's always available now.
13476 (syms_of_floatfns): Always define isnan at the Lisp level.
13477
e39b275c 134782011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
13479
13480 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
13481
b2db44d9 134822011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 13483
f4af5137 13484 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
13485 The previous code assumed that file offsets (off_t values) fit in
13486 EMACS_INT variables, which is not true on typical 32-bit hosts.
13487 The code messed up by falsely reporting buffer overflow in cases
13488 such as (insert-file-contents "big" nil 1 2) into an empty buffer
13489 when "big" contains more than 2**29 bytes, even though this
13490 inserts just one byte and does not overflow the buffer.
13491 (Finsert_file_contents): Store file offsets as off_t
13492 values, not as EMACS_INT values. Check for overflow when
13493 converting between EMACS_INT and off_t. When checking for
13494 buffer overflow or for overlap, take the offsets into account.
13495 Don't use EMACS_INT for small values where int suffices.
13496 When checking for overlap, fix a typo: ZV was used where
13497 ZV_BYTE was intended.
13498 (Fwrite_region): Don't assume off_t fits into 'long'.
13499 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
13500
ecfc0a49
MA
135012011-09-05 Michael Albinus <michael.albinus@gmx.de>
13502
13503 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
13504
6511acf2 135052011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 13506
0999621a 13507 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
13508
13509 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 13510 (esprintf, exprintf, evxprintf): New functions.
62f19c19 13511 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 13512 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
13513 (modify_event_symbol): Do not assume that the length of
13514 name_alist_or_stem is safe to alloca and fits in int.
13515 (Fexecute_extended_command): Likewise for function name and binding.
13516 (Frecursion_depth): Wrap around reliably on integer overflow.
13517 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
13518 since some callers pass EMACS_INT values.
13519 (Fsingle_key_description): Don't crash if symbol name contains more
13520 than MAX_ALLOCA bytes.
13521 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
13522 (get_minibuffer): Arg is now EMACS_INT, not int.
13523 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 13524 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
13525 * window.h (command_loop_level, minibuf_level): Reflect API changes.
13526
2be7d702
PE
13527 * dbusbind.c (signature_cat): New function.
13528 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
13529 Do not overrun buffer; instead, report string overflow.
13530
9d1df220
PE
13531 * dispnew.c (add_window_display_history): Don't overrun buffer.
13532 Truncate instead; this is OK since it's just a log.
13533
33ef5c64
PE
13534 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
13535 even if the time zone offset is outlandishly large.
13536 Don't mishandle offset == INT_MIN.
13537
66c6fdd5
PE
13538 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
13539 when creating daemon; the previous buffer-overflow check was incorrect.
13540
d749b01b
PE
13541 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
13542 which has the guts of the old verror function.
13543
b5cd1905
PE
13544 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
13545 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
13546
6e1a67fb
PE
13547 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
13548 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 13549 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 13550 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
13551 length of string rather than counting it via multiple sprintfs;
13552 that's simpler and more reliable.
c21721cc
PE
13553 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
13554 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
13555 sprintf, in case result does not fit in int.
13556
c57b67fc
PE
13557 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
13558 (fontset_from_font): Print it.
13559
8a401434
PE
13560 * frame.c (tty_frame_count): Now printmax_t, not int.
13561 (make_terminal_frame, set_term_frame_name): Print it.
13562 (x_report_frame_params): In X, window IDs are unsigned long,
13563 not signed long, so print them as unsigned.
13564 (validate_x_resource_name): Check for implausibly long names,
13565 and don't assume name length fits in 'int'.
13566 (x_get_resource_string): Don't blindly alloca invocation name;
13567 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
13568 not fit in int.
13569
6e1a67fb
PE
13570 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
13571 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
13572 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
13573
0df02bf3
PE
13574 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
13575 Use esprintf, not sprintf, in case result does not fit in int.
13576
48e30793
PE
13577 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13578 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
13579 it as a large positive number.
13580 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
13581 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
13582
a66ff6d8
PE
13583 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
13584 in case result does not fit in int.
13585
aca216ff
PE
13586 * print.c (float_to_string): Detect width overflow more reliably.
13587 (print_object): Make sprintf buffer a bit bigger, to avoid potential
13588 buffer overrun. Don't assume list length fits in 'int'. Treat
13589 print length of 0 as 0, not as infinity; to be consistent with other
13590 uses of print length in this function. Don't overflow print length
13591 index. Don't assume hash table size fits in 'long', or that
13592 vectorlike size fits in 'unsigned long'.
13593
31c286f7
PE
13594 * process.c (make_process): Use printmax_t, not int, to format
13595 process-name gensyms.
13596
55e5faa1
PE
13597 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
13598
80f2e268
PE
13599 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
13600 to avoid potential buffer overrun.
13601
670741ab
PE
13602 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
13603 if X resource line is longer than 512 bytes.
13604
b7163a50
PE
13605 * xfns.c (x_window): Make sprintf buffer a bit bigger
13606 to avoid potential buffer overrun.
13607
ae58ff1f
PE
13608 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
13609
c43c8a6a
PE
13610 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
13611
3f8236f4
PE
136122011-09-04 Paul Eggert <eggert@cs.ucla.edu>
13613
53e9fe90 13614 Integer overflow fixes for scrolling, etc.
6511acf2
PE
13615 Without these, Emacs silently mishandles large integers sometimes.
13616 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
13617 it were "C-u 1 M-x recenter" on a typical 64-bit host.
13618
6511acf2
PE
13619 * xdisp.c (try_window_id): Check Emacs fixnum range before
13620 converting to 'int'.
806add1d 13621
6511acf2 13622 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
13623 Check that an Emacs fixnum is in range before assigning it to 'int'.
13624 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
13625 values converted from Emacs fixnums.
13626 (Frecenter): Don't wrap around a line count if it is out of 'int'
13627 range; instead, treat it as an extreme value.
13628 (Fset_window_configuration, compare_window_configurations):
13629 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
13630
6511acf2
PE
13631 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
13632 that can exceed INT_MAX. Check that EMACS_INT value is in range
13633 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
13634 (match_limit): Don't assume that a fixnum can fit in 'int'.
13635
6511acf2 13636 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
13637 exceed INT_MAX.
13638
6511acf2 13639 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
13640 (Fvertical_motion): Don't wrap around LINES values that don't fit
13641 in 'int'. Instead, treat them as extreme values. This is good
13642 enough for windows, which can't have more than INT_MAX lines anyway.
13643
fcb901a7
LMI
136442011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
13645
0f2f6b6d
LMI
13646 * Require libxml/parser.h to avoid compilation warning.
13647
fcb901a7
LMI
13648 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
13649
13650 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
13651 since this reportedly can destroy thread storage.
13652
6e20a0d4
CY
136532011-08-30 Chong Yidong <cyd@stupidchicken.com>
13654
13655 * syntax.c (find_defun_start): Update all cache variables if
13656 exiting early (Bug#9401).
13657
148ae00e
EZ
136582011-08-30 Eli Zaretskii <eliz@gnu.org>
13659
f6cfbd8f
EZ
13660 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
13661
148ae00e
EZ
13662 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
13663 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
13664 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
13665
13666 * term.c (tty_append_glyph): New function.
13667 (produce_stretch_glyph): Static function and its prototype deleted.
13668
a66cfb1c
SM
13669 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
13670 Add prototypes.
148ae00e 13671
c4a07a4c
PE
136722011-08-29 Paul Eggert <eggert@cs.ucla.edu>
13673
13674 * image.c (parse_image_spec): Check for nonnegative, not for positive,
13675 when checking :margin (Bug#9390).
13676 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 13677 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
13678 so that the name doesn't mislead. All uses changed.
13679
6bc8cd65
JB
136802011-08-28 Johan Bockgård <bojohan@gnu.org>
13681
13682 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
13683 set_tty_hooks.
13684
dca4927e
EZ
136852011-08-27 Eli Zaretskii <eliz@gnu.org>
13686
13687 * xdisp.c (move_it_to): Don't bail out early when reaching
13688 position beyond to_charpos, if we are scanning backwards.
13689 (move_it_vertically_backward): When DY == 0, make sure we get to
13690 the first character in the line after the newline.
13691
f2cad773
PE
136922011-08-27 Paul Eggert <eggert@cs.ucla.edu>
13693
13694 * ccl.c: Improve and simplify overflow checking (Bug#9196).
13695 (ccl_driver): Do not generate an out-of-range pointer.
13696 (Fccl_execute_on_string): Remove unnecessary check for
13697 integer overflow, noted by Stefan Monnier in
13698 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
13699 Remove a FIXME that didn't need fixing.
13700 Simplify the newly-introduced buffer reallocation code.
13701
0cae2cdb
JB
137022011-08-27 Juanma Barranquero <lekktu@gmail.com>
13703
13704 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
13705
5fc295a4 137062011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 13707
70c60eb2 13708 Integer and memory overflow issues (Bug#9196).
726e0ab1 13709
d31850da
PE
13710 * doc.c (get_doc_string): Rework so that
13711 get_doc_string_buffer_size is the actual buffer size, rather than
13712 being 1 less than the actual buffer size; this makes xpalloc more
13713 convenient.
13714
a69fbedb
PE
13715 * image.c (x_allocate_bitmap_record, cache_image):
13716 * xselect.c (Fx_register_dnd_atom):
13717 Simplify previous changes by using xpalloc.
13718
fe5c5d37
PE
13719 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
13720 since either will do and ptrdiff_t is convenient with xpalloc.
13721
0065d054
PE
13722 * charset.c (charset_table_size)
13723 (struct charset_sort_data.priority): Now ptrdiff_t.
13724 (charset_compare): Don't overflow if priorities differ greatly.
13725 (Fsort_charsets): Don't assume list length fits in int.
13726 Check for size-calculation overflow when allocating sort data.
13727 (syms_of_charset): Allocate an initial charset table that is
13728 just under 64 KiB, to avoid problems with glibc malloc and mmap.
13729
13730 * cmds.c (internal_self_insert): Check for size-calculation overflow.
13731
13732 * composite.h (struct composition.glyph_len): Now int, not unsigned.
13733 The actual value is always <= INT_MAX, and leaving it unsigned made
13734 overflow checking harder.
13735
13736 * dispextern.h (struct glyph_matrix.rows_allocated)
13737 (struct face_cache.size): Now ptrdiff_t, for convenience in use
13738 with xpalloc. The values are still always <= INT_MAX.
13739
13740 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
13741
13742 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
13743 (SAFE_NALLOCA): New macro.
13744
13745 * region-cache.c (struct boundary.pos, find_cache_boundary)
13746 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
13747 (set_cache_region, invalidate_region_cache)
13748 (revalidate_region_cache, know_region_cache, region_cache_forward)
13749 (region_cache_backward, pp_cache):
13750 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
13751 so that ptrdiff_t * can be passed to xpalloc.
13752 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
13753 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
13754 (pp_cache): Don't assume cache_len fits in int.
13755 * region-cache.h: Adjust extern decls to match.
13756
13757 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
13758 EMACS_INT, since either will do, for xpalloc.
13759
13760 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
13761 (xnmalloc, xnrealloc, xpalloc): New functions.
13762
726e0ab1
PE
13763 * bidi.c (bidi_shelve_header_size): New constant.
13764 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
13765 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
13766
51f30bc5 13767 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
13768 * buffer.c (overlays_at, overlays_in, record_overlay_string)
13769 (overlay_strings):
13770 Don't update size of array until after memory allocation succeeds,
13771 because xmalloc/xrealloc may not return.
0065d054
PE
13772 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
13773 now that we have proper integer overflow checking.
13774 (record_overlay_string, overlay_strings): Catch overflows when
13775 calculating size of overlay_str_buf.
726e0ab1 13776
0065d054
PE
13777 * callproc.c (Fcall_process): Check for size overflow when
13778 calculating size of args2.
13779 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
13780 Normally we prefer signed values, but sticking with ptrdiff_t would
13781 require adding more-complicated checks.
726e0ab1
PE
13782
13783 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
13784 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
13785 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 13786 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
13787
13788 * character.c (Fstring): Check for size-calculation overflow.
13789
13790 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
13791 unnecessary integer overflow. Check for size overflow.
13792 (encode_coding_object): Don't update size until xmalloc succeeds.
13793
13794 * composite.c (get_composition_id): Check for overflow in glyph
13795 length calculations.
13796
13797 Integer and memory overflow fixes for display code.
13798 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
13799 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
13800 (scrolling_window): Check for overflow in size calculations.
13801 (line_draw_cost, realloc_glyph_pool, add_row_entry):
13802 Don't assume glyph table len fits in int.
13803 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
13804 (row_table_size): Now ptrdiff_t, not int.
13805 (scrolling_window): Avoid overflow in size calculations.
13806 Don't update size until allocation succeeds.
13807 * fns.c (concat): Check for overflow in size calculations.
13808 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
13809 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
13810 (NEXT_ALMOST_PRIME_LIMIT): New constant.
13811
13812 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
13813 (get_doc_string): Check for size calculation overflow.
13814 Don't update size until allocation succeeds.
13815 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
13816 EMACS_INT, where ptrdiff_t will do.
13817 (Fsubstitute_command_keys): Check for string overflow.
13818
13819 * editfns.c (set_time_zone_rule): Don't assume environment length
13820 fits in int.
13821 (message_length): Now ptrdiff_t, not int.
13822 (Fmessage_box): Don't update size until allocation succeeds.
13823 Don't assume message length fits in int.
13824 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
13825
0065d054
PE
13826 * emacs.c (main): Do not reallocate argv, since there is a null at
13827 the end that can be overwritten, and this way there's no need to
13828 worry about size-calculation overflow.
13829 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
13830
13831 * eval.c (init_eval_once, grow_specpdl): Don't update size until
13832 alloc succeeds.
13833 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
13834
13835 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
13836 (x_set_scroll_bar_width, x_figure_window_size):
13837 Check for integer overflow.
13838 (x_set_alpha): Do not assume XINT fits in int.
13839
13840 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
13841 This is for the members text_lines, text_cols, total_lines, total_cols,
13842 where the system imposes an 'int' limit.
13843
13844 * fringe.c (Fdefine_fringe_bitmap):
13845 Don't update size until alloc works.
13846
13847 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
13848 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
13849
13850 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
13851 Check for size-calculation overflow.
13852 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
13853 do, as we prefer signed integers.
13854 (id_to_widget.max_size, id_to_widget.used)
13855 (xg_store_widget_in_map, xg_remove_widget_from_map)
13856 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
13857 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
13858 Use and return ptrdiff_t, not int.
13859 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
13860 * gtkutil.h: Change prototypes to match the above.
13861
13862 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
13863 are duplicate now that they've been promoted to lisp.h.
13864 (x_allocate_bitmap_record, x_alloc_image_color)
13865 (make_image_cache, cache_image, xpm_load):
13866 Don't update size until alloc is done.
13867 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
13868 (x_detect_edges):
3256efce 13869 Check for size calculation overflow.
726e0ab1
PE
13870 (ct_colors_allocated_max): New constant.
13871 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
13872 overflow.
3256efce 13873
726e0ab1
PE
13874 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
13875 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
13876 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
13877 Use ptrdiff_t, not int, to count maps.
13878 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
13879 calculations. Don't update size until allocation succeeds.
13880 Redo calculations to avoid overflow.
726e0ab1
PE
13881 * keyboard.h: Change prototypes to match the above.
13882
13883 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
13884 to count maps.
13885 (current_minor_maps): Check for size calculation overflow.
13886 * keymap.h: Change prototypes to match the above.
13887
13888 * lread.c (read1, init_obarray): Don't update size until alloc done.
13889
13890 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
13891 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
13892
726e0ab1
PE
13893 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
13894 Now ptrdiff_t, not int.
13895 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
13896 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
13897
13898 * process.c (Fnetwork_interface_list): Check for overflow
13899 in size calculation.
13900
13901 * region-cache.c (move_cache_gap): Check for size calculation overflow.
13902
13903 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
13904 overflow. Don't bother calling xmalloc when xrealloc will do.
13905
13906 * search.c (Freplace_match): Check for size calculation overflow.
13907 (Fset_match_data): Don't assume list lengths fit in 'int'.
13908
13909 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
13910 for command line length. Do not attempt to address one before the
13911 beginning of an array, as that's not portable.
13912
13913 * term.c (max_frame_lines): Remove; unused.
13914 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
13915 not int.
13916 (encode_terminal_code, calculate_costs): Check for size
13917 calculation overflow.
13918 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
13919 table lengths and related sizes. Don't update size until alloc
13920 done. Redo calculations to avoid overflow.
13921 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
13922
13923 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
13924 subtracting pointers.
13925 (gobble_line): Check for overflow more carefully. Don't update size
13926 until alloc done.
13927
13928 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
13929 Don't update size until alloc done.
13930 Redo size calculations to avoid overflow.
13931 Check for size calculation overflow.
0065d054 13932 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
13933
13934 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
13935 Use ptrdiff_t, not int, for sizes.
13936 (store_mode_line_noprop_char): Don't update size until alloc done.
13937
0065d054
PE
13938 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
13939 Use ptrdiff_t, not int, for sizes.
13940 (Finternal_make_lisp_face, cache_face):
13941 Check for size calculation overflow.
13942 (cache_face): Treat size calculation overflows as if they were
13943 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
13944
13945 * xfns.c (x_encode_text, x_set_name_internal)
13946 (Fx_change_window_property): Use ptrdiff_t, not int, to count
13947 sizes, since they can exceed INT_MAX in size. Check for size
13948 calculation overflow.
13949
0065d054
PE
13950 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
13951 (xg_select): Check for size calculation overflow.
726e0ab1
PE
13952 Don't update size until alloc done.
13953
0065d054 13954 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 13955 as sprintf is limited to int lengths.
1d526e2f 13956
252c5ee1
PE
13957 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
13958 (X_LONG_MIN): New macros.
864d7ce7
PE
13959 Use them to make the following changes clearer.
13960 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
13961 This change doesn't affect the value now, but it may help remind
13962 future maintainers not to raise the value too much later.
13963 (SELECTION_QUANTUM): Remove, replacing with ...
13964 (selection_quantum): ... new function, which avoids overflow.
13965 All uses changed.
13966 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
13967 assumption that selection length fits in 'int'.
13968 (x_reply_selection_request, x_handle_selection_request)
13969 (x_get_window_property, receive_incremental_selection)
13970 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
13971 (lisp_data_to_selection_data, clean_local_selection_data):
13972 Use ptrdiff_t, not int, to record length of selection.
13973 (x_reply_selection_request, x_get_window_property)
13974 (receive_incremental_selection, x_property_data_to_lisp):
13975 Redo calculations to avoid overflow.
13976 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 13977 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
13978 something.
13979 (x_get_window_property, receive_incremental_selection)
13980 (lisp_data_to_selection_data, x_property_data_to_lisp):
13981 Check for size-calculation overflow.
13982 (x_get_window_property, receive_incremental_selection)
13983 (lisp_data_to_selection_data, Fx_register_dnd_atom):
13984 Don't store size until memory allocation succeeds.
13985 (x_get_window_property): Plug memory leak on memory exhaustion.
13986 Don't double-block input; malloc is safe here. Don't assume 2**34
13987 - 4 fits in unsigned long. Add an xassert to check
13988 XGetWindowProperty overflow. Be more careful about overflow
13989 calculations, and distinguish size from memory overflow better.
13990 (receive_incremental_selection): When tracing, don't assume
13991 unsigned int is less than INT_MAX.
13992 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
13993 harmful) conversions of unsigned short to int.
13994 (lisp_data_to_selection_data): Don't assume that integers
13995 in the range -65535 through -1 fit in an X unsigned short.
13996 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
13997 result parameters unless successful. Rely on cons_to_unsigned
13998 to report problems with elements; the old code wasn't right anyway.
13999 (x_check_property_data): Check for int overflow; we cannot use
14000 a wider type due to X limits.
14001 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
14002
726e0ab1 14003 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 14004
0065d054
PE
14005 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
14006 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
14007 (x_color_cells): Don't store size until memory allocation succeeds.
14008 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 14009 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
14010 (x_term_init): Don't assume length fits in int (sprintf is limited
14011 to int size).
bc18e09d 14012
ebfa62c0
PE
14013 Use ptrdiff_t for composition IDs.
14014 * character.c (lisp_string_width):
14015 * composite.c (composition_table_size, n_compositions)
14016 (get_composition_id, composition_gstring_from_id):
14017 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
14018 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
14019 * window.c (Frecenter):
14020 Use ptrdiff_t, not int, for composition IDs.
14021 * composite.c (get_composition_id): Check for integer overflow.
14022 * composite.h: Adjust prototypes to match the above changes.
14023
d3411f89
PE
14024 Use ptrdiff_t for hash table indexes.
14025 * category.c (hash_get_category_set):
14026 * ccl.c (ccl_driver):
14027 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
14028 * coding.c (coding_system_charset_list, detect_coding_system):
14029 * coding.h (struct coding_system.id):
14030 * composite.c (get_composition_id, gstring_lookup_cache):
14031 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
14032 * image.c (xpm_get_color_table_h):
14033 * lisp.h (hash_lookup, hash_put):
14034 * minibuf.c (Ftest_completion):
14035 Use ptrdiff_t for hash table indexes, not int (which is too
14036 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
14037 32-bit --with-wide-int hosts).
14038
e097a6fa
PE
14039 * charset.c (Fdefine_charset_internal): Check for integer overflow.
14040 Add a FIXME comment about memory leaks.
14041 (syms_of_charset): Don't assume xmalloc returns.
14042
5637687f
PE
14043 Don't assume that stated character widths fit in int.
14044 * character.c (Fchar_width, c_string_width, lisp_string_width):
14045 * character.h (CHAR_WIDTH):
14046 * indent.c (MULTIBYTE_BYTES_WIDTH):
14047 Use sanitize_char_width to avoid undefined and/or bad behavior
14048 with outlandish widths.
a66cfb1c 14049 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
14050 now that we have two such functions. All uses changed.
14051 (sanitize_char_width): New inline function.
14052
a2271ba2
PE
14053 Don't assume that tab-width fits in int.
14054 * character.h (sanitize_width): New inline function.
14055 (SANE_TAB_WIDTH): New macro.
14056 (ASCII_CHAR_WIDTH): Use it.
14057 * indent.c (sane_tab_width): Remove. All uses replaced by
14058 SANE_TAB_WIDTH (current_buffer).
14059 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
14060
18c52557
PE
14061 * fileio.c: Integer overflow issues with file modes.
14062 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
14063
caeeedc1
PE
14064 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
14065 Remove unreachable code.
14066 (read_hex, load_charset_map_from_file): Check for integer overflow.
14067
6df6ae42 14068 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
14069 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
14070 (x_send_scroll_bar_event): Likewise. Check that the size does not
14071 exceed limits imposed by XClientMessageEvent, as well as the usual
14072 ptrdiff_t and size_t limits.
14073
b13995db
PE
14074 * keyboard.c: Overflow, signedness and related fixes.
14075 (make_lispy_movement): Use same integer type in forward decl
14076 that is used in the definition.
14077 (read_key_sequence, keyremap_step):
14078 Change bufsize argument back to int, undoing my 2011-03-30 change.
14079 We prefer signed types, and int is wide enough here.
14080 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
14081 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
14082 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
14083 length, not size_t. Use ptrdiff_t for index, not int.
14084 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
14085 possibility of integer overflow.
14086
13464394
PE
14087 Overflow, signedness and related fixes for images.
14088
14089 * dispextern.h (struct it.stack[0].u.image.image_id)
14090 (struct_it.image_id, struct image.id, struct image_cache.size)
14091 (struct image_cache.used, struct image_cache.ref_count):
14092 * gtkutil.c (update_frame_tool_bar):
14093 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
14094 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
14095 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
14096 * nsmenu.m (update_frame_tool_bar):
14097 * xdisp.c (calc_pixel_width_or_height):
14098 * xfns.c (image_cache_refcount):
14099 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
14100 on typical 64-bit hosts.
14101
14102 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
14103 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
14104 Omit unnecessary casts to int.
14105 (parse_image_spec): Check that integers fall into 'int' range
14106 when the callers expect that.
14107 (image_ascent): Redo ascent calculation to avoid int overflow.
14108 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
14109 (lookup_image): Remove unnecessary tests.
14110 (xbm_image_p): Locals are now of int, not EMACS_INT,
14111 since parse_image_check makes sure they fit into int.
14112 (png_load, gif_load, svg_load_image):
14113 Prefer int to unsigned where either will do.
14114 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
14115 old tiff_error_handler and tiff_warning_handler.
14116 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
14117 stack buffer overflows. It uses only the features of vsnprintf
14118 that are common to both POSIX and native Microsoft.
14119 (tiff_error_handler, tiff_warning_handler): Use it.
14120 (tiff_load, gif_load, imagemagick_load_image):
14121 Don't assume :index value fits in 'int'.
14122 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
14123 (imagemagick_load_image): Check that crop parameters fit into
14124 the integer types that MagickCropImage accepts. Don't assume
14125 Vimagemagick_render_type has a nonnegative value. Don't assume
14126 size_t fits in 'long'.
14127 (gs_load): Use printmax_t to print the widest integers possible.
14128 Check for integer overflow when computing image height and width.
14129
c11821d4
EZ
141302011-08-26 Eli Zaretskii <eliz@gnu.org>
14131
14132 * xdisp.c (redisplay_window): Don't force window start if point
14133 will be invisible in the resulting window. (Bug#9324)
14134
0c95fcf7
EZ
141352011-08-25 Eli Zaretskii <eliz@gnu.org>
14136
14137 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
14138 the display spec is of the form `(space ...)'.
14139 (handle_display_spec): Return the value returned by
14140 handle_single_display_spec, not just 1 or zero.
14141 (handle_single_display_spec): If the display spec is of the form
14142 `(space ...)', and specifies display in the text area, return 2
14143 rather than 1.
fee65a97 14144 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
14145 accurately, and prefer exact match for point under bidi.
14146 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
14147
14148 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
14149 into disp_prop; all users changed.
14150
14151 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
14152 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
14153 for the text covered by the display property.
14154
e4ed06f1
CY
141552011-08-25 Chong Yidong <cyd@stupidchicken.com>
14156
14157 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
14158 Change return value to nil.
14159 (Frecord_buffer): Delete unused function.
14160
f67cdd7f
EZ
141612011-08-24 Eli Zaretskii <eliz@gnu.org>
14162
5980d4c6
EZ
14163 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
14164 buffers, return left-to-right.
8610fe8b
EZ
14165 (set_cursor_from_row): Consider candidate row a win if its glyph
14166 represents a newline and point is on that newline. Fixes cursor
14167 positioning on the newline at EOL of R2L text within L2R
14168 paragraph, and vice versa.
14169 (try_cursor_movement): Check continued rows, in addition to
14170 continuation rows. Fixes unwarranted scroll when point enters a
14171 continued line of R2L text within an L2R paragraph, or vice versa.
14172 (cursor_row_p): Consider the case of point being equal to
14173 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
14174 from the end of a short line to the beginning of a continued line
14175 of R2L text within L2R paragraph.
14176 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
14177 composed characters.
5980d4c6 14178
f67cdd7f
EZ
14179 * bidi.c (bidi_check_type): Use xassert.
14180 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
14181 members.
14182
bca633fb
EZ
141832011-08-23 Eli Zaretskii <eliz@gnu.org>
14184
14185 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
14186 a character.
14187
4a5885a7
CY
141882011-08-23 Chong Yidong <cyd@stupidchicken.com>
14189
14190 * nsfont.m (ns_otf_to_script): Fix typo.
14191
0902a04e
KH
141922011-08-22 Kenichi Handa <handa@m17n.org>
14193
14194 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
14195 extra slot even if the purpose is char-code-property-table.
14196
1a2e6670
EZ
141972011-08-23 Eli Zaretskii <eliz@gnu.org>
14198
8ddde651
EZ
14199 * xdisp.c (redisplay_window): When computing centering_position,
14200 account for the height of the header line. (Bug#8874)
14201
425cc014
EZ
14202 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
14203 instead of CHAR_TO_BYTE. Fixes a crash when a completion
14204 candidate is selected by the mouse, and that candidate has a
14205 composed character under the mouse.
14206
1a2e6670
EZ
14207 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
14208 coordinates reported by pos-visible-in-window-p for a composed
14209 character in column zero.
14210
8b76d6f8
SM
142112011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
14212
14213 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
14214
dac347dd
EZ
142152011-08-22 Eli Zaretskii <eliz@gnu.org>
14216
14217 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
14218 consider it a hit if to_charpos is anywhere in the range of the
14219 composed buffer positions.
14220
e013fb34
CY
142212011-08-22 Chong Yidong <cyd@stupidchicken.com>
14222
14223 * image.c (gif_load): Don't assume that each subimage has the same
14224 dimensions as the base image. Handle disposal method that is
14225 "undefined" by the gif spec (Bug#9335).
14226
bd1ba3e8
CY
142272011-08-20 Chong Yidong <cyd@stupidchicken.com>
14228
14229 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 14230 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 14231
54a1215b
EZ
142322011-08-19 Eli Zaretskii <eliz@gnu.org>
14233
823564e5
EZ
14234 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
14235 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
14236 from an Org mode buffer to a Speedbar frame.
14237
54a1215b
EZ
14238 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
14239 a composition, take its buffer position from IT->cmp_it.charpos.
14240 Fixes cursor positioning at the beginning of a line that begins
14241 with a composed character.
14242
9778ebcc
EZ
142432011-08-18 Eli Zaretskii <eliz@gnu.org>
14244
0be6ee06
EZ
14245 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
14246 character bidirectional type, use STRONG_L instead. Fixes crashes
14247 in a buffer produced by `describe-categories'.
14248
9778ebcc
EZ
14249 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
14250 members before the level stack, so they would be saved and
14251 restored when copying iterator state. Fixes incorrect reordering
14252 around TABs covered by display properties.
14253
156bffbe
AS
142542011-08-18 Andreas Schwab <schwab@linux-m68k.org>
14255
6b02f655 14256 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 14257
72ad093b
CY
142582011-08-17 Chong Yidong <cyd@stupidchicken.com>
14259
14260 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
14261 (internal_condition_case_2, internal_condition_case_n):
14262 Remove unnecessary aborts (Bug#9081).
72ad093b 14263
35774242
EZ
142642011-08-17 Eli Zaretskii <eliz@gnu.org>
14265
14266 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
14267 has no `load' handler, try opening the file locally. (Bug#9311)
14268
db76dd85
KB
142692011-08-16 Ken Brown <kbrown@cornell.edu>
14270
14271 * gmalloc.c: Expand comment.
14272
b215eee5
EZ
142732011-08-16 Eli Zaretskii <eliz@gnu.org>
14274
14275 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
14276 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
14277
a4579d33
KB
142782011-08-16 Ken Brown <kbrown@cornell.edu>
14279
14280 Fix memory allocation problems in Cygwin build (Bug#9273).
14281
14282 * unexcw.c ( __malloc_initialized): Declare external variable.
14283 (fixup_executable): Force the dumped emacs to reinitialize malloc.
14284
8b76d6f8
SM
14285 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
14286 New variables.
a4579d33
KB
14287 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
14288 dumped emacs.
14289 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
14290 in the static heap.
14291 [CYGWIN] (special_realloc): New function.
14292 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
14293 requests to realloc storage in the static heap.
14294
3ebec551
PE
142952011-08-15 Paul Eggert <eggert@cs.ucla.edu>
14296
14297 * bidi.c (bidi_initialize): Remove unused local.
14298
9fd8be00
EZ
142992011-08-15 Eli Zaretskii <eliz@gnu.org>
14300
6b02f655
SM
14301 * bidimirror.h:
14302 * biditype.h: Remove file.
14303 * makefile.w32-in ($(BLD)/bidi.$(O)):
14304 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
14305
14306 * dispextern.h: Fix a typo in the comment to bidi_type_t.
14307
14308 * chartab.c: Improve commentary for the uniprop_table API.
14309
32413314
EZ
14310 * bidi.c (bidi_paragraph_init): Support zero value of
14311 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
14312 (bidi_initialize): Use uniprop_table instead of including
14313 biditype.h and bidimirror.h.
32413314 14314
9fd8be00
EZ
14315 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
14316 coordinates of the iterator when restoring from ppos_it.
14317 (Bug#9296)
14318
5cf2b69b
KH
143192011-08-14 Kenichi Handa <handa@m17n.org>
14320
14321 * process.c (create_process): Call setup_process_coding_systems
72ad093b 14322 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 14323
daf17d00
EZ
143242011-08-14 Eli Zaretskii <eliz@gnu.org>
14325
14326 * xdisp.c (move_it_in_display_line_to): Don't invoke
14327 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
14328 ppos_it. Fixes vertical cursor motion when line beginning is
14329 covered by an image. (Bug#9296)
14330
08e3161a
JD
143312011-08-14 Jan Djärv <jan.h.d@swipnet.se>
14332
14333 * nsterm.h (ns_run_ascript): Declare.
14334 (NSAPP_DATA2_RUNASSCRIPT): Define.
14335
14336 * nsfns.m (as_script, as_result, as_status): New static variables.
14337 (ns_run_ascript): New function.
5e617bc2 14338 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
14339 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
14340 the event loop. Get status from as_status (Bug#7276).
14341
14342 * nsterm.m (sendEvent): If event is NSApplicationDefined and
14343 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
14344 the event loop (Bug#7276).
14345
a3720aa2
AS
143462011-08-14 Andreas Schwab <schwab@linux-m68k.org>
14347
14348 * gnutls.c (QCgnutls_bootprop_priority)
14349 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
14350 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
14351 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
14352 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
14353 (QCgnutls_bootprop_verify_hostname_error)
14354 (QCgnutls_bootprop_callbacks_verify): Rename from
14355 Qgnutls_bootprop_..., all uses changed.
14356
14357 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
14358 uses changed.
14359
0a0d27fb
PE
143602011-08-14 Paul Eggert <eggert@cs.ucla.edu>
14361
19d5c50c
PE
14362 * xfaces.c (Qframe_set_background_mode): Now static.
14363 * dispextern.h (Qframe_set_background_mode): Remove decl.
14364
0a0d27fb
PE
14365 * process.c (Fnetwork_interface_info): Declare local only if needed.
14366
377538cb
JD
143672011-08-13 Jan Djärv <jan.h.d@swipnet.se>
14368
14369 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
14370 (Fnetwork_interface_list): Allocate in increments of bytes instead
14371 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
14372 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
14373 sockaddr.
14374 (struct ifflag_def): notrailers is smart on OSX.
14375 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
14376 Get hardware address with getifaddrs if available.
14377
08fff70c
EZ
143782011-08-12 Eli Zaretskii <eliz@gnu.org>
14379
14380 * xdisp.c (iterate_out_of_display_property): xassert that
14381 IT->position is set to within IT->object's boundaries. Break from
14382 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
14383 when IT->position is set up wrongly due to some bug.
14384 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
14385 (push_display_prop): Allow GET_FROM_STRING as IT->method on
14386 entry. Force push_it to save on the stack the current
14387 buffer/string position, to be restored by pop_it. Fix flags in
14388 the iterator structure wrt the object coming from a display
14389 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
14390 properties. (Bug#9284)
14391
7be1c708 143922011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 14393
7be1c708
CY
14394 * fontset.c (fontset_get_font_group): Add proper type checks.
14395 (Bug#9172)
aac0c6e3 14396
7be1c708 143972011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 14398
7be1c708
CY
14399 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
14400 and LC_VERSION_MIN_MACOSX.
14401 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
14402 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 14403
97bb72a6
EZ
144042011-08-08 Eli Zaretskii <eliz@gnu.org>
14405
14406 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
14407 no-display-properties-and-no-overlays under bidi display.
14408 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 14409 properties and overlays.
97bb72a6 14410
d5617611
CY
144112011-08-08 Chong Yidong <cyd@stupidchicken.com>
14412
37e11a63
CY
14413 * editfns.c (Fset_time_zone_rule): Document relationship with the
14414 setenv function.
14415
d5617611
CY
14416 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
14417 the font entity extracted from the cache (Bug#8109).
14418
58872834
CY
144192011-08-07 Chong Yidong <cyd@stupidchicken.com>
14420
14421 * composite.c (autocmp_chars): Don't reset point. That is done by
14422 restore_point_unwind (Bug#5984).
14423
75bfc667
JL
144242011-08-07 Juri Linkov <juri@jurta.org>
14425
14426 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
14427 to show the arg `TIME' instead of `TIMEVAL'.
14428
d1410150
EZ
144292011-08-06 Eli Zaretskii <eliz@gnu.org>
14430
14431 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
14432 display property strides EOL and includes a newline, as in
14433 longlines-mode. (Bug#9254)
75b771e4
EZ
14434 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
14435 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
14436
14437 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
14438 is non-zero, even if the data buffer is NULL. Fixes a crash in
14439 vertical-motion with longlines-mode. (Bug#9254)
14440
35928349
EZ
144412011-08-05 Eli Zaretskii <eliz@gnu.org>
14442
ec7cc85b
EZ
14443 * bidi.c <bidi_cache_total_alloc>: Now static.
14444 (bidi_initialize): Initialize bidi_cache_total_alloc.
14445
8b76d6f8 14446 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
14447 cache. (Bug#9221)
14448
14449 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
14450 amount allocated this far in `bidi_cache_total_alloc'.
14451 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
14452 non-zero, only free the data buffer without restoring the cache
14453 contents. All callers changed.
14454
14455 * dispextern.h (bidi_unshelve_cache): Update prototype.
14456
14457 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
14458 (move_it_in_display_line, move_it_to)
14459 (move_it_vertically_backward, move_it_by_lines): Replace the call
14460 to xfree to an equivalent call to bidi_unshelve_cache.
14461 (move_it_in_display_line_to): Fix logic of returning
412b6358 14462 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 14463
e2e2423b
EZ
144642011-08-05 Eli Zaretskii <eliz@gnu.org>
14465
14466 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
14467 came from a string character with a `cursor' property. (Bug#9229)
14468
ae9e757a
JD
144692011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14470
14471 * Makefile.in (LIB_PTHREAD): New variable.
14472 (LIBES): Add LIB_PTHREAD (Bug#9216).
14473
14474 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
14475 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
14476
213bd7f2
AS
144772011-08-04 Andreas Schwab <schwab@linux-m68k.org>
14478
6b02f655 14479 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 14480
99aaf75f
JD
144812011-08-04 Jan Djärv <jan.h.d@swipnet.se>
14482
14483 * xterm.c (x_find_topmost_parent): New function.
14484 (x_set_frame_alpha): Find topmost parent window with
14485 x_find_topmost_parent and set the property there also (bug#9181).
14486 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
14487
c74e9d86
PE
144882011-08-04 Paul Eggert <eggert@cs.ucla.edu>
14489
14490 * callproc.c (Fcall_process): Avoid vfork clobbering
14491 the local vars buffer, coding_systems, current_dir.
14492
640c8776
SM
144932011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
14494
14495 * keymap.c (Fmake_composed_keymap): Move to subr.el.
14496
f26d0e4c
PE
144972011-08-03 Paul Eggert <eggert@cs.ucla.edu>
14498
8a10d76c
PE
14499 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
14500 so that it is not optimized away.
14501
f26d0e4c
PE
14502 * xdisp.c (compute_display_string_pos): Remove unused local.
14503
55439c61
EZ
145042011-08-02 Eli Zaretskii <eliz@gnu.org>
14505
14506 Fix slow cursor motion and scrolling in large buffers with
14507 selective display, like Org Mode buffers. (Bug#9218)
14508
14509 * dispextern.h (struct bidi_it): New member disp_prop_p.
14510
14511 * xdisp.c: Remove one-slot cache of display string positions.
14512 (compute_display_string_pos): Accept an additional argument
5e617bc2 14513 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
14514 for a display string or property. If found, set DISP_PROP_P
14515 non-zero.
14516
14517 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
14518 DISP_PROP_P, and pass it to compute_display_string_pos.
14519 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
14520 non-zero. All callers of bidi_fetch_char changed.
14521
fb33fa43
SM
145222011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
14523
14524 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
14525
b099e063
DM
145262010-12-03 Don March <don@ohspite.net>
14527
14528 * keymap.c (Fdefine_key): Fix non-prefix key error message when
14529 last character M-[char] is translated to ESC [char] (bug#7541).
14530
5cc7f7af
KH
145312011-08-02 Kenichi Handa <handa@m17n.org>
14532
d0fffa3f 14533 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
14534
14535 * chartab.c (uniprop_table): Make it non-static.
14536
525d5e6e
EZ
145372011-08-01 Eli Zaretskii <eliz@gnu.org>
14538
14539 * xdisp.c (forward_to_next_line_start): Accept additional argument
14540 BIDI_IT_PREV, and store into it the state of the bidi iterator had
14541 on the newline.
14542 (reseat_at_next_visible_line_start): Use the bidi iterator state
14543 returned by forward_to_next_line_start to restore the state of
14544 it->bidi_it after backing up to previous newline. (Bug#9212)
14545
31011111
AS
145462011-07-30 Andreas Schwab <schwab@linux-m68k.org>
14547
14548 * regex.c (re_comp): Protoize.
14549 (re_exec): Fix return type.
14550 (regexec): Fix type of `ret'. (Bug#9203)
14551
476371c4
PE
145522011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14553
e5d76069
PE
14554 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
14555 This is needed if max-image-size is a floating-point number.
14556
9a79b20c
AS
145572011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14558
14559 * print.c (print_object): Print empty symbol as ##.
14560
14561 * lread.c (read1): Read ## as empty symbol.
14562
d8c2fa78
AA
145632011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
14564
14565 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
14566 setting frame foreground color (Bug#9175).
14567 (x_set_background_color): Likewise.
14568
ffe57a7a
AA
14569 * nsmenu.m (-setText): Size tooltip dimensions precisely to
14570 contents (Bug#9176).
14571 (EmacsTooltip -init): Remove bezels and add shadows to
14572 tooltip windows.
14573
bf3492a5
AA
14574 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
14575 or scroll bar (Bug#8470).
14576
d55e9c53
AA
14577 * nsfont.m (nsfont_open): Remove assignment to voffset and
14578 unnecessary vars hshink, expand, hd, full_height, min_height.
14579 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
14580
14581 * nsterm.h (nsfont_info): Remove voffset field.
14582
d8c2fa78 145832011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
14584
14585 Implement strike-through and overline on NextStep (Bug#8863).
14586
14587 * nsfont.m (nsfont_open): Use underline position provided by font,
14588 instead of hard-coded value of 2.
14589 (nsfont_draw): Call ns_draw_text_decoration instead.
14590
14591 * nsterm.h: Add declaration for ns_draw_text_decoration.
14592
14593 * nsterm.m (ns_draw_text_decoration): New function for drawing
14594 underline, overline, and strike-through.
14595 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
14596 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 14597 accommodate underlining, etc.
4843aac3 14598
4cc60b9b
EZ
145992011-07-28 Eli Zaretskii <eliz@gnu.org>
14600
bc7ece87
EZ
14601 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
14602 default.
4cc60b9b 14603
476371c4
PE
146042011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14605
66606eea
PE
14606 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
14607 Without this fix, if a signal arrives just after memory fills up,
14608 'malloc' might be invoked reentrantly.
14609
476371c4
PE
14610 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
14611 In other words, assume that every image size is allowed, on non-X
14612 hosts. This assumption is probably wrong, but it lets Emacs compile.
14613
f3fcc40d
AS
146142011-07-28 Andreas Schwab <schwab@linux-m68k.org>
14615
14616 * regex.c (re_iswctype): Convert return values to boolean.
14617
350c992f
EZ
146182011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
14619
14620 * xdisp.c (compute_display_string_pos): Don't use cached display
14621 string position if the buffer had its restriction changed.
14622 (Bug#9184)
14623
5266b4bb
PE
146242011-07-28 Paul Eggert <eggert@cs.ucla.edu>
14625
14626 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14627
2573a837 146282011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 14629
41f55ccd 14630 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 14631
39e378da
PE
14632 * bidi.c: Integer size and overflow fixes.
14633 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
14634 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
14635 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14636 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
14637 (bidi_find_other_level_edge):
14638 Use ptrdiff_t instead of EMACS_INT where either will do.
14639 This works better on 32-bit hosts configured --with-wide-int.
14640 (bidi_cache_ensure_space): Check for size-calculation overflow.
14641 Use % rather than repeated addition, for better worst-case speed.
14642 Don't set bidi_cache_size until after xrealloc returns, because it
14643 might not return.
14644 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
14645 (bidi_cache_ensure_space): Also check that the bidi cache size
14646 does not exceed that of the largest Lisp string or buffer. See Eli
14647 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 14648
5e927815
PE
14649 * alloc.c (__malloc_size_t): Remove.
14650 All uses replaced by size_t. See Andreas Schwab's note
14651 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
14652
ca4aa935
PE
14653 * image.c: Improve checking for integer overflow.
14654 (check_image_size): Assume that f is nonnull, since
14655 it is always nonnull in practice. This is one less thing to
14656 worry about when checking for integer overflow later.
14657 (x_check_image_size): New function, which checks for integer
14658 overflow issues inside X.
14659 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
14660 This removes the need for a memory_full check.
14661 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
14662 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
14663 (xbm_read_bitmap_data): Change locals back to 'int', since
14664 their values must fit in 'int'.
14665 (xpm_load_image, png_load, tiff_load):
14666 Invoke x_create_x_image_and_pixmap earlier,
14667 to avoid much needless work if the image is too large.
14668 (tiff_load): Treat overly large images as if
14669 x_create_x_image_and_pixmap failed, not as malloc failures.
14670 (gs_load): Use x_check_image_size.
14671
5f8f9cc2
PE
14672 * gtkutil.c: Omit integer casts.
14673 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
14674 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
14675
5adf60bc
PE
14676 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
14677
c8907a93
PE
14678 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
14679 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
14680 would wrongly return t on a 64-bit host.
14681
e3c25c68
PE
14682 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
14683 The plain *_OVERFLOW macros run afoul of GCC bug 49705
14684 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
14685 and therefore cause GCC to emit a bogus diagnostic in some cases.
14686
3f791afe
PE
14687 * image.c: Integer signedness and overflow and related fixes.
14688 This is not an exhaustive set of fixes, but it's time to
14689 record what I've got.
14690 (lookup_pixel_color, check_image_size): Remove redundant decls.
14691 (check_image_size): Don't assume that arbitrary EMACS_INT values
14692 fit in 'int', or that arbitrary 'double' values fit in 'int'.
14693 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
14694 (tiff_load, imagemagick_load_image):
14695 Check for overflow in size calculations.
14696 (x_create_x_image_and_pixmap): Remove unnecessary test for
14697 xmalloc returning NULL; that can't happen.
14698 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
14699 (xpm_color_bucket): Use better integer hashing function.
14700 (xpm_cache_color): Don't possibly over-allocate memory.
14701 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
14702 (gif_memory_source):
14703 Use ptrdiff_t, not int or size_t, to record sizes.
14704 (png_load): Don't assume values greater than 2**31 fit in 'int'.
14705 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
14706 either works, as we prefer signed integers.
14707 (tiff_read_from_memory, tiff_write_from_memory):
14708 Return tsize_t, not size_t, since that's what the TIFF API wants.
14709 (tiff_read_from_memory): Don't fail simply because the read would
14710 go past EOF; instead, return a short read.
14711 (tiff_load): Omit no-longer-needed casts.
14712 (Fimagemagick_types): Don't assume size fits into 'int'.
14713
3cc5a532
PE
14714 Improve hashing quality when configured --with-wide-int.
14715 * fns.c (hash_string): New function, taken from sxhash_string.
14716 Do not discard information about ASCII character case; this
14717 discarding is no longer needed.
14718 (sxhash-string): Use it. Change sig to match it. Caller changed.
14719 * lisp.h: Declare it.
14720 * lread.c (hash_string): Remove, since we now use fns.c's version.
14721 The fns.c version returns a wider integer if --with-wide-int is
14722 specified, so this should help the quality of the hashing a bit.
14723
b312a492
PE
14724 * emacs.c: Integer overflow minor fix.
14725 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
14726 Define only if GNU_LINUX.
14727 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
14728
dfd153ae
PE
14729 * dispnew.c: Integer signedness and overflow fixes.
14730 Remove unnecessary forward decls, that were a maintenance hassle.
14731 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
14732 All uses changed.
14733 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
14734 (scrolling_window): Use ptrdiff_t, not int, for byte count.
14735 (prepare_desired_row, line_draw_cost):
14736 Use int, not unsigned, where either works.
14737 (save_current_matrix, restore_current_matrix):
14738 Use ptrdiff_t, not size_t, where either works.
14739 (init_display): Check for overflow more accurately, and without
14740 relying on undefined behavior.
14741
a81d11a3
PE
14742 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
14743 Remove, replacing with the new symbols in lisp.h. All uses changed.
14744 * fileio.c (make_temp_name):
14745 * filelock.c (lock_file_1, lock_file):
14746 * xdisp.c (message_dolog):
14747 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
14748 Use pMd etc. instead.
14749 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
14750 replacing the pWIDE etc. symbols removed from editfns.c.
14751
3300e6fd
PE
14752 * keyboard.h (num_input_events): Now uintmax_t.
14753 This is (very slightly) less likely to mess up due to wraparound.
14754 All uses changed.
14755
fd05c7e9
PE
14756 * buffer.c: Integer signedness fixes.
14757 (alloc_buffer_text, enlarge_buffer_text):
14758 Use ptrdiff_t rather than size_t when either will do, as we prefer
14759 signed integers.
14760
903fe15d
PE
14761 * alloc.c: Integer signedness and overflow fixes.
14762 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
14763 (__malloc_size_t): Default to size_t, not to int.
14764 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
14765 (Fgarbage_collect, mark_object_loop_halt, mark_object):
14766 Prefer ptrdiff_t to size_t when either would do, as we prefer
14767 signed integers.
14768 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
14769 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
14770 Now const. Initialize with values that are in range even if char
14771 is signed.
14772 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
14773 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
14774 These functions do the right thing with sizes > 2**32.
14775 (check_depth): Now ptrdiff_t, not int.
14776 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
14777 Adjust to new way of storing sizes. Check for size overflow bugs
14778 in rest of code.
14779 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
14780 slightly wrong anyway, as it missed one instance of
14781 XMALLOC_OVERRUN_CHECK_OVERHEAD.
14782 (refill_memory_reserve): Omit needless cast to size_t.
14783 (mark_object_loop_halt): Mark as externally visible.
14784
ac82cc6a
PE
14785 * xselect.c: Integer signedness and overflow fixes.
14786 (Fx_register_dnd_atom, x_handle_dnd_message):
14787 Use ptrdiff_t, not size_t, since we prefer signed.
14788 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
14789 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
14790 x_dnd_atoms_size and x_dnd_atoms_length.
14791
c2d1e36d
PE
14792 * doprnt.c: Prefer signed to unsigned when either works.
14793 * eval.c (verror):
14794 * doprnt.c (doprnt):
14795 * lisp.h (doprnt):
14796 * xdisp.c (vmessage):
14797 Use ptrdiff_t, not size_t, when using or implementing doprnt,
14798 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
14799 prefer signed arithmetic to avoid comparison confusion.
14800 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
14801 but is a bit tricky.
14802
0e926e56
PE
14803 Assume freestanding C89 headers, string.h, stdlib.h.
14804 * data.c, doprnt.c, floatfns.c, print.c:
14805 Include float.h unconditionally.
14806 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
14807 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
14808 * regex.c: Likewise for stddef.h, string.h.
14809 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
14810 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
14811 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
14812 (STDC_HEADERS): Remove obsolete defines.
14813 * sysdep.c: Include limits.h unconditionally.
14814
9cfdb3ec
PE
14815 Assume support for memcmp, memcpy, memmove, memset.
14816 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
14817 * regex.c (memcmp, memcpy):
14818 Remove; we assume C89 now.
14819
14820 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
14821 (__malloc_safe_bcopy): Remove; no longer needed.
14822
cf950e6b 14823 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
14824 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
14825 well either way, and we prefer signed to unsigned.
14826
dbf38e02
LMI
148272011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
14828
14829 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
14830 closes the connection while we're reading (bug#9182).
14831
d6f0886c 148322011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 14833
d6f0886c
JD
14834 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
14835 are specified (Bug#9168).
24e0f6b1 14836
2eb1f9e6
PE
148372011-07-25 Paul Eggert <eggert@cs.ucla.edu>
14838
14839 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
14840 Found by GCC static checking and --with-wide-int on a 32-bit host.
14841
22381272 148422011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
14843
14844 * xdisp.c (compute_display_string_pos): Fix logic of caching
14845 previous display string position. Initialize cached_prev_pos to
14846 -1. Fixes slow-down at the beginning of a buffer.
14847
f25e39b4
EZ
148482011-07-24 Eli Zaretskii <eliz@gnu.org>
14849
14850 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
14851 for attrs[LFACE_FONTSET_INDEX].
14852
04c4b52e
PE
148532011-07-23 Paul Eggert <eggert@cs.ucla.edu>
14854
14855 * xml.c (parse_region): Remove unused local
14856 that was recently introduced.
14857
c1734fbd
EZ
148582011-07-23 Eli Zaretskii <eliz@gnu.org>
14859
be18c5a5
EZ
14860 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
14861 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
14862
c1734fbd
EZ
14863 * xdisp.c (move_it_in_display_line_to): Record the best matching
14864 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
14865 exit if none of the characters scanned was an exact match.
14866 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
14867 when exact match is impossible due to invisible text, and the
14868 lines are truncated.
14869
a258d627
JD
148702011-07-23 Jan Djärv <jan.h.d@swipnet.se>
14871
14872 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
14873 for OSX >= 10.7.
14874
b6d5a689
EZ
148752011-07-22 Eli Zaretskii <eliz@gnu.org>
14876
0f74f785
EZ
14877 Fix a significant slow-down of cursor motion with C-n, C-p,
14878 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
14879 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 14880 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
14881 (next_element_from_buffer): Call compute_stop_pos_backwards to
14882 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
14883 base_level_stop.
14884 (reseat): Don't look for prev_stop, as that could mean a very long
14885 run.
14886 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
14887 <cached_disp_overlay_modiff>: Cache for last found display string
14888 position.
551918c1 14889 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
14890 about the same buffer in the same area of character positions, and
14891 the buffer wasn't changed since the time the display string
14892 position was cached.
551918c1 14893
b2d0c91a
EZ
148942011-07-22 Eli Zaretskii <eliz@gnu.org>
14895
14896 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
14897 is an integer, which is important for empty lines. (Bug#9149)
14898
043604ee
CY
148992011-07-22 Chong Yidong <cyd@stupidchicken.com>
14900
14901 * frame.c (Fmodify_frame_parameters): In tty case, update the
14902 default face if necessary (Bug#4238).
14903
da4adb04
CY
149042011-07-21 Chong Yidong <cyd@stupidchicken.com>
14905
14906 * editfns.c (Fstring_to_char): No need to explain what a character
14907 is in the docstring (Bug#6576).
14908
9abd0532
LMI
149092011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14910
14911 * xml.c (parse_region): Make sure we always return a tree.
14912
36881d16
HK
149132011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
14914
14915 * xml.c (parse_region): If a document contains only comments,
14916 return that, too.
14917
1e98674d
LMI
149182011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
14919
14920 * xml.c (make_dom): Return comments, too.
14921
590bd467
PE
149222011-07-19 Paul Eggert <eggert@cs.ucla.edu>
14923
14924 Port to OpenBSD.
14925 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
14926 and the surrounding thread.
14927 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
14928 rather than fgets, and retry after EINTR. Otherwise, 'emacs
14929 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
14930 timer goes off.
14931 * s/openbsd.h (BROKEN_SIGIO): Define.
14932 * unexelf.c (unexec) [__OpenBSD__]:
14933 Don't update the .mdebug section of the Alpha COFF symbol table.
14934
f41628b2
LMI
149352011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
14936
14937 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
14938 (bug#8460).
14939
b59b67c5
PE
149402011-07-18 Paul Eggert <eggert@cs.ucla.edu>
14941
15e3a074
PE
14942 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
14943 This fixes some race conditions on the permissions of any newly
14944 created file.
14945
41bed37d
PE
14946 * alloc.c (valid_pointer_p): Use pipe, not open.
14947 This fixes some permissions issues when debugging.
14948
b59b67c5
PE
14949 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
14950 If fchown fails to set both uid and gid, try to set just gid,
14951 as that is sometimes allowed. Adjust the file's mode to eliminate
14952 setuid or setgid bits that are inappropriate if fchown fails.
14953
925a6be7
SM
149542011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
14955
14956 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
14957 to compare Lisp_Objects.
14958 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
14959 global_gnutls_log_level, don't mistake it for a Lisp_Object.
14960 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
14961
52968808
AS
149622011-07-17 Andreas Schwab <schwab@linux-m68k.org>
14963
0a6a104b
AS
14964 * lread.c (read_integer): Unread even EOF character.
14965 (read1): Likewise. Properly record start position of symbol.
14966
52968808
AS
14967 * lread.c (read1): Read `#:' as empty uninterned symbol if no
14968 symbol character follows.
14969
9e381cdd
PE
149702011-07-17 Paul Eggert <eggert@cs.ucla.edu>
14971
14972 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
14973 This works around a problem with the previous change to Fcopy_file.
14974 Recent glibc declares fchown with __attribute__((warn_unused_result)),
14975 and without this change, GCC might complain about discarding
14976 fchown's return value.
14977
b5641435
JB
149782011-07-16 Juanma Barranquero <lekktu@gmail.com>
14979
14980 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
14981
a8031457
PE
149822011-07-16 Paul Eggert <eggert@cs.ucla.edu>
14983
14984 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
14985
dd889327
LMI
149862011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
14987
750c33f7
LMI
14988 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
14989 it's used from the C level.
14990
dd889327
LMI
14991 * process.c: Use the same condition for POLL_FOR_INPUT in both
14992 keyboard.c and process.c (bug#1858).
14993
87e86684
LM
149942011-07-09 Lawrence Mitchell <wence@gmx.li>
14995
14996 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
14997 (Fgnutls_boot): Use it.
14998
64348f40
AS
149992011-07-15 Andreas Schwab <schwab@linux-m68k.org>
15000
15001 * doc.c (Fsubstitute_command_keys): Revert last change.
15002
1d698799
LMI
150032011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
15004
f863868c
LMI
15005 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
15006 quotes the next character, and doesn't affect other longer
15007 sequences (bug#8935).
15008
1d698799
LMI
15009 * lread.c (syms_of_lread): Clarify that is isn't only
15010 `eval-buffer' and `eval-defun' that's affected by
15011 `lexical-binding' (bug#8460).
15012
aa4b6df6
EZ
150132011-07-15 Eli Zaretskii <eliz@gnu.org>
15014
15015 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 15016 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 15017
5d856da6
PE
150182011-07-14 Paul Eggert <eggert@cs.ucla.edu>
15019
ad6042bb
PE
15020 Fix minor problems found by static checking.
15021 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
15022 (elsz): Now a signed constant, not a size_t var. We prefer signed
15023 types to unsigned, to avoid integer comparison confusion. Without
15024 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
15025 "cannot optimize loop, the loop counter may overflow", a symptom
15026 of the confusion.
f00bbb22 15027 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
15028 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
15029
6468f31c
LMI
150302011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15031
49080b10
LMI
15032 * search.c (Fre_search_backward): Mention `case-fold-search' in
15033 all the re_search_* functions (bug#8138).
15034
6468f31c
LMI
15035 * keyboard.c (Fopen_dribble_file): Document when the file is
15036 closed (bug#8056).
15037
c965adc5
EZ
150382011-07-14 Eli Zaretskii <eliz@gnu.org>
15039
df9733bf
EZ
15040 * bidi.c (bidi_dump_cached_states): Fix format of displaying
15041 bidi_cache_idx.
15042
0bb23927
EZ
15043 Support bidi reordering of display and overlay strings.
15044 * xdisp.c (compute_display_string_pos)
15045 (compute_display_string_end): Accept additional argument STRING.
15046 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
15047 (reseat_to_string): Initialize bidi_it->string.s and
15048 bidi_it->string.schars.
15049 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
15050 NULL (avoids a crash in bidi_paragraph_init).
15051 Initialize itb.string.lstring.
0bb23927
EZ
15052 (init_iterator): Call bidi_init_it only of a valid
15053 buffer position was specified. Initialize paragraph_embedding to
15054 L2R.
15055 (reseat_to_string): Initialize the bidi iterator.
15056 (display_string): If we need to ignore text properties of
15057 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
15058 original value of -1 will not work with bidi.)
15059 (compute_display_string_pos): First arg is now struct
15060 `text_pos *'; all callers changed. Support display properties on
15061 Lisp strings.
15062 (compute_display_string_end): Support display properties on Lisp
15063 strings.
15064 (init_iterator, reseat_1, reseat_to_string): Initialize the
15065 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
15066 when iterating on a string not from display properties).
640c8776
SM
15067 (compute_display_string_pos, compute_display_string_end):
15068 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
15069 arrow keys.
15070 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
15071 base_level_stop; instead, set base_level_stop to BEGV.
15072 Fixes crashes in vertical-motion.
0bb23927
EZ
15073 (next_element_from_buffer): Improve commentary for when
15074 the iterator is before prev_stop.
15075 (init_iterator): Initialize bidi_p from the default value of
15076 bidi-display-reordering, not from buffer-local value. Use the
15077 buffer-local value only if initializing for buffer iteration.
15078 (handle_invisible_prop): Support invisible properties on strings
15079 that are being bidi-reordered.
15080 (set_iterator_to_next): Support bidi reordering of C strings and
15081 Lisp strings.
15082 (next_element_from_string): Support bidi reordering of Lisp
15083 strings.
15084 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
15085 (display_string): Support display of R2L glyph rows.
15086 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
15087 (init_iterator): Don't initialize it->bidi_p for strings
15088 here.
15089 (reseat_to_string): Initialize it->bidi_p for strings here.
15090 (next_element_from_string, next_element_from_c_string)
15091 (next_element_from_buffer): Add xassert's for correspondence
15092 between IT's object being iterated and it->bidi_it.string
15093 structure.
15094 (face_before_or_after_it_pos): Support bidi iteration.
15095 (next_element_from_c_string): Handle the case of the first string
15096 character that is not the first one in the visual order.
15097 (get_visually_first_element): New function, refactored from common
15098 parts of next_element_from_buffer, next_element_from_string, and
15099 next_element_from_c_string.
15100 (tool_bar_lines_needed, redisplay_tool_bar)
15101 (display_menu_bar): Force left-to-right direction. Add a FIXME
15102 comment for making that be controlled by a user option.
15103 (push_it, pop_it): Save and restore the state of the
15104 bidi iterator. Save and restore the bidi_p flag.
15105 (pop_it): Iterate out of display property for string iteration as
15106 well.
15107 (iterate_out_of_display_property): Support iteration over strings.
15108 (handle_single_display_spec): Set up it->bidi_it for iteration
15109 over a display string, and call bidi_init_it.
15110 (handle_single_display_spec, next_overlay_string)
15111 (get_overlay_strings_1, push_display_prop): Set up the bidi
15112 iterator for displaying display or overlay strings.
15113 (forward_to_next_line_start): Don't use the shortcut if
15114 bidi-iterating.
15115 (back_to_previous_visible_line_start): If handle_display_prop
15116 pushed the iterator stack, restore the internal state of the bidi
15117 iterator by calling bidi_pop_it same number of times.
15118 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
15119 and we are bidi-iterating, don't decrement the iterator position;
15120 instead, set the first_elt flag in the bidi iterator, to produce
15121 the same effect.
15122 (reseat_1): Remove redundant setting of string_from_display_prop_p.
15123 (push_display_prop): xassert that we are iterating a buffer.
15124 (push_it, pop_it): Save and restore paragraph_embedding member.
15125 (handle_single_display_spec, next_overlay_string)
15126 (get_overlay_strings_1, reseat_1, reseat_to_string)
15127 (push_display_prop): Set up the `unibyte' member of bidi_it.string
15128 correctly. Don't assume unibyte strings are not bidi-reordered.
15129 (compute_display_string_pos)
15130 (compute_display_string_end): Fix handling the case of C string.
15131 (push_it, pop_it): Save and restore from_disp_prop_p.
15132 (handle_single_display_spec, push_display_prop): Set the
15133 from_disp_prop_p flag.
15134 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
15135 (pop_it): Call iterate_out_of_display_property only if we are
15136 popping after iteration over a string that came from a display
15137 property. Fix a typo in popping stretch info. Add an assertion
15138 for verifying that the iterator position is in sync with the bidi
15139 iterator.
15140 (handle_single_display_spec, get_overlay_strings_1)
15141 (push_display_prop): Fix initialization of paragraph direction for
15142 string when that of the parent object is not yet determined.
15143 (reseat_1): Call bidi_init_it to resync the bidi
15144 iterator with IT's position. (Bug#7616)
15145 (find_row_edges): If ROW->start.pos gives position
15146 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
15147 (handle_stop, back_to_previous_visible_line_start, reseat_1):
15148 Reset the from_disp_prop_p flag.
15149 (SAVE_IT, RESTORE_IT): New macros.
15150 (pos_visible_p, face_before_or_after_it_pos)
15151 (back_to_previous_visible_line_start)
15152 (move_it_in_display_line_to, move_it_in_display_line)
15153 (move_it_to, move_it_vertically_backward, move_it_by_lines)
15154 (try_scrolling, redisplay_window, display_line): Use them when
15155 saving a temporary copy of the iterator and restoring it back.
15156 (back_to_previous_visible_line_start, reseat_1)
15157 (init_iterator): Empty the bidi cache "stack".
15158 (move_it_in_display_line_to): If iterator ended up at
15159 EOL, but we never saw any buffer positions smaller than
15160 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
15161 motion in bidi-reordered lines.
15162 (move_it_in_display_line_to): Record prev_method and prev_pos
15163 immediately before the call to set_iterator_to_next. Fixes cursor
15164 motion in bidi-reordered lines with stretch glyphs and strings
15165 displayed in margins. (Bug#8133) (Bug#8867)
15166 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
15167 TO_CHARPOS.
640c8776
SM
15168 (pos_visible_p): Support positions in bidi-reordered lines.
15169 Save and restore bidi cache.
0bb23927
EZ
15170
15171 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
15172 (bidi_paragraph_info): Delete unused struct.
15173 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
15174 (bidi_cache_start): New variable.
15175 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
15176 to zero.
15177 (bidi_cache_fetch_state, bidi_cache_search)
15178 (bidi_cache_find_level_change, bidi_cache_iterator_state)
15179 (bidi_cache_find, bidi_peek_at_next_level)
15180 (bidi_level_of_next_char, bidi_find_other_level_edge)
15181 (bidi_move_to_visually_next): Compare cache index with
15182 bidi_cache_start rather than with zero.
15183 (bidi_fetch_char): Accept new argument STRING; all callers
15184 changed. Support iteration over a string. Support strings with
15185 display properties. Support unibyte strings. Fix the type of
15186 `len' according to what STRING_CHAR_AND_LENGTH expects.
15187 (bidi_paragraph_init, bidi_resolve_explicit_1)
15188 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
15189 (bidi_level_of_next_char, bidi_move_to_visually_next):
15190 Support iteration over a string.
0bb23927
EZ
15191 (bidi_set_sor_type, bidi_resolve_explicit_1)
15192 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
15193 can now be zero (for strings); special values 0 and -1 were
15194 changed to -1 and -2, respectively.
15195 (bidi_char_at_pos): New function.
15196 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
15197 Call it instead of FETCH_MULTIBYTE_CHAR.
15198 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
15199 initialized to valid values.
15200 (bidi_init_it): Don't initialize charpos and bytepos with invalid
15201 values.
15202 (bidi_level_of_next_char): Allow the sentinel "position" to pass
15203 the test for valid cached positions. Fix the logic for looking up
15204 the sentinel state in the cache. GCPRO the Lisp string we are
15205 iterating.
15206 (bidi_push_it, bidi_pop_it): New functions.
15207 (bidi_initialize): Initialize the bidi cache start stack pointer.
15208 (bidi_cache_ensure_space): New function, refactored from part of
15209 bidi_cache_iterator_state. Don't assume the required size is just
15210 one BIDI_CACHE_CHUNK away.
15211 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
15212 (bidi_count_bytes, bidi_char_at_pos): New functions.
15213 (bidi_cache_search): Don't assume bidi_cache_last_idx is
15214 always valid if bidi_cache_idx is valid.
15215 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
15216 is valid if it's going to be used.
15217 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
15218 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
15219 (bidi_cache_find_level_change, bidi_cache_ensure_space)
15220 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
15221 (bidi_find_other_level_edge, bidi_cache_start_stack):
15222 All variables related to cache indices are now EMACS_INT.
c965adc5 15223
0bb23927
EZ
15224 * dispextern.h (struct bidi_string_data): New structure.
15225 (struct bidi_it): New member `string'. Make flag members be 1-bit
15226 fields, and put them last in the struct.
640c8776
SM
15227 (compute_display_string_pos, compute_display_string_end):
15228 Update prototypes.
0bb23927
EZ
15229 (bidi_push_it, bidi_pop_it): Add prototypes.
15230 (struct iterator_stack_entry): New members bidi_p,
15231 paragraph_embedding, and from_disp_prop_p.
15232 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
15233 (bidi_shelve_cache, bidi_unshelve_cache):
15234 Declare prototypes.
0bb23927
EZ
15235
15236 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
15237 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
15238 and vector-like objects.
15239
15240 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
15241 cache around display iteration.
15242
15243 * window.c (Fwindow_end, window_scroll_pixel_based)
15244 (displayed_window_lines, Frecenter): Save and restore the bidi
15245 cache around display iteration.
15246
3bbd2265
LMI
152472011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
15248
15249 * editfns.c (Fdelete_region): Clarify the use of the named
15250 parameters (bug#6788).
15251
adc47434
MR
152522011-07-14 Martin Rudalics <rudalics@gmx.at>
15253
15254 * indent.c (Fvertical_motion): Set and restore w->pointm when
15255 saving and restoring the window's buffer (Bug#9006).
15256
837c31f8
LMI
152572011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15258
15259 * editfns.c (Fstring_to_char): Clarify just what is returned
15260 (bug#6576). Text by Eli Zaretskii.
15261
ac389d0c
JB
152622011-07-13 Juanma Barranquero <lekktu@gmail.com>
15263
15264 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
15265
0be0ce47
EZ
152662011-07-13 Eli Zaretskii <eliz@gnu.org>
15267
15268 * buffer.c (mmap_find): Fix a typo.
15269
cd18e7e3
JB
152702011-07-13 Johan Bockgård <bojohan@gnu.org>
15271
15272 Fix execution of x selection hooks.
15273 * xselect.c (Qx_lost_selection_functions)
15274 (Qx_sent_selection_functions): New vars.
15275 (syms_of_xselect): DEFSYM them.
15276 (x_handle_selection_request): Pass Qx_sent_selection_functions
15277 rather than Vx_sent_selection_functions to Frun_hook_with_args.
15278 (x_handle_selection_clear,x_clear_frame_selections):
15279 Pass Qx_lost_selection_functions rather than
15280 Vx_lost_selection_functions to Frun_hook_with_args.
15281
47ea7f44
PE
152822011-07-13 Paul Eggert <eggert@cs.ucla.edu>
15283
ac389d0c 15284 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
15285 The old code sometimes used this field without initializing it.
15286
47ea7f44
PE
15287 * alloc.c (gc_sweep): Don't read past end of array.
15288 In theory, the old code could also have corrupted Emacs internals,
15289 though it'd be very unlikely.
15290
bc985c87
AS
152912011-07-12 Andreas Schwab <schwab@linux-m68k.org>
15292
15293 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 15294 argument. (Bug#4026)
bc985c87 15295
0cf34688
LMI
152962011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
15297
b3dadd76
LMI
15298 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
15299 key" (bug#4257).
15300
0cf34688
LMI
15301 * window.c (Fset_window_start): Doc fix (bug#4199).
15302 (Fset_window_hscroll): Ditto.
15303
270768cd
PE
153042011-07-12 Paul Eggert <eggert@cs.ucla.edu>
15305
077e3dda 15306 Fix minor new problems caught by GCC 4.6.1.
270768cd 15307 * term.c (init_tty): Remove unused local.
490011a6 15308 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 15309 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 15310 not used otherwise.
270768cd 15311
b1f58454
CY
153122011-07-12 Chong Yidong <cyd@stupidchicken.com>
15313
15314 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
15315
22b9578d
LMI
153162011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15317
6e70ab07
LMI
15318 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
15319 are the mini-buffer and the echo area (bug#3320).
15320
22b9578d
LMI
15321 * term.c (init_tty): Remove support for supdup, c10 and perq
15322 terminals, which are no longer supported (bug#1482).
15323
8974cc9f
JB
153242011-07-10 Johan Bockgård <bojohan@gnu.org>
15325
15326 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
15327
a560d974
JD
153282011-07-10 Jan Djärv <jan.h.d@swipnet.se>
15329
15330 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
15331 for non-popups (Bug#3642).
15332
1dae0f0a
AS
153332011-07-10 Andreas Schwab <schwab@linux-m68k.org>
15334
268c2c36 15335 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 15336 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
15337 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
15338 * cm.c (losecursor): Likewise.
1dae0f0a
AS
15339 * data.c (fmod): Likewise.
15340 * dispnew.c (swap_glyphs_in_rows): Likewise.
15341 * emacs.c (memory_warning_signal): Likewise.
15342 * floatfns.c (float_error): Likewise.
15343 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
15344 (otf_open, font_otf_capability, generate_otf_features)
15345 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
15346 Likewise.
15347 * image.c (pbm_read_file): Likewise.
15348 * indent.c (string_display_width): Likewise.
15349 * intervals.c (check_for_interval, search_for_interval)
15350 (inc_interval_count, count_intervals, root_interval)
15351 (adjust_intervals_for_insertion, make_new_interval): Likewise.
15352 * lread.c (defalias): Likewise.
268c2c36 15353 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
15354 * regex.c (set_image_of_range_1, set_image_of_range)
15355 (regex_grow_registers): Likewise.
15356 * sysdep.c (strerror): Likewise.
15357 * termcap.c (valid_filename_p, tprint, main): Likewise.
15358 * tparam.c (main): Likewise.
15359 * unexhp9k800.c (run_time_remap, save_data_space)
15360 (update_file_ptrs, read_header, write_header, calculate_checksum)
15361 (copy_file, copy_rest, display_header): Likewise.
15362 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
15363 Likewise.
15364 * xdisp.c (check_it): Likewise.
15365 * xfaces.c (register_color, unregister_color, unregister_colors):
15366 Likewise.
15367 * xfns.c (print_fontset_result): Likewise.
15368 * xrdb.c (member, fatal, main): Likewise.
15369
99033785
PE
153702011-07-10 Paul Eggert <eggert@cs.ucla.edu>
15371
15372 Fix minor problems found by static checking (Bug#9031).
15373 * chartab.c (char_table_set_range, map_sub_char_table):
15374 Remove unused locals.
15375 (uniprop_table): Now static.
15376 * composite.c (_work_char): Remove unused static var.
15377
9cb2ac56
JB
153782011-07-09 Juanma Barranquero <lekktu@gmail.com>
15379
15380 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
15381
f25661f0
JD
153822011-07-09 Jan Djärv <jan.h.d@swipnet.se>
15383
15384 * gtkutil.c (qttip_cb): Remove code without function.
15385
8278c4fe
EZ
153862011-07-09 Eli Zaretskii <eliz@gnu.org>
15387
15388 * w32.c (pthread_sigmask): New stub.
15389
1692ae2d 153902011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 15391
8a6ebd58 15392 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
15393 sigprocmask is portable only for single-threaded applications, and
15394 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
15395 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
15396 (LIBES): Use it.
15397 * callproc.c (Fcall_process):
15398 * process.c (create_process):
15399 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
15400 Use pthread_sigmask, not sigprocmask.
123403e4 15401
1b854618
JD
154022011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15403
15404 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
15405 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
15406 wrong (Bug#8591).
15407
3fe4b549
JD
154082011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15409
0ce7e563
JD
15410 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
15411 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
15412 (xg_hide_tooltip): Fix comment.
15413
3fe4b549
JD
15414 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
15415 in registerServicesMenuSendTypes.
15416 (validRequestorForSendType): Don't check ns_return_types.
15417
15418 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
15419 ns_return_type.
15420
5df75e47
JR
154212011-07-08 Jason Rumney <jasonr@gnu.org>
15422
22610910
JR
15423 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
15424 SH_SHOW for hidden windows (Bug#5482).
15425
5df75e47
JR
15426 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
15427 frame struct members of non-existent frames (Bug#6284).
15428
699c10bd
JD
154292011-07-08 Jan Djärv <jan.h.d@swipnet.se>
15430
4393663b
JD
15431 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
15432 variable firstTime not needed on OSX >= 10.6.
15433 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
15434 >= 10.5. Use setKnobProportion, setDoubleValue.
15435
15436 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
15437 (MAC_OS_X_VERSION_10_5): Define if not defined.
15438 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
15439 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
15440 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
15441
15442 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 15443 cString and lossyCString on OSX >= 10.4.
4393663b 15444
58179cce 15445 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
15446 sizeToFit on OSX >= 10.2.
15447
15448 * nsimage.m (allocInitFromFile): Don't use deprecated method
15449 bestRepresentationForDevice on OSX >= 10.6.
15450
15451 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
15452 to avoid warning.
15453
15454 * emacs.c: Declare unexec_init_emacs_zone.
15455
a63e0781
JD
15456 * nsgui.h: Fix compiler warning about gnulib redefining verify.
15457
699c10bd
JD
15458 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
15459
15460 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
15461 on svcsMenu (Bug#8842).
15462
15463 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
15464 ns_return_types.
15465 (Fns_list_services): Just return Qnil on 10.6, code not working there.
15466
15467 * nsterm.m (QUTF8_STRING): Declare.
15468 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
15469 (validRequestorForSendType): Return type is (id).
15470 Change indexOfObjectIdenticalTo to indexOfObject.
15471 Check if we have local selection before returning self (Bug#8842).
15472 (writeSelectionToPasteboard): Put local selection into paste board
15473 if we have a local selection (Bug#8842).
15474 (syms_of_nsterm): DEFSYM QUTF8_STRING.
15475
15476 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
15477 (ns_get_local_selection): Declare.
15478
54e10184
LMI
154792011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
15480
9888ff71
LMI
15481 * keymap.c (describe_map_tree): Don't insert a double newline at
15482 the end of the buffer (bug#1169) and return whether we inserted
15483 something.
15484
54e10184
LMI
15485 * callint.c (Fcall_interactively): Change "reading args" to
15486 "providing args" to try to clarify what it does (bug#1010).
15487
15fa4783
KH
154882011-07-07 Kenichi Handa <handa@m17n.org>
15489
15490 * composite.c (composition_compute_stop_pos): Ignore a static
15491 composition starting before CHARPOS (Bug#8915).
15492
15493 * xdisp.c (handle_composition_prop): Likewise.
15494
a8815b00
EZ
154952011-07-07 Eli Zaretskii <eliz@gnu.org>
15496
15497 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
15498 (Bug#9015)
15499
ef7b981d 155002011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
15501
15502 * character.h (unicode_category_t): New enum type.
15503
15504 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
15505 (Qchar_code_property_table): New variable.
15506 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
15507 (UNIPROP_COMPRESSED_FORM_P): New macros.
15508 (char_table_ascii): Uncompress the compressed values.
15509 (sub_char_table_ref): New arg is_uniprop. Callers changed.
15510 Uncompress the compressed values.
ac389d0c 15511 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
15512 (char_table_ref_and_range): Uncompress the compressed values.
15513 (sub_char_table_set): New arg is_uniprop. Callers changed.
15514 Uncompress the compressed values.
15515 (sub_char_table_set_range): Args changed. Callers changed.
15516 (char_table_set_range): Adjuted for the above change.
15517 (map_sub_char_table): Delete args default_val and parent. Add arg
15518 top. Give decoded values to a Lisp function.
640c8776 15519 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
15520 values to a Lisp function. Gcpro more variables.
15521 (uniprop_table_uncompress)
15522 (uniprop_decode_value_run_length): New functions.
15523 (uniprop_decoder, uniprop_decoder_count): New variables.
15524 (uniprop_get_decoder, uniprop_encode_value_character)
15525 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
15526 New functions.
15527 (uniprop_encoder, uniprop_encoder_count): New variables.
15528 (uniprop_get_encoder, uniprop_table)
15529 (Funicode_property_table_internal, Fget_unicode_property_internal)
15530 (Fput_unicode_property_internal): New functions.
15531 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
15532 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 15533 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
15534 char-code-property-alist.
15535
640c8776 15536 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
15537 Vunicode_category_table.
15538
640c8776 15539 * font.c (font_range): Adjust for the change of
c805dec0
KH
15540 Vunicode_category_table.
15541
76b397fb
DN
155422011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
15543
15544 * m/iris4d.h: Remove file, move contents ...
15545 * s/irix6-5.h: ... here.
15546
22b4128e
PE
155472011-07-06 Paul Eggert <eggert@cs.ucla.edu>
15548
15549 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
15550 * alloc.c (mark_buffer):
15551 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
15552 (clone_per_buffer_values): Don't assume that
22b4128e
PE
15553 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
15554 This isn't true in general, and it's particularly not true
15555 if Emacs is configured with --with-wide-int.
15556 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
15557 New macros, used in the buffer.c change.
15558
869795d6
JD
155592011-07-05 Jan Djärv <jan.h.d@swipnet.se>
15560
15561 * xsettings.c: Use both GConf and GSettings if both are available.
15562 (store_config_changed_event): Add comment.
15563 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
15564 (store_tool_bar_style_changed): New functions.
5e617bc2 15565 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
15566 (struct xsettings): Move font inside HAVE_XFT.
15567 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 15568 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 15569 Move inside HAVE_XFT.
640c8776 15570 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
15571 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
15572 also.
15573 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 15574 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 15575 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
15576 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
15577 (parse_settings): Move check for font inside HAVE_XFT.
15578 (read_settings, apply_xft_settings): Add comment.
15579 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
15580 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
15581 call store_font_name_changed.
15582 (xft_settings_event): Add comment.
15583 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
15584 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
15585 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
15586 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
15587 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
15588 (xsettings_get_system_font, xsettings_get_system_normal_font):
15589 Add comment.
869795d6 15590
d8ed26bd
PE
155912011-07-05 Paul Eggert <eggert@cs.ucla.edu>
15592
15593 Random fixes. E.g., (random) never returned negative values.
15594 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
15595 subseconds part to the entropy, as that's a bit more random.
15596 Prefer signed to unsigned, since the signedness doesn't matter and
15597 in general we prefer signed. When given a limit, use a
15598 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
15599 latter isn't right if USE_2_TAGS_FOR_INTS.
15600 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
15601 not 0..VALMASK. Don't discard "excess" bits that random () returns.
15602
cabf1cac
SM
156032011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
15604
15605 * textprop.c (text_property_stickiness):
15606 Obey Vtext_property_default_nonsticky.
15607 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
15608 * w32fns.c (syms_of_w32fns):
15609 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
15610
6e9b2be9
PE
156112011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15612
15613 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
15614 This is more efficient than Ffile_directory_p and avoids a minor race.
15615
90186c68
LMI
156162011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
15617
7c301272
LMI
15618 * buffer.c (Foverlay_put): Say what the return value is
15619 (bug#7835).
15620
c4f2d8d4
LMI
15621 * fileio.c (barf_or_query_if_file_exists): Check first if the file
15622 is a directory before asking whether to use the file name
15623 (bug#7564).
ad637907
LMI
15624 (barf_or_query_if_file_exists): Make the "File is a directory"
15625 error be more correct.
c4f2d8d4 15626
90186c68
LMI
15627 * fns.c (Frequire): Remove the mention of the .gz files, since
15628 that's installation-specific, but keep the mention of
15629 `get-load-suffixes'.
15630
da64016e
PE
156312011-07-04 Paul Eggert <eggert@cs.ucla.edu>
15632
15633 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
15634 Report string overflow if the output is too long.
15635
7d47b580
JB
156362011-07-04 Juanma Barranquero <lekktu@gmail.com>
15637
a555cb87
JB
15638 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
15639 (syms_of_gnutls): Remove duplicate DEFSYM for
15640 Qgnutls_bootprop_verify_hostname_error, an error for
15641 Qgnutls_bootprop_verify_error (which is no longer used).
15642
7d47b580
JB
15643 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
15644 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
15645 Also (re)move comments that are misplaced or no longer relevant.
15646
1e49bfab
LMI
156472011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15648
15649 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
15650
1485f4c0
CY
156512011-07-03 Chong Yidong <cyd@stupidchicken.com>
15652
15653 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
15654 and background color parameters if they have been changed.
15655
a9ab721e
LMI
156562011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15657
15658 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
15659
cf7cff57
PE
156602011-07-03 Paul Eggert <eggert@cs.ucla.edu>
15661
2e13213d
PE
15662 * xsettings.c (SYSTEM_FONT): Define only when used.
15663 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
15664
cf7cff57
PE
15665 * keymap.c (access_keymap_1): Now static.
15666
7a8e04f7
CY
156672011-07-02 Chong Yidong <cyd@stupidchicken.com>
15668
15669 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
15670 leave any prefix arg for the up event (Bug#1586).
15671
61352f62
LMI
156722011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
15673
69bb1ef7
LMI
15674 * lread.c (syms_of_lread): Mention single symbols defined by
15675 `defvar' or `defconst' (bug#7154).
15676
61352f62 15677 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 15678 (Frequire): Mention get-load-suffixes.
61352f62 15679
28545e04
MR
156802011-07-02 Martin Rudalics <rudalics@gmx.at>
15681
15682 * window.h (window): Remove clone_number slot.
15683 * window.c (Fwindow_clone_number, Fset_window_clone_number):
15684 Remove.
15685 (make_parent_window, make_window, saved_window)
15686 (Fset_window_configuration, save_window_save): Don't deal with
15687 clone numbers.
15688 * buffer.c (Qclone_number): Remove declaration.
15689 (sort_overlays, overlay_strings): Don't deal with clone numbers.
15690
3349e122
SM
156912011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
15692
15693 Add multiple inheritance to keymaps.
15694 * keymap.c (Fmake_composed_keymap): New function.
15695 (Fset_keymap_parent): Simplify.
15696 (fix_submap_inheritance): Remove.
15697 (access_keymap_1): New function extracted from access_keymap to handle
15698 embedded parents and handle lists of maps.
15699 (access_keymap): Use it.
15700 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
15701 (Fcopy_keymap): Handle embedded parents.
15702 (Fcommand_remapping, define_as_prefix): Simplify.
15703 (Fkey_binding): Simplify.
15704 (syms_of_keymap): Move minibuffer-local-completion-map,
15705 minibuffer-local-filename-completion-map,
15706 minibuffer-local-must-match-map, and
15707 minibuffer-local-filename-must-match-map to Elisp.
15708 (syms_of_keymap): Defsubr make-composed-keymap.
15709 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
15710 (parse_menu_item): Trivial simplification.
15711
3279eb87
GM
157122011-07-01 Glenn Morris <rgm@gnu.org>
15713
15714 * Makefile.in (SETTINGS_LIBS): Fix typo.
15715
39cb9e56 157162011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
15717
15718 * coding.c (Fencode_coding_string): Record the last coding system
15719 used, as the function doc string says (bug#8738).
15720
0949d2b6
JD
157212011-07-01 Jan Djärv <jan.h.d@swipnet.se>
15722
15723 * xsettings.c (store_monospaced_changed): Take new font as arg and
15724 check for change against current_mono_font.
15725 (EMACS_TYPE_SETTINGS): Remove this and related defines.
15726 (emacs_settings_constructor, emacs_settings_get_property)
15727 (emacs_settings_set_property, emacs_settings_class_init)
15728 (emacs_settings_init, gsettings_obj): Remove.
15729 (something_changedCB): New function for HAVE_GSETTINGS.
15730 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
15731 with value as argument.
15732 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
15733 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 15734 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
15735 "changed".
15736
15737 * xgselect.c: Add defined (HAVE_GSETTINGS).
15738 (xgselect_initialize): Ditto.
15739
15740 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
15741 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
15742 xg_select.
15743
bbc6b304
PE
157442011-07-01 Paul Eggert <eggert@cs.ucla.edu>
15745
15746 * eval.c (struct backtrace): Simplify and port the data structure.
15747 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
15748 signed bit field, as this assumption is not portable and it makes
15749 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
15750 "char debug_on_exit : 1" as this is not portable either; instead,
15751 use the portable "unsigned int debug_on_exit : 1". Remove unused
15752 member evalargs. Remove obsolete comments about cc bombing out.
15753
9851bfc5
JD
157542011-06-30 Jan Djärv <jan.h.d@swipnet.se>
15755
51bb811f 15756 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
15757 Let HAVE_GSETTINGS override HAVE_GCONF.
15758 (store_monospaced_changed): New function.
15759 (EMACS_SETTINGS): A new type derived from GObject to handle
15760 GSettings notifications.
15761 (emacs_settings_constructor, emacs_settings_get_property)
15762 (emacs_settings_set_property, emacs_settings_class_init):
15763 New functions.
15764 (gsettings_client, gsettings_obj): New variables.
15765 (GSETTINGS_SCHEMA): New define.
15766 (something_changedCB): Call store_monospaced_changed.
15767 (init_gsettings): New function.
15768 (xsettings_initialize): Call init_gsettings.
15769 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
15770 to NULL.
15771
640c8776 15772 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
15773 GCONF_CFLAGS/LIBS.
15774
5386012d
MR
157752011-06-29 Martin Rudalics <rudalics@gmx.at>
15776
15777 * window.c (resize_root_window, grow_mini_window)
15778 (shrink_mini_window): Rename Qresize_root_window to
15779 Qwindow_resize_root_window and Qresize_root_window_vertically to
15780 Qwindow_resize_root_window_vertically.
15781
f13e0b08
PE
157822011-06-28 Paul Eggert <eggert@cs.ucla.edu>
15783
15784 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
15785
94515237
JB
157862011-06-27 Juanma Barranquero <lekktu@gmail.com>
15787
15788 * makefile.w32-in: Redesign dependencies so they reflect more
15789 clearly which files are directly included by each source file,
15790 and not through other includes.
15791
e43b6e43
MR
157922011-06-27 Martin Rudalics <rudalics@gmx.at>
15793
15794 * buffer.c (Qclone_number): Declare static and DEFSYM it.
15795 (sort_overlays, overlay_strings): When an overlay's clone number
15796 matches the window's clone number process the overlay even if
15797 the overlay's window property doesn't match the current window.
15798
d68443dc
MR
15799 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
15800 (Fwindow_hchild): Rename to Fwindow_left_child.
15801 (Fwindow_next): Rename to Fwindow_next_sibling.
15802 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
15803 (resize_window_check): Rename to window_resize_check.
15804 (resize_window_apply): Rename to window_resize_apply.
15805 (Fresize_window_apply): Rename to Fwindow_resize_apply.
15806 (Fdelete_other_windows_internal, resize_frame_windows)
15807 (Fsplit_window_internal, Fdelete_window_internal)
15808 (grow_mini_window, shrink_mini_window)
15809 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 15810
c7e73be5
JD
158112011-06-26 Jan Djärv <jan.h.d@swipnet.se>
15812
15813 * emacsgtkfixed.h: State that this is only used with Gtk+3.
15814 (emacs_fixed_set_min_size): Remove.
15815 (emacs_fixed_new): Take frame as argument.
15816
15817 * emacsgtkfixed.c: State that this is only used with Gtk+3.
15818 (_EmacsFixedPrivate): Remove minwidth/height.
15819 Add struct frame *f.
15820 (emacs_fixed_init): Initialize priv->f.
15821 (get_parent_class, emacs_fixed_set_min_size): Remove.
15822 (emacs_fixed_new): Set priv->f to argument.
15823 (emacs_fixed_get_preferred_width)
15824 (emacs_fixed_get_preferred_height): Use min_width/height from
15825 frames size_hint to set minimum and natural (Bug#8919).
15826 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
15827 and use min_width/height from frames size_hint to set
15828 min_width/height (Bug#8919).
15829
15830 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
15831 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
15832 Fix indentation.
c7e73be5 15833
cf99dcf8
EZ
158342011-06-26 Eli Zaretskii <eliz@gnu.org>
15835
15836 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
15837 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
15838 called at ZV.
15839
029529ac
CY
158402011-06-26 Chong Yidong <cyd@stupidchicken.com>
15841
15842 * process.c (wait_reading_process_output): Bypass select if
15843 waiting for a cell while ignoring keyboard input, and input is
15844 pending. Suggested by Jan Djärv (Bug#8869).
15845
7a7ef429
PE
158462011-06-25 Paul Eggert <eggert@cs.ucla.edu>
15847
15848 Use gnulib's dup2 module instead of rolling our own.
15849 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
15850
11fdef7d 158512011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
15852
15853 * dispnew.c (scrolling_window): Before scrolling, turn off a
15854 mouse-highlight in the window being scrolled.
15855
cd3520a4
JB
158562011-06-24 Juanma Barranquero <lekktu@gmail.com>
15857
15858 Move DEFSYM to lisp.h and use everywhere.
15859
15860 * character.h (DEFSYM): Move declaration...
15861 * lisp.h (DEFSYM): ...here.
15862
15863 * gnutls.c:
15864 * minibuf.c:
15865 * w32menu.c:
15866 * w32proc.c:
15867 * w32select.c: Don't include character.h.
15868
15869 * alloc.c (syms_of_alloc):
15870 * buffer.c (syms_of_buffer):
15871 * bytecode.c (syms_of_bytecode):
15872 * callint.c (syms_of_callint):
15873 * casefiddle.c (syms_of_casefiddle):
15874 * casetab.c (init_casetab_once):
15875 * category.c (init_category_once, syms_of_category):
15876 * ccl.c (syms_of_ccl):
15877 * cmds.c (syms_of_cmds):
15878 * composite.c (syms_of_composite):
15879 * dbusbind.c (syms_of_dbusbind):
15880 * dired.c (syms_of_dired):
15881 * dispnew.c (syms_of_display):
15882 * doc.c (syms_of_doc):
15883 * editfns.c (syms_of_editfns):
15884 * emacs.c (syms_of_emacs):
15885 * eval.c (syms_of_eval):
15886 * fileio.c (syms_of_fileio):
15887 * fns.c (syms_of_fns):
15888 * frame.c (syms_of_frame):
15889 * fringe.c (syms_of_fringe):
15890 * insdel.c (syms_of_insdel):
15891 * keymap.c (syms_of_keymap):
15892 * lread.c (init_obarray, syms_of_lread):
15893 * macros.c (syms_of_macros):
15894 * msdos.c (syms_of_msdos):
15895 * print.c (syms_of_print):
15896 * process.c (syms_of_process):
15897 * search.c (syms_of_search):
15898 * sound.c (syms_of_sound):
15899 * syntax.c (init_syntax_once, syms_of_syntax):
15900 * terminal.c (syms_of_terminal):
15901 * textprop.c (syms_of_textprop):
15902 * undo.c (syms_of_undo):
15903 * w32.c (globals_of_w32):
15904 * window.c (syms_of_window):
15905 * xdisp.c (syms_of_xdisp):
15906 * xfaces.c (syms_of_xfaces):
15907 * xfns.c (syms_of_xfns):
15908 * xmenu.c (syms_of_xmenu):
15909 * xsettings.c (syms_of_xsettings):
15910 * xterm.c (syms_of_xterm): Use DEFSYM.
15911
4228cf16
TZ
159122011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
15913
cd3520a4 15914 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 15915
7fcccf1e
PE
159162011-06-23 Paul Eggert <eggert@cs.ucla.edu>
15917
7efb4e0e
PE
15918 Integer and buffer overflow fixes (Bug#8873).
15919
ff5844ad
PE
15920 * print.c (printchar, strout): Check for string overflow.
15921 (PRINTPREPARE, printchar, strout):
15922 Don't set size unless allocation succeeds.
15923
90532f02
PE
15924 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
15925 for sizes. Check for string overflow more accurately.
15926 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
15927
6d84508d
PE
15928 * macros.c: Integer and buffer overflow fixes.
15929 * keyboard.h (struct keyboard.kbd_macro_bufsize):
15930 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
15931 Use ptrdiff_t, not int, for sizes.
15932 Don't increment bufsize until after realloc succeeds.
15933 Check for size-calculation overflow.
15934 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
15935
437b2cb4
PE
15936 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
15937
8b9ac8b4
PE
15938 * lread.c: Integer overflow fixes.
15939 (read_integer): Radix is now EMACS_INT, not int,
15940 to improve quality of diagnostics for out-of-range radices.
15941 Calculate buffer size correctly for out-of-range radices.
15942 (read1): Check for integer overflow in radices, and in
15943 read-circle numbers.
82cb60d3
PE
15944 (read_escape): Avoid int overflow.
15945 (Fload, openp, read_buffer_size, read1)
15946 (substitute_object_recurse, read_vector, read_list, map_obarray):
15947 Use ptrdiff_t, not int, for sizes.
15948 (read1): Use EMACS_INT, not int, for sizes.
20270765 15949 Check for size overflow.
8b9ac8b4 15950
7fcccf1e
PE
15951 * image.c (cache_image): Check for size arithmetic overflow.
15952
bfbbd7e7
PE
15953 * lread.c: Integer overflow issues.
15954 (saved_doc_string_size, saved_doc_string_length)
15955 (prev_saved_doc_string_size, prev_saved_doc_string_length):
15956 Now ptrdiff_t, not int.
15957 (read1): Don't assume doc string length fits in int. Check for
15958 out-of-range doc string lengths.
15959 (read_list): Don't assume file position fits in int.
39019e54 15960 (read_escape): Check for hex character overflow.
bfbbd7e7 15961
4e323265
LL
159622011-06-22 Leo Liu <sdl.web@gmail.com>
15963
15964 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
15965 Move to minibuffer.el.
15966
85fece3e
PE
159672011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15968
20b84ce9 15969 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
15970 The following patches are for when GLYPH_DEBUG && !XASSERT.
15971 * dispextern.h (trace_redisplay_p, dump_glyph_string):
15972 * dispnew.c (flush_stdout):
15973 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
15974 Mark as externally visible.
15975 * dispnew.c (check_window_matrix_pointers): Now static.
15976 * dispnew.c (window_to_frame_vpos):
15977 * xfns.c (unwind_create_frame):
15978 * xterm.c (x_check_font): Remove unused local.
15979 * scroll.c (CHECK_BOUNDS):
15980 * xfaces.c (cache_fache): Rename local to avoid shadowing.
15981 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
15982 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
15983 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
15984 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
15985 Now static.
15986 (debug_method_add): Use va_list and vsprintf rather than relying
15987 on undefined behavior with wrong number of arguments.
15988 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
15989 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
15990 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
15991 since we're not interested in debugging glyphs with old libraries.
15992 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
15993 GCC 4.6.0's static checking.
15994
0766b489
PE
159952011-06-22 Paul Eggert <eggert@cs.ucla.edu>
15996
31fd4b32
PE
15997 Integer overflow and signedness fixes (Bug#8873).
15998 A few related buffer overrun fixes, too.
15999
b79e8648
PE
16000 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
16001
0766b489
PE
16002 * dispextern.h (struct face.stipple):
16003 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
16004 (x_bitmap_mask, x_allocate_bitmap_record)
16005 (x_create_bitmap_from_data, x_create_bitmap_from_file)
16006 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
16007 (x_create_bitmap_from_xpm_data):
16008 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
16009 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
16010 (.bitmaps_last):
16011 * xfaces.c (load_pixmap):
16012 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
16013 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
16014 (.bitmaps_last, struct x_output.icon_bitmap):
16015 Use ptrdiff_t, not int, for bitmap indexes.
16016 (x_allocate_bitmap_record): Check for size overflow.
16017 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
16018
b081724f
PE
16019 Use ptrdiff_t, not int, for overlay counts.
16020 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
16021 * editfns.c (overlays_around, get_pos_property):
16022 * textprop.c (get_char_property_and_overlay):
16023 * xdisp.c (next_overlay_change, note_mouse_highlight):
16024 * xfaces.c (face_at_buffer_position):
21514da7
PE
16025 * buffer.c (OVERLAY_COUNT_MAX): New macro.
16026 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
16027 (Fnext_overlay_change, Fprevious_overlay_change)
16028 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 16029 Use ptrdiff_t, not int, for sizes.
21514da7 16030 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 16031
3de73e5e
PE
16032 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
16033
2606c57b
PE
16034 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
16035 (x_session_initialize): Do not assume string length fits in int.
16036
aaafe47a
PE
16037 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
16038 This is unlikely, but can occur if DPI is outlandish.
16039
2674ddc8 16040 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
16041 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
16042
28154962
PE
16043 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
16044 * xrdb.c (magic_file_p, search_magic_path):
16045 Omit last arg SUFFIX; it was always 0. All callers changed.
16046 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
16047
7de51af5
PE
16048 * xfont.c (xfont_match): Avoid need for strlen.
16049
25ed6cc3
PE
16050 * xfns.c: Don't assume strlen fits in int.
16051 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
16052
4eab31dd
PE
16053 * xdisp.c (message_log_check_duplicate): Return intmax_t,
16054 not unsigned long, as we prefer signed integers. All callers changed.
16055 Detect integer overflow in repeat count.
16056 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 16057 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 16058
171e2a58
PE
16059 * termcap.c: Don't assume sizes fit in int and never overflow.
16060 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
16061 (gobble_line): Check for size-calculation overflow.
16062
ad39faca 16063 * minibuf.c (Fread_buffer):
6e5bb2dc 16064 * lread.c (intern, intern_c_string):
74ca2eb3
PE
16065 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
16066 Don't assume string length fits in int.
16067
52c61c22 16068 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
16069 * gtkutil.c (style_changed_cb): Avoid need for strlen.
16070
b5b8c9e5
PE
16071 * font.c: Don't assume string length fits in int.
16072 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
16073 Use ptrdiff_t, not int.
ccd6111c
PE
16074 (font_intern_prop): Don't assume string length fits in int.
16075 Don't assume integer property fits in fixnum.
16076 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 16077
882f0d81 16078 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 16079 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
16080 Reformulate so as not to need the command string.
16081 Invoke gzip -cd rather than gunzip, as it's more portable.
16082 (lock_info_type, lock_file_1, lock_file):
16083 Don't assume pid_t and time_t fit in unsigned long.
16084 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
16085 (current_lock_owner): Prefer signed type for sizes.
16086 Use memcpy, not strncpy, where memcpy is what is really wanted.
16087 Don't assume (via atoi) that time_t and pid_t fit in int.
16088 Check for time_t and/or pid_t out of range, e.g., via a network share.
16089 Don't alloca where an auto var works fine.
16090
93f4cf88
PE
16091 * fileio.c: Fix some integer overflow issues.
16092 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
16093 Don't assume string length fits in int.
16094 (directory_file_name): Don't assume string length fits in long.
16095 (make_temp_name): Don't assume pid fits in int, or that its print
16096 length is less than 20.
16097
f3e92b69
PE
16098 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
16099
1bfdaf10
PE
16100 * coding.c (make_subsidiaries): Don't assume string length fits in int.
16101
35016e9a
PE
16102 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
16103
3d1e65a1
PE
16104 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
16105 We prefer signed integers, even for size calculations.
16106
0b963a93
PE
16107 * emacs.c: Don't assume string length fits in 'int'.
16108 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
16109 (main): Don't invoke strlen when not needed.
16110
573f4b54
PE
16111 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
16112 (XD_DEBUG_MESSAGE): Don't waste a byte.
16113
989f33ba
PE
16114 * callproc.c (getenv_internal_1, getenv_internal)
16115 (Fgetenv_internal):
965d34eb
PE
16116 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
16117
e4d29b33
PE
16118 * lread.c (invalid_syntax): Omit length argument.
16119 All uses changed. This doesn't fix a bug, but it simplifies the
16120 code away from its former Hollerith-constant appearance, and it's
16121 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 16122 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 16123
eb49b136
PE
16124 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
16125 This didn't break anything, but it didn't help either.
16126 It's confusing to put a bogus integer in a place where the actual
16127 value does not matter.
9f62aeb1 16128 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 16129 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 16130
15375a22
PE
16131 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
16132 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
16133 implementation.
b61cc01c
PE
16134 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
16135 We prefer signed types, and the value cannot exceed the EMACS_INT
16136 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
16137 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
16138 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
16139 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 16140
53b2623d
PE
16141 * indent.c (sane_tab_width): New function.
16142 (current_column, scan_for_column, Findent_to, position_indentation)
16143 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 16144 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 16145
51cab52b 16146 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 16147
f2ed8a70
PE
16148 * lisp.h (lint_assume): New macro.
16149 * composite.c (composition_gstring_put_cache):
16150 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
16151
abe80cc6
PE
16152 * editfns.c, insdel.c:
16153 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 16154
b02c740e
PE
16155 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
16156
ebc96716
PE
16157 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
16158
b4e50fa0 16159 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 16160 Use much-faster test for byte-length change.
311d5d7c 16161 Don't assume string byte-length fits in 'int'.
a4cf38e4 16162 Check that character arg fits in 'int'.
85461888 16163 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 16164
c0c1ee9f
PE
16165 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
16166
a498d7f4
PE
16167 * fns.c (concat): Catch string overflow earlier.
16168 Do not rely on integer wraparound.
16169
51cab52b
PE
16170 * dispextern.h (struct it.overlay_strings_charpos)
16171 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
16172 * xdisp.c (forward_to_next_line_start)
16173 (back_to_previous_visible_line_start)
16174 (reseat_at_next_visible_line_start, next_element_from_buffer):
16175 Don't arbitrarily truncate the value of 'selective' to int.
16176
76031fad
PE
16177 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
16178
5eb55db9
PE
16179 * composite.c: Don't truncate sizes to 'int'.
16180 (composition_gstring_p, composition_reseat_it)
16181 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
16182 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
16183 not EMACS_UINT, for indexes.
5eb55db9 16184
0703a717
PE
16185 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
16186
d6202519
PE
16187 * buffer.c: Include <verify.h>.
16188 (struct sortvec.priority, struct sortstr.priority):
8961a454 16189 Now EMACS_INT, not int.
c20998a7 16190 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
16191 (struct sortstr.size, record_overlay_string)
16192 (struct sortstrlist.size, struct sortlist.used):
16193 Don't truncate size to int.
16194 (record_overlay_string): Check for size-calculation overflow.
d6202519 16195 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 16196
d5a19415
JM
161972011-06-22 Jim Meyering <meyering@redhat.com>
16198
029529ac 16199 Don't leak an XBM-image-sized buffer
d5a19415
JM
16200 * image.c (xbm_load): Free the image buffer after using it.
16201
a9041e6c
PE
162022011-06-21 Paul Eggert <eggert@cs.ucla.edu>
16203
16204 Port to Sun C.
16205 * composite.c (find_automatic_composition): Omit needless 'return 0;'
16206 that Sun C diagnosed.
16207 * fns.c (secure_hash): Fix pointer signedness issue.
16208 * intervals.c (static_offset_intervals): New function.
16209 (offset_intervals): Use it.
16210
7f3f739f
LL
162112011-06-21 Leo Liu <sdl.web@gmail.com>
16212
16213 * deps.mk (fns.o):
16214 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
16215 sha512.h.
16216
16217 * fns.c (secure_hash): Rename from crypto_hash_function and change
16218 the first arg to accept symbols.
5b66d427 16219 (Fsecure_hash): New primitive.
7f3f739f
LL
16220 (syms_of_fns): New symbols.
16221
76147d94
DD
162222011-06-20 Deniz Dogan <deniz@dogan.se>
16223
16224 * process.c (Fset_process_buffer): Clarify return value in
16225 docstring.
16226
7d7d0045
CY
162272011-06-18 Chong Yidong <cyd@stupidchicken.com>
16228
16229 * dispnew.c (add_window_display_history): Use BVAR.
16230
16231 * xdisp.c (debug_method_add): Use BVAR.
16232 (check_window_end, dump_glyph_matrix, dump_glyph)
16233 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
16234
16235 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
16236 Likewise.
16237
16238 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
16239 check till after the cache is created in init_frame_faces.
16240
ff2bc410
SM
162412011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
16242
16243 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
16244
28177add
PE
162452011-06-16 Paul Eggert <eggert@cs.ucla.edu>
16246
dd3482fe
PE
16247 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
16248 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
16249 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
16250
393d71f3 16251 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
16252 * fileio.c (Finsert_file_contents):
16253 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
16254 Remove the old (too-loose) buffer overflow checks.
16255 They weren't needed, since make_gap checks for buffer overflow.
16256 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
16257 The old code merely checked for Emacs fixnum overflow, and relied
16258 on undefined (wraparound) behavior. The new code avoids undefined
16259 behavior, and also checks for ptrdiff_t and/or size_t overflow.
16260
2e6813b0 16261 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
16262 Tune. Don't use wider integers than needed. Don't use alloca.
16263 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 16264
599a9e4f
PE
16265 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
16266
99561444
PE
16267 * insdel.c, lisp.h (buffer_overflow): New function.
16268 (insert_from_buffer_1, replace_range, replace_range_2):
16269 * insdel.c (make_gap_larger):
16270 * editfns.c (Finsert_char):
16271 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
16272
28177add
PE
16273 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
16274
e69dafad
PE
162752011-06-15 Paul Eggert <eggert@cs.ucla.edu>
16276
4baa020d 16277 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 16278
b1c46f02
PE
16279 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
16280 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
16281
e69dafad
PE
16282 * fileio.c: Don't assume EMACS_INT fits in off_t.
16283 (emacs_lseek): New static function.
16284 (Finsert_file_contents, Fwrite_region): Use it.
16285 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
16286
566684ea
PE
16287 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
16288
e6966cd6
PE
16289 * fns.c: Don't overflow int when computing a list length.
16290 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
16291 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
16292 truncation on 64-bit hosts. Check for QUIT every
16293 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
16294 faster and is responsive enough.
16295 (Flength): Report an error instead of overflowing an integer.
16296 (Fsafe_length): Return a float if the value is not representable
16297 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 16298 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 16299 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 16300
dd0b0efb
PE
16301 * alloc.c: Check that resized vectors' lengths fit in fixnums.
16302 (header_size, word_size): New constants.
16303 (allocate_vectorlike): Don't check size overflow here.
16304 (allocate_vector): Check it here instead, since this is the only
16305 caller of allocate_vectorlike that could cause overflow.
16306 Check that the new vector's length is representable as a fixnum.
16307
86fe5cfe
PE
16308 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
16309 The previous code was bogus. For example, next_almost_prime (32)
16310 returned 39, which is undesirable as it is a multiple of 3; and
16311 next_almost_prime (24) returned 25, which is a multiple of 5 so
16312 why was the code bothering to check for multiples of 7?
16313
80e88859
PE
16314 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
16315
4a2f0ad6
PE
16316 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
16317
f66c7cf8
PE
16318 Variadic C functions now count arguments with ptrdiff_t.
16319 This partly undoes my 2011-03-30 change, which replaced int with size_t.
16320 Back then I didn't know that the Emacs coding style prefers signed int.
16321 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
16322 were being counted with int, which may truncate counts on 64-bit
16323 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
16324 * lisp.h (struct Lisp_Subr.function.aMANY)
16325 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
16326 Arg counts are now ptrdiff_t, not size_t.
16327 All variadic functions and their callers changed accordingly.
16328 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
16329 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
16330 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
16331 * callint.c (Fcall_interactively): Check arg count for overflow,
16332 to avoid potential buffer overrun. Use signed char, not 'int',
16333 for 'varies' array, so that we needn't bother to check its size
16334 calculation for overflow.
16335 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
16336 * eval.c (apply_lambda):
16337 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
16338 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
16339 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
16340
a1759b76
PE
16341 * callint.c (Fcall_interactively): Don't use index var as event count.
16342
d96be9fc
PE
16343 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
16344 * mem-limits.h (SIZE): Remove; no longer used.
16345
a690a978 16346 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 16347
578c21e6
PE
16348 Remove unnecessary casts.
16349 * xterm.c (x_term_init):
16350 * xfns.c (x_set_border_pixel):
16351 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
16352 These aren't needed now that we assume ANSI C.
16353
96f53c6c
PE
16354 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
16355 It's more likely to cause problems (due to unsigned overflow)
16356 than to cure them.
16357
83c77d31
PE
16358 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
16359
ee2079f1
PE
16360 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
16361
6da65536
PE
16362 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
16363
7147c4a4
PE
16364 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
16365
193e32d9
PE
16366 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
16367
e5533da6
PE
16368 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
16369
9910e595
PE
16370 GLYPH_CODE_FACE returns EMACS_INT, not int.
16371 * dispextern.h (merge_faces):
16372 * xfaces.c (merge_faces):
01103c44
PE
16373 * xdisp.c (get_next_display_element, next_element_from_display_vector):
16374 Don't assume EMACS_INT fits in int.
9910e595 16375
2638320e
PE
16376 * character.h (CHAR_VALID_P): Remove unused parameter.
16377 * fontset.c, lisp.h, xdisp.c: All uses changed.
16378
045eb8d9
PE
16379 * editfns.c (Ftranslate_region_internal): Omit redundant test.
16380
c1f134b5
PE
16381 * fns.c (concat): Minor tuning based on overflow analysis.
16382 This doesn't fix any bugs. Use int to hold character, instead
16383 of constantly refetching from Emacs object. Use XFASTINT, not
16384 XINT, for value known to be a character. Don't bother comparing
16385 a single byte to 0400, as it's always less.
16386
395fcb93 16387 * floatfns.c (Fexpt):
327eeec8
PE
16388 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
16389
abbd3d23
PE
16390 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
16391 for characters.
16392
684a03ef
PE
16393 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
16394
0fed43f3
PE
16395 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
16396 Without this fix, on a 64-bit host (aset S 0 4294967386) would
16397 incorrectly succeed when S was a string, because 4294967386 was
16398 truncated before it was used.
16399
8fd02eb7
PE
16400 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
16401 Otherwise, an out-of-range integer could cause undefined behavior
16402 on a 64-bit host.
16403
f8c86b69
PE
16404 * composite.c: Use int, not EMACS_INT, for characters.
16405 (fill_gstring_body, composition_compute_stop_pos): Use int, not
16406 EMACS_INT, for values that are known to be in character range.
16407 This doesn't fix any bugs but is the usual style inside Emacs and
16408 may generate better code on 32-bit machines.
16409
34206dd2
PE
16410 Make sure a 64-bit char is never passed to ENCODE_CHAR.
16411 This is for reasons similar to the recent CHAR_STRING fix.
16412 * charset.c (Fencode_char): Check that character arg is actually
16413 a character. Pass an int to ENCODE_CHAR.
16414 * charset.h (ENCODE_CHAR): Verify that the character argument is no
16415 wider than 'int', as a compile-time check to prevent future regressions
16416 in this area.
16417
c5958d4c 16418 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
16419
16420 Make sure a 64-bit char is never passed to CHAR_STRING.
16421 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
16422 by silently ignoring the top 32 bits, allowing some values
16423 that were far too large to be valid characters.
16424 * character.h: Include <verify.h>.
16425 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
16426 arguments are no wider than unsigned, as a compile-time check
16427 to prevent future regressions in this area.
16428 * data.c (Faset):
01103c44 16429 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
16430 (Fsubst_char_in_region):
16431 * fns.c (concat):
16432 * xdisp.c (decode_mode_spec_coding):
16433 Adjust to CHAR_STRING's new requirement.
16434 * editfns.c (Finsert_char, Fsubst_char_in_region):
16435 * fns.c (concat): Check that character args are actually
16436 characters. Without this test, these functions did the wrong
16437 thing with wildly out-of-range values on 64-bit hosts.
16438
d37ca623
PE
16439 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
16440 These casts should not be needed on 32-bit hosts, either.
16441 * keyboard.c (read_char):
16442 * lread.c (Fload): Remove casts to unsigned.
16443
ea204efb
PE
16444 * lisp.h (UNSIGNED_CMP): New macro.
16445 This fixes comparison bugs on 64-bit hosts.
16446 (ASCII_CHAR_P): Use it.
16447 * casefiddle.c (casify_object):
01103c44 16448 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
16449 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
16450 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
16451 * dispextern.h (FACE_FROM_ID):
16452 * keyboard.c (read_char): Use UNSIGNED_CMP.
16453
41cb286c
PE
16454 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
16455 not to EMACS_INT, to avoid GCC warning.
16456
4a1b9832
PE
16457 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
16458
55daad71
PE
16459 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
16460 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
16461 isn't needed on 32-bit machines.
8f95c75c 16462
01103c44
PE
16463 * buffer.c (Fgenerate_new_buffer_name):
16464 Use EMACS_INT for count, not int.
0ceccced 16465 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
16466
16467 * data.c (Qcompiled_function): Now static.
16468
c6f072e7
PE
16469 * window.c (window_body_lines): Now static.
16470
20ce5912
PE
16471 * image.c (gif_load): Rename local to avoid shadowing.
16472
9c4c5f81
PE
16473 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
16474 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
16475 * alloc.c (make_save_value): Integer argument is now of type
16476 ptrdiff_t, not int.
16477 (mark_object): Use ptrdiff_t, not int.
16478 * lisp.h (pD): New macro.
16479 * print.c (print_object): Use it.
16480
c0c5c8ae
PE
16481 * alloc.c: Use EMACS_INT, not int, to count objects.
16482 (total_conses, total_markers, total_symbols, total_vector_size)
16483 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
16484 (total_free_floats, total_floats, total_free_intervals)
16485 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
16486 Now EMACS_INT, not int. All uses changed.
16487 (Fgarbage_collect): Compute overall total using a double, so that
16488 integer overflow is less likely to be a problem. Check for overflow
16489 when converting back to an integer.
5a25e253
PE
16490 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
16491 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
16492 These were 'int' variables that could overflow on 64-bit hosts;
16493 they were never used, so remove them instead of repairing them.
211a0b2a 16494 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
16495 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
16496 Previously, this ceilinged at INT_MAX, but that doesn't work on
16497 64-bit machines.
e46bb31a 16498 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 16499
c78baabf 16500 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 16501 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
16502 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
16503 when a (possibly-narrower) signed value would do just as well.
16504 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 16505
c9d624c6
PE
16506 * alloc.c: Catch some string size overflows that we were missing.
16507 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
16508 for convenience in STRING_BYTES_MAX.
16509 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
16510 The definition here is exact; the one in lisp.h was approximate.
16511 (allocate_string_data): Check for string overflow. This catches
16512 some instances we weren't catching before. Also, it catches
16513 size_t overflow on (unusual) hosts where SIZE_MAX <= min
16514 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
16515 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 16516
c9d624c6
PE
16517 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
16518 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 16519 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 16520
353032ce
PE
16521 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
16522
2bccce07
PE
16523 * alloc.c (Fmake_string): Check for out-of-range init.
16524
0ac30604
SM
165252011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
16526
16527 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
16528
c195f2de
JD
165292011-06-14 Jan Djärv <jan.h.d@swipnet.se>
16530
16531 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
16532 xg_get_default_scrollbar_width.
16533
16534 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
16535 (int_gtk_range_get_value): Move to the scroll bar part of the file.
16536 (style_changed_cb): Call update_theme_scrollbar_width and call
16537 x_set_scroll_bar_default_width and xg_frame_set_char_size for
16538 all frames (Bug#8505).
16539 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
16540 Call gtk_window_set_resizable if HAVE_GTK3.
16541 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
16542 and height if HAVE_GTK3 (Bug#8505).
16543 (scroll_bar_width_for_theme): New variable.
16544 (update_theme_scrollbar_width): New function.
16545 (xg_get_default_scrollbar_width): Move code to
16546 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
16547 (xg_initialize): Call update_theme_scrollbar_width.
16548
16549 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
16550
16551 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
16552
e10ac9f1
MR
165532011-06-12 Martin Rudalics <rudalics@gmx.at>
16554
16555 * frame.c (make_frame): Call other_buffer_safely instead of
16556 other_buffer.
16557
16558 * window.c (temp_output_buffer_show): Call display_buffer with
16559 second argument Vtemp_buffer_show_specifiers and reset latter
16560 immediately after the call.
16561 (Vtemp_buffer_show_specifiers): New variable.
16562 (auto_window_vscroll_p, next_screen_context_lines)
16563 (Vscroll_preserve_screen_position): Remove leading asterisks from
16564 doc-strings.
16565
2d3c217e 165662011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 16567
7b7f97e8 16568 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
16569 * buffer.c (Qclone_number): Remove for now, as it's unused.
16570 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
16571 (record_buffer): Remove unused local.
16572 * frame.c (other_visible_frames, frame_buffer_list): Now static.
16573 (set_frame_buffer_list): Remove; unused.
16574 * frame.h (other_visible_frames): Remove decl.
16575 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
16576 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
16577 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
16578 if HAVE_GPM.
16579 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
16580 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
16581 Define only if HAVE_GPM.
16582 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
16583 (update_hints_inhibit): Remove; never set. All uses removed.
16584 * widgetprv.h (emacsFrameClassRec): Remove decl.
16585 * window.c (delete_deletable_window): Now returns void, since it
16586 wasn't returning anything.
16587 (compare_window_configurations): Remove unused locals.
16588 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
16589 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
16590 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
16591 the same widths as pointers. This follows up on the 2011-05-06 patch.
16592 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
16593 * xterm.h: Likewise.
16594 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
16595
1384b89e
JB
165962011-06-12 Juanma Barranquero <lekktu@gmail.com>
16597
16598 * makefile.w32-in: Update dependencies.
16599 (LISP_H): Add lib/intprops.h.
16600
1100a63c
CY
166012011-06-11 Chong Yidong <cyd@stupidchicken.com>
16602
16603 * image.c (gif_load): Add animation frame delay to the metadata.
16604 (syms_of_image): Use DEFSYM. New symbol `delay'.
16605
6198ccd0
MR
166062011-06-11 Martin Rudalics <rudalics@gmx.at>
16607
16608 * window.c (delete_deletable_window): Re-add.
16609 (Fset_window_configuration): Rewrite to handle dead buffers and
16610 consequently deletable windows.
16611 (window_tree, Fwindow_tree): Remove. Supply functionality in
16612 window.el.
16613 (compare_window_configurations): Simplify code.
16614
b6e3633c
AS
166152011-06-11 Andreas Schwab <schwab@linux-m68k.org>
16616
1ab0dee5
AS
16617 * image.c (imagemagick_load_image): Fix type mismatch.
16618 (Fimagemagick_types): Likewise.
16619
b6e3633c
AS
16620 * window.h (replace_buffer_in_windows): Declare.
16621
9397e56f
MR
166222011-06-11 Martin Rudalics <rudalics@gmx.at>
16623
16624 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
16625 Qclone_number. Remove external declaration of Qdelete_window.
16626 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
16627 code.
640c8776
SM
16628 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
16629 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
16630 (Fother_buffer): Rewrite doc-string. Major rewrite for new
16631 buffer list implementation.
16632 (other_buffer_safely): New function.
16633 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
16634 calls to replace_buffer_in_windows and
16635 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
16636 if allowed.
16637 (record_buffer): Inhibit quitting and rewrite using quittable
16638 functions. Run Qbuffer_list_update_hook if allowed.
16639 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
16640 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
16641 Move switch-to-buffer to window.el.
9397e56f
MR
16642 (bury-buffer): Move to window.el.
16643 (Vbuffer_list_update_hook): New variable.
16644
16645 * lisp.h (other_buffer_safely): Add prototype in buffer.c
16646 section.
16647
16648 * window.h (resize_frame_windows): Move up in code.
16649 (Fwindow_frame): Remove EXFUN.
16650 (replace_buffer_in_all_windows): Remove prototype.
16651 (replace_buffer_in_windows_safely): Add prototype.
16652
16653 * window.c: Declare Qdelete_window static again. Move down
16654 declaration of select_count.
16655 (Fnext_window, Fprevious_window): Rewrite doc-strings.
16656 (Fother_window): Move to window.el.
16657 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
16658 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
16659 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
16660 window.el.
16661 (replace_buffer_in_windows): Implement by calling
16662 Qreplace_buffer_in_windows.
16663 (replace_buffer_in_all_windows): Remove with some functionality
16664 moved into replace_buffer_in_windows_safely.
16665 (replace_buffer_in_windows_safely): New function.
16666 (select_window_norecord, select_frame_norecord): Move in front
16667 of run_window_configuration_change_hook. Remove now obsolete
16668 declarations.
640c8776
SM
16669 (Fset_window_buffer): Rewrite doc-string.
16670 Call Qrecord_window_buffer.
9397e56f
MR
16671 (keys_of_window): Move binding for other-window to window.el.
16672
b50691aa
CY
166732011-06-11 Chong Yidong <cyd@stupidchicken.com>
16674
16675 * dispextern.h (struct image): Replace data member, whose int_val
16676 and ptr_val fields were not used by anything, with a single
16677 lisp_val object.
16678
16679 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
16680 (gif_clear_image, gif_load, imagemagick_load_image)
16681 (gs_clear_image, gs_load): Callers changed.
16682
3f754b86
PE
166832011-06-10 Paul Eggert <eggert@cs.ucla.edu>
16684
cca69397
PE
16685 * buffer.h: Include <time.h>, for time_t.
16686 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
16687
109e28d0
PE
16688 Fix minor problems found by static checking.
16689
60737f02
PE
16690 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
16691
4b66faf3
PE
16692 Make identifiers static if they are not used in other modules.
16693 * data.c (Qcompiled_function, Qframe, Qvector):
16694 * image.c (QimageMagick, Qsvg):
16695 * minibuf.c (Qmetadata):
16696 * window.c (resize_window_check, resize_root_window): Now static.
16697 * window.h (resize_window_check, resize_root_window): Remove decls.
16698
109e28d0
PE
16699 * window.c (window_deletion_count, delete_deletable_window):
16700 Remove; unused.
46a4ce9e
PE
16701 (window_body_lines): Now static.
16702 (Fdelete_other_windows_internal): Mark vars as initialized.
16703 Make sure 'resize_failed' is initialized.
16704 (run_window_configuration_change_hook): Rename local to avoid shadowing.
16705 (resize_window_apply): Remove unused local.
16706 * window.h (delete_deletable_window): Remove decl.
16707
109e28d0 16708 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
16709 (imagemagick_load_image): Fix pointer signedness problem by changing
16710 last arg from unsigned char * to char *. All uses changed.
16711 Also, fix a local for similar reasons.
16712 Remove unused locals. Remove locals to avoid shadowing.
16713 (fn_rsvg_handle_free): Remove; unused.
16714 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 16715 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 16716
3f754b86
PE
16717 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
16718
2547adb1
CY
167192011-06-10 Chong Yidong <cyd@stupidchicken.com>
16720
16721 * image.c (gif_load): Fix omitted cast error introduced by
16722 2011-06-06 change.
16723
2c8e37d4
MR
167242011-06-10 Martin Rudalics <rudalics@gmx.at>
16725
16726 * window.h (resize_proportionally, orig_total_lines)
16727 (orig_top_line): Remove from window structure.
16728 (set_window_height, set_window_width, change_window_heights)
16729 (Fdelete_window): Remove prototypes.
16730 (resize_frame_windows): Remove duplicate declaration.
16731
440a42e3
EZ
167322011-06-10 Eli Zaretskii <eliz@gnu.org>
16733
16734 * window.h (resize_frame_windows, resize_window_check)
16735 (delete_deletable_window, resize_root_window)
16736 (resize_frame_windows): Declare prototypes.
16737
16738 * window.c (resize_window_apply): Make definition be "static" to
16739 match the prototype.
16740
562dd5e9
MR
167412011-06-10 Martin Rudalics <rudalics@gmx.at>
16742
16743 * window.c: Remove declarations of Qwindow_size_fixed,
16744 window_min_size_1, window_min_size_2, window_min_size,
16745 size_window, window_fixed_size_p, enlarge_window, delete_window.
16746 Remove static from declaration of Qdelete_window, it's
16747 temporarily needed by Fbury_buffer.
16748 (replace_window): Don't assign orig_top_line and
16749 orig_total_lines.
16750 (Fdelete_window, delete_window): Remove. Window deletion is
16751 handled by window.el.
640c8776
SM
16752 (window_loop): Remove DELETE_OTHER_WINDOWS case.
16753 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
16754 (Fdelete_other_windows): Remove. Deleting other windows is
16755 handled by window.el.
16756 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
16757 handled in window.el.
16758 (window_min_size_2, window_min_size_1, window_min_size): Remove.
16759 Window minimum sizes are handled in window.el.
16760 (shrink_windows, size_window, set_window_height)
16761 (set_window_width, change_window_heights, window_height)
16762 (window_width, CURBEG, CURSIZE, enlarge_window)
16763 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
16764 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
16765 handled in window.el.
16766 (make_dummy_parent): Rename to make_parent_window and give it a
16767 second argument horflag.
16768 (make_window): Don't set resize_proportionally any more.
16769 (Fsplit_window): Remove. Windows are split in window.el.
16770 (save_restore_action, save_restore_orig_size)
16771 (shrink_window_lowest_first, save_restore_orig_size): Remove.
16772 Resize mini windows in window.el.
16773 (grow_mini_window, shrink_mini_window): Implement by calling
16774 Qresize_root_window_vertically, resize_window_check and
16775 resize_window_apply.
640c8776
SM
16776 (saved_window, Fset_window_configuration, save_window_save):
16777 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
16778 resize_proportionally.
16779 (window_min_height, window_min_width): Move to window.el.
16780 (keys_of_window): Move bindings for delete-other-windows,
16781 split-window, delete-window and enlarge-window to window.el.
16782
16783 * buffer.c: Temporarily extern Qdelete_window.
16784 (Fbury_buffer): Temporarily call Qdelete_window instead of
16785 Fdelete_window (Fbury_buffer will move to window.el soon).
16786
16787 * frame.c (set_menu_bar_lines_1): Remove code handling
16788 orig_top_line and orig_total_lines.
16789
16790 * dispnew.c (adjust_frame_glyphs_initially): Don't use
16791 set_window_height but set heights directly.
16792 (change_frame_size_1): Use resize_frame_windows.
16793
16794 * xdisp.c (init_xdisp): Don't use set_window_height but set
16795 heights directly.
16796
640c8776
SM
16797 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
16798 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
16799 run_window_configuration_change_hook.
16800
16801 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
16802 instead of change_window_heights and run
16803 run_window_configuration_change_hook.
16804
1a13852e
MR
168052011-06-09 Martin Rudalics <rudalics@gmx.at>
16806
16807 * window.c (replace_window): Rename second argument REPLACEMENT to
16808 NEW. New third argument SETFLAG. Rewrite.
16809 (delete_window, make_dummy_parent): Call replace_window with
16810 third argument 1.
16811 (window_list_1): Move down in code.
16812 (run_window_configuration_change_hook): Move set_buffer part
16813 before select_frame_norecord part in order to unwind correctly.
16814 Rename count1 to count.
16815 (recombine_windows, delete_deletable_window, resize_root_window)
16816 (Fdelete_other_windows_internal)
16817 (Frun_window_configuration_change_hook, make_parent_window)
16818 (resize_window_check, resize_window_apply, Fresize_window_apply)
16819 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
16820 (Fdelete_window_internal, Fresize_mini_window_internal):
16821 New functions.
1a13852e
MR
16822 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
16823
f3d1777e
MR
168242011-06-08 Martin Rudalics <rudalics@gmx.at>
16825
496e208e
MR
16826 * window.h (window): Add some new members to window structure -
16827 normal_lines, normal_cols, new_total, new_normal, clone_number,
16828 splits, nest, prev_buffers, next_buffers.
16829 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 16830 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 16831
f3d1777e
MR
16832 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
16833 Remove.
496e208e
MR
16834 (make_dummy_parent): Set new members of windows structure.
16835 (make_window): Move down in code. Handle new members of window
16836 structure.
16837 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
16838 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
16839 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
16840 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
16841 (Fset_window_next_buffers, Fset_window_clone_number):
16842 New functions.
496e208e
MR
16843 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
16844 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
16845 Doc-string fixes.
16846 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
16847 Argument WINDOW can be now internal window too.
16848 (Fwindow_use_time): Move up in code.
16849 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
16850 Rewrite doc-string.
16851 (Fset_window_configuration, saved_window)
16852 (Fcurrent_window_configuration, save_window_save): Handle new
16853 members of window structure.
b9e809c2
MR
16854 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
16855 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
16856 (syms_of_window): New Lisp objects Qrecord_window_buffer,
16857 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
16858 Qget_mru_window, Qresize_root_window,
16859 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
16860 Qauto_buffer_name; staticpro them.
f3d1777e 16861
abde8f8c
MR
168622011-06-07 Martin Rudalics <rudalics@gmx.at>
16863
16864 * window.c (Fwindow_total_size, Fwindow_left_column)
16865 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
16866 (Fwindow_list_1): New functions.
16867 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
16868 (Fwindow_width, Fscroll_left, Fscroll_right):
16869 Use window_body_cols instead of window_box_text_cols.
16870 (delete_window, Fset_window_configuration):
16871 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
16872 (delete_all_subwindows): Take a window as argument and not a
16873 structure. Rewrite.
190b47e6
MR
16874 (window_loop): Remove handling of GET_LRU_WINDOW and
16875 GET_LARGEST_WINDOW.
16876 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
16877
16878 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
16879 window_box_text_cols. delete_all_subwindows now takes a
16880 Lisp_Object as argument.
abde8f8c 16881
640c8776
SM
16882 * indent.c (compute_motion, Fcompute_motion):
16883 Use window_body_cols instead of window_box_text_cols.
abde8f8c 16884
fa8a67e6
MR
16885 * frame.c (delete_frame): Call delete_all_subwindows with root
16886 window as argument.
16887
a54e3482
DC
168882011-06-07 Daniel Colascione <dan.colascione@gmail.com>
16889
16890 * fns.c (Fputhash): Document return value.
16891
60002bf5
CY
168922011-06-06 Chong Yidong <cyd@stupidchicken.com>
16893
16894 * image.c (gif_load): Implement gif89a spec "no disposal" method.
16895
0c671da6 168962011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 16897
b862a52a 16898 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 16899
be44ca6c
PE
16900 Check for overflow when converting integer to cons and back.
16901 * charset.c (Fdefine_charset_internal, Fdecode_char):
16902 Use cons_to_unsigned to catch overflow.
16903 (Fencode_char): Use INTEGER_TO_CONS.
16904 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
16905 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
16906 * data.c (long_to_cons, cons_to_long): Remove.
16907 (cons_to_unsigned, cons_to_signed): New functions.
16908 These signal an error for invalid or out-of-range values.
16909 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
16910 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
16911 * font.c (Ffont_variation_glyphs):
16912 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
16913 * lisp.h: Include <intprops.h>.
16914 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
16915 (cons_to_signed, cons_to_unsigned): New decls.
16916 (long_to_cons, cons_to_long): Remove decls.
16917 * undo.c (record_first_change): Use INTEGER_TO_CONS.
16918 (Fprimitive_undo): Use CONS_TO_INTEGER.
16919 * xfns.c (Fx_window_property): Likewise.
16920 * xselect.c: Include <limits.h>.
16921 (x_own_selection, selection_data_to_lisp_data):
16922 Use INTEGER_TO_CONS.
16923 (x_handle_selection_request, x_handle_selection_clear)
16924 (x_get_foreign_selection, Fx_disown_selection_internal)
16925 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
16926 (lisp_data_to_selection_data): Use cons_to_unsigned.
16927 (x_fill_property_data): Use cons_to_signed.
16928 Report values out of range.
16929
d1f3d2af
PE
16930 Check for buffer and string overflow more precisely.
16931 * buffer.h (BUF_BYTES_MAX): New macro.
16932 * lisp.h (STRING_BYTES_MAX): New macro.
16933 * alloc.c (Fmake_string):
16934 * character.c (string_escape_byte8):
16935 * coding.c (coding_alloc_by_realloc):
16936 * doprnt.c (doprnt):
16937 * editfns.c (Fformat):
16938 * eval.c (verror):
16939 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
16940 since they may not be the same number.
16941 * editfns.c (Finsert_char):
16942 * fileio.c (Finsert_file_contents):
16943 Likewise for BUF_BYTES_MAX.
16944
dd52fcea
PE
16945 * image.c: Use ptrdiff_t, not int, for sizes.
16946 (slurp_file): Switch from int to ptrdiff_t.
16947 All uses changed.
16948 (slurp_file): Check that file size fits in both size_t (for
16949 malloc) and ptrdiff_t (for sanity and safety).
16950
7f9bbdbb
PE
16951 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
16952 if b->modtime has its maximal value.
16953
dfe18f82
PE
16954 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
16955
84acfcf0
PE
16956 Don't assume time_t can fit into int.
16957 * buffer.h (struct buffer.modtime): Now time_t, not int.
16958 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
16959 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
16960
ccd9a01a
PE
16961 Minor fixes for signed vs unsigned integers.
16962 * character.h (MAYBE_UNIFY_CHAR):
16963 * charset.c (maybe_unify_char):
16964 * keyboard.c (read_char, reorder_modifiers):
16965 XINT -> XFASTINT, since the integer must be nonnegative.
16966 * ftfont.c (ftfont_spec_pattern):
16967 * keymap.c (access_keymap, silly_event_symbol_error):
16968 XUINT -> XFASTINT, since the integer must be nonnegative.
16969 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
16970 since it makes no difference and we prefer signed.
16971 * keyboard.c (record_char): Use XUINT when all the neighbors do.
16972 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
16973 nonnegative.
16974
d6d100dd
SM
169752011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
16976
16977 * window.h (Fwindow_frame): Declare.
16978
2b6148e4
PE
169792011-06-06 Paul Eggert <eggert@cs.ucla.edu>
16980
16981 * alloc.c: Simplify handling of large-request failures (Bug#8800).
16982 (SPARE_MEMORY): Always define.
16983 (LARGE_REQUEST): Remove.
16984 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
16985
f230ecc9
MR
169862011-06-06 Martin Rudalics <rudalics@gmx.at>
16987
727e958e
MR
16988 * lisp.h: Move EXFUNS for Fframe_root_window,
16989 Fframe_first_window and Fset_frame_selected_window to window.h.
16990
16991 * window.h: Move EXFUNS for Fframe_root_window,
16992 Fframe_first_window and Fset_frame_selected_window here from
16993 lisp.h.
16994
16995 * frame.c (Fwindow_frame, Fframe_first_window)
16996 (Fframe_root_window, Fframe_selected_window)
16997 (Fset_frame_selected_window): Move to window.c.
16998 (Factive_minibuffer_window): Move to minibuf.c.
16999 (Fother_visible_frames_p): New function.
17000
17001 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
17002
f230ecc9
MR
17003 * window.c (decode_window, decode_any_window): Move up in code.
17004 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
17005 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
17006 (Fwindow_buffer): Move up and rewrite doc-string.
17007 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
17008 (Fwindow_prev): New functions.
727e958e
MR
17009 (Fwindow_frame): Move here from frame.c. Accept any window as
17010 argument.
17011 (Fframe_root_window, Fframe_first_window)
17012 (Fframe_selected_window): Move here from frame.c. Accept frame
17013 or arbitrary window as argument. Update doc-strings.
17014 (Fminibuffer_window): Move up in code.
17015 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
17016 (Fset_frame_selected_window): Move here from frame.c.
17017 Marginal rewrite.
727e958e
MR
17018 (Fselected_window, select_window, Fselect_window): Move up in
17019 code. Minor doc-string fixes.
f230ecc9 17020
4d09bcf6
PE
170212011-06-06 Paul Eggert <eggert@cs.ucla.edu>
17022
17023 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
17024 Do not assume that spare memory exists; that assumption is valid
17025 only if SYSTEM_MALLOC.
17026 (LARGE_REQUEST): New macro, so that the issue of large requests
17027 is separated from the issue of spare memory.
17028
810928a2
AS
170292011-06-05 Andreas Schwab <schwab@linux-m68k.org>
17030
172418ad
AS
17031 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
17032 format. (Bug#8806)
17033
43f862f7
AS
17034 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
17035
810928a2
AS
17036 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17037 before statements.
17038
a059fe24
JD
170392011-06-05 Jan Djärv <jan.h.d@swipnet.se>
17040
17041 * gtkutil.c (xg_get_default_scrollbar_width): New function.
17042
17043 * gtkutil.h: Declare xg_get_default_scrollbar_width.
17044
17045 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
17046 min width by calling x_set_scroll_bar_default_width (Bug#8505).
17047
989bf368
JB
170482011-06-05 Juanma Barranquero <lekktu@gmail.com>
17049
17050 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
17051
4b80f674
CY
170522011-06-04 Chong Yidong <cyd@stupidchicken.com>
17053
17054 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
17055 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
17056 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
17057 New error handlers.
4b80f674
CY
17058 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
17059 Obey Vx_select_enable_clipboard_manager. Catch errors in
17060 x_clipboard_manager_save (Bug#8779).
17061 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 17062 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 17063
99a33b77 170642011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
17065
17066 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
17067
99a33b77 170682011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
17069
17070 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
17071 in the current matrix if keep_current_p is non-zero.
17072
8264569d
EZ
170732011-06-04 Eli Zaretskii <eliz@gnu.org>
17074
17075 * bidi.c (bidi_level_of_next_char): Fix last change.
17076
57f97249
EZ
170772011-06-03 Eli Zaretskii <eliz@gnu.org>
17078
fec2107c 17079 Support bidi reordering of text covered by display properties.
57f97249 17080
fec2107c
EZ
17081 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
17082 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
17083 (bidi_cache_search, bidi_cache_iterator_state)
17084 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
17085 (bidi_level_of_next_char, bidi_move_to_visually_next):
17086 Support character positions inside a run of characters covered by a
fec2107c
EZ
17087 display string.
17088 (bidi_paragraph_init, bidi_resolve_explicit_1)
17089 (bidi_level_of_next_char): Call bidi_fetch_char and
17090 bidi_fetch_char_advance instead of FETCH_CHAR and
17091 FETCH_CHAR_ADVANCE.
17092 (bidi_init_it): Initialize new members.
17093 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
17094 definitions.
17095 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
17096 instead of using explicit *_CHAR codes.
d6d100dd
SM
17097 (bidi_resolve_explicit, bidi_resolve_weak):
17098 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
17099 bidirectional text is supported only in multibyte buffers.
17100 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
17101 it to initialize the frame_window_p member of struct bidi_it.
17102 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
17103 (bidi_resolve_explicit, bidi_resolve_weak)
17104 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
17105 bidi_it->nchars is non-positive.
17106 (bidi_level_of_next_char): Don't try to lookup the cache for the
17107 next/previous character if nothing is cached there yet, or if we
17108 were just reseat()'ed to a new position.
c40e2fb2 17109
0e14fe90
EZ
17110 * xdisp.c (set_cursor_from_row): Set start and stop points
17111 according to the row's direction when priming the loop that looks
17112 for the glyph on which to display cursor.
17113 (single_display_spec_intangible_p): Function deleted.
17114 (display_prop_intangible_p): Reimplement to call
17115 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
17116 Accept 3 additional arguments needed by handle_display_spec.
17117 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
17118 values: lists, `(when COND...)' forms, etc.
17119 (single_display_spec_string_p): Support property values that are
17120 lists with the argument STRING its top-level element.
17121 (display_prop_string_p): Fix the condition for processing a
17122 property that is a list to be consistent with handle_display_spec.
fec2107c 17123 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
17124 last portion of handle_display_prop.
17125 (compute_display_string_pos): Accept additional argument
17126 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
17127 value of a `display' property is a "replacing spec".
17128 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
17129 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
17130 the display property, but just return a value indicating whether
17131 the display property will replace the characters it covers.
17132 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
17133 frame_window_p members of struct bidi_it.
d6d100dd
SM
17134 (compute_display_string_pos, compute_display_string_end):
17135 New functions.
fec2107c
EZ
17136 (push_it): Accept second argument POSITION, where pop_it should
17137 jump to continue iteration.
17138 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 17139
fec2107c
EZ
17140 * keyboard.c (adjust_point_for_property): Adjust the call to
17141 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
17142
17143 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
17144 (bidi_init_it): Update prototypes.
17145 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
17146 (compute_display_string_pos, compute_display_string_end):
17147 Declare prototypes.
fec2107c
EZ
17148 (struct bidi_it): New members nchars and disp_pos. ch_len is now
17149 EMACS_INT.
fc6f18ce 17150
40087514 171512011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 17152
57f53182
PE
17153 Malloc failure behavior now depends on size of allocation.
17154 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
17155 * lisp.h: Change signatures accordingly.
17156 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
17157 All callers changed. (Bug#8762)
17158
17159 * gnutls.c: Use Emacs's memory allocators.
17160 Without this change, the gnutls library would invoke malloc etc.
17161 directly, which causes problems on non-SYNC_INPUT hosts, and which
17162 runs afoul of improving memory_full behavior. (Bug#8761)
17163 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
17164 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
17165 xfree instead of the default malloc, realloc, free.
17166 (Fgnutls_boot): No need to check for memory allocation failure,
17167 since xmalloc does that for us.
17168
ac32cd99 17169 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
17170 * category.c (hash_get_category_set):
17171 * ccl.c (ccl_driver):
17172 * charset.c (Fdefine_charset_internal):
17173 * charset.h (struct charset.hash_index):
17174 * composite.c (get_composition_id, gstring_lookup_cache)
17175 (composition_gstring_put_cache):
17176 * composite.h (struct composition.hash_index):
17177 * dispextern.h (struct image.hash):
17178 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
17179 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
17180 (hashfn_equal, hashfn_user_defined, make_hash_table)
17181 (maybe_resize_hash_table, hash_lookup, hash_put)
17182 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
17183 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
17184 (Fsxhash, Fgethash, Fputhash, Fmaphash):
17185 * image.c (make_image, search_image_cache, lookup_image)
17186 (xpm_put_color_table_h):
17187 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 17188 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 17189 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 17190 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
17191 * alloc.c (allocate_vectorlike):
17192 Check for overflow in vector size calculations.
17193 * ccl.c (ccl_driver):
17194 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
17195 * fns.c, image.c: Remove unnecessary static decls that would otherwise
17196 need to be updated by these changes.
40087514
PE
17197 * fns.c (make_hash_table, maybe_resize_hash_table):
17198 Check for integer overflow with large hash tables.
0de4bb68
PE
17199 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
17200 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
17201 (SXHASH_REDUCE): New macro.
17202 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
17203 Use it instead of discarding useful hash info with large hash values.
17204 (sxhash_float): New function.
17205 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
17206 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
17207 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
17208 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
17209 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
17210 Adjust signatures to match updated version of code.
17211 (consing_since_gc): Now EMACS_INT, since a single hash table can
17212 use more than INT_MAX bytes.
17213
698d32e2
DN
172142011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
17215
17216 Make it possible to build with GCC-4.6+ -O2 -flto.
17217
17218 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
17219
fd6fa53f
SM
172202011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
17221
17222 * minibuf.c (get_minibuffer, read_minibuf_unwind):
17223 Call minibuffer-inactive-mode.
17224
864db017
JB
172252011-05-31 Juanma Barranquero <lekktu@gmail.com>
17226
17227 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
17228 Update dependencies.
17229
2ad0baf4
DN
172302011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17231
17232 * data.c (init_data): Remove code for UTS, this system is not
17233 supported anymore.
17234
4fcc2638
DN
172352011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17236
17237 Don't force ./temacs to start in terminal mode.
17238
17239 * frame.c (make_initial_frame): Initialize faces in all cases, not
17240 only when CANNOT_DUMP is defined.
17241 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
17242
c56e0fd5
DN
172432011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17244
17245 * dispnew.c (add_window_display_history): Use const for the string
17246 pointer. Remove declaration, not needed.
17247
333d54da 172482011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 17249
55d4c1b2 17250 Use 'inline', not 'INLINE'.
333d54da 17251 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
17252 * alloc.c, fontset.c (INLINE): Remove.
17253 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
17254 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
17255 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
17256 * gmalloc.c (register_heapinfo): Use inline unconditionally.
17257 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
17258
738db178
DN
172592011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
17260
17261 Make it possible to run ./temacs.
17262
17263 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
17264 syms_of_callproc does the same thing. Remove test for
17265 "initialized", do it in the caller.
17266 * emacs.c (main): Avoid calling set_initial_environment when dumping.
17267
620c53a6
SM
172682011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
17269
17270 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
17271 (read_minibuf): Use get_minibuffer.
17272 (syms_of_minibuf): Use DEFSYM.
17273 (Qmetadata): New var.
17274 * data.c (Qbuffer): Don't make it static.
17275 (syms_of_data): Use DEFSYM.
17276
e003a292
PE
172772011-05-31 Paul Eggert <eggert@cs.ucla.edu>
17278
17279 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
17280 (CCL_CODE_MIN): New macro.
17281
ed008a6d
PE
172822011-05-30 Paul Eggert <eggert@cs.ucla.edu>
17283
3687c2ef
PE
17284 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
17285
ed008a6d
PE
17286 * eval.c (Qdebug): Now static.
17287 * lisp.h (Qdebug): Remove decl. This reverts a part of the
17288 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
17289 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
17290
d66c4c7c
CY
172912011-05-29 Chong Yidong <cyd@stupidchicken.com>
17292
17293 * image.c: Various fixes to ImageMagick code comments.
17294 (Fimagemagick_types): Doc fix.
17295
5fbc2025
PE
172962011-05-29 Paul Eggert <eggert@cs.ucla.edu>
17297
0196f88a
PE
17298 Minor fixes prompted by GCC 4.6.0 warnings.
17299
17300 * xselect.c (converted_selections, conversion_fail_tag): Now static.
17301
5fbc2025
PE
17302 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
17303 (x_clipboard_manager_save_all): Move extern decl to ...
17304 * xterm.h: ... here, so that it can be checked for consistency.
17305
1dd3c2d9
CY
173062011-05-29 Chong Yidong <cyd@stupidchicken.com>
17307
17308 * xselect.c (x_clipboard_manager_save_frame)
17309 (x_clipboard_manager_save_all): New functions.
17310 (Fx_clipboard_manager_save): Lisp function deleted.
17311
17312 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
17313 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
17314
17315 * xterm.h: Update prototype.
17316
5ba6571d
WX
173172011-05-28 William Xu <william.xwl@gmail.com>
17318
17319 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
17320 exiting (Bug#8239).
17321
3eaff834
JM
173222011-05-28 Jim Meyering <meyering@redhat.com>
17323
e1900994 17324 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
17325 * fns.c (to_uchar): Define.
17326 (crypto_hash_function): Use it to convert some newly-signed
17327 variables to unsigned, to avoid sign-extension bugs. For example,
17328 without this change, (md5 "truc") would evaluate to
17329 45723a2aff78ff4fff7fff1114760e62 rather than the expected
17330 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 17331 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 17332
0f6990a7
PE
173332011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17334
17335 Integer overflow fixes.
c8a9ca5a 17336
08686060
PE
17337 * dbusbind.c: Serial number integer overflow fixes.
17338 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
17339 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
17340 to hold a serial number that is too large for a fixnum.
17341 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17342 Check for serial numbers out of range. Decode any serial number
59568bf0 17343 that was so large that it became a float. (Bug#8722)
08686060 17344
2d1fc3c7
PE
17345 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
17346 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17347 Use XFASTINT rather than XUINT when numbers are nonnegative.
17348 (xd_append_arg, Fdbus_method_return_internal):
17349 (Fdbus_method_error_internal): Likewise. Also, for unsigned
17350 arguments, check that Lisp number is nonnegative, rather than
59568bf0 17351 silently wrapping negative numbers around. (Bug#8722)
30217ff0 17352 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 17353 (Bug#8722)
2d1fc3c7 17354
c8a9ca5a
PE
17355 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
17356
519e1d69
PE
17357 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
17358
6df6ae42 17359 ccl: Add integer overflow checks.
30569699
PE
17360 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
17361 (IN_INT_RANGE): New macros.
17362 (ccl_driver): Use them to check for integer overflow when
17363 decoding a CCL program. Many of the new checks are whether XINT (x)
17364 fits in int; it doesn't always, on 64-bit hosts. The new version
17365 doesn't catch all possible integer overflows, but it's an
847044ea 17366 improvement. (Bug#8719)
30569699 17367
c11285dc
PE
17368 * alloc.c (make_event_array): Use XINT, not XUINT.
17369 There's no need for unsigned here.
17370
fdccd48e
PE
17371 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
17372 This follows up to the 2011-05-06 change that substituted uintptr_t
17373 for EMACS_INT. This case wasn't caught back then.
17374
37910ab2
PE
17375 Rework Fformat to avoid integer overflow issues.
17376 * editfns.c: Include <float.h> unconditionally, as it's everywhere
17377 now (part of C89). Include <verify.h>.
17378 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
17379 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
17380 (Fformat): Avoid the prepass trying to compute sizes; it was only
17381 approximate and thus did not catch overflow reliably. Instead, walk
17382 through the format just once, formatting and computing sizes as we go,
17383 checking for integer overflow at every step, and allocating a larger
17384 buffer as needed. Keep track separately whether the format is
17385 multibyte. Keep only the most-recently calculated precision, rather
17386 than them all. Record whether each argument has been converted to
17387 string. Use EMACS_INT, not int, for byte and char and arg counts.
17388 Support field widths and precisions larger than INT_MAX. Avoid
17389 sprintf's undefined behavior with conversion specifications such as %#d
17390 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
17391 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
17392 formatting out-of-range floating point numbers with int
9173deec 17393 formats. (Bug#8668)
37910ab2 17394
2e6578fb
PE
17395 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
17396
0ae6bdee
PE
17397 * data.c: Avoid integer truncation in expressions involving floats.
17398 * data.c: Include <intprops.h>.
17399 (arith_driver): When there's an integer overflow in an expression
17400 involving floating point, convert the integers to floating point
17401 so that the resulting value does not suffer from catastrophic
17402 integer truncation. For example, on a 64-bit host (* 4
17403 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
17404 Do not rely on undefined behavior after integer overflow.
17405
de883a70
PE
17406 merge count_size_as_multibyte, parse_str_to_multibyte
17407 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 17408 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
17409 Check for integer overflow.
17410 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
17411 since it's now a duplicate of the other. This is more of
17412 a character than a buffer op, so better that it's in character.c.
17413 * fns.c, print.c: Adjust to above changes.
17414
2ff916cb
PE
174152011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
17416
17417 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
17418
f1b54466
PE
174192011-05-27 Paul Eggert <eggert@cs.ucla.edu>
17420
fb1ac845
PE
17421 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17422 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
17423 (x_clipboard_manager_save): Now static.
17424 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
17425
f1b54466
PE
17426 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
17427 (crypto_hash_function): Now static.
17428 Fix pointer signedness problems. Avoid unnecessary initializations.
17429
a9f737ee
CY
174302011-05-27 Chong Yidong <cyd@stupidchicken.com>
17431
17432 * termhooks.h (Vselection_alist): Make it terminal-local.
17433
17434 * terminal.c (create_terminal): Initialize it.
17435
17436 * xselect.c: Support for clipboard managers.
17437 (Vselection_alist): Move to termhooks.h as terminal-local var.
17438 (LOCAL_SELECTION): New macro.
17439 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
17440 (symbol_to_x_atom): Remove gratuitous arg.
17441 (x_handle_selection_request, lisp_data_to_selection_data)
17442 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
17443 (x_own_selection, x_get_local_selection, x_convert_selection):
17444 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
17445 (some_frame_on_display): Delete unused function.
17446 (Fx_own_selection_internal, Fx_get_selection_internal)
17447 (Fx_disown_selection_internal, Fx_selection_owner_p)
17448 (Fx_selection_exists_p): New optional frame arg.
17449 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
17450 (x_handle_selection_clear): Don't treat other terminals with the
17451 same keyboard specially. Use the terminal-local Vselection_alist.
17452 (x_clear_frame_selections): Use Frun_hook_with_args.
17453
17454 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
17455
17456 * xterm.h: Add support for those atoms.
17457
e067f0c1
CY
174582011-05-26 Chong Yidong <cyd@stupidchicken.com>
17459
17460 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
17461 (converted_selections, conversion_fail_tag): New global variables.
17462 (x_selection_request_lisp_error): Free the above.
17463 (x_get_local_selection): Remove unnecessary code.
17464 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
17465 of converted selections stored in converted_selections.
17466 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
17467 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
17468 (x_convert_selection): New function.
17469 (x_handle_selection_event): Simplify.
17470 (x_get_foreign_selection): Don't ignore incoming requests while
17471 waiting for an answer; this will fail when we implement
17472 SAVE_TARGETS, and seems unnecessary anyway.
17473 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
17474 (Vx_sent_selection_functions): Doc fix.
17475
0f4aebc0
LL
174762011-05-26 Leo Liu <sdl.web@gmail.com>
17477
17478 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
17479
e61124cd
YM
174802011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17481
17482 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
17483
17484 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
17485 for fringe update if it has periodic bitmap.
ac389d0c 17486 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
17487 and fringe_bitmap_periodic_p.
17488
17489 * fringe.c (get_fringe_bitmap_data): New function.
17490 (draw_fringe_bitmap_1, update_window_fringes): Use it.
17491 (update_window_fringes): Record periodicity of fringe bitmap in glyph
17492 row. Mark glyph row for fringe update if periodicity changed.
17493
17494 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
17495 for fringe update unless it has periodic bitmap.
17496
f16d9837
KH
174972011-05-25 Kenichi Handa <handa@m17n.org>
17498
17499 * xdisp.c (get_next_display_element): Set correct it->face_id for
17500 a static composition.
17501
e1b90ef6
LL
175022011-05-24 Leo Liu <sdl.web@gmail.com>
17503
17504 * deps.mk (fns.o):
17505 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
17506
17507 * fns.c (crypto_hash_function, Fsha1): New function.
17508 (Fmd5): Use crypto_hash_function.
17509 (syms_of_fns): Add Ssha1.
17510
7400048f
PE
175112011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17512
17513 * gnutls.c: Remove unused macros.
17514 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
17515 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
17516 Remove macros that are defined and never used.
17517 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
17518
abb71cf4
CY
175192011-05-22 Chong Yidong <cyd@stupidchicken.com>
17520
17521 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
17522 (Fx_get_selection_internal): Minor cleanup.
17523 (Fx_own_selection_internal): Rename arguments for consistency with
17524 select.el.
17525
6307db39
PE
175262011-05-22 Paul Eggert <eggert@cs.ucla.edu>
17527
17528 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
17529
f3d4e0a4
CY
175302011-05-22 Chong Yidong <cyd@stupidchicken.com>
17531
17532 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
17533
4d8ade89
YM
175342011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17535
17536 * dispnew.c (scrolling_window): Don't exclude the case that the
17537 last enabled row in the desired matrix touches the bottom boundary.
17538
32078c8d
GM
175392011-05-21 Glenn Morris <rgm@gnu.org>
17540
17541 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
17542 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
17543 and add some more files.
32078c8d 17544
7285dc67
EZ
175452011-05-20 Eli Zaretskii <eliz@gnu.org>
17546
17547 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
17548 report_file_error introduced by the change from 2011-05-07.
17549
89d1bd22
PE
175502011-05-20 Paul Eggert <eggert@cs.ucla.edu>
17551
17552 * systime.h (Time): Define only if emacs is defined.
17553 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
17554 where the include path doesn't have X11/X.h by default. See
17555 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
17556
cd394be1 175572011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
17558
17559 * composite.c (find_automatic_composition): Fix previous change.
17560
b9704ad9
GM
175612011-05-20 Glenn Morris <rgm@gnu.org>
17562
17563 * lisp.mk: New file, split from Makefile.in.
17564 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
17565 (shortlisp): Remove.
17566 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
17567
4a720484
GM
175682011-05-19 Glenn Morris <rgm@gnu.org>
17569
17570 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
17571 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
17572 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
17573 (lisp): Set the order to that of loadup.el.
17574 (shortlisp): Make it a copy of $lisp.
17575 (SOME_MACHINE_LISP): Remove.
17576 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
17577 Use just $shortlisp, not $SOME_MACHINE_LISP too.
17578
a28d4396
KH
175792011-05-18 Kenichi Handa <handa@m17n.org>
17580
17581 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
17582 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
17583 (find_automatic_composition): Mostly rewrite for efficiency.
17584
a2b1fa8e
JB
175852011-05-18 Juanma Barranquero <lekktu@gmail.com>
17586
17587 * makefile.w32-in: Update dependencies.
17588
8e1f5610
CS
175892011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
17590
17591 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 17592 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 17593
7025ee00 175942011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 17595
cdfa6eab
PE
17596 Fix some integer overflow issues, such as string length overflow.
17597
06d6db33
PE
17598 * insdel.c (count_size_as_multibyte): Check for string overflow.
17599
2b4560a8
PE
17600 * character.c (lisp_string_width): Check for string overflow.
17601 Use EMACS_INT, not int, for string indexes and lengths; in
17602 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
17603 the resulting string length overflows an EMACS_INT; instead,
17604 report a string overflow if no precision given. When checking for
17605 precision exhaustion, use a check that cannot possibly have
17606 integer overflow. (Bug#8675)
17607 * character.h (lisp_string_width): Adjust to new signature.
17608
cb93f9be
PE
17609 * alloc.c (string_overflow): New function.
17610 (Fmake_string): Use it. This doesn't change behavior, but saves
17611 a few bytes and will simplify future changes.
17612 * character.c (string_escape_byte8): Likewise.
17613 * lisp.h (string_overflow): New decl.
17614
1a1f3366
PE
17615 Fixups, following up to the user-interface timestamp change.
17616 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
17617 for UI timestamps, instead of unsigned long.
9fbd6841
PE
17618 * msdos.c (mouse_get_pos): Likewise.
17619 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
17620 * w32gui.h (Time): Define by including "systime.h" rather than by
17621 declaring it ourselves. (Bug#8664)
17622
d4e3e4d3
PE
17623 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
17624 * image.c (clear_image_cache): Likewise.
17625
f6a24d19
PE
17626 * term.c (term_mouse_position): Don't assume time_t wraparound.
17627
08dc5ae6
PE
17628 Be more systematic about user-interface timestamps.
17629 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
17630 and sometimes 'EMACS_UINT', to represent these timestamps.
17631 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
17632 This makes the code easier to follow, and makes it easier to catch
17633 integer overflow bugs such as Bug#8664.
17634 * frame.c (Fmouse_position, Fmouse_pixel_position):
17635 Use Time, not unsigned long, for user-interface timestamps.
17636 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
17637 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
17638 * keyboard.h (last_event_timestamp): Likewise.
17639 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
17640 * menu.h (xmenu_show): Likewise.
17641 * term.c (term_mouse_position): Likewise.
17642 * termhooks.h (struct input_event.timestamp): Likewise.
17643 (struct terminal.mouse_position_hook): Likewise.
17644 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
17645 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
17646 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
17647 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
17648 what it was before.
17649 * menu.h, termhooks.h: Include "systime.h", for Time.
17650
8e55734a
PE
17651 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
17652 Don't assume that the difference between two unsigned long values
17653 can fit into an integer. At this point, we know button_down_time
17654 <= event->timestamp, so the difference must be nonnegative, so
17655 there's no need to cast the result if double-click-time is
17656 nonnegative, as it should be; check that it's nonnegative, just in
17657 case. This bug is triggered when events are more than 2**31 ms
86db42d2 17658 apart (about 25 days). (Bug#8664)
8e55734a 17659
841f1b75 17660 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 17661 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 17662
3e26f69c
PE
17663 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
17664 that always fit in int. Use a sentinel instead of a counter, to
17665 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
17666 * frame.h (struct frame): Use int for menu_bar_items_used
17667 instead of EMACS_INT, since it always fits in int.
3e26f69c 17668
5cc152c0
PE
17669 * menu.c (grow_menu_items): Check for int overflow.
17670
d89eb65e
PE
17671 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
17672
5235bd3e
PE
17673 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
17674 Before, the code was not consistent. These values cannot exceed
17675 2**31 - 1 so there's no need to make them unsigned.
17676 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
17677 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
17678 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
17679 as modifiers.
17680 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
17681
bc827e23
PE
17682 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
17683 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
17684 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
17685 presumably because the widths might not match.
17686
78eb494e
PE
17687 * window.c (size_window): Avoid needless test at loop start.
17688
04f2d78b
CB
176892011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
17690
17691 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
17692
d2fc7e3d 176932011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
17694
17695 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
17696
d2fc7e3d 176972011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
17698
17699 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
17700 `width' to `bar_area_x' and `bar_area_width', respectively.
17701 (x_scroll_run): Take account of fringe background extension.
17702
04f2d78b
CB
17703 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
17704 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
17705 `bar_area_width', respectively.
17706 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
17707 background extension.
17708
79b70037
GM
177092011-05-10 Jim Meyering <meyering@redhat.com>
17710
17711 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
17712
2f142cc5
JB
177132011-05-10 Juanma Barranquero <lekktu@gmail.com>
17714
17715 * image.c (Finit_image_library): Return t for built-in image types,
17716 like pbm and xbm. (Bug#8640)
17717
57679c86
AS
177182011-05-09 Andreas Schwab <schwab@linux-m68k.org>
17719
17720 * w32menu.c (set_frame_menubar): Fix submenu allocation.
17721
888c9e86
EZ
177222011-05-07 Eli Zaretskii <eliz@gnu.org>
17723
b0512a1d
EZ
17724 * w32console.c (Fset_screen_color): Doc fix.
17725 (Fget_screen_color): New function.
17726 (syms_of_ntterm): Defsubr it.
17727
7285dc67
EZ
17728 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
17729 unlink the temporary file if Fcall_process didn't create it in the
17730 first place.
17731 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
17732 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
17733 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
17734 cue to call_process_cleanup not to close that handle.
17735
4d3fcc8e
BK
177362011-05-07 Ben Key <bkey76@gmail.com>
17737
17738 * makefile.w32-in: The bootstrap-temacs rule now makes use of
17739 one of two shell specific rules, either bootstrap-temacs-CMD or
17740 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
17741 to the previous implementation of the bootstrap-temacs rule.
17742 The bootstrap-temacs-CMD rule is similar to the previous
17743 implementation of the bootstrap-temacs rule except that it
17744 makes use of the ESC_CFLAGS variable instead of the CFLAGS
17745 variable.
17746
17747 These changes, along with some changes to nt/configure.bat,
17748 nt/gmake.defs, and nt/nmake.defs, are required to extend my
17749 earlier fix to add support for --cflags and --ldflags options
17750 that include quotes so that it works whether make uses cmd or
17751 sh as the shell.
17752
b4289b64
MA
177532011-05-06 Michael Albinus <michael.albinus@gmx.de>
17754
17755 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
17756 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
17757 is a constant.
17758 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
17759 a string. Handle both cases.
17760 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
17761 (Fdbus_register_method): Use Qinvalid_function.
17762
af4c0e28
JB
177632011-05-06 Juanma Barranquero <lekktu@gmail.com>
17764
17765 * makefile.w32-in: Update dependencies.
17766 (LISP_H): Add inttypes.h and stdin.h.
17767 (PROCESS_H): Add unistd.h.
17768
c51453d9
EZ
177692011-05-06 Eli Zaretskii <eliz@gnu.org>
17770
17771 * lread.c: Include limits.h (fixes the MS-Windows build broken by
17772 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
17773
8ff0ac3c 177742011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 17775
4c4b566b
PE
17776 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
17777
aab2b9b5
PE
17778 * term.c (vfatal): Remove stray call to va_end.
17779 It's not needed and the C Standard doesn't allow it here anyway.
17780
c378da0b
PE
17781 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
17782 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
17783
288b08c7
PE
17784 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
17785 bytes.
17786
e3601888
PE
17787 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
17788
db6c0e74
PE
17789 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17790
dd5963ea
PE
17791 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
17792
88c9450f
PE
17793 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
17794
2f9442b8
PE
17795 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
17796
c032b5f8
PE
17797 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
17798 * charset.c (Fdefine_charset_internal): Don't initialize
17799 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 17800 32-bit int (Bug#8600).
a108c10b
PE
17801
17802 * lread.c (read_integer): Be more consistent with string-to-number.
17803 Use string_to_number to do the actual conversion; this avoids
17804 rounding errors and fixes some other screwups. Without this fix,
17805 for example, #x1fffffffffffffff was misread as -2305843009213693952.
17806 (digit_to_number): Move earlier, for benefit of read_integer.
17807 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 17808 not a digit in any supported base. (Bug#8602)
a108c10b 17809
ad5f9eea
PE
17810 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
17811
aec1708a
PE
17812 * dispnew.c (scrolling_window): Return 1 if we scrolled,
17813 to match comment at start of function. This also removes a
17814 GCC warning about overflow in a 32+64-bit port.
17815
47be4ab5
PE
17816 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
17817
371cac43
PE
17818 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
17819 Reported by Stefan Monnier in
17820 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
17821 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17822 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 17823
d01a7826
PE
17824 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
17825 (EMACS_UINTPTR): Likewise, with uintptr_t.
17826
7fd47d5c
PE
17827 * lisp.h: Prefer 64-bit EMACS_INT if available.
17828 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
17829 on 32-bit hosts that have 64-bit int, so that they can access
17830 large files.
122b0c86
PE
17831 However, temporarily disable this change unless the temporary
17832 symbol WIDE_EMACS_INT is defined.
7fd47d5c 17833
8727937b
PE
17834 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
17835
8ac068ac
PE
17836 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
17837 This removes an assumption that EMACS_INT and long are the same
17838 width as pointers. The assumption is true for Emacs porting targets
17839 now, but we want to make other targets possible.
17840 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
17841 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
17842 In the rest of the code, change types of integers that hold casted
17843 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
17844 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
17845 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
17846 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
17847 No need to cast type when ORing.
17848 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
17849 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
17850 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
17851 assume EMACS_INT is the same width as char *.
17852 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
17853 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
17854 Remove no-longer-needed casts.
17855 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
17856 (xg_tool_bar_help_callback, xg_make_tool_item):
17857 Use EMACS_INTPTR to hold an integer
17858 that will be cast to void *; this can avoid a GCC warning
17859 if EMACS_INT is not the same width as void *.
17860 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
17861 * xdisp.c (display_echo_area_1, resize_mini_window_1):
17862 (current_message_1, set_message_1):
17863 Use a local to convert to proper width without a cast.
17864 * xmenu.c (dialog_selection_callback): Likewise.
17865
ede49d71
PE
17866 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
17867 Also, don't assume VALBITS / RAND_BITS is less than 5,
17868 and don't rely on undefined behavior when shifting a 1 left into
17869 the sign bit.
17870 * lisp.h (get_random): Change signature to match.
17871
2f30ecd0
PE
17872 * lread.c (hash_string): Use size_t, not int, for hash computation.
17873 Normally we prefer signed values; but hashing is special, because
17874 it's better to use unsigned division on hash table sizes so that
17875 the remainder is nonnegative. Also, size_t is the natural width
17876 for hashing into memory. The previous code used 'int', which doesn't
17877 retain enough info to hash well into very large tables.
17878 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
17879
2a866e7b
PE
17880 * dbusbind.c: Don't possibly lose pointer info when converting.
17881 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
17882 Use XPNTR rather than XHASH, so that the high-order bits of
17883 the pointer aren't lost when converting through void *.
17884
51639eac
PE
17885 * eval.c (Fautoload): Don't double-shift a pointer.
17886
92394119
PE
17887 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
17888
dbdb9a7c
JB
178892011-05-06 Juanma Barranquero <lekktu@gmail.com>
17890
17891 * gnutls.c (DEF_GNUTLS_FN):
17892 * image.c (DEF_IMGLIB_FN): Make function pointers static.
17893
db7a0b4f
AS
178942011-05-05 Andreas Schwab <schwab@linux-m68k.org>
17895
17896 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
17897 marker. (Bug#8610)
17898
cd394be1 178992011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
17900
17901 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
17902 New version that can reserve upto 2GB of heap space.
17903
f7ff1b0f 179042011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
17905
17906 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
17907
639c109b
TZ
179082011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
17909
17910 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
17911 `gnutls_certificate_set_x509_key_file'.
17912
d2127135
JB
179132011-05-05 Juanma Barranquero <lekktu@gmail.com>
17914
17915 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
17916 Update dependencies.
17917
e968f4f3
JB
179182011-05-04 Juanma Barranquero <lekktu@gmail.com>
17919
17920 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
17921 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
17922 Remove unused parameter `fildes'.
17923 * process.c (read_process_output, send_process): Don't pass it.
17924
84d358f0
JB
179252011-05-04 Juanma Barranquero <lekktu@gmail.com>
17926
17927 Fix previous change: the library cache is defined in w32.c.
17928 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
17929 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
17930
0898ca10
JB
179312011-05-04 Juanma Barranquero <lekktu@gmail.com>
17932
17933 Implement dynamic loading of GnuTLS on Windows.
17934
17935 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
17936 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
17937 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17938 Declare.
17939
17940 * gnutls.c (Qgnutls_dll): Define.
17941 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
17942 (gnutls_*): Declare function pointers.
17943 (init_gnutls_functions): New function to initialize function pointers.
17944 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
17945 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
17946 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
17947 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
17948 (emacs_gnutls_write, emacs_gnutls_read)
17949 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
17950 (Fgnutls_available_p): New function.
17951 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
17952 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
17953 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
17954
17955 * image.c: Include w32.h.
17956 (Vimage_type_cache): Delete.
17957 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
17958 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
17959 (w32_delayed_load): Move to w32.c.
17960
17961 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
17962
17963 * w32.c (QCloaded_from, Vlibrary_cache): Define.
17964 (w32_delayed_load): Move from image.c. When loading a library, record
17965 its filename in the :loaded-from property of the library id.
17966 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
17967 Initialize and staticpro them.
17968 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
17969
17970 * process.c: Include lisp.h before w32.h, not after.
17971 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
17972 instead of gnutls_record_check_pending.
17973
17974 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
17975
ff4de4aa
TZ
179762011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
17977
17978 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
17979 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
17980 as passed in.
17981
abe95abb
JD
179822011-05-03 Jan Djärv <jan.h.d@swipnet.se>
17983
17984 * xterm.c (x_set_frame_alpha): Do not set property on anything
17985 else than FRAME_X_OUTER_WINDOW (Bug#8608).
17986
e16e55d4
JB
179872011-05-02 Juanma Barranquero <lekktu@gmail.com>
17988
17989 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
17990
bafcf6a5
JB
179912011-05-02 Juanma Barranquero <lekktu@gmail.com>
17992
17993 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
17994 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
17995 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
17996 (gnutls_global_initialized, Qgnutls_bootprop_priority)
17997 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
17998 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
17999 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
18000 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
18001 (Qgnutls_bootprop_callbacks_verify): Make static.
18002
e7a6747f
AS
180032011-05-01 Andreas Schwab <schwab@linux-m68k.org>
18004
19ed11ba
AS
18005 * callproc.c: Indentation fixup.
18006
e7a6747f 18007 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
18008 (wait_for_termination, interruptible_wait_for_termination):
18009 Move after wait_for_termination_1.
e7a6747f 18010
1ef14cb4
LMI
180112011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
18012
18013 * sysdep.c (interruptible_wait_for_termination): New function
18014 which is like wait_for_termination, but allows keyboard
18015 interruptions.
18016
18017 * callproc.c (Fcall_process): Add (:file "file") as an option for
18018 the STDOUT buffer.
18019 (Fcall_process_region): Ditto.
18020
330d880c
EZ
180212011-04-30 Eli Zaretskii <eliz@gnu.org>
18022
8db90b73
EZ
18023 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
18024 rather than `XVECTOR (FOO)->size'.
18025
330d880c
EZ
18026 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
18027 inttypes.h, as a gnulib replacement is used if it not available in
18028 system headers.
18029
15cbd324
EZ
180302011-04-21 Eli Zaretskii <eliz@gnu.org>
18031
18032 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
18033 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
18034 of MOST_POSITIVE_FIXNUM. (Bug#8528)
18035
18036 * coding.c (coding_alloc_by_realloc): Error out if destination
18037 will grow beyond MOST_POSITIVE_FIXNUM.
18038 (decode_coding_emacs_mule): Abort if there isn't enough place in
18039 charbuf for the composition carryover bytes. Reserve an extra
18040 space for up to 2 characters produced in a loop.
18041 (decode_coding_iso_2022): Abort if there isn't enough place in
18042 charbuf for the composition carryover bytes.
18043
180442011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 18045
ae940cca
EZ
18046 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
18047 aborting when %lld or %lll format is passed.
18048 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
18049 %llo or %llx format is passed. (Bug#8545)
18050
03ab8921
EZ
18051 * window.c (window_scroll_line_based): Use a marker instead of
18052 simple variables to record original value of point. (Bug#7952)
18053
afda1437
EZ
18054 * doprnt.c (doprnt): Fix the case where a multibyte sequence
18055 produced by %s or %c overflows available buffer space. (Bug#8545)
18056
f76dee0c
PE
180572011-04-28 Paul Eggert <eggert@cs.ucla.edu>
18058
18059 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 18060 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 18061
fdc5744d
JB
180622011-04-28 Juanma Barranquero <lekktu@gmail.com>
18063
18064 * w32.c (init_environment): Warn about defaulting HOME to C:\.
18065
638f053a
JB
180662011-04-28 Juanma Barranquero <lekktu@gmail.com>
18067
18068 * keyboard.c (Qdelayed_warnings_hook): Define.
18069 (command_loop_1): Run `delayed-warnings-hook'
18070 if Vdelayed_warnings_list is non-nil.
18071 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
18072 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
18073
d178f871
EZ
180742011-04-28 Eli Zaretskii <eliz@gnu.org>
18075
18076 * doprnt.c (doprnt): Don't return value smaller than the buffer
18077 size if the message was truncated. (Bug#8545).
18078
b124fd93
JB
180792011-04-28 Juanma Barranquero <lekktu@gmail.com>
18080
18081 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
18082 (Fx_window_property): #if-0 the whole functions, not just the bodies.
18083
e810457d
PE
180842011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18085
18086 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
18087
ea51cceb
JB
180882011-04-27 Juanma Barranquero <lekktu@gmail.com>
18089
18090 * makefile.w32-in: Update dependencies.
18091
94dcfacf
EZ
180922011-04-27 Eli Zaretskii <eliz@gnu.org>
18093
18094 Improve `doprnt' and its usage. (Bug#8545)
18095 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
18096 `format_end'. Remove support for %l as a conversion specifier.
18097 Don't use xrealloc. Improve diagnostics when the %l size modifier
18098 is used. Update the commentary.
18099
18100 * eval.c (verror): Simplify calculation of size_t.
18101
18102 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
18103 messages.
18104
f61f41d7
PE
181052011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
18106
18107 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
18108 change.
18109
96fb4434
PE
181102011-04-27 Paul Eggert <eggert@cs.ucla.edu>
18111
18112 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
18113 This makes this file independent of the recent pseudovector change.
18114
671875da 181152011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 18116
69e9b5a3
PE
18117 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
18118
b5f869a7 18119 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 18120 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 18121 Remove unused local.
c8926152 18122 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 18123
841a1577 18124 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
18125 GCC 4.6.0 optimizes based on type-based alias analysis.
18126 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
18127 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
18128 != &v->size, and therefore "v->size = 1; b->size = 2; return
18129 v->size;" must therefore return 1. This assumption is incorrect
18130 for Emacs, since it type-puns struct Lisp_Vector * with many other
18131 types. To fix this problem, this patch adds a new type struct
f904488f 18132 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
18133 and pseudovectors, and helps optimizing compilers not get fooled
18134 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
18135 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
18136 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
18137 the size member.
eab3844f
PE
18138 (XSETPVECTYPE): Rewrite in terms of new macro.
18139 (XSETPVECTYPESIZE): New macro, specifying both type and size.
18140 This is a bit clearer, and further avoids the possibility of
18141 undesirable aliasing.
18142 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 18143 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
18144 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
18145 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
18146 (ASIZE): Now uses header.size rather than size.
18147 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
18148 to avoid the hassle of writing XVECTOR (foo)->header.size.
18149 (struct vectorlike_header): New type.
eab3844f
PE
18150 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
18151 object, to help avoid aliasing.
18152 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
18153 (SUBRP): Likewise, since Lisp_Subr is a special case.
18154 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
18155 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
18156 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 18157 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
18158 changed to be "header.size" and "header.next".
18159 * buffer.h (struct buffer): Likewise.
18160 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
18161 * frame.h (struct frame): Likewise.
18162 * process.h (struct Lisp_Process): Likewise.
18163 * termhooks.h (struct terminal): Likewise.
18164 * window.c (struct save_window_data, struct saved_window): Likewise.
18165 * window.h (struct window): Likewise.
18166 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
18167 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
18168 * buffer.c (init_buffer_once): Likewise.
18169 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
18170 special case.
18171 * process.c (Fformat_network_address): Use local var for size,
18172 for brevity.
18173
0df1eac5
PE
18174 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
18175
847ab9d1 18176 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
18177 * data.c (atof): Remove decl; no longer used or needed.
18178 (digit_to_number): Move to lread.c.
18179 (Fstring_to_number): Use new string_to_number function, to be
18180 consistent with how the Lisp reader treats infinities and NaNs.
18181 Do not assume that floating-point numbers represent EMACS_INT
18182 without losing information; this is not true on most 64-bit hosts.
18183 Avoid double-rounding errors, by insisting on integers when
18184 parsing non-base-10 numbers, as the documentation specifies.
18185 * lisp.h (string_to_number): New decl, replacing ...
18186 (isfloat_string): Remove.
bc0a5c13 18187 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 18188 (read1): Do not accept +. and -. as integers; this
452f4150
PE
18189 appears to have been a coding error. Similarly, do not accept
18190 strings like +-1e0 as floating point numbers. Do not report
18191 overflow for integer overflows unless the base is not 10 which
18192 means we have no simple and reliable way to continue.
18193 Break out the floating-point parsing into a new
18194 function string_to_number, so that Fstring_to_number parses
18195 floating point numbers consistently with the Lisp reader.
04f2d78b 18196 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
18197 (E_CHAR, EXP_INT): Remove, replacing with ...
18198 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
18199 (string_to_number): New function, replacing isfloat_string.
18200 This function checks for valid syntax and produces the resulting
18201 Lisp float number too. Rework it so that string-to-number
bc0a5c13 18202 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
18203 so that overflow for non-base-10 numbers is reported only when
18204 there's no portable and simple way to convert to floating point.
452f4150 18205
67769ffc
PE
18206 * textprop.c (set_text_properties_1): Rewrite for clarity,
18207 and to avoid GCC warning about integer overflow.
18208
c20db43f
PE
18209 * intervals.h (struct interval): Use EMACS_INT for members
18210 where EMACS_UINT might cause problems. See
18211 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
18212 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
18213 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
18214 All uses changed.
37aa2f85
PE
18215 (offset_intervals): Tell GCC not to worry about length overflow
18216 when negating a negative length.
c20db43f 18217
2538aa2f
PE
18218 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
18219 (overrun_check_free): Likewise.
18220
f2d3008d
PE
18221 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
18222 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
18223 word size.
18224
ec8df744
PE
18225 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18226 (gnutls_make_error): Rename local to avoid shadowing.
18227 (gnutls_emacs_global_deinit): ifdef out; not used.
18228 (Fgnutls_boot): Use const for pointer to readonly storage.
18229 Comment out unused local. Fix pointer signedness problems.
18230
640ee02d
PE
18231 * lread.c (openp): Don't stuff size_t into an 'int'.
18232 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
18233 about possible signed overflow.
18234
6048fb2a
PE
18235 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
18236 (GDK_KEY_g): Don't define if already defined.
18237 (xg_prepare_tooltip): Avoid pointer signedness problem.
18238 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
18239
fa3c87e1
PE
18240 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
18241 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
18242
2172544b
PE
18243 * xfns.c (Fx_window_property): Simplify a bit,
18244 to make a bit faster and to avoid GCC 4.6.0 warning.
18245 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
18246
9b821a21
PE
18247 * fns.c (internal_equal): Don't assume size_t fits in int.
18248
3c616cfa
PE
18249 * alloc.c (compact_small_strings): Tighten assertion a little.
18250
c2982e87
PE
18251 Replace pEd with more-general pI, and fix some printf arg casts.
18252 * lisp.h (pI): New macro, generalizing old pEd macro to other
18253 conversion specifiers. For example, use "...%"pI"d..." rather
18254 than "...%"pEd"...".
18255 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 18256 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
18257 * alloc.c (check_pure_size): Don't overflow by converting size to int.
18258 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
18259 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
18260 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
18261 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
18262 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
18263 64-bit hosts.
18264 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
18265 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
18266 * print.c (safe_debug_print, print_object): Likewise.
18267 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
18268 to int.
6f04d126
PE
18269 Use pI instead of if-then-else-abort. Use %p to avoid casts,
18270 avoiding the 0 flag, which is not portable.
c2982e87
PE
18271 * process.c (Fmake_network_process): Use pI to avoid cast.
18272 * region-cache.c (pp_cache): Likewise.
18273 * xdisp.c (decode_mode_spec): Likewise.
18274 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
18275 behavior on 64-bit hosts with printf arg.
6f04d126 18276 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
18277 (x_stop_queuing_selection_requests): Likewise.
18278 (x_get_window_property): Don't truncate byte count to an 'int'
18279 when tracing.
0b432f21 18280
5e073ec7
PE
18281 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
18282 here, since it parses constructs like leading '-' and spaces,
18283 which are not wanted; and it overflows with large numbers.
18284 Instead, simply match F[0-9]+, which is what is wanted anyway.
18285
36372bf9
PE
18286 * alloc.c: Remove unportable assumptions about struct layout.
18287 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
18288 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
18289 (allocate_vectorlike, make_pure_vector): Use the new macros,
18290 plus offsetof, to remove unportable assumptions about struct layout.
18291 These assumptions hold on all porting targets that I know of, but
18292 they are not guaranteed, they're easy to remove, and removing them
18293 makes further changes easier.
18294
0b432f21
PE
18295 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
18296 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
18297 (string_overrun_cookie): Now const. Use initializers that
18298 don't formally overflow signed char, to avoid warnings.
000098c1
PE
18299 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
18300 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
18301 (allocate_buffer): Don't assume sizeof (struct buffer) is a
18302 multiple of sizeof (EMACS_INT); it need not be, if
18303 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 18304 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 18305
895009e1
JB
183062011-04-26 Juanma Barranquero <lekktu@gmail.com>
18307
18308 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
18309
6a7a1b0b
TZ
183102011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
18311
18312 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 18313 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
18314 Reported by Paul Eggert <eggert@cs.ucla.edu>.
18315
841a1577 183162011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
18317
18318 * lisp.h (Qdebug): List symbol.
895009e1 18319 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
18320 * keyboard.c (debug-on-event): New variable.
18321 (handle_user_signal): Break into debugger when debug-on-event
18322 matches the current signal symbol.
18323
f2d3ba6f
DN
183242011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
18325
18326 * alloc.c (check_sblock, check_string_bytes)
18327 (check_string_free_list): Convert to standard C.
18328
42ce4c63
TZ
183292011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
18330
18331 * w32.c (emacs_gnutls_push): Fix typo.
18332
825cd63c
EZ
183332011-04-25 Eli Zaretskii <eliz@gnu.org>
18334
fb11d64d
EZ
18335 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
18336 "cast to pointer from integer of different size".
18337
825cd63c
EZ
18338 Improve doprnt and its use in verror. (Bug#8545)
18339 * doprnt.c (doprnt): Document the set of format control sequences
18340 supported by the function. Use SAFE_ALLOCA instead of always
18341 using `alloca'.
18342
18343 * eval.c (verror): Don't limit the buffer size at size_max-1, that
18344 is one byte too soon. Don't use xrealloc; instead xfree and
18345 xmalloc anew.
18346
e061a11b
TZ
183472011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
18348
18349 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
18350 callbacks stage.
18351
18352 * gnutls.c: Renamed global_initialized to
18353 gnutls_global_initialized. Added internals for the
18354 :verify-hostname-error, :verify-error, and :verify-flags
18355 parameters of `gnutls-boot' and documented those parameters in the
18356 docstring. Start callback support.
9173deec
JB
18357 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
18358 unless a fatal error occurred. Call gnutls_alert_send_appropriate
18359 on error. Return error code.
e061a11b
TZ
18360 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
18361 (emacs_gnutls_read): Likewise.
18362 (Fgnutls_boot): Return handshake error code.
18363 (emacs_gnutls_handle_error): New function.
18364 (wsaerror_to_errno): Likewise.
18365
18366 * w32.h (emacs_gnutls_pull): Add prototype.
18367 (emacs_gnutls_push): Likewise.
18368
18369 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
18370 (emacs_gnutls_push): Likewise.
18371
183722011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
18373
18374 * process.c (wait_reading_process_output): Check if GnuTLS
18375 buffered some data internally if no FDs are set for TLS
18376 connections.
18377
18378 * makefile.w32-in (OBJ2): Add gnutls.$(O).
18379 (LIBS): Link to USER_LIBS.
18380 ($(BLD)/gnutls.$(0)): New target.
18381
fa6996bc
EZ
183822011-04-24 Eli Zaretskii <eliz@gnu.org>
18383
eb35682e
EZ
18384 * xdisp.c (handle_single_display_spec): Rename the
18385 display_replaced_before_p argument into display_replaced_p, to
18386 make it consistent with the commentary. Fix typos in the
18387 commentary.
18388
e2ad650c
EZ
18389 * textprop.c (syms_of_textprop): Remove dead code.
18390 (copy_text_properties): Delete obsolete commentary about an
18391 interface that was deleted long ago. Fix typos in the description
18392 of arguments.
18393
1b2de274
EZ
18394 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
18395 to changes in oldXMenu/XMenu.h from 2011-04-16.
18396 <menu_help_message, prev_menu_help_message>: Constify.
18397 (IT_menu_make_room): menu->help_text is now `const char **';
18398 adjust.
18399
18400 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
18401 to changes in oldXMenu/XMenu.h from 2011-04-16.
18402 (struct XMenu): Declare `help_text' `const char **'.
18403
18404 * xfaces.c <Qunspecified>: Make extern again.
18405
18406 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 18407 required by POSIX.
1b2de274 18408
762b15be
EZ
18409 * doc.c (get_doc_string): Improve the format passed to `error'.
18410
18411 * doprnt.c (doprnt): Improve commentary.
18412
18413 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
18414
18415 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
18416 them with etags.
18417
f1052e5d
EZ
18418 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
18419 changes in globals.h immediately force recompilation.
762b15be
EZ
18420 (TAGS): Depend on $(CURDIR)/m/intel386.h and
18421 $(CURDIR)/s/ms-w32.h.
18422 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 18423
fa6996bc
EZ
18424 * character.c (Fchar_direction): Function deleted.
18425 (syms_of_character): Don't defsubr it.
18426 <char-direction-table>: Deleted.
18427
e6c3da20
EZ
184282011-04-23 Eli Zaretskii <eliz@gnu.org>
18429
18430 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
18431 * doprnt.c: Include limits.h.
18432 (SIZE_MAX): New macro.
04f2d78b
CB
18433 (doprnt): Return a size_t value. 2nd arg is now size_t.
18434 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
18435 Improve overflow protection. Support `l' modifier for integer
18436 conversions. Support %l conversion. Don't assume an EMACS_INT
18437 argument for integer conversions and for %c.
18438
18439 * lisp.h (doprnt): Restore prototype.
18440
18441 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
18442 $(SRC)/character.h.
18443
18444 * Makefile.in (base_obj): Add back doprnt.o.
18445
18446 * deps.mk (doprnt.o): Add back prerequisites.
18447 (callint.o): Depend on character.h.
18448
18449 * eval.c (internal_lisp_condition_case): Include the handler
18450 representation in the error message.
18451 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
18452 when breaking from the loop.
18453
18454 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
18455
18456 * callint.c (Fcall_interactively): When displaying error message
18457 about invalid control letter, pass the character's codepoint, not
18458 a pointer to its multibyte form. Improve display of the character
18459 in octal and display also its hex code.
18460
18461 * character.c (char_string): Use %x to display the (unsigned)
18462 codepoint of an invalid character, to avoid displaying a bogus
18463 negative value.
18464
18465 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
18466 `error', not SYMBOL_NAME itself.
18467
18468 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
18469 character arguments to `error'.
18470
18471 * charset.c (check_iso_charset_parameter): Fix incorrect argument
18472 to `error' in error message about FINAL_CHAR argument. Make sure
18473 FINAL_CHAR is a character, and use %c when it is passed as
18474 argument to `error'.
18475
4ffd0d6b 184762011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
18477
18478 * s/ms-w32.h (localtime): Redirect to sys_localtime.
18479
18480 * w32.c: Include <time.h>.
18481 (sys_localtime): New function.
18482
4ffd0d6b 184832011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
18484
18485 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
18486
4ffd0d6b 18487 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 18488
4ffd0d6b 184892011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 18490
4ffd0d6b
GM
18491 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
18492 zombies (Bug#8467).
aac0c6e3 18493
04c56954
EZ
184942011-04-19 Eli Zaretskii <eliz@gnu.org>
18495
18496 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
18497 gl_state.e_property when gl_state.object is Qt.
18498
18499 * insdel.c (make_gap_larger): Remove limitation of buffer size
18500 to <= INT_MAX.
18501
16a43933
CY
185022011-04-18 Chong Yidong <cyd@stupidchicken.com>
18503
18504 * xdisp.c (lookup_glyphless_char_display)
18505 (produce_glyphless_glyph): Handle cons cell entry in
18506 glyphless-char-display.
18507 (Vglyphless_char_display): Document it.
18508
18509 * term.c (produce_glyphless_glyph): Handle cons cell entry in
18510 glyphless-char-display.
18511
4581706e
CY
185122011-04-17 Chong Yidong <cyd@stupidchicken.com>
18513
18514 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
18515
18516 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
18517
18518 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
18519 definition for no-X builds.
18520
4887c6e2 185212011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 18522
fd35b6f9
PE
18523 Static checks with GCC 4.6.0 and non-default toolkits.
18524
5c1ccb01
PE
18525 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
18526
006c5daa
PE
18527 * process.c (keyboard_bit_set): Define only if SIGIO.
18528 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
18529 (send_process): Repair possible setjmp clobbering.
18530
efc736d3
PE
18531 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
18532
4e2fe2e6
PE
18533 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
18534
f97334a2
PE
18535 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
18536
4e75f29d
PE
18537 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
18538 Define only if needed.
18539
90efadd1
PE
18540 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
18541 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 18542 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 18543
3c647824
PE
18544 * dispextern.h (struct redisplay_interface): Rename param
18545 to avoid shadowing.
e264f262 18546 * termhooks.h (struct terminal): Likewise.
761383f4 18547 * xterm.c (xembed_send_message): Likewise.
3c647824 18548
b58c5c4a
PE
18549 * insdel.c (make_gap_smaller): Define only if
18550 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
18551
cad59032
PE
18552 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
18553 it.
18554
c339dc2e
PE
18555 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
18556 so that we aren't warned about unused symbols.
18557
91a3e27b
PE
18558 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
18559
399c71d3 18560 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 18561
8ffc96f5
PE
18562 * xfns.c (x_real_positions): Mark locals as initialized.
18563
eef9bc79
PE
18564 * xmenu.c (xmenu_show): Don't use uninitialized vars.
18565
098db9dd
PE
18566 * xterm.c: Fix problems found by static analysis with other toolkits.
18567 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
18568 (x_dispatch_event): Declare static if USE_GTK, and
18569 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 18570 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 18571 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
18572 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
18573 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 18574
eb18f6cc
PE
18575 * xmenu.c (menu_help_callback): Pointer type fixes.
18576 Use const pointers when pointing at readonly data. Avoid pointer
18577 signedness clashes.
18578 (FALSE): Remove unused macro.
18579 (update_frame_menubar): Remove unused decl.
18580
1fe72bf8
PE
18581 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
18582
60d9e1db
PE
18583 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
18584 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
18585 (single_menu_item): Rename local to avoid shadowing.
18586
39261c26
PE
18587 * keyboard.c (make_lispy_event): Remove unused local var.
18588
018c5e19
PE
18589 * frame.c, frame.h (x_get_resource_string): Bring this back, but
18590 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
18591
63d2b86e
PE
18592 * bitmaps: Change bitmaps from unsigned char back to the X11
18593 compatible char. Avoid the old compiler warnings about
18594 out-of-range initializers by using, for example, '\xab' rather
18595 than 0xab.
18596
aefd87e1
PE
18597 * xgselect.c (xgselect_initialize): Check vs interface
18598 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
18599
bf501fb9
PE
18600 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
18601
e9829fdf
PE
18602 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
18603 to read-only memory.
18604
1086c095
PE
18605 * fns.c (vector): Remove; this old hack is no longer needed.
18606
2baccd04 18607 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 18608 Remove unused var.
dde42981 18609 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 18610
72391843 18611 * xrdb.c (x_load_resources): Omit unused local.
3565b346 18612
436c16df 18613 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 18614 (x_window): Rename locals to avoid shadowing.
dc5ddd85 18615 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 18616
92bb796d 18617 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 18618 (x_term_init): Remove local to avoid shadowing.
92bb796d 18619
764430a3 18620 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
18621
18622 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
18623 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
18624
d1dfb56c
EZ
186252011-04-16 Eli Zaretskii <eliz@gnu.org>
18626
c4354cb4
EZ
18627 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
18628
d1dfb56c
EZ
18629 Fix regex.c, syntax.c and friends for buffers > 2GB.
18630 * syntax.h (struct gl_state_s): Declare character position members
18631 EMACS_INT.
18632
18633 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
18634
04f2d78b
CB
18635 * textprop.c (verify_interval_modification, interval_of):
18636 Declare arguments EMACS_INT.
d1dfb56c
EZ
18637
18638 * intervals.c (adjust_intervals_for_insertion): Declare arguments
18639 EMACS_INT.
18640
18641 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
18642
18643 * indent.c (Fvertical_motion): Local variable it_start is now
18644 EMACS_INT.
18645
18646 * regex.c (re_match, re_match_2, re_match_2_internal)
18647 (bcmp_translate, regcomp, regexec, print_double_string)
18648 (group_in_compile_stack, re_search, re_search_2, regex_compile)
18649 (re_compile_pattern, re_exec): Declare arguments and local
18650 variables `size_t' and `ssize_t' and return values `regoff_t', as
18651 appropriate.
18652 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
18653 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
18654 <compile_stack_type>: `size' and `avail' are now `size_t'.
18655
18656 * regex.h <regoff_t>: Use ssize_t, not int.
18657 (re_search, re_search_2, re_match, re_match_2): Arguments that
18658 specify buffer/string position and length are now ssize_t and
18659 size_t. Return type is regoff_t.
18660
613052cd
BK
186612011-04-16 Ben Key <bkey76@gmail.com>
18662
18663 * nsfont.m: Fixed bugs in ns_get_family and
18664 ns_descriptor_to_entity that were caused by using free to
18665 deallocate memory blocks that were allocated by xmalloc (via
18666 xstrdup). This caused Emacs to crash when compiled with
18667 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
18668 --enable-checking=xmallocoverrun). xfree is now used to
18669 deallocate these memory blocks.
18670
4170f62f 186712011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 18672
71b41406
PE
18673 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
18674
9587a89d
PE
18675 emacs_write: Accept and return EMACS_INT for sizes.
18676 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
18677 et seq.
18678 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
18679 Accept and return EMACS_INT.
18680 (emacs_gnutls_write): Return the number of bytes written on
18681 partial writes.
18682 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
18683 (emacs_read, emacs_write): Remove check for negative size, as the
18684 Emacs source code has been audited now.
9587a89d
PE
18685 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
18686 (emacs_read, emacs_write): Use it.
273a5f82
PE
18687 * process.c (send_process): Adjust to the new signatures of
18688 emacs_write and emacs_gnutls_write. Do not attempt to store
18689 a byte offset into an 'int'; it might overflow.
9587a89d 18690 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 18691
3e047f51
PE
18692 * sound.c: Don't assume sizes fit in 'int'.
18693 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 18694 Return EMACS_INT, not int.
3e047f51 18695 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
18696 Accept EMACS_INT, not int.
18697 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
18698 record read return values.
18699
cc39a9db
BK
187002011-04-15 Ben Key <bkey76@gmail.com>
18701
c9d0ec6d
JB
18702 * keyboard.c (Qundefined): Don't declare static since it is used
18703 in nsfns.m.
18704 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
18705 static since they are used in nsfont.m.
cc39a9db 18706
6c60eb9f
SM
187072011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
18708
18709 * process.c (Qprocessp): Don't declare static.
18710 * lisp.h (Qprocessp): Declare again.
18711
7990b61a
JB
187122011-04-15 Juanma Barranquero <lekktu@gmail.com>
18713
18714 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
18715
5d4cb038
PE
187162011-04-14 Paul Eggert <eggert@cs.ucla.edu>
18717
8bd7b830 18718 Improve C-level modularity by making more things 'static'.
cd64ea1d 18719
e3b27b31
PE
18720 Don't publish debugger-only interfaces to other modules.
18721 * lisp.h (safe_debug_print, debug_output_compilation_hack):
18722 (verify_bytepos, count_markers): Move decls to the only modules
18723 that need them.
18724 * region-cache.h (pp_cache): Likewise.
18725 * window.h (check_all_windows): Likewise.
18726 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
18727
5d4cb038
PE
18728 * sysdep.c (croak): Now static, if
18729 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
18730 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
18731
18732 * alloc.c (refill_memory_reserve): Now static if
18733 !defined REL_ALLOC || defined SYSTEM_MALLOC.
18734 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 18735
e87b6180
PE
18736 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
18737 Define only if USE_LUCID.
18738
ac64929e
PE
18739 * xrdb.c (x_customization_string, x_rm_string): Now static.
18740
6f37259d
PE
18741 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
18742 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
18743
1683e3ab
PE
18744 * xdisp.c (draw_row_with_mouse_face): Now static.
18745 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
18746
de9c2632
PE
18747 * window.h (check_all_windows): Mark externally visible.
18748
2b96acb7
PE
18749 * window.c (window_deletion_count): Now static.
18750
18751 * undo.c: Make symbols static if they're not exported.
18752 (last_undo_buffer, last_boundary_position, pending_boundary):
18753 Now static.
18754
50436f33
PE
18755 * textprop.c (interval_insert_behind_hooks): Now static.
18756 (interval_insert_in_front_hooks): Likewise.
18757
64520e5c
PE
18758 * term.c: Make symbols static if they're not exported.
18759 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
18760 (max_frame_lines, tty_set_terminal_modes):
18761 (tty_reset_terminal_modes, tty_turn_off_highlight):
18762 (get_tty_terminal): Now static.
18763 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
18764 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 18765 HAVE_WINDOW_SYSTEM.
64520e5c
PE
18766 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
18767 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
18768
1fa53021
PE
18769 * sysdep.c: Make symbols static if they're not exported.
18770 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
18771 Now static.
18772 (sigprocmask_set, full_mask): Remove; unused.
18773 (wait_debugging): Mark as visible.
18774 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
18775 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
18776
d4b43b22
PE
18777 * syntax.c (syntax_temp): Define only if !__GNUC__.
18778
b7c513d0
PE
18779 * sound.c (current_sound_device, current_sound): Now static.
18780
989b29ad
PE
18781 * search.c (searchbufs, searchbuf_head): Now static.
18782
13a55a78
PE
18783 * scroll.c (scroll_cost): Remove; unused.
18784 * dispextern.h (scroll_cost): Remove decl.
18785
de68a1fc
PE
18786 * region-cache.h (pp_cache): Mark as externally visible.
18787
40ccffa6
PE
18788 * process.c: Make symbols static if they're not exported.
18789 (process_tick, update_tick, create_process, chan_process):
18790 (Vprocess_alist, proc_buffered_char, datagram_access):
18791 (fd_callback_data, send_process_frame, process_sent_to): Now static.
18792 (deactivate_process): Mark defn as static, as well as decl.
18793 * lisp.h (create_process): Remove decl.
18794 * process.h (chan_process, Vprocess_alist): Remove decls.
18795
ad64fc97
PE
18796 * print.c: Make symbols static if they're not exported.
18797 (print_depth, new_backquote_output, being_printed, print_buffer):
18798 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
18799 (print_interval, print_number_index, initial_stderr_stream):
18800 Now static.
18801 * lisp.h (Fprinc): Remove decl.
18802 (debug_output_compilation_hack): Mark as externally visible.
18803
adddb265
PE
18804 * sysdep.c (croak): Move decl from here to syssignal.h.
18805 * syssignal.h (croak): Put it here, so the API can be checked when
18806 'croak' is called from dissociate_if_controlling_tty.
18807
1717ede2
PE
18808 * minibuf.c: Make symbols static if they're not exported.
18809 (minibuf_save_list, choose_minibuf_frame): Now static.
18810 * lisp.h (choose_minibuf_frame): Remove decl.
18811
fa5fb2bc
PE
18812 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
18813
1e3890d1
PE
18814 * lread.c: Make symbols static if they're not exported.
18815 (read_objects, initial_obarray, oblookup_last_bucket_number):
18816 Now static.
18817 (make_symbol): Remove; unused.
18818 * lisp.h (initial_obarray, make_symbol): Remove decls.
18819
8a1414fa
PE
18820 * keyboard.c: Make symbols static if they're not exported.
18821 (single_kboard, recent_keys_index, total_keys, recent_keys):
18822 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
18823 (this_single_command_key_start, echoing, last_auto_save):
18824 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
18825 (command_loop, echo_now, keyboard_init_hook, help_char_p):
18826 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
18827 (Vlispy_mouse_stem, double_click_count):
18828 Now static.
18829 (force_auto_save_soon): Define only if SIGDANGER.
18830 (ignore_mouse_drag_p): Now static if
18831 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
18832 (print_help): Remove; unused.
18833 (stop_character, last_timer_event): Mark as externally visible.
18834 * keyboard.h (ignore_mouse_drag_p): Declare only if
18835 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
18836 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
18837 * lisp.h (echoing): Remove decl.
18838 (force_auto_save_soon): Declare only if SIGDANGER.
18839 * xdisp.c (redisplay_window): Simplify code, to make it more
18840 obvious that ignore_mouse_drag_p is not accessed if !defined
18841 USE_GTK && !defined HAVE_NS.
18842
93ea6e8f
PE
18843 * intervals.c: Make symbols static if they're not exported.
18844 (merge_properties_sticky, merge_interval_right, delete_interval):
18845 Now static.
18846 * intervals.h (merge_interval_right, delete_interval): Remove decls.
18847
77382fcc
PE
18848 * insdel.c: Make symbols static if they're not exported.
18849 However, leave prepare_to_modify_buffer alone. It's never
18850 called from outside this function, but that appears to be a bug.
18851 (combine_after_change_list, combine_after_change_buffer):
4889fc82 18852 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
18853 (adjust_after_replace_noundo): Remove; unused.
18854 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 18855 (signal_before_change): Remove decls.
77382fcc 18856
9306c32e
PE
18857 * indent.c (val_compute_motion, val_vmotion): Now static.
18858
cd44d2eb
PE
18859 * image.c: Make symbols static if they're not exported.
18860 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
18861 if USE_GTK.
18862 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
18863 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
18864
ad9a7a06
PE
18865 * fringe.c (standard_bitmaps): Now static.
18866 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
18867
81626931
PE
18868 * frame.c: Make symbols static if they're not exported.
18869 (x_report_frame_params, make_terminal_frame): Now static.
18870 (get_frame_param): Now static, unless HAVE_NS.
18871 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
18872 (x_get_resource_string): Remove; not used.
18873 * frame.h (make_terminal_frame, x_report_frame_params):
18874 (x_get_resource_string); Remove decls.
18875 (x_fullscreen_adjust): Declare only if WINDOWSNT.
18876 * lisp.h (get_frame_param): Declare only if HAVE_NS.
18877
239f9db9
PE
18878 * font.c, fontset.c: Make symbols static if they're not exported.
18879 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
18880 (FACE_SUITABLE_FOR_CHAR_P): Use it.
18881 * font.c (font_close_object): Now static.
18882 * font.h (font_close_object): Remove.
18883 * fontset.c (FONTSET_OBJLIST): Remove.
18884 (free_realized_fontset) #if-0 the body, which does nothing.
18885 (face_suitable_for_char_p): #if-0, as it's never called.
18886 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
18887 * xfaces.c (face_at_string_position):
18888 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
18889 since 0 is always ASCII.
18890
dfcf3579
PE
18891 * fns.c (weak_hash_tables): Now static.
18892
5045092b
PE
18893 * fileio.c: Make symbols static if they're not exported.
18894 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
18895 (Vwrite_region_annotation_buffers): Now static.
18896
57a96f5c
PE
18897 * eval.c: Make symbols static if they're not exported.
18898 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
18899 * lisp.h (backtrace_list): Remove decl.
18900
35f08c38
PE
18901 * emacs.c: Make symbols static if they're not exported.
18902 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
18903 (fatal_error_code, fatal_error_signal_hook, standard_args):
18904 Now static.
18905 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
18906 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
18907 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
18908 * lisp.h (fatal_error_signal_hook): Remove decl.
18909 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
18910
f44bd759
PE
18911 * editfns.c: Move a (normally-unused) function to its only use.
18912 * editfns.c, lisp.h (get_operating_system_release): Remove.
18913 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
18914 worth the hassle of breaking this out.
18915
b532497d
PE
18916 * xterm.c: Make symbols static if they're not exported.
18917 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
18918 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
18919 (x_destroy_window, x_delete_display):
18920 Now static.
18921 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
18922 (x_mouse_leave): Remove; unused.
18923 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
18924 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
18925 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
18926 Remove decls.
18927 (x_mouse_leave): Declare only if WINDOWSNT.
18928 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
18929 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
18930 USE_X_TOOLKIT.
18931
1675728f
PE
18932 * ftxfont.c: Make symbols static if they're not exported.
18933 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
18934 HAVE_FREETYPE.
18935 * font.h (ftxfont_driver): Likewise.
18936
e4cebfca
PE
18937 * xfns.c: Make symbols static if they're not exported.
18938 (x_last_font_name, x_display_info_for_name):
18939 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
18940 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
18941 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
18942 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
18943 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
18944 (last_show_tip_args): Now static.
18945 (xic_defaut_fontset, xic_create_fontsetname): Define only if
18946 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
18947 (x_screen_planes): Remove; unused.
18948 * dispextern.h (x_screen_planes): Remove decl.
18949
5bf46f05
PE
18950 * dispnew.c: Make symbols static if they're not exported.
18951 * dispextern.h (redraw_garbaged_frames, scrolling):
18952 (increment_row_positions): Remove.
18953 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
18954 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
18955 Now static.
18956 (redraw_garbaged_frames): Remove; unused.
18957
435f4c28
PE
18958 * xfaces.c: Make symbols static if they're not exported.
18959 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
18960 Remove decls.
18961 * xterm.h (defined_color): Remove decls.
18962 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
18963 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
18964 (menu_face_changed_default, defined_color, free_realized_face):
18965 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
18966 (ascii_face_of_lisp_face): Remove; unused.
18967
8524aef3
PE
18968 * xdisp.c: Make symbols static if they're not exported.
18969 * dispextern.h (scratch_glyph_row, window_box_edges):
18970 (glyph_to_pixel_coords, set_cursor_from_row):
18971 (get_next_display_element, set_iterator_to_next):
18972 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
18973 (show_mouse_face): Remove decls
18974 * frame.h (message_buf_print): Likewise.
18975 * lisp.h (pop_message, set_message, check_point_in_composition):
18976 Likewise.
18977 * xterm.h (set_vertical_scroll_bar): Likewise.
18978 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
18979 (message_buf_print, scratch_glyph_row, displayed_buffer):
18980 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
18981 (get_next_display_element, show_mouse_face, window_box_edges):
18982 (frame_to_window_pixel_xy, check_point_in_composition):
18983 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
18984 (glyph_to_pixel_coords): Remove; unused.
18985
16390cd2
PE
18986 * dired.c (file_name_completion): Now static.
18987
18988 * dbusbind.c (xd_in_read_queued_messages): Now static.
18989
a25f4dfa
PE
18990 * lisp.h (circular_list_error, FOREACH): Remove; unused.
18991 * data.c (circular_list_error): Remove.
18992
14a9c8df
PE
18993 * commands.h (last_point_position, last_point_position_buffer):
18994 (last_point_position_window): Remove decls.
18995 * keyboard.c: Make these variables static.
18996
04f2d78b
CB
18997 * coding.h (coding, code_convert_region, encode_coding_gap):
18998 Remove decls.
74ab6df5
PE
18999 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
19000 (iso_code_class, detect_coding, code_convert_region): Now static.
19001 (encode_coding_gap): Remove; unused.
19002
38dfbee1
PE
19003 * chartab.c (chartab_chars, chartab_bits): Now static.
19004
a2cb4e63
PE
19005 * charset.h (charset_iso_8859_1): Remove decl.
19006 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
19007 Now static.
19008
127198fd
PE
19009 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
19010 * ccl.c (Vccl_program_table): Now static.
19011 (check_ccl_update): Remove; unused.
19012
d85b608f
PE
19013 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
19014 * category.h: ... from here.
19015 * category.c (check_category_table, set_category_set): Now static.
19016
31cd66f3
PE
19017 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
19018 * lisp.h: Remove these decls.
19019
c358e587
PE
19020 * buffer.c (buffer_count): Remove unused var.
19021
e78aecca
PE
19022 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
19023 so that it's not optimized away.
19024 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
19025 * dispextern.h (bidi_dump_cached_states): Remove, since it's
19026 exported only to the debugger.
19027
e192d7d3 19028 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 19029 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 19030
92470028
PE
19031 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
19032 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
19033 was inaccessible from Lisp.
19034 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
19035 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
19036
244ed907
PE
19037 alloc.c: Import and export fewer symbols, and remove unused items.
19038 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
19039 is defined.
19040 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
19041 it's not optimized away by whole-program optimization.
19042 (message_enable_multibyte, free_misc): Remove.
19043 (catchlist, handlerlist, mark_backtrace):
19044 Declare only if BYTE_MARK_STACK.
19045 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
19046 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
19047 (message_enable_multibyte): Remove decl.
19048 (free_misc, interval_free_list, float_block, float_block_index):
19049 (n_float_blocks, float_free_list, cons_block, cons_block_index):
19050 (cons_free_list, last_marked_index):
19051 Now static.
19052 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
19053 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
19054 (mark_backtrace): Define only if BYTE_MARK_STACK.
19055 * xdisp.c (message_enable_multibyte): Now static.
19056
61c2b50e 19057 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
19058 This makes it easier for human readers (and static analyzers)
19059 to see whether these variables are used from other modules.
19060 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
19061 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
19062 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
19063 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
19064 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
19065 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
19066 * xmenu.c, xselect.c:
19067 Declare Q* vars static if they are not used in other modules.
19068 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
19069 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
19070 Remove decls of unexported vars.
19071 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
19072
95c82688
PE
19073 * lisp.h (DEFINE_FUNC): Make sname 'static'.
19074
16a97296
PE
19075 Make Emacs functions such as Fatom 'static' by default.
19076 This makes it easier for human readers (and static analyzers)
19077 to see whether these functions can be called from other modules.
19078 DEFUN now defines a static function. To make the function external
19079 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
19080 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
19081 (Finit_image_library):
16a97296
PE
19082 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
19083 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
19084 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
19085 Remove decls, since these functions are now static.
19086 (Funintern, Fget_internal_run_time): New decls, since these functions
19087 were already external.
95c82688 19088
16a97296
PE
19089 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
19090 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
19091 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
19092 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
19093 * keyboard.c, keymap.c, lread.c:
19094 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
19095 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
19096 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
19097 Mark functions with DEFUE instead of DEFUN,
19098 if they are used in other modules.
19099 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
19100 decls for now-static functions.
19101 * buffer.h (Fdelete_overlay): Remove decl.
19102 * callproc.c (Fgetenv_internal): Mark as internal.
19103 * composite.c (Fremove_list_of_text_properties): Remove decl.
19104 (Fcomposition_get_gstring): New forward static decl.
19105 * composite.h (Fcomposite_get_gstring): Remove decl.
19106 * dired.c (Ffile_attributes): New forward static decl.
19107 * doc.c (Fdocumntation_property): New forward static decl.
19108 * eval.c (Ffetch_bytecode): New forward static decl.
19109 (Funintern): Remove extern decl; now in .h file where it belongs.
19110 * fileio.c (Fmake_symbolic_link): New forward static decl.
19111 * image.c (Finit_image_library): New forward static decl.
19112 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
19113 * intervals.h (Fprevious_property_change):
19114 (Fremove_list_of_text_properties): Remove decls.
19115 * keyboard.c (Fthis_command_keys): Remove decl.
19116 (Fcommand_execute): New forward static decl.
19117 * keymap.c (Flookup_key): New forward static decl.
19118 (Fcopy_keymap): Now static.
19119 * keymap.h (Flookup_key): Remove decl.
19120 * process.c (Fget_process): New forward static decl.
19121 (Fprocess_datagram_address): Mark as internal.
19122 * syntax.c (Fsyntax_table_p): New forward static decl.
19123 (skip_chars): Remove duplicate decl.
19124 * textprop.c (Fprevious_property_change): New forward static decl.
19125 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
19126 Now internal.
19127 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
19128 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
19129
785bbd42
PE
19130 * editfns.c (Fformat): Remove unreachable code.
19131
8b913b57
AS
191322011-04-14 Andreas Schwab <schwab@linux-m68k.org>
19133
19134 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
19135 change. (Bug#8496)
19136
a6744a35
EZ
191372011-04-13 Eli Zaretskii <eliz@gnu.org>
19138
19139 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
19140 when at ZV. (Bug#8487)
19141
e7974947
AS
191422011-04-12 Andreas Schwab <schwab@linux-m68k.org>
19143
baad03f0
AS
19144 * charset.c (Fclear_charset_maps): Use xfree instead of free.
19145 (Bug#8437)
19146 * keyboard.c (parse_tool_bar_item): Likewise.
19147 * sound.c (sound_cleanup, alsa_close): Likewise.
19148 * termcap.c (tgetent): Likewise.
19149 * xfns.c (x_default_font_parameter): Likewise.
19150 * xsettings.c (read_and_apply_settings): Likewise.
19151
e7974947
AS
19152 * alloc.c (overrun_check_malloc, overrun_check_realloc)
19153 (overrun_check_free): Protoize.
19154
28272684
PE
191552011-04-12 Paul Eggert <eggert@cs.ucla.edu>
19156
19157 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
19158 since callers should never pass a negative size.
19159 Change the signature to match that of plain 'read' and 'write'; see
19160 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
19161 * lisp.h: Update prototypes of emacs_write and emacs_read.
19162
11997c76
EZ
191632011-04-11 Eli Zaretskii <eliz@gnu.org>
19164
19165 * xdisp.c (redisplay_window): Don't try to determine the character
19166 position of the scroll margin if the window start point w->startp
e896f03c 19167 is outside the buffer's accessible region. (Bug#8468)
11997c76 19168
8a2cbd72
EZ
191692011-04-10 Eli Zaretskii <eliz@gnu.org>
19170
19171 Fix write-region and its subroutines for buffers > 2GB.
19172 * fileio.c (a_write, e_write): Modify declaration of arguments and
19173 local variables to support buffers larger than 2GB.
19174 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
19175
19176 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
19177 argument, local variables, and return value.
19178
19179 * lisp.h: Update prototypes of emacs_write and emacs_read.
19180
19181 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
19182
4073e537 191832011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 19184
1ebfdcb6
PE
19185 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
19186
b2ded58d
PE
19187 Fix more problems found by GCC 4.6.0's static checks.
19188
7d66342c
PE
19189 * xdisp.c (vmessage): Use a better test for character truncation.
19190
bbf47d44
PE
19191 * charset.c (load_charset_map): <, not <=, for optimization,
19192 and to avoid potential problems with integer overflow.
9248994d 19193 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 19194 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 19195 * editfns.c (Fformat): Likewise.
1e69125e 19196 * syntax.c (skip_chars): Likewise.
3befa583 19197
e3019616
PE
19198 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
19199 This also lets GCC 4.6.0 generate slightly better loop code.
19200
becfa255
PE
19201 * callint.c (Fcall_interactively): <, not <=, for optimization.
19202 (Fcall_interactively): Count the number of arguments produced,
19203 not the number of arguments given. This is simpler and lets GCC
19204 4.6.0 generate slightly better code.
19205
dae0cd48
PE
19206 * ftfont.c: Distingish more carefully between FcChar8 and char.
19207 The previous code passed unsigned char * to a functions like
19208 strlen and xstrcasecmp that expect char *, which does not
19209 conform to the C standard.
19210 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
19211 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
19212 char * when the C standard requires it.
19213
76032d70
PE
19214 * keyboard.c (read_char): Remove unused var.
19215
eb3f1cc8
PE
19216 * eval.c: Port to Windows vsnprintf (Bug#8435).
19217 Include <limits.h>.
19218 (SIZE_MAX): Define if the headers do not.
19219 (verror): Do not give up if vsnprintf returns a negative count.
19220 Instead, grow the buffer. This ports to Windows vsnprintf, which
19221 does not conform to C99. Problem reported by Eli Zaretskii.
19222 Also, simplify the allocation scheme, by avoiding the need for
19223 calling realloc, and removing the ALLOCATED variable.
19224
70476b54
PE
19225 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
19226
12020a9e
PE
19227 Remove invocations of doprnt, as Emacs now uses vsnprintf.
19228 But keep the doprint source code for now, as we might revamp it
19229 and use it again (Bug#8435).
ea6c7ae6
PE
19230 * lisp.h (doprnt): Remove.
19231 * Makefile.in (base_obj): Remove doprnt.o.
19232 * deps.mk (doprnt.o): Remove.
19233
5fdb398c
PE
19234 error: Print 32- and 64-bit integers portably (Bug#8435).
19235 Without this change, on typical 64-bit hosts error ("...%d...", N)
19236 was used to print both 32- and 64-bit integers N, which relied on
19237 undefined behavior.
61bdb816 19238 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
19239 * lisp.h (error, verror): Mark as printf-like functions.
19240 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
19241 Report overflow in size calculations when allocating printf buffer.
19242 Do not truncate output string at its first null byte.
19243 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
19244 Truncate the output at a character boundary, since vsnprintf does not
19245 do that.
19246 * charset.c (check_iso_charset_parameter): Convert internal
19247 character to string before calling 'error', since %c now has the
19248 printf meaning.
19249 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
19250 overflow when computing char to be passed to 'error'. Do not
19251 pass Lisp_Object to 'error'; pass the integer instead.
19252 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
19253 formatted with plain %d.
19254
b189fa66
PE
19255 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
19256
bff87ef0
PE
19257 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
19258
7e2cac20
PE
19259 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
19260
ce4d90b5
PE
19261 * xterm.c (x_catch_errors): Remove duplicate declaration.
19262
266c9547
PE
19263 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
19264
79c49ad2
PE
19265 * xdisp.c, lisp.h (message_nolog): Remove; unused.
19266
368f4090
JM
192672011-04-10 Jim Meyering <meyering@redhat.com>
19268
19269 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
19270 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
19271 return ssize_t not "int", and use size_t as the buffer length.
19272 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
19273 * gnutls.h: Update declarations.
19274 * process.c (read_process_output): Use ssize_t, to match.
19275 (send_process): Likewise.
19276
a32d4040
CY
192772011-04-09 Chong Yidong <cyd@stupidchicken.com>
19278
19279 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
19280
8546720e 192812011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 19282
04f2d78b
CB
19283 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
19284 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 19285
8546720e
GM
19286 * xterm.c (handle_one_xevent):
19287 * xmenu.c (create_and_show_popup_menu):
19288 * xselect.c (x_decline_selection_request)
19289 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 19290
0a2f5c1a 192912011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
19292
19293 Fix some uses of `int' instead of EMACS_INT.
19294 * search.c (string_match_1, fast_string_match)
19295 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
19296 (scan_buffer, find_next_newline_no_quit)
19297 (find_before_next_newline, search_command, Freplace_match)
19298 (Fmatch_data): Make some `int' variables be EMACS_INT.
19299
19300 * xdisp.c (display_count_lines): 3rd argument and return value now
19301 EMACS_INT. All callers changed.
19302 (pint2hrstr): Last argument is now EMACS_INT.
19303
19304 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
19305 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
19306 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
19307 (decode_coding_utf_16, decode_coding_emacs_mule)
19308 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
19309 (decode_coding_ccl, decode_coding_charset)
19310 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
19311 (decode_coding_iso_2022, decode_coding_emacs_mule)
19312 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
19313 <char_offset, last_offset>: Declare EMACS_INT.
19314 (encode_coding_utf_8, encode_coding_utf_16)
19315 (encode_coding_emacs_mule, encode_invocation_designation)
19316 (encode_designation_at_bol, encode_coding_iso_2022)
19317 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
19318 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
19319 Declare EMACS_INT.
19320 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
19321 (encode_invocation_designation): Last argument P_NCHARS is now
19322 EMACS_INT.
19323 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
19324 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
19325
19326 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
19327 All users changed.
19328
19329 * ccl.c (Fccl_execute_on_string): Declare some variables
19330 EMACS_INT.
19331
8546720e 193322011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
19333
19334 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
19335
4e19a977
CS
193362011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
19337
19338 * process.c (Fformat_network_address): Doc fix.
19339
87302331
R
193402011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
19341
ee7683eb 19342 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 19343
cbb59342
CY
193442011-04-08 Chong Yidong <cyd@stupidchicken.com>
19345
19346 * keyboard.c (read_char): Call Lisp function help-form-show,
19347 instead of using internal_with_output_to_temp_buffer.
19348 (Qhelp_form_show): New var.
e0d38eeb 19349 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
19350
19351 * print.c (internal_with_output_to_temp_buffer): Function deleted.
19352
19353 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
19354
e67a13ab
CY
193552011-04-06 Chong Yidong <cyd@stupidchicken.com>
19356
04f2d78b
CB
19357 * process.c (Flist_processes): Remove to Lisp.
19358 (list_processes_1): Delete.
e67a13ab 19359
973f782d
EZ
193602011-04-06 Eli Zaretskii <eliz@gnu.org>
19361
7c106b1e
EZ
19362 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
19363
973f782d
EZ
19364 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
19365
41cf7d1a 193662011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 19367
ca23cc88
PE
19368 Fix more problems found by GCC 4.6.0's static checks.
19369
f390e2d5
PE
19370 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
19371
42eea0d0
PE
19372 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
19373
b69769da 19374 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 19375
f9541e84
PE
19376 * xdisp.c (vmessage): Mark as a printf-like function.
19377
13841b55
PE
19378 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
19379
c136c10f
PE
19380 * sound.c (sound_warning): Don't crash if arg contains a printf format.
19381
5e2d4a30
PE
19382 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
19383 printf-like functions.
19384 (tiff_load): Add casts to remove these marks before passing them
19385 to system-supplied API.
19386
583f48b9
PE
19387 * eval.c (Fsignal): Remove excess argument to 'fatal'.
19388
b25d760e
PE
19389 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
19390 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
19391 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
19392 directly, rather than having caller test rule sign. This avoids
19393 some unnecessary tests.
19394 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
19395 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
19396 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 19397
bc7b6697 19398 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 19399 (xfont_open): Avoid unnecessary tests.
bc7b6697 19400
27ccc379
PE
19401 * composite.c (composition_gstring_put_cache): Use unsigned integer.
19402
dcd5c89a
PE
19403 * composite.h, composite.c (composition_gstring_put_cache):
19404 Use EMACS_INT, not int, for length.
19405
b13a45c6
PE
19406 * composite.h (COMPOSITION_DECODE_REFS): New macro,
19407 breaking out part of COMPOSITION_DECODE_RULE.
19408 (COMPOSITION_DECODE_RULE): Use it.
19409 * composite.c (get_composition_id): Remove unused local vars,
19410 by using the new macro.
19411
1e792e4d
PE
19412 * textprop.c (set_text_properties_1): Change while to do-while,
19413 since the condition is always true at first.
19414
dc6c6455 19415 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
19416 (interval_deletion_adjustment): Return unsigned value.
19417 All uses changed.
dc6c6455 19418
aba7731a
PE
19419 * process.c (list_processes_1, create_pty, read_process_output):
19420 (exec_sentinel): Remove vars that were set but not used.
afd4052b 19421 (create_pty): Remove unnecessary "volatile"s.
bc57d757 19422 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 19423 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 19424 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 19425
fdfc4bf3
PE
19426 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
19427
fca8fe46 19428 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 19429 (update_syntax_table): Use unsigned instead of int.
fca8fe46 19430
06a0259a 19431 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 19432 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 19433 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 19434
e7b9e80f
PE
19435 * print.c (print_error_message): Avoid int overflow.
19436
56201685
PE
19437 * font.c (font_list_entities): Redo for clarity,
19438 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
19439
78834453 19440 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 19441 (font_score): Avoid potential overflow in diff calculation.
78834453 19442
0bc0b309 19443 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 19444 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 19445
e610eaca
PE
19446 * eval.c (funcall_lambda): Rename local to avoid shadowing.
19447
b895abce
PE
19448 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
19449 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
19450 can always succeed if overflow has undefined behavior.
19451
1f1d9321 19452 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 19453 (wordify): Omit three unnecessary tests.
1f1d9321 19454
c59478bc
PE
19455 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
19456 All callers changed. This avoids the need for an unused var.
19457
79b73827
PE
19458 * casefiddle.c (casify_region): Remove var that is set but not used.
19459
a4db5dfe
PE
19460 * dired.c (file_name_completion): Remove var that is set but not used.
19461
43aae36e
PE
19462 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
19463
2a47c44d 19464 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 19465 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 19466
a37c69bf
PE
19467 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
19468 Check for integer overflow on size calculations.
19469
328ab8e7
PE
19470 * buffer.c (Fprevious_overlay_change): Remove var that is set
19471 but not used.
19472
e5a2a5cb
PE
19473 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
19474 Remove vars that are set but not used.
8d84a6eb 19475 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 19476 (timer_check_2): Mark vars as initialized.
e5a2a5cb 19477
a60e5f68
PE
19478 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
19479
f661cb61 19480 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 19481 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 19482
f0397f5a
PE
19483 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
19484 that are set but not used.
19485
8664db06 19486 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 19487 if XCreateBitmapFromData fails (Bug#8410).
8664db06 19488
6abdaa4a
PE
19489 * xselect.c (x_get_local_selection, x_handle_property_notify):
19490 Remove vars that are set but not used.
19491
0ce7538d 19492 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 19493 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 19494
9ae848fc
PE
19495 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
19496 Remove var that is set but not used.
0b918413
PE
19497 (scroll_bar_windows_size): Now size_t, not int.
19498 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
19499 Check for overflow.
9ae848fc 19500
a5a62657
PE
19501 * xfaces.c (realize_named_face): Remove vars that are set but not used.
19502 (map_tty_color) [!defined MSDOS]: Likewise.
19503
5c5cdd39
PE
19504 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
19505
66ebf983
PE
19506 * coding.c: Remove vars that are set but not used.
19507 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
19508 All callers changed.
19509 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
19510 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
19511 (decode_coding_charset): Remove vars that are set but not used.
19512
1be4d761
PE
19513 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
19514 that is set but not used.
19515
47553fa8
PE
19516 * print.c (print_object): Remove var that is set but not used.
19517
1f7196bf 19518 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
19519 The gnulib version avoids calling malloc in the usual case,
19520 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
19521 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
19522 * filelock.c (current_lock_owner): Likewise.
19523 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
19524 * sysdep.c: Include allocator.h, careadlinkat.h.
19525 (emacs_no_realloc_allocator): New static constant.
19526 (emacs_readlink): New function.
fdb61804
PE
19527 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
19528 ../lib/careadlinkat.h.
d1fdcab7 19529
f84c17c7
SM
195302011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
19531
19532 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
19533 first non-nil return value).
19534
ef3862ad
JD
195352011-04-03 Jan Djärv <jan.h.d@swipnet.se>
19536
19537 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
19538 if not defined (Bug#8403).
19539
376a7006
JB
195402011-04-02 Juanma Barranquero <lekktu@gmail.com>
19541
19542 * xdisp.c (display_count_lines): Remove parameter `start',
19543 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19544 (get_char_face_and_encoding): Remove parameter `multibyte_p',
19545 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19546 (fill_stretch_glyph_string): Remove parameters `row' and `area',
19547 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
19548 and thereabouts. All callers changed.
19549 (get_per_char_metric): Remove parameter `f', unused since
19550 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
19551
6ca3801d
JM
195522011-04-02 Jim Meyering <meyering@redhat.com>
19553
19554 do not dereference NULL upon failed strdup
19555 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
19556 (ns_get_family): Likewise.
19557
d8e2b5ba
JB
195582011-04-02 Juanma Barranquero <lekktu@gmail.com>
19559
19560 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
19561
8c74fcbd
JD
195622011-04-02 Jan Djärv <jan.h.d@swipnet.se>
19563
19564 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
19565 later (Bug#8403).
19566
7200d79c
SM
195672011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
19568
03408648 19569 Add lexical binding.
7200d79c 19570
03408648
SM
19571 * window.c (Ftemp_output_buffer_show): New fun.
19572 (Fsave_window_excursion):
19573 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
19574
19575 * lread.c (lisp_file_lexically_bound_p): New function.
19576 (Fload): Bind Qlexical_binding.
19577 (readevalloop): Remove `evalfun' arg.
19578 Bind Qinternal_interpreter_environment.
19579 (Feval_buffer): Bind Qlexical_binding.
19580 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
19581 Mark as dynamic.
19582 (syms_of_lread): Declare `lexical-binding'.
19583
19584 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
19585
19586 * keyboard.c (eval_dyn): New fun.
19587 (menu_item_eval_property): Use it.
ca105506
SM
19588
19589 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 19590
03408648
SM
19591 * fns.c (concat, mapcar1): Accept byte-code-functions.
19592
19593 * eval.c (Fsetq): Handle lexical vars.
19594 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
19595 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
19596 (FletX, Flet): Obey lexical binding.
19597 (Fcommandp): Handle closures.
19598 (Feval): New `lexical' arg.
19599 (eval_sub): New function extracted from Feval. Use it almost
19600 everywhere where Feval was used. Look up vars in lexical env.
19601 Handle closures.
19602 (Ffunctionp): Move from subr.el.
19603 (Ffuncall): Handle closures.
19604 (apply_lambda): Remove `eval_flags'.
19605 (funcall_lambda): Handle closures and new byte-code-functions.
19606 (Fspecial_variable_p): New function.
19607 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
19608 but without exporting it to Lisp.
23aba0ea 19609
23aba0ea 19610 * doc.c (Fdocumentation, store_function_docstring):
03408648 19611 * data.c (Finteractive_form): Handle closures.
23aba0ea 19612
03408648
SM
19613 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
19614 interactive spec.
ba83908c 19615
04f2d78b
CB
19616 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
19617 New byte-codes.
03408648
SM
19618 (exec_byte_code): New function extracted from Fbyte_code to handle new
19619 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 19620
03408648 19621 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 19622
03408648 19623 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 19624
e2abce01
JB
196252011-03-31 Juanma Barranquero <lekktu@gmail.com>
19626
19627 * xdisp.c (redisplay_internal): Fix prototype.
19628
63696a73 196292011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 19630
63696a73 19631 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
19632 (try_scrolling): Use it when setting scroll_limit.
19633 Limit scrolling to 100 screen lines.
63696a73
EZ
19634 (redisplay_window): Even when falling back on "recentering",
19635 position point in the window according to scroll-conservatively,
19636 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
19637
19638 (try_scrolling): When point is above the window, allow searching
19639 as far as scroll_max, or one screenful, to compute vertical
19640 distance from PT to the scroll margin position. This prevents
19641 try_scrolling from unnecessarily failing when
19642 scroll-conservatively is set to a value slightly larger than the
19643 window height. Clean up the case of PT below the margin at bottom
19644 of window: scroll_max can no longer be INT_MAX. When aggressive
19645 scrolling is in use, don't let point enter the opposite scroll
19646 margin as result of the scroll.
19647 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
19648 threshold of 100 lines for never-recentering scrolling.
19649
e4cc2dfc
JB
196502011-03-31 Juanma Barranquero <lekktu@gmail.com>
19651
19652 * dispextern.h (move_it_by_lines):
19653 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
19654 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
19655 (message_log_check_duplicate): Remove parameters `prev_bol' and
19656 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
19657 (redisplay_internal): Remove parameter `preserve_echo_area',
19658 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
19659
19660 * indent.c (Fvertical_motion):
19661 * window.c (window_scroll_pixel_based, Frecenter):
19662 Don't pass `need_y_p' to `move_it_by_lines'.
19663
1c470562
SM
196642011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
19665
44f230aa
SM
19666 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
19667 steal a few bits to be more compact.
19668 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
19669 Remove unneeded casts.
19670
1c470562
SM
19671 * bytecode.c (Fbyte_code): CAR and CDR can GC.
19672
888adce9
ZK
196732011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
19674
19675 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
19676 binding" message (bug#7967).
19677
f838ed7b
PE
196782011-03-30 Paul Eggert <eggert@cs.ucla.edu>
19679
77861b95
PE
19680 Fix more problems found by GCC 4.6.0's static checks.
19681
de6dbc14
PE
19682 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
19683 Remove unused local var.
19684
f838ed7b
PE
19685 * editfns.c (Fmessage_box): Remove unused local var.
19686
792c7b2b
PE
19687 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
19688 (note_mode_line_or_margin_highlight, note_mouse_highlight):
19689 Omit unused local vars.
c499e557 19690 * window.c (shrink_windows): Omit unused local var.
b01a1c29 19691 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
19692 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
19693 Omit unused local var.
19694
ba0165e1
PE
19695 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
19696 Don't assume string length fits in int.
32ad8845 19697 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 19698 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 19699
3c59b4c9
PE
19700 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
19701 instead of alloca (Bug#8344).
19702
a3eed478 19703 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 19704 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 19705
eb4d412d
PE
19706 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
19707
1658b401
PE
19708 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
19709 concerns.
19710
19711 * term.c (produce_glyphless_glyph): Remove unnecessary test.
19712
19713 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 19714
9a2c6e05
PE
19715 * keyboard.c (syms_of_keyboard): Use the same style as later
19716 in this function when indexing through an array. This also
19717 works around GCC bug 48267.
19718
03d0a109
PE
19719 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
19720
44f730c8
PE
19721 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
19722
fe75f926
PE
19723 * chartab.c (sub_char_table_ref_and_range): Redo for slight
19724 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
19725
ffa8c828
PE
19726 * keyboard.c, keyboard.h (num_input_events): Now size_t.
19727 This avoids undefined behavior on integer overflow, and is a bit
19728 more convenient anyway since it is compared to a size_t variable.
19729
c5101a77
PE
19730 Variadic C functions now count arguments with size_t, not int.
19731 This avoids an unnecessary limitation on 64-bit machines, which
19732 caused (substring ...) to crash on large vectors (Bug#8344).
19733 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
19734 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 19735 All variadic functions and their callers changed accordingly.
c5101a77
PE
19736 (struct gcpro.nvars): Now size_t, not int. All uses changed.
19737 * data.c (arith_driver, float_arith_driver): Likewise.
19738 * editfns.c (general_insert_function): Likewise.
19739 * eval.c (struct backtrace.nargs, interactive_p)
19740 (internal_condition_case_n, run_hook_with_args, apply_lambda)
19741 (funcall_lambda, mark_backtrace): Likewise.
19742 * fns.c (concat): Likewise.
19743 * frame.c (x_set_frame_parameters): Likewise.
19744 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
19745 0 if not found, not -1. All callers changed.
19746
dd3f25f7
PE
19747 * alloc.c (garbage_collect): Don't assume stack size fits in int.
19748 (stack_copy_size): Now size_t, not int.
19749 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
19750
461c2ab9
JB
197512011-03-28 Juanma Barranquero <lekktu@gmail.com>
19752
19753 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
19754 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19755 All callers changed.
19756
19757 * lisp.h (multibyte_char_to_unibyte):
19758 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
19759 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
19760 * character.h (CHAR_TO_BYTE8):
19761 * cmds.c (internal_self_insert):
19762 * editfns.c (general_insert_function):
19763 * keymap.c (push_key_description):
19764 * search.c (Freplace_match):
19765 * xdisp.c (message_dolog, set_message_1): All callers changed.
19766
f6d62986
SM
197672011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
19768
19769 * keyboard.c (safe_run_hook_funcall): New function.
19770 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
19771 don't set the hook to nil, but remove the offending function instead.
19772 (Qcommand_hook_internal): Remove, unused.
19773 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
19774 Vcommand_hook_internal.
19775
19776 * eval.c (enum run_hooks_condition): Remove.
19777 (funcall_nil, funcall_not): New functions.
19778 (run_hook_with_args): Call each function through a `funcall' argument.
19779 Remove `cond' argument, now redundant.
19780 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
19781 (Frun_hook_with_args_until_failure): Adjust accordingly.
19782 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
19783
1db5b1ad
JB
197842011-03-28 Juanma Barranquero <lekktu@gmail.com>
19785
19786 * dispextern.h (string_buffer_position): Remove declaration.
19787
19788 * print.c (strout): Remove parameter `multibyte', unused since
19789 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
19790
19791 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
19792 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
19793 All callers changed.
19794
19795 * w32.c (_wsa_errlist): Use braces for struct initializers.
19796
19797 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
19798 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
19799 All callers changed.
19800 (string_buffer_position): Likewise. Also, make static (it's never
19801 used outside xdisp.c).
19802 (cursor_row_p): Remove parameter `w', unused since
19803 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
19804 (decode_mode_spec): Remove parameter `precision', introduced during
19805 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
19806 All callers changed.
19807
5ffb62aa
JD
198082011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19809
19810 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
19811
461c2ab9 198122011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
19813
19814 * nsterm.m (ns_menu_bar_is_hidden): New variable.
19815 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
19816 (ns_update_auto_hide_menu_bar): New functions.
19817 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
19818 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
19819 ns_constrain_all_frames.
19820 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
19821 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
19822
5c380ffb
JD
198232011-03-27 Jan Djärv <jan.h.d@swipnet.se>
19824
19825 * nsmenu.m (runDialogAt): Remove argument to timer_check.
19826
9af30bdf
GM
198272011-03-27 Glenn Morris <rgm@gnu.org>
19828
19829 * syssignal.h: Replace RETSIGTYPE with void.
19830 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
19831 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
19832 Replace SIGTYPE with void everywhere.
19833 * s/usg5-4-common.h (SIGTYPE): Remove definition.
19834 * s/template.h (SIGTYPE): Remove commented out definition.
19835
e2abce01
JB
198362011-03-26 Eli Zaretskii <eliz@gnu.org>
19837
19838 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
19839 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
19840
f868cd8a
JB
198412011-03-26 Juanma Barranquero <lekktu@gmail.com>
19842
59eb0929
JB
19843 * w32.c (read_unc_volume): Use parameter `henum', instead of
19844 global variable `wget_enum_handle'.
19845
19846 * keymap.c (describe_vector): Remove parameters `indices' and
19847 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
19848 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
19849
f868cd8a
JB
19850 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
19851
19852 * keyboard.c (timer_check): Remove parameter `do_it_now',
19853 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
19854 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
19855 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
19856
19857 * keyboard.c (read_char):
19858 * w32menu.c (w32_menu_display_help):
19859 * xmenu.c (show_help_event, menu_help_callback):
19860 Adjust calls to `show_help_echo'.
19861
19862 * gtkutil.c (xg_maybe_add_timer):
19863 * keyboard.c (readable_events):
19864 * process.c (wait_reading_process_output):
19865 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
19866
19867 * insdel.c (adjust_markers_gap_motion):
19868 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
19869 (gap_left, gap_right): Don't call it.
19870
2ecf6fdb
CY
198712011-03-25 Chong Yidong <cyd@stupidchicken.com>
19872
19873 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
19874 incurred during fontification.
19875
6b1f9ba4
JB
198762011-03-25 Juanma Barranquero <lekktu@gmail.com>
19877
19878 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
19879 (DEFVAR_PER_BUFFER): Don't pass it.
19880
19881 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
19882 (scrolling_window): Don't pass it.
19883
0f4a96b5
JB
198842011-03-25 Juanma Barranquero <lekktu@gmail.com>
19885
19886 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
19887
19888 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
19889 and `suffix'.
19890 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
19891 of variables specific to SELinux and computation of `encoded_absname'.
19892
19893 * image.c (XPutPixel): Remove unused variable `height'.
19894
19895 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
19896
19897 * unexw32.c (get_section_info): Remove unused variable `section'.
19898
19899 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
19900 (system_process_attributes): Remove unused variable `sess'.
19901 (sys_read): Remove unused variable `err'.
19902
19903 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
19904 (w32_wnd_proc): Remove unused variable `isdead'.
19905 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
19906 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
19907 (x_create_tip_frame): Remove unused variable `tem'.
19908
19909 * w32inevt.c (w32_console_read_socket):
19910 Remove unused variable `no_events'.
19911
19912 * w32term.c (x_draw_composite_glyph_string_foreground):
19913 Remove unused variable `width'.
19914
1149507c
JB
199152011-03-24 Juanma Barranquero <lekktu@gmail.com>
19916
19917 * w32term.c (x_set_glyph_string_clipping):
19918 Don't pass uninitialized region to CombineRgn.
19919
9c88f339
JB
199202011-03-23 Juanma Barranquero <lekktu@gmail.com>
19921
19922 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
19923 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
19924 (Fx_close_connection): Remove unused variable `i'.
19925
19926 * w32font.c (w32font_draw): Return number of glyphs.
19927 (w32font_open_internal): Remove unused variable `i'.
19928 (w32font_driver): Add missing initializer.
19929
19930 * w32menu.c (utf8to16): Remove unused variable `utf16'.
19931 (fill_in_menu): Remove unused variable `items_added'.
19932
19933 * w32term.c (last_mouse_press_frame): Remove static global variable.
19934 (w32_clip_to_row): Remove unused variable `f'.
19935 (x_delete_terminal): Remove unused variable `i'.
19936
19937 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
19938 (NOTHING): Remove unused static global variable.
19939 (uniscribe_check_otf): Remove unused variable `table'.
19940 (uniscribe_font_driver): Add missing initializers.
19941
dee091a3
JD
199422011-03-23 Julien Danjou <julien@danjou.info>
19943
19944 * term.c (Fsuspend_tty, Fresume_tty):
19945 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
19946 * window.c (temp_output_buffer_show):
19947 * insdel.c (signal_before_change):
19948 * frame.c (Fhandle_switch_frame):
19949 * fileio.c (Fdo_auto_save):
19950 * emacs.c (Fkill_emacs):
19951 * editfns.c (save_excursion_restore):
19952 * cmds.c (internal_self_insert):
19953 * callint.c (Fcall_interactively):
19954 * buffer.c (Fkill_all_local_variables):
19955 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
19956 Use Frun_hooks.
0f4a96b5 19957 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 19958 unconditionally since it does the check itself.
dee091a3 19959
2c520ab5 199602011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 19961
c9c49752
PE
19962 Fix more problems found by GCC 4.5.2's static checks.
19963
8abc3f12
PE
19964 * coding.c (encode_coding_raw_text): Avoid unnecessary test
19965 the first time through the loop, since we know p0 < p1 then.
19966 This also avoids a gcc -Wstrict-overflow warning.
19967
a2d26660
PE
19968 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
19969 leading to a memory leak, possible in functions like
19970 load_charset_map_from_file that can allocate an unbounded number
b12ef411 19971 of objects (Bug#8318).
a2d26660 19972
916c72e9
PE
19973 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
19974 that could (at least in theory) be that large.
19975
19ab8a18
PE
19976 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
19977 This is less likely to overflow, and avoids undefined behavior if
19978 overflow does occur. All callers changed. Use strtoul to scan
19979 for the unsigned long integer.
b7cbbd6f
PE
19980 (pint2hrstr): Simplify and tune code slightly.
19981 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 19982
f0641eff
PE
19983 * scroll.c (do_scrolling): Work around GCC bug 48228.
19984 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
19985
7f650bb9
PE
19986 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
19987 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
19988 (validate_x_resource_name): Simplify count usage.
19989 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 19990
37dd57d1
PE
19991 * fileio.c (Fcopy_file): Report error if fchown or fchmod
19992 fail (Bug#8306).
81e56e61 19993
699979fc 19994 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 19995
401bf9b4
PE
19996 * process.c (Fmake_network_process): Use socklen_t, not int,
19997 where POSIX says socklen_t is required in portable programs.
19998 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 19999 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
20000 (Fmake_network_process, server_accept_connection):
20001 (wait_reading_process_output, read_process_output):
20002 Likewise.
20003
b93aacde
PE
20004 * process.c: Rename or move locals to avoid shadowing.
20005 (list_processes_1, Fmake_network_process):
20006 (read_process_output_error_handler, exec_sentinel_error_handler):
20007 Rename or move locals.
4dc343ee 20008 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 20009 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 20010 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 20011 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 20012 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 20013
af8a867c 20014 Make tparam.h and terminfo.c consistent.
44f230aa
SM
20015 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
20016 Include tparam.h instead, since it declares them.
af8a867c
PE
20017 * cm.h (PC): Remove extern decl; tparam.h now does this.
20018 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
20019 * terminfo.c: Include tparam.h, to check interfaces.
20020 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
20021 (tparam): Adjust signature to match interface in tparam.h;
20022 this removes some undefined behavior. Check that outstring and len
20023 are zero, which they always are with Emacs.
20024 * tparam.h (PC, BC, UP): New extern decls.
20025
0248044d 20026 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 20027 (xftfont_open): Rename locals to avoid shadowing.
0248044d 20028
8ff096c1 20029 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
20030 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
20031 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 20032 (ftfont_list): Remove unused local.
49eaafba
PE
20033 (get_adstyle_property, ftfont_pattern_entity):
20034 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
20035 Rename locals to avoid shadowing.
8ff096c1 20036
e2be39f6
PE
20037 * xfont.c (xfont_list_family): Mark var as initialized.
20038
c9735e30
PE
20039 * xml.c (make_dom): Now static.
20040
8f5201ae
PE
20041 * composite.c (composition_compute_stop_pos): Rename local to
20042 avoid shadowing.
b246f932
PE
20043 (composition_reseat_it): Remove unused locals.
20044 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 20045 (composition_update_it): Mark var as initialized.
11b61122
PE
20046 (find_automatic_composition): Mark vars as initialized,
20047 with a FIXME (Bug#8290).
8f5201ae 20048
760fbc2c
PE
20049 character.h: Rename locals to avoid shadowing.
20050 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
20051 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
20052 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
20053 (BUF_DEC_POS): Be more systematic about renaming local temporaries
20054 to avoid shadowing.
20055
ff08eb85
PE
20056 * textprop.c (property_change_between_p): Remove; unused.
20057
fc7bf025
PE
20058 * intervals.c (interval_start_pos): Now static.
20059
235d7abc
PE
20060 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
20061
44f230aa
SM
20062 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
20063 Rename locals to avoid shadowing.
3e7d6594 20064
50060332
PE
20065 * sound.c (wav_play, au_play, Fplay_sound_internal):
20066 Fix pointer signedness.
d01f234b 20067 (alsa_choose_format): Remove unused local var.
c83b8872
PE
20068 (wav_play): Initialize a variable to 0, to prevent undefined
20069 behavior (Bug#8278).
50060332 20070
c4fc4e30
PE
20071 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
20072
918436ed
PE
20073 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
20074
c939f91b
PE
20075 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
20076 clobbering (Bug#8298).
b9c7f648
PE
20077 * sysdep.c (sys_subshell): Likewise.
20078 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 20079
6bd8c144
PE
20080 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
20081 This should get cleaned up, so that child_setup has the
20082 same signature on all platforms.
20083
7710357c 20084 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 20085 (relocate_fd): Rename locals to avoid shadowing.
7710357c 20086
c59da222
CY
200872011-03-22 Chong Yidong <cyd@stupidchicken.com>
20088
20089 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
20090 not to be necessary, and produces flickering.
20091
66b87493
GM
200922011-03-20 Glenn Morris <rgm@gnu.org>
20093
20094 * config.in: Remove file.
20095
45b6f6d5
JB
200962011-03-20 Juanma Barranquero <lekktu@gmail.com>
20097
20098 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
20099 are now in src/globals.h.
20100 (syms_of_minibuf): Remove spurious & from previous change.
20101
cd394be1 201022011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
20103
20104 * minibuf.c (completing-read-function): New variable.
20105 (completing-read-default): Rename from completing-read.
20106 (completing-read): Call completing-read-function.
20107
b14e3e21
CY
201082011-03-19 Juanma Barranquero <lekktu@gmail.com>
20109
20110 * xfaces.c (Fx_load_color_file):
20111 Read color file from absolute filename (bug#8250).
20112
f2b726e6
JB
201132011-03-19 Juanma Barranquero <lekktu@gmail.com>
20114
20115 * makefile.w32-in: Update dependencies.
20116
09f6ff02
EZ
201172011-03-17 Eli Zaretskii <eliz@gnu.org>
20118
20119 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
20120
29a6015a
PE
201212011-03-17 Paul Eggert <eggert@cs.ucla.edu>
20122
a3a6c54e
PE
20123 Fix more problems found by GCC 4.5.2's static checks.
20124
b766f867
PE
20125 * process.c (make_serial_process_unwind, send_process_trap):
20126 (sigchld_handler): Now static.
20127
be02381c
PE
20128 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
20129 That way, the code declares only the vars that it needs.
20130 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
20131 * s/cygwin.h (PTY_ITERATION): Likewise.
20132 * s/darwin.h (PTY_ITERATION): Likewise.
20133 * s/gnu-linux.h (PTY_ITERATION): Likewise.
20134
57048744
PE
20135 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
20136 * process.c (allocate_pty): Don't declare stb unless it's needed.
20137
7914961c 20138 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
20139 (CONSTANTLIM): Remove; unused.
20140 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
20141 Define only if needed.
7914961c 20142
b3967b18
PE
20143 * unexelf.c (unexec): Name an expression,
20144 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
20145 Use a different way to cause a compilation error if anyone uses
20146 n rather than nn, a way that does not involve shadowing.
73366a00 20147 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 20148
29a6015a
PE
20149 * deps.mk (unexalpha.o): Remove; unused.
20150
43cfc33e 20151 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 20152 * unexec.h: New file.
ce701a33
PE
20153 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
20154 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
20155 Depend on unexec.h.
20156 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
20157 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
20158 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 20159 Change as necessary to match prototype in unexec.h.
ce701a33 20160
01f44d5a
PE
20161 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
20162 shadowing.
4f63c6bb 20163 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 20164
a6670b0b
PE
20165 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
20166 Rename locals to avoid shadowing.
20167
cef2010d 20168 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 20169 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 20170
d4d7173a
PE
20171 * print.c (Fredirect_debugging_output): Fix pointer signedess.
20172
f08b802a
PE
20173 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
20174 warning when compiling print.c.
20175
3ddb0639
PE
20176 * font.c (font_unparse_fcname): Abort in an "impossible" situation
20177 instead of using an uninitialized var.
5ad03b97 20178 (font_sort_entities): Mark var as initialized.
3ddb0639 20179
170a2692
PE
20180 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
20181
e663c700
PE
20182 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
20183 pointers to constants.
89bc529a 20184 (font_parse_fcname): Remove unused vars.
7b81e2d0 20185 (font_delete_unmatched): Now static.
ea838e10 20186 (font_get_spec): Remove; unused.
13a547c6
PE
20187 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
20188 (font_update_drivers, Ffont_get_glyphs, font_add_log):
20189 Rename or move locals to avoid shadowing.
e663c700 20190
2a80c887 20191 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 20192 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 20193
1384fa33 20194 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 20195 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 20196
8b2c52e9
PE
20197 * alloc.c (mark_backtrace): Move decl from here ...
20198 * lisp.h: ... to here, so that it can be checked.
20199
475545b5 20200 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 20201 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
20202 (lisp_indirect_variable): Name an expression,
20203 to avoid gcc -Wbad-function-cast warning.
1faed8ae 20204 (Fdefvar): Rename locals to avoid shadowing.
475545b5 20205
b1349114 20206 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 20207 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 20208 Use const pointer when appropriate.
b1349114 20209
a2928364
PE
20210 * lisp.h (get_system_name, get_operating_system_release):
20211 Move decls here, to check interfaces.
20212 * process.c (get_operating_system_release): Move decl to lisp.h.
20213 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
20214 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
20215 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
20216 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
20217 (Fformat_time_string, Fencode_time, Finsert_char):
20218 (Ftranslate_region_internal, Fformat):
20219 Rename or remove local vars to avoid shadowing.
9710023e 20220 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 20221
a415e694
PE
20222 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
20223 avoid shadowing.
20224
8ef4622d
PE
20225 * lisp.h (eassert): Check that the argument compiles, even if
20226 ENABLE_CHECKING is not defined.
20227
946f9a5b
PE
20228 * data.c (Findirect_variable): Name an expression, to avoid
20229 gcc -Wbad-function-cast warning.
112396d6 20230 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 20231 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
20232 (Fmake_variable_buffer_local, Fmake_local_variable):
20233 Mark variables as initialized.
52746918 20234 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 20235
e5aab7e7 20236 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
20237 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
20238 Rename locals to avoid shadowing.
dff45157
PE
20239 (mark_stack): Move local variables into the #ifdef region where
20240 they're used.
7bc26fdb
PE
20241 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
20242 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
20243 needed otherwise.
20244 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
20245 (GC_STRING_CHARS): Remove; not used.
d40d4be1 20246 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 20247
e5aab7e7
PE
20248 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
20249 avoids undefined behavior in theory.
20250
4da60324
PE
20251 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
20252
88043301
PE
20253 Use functions, not macros, for up- and down-casing (Bug#8254).
20254 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20255 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
20256 to use the following functions instead of these macros.
20257 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
20258 EMACS_INT, since callers assume the returned value fits in int.
20259 (upcase1): Likewise, for UPCASE_TABLE.
20260 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 20261 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 20262 the race-condition problem in the old DOWNCASE.
88043301 20263
19ed5445
PE
20264 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
20265 Rename locals to avoid shadowing.
20266 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
20267 (regex_compile, re_search_2, re_match_2_internal):
20268 Remove unused local vars.
952db0d7
PE
20269 (FREE_VAR): Rewrite so as not to use empty "else",
20270 which gcc can warn about.
da053e48 20271 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
20272 (RETALLOC_IF): Define only if needed.
20273 (WORDCHAR_P): Likewise. This one is never needed, but is used
20274 only in a comment talking about a compiler bug, so put inside
20275 the #if 0 of that comment.
20276 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
20277 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
20278 Remove; unused.
19ed5445 20279
1f3561e4 20280 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
20281 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
20282 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 20283
ded6f8f7
PE
20284 * search.c (simple_search): Remove unused var.
20285
dbd37a95
PE
20286 * dired.c (compile_pattern): Move decl from here ...
20287 * lisp.h: ... to here, so that it can be checked.
20288 (struct re_registers): New forward decl.
20289
7e47afad
PE
20290 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
20291
85f24f61
PE
20292 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
20293 All uses changed.
20294 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
20295 Rename locals to avoid shadowing.
5671df8f 20296 (Fvertical_motion): Mark locals as initialized.
85f24f61 20297
181aa2be 20298 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 20299 (casify_region): Mark local as initialized.
181aa2be 20300
930d429c
PE
20301 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
20302
7082eac6
PE
20303 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
20304 New macros, so that the caller can use some names other than
20305 gcpro1, gcpro2, etc.
20306 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
20307 of the new macros.
20308 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
20309 argument, for consistency with GCPRO2_VAR, etc: it is now the
20310 prefix of the variable, not the variable itself. All uses
20311 changed.
38b2c076
PE
20312 * dired.c (directory_files_internal, file_name_completion):
20313 Rename locals to avoid shadowing.
20314
15206ed9
PE
20315 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
20316 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
20317 dired.c's scmp function, had undefined behavior.
20318 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
20319 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
20320 * buffer.h: ... to here, because these macros use current_buffer,
20321 and the new implementation with inline functions needs to have
20322 current_buffer in scope now, rather than later when the macros
20323 are used.
20324 (downcase, upcase1): New static inline functions.
20325 (DOWNCASE, UPCASE1): Reimplement using these functions.
20326 This avoids undefined behavior in expressions like
20327 DOWNCASE (x) == DOWNCASE (y), which previously suffered
20328 from race conditions in accessing the global variables
20329 case_temp1 and case_temp2.
20330 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
20331 * lisp.h (case_temp1, case_temp2): Remove their decls.
20332 * character.h (ASCII_CHAR_P): Move from here ...
20333 * lisp.h: ... to here, so that the inline functions mentioned
20334 above can use them.
20335
4a6bea26
PE
20336 * dired.c (directory_files_internal_unwind): Now static.
20337
f14b7e14
PE
20338 * fileio.c (file_name_as_directory, directory_file_name):
20339 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
20340 Now static.
2893f146
PE
20341 (file_name_as_directory): Use const pointers when appropriate.
20342 (Fexpand_file_name): Likewise. In particular, newdir might
20343 point at constant storage, so make it a const pointer.
fd4ead52 20344 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
20345 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
20346 signedness issues.
f839df0c
PE
20347 (Fset_file_times, Finsert_file_contents, auto_save_error):
20348 Rename locals to avoid shadowing.
f14b7e14 20349
5716756e 20350 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
20351 (Ftry_completion, Fall_completions): Rename or remove locals
20352 to avoid shadowing.
5716756e 20353
b4c3046a
PE
20354 * marker.c (bytepos_to_charpos): Remove; unused.
20355
b45db522
PE
20356 * lisp.h (verify_bytepos, count_markers): New decls,
20357 so that gcc does not warn that these functions aren't declared.
20358
85876d07
PE
20359 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
20360 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 20361 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 20362 (copy_text): Remove unused local var.
85876d07 20363
03d78a21 20364 * filelock.c (within_one_second): Now static.
b3dd38ab 20365 (lock_file_1): Rename local to avoid shadowing.
03d78a21 20366
5df8f01b
PE
20367 * buffer.c (fix_overlays_before): Mark locals as initialized.
20368 (fix_start_end_in_overlays): Likewise. This function should be
20369 simplified by using pointers-to-pointers, but that's a different
20370 matter.
b1d876f1 20371 (switch_to_buffer_1): Now static.
8f54f30a
PE
20372 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
20373 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 20374
a70072c9 20375 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 20376 Fix pointer signedness issue.
edced198
PE
20377 (sys_subshell): Mark local as volatile if checking for lint,
20378 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 20379 (MAXPATHLEN): Define only if needed.
a70072c9 20380
a0977c44
PE
20381 * process.c (serial_open, serial_configure): Move decls from here ...
20382 * systty.h: ... to here, so that they can be checked.
20383
a884fdcc
PE
20384 * fns.c (get_random, seed_random): Move extern decls from here ...
20385 * lisp.h: ... to here, so that they can be checked.
20386
604efe86 20387 * sysdep.c (reset_io): Now static.
b8950c94 20388 (wait_for_termination_signal): Remove; unused.
604efe86 20389
38fc62d9
PE
20390 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
20391 (copy_keymap_item, append_key, push_text_char_description):
20392 Now static.
1004a21a 20393 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 20394 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
20395 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
20396 (describe_map_tree):
20397 Rename locals to avoid shadowing.
38fc62d9 20398
2f2650da
PE
20399 * keyboard.c: Declare functions static if they are not used elsewhere.
20400 (echo_char, echo_dash, cmd_error, top_level_2):
20401 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
20402 (read_char, kbd_buffer_get_event, make_lispy_position):
20403 (make_lispy_event, make_lispy_movement, apply_modifiers):
20404 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
20405 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
20406 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 20407 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 20408 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 20409
a053e86c 20410 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
20411 (mark_kboards): Move decl here ...
20412 * alloc.c (mark_kboards): ... from here.
a053e86c 20413
4752793e
PE
20414 * lisp.h (force_auto_save_soon): New decl.
20415
74f10ca7 20416 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
20417 (DEFINE_DUMMY_FUNCTION): New macro.
20418 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
20419 Use it.
c03cd23f
PE
20420 (main): Add casts to avoid warnings
20421 if GCC considers string literals to be constants.
74f10ca7 20422
022e70d4
PE
20423 * lisp.h (fatal_error_signal): Add decl, since it's exported.
20424
59d6fe83
PE
20425 * dbusbind.c: Pointer signedness fixes.
20426 (xd_signature, xd_append_arg, xd_initialize):
20427 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20428 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20429 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
20430 (Fdbus_register_signal): Use SSDATA when the context wants char *.
20431
78320123
PE
20432 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
20433 if GCC considers string literals to be constants.
49cebcca 20434 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 20435
35ac2a97
SM
204362011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
20437
fb103ca9
SM
20438 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
20439 (print_preprocess, print_object): New macro to fix last change.
20440
35ac2a97
SM
20441 * print.c (print_preprocess): Don't forget font objects.
20442
62973b41
JB
204432011-03-16 Juanma Barranquero <lekktu@gmail.com>
20444
20445 * emacs.c (USAGE3): Doc fixes.
20446
0e48bb22
AS
204472011-03-15 Andreas Schwab <schwab@linux-m68k.org>
20448
20449 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
20450 structure.
20451
7684e57b
JB
204522011-03-14 Juanma Barranquero <lekktu@gmail.com>
20453
20454 * lisp.h (VWindow_system, Qfile_name_history):
20455 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
20456 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
20457 (w32_system_caret_x, w32_system_caret_y): Declare extern.
20458
20459 * w32select.c: Don't #include "keyboard.h".
c96bbc66 20460 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
20461
20462 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
20463 * w32console.c (detect_input_pending, read_input_pending)
20464 (encode_terminal_code):
20465 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
20466 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
20467 (w32_system_caret_y, Qfile_name_history):
20468 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
20469 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
20470 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
20471 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
20472 * w32proc.c (Qlocal, report_file_error):
20473 * w32term.c (Vwindow_system, updating_frame):
20474 * w32uniscribe.c (initialized, uniscribe_font_driver):
20475 Remove unneeded extern declarations.
20476
2aa46d6c
CY
204772011-03-14 Chong Yidong <cyd@stupidchicken.com>
20478
c96bbc66 20479 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 20480
cffc6f3b
CY
204812011-03-13 Chong Yidong <cyd@stupidchicken.com>
20482
20483 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
20484 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
20485 These macros can no longer be used for assignment.
20486
44f230aa
SM
20487 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
20488 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
20489 (record_buffer_markers, fetch_buffer_markers): New functions for
20490 recording and fetching special buffer markers.
20491 (set_buffer_internal_1, set_buffer_temp): Use them.
20492
20493 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
20494
20495 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
20496
20497 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
20498 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
20499
20500 * xdisp.c (hscroll_window_tree):
20501 (reconsider_clip_changes): Use PT instead of BUF_PT.
20502
d251f04b
EZ
205032011-03-13 Eli Zaretskii <eliz@gnu.org>
20504
20505 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
20506 $(EMACS_ROOT)/lib/intprops.h.
20507
f0c77cd1
PE
205082011-03-13 Paul Eggert <eggert@cs.ucla.edu>
20509
3eca4629
PE
20510 Fix more problems found by GCC 4.5.2's static checks.
20511
7c86ee98
PE
20512 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
20513 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
20514 (xg_free_frame_widgets): Make it clear that a local variable is
20515 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
20516 (gdk_window_get_screen): Make it clear that this macro is needed
20517 only if USE_GTK_TOOLTIP.
1e5524e7
PE
20518 (int_gtk_range_get_value): New function, which avoids a diagnostic
20519 from gcc -Wbad-function-cast.
20520 (xg_set_toolkit_scroll_bar_thumb): Use it.
20521 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
20522 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
20523 (get_utf8_string, xg_get_file_with_chooser):
20524 Rename locals to avoid shadowing.
20525 (create_dialog): Move locals to avoid shadowing.
7c86ee98 20526
41729b81
PE
20527 * xgselect.c (xg_select): Remove unused var.
20528
f0c77cd1
PE
20529 * image.c (four_corners_best): Mark locals as initialized.
20530 (gif_load): Initialize transparent_p to zero (Bug#8238).
20531 Mark another local as initialized.
ec6cf4c6 20532 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 20533
ce0ad53d 20534 * image.c (clear_image_cache): Now static.
d5d5a617 20535 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 20536 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
20537 (x_edge_detection): Remove unnecessary cast that
20538 gcc -Wbad-function-cast diagnoses.
2037898d 20539 (gif_load): Fix pointer signedness.
6ae141d6
PE
20540 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
20541 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 20542
33383987 205432011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 20544
d32df629
PE
20545 Improve quality of tests for time stamp overflow.
20546 For example, without this patch (encode-time 0 0 0 1 1
20547 1152921504606846976) returns the obviously-bogus value (-948597
20548 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
20549 reports time overflow. See
20550 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
20551 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
20552 * editfns.c: Include limits.h and intprops.h.
20553 (TIME_T_MIN, TIME_T_MAX): New macros.
20554 (time_overflow): Move earlier, to before first use.
20555 (hi_time, lo_time): New functions, for an accurate test for
20556 out-of-range times.
20557 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
20558 (Fget_internal_run_time): Don't assume time_t fits in int.
20559 (make_time): Use list2 instead of Fcons twice.
20560 (Fdecode_time): More accurate test for out-of-range times.
20561 (check_tm_member): New function.
20562 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
20563 (lisp_time_argument): Don't rely on undefined left-shift and
20564 right-shift behavior when checking for time stamp overflow.
8be6f318 20565
fe31d94c
PE
20566 * editfns.c (time_overflow): New function, refactoring common code.
20567 (Fformat_time_string, Fdecode_time, Fencode_time):
20568 (Fcurrent_time_string): Use it.
20569
8be6f318
PE
20570 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
20571 * dired.c (make_time): Move to ...
20572 * editfns.c (make_time): ... here.
20573 * systime.h: Note the move.
20574
09d9db2c 205752011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 20576
126bc0dc
YM
20577 * fringe.c (update_window_fringes): Remove unused variables.
20578
c47cbdfd
YM
20579 * unexmacosx.c (copy_data_segment): Also copy __got section.
20580 (Bug#8223)
20581
7ac80be9
EZ
205822011-03-12 Eli Zaretskii <eliz@gnu.org>
20583
c96bbc66 20584 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
20585 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
20586 Constify `char *' arguments and their references according to
20587 prototypes in tparam.h.
20588
ecb0f94d 20589 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 20590
7ac80be9
EZ
20591 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
20592 Adapt all references accordingly.
20593
20594 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
20595
ef1fd07e
TT
205962011-03-11 Tom Tromey <tromey@redhat.com>
20597
20598 * buffer.c (syms_of_buffer): Remove obsolete comment.
20599
7ef4b50c
EZ
206002011-03-11 Eli Zaretskii <eliz@gnu.org>
20601
20602 * termhooks.h (encode_terminal_code): Declare prototype.
20603
20604 * msdos.c (encode_terminal_code): Don't declare prototype.
20605
20606 * term.c (encode_terminal_code): Now external again, used by
20607 w32console.c and msdos.c.
20608
44f230aa
SM
20609 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
20610 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 20611
4b1ec863 206122011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 20613
1714f52b 20614 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 20615
4b1ec863
PE
20616 * fringe.c (update_window_fringes): Mark locals as initialized
20617 (Bug#8227).
20618 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 20619
524c7aa6
PE
20620 * alloc.c (mark_fringe_data): Move decl from here ...
20621 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
20622 to check its interface.
20623 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
20624
a5c0af81 20625 * fontset.c (free_realized_fontset): Now static.
7519b8cd 20626 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 20627 (fontset_font): Mark local as initialized.
a9a06e0b 20628 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 20629
b4716021
PE
20630 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
20631
811e9bac 20632 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 20633 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
20634 (x_own_selection, Fx_disown_selection_internal): Rename locals
20635 to avoid shadowing.
20636 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 20637
7e3ab302
PE
20638 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
20639 so that the caller can use some name other than gcpro1.
20640 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
20641 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20642 (Fx_backspace_delete_keys_p):
20643 Use them to avoid shadowing, and rename vars to avoid shadowing.
20644 (x_decode_color, x_set_name, x_window): Now static.
6b437900 20645 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 20646 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
20647 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
20648 Remove unused locals.
7e3ab302
PE
20649 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
20650 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
20651 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
20652 macros.
f78faa98 20653
e2b13473
PE
20654 * xterm.h (x_mouse_leave): New decl.
20655
77f23912
PE
20656 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
20657 Remove unused functions.
cdf4ba58
PE
20658 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
20659 (x_calc_absolute_position): Now static.
7411c686 20660 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 20661 Don't declare local "event" unless it's used.
ed7bf3a5
PE
20662 (x_iconify_frame, x_free_frame_resources): Don't declare locals
20663 unless they are used.
38d0b34a
PE
20664 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
20665 (x_fatal_error_signal): Remove; not used.
a6067996
PE
20666 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
20667 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
20668 (x_error_catcher, x_connection_closed, x_error_handler):
20669 (x_error_quitter, xembed_send_message, x_iconify_frame):
20670 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 20671 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 20672 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 20673
44f230aa
SM
20674 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
20675 Rename or move locals to avoid shadowing.
6b463e58 20676 (tty_defined_color, merge_face_heights): Now static.
5967d051 20677 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
20678 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
20679 does not deduce is never used uninitialized.
73719eba
PE
20680 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
20681 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 20682
426994c3 20683 * terminal.c (store_terminal_param): Now static.
5489860b 20684
032f1620 20685 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 20686 (set_frame_menubar): Remove unused local.
d4323972 20687 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
20688 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
20689 since they might point to immutable storage.
281585b0
PE
20690 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
20691 since it's unused otherwise.
032f1620 20692
367c19e5 20693 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 20694 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
20695 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
20696 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 20697 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
20698 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
20699 does not deduce are never used uninitialized.
70739cbe 20700
07b48fa9
PE
20701 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
20702
8868a238 20703 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
20704 * window.c (window_loop, size_window):
20705 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 20706
7e5cf297 20707 * window.c (display_buffer): Now static.
d6550a9f
PE
20708 (size_window): Mark variables that gcc -Wuninitialized
20709 does not deduce are never used uninitialized.
a586633d
PE
20710 * window.h (check_all_windows): New decl, to forestall
20711 gcc -Wmissing-prototypes diagnostic.
5b555da1 20712 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 20713
f6095868
PE
20714 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
20715 shadowing.
20716 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
20717 Include <limits.h>.
20718 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
20719 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
20720 (load_charset_map): Mark variables that gcc -Wuninitialized
20721 does not deduce are never used uninitialized.
53df7c11 20722 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 20723
f38b440c
PE
20724 * coding.c (coding_set_source, coding_set_destination):
20725 Use "else { /* comment */ }" rather than "else /* comment */;"
20726 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
20727 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
20728 a block, when the outer 'i' will do.
20729 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
20730 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
20731 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
20732 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
20733 (Fdecode_sjis_char, Fdefine_coding_system_internal):
20734 Rename locals to avoid shadowing.
20735 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
20736 * coding.c (emacs_mule_char, encode_invocation_designation):
20737 Now static, since they're not used elsewhere.
413bb2db 20738 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 20739 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
20740 (decode_coding_emacs_mule): Mark variables that gcc
20741 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
20742 (detect_coding_iso_2022): Initialize a local variable that might
20743 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 20744 this initialization is needed. (Bug#8211)
5f58e762
PE
20745 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
20746 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
20747 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
20748 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
20749 Remove unused macros.
f38b440c 20750
232b38b9 20751 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 20752 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 20753 * character.c (string_count_byte8): Likewise.
232b38b9 20754
fb90da1b
PE
20755 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
20756 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
20757
fb93dbc2
PE
20758 * chartab.c (copy_sub_char_table): Now static, since it's not used
20759 elsewhere.
5c156ace
PE
20760 (sub_char_table_ref_and_range, char_table_ref_and_range):
20761 Rename locals to avoid shadowing.
bbcd0949 20762 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 20763
7d3b3862 20764 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 20765 (BIDI_BOB): Remove unused macro.
7d3b3862 20766
6be7d3da
PE
20767 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
20768 deduce are never used uninitialized.
c2ed9c8b 20769 * term.c (encode_terminal_code): Likewise.
6be7d3da 20770
75f8807f 20771 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 20772
50938595
PE
20773 * tparam.h: New file.
20774 * term.c, tparam.h: Include it.
20775 * deps.mk (term.o, tparam.o): Depend on tparam.h.
20776 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
20777 Move these decls to tparam.h, and make them agree with what
20778 is actually in tparam.c. The previous trick of using incompatible
20779 decls in different modules does not conform to the C standard.
20780 All callers of tparam changed to use tparam's actual API.
20781 * tparam.c (tparam1, tparam, tgoto):
20782 Use const pointers where appropriate.
20783
fbceeba2
PE
20784 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
20785 * cm.h (struct cm): Likewise.
20786 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
20787 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
20788 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
20789 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
20790 (turn_on_face, init_tty): Likewise.
20791 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 20792
7f3f1250
PE
20793 * term.c (term_mouse_position): Rename local to avoid shadowing.
20794
e6ca6543
PE
20795 * alloc.c (mark_ttys): Move decl from here ...
20796 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
20797
c40f8d15
AS
207982011-03-11 Andreas Schwab <schwab@linux-m68k.org>
20799
20800 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
20801
cfe0661d
JB
208022011-03-09 Juanma Barranquero <lekktu@gmail.com>
20803
20804 * search.c (compile_pattern_1): Remove argument regp, unused since
20805 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
20806 (compile_pattern): Don't pass it.
20807
0afb4571
J
208082011-03-08 Jan Djärv <jan.h.d@swipnet.se>
20809
20810 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
20811 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
20812 for ! HAVE_GTK3.
20813 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
20814
20815 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
20816
20817 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
20818 gdk_window_get_screen, gdk_window_get_geometry,
20819 gdk_x11_window_lookup_for_display and GDK_KEY_g.
20820 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
20821 (xg_get_pixbuf_from_pixmap): New function.
20822 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
20823 to Pixmap, take frame as parameter, remove GdkColormap parameter.
20824 Call xg_get_pixbuf_from_pixmap instead of
20825 gdk_pixbuf_get_from_drawable.
20826 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
20827 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
20828 (xg_check_special_colors): Use GtkStyleContext and its functions
20829 for HAVE_GTK3.
20830 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
20831 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
20832 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
20833 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
20834 Call gtk_widget_get_preferred_size.
0afb4571
J
20835 (xg_frame_resized): gdk_window_get_geometry only takes 5
20836 parameters.
44f230aa
SM
20837 (xg_win_to_widget, xg_event_is_for_menubar):
20838 Call gdk_x11_window_lookup_for_display.
0afb4571
J
20839 (xg_set_widget_bg): New function.
20840 (delete_cb): New function.
895009e1 20841 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 20842 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
20843 (xg_set_background_color): Call xg_set_widget_bg.
20844 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
20845 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
20846 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
20847 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
20848 if ! HAVE_GTK3.
20849 (update_frame_tool_bar): Call gtk_widget_hide.
20850 (xg_initialize): Use GDK_KEY_g.
20851
20852 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
20853 if ! HAVE_GTK3
20854 (x_session_initialize): Call gdk_x11_set_sm_client_id.
20855
20856 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
20857 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
20858 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
20859
1c2cc4ef
JB
208602011-03-08 Juanma Barranquero <lekktu@gmail.com>
20861
20862 * w32xfns.c (select_palette): Check success of RealizePalette against
20863 GDI_ERROR, not zero.
20864
33383987 20865See ChangeLog.11 for earlier changes.
aac0c6e3
MR
20866
20867;; Local Variables:
20868;; coding: utf-8
aac0c6e3
MR
20869;; End:
20870
2f097256 20871 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
20872
20873 This file is part of GNU Emacs.
20874
20875 GNU Emacs is free software: you can redistribute it and/or modify
20876 it under the terms of the GNU General Public License as published by
20877 the Free Software Foundation, either version 3 of the License, or
20878 (at your option) any later version.
20879
20880 GNU Emacs is distributed in the hope that it will be useful,
20881 but WITHOUT ANY WARRANTY; without even the implied warranty of
20882 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20883 GNU General Public License for more details.
20884
20885 You should have received a copy of the GNU General Public License
20886 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.