* lisp/find-file.el (cc-other-file-alist): Bump :version.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
dc4a2ee0
PE
12013-05-06 Paul Eggert <eggert@cs.ucla.edu>
2
5ee94506
PE
3 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
4 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
5 Verify that ElfW (Half) fits in int.
6 (fatal): Use same signature as lisp.h.
7 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
8 configure and build with -DUNEXELF_DEBUG without worrying about
9 other modules that use DEBUG.
10 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
11 possibly-wide integers now uses it instead of plain fprintf.
12 (entry_address): New function, which avoids problems with 32-bit
13 overflow on 64-bit hosts.
14 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
15 (round_up): Don't assume the remainder fits in int.
16 (find_section): Use bool for boolean. Simplify debug code.
17 (unexec): Don't assume file sizes fit in int or size_t.
18 Omit unnecessary trailing newline in 'fatal' format.
19 Use strerror rather than outputting decimal error number.
20 Remove unused code when emacs is not defined;
21 this file relies on Emacs now.
22 Don't assume e_phnum and e_shnum are positive.
23
dc4a2ee0
PE
24 * regex.c: Fix problems when DEBUG is defined.
25 (extract_number, extract_number_and_incr): Define regardless of
26 whether DEBUG is defined; that's simpler and makes the code less
27 likely to go stale in the normal case when DEBUG is not defined.
28 Return int rather than taking an int * arg. All callers changed.
29 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
30 Remove, replacing with ...
31 (DEBUG_PRINT): New macro. All callers changed.
32 (DEBUG_COMPILES_ARGUMENTS): New macro.
33 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
34 (print_compiled_pattern, print_double_string) [DEBUG]:
35 Use prototype rather than old-style definition.
36 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
37 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
38 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
39 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
40 Don't assume ptrdiff_t, size_t, and long are the same width as int.
41 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
42 This matters only when DEBUG is defined.
43
14c7ed05
EZ
442013-05-05 Eli Zaretskii <eliz@gnu.org>
45
46 * xdisp.c (set_iterator_to_next): Set the
47 ignore_overlay_strings_at_pos_p flag only if we are _really_
48 iterating over an overlay string, as indicated by the
49 current.overlay_string_index member. (Bug#14306)
50
e6076b1b
JD
512013-05-05 Jan Djärv <jan.h.d@swipnet.se>
52
53 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
54 to where it is used, to avoid autorelease issues (Bug#14050).
55
cbee2131
PE
562013-05-05 Paul Eggert <eggert@cs.ucla.edu>
57
58 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
59 * fileio.c (syms_of_fileio): Implement this.
60 * filelock.c (create_lock_file): If symbolic links don't work, so
61 we use a regular file as a lock file, do not fsync the lock file;
62 it's not needed.
63
30c7e542
SM
642013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
65
66 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
67 (syms_of_minibuf): Adjust accodingly.
68 * lread.c (Fread):
69 * callint.c (Fcall_interactively): Adjust calls accordingly.
70
5bebd186
EZ
712013-05-04 Eli Zaretskii <eliz@gnu.org>
72
73 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
30c7e542
SM
74 w->contents is a buffer before computing everything else.
75 Use parentheses to disambiguate last part of the condition.
5bebd186
EZ
76
77 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
78 assertion violations. (Bug#14062)
79
0fb0a4f3
DR
802013-05-01 David Reitter <david.reitter@gmail.com>
81
82 * nsfns.m (ns_tooltip): Initialize.
83
9e63b4a5
EZ
842013-04-28 Eli Zaretskii <eliz@gnu.org>
85
86 * coding.c (decode_coding_gap): Don't remove the character before
87 a newline unless it's a CR character. (Bug#14287)
88
ad60824e
DN
892013-04-28 Dan Nicolaescu <dann@gnu.org>
90
91 * dispextern.h (struct face): Move enum face_underline_type
92 earlier so that bitfields can be in the same word.
93
edbdcec0
JD
942013-04-28 Jan Djärv <jan.h.d@swipnet.se>
95
96 * nsfns.m (handlePanelKeys): New function.
97 (EmacsOpenPanel:performKeyEquivalent:)
98 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
99 arrows/function/control and copy/paste keys (Bug#14296).
100
0208ede7
JL
1012013-04-27 Juri Linkov <juri@jurta.org>
102
103 * callint.c (Fcall_interactively): Call `Qread_number' for
104 interactive code letter `n' instead of using duplicate code.
105 (Bug#14254)
106
b8dd59f7
PE
1072013-04-27 Paul Eggert <eggert@cs.ucla.edu>
108
109 * systime.h (make_timeval): Declare as 'const'.
110
8bd722db
KH
1112013-04-27 Kenichi Handa <handa@gnu.org>
112
113 * font.c (font_open_entity): Always open a font of manageable
114 size.
115
13d0e56f 1162013-04-26 Paul Eggert <eggert@cs.ucla.edu>
cbee2131 117
f780d632
PE
118 Port better to AIX (Bug#14258).
119 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
120 to pacify AIX xlc.
121
ec509856
KH
1222013-04-24 Kenichi Handa <handa@gnu.org>
123
124 * coding.c (decode_coding_iso_2022): When an invalid escape
125 sequence is encountered, reset the invocation and designation
126 status to the safest one.
127
84fc48e5
PE
1282013-04-22 Paul Eggert <eggert@cs.ucla.edu>
129
130 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
131 Without this fix, "make distclean" leaves stamp-h1 behind.
132
806bda47
EC
1332013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
134
135 * w32fns.c (w32_fullscreen_rect): New function to compute the
136 window rectangle for the given fullscreen mode.
137 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
138 longer tunes the window size. This keeps the window's edges flush
139 with the screen and allows the taskbar to hide itself in fullboth.
140
141 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
142 window decorations and uses the entire screen.
143
144 * w32term.h (w32_fullscreen_rect) Add prototype.
145 (struct w32_output): Replace normal_width, normal_height,
146 normal_top, and normal_left members with a single normal_placement
147 struct.
148 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
149 Remove macros.
150 (FRAME_NORMAL_PLACEMENT): New macro.
151
9cc2810b
JB
1522013-04-16 Juanma Barranquero <lekktu@gmail.com>
153
154 * minibuf.c (Ftest_completion): Silence compiler warning.
155
fd16b54c
EZ
1562013-04-15 Eli Zaretskii <eliz@gnu.org>
157
158 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
5fbcd237 159 bug#14062.
fd16b54c
EZ
160
161 * frame.h (WINDOW_FRAME): Protect macro and its argument with
162 parentheses.
163
164 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
165 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
166 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
167 parentheses where appropriate.
168
9e3379a0
PE
1692013-04-14 Paul Eggert <eggert@cs.ucla.edu>
170
171 * keyboard.c (timer_start_idle): Remove no-longer-used local.
172
ddd6b685
EZ
1732013-04-14 Eli Zaretskii <eliz@gnu.org>
174
175 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
176 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
177 Mention in the doc string that setting these variables takes
178 effect only after a call to set-window-buffer. (Bug#14200)
179
29b79ba1
EZ
1802013-04-13 Eli Zaretskii <eliz@gnu.org>
181
182 * indent.c (Fvertical_motion): Don't consider display strings on
183 overlay strings as display strings on the buffer position we
184 started from. This prevents vertical cursor motion from jumping
185 more than one line when there's an overlay string with a display
186 property at end of line.
187 Reported by Karl Chen <Karl.Chen@quarl.org> in
188 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
189
562c6ee9
SM
1902013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
191
192 * window.c (select_window): `record_buffer' even if window is
193 already selected (bug#14191).
194
fcc1fe85
EZ
1952013-04-11 Eli Zaretskii <eliz@gnu.org>
196
197 * window.c (Fwindow_end): Test more flags, including the buffer's
198 last_overlay_modified flag, to determine whether the window's
199 display is really up-to-date. Prevents the function from
200 returning a stale value. (Bug#14170)
201 (Fwindow_line_height): Fix the test for up-to-date-ness of the
202 current matrix.
203
f009190a
EZ
2042013-04-10 Eli Zaretskii <eliz@gnu.org>
205
206 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
562c6ee9
SM
207 garbaged only if it is not already the top frame on its TTY.
208 This prevents flickering due to constant redrawing of TTY frames when
f009190a
EZ
209 there are GUI frames open in the same session. (Bug#13864)
210
78ce603d
SM
2112013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
212
213 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
214 of marking the idle timers directly.
215
a8036e40
SM
2162013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
217
218 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
219 tables (bug#14054).
220
7ffe7ef6
SM
2212013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
222
223 * window.c (select_window): Don't record_buffer while the invariant is
224 temporarily broken (bug#14161).
225
226 * fns.c (Fdelq): Don't assume !NILP => CONSP.
227
7d9f6883
EZ
2282013-04-07 Eli Zaretskii <eliz@gnu.org>
229
230 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
231
5406cfd9
RF
2322013-04-07 Romain Francoise <romain@orebokech.com>
233
234 Ignore additional platform-specific ACL errors (Bug#13702).
235 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
236 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
237
95c0e83b
JD
2382013-03-31 Jan Djärv <jan.h.d@swipnet.se>
239
240 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
241 f->output_data.ns.
242
876da980
PE
2432013-04-07 Paul Eggert <eggert@cs.ucla.edu>
244
245 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
246 This bug was introduced by my 2013-02-25 change that simplified
247 data_start configuration. Without this change, on GNU/Linux
248 an Emacs configured with --enable-profiling fails immediately
249 due to a profiler signal.
250 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
251 with these flags. On platforms where special flags are needed
252 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
253 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
254 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
255
7452b7bd
DA
2562013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
257
258 Get rid of some platform-specific functions examining window
259 system and its capabilities. This is a partial rework of the
260 2013-04-05 change.
261 * lisp.h (have_menus_p): Remove prototype. This function is
262 replaced with platform-independent window_system_available.
263 (check_window_system): Move to...
264 * frame.h (decode_window_system_frame, window_system_available):
265 ...here, add new prototypes.
266 * frame.c (window_system_available, decode_window_system_frame):
267 New functions.
268 (check_window_system): Platform-independent now.
269 * xterm.h (x_in_use): Remove declaration.
270 (check_x_frame):
271 * w32term.h (check_x_frame):
272 * nsterm.h (check_x_frame): Remove prototypes. This function
273 is replaced with platform-independent decode_window_system_frame.
274 * msdos.c (have_menus_p): Remove.
275 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
276 Remove platform-specific functions. Use check_window_system,
277 decode_window_system_frame and check_ns_display_info where
278 appropriate. Minor style and comment tweaks.
279 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
280 (check_x_frame): Likewise.
281 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
282 Likewise.
283 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
284 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
285 * xmenu.c, xselect.c: All related users changed.
286
251e9147
KH
2872013-04-03 Kenichi Handa <handa@gnu.org>
288
289 The following changes is to optimize the code for reading UTF-8
290 files.
291
562c6ee9 292 * coding.c (check_ascii): Rename from detect_ascii. Return value
251e9147
KH
293 changed. Check EOL format. Do not call adjust_coding_eol_type
294 here.
295 (check_utf_8): New function.
296 (adjust_coding_eol_type): Do nothing if already adjusted.
297 (detect_coding): Compare the return value of check_ascii with
298 coding->src_bytes. Call adjust_coding_eol_type if necessary.
299 (decode_coding_gap): Optimize for valid UTF-8.
300
8bc369d4
KH
3012013-03-21 Kenichi Handa <handa@gnu.org>
302
303 * coding.c (syms_of_coding): Cancel previous change.
304
305 * insdel.c (insert_from_gap): Fix previous change.
306
73931ad1
DA
3072013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
308
309 Consistently use platform-specific function to detect window system.
310 * lisp.h (check_window_system): New prototype. This function is
311 going to replace check_x, check_w32 and check_ns.
312 (have_menus_p): Mention msdos.c in comment.
313 * fontset.c (check_window_system_func): Remove. Adjust all users.
314 * fontset.h (check_window_system_func): Remove prototype.
315 * nsterm.h (check_ns):
316 * xterm.h (check_x):
317 * w32term.h (check_w32): Likewise.
318 * menu.c (Fx_popup_menu): Use check_window_system.
319 * msdos.c (check_window_system): Define for MS-DOS.
320 * nsfns.m (check_window_system): Define for NS. Adjust all users.
321 * w32fns.c (check_window_system): Likewise for MS-Windows.
322 * xfns.c (check_window_system): Likewise for X.
323 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
324 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
325
7216e43b
PE
3262013-04-02 Paul Eggert <eggert@cs.ucla.edu>
327
328 Prefer < to > in range checks such as 0 <= i && i < N.
329 This makes it easier to visualize quantities on a number line.
330 This patch doesn't apply to all such range checks,
331 only to the range checks affected by the 2013-03-24 change.
332 This patch reverts most of the 2013-03-24 change.
333 * alloc.c (xpalloc, Fgarbage_collect):
334 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
335 * character.c (string_escape_byte8):
336 * charset.c (read_hex):
337 * data.c (cons_to_unsigned):
338 * dispnew.c (update_frame_1):
339 * doc.c (Fsubstitute_command_keys):
340 * doprnt.c (doprnt):
341 * editfns.c (hi_time, decode_time_components):
342 * fileio.c (file_offset):
343 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
344 * font.c (font_intern_prop):
345 * frame.c (x_set_alpha):
346 * gtkutil.c (get_utf8_string):
347 * indent.c (check_display_width):
348 * keymap.c (Fkey_description):
349 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
350 * lread.c (read1):
351 * minibuf.c (read_minibuf_noninteractive):
352 * process.c (wait_reading_process_output):
353 * search.c (Freplace_match):
354 * window.c (get_phys_cursor_glyph):
355 * xdisp.c (redisplay_internal):
356 * xsmfns.c (smc_save_yourself_CB):
357 Prefer < to > for range checks.
358 * dispnew.c (sit_for): Don't mishandle NaNs.
359 This fixes a bug introduced in the 2013-03-24 change.
360 * editfns.c (decode_time_components): Don't hoist comparison.
361 This fixes another bug introduced in the 2013-03-24 change.
362
92759988
DA
3632013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
364
365 * frame.h (struct frame): Drop scroll_bottom_vpos
366 member becaue all real users are dead long ago.
367 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
368 * xdisp.c (redisplay_internal): Adjust user.
369
9a1971bb
GM
3702013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
371
f38ab167
JD
372 * nsmenu.m (showAtX:Y:for:): setLevel to
373 NSPopUpMenuWindowLevel (Bug#13998).
374
6d01f1fe
JD
3752013-03-30 Jan Djärv <jan.h.d@swipnet.se>
376
377 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
378 (ns_check_pending_open_menu): Declare.
379
380 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
381 (x_activate_menubar): Update the menu with title that matches
382 ns_get_pending_menu_title, and call
383 ns_check_pending_openmenu (Bug#12698).
384 (menuWillOpen:): New method.
385 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
386
387 * nsterm.m (menu_will_open_state, menu_mouse_point)
388 (menu_pending_title): New varaibles.
389 (ns_get_pending_menu_title, ns_check_menu_open)
390 (ns_check_pending_open_menu): New functions.
391
781f4782
DA
3922013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
393
394 * indent.c (current_column_bol_cache): Remove leftover which is not
395 used in Fmove_to_column any more.
396 (current_column, scan_for_column): Adjust users.
397 * keyboard.c (last_point_position_buffer, last_point_position_window):
398 Remove leftovers which are not used for recording undo any more.
399 (command_loop_1, syms_of_keyboard): Adjust users.
400 * xdisp.c (last_max_ascent): Remove leftover which is not used in
401 redisplay_window any more.
402 (move_it_to): Adjust user.
403
1921c31b
JB
4042013-03-29 Juanma Barranquero <lekktu@gmail.com>
405
406 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
407 Update dependencies.
408
717b8bcd
SM
4092013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
410
411 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
412 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
413 forward references.
414
e74aeda8
DA
4152013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
416
417 * window.h (struct window): Replace hchild, vchild and buffer slots
418 with the only contents slot. This is possible because each valid
419 window may have either the child window (in vertical or horizontal
420 combination) or buffer to display (for the leaf window). Using that,
421 a lof of operations to traverse and/or change window hierarchies may
422 be simplified. New member horizontal is used to distinguish between
423 horizontal and vertical combinations of internal windows.
424 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
425 (WINDOW_VERTICAL_COMBINATION_P): New macros.
426 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
427 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
428 Use contents slot, not buffer, where appropriate.
429 (wset_combination): New function.
430 (wset_buffer): Add eassert.
431 (Fframe_first_window): Simplify the loop reaching first window.
432 (Fwindow_buffer): Use WINDOW_LEAF_P.
433 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
434 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
435 (unshow_buffer): Convert initial debugging check to eassert.
436 (replace_window, recombine_windows, Fdelete_other_windows_internal)
437 (make_parent_window, window_resize_check, window_resize_apply)
438 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
439 (Fset_window_configuration, delete_all_child_windows, save_window_save):
440 Adjust to match struct window changes.
441 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
442 (mark_window_cursors_off, count_windows, get_leaf_windows)
443 (foreach_window_1): Simplify the loop.
444 * alloc.c (mark_object): Do not check for the leaf window because
445 internal windows has no glyph matrices anyway.
446 * dispnew.c (clear_window_matrices, showing_window_margins_p)
447 (allocate_matrices_for_window_redisplay, fake_current_matrices)
448 (allocate_matrices_for_frame_redisplay, free_window_matrices)
449 (build_frame_matrix_from_window_tree, mirror_make_current)
450 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
451 (update_window_tree, set_window_update_flags): Simplify the loop.
452 (sync_window_with_frame_matrix_rows): Enforce live window.
453 Use contents slot, not buffer, where appropriate.
454 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
455 and WINDOW_HORIZONTAL_COMBINATION_P.
456 (make_frame_visible_1): Simplify the loop.
457 Use contents slot, not buffer, where appropriate.
458 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
459 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
460 (expose_window_tree): Likewise.
461 Use contents slot, not buffer, where appropriate.
462 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
463 to avoid deleted windows. Use contents slot instead of buffer.
464 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
465 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
466 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
467 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
468
121ab1cd
EZ
4692013-03-28 Eli Zaretskii <eliz@gnu.org>
470
ef454cf7
EZ
471 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
472 identify the reasons for assertion violations in bug#14062 and
473 similar ones.
21e930f8
EZ
474 (Fx_show_tip): Fix compilation error under
475 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 476
121ab1cd
EZ
477 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
478 Reported by <rzl24ozi@gmail.com>.
479
5c89ca24
DA
4802013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
481
482 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
483 start marker...
562c6ee9
SM
484 (unwind_with_echo_area_buffer): ...to restore it here.
485 This is needed to ensure that...
5c89ca24
DA
486 (redisplay_window): ...both window markers are valid here,
487 which is verified by eassert.
488 * editfns.c (save_excursion_save): Do not assume that
489 selected_window always displays the buffer.
c7f53895
DA
490 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
491 Fix comment.
5c89ca24 492
f557c1b1
SM
4932013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
494
495 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
496 the upcase table.
497
40693bba 4982013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
499
500 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
501
c86f791f
EZ
5022013-03-27 Eli Zaretskii <eliz@gnu.org>
503
504 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
505 since MinGW's w32api headers do. This avoids compiler warnings.
506
507 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
508 if already defined.
509
c6e72e17
EZ
5102013-03-26 Eli Zaretskii <eliz@gnu.org>
511
512 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
513
54e95010
JD
5142013-03-26 Jan Djärv <jan.h.d@swipnet.se>
515
516 * gtkutil.c (style_changed_cb): Check if frame is live and an
517 X frame (Bug#14038).
518
b88b62de
EZ
5192013-03-26 Eli Zaretskii <eliz@gnu.org>
520
a18d7de6
EZ
521 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
522 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
523 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
524 MinGW64.
8f5e14c8
EZ
525 Move inclusion of time.h before sys/time.h, so that MinGW64 could
526 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 527
b88b62de
EZ
528 Fix incompatibilities between MinGW.org and MinGW64 headers.
529 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
530
531 * w32.c (REPARSE_DATA_BUFFER): Guard with
532 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
533
c074e458
JD
5342013-03-25 Jan Djärv <jan.h.d@swipnet.se>
535
536 * xterm.c: Include X11/XKBlib.h
537 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
538
908589fd
AS
5392013-03-24 Andreas Schwab <schwab@linux-m68k.org>
540
541 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
542 written backwards.
543 * blockinput.h (input_blocked_p): Likewise.
544 * bytecode.c (exec_byte_code): Likewise.
545 * callproc.c (call_process_kill, call_process_cleanup)
546 (Fcall_process): Likewise.
547 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
548 (Fccl_execute_on_string): Likewise.
549 * character.c (string_escape_byte8): Likewise.
550 * charset.c (read_hex): Likewise.
551 * cm.c (calccost): Likewise.
552 * data.c (cons_to_unsigned): Likewise.
553 * dired.c (directory_files_internal, file_name_completion):
554 Likewise.
555 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
556 (sit_for): Likewise.
557 * doc.c (Fsubstitute_command_keys): Likewise.
558 * doprnt.c (doprnt): Likewise.
559 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
560 * emacsgtkfixed.c: Likewise.
561 * fileio.c (file_offset, Fwrite_region): Likewise.
562 * floatfns.c (Fexpt, fmod_float): Likewise.
563 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
564 Likewise.
565 * font.c (font_intern_prop): Likewise.
566 * frame.c (x_set_alpha): Likewise.
567 * gtkutil.c (get_utf8_string): Likewise.
568 * indent.c (check_display_width): Likewise.
569 * intervals.c (create_root_interval, rotate_right, rotate_left)
570 (split_interval_right, split_interval_left)
571 (adjust_intervals_for_insertion, delete_node)
572 (interval_deletion_adjustment, adjust_intervals_for_deletion)
573 (merge_interval_right, merge_interval_left, copy_intervals)
574 (set_intervals_multibyte_1): Likewise.
575 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
576 * keymap.c (Fkey_description): Likewise.
577 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
578 * lread.c (openp, read_integer, read1, string_to_number):
579 Likewise.
580 * menu.c (ensure_menu_items): Likewise.
581 * minibuf.c (read_minibuf_noninteractive): Likewise.
582 * print.c (printchar, strout): Likewise.
583 * process.c (create_process, Faccept_process_output)
584 (wait_reading_process_output, read_process_output, send_process)
585 (wait_reading_process_output): Likewise.
586 * profiler.c (make_log, handle_profiler_signal): Likewise.
587 * regex.c (re_exec): Likewise.
588 * regex.h: Likewise.
589 * search.c (looking_at_1, Freplace_match): Likewise.
590 * sysdep.c (get_child_status, procfs_ttyname)
591 (procfs_get_total_memory): Likewise.
592 * systime.h (EMACS_TIME_VALID_P): Likewise.
593 * term.c (dissociate_if_controlling_tty): Likewise.
594 * window.c (get_phys_cursor_glyph): Likewise.
595 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
596 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
597 Likewise.
598 * xfns.c (Fx_window_property): Likewise.
599 * xmenu.c (set_frame_menubar): Likewise.
600 * xselect.c (x_get_window_property, x_handle_dnd_message):
601 Likewise.
602 * xsmfns.c (smc_save_yourself_CB): Likewise.
603 * xterm.c (x_scroll_bar_set_handle): Likewise.
604
2bf7d27a
DA
6052013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
606
607 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
608 to be optional or nil. Adjust comment and convert it to docstring.
609 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
610 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
611
a9ebfa0b
PE
6122013-03-24 Paul Eggert <eggert@cs.ucla.edu>
613
614 Static checking by GCC 4.8-20130319.
615 * image.c (gif_load): Assume pass < 3 to pacify GCC.
616 * process.c (Fset_process_datagram_address)
617 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
618 * xdisp.c (get_char_face_and_encoding):
619 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
620 (get_glyph_face_and_encoding): Prepare face before possibly using it.
621 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
622
4f3576ee
KB
6232013-03-24 Ken Brown <kbrown@cornell.edu>
624
789b5e9a
KB
625 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
626 fix compilation on 64-bit Cygwin, where underscores are not
627 automatically prepended.
628
4f3576ee
KB
629 * w32term.c (w32_initialize): Silence compiler warning.
630
b5b7745f
EZ
6312013-03-23 Eli Zaretskii <eliz@gnu.org>
632
cdc0d0bd
EZ
633 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
634 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
562c6ee9
SM
635 variables, to save and restore frame dimensions.
636 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
637 after returning from a 'fullscreen' configuration.
638 use SendMessage instead of PostMessage to send the SC_RESTORE message,
cdc0d0bd
EZ
639 to avoid races between the main thread and the input thread.
640
641 * w32term.h (struct w32_output): New members normal_width,
642 normal_height, normal_top, normal_left, and prev_fsmode.
643 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
644 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
645 members of a frame.
646
b5b7745f
EZ
647 * w32term.c (w32fullscreen_hook): Record last value of the frame's
648 'fullscreen' parameter. Always record previous width and height
649 of the frame, except when switching out of maximized modes, so
650 that they could be restored correctly, instead of resetting to the
651 default frame dimensions. Send SC_RESTORE command to the frame,
652 unless we are going to send SC_MAXIMIZE, to restore the frame
653 resize hints in the mouse pointer shown by the window manager.
654 (Bug#14032)
655
656 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
657
658 * lisp.h (get_frame_param): Adjust conditions for prototype
659 declaration.
660
a3454eed
KB
6612013-03-22 Ken Brown <kbrown@cornell.edu>
662
663 * unexcw.c: Drop unneeded inclusion of w32common.h.
664 (report_sheap_usage): Declare.
665 (read_exe_header): Add magic numbers for x86_64.
666 (fixup_executable): Fix printf format specifier for unsigned long
667 argument.
668
5a49b79c
DA
6692013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
670
671 * frame.h (struct frame): Put menu_bar_window under #ifdef
672 because this member is not needed when X toolkit is in use.
673 (fset_menu_bar_window):
674 * dispnew.c (clear_current_matrices, clear_desired_matrices)
675 (free_glyphs, update_frame):
676 * xdisp.c (expose_frame): Likewise.
677 (display_menu_bar): Likewise. Remove redundant eassert.
678 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
679 toolkit is in use.
680
d6723bf7
PE
6812013-03-21 Paul Eggert <eggert@cs.ucla.edu>
682
7b1123d8
PE
683 Use functions and constants to manipulate Lisp_Save_Value objects.
684 This replaces code that used macros and strings and token-pasting.
685 The change makes the C source a bit easier to follow,
686 and shrinks the Emacs executable a bit.
687 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
688 (make_save_value): Change 1st arg from string to enum. All callers
689 changed.
690 (INTX): Remove.
691 (mark_object): Use if, not #if, for GC_MARK_STACK.
692 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
693 (XSAVE_OBJECT): Now functions, not macros.
694 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
695 the constant was never used.
696 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
697 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
698 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
699 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
700 New constants.
701 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
702 type3 with a single member save_type. All uses changed.
703 (save_type, set_save_pointer, set_save_integer): New functions.
704 * print.c (PRINTX): Remove.
705
d6723bf7
PE
706 * alloc.c: Remove redundant static declarations.
707
5f24fa51
DA
7082013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
709
710 * window.h (struct window): Convert left_col, top_line, total_lines
711 and total_cols from Lisp_Objects to integers. Adjust comments.
712 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
713 Remove.
714 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
715 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
716 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
717 Adjust users where appropriate.
718
42143acd
DA
7192013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
720
721 * frame.h (struct frame): Drop resx and resy because the same data is
722 available from window system-specific output context. Adjust users.
562c6ee9
SM
723 (default_pixels_per_inch_x, default_pixels_per_inch_y):
724 New functions to provide defaults when no window system available.
42143acd 725 (FRAME_RES_X, FRAME_RES_Y): New macros.
562c6ee9 726 (NUMVAL): Move from xdisp.c.
42143acd
DA
727 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
728 (Ffont_face_attributes, Fopen_font):
729 * image.c (gs_load):
730 * w32font.c (fill_in_logfont):
731 * xdisp.c (calc_pixel_width_or_height):
732 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
733 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
734
c0a17406
KH
7352013-03-20 Kenichi Handa <handa@gnu.org>
736
737 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
738 to 1 (temporary workaround until a bug related to ASCII
739 optimization is fixed).
740
095d384d
DA
7412013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
742
743 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
744 Signal error if window is not internal. Adjust docstring.
745 (delete_all_child_windows): Use combination_limit to save the buffer.
746 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
747 * print.c (syms_of_print): Initialize debugging output not here...
748 (init_print_once): ...but in a new function here.
749 * lisp.h (init_print_once): Add prototype.
750 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 751
748fa866
DA
7522013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
753
754 * window.c (window_resize_check, window_resize_apply)
755 (window_from_coordinates, recombine_windows, set_window_buffer)
756 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
757 (Fsplit_window_internal, Fdelete_window_internal)
758 (freeze_window_starts): Use bool for booleans.
759 * window.h (window_frame_coordinates, resize_frame_windows)
760 (freeze_window_starts, set_window_buffer): Adjust prototypes.
761
81519fd2
SM
7622013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
763
764 * dispnew.c (bitch_at_user): Use `user-error'.
765
6db423a9
KB
7662013-03-17 Ken Brown <kbrown@cornell.edu>
767
768 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
769 as return type of image_background. (Bug#13981)
770 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
771
8f2906f5
JD
7722013-03-16 Jan Djärv <jan.h.d@swipnet.se>
773
960ce480 774 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 775 (ns_select): Don't return with result uninitialized.
960ce480 776
8f2906f5
JD
777 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
778 and getDirectory.
779
81519fd2
SM
780 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
781 New functions.
8f2906f5
JD
782 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
783 directories. If filename is nil, get directory name (Bug#13932).
784 Use getFilename and getDirectory.
785 (getFilename, getDirectory): New methods for EmacsSavePanel and
786 EmacsOpenPanel.
787 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
788
cded56c1
PE
7892013-03-15 Paul Eggert <eggert@cs.ucla.edu>
790
791 * coding.c (decode_coding_gap): Fix typo caught by static checking.
792
251e9147 7932013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
794
795 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
796 (adjust_after_replace): Make it back to static. Delete the third
797 arg text_at_gap_tail. Cancel the code for handling it.
798
799 * coding.h (struct coding_system): New member eol_seen.
800
801 * coding.c (detect_ascii): New function.
802 (detect_coding): Set coding->head_ascii and coding->eol_seen only
803 when the source bytes are actually scanned. On detecting for
804 coding_category_utf_8_auto, call detect_ascii instead of scanning
805 source bytes directly.
806 (produce_chars): Call insert_from_gap with the new arg 0.
807 (encode_coding): Likewise.
808 (decode_coding_gap): Control ASCII optimization by the variable
809 disable_ascii_optimization instead of #ifndef .. #endif.
810 Deccode EOL format according to coding->eol_seen.
811 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
812 variable.
813
8a44e6d1
KH
814 * lisp.h (adjust_after_replace): Cancel externing it.
815 (insert_from_gap): Adjust prototype.
816
5f795e34
EZ
8172013-03-15 Eli Zaretskii <eliz@gnu.org>
818
819 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
820 FULLSCREEN_MAXIMIZED. (Bug#13935)
821
f258b4be
DA
8222013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
823
824 * region-cache.c (find_cache_boundary, move_cache_gap)
825 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
826 Simplify debugging check and convert to eassert. Adjust comment.
827 (pp_cache): Put under ENABLE_CHECKING.
828
a5cc4dde
EZ
8292013-03-14 Eli Zaretskii <eliz@gnu.org>
830
831 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
832 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
833 and WM_ACTIVATEAPP.
834 (w32fullscreen_hook): If the frame is visible, reset
835 f->want_fullscreen flag after changing the frame size. If the
836 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
837 (Bug#13953)
838
3fc5e44a
DC
8392013-03-13 Daniel Colascione <dancol@dancol.org>
840
841 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
842 too so that these builds can use Cygwin's file conversion
843 functions. (We've been building and linking cygw32.o all along
844 and just not using it.)
845
47d7532e
PE
8462013-03-13 Paul Eggert <eggert@cs.ucla.edu>
847
848 File synchronization fixes (Bug#13944).
849 * Makefile.in (LIB_FDATASYNC): New macro.
850 (LIBES): Use it.
851 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
852 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
853 Don't worry about HAVE_FSYNC, since a substitute fsync is
854 available if the system lacks one.
855 (Fwrite_regin): Retry fsync if interrupted.
856
c7ffccaf
EZ
8572013-03-13 Eli Zaretskii <eliz@gnu.org>
858
4e2df81d 859 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
860 activated, call w32fullscreen_hook, to make sure the new frame
861 dimensions are in effect. (Bug#13937)
862
8a7debc1
DA
8632013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
864
865 * xdisp.c (init_iterator): Simplify because both character and byte
866 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
867 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
868 character and byte positions can be obtained from marker.
8a7debc1 869
7fd8c501
PE
8702013-03-13 Paul Eggert <eggert@cs.ucla.edu>
871
d9df6f40
PE
872 Static checking by Sun C 5.12.
873 * alloc.c (buffer_memory_full) [REL_ALLOC]:
874 * bytecode.c (exec_byte_code):
875 * dispnew.c (init_display):
876 * eval.c (error):
877 * fileio.c (Fsubstitute_in_file_name):
878 * keyboard.c (Fevent_convert_list):
879 * keymap.c (Fsingle_key_description):
880 * term.c (maybe_fatal, fatal):
881 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
882 * xsmfns.c (Fhandle_save_session):
883 Omit unreachable code.
884 * keymap.c (map_keymap_char_table_item): Cast void * to
885 a function pointer type; the C Standard requires this.
886
7fd8c501
PE
887 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
888 Include <sys/param.h> unconditionally, as that works elsewhere and
889 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
890 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
891 and FreeBSD now.
892
cb0290df
PE
8932013-03-11 Paul Eggert <eggert@cs.ucla.edu>
894
895 * insdel.c (adjust_after_replace): Use bool for boolean.
896
cbae07d5
SM
8972013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
898
899 * keyboard.c: Move keyboard decoding to read_key_sequence.
900 (decode_keyboard_code): Remove.
901 (tty_read_avail_input): Don't try to decode input.
902 (read_decoded_char): New function.
903 (read_key_sequence): Use it.
904
819e2da9
DC
9052013-03-10 Daniel Colascione <dancol@dancol.org>
906
907 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
908 (GUI_SDATA, guichar_t): Macros to abstract out differences between
909 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
910 w32fns.c.
911
912 * w32term.c (construct_drag_n_drop): Use the above macros to make
913 drag-and-drop work for non-ASCII filenames in cygw32 builds.
914
915 * w32fns.c (x_set_name, x_set_title): Use the above macros to
916 properly display non-ASCII frame titles in cygw32 builds.
917
918 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
919 call ShellExecute in cygw32 builds.
920
921 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
922 common file dialog code.
923
924 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
925 can just use du like other systems.
926
927 * coding.c (from_unicode_buffer): Declare.
928 * coding.c (from_unicode_buffer): Implement.
929
99ec1647
SM
9302013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
931
d2e24f92
SM
932 * lread.c: Minor cleanup.
933 (FROM_FILE_P): New macro.
934 (skip_dyn_bytes, unreadchar, read1): Use it.
935 (read_list): Consolidate duplicated code.
936
99ec1647
SM
937 * bytecode.c (struct byte_stack): Remove `constants' when unused.
938
138c0ae8
EZ
9392013-03-10 Eli Zaretskii <eliz@gnu.org>
940
941 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
942 (redisplay_internal, set_cursor_from_row, try_window)
943 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
944 (display_line, notice_overwritten_cursor)
99ec1647
SM
945 (mouse_face_from_buffer_pos, note_mouse_highlight):
946 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 947 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
948 (mouse_face_from_string_pos, fast_find_string_pos):
949 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
950
951 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
952
953 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
954
955 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
956 MATRIX_MODE_LINE_ROW.
957
958 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
959
c230dd7d
KH
9602013-03-10 handa <handa@gnu.org>
961
962 * lisp.h (adjust_after_replace): Extern it.
963
964 * coding.c (detect_coding): Cound the heading ASCII bytes in the
965 case of detection for coding_category_utf_8_auto.
99ec1647
SM
966 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
967 Skip decoding if all bytes are ASCII.
c230dd7d
KH
968
969 * insdel.c (adjust_after_replace): Make it public. New arg
970 text_at_gap_tail.
971 (adjust_after_insert): Call adjust_after_replace with the new arg
972 value 0.
973
27a98a62
SM
9742013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
975
976 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
977 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
978 from Elisp via unread-command-events.
979
980 * keyboard.c (access_keymap_keyremap): Accept nil return value from
981 functions to mean "no change".
982
457882c2
PE
9832013-03-08 Paul Eggert <eggert@cs.ucla.edu>
984
985 region-cache.c, scroll.c, search.c: Use bool for booleans.
986 * lisp.h (compile_pattern):
987 * scroll.c (do_scrolling, do_direct_scrolling):
988 * search.c (struct regexp_cache, compile_pattern_1)
989 (compile_pattern, string_match_1, search_command)
990 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
991 (search_regs_saved, Fregexp_quote):
992 Use bool for boolean.
993 * region-cache.c (region_cache_forward, region_cache_backward):
994 Fix comments to match code: these functions return int, not boolean.
995
b5426561
DA
9962013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
997
998 * search.c (find_newline): Accept start and end byte positions
999 as arguments and allow -1 if not known.
1000 (find_newline_no_quit): Likewise for start position.
1001 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1002 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1003 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
1004 * editfns.c (Fconstrain_to_field): Break long line.
1005 Adjust call to find_newline.
b5426561
DA
1006 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1007 Use DEC_BOTH to start next search from the previous buffer
1008 position, where appropriate.
1009 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1010 (get_visually_first_element, move_it_vertically_backward): Likewise.
1011 Obtain byte position from the display iterator, where appropriate.
1012
0bce5d9e
PE
10132013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1014
1015 print.c, process.c: Use bool for booleans.
1016 * lisp.h (wait_reading_process_output):
1017 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1018 (strout, debug_output_compilation_hack, float_to_string, print)
1019 (print_object):
1020 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1021 (decode_status, status_message, create_process, create_pty)
1022 (Fmake_network_process, Fnetwork_interface_info)
1023 (wait_reading_process_output, read_process_output)
1024 (write_queue_push, write_queue_pop, process_send_signal)
1025 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1026 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1027 Use bool for booleans.
1028 * process.c (Fnetwork_interface_list): Remove unused local.
1029 (connect_counter): Now EMACS_INT, not int.
1030
36075a19
DA
10312013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1032
1033 * bidi.c (bidi_fetch_char): Swap first and second arguments
1034 to match other functions accepting character and byte positions.
1035 Adjust comment.
1036 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1037 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1038 when you need just to move to the previous buffer position.
1039 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1040
4aae1914
EZ
10412013-03-07 Eli Zaretskii <eliz@gnu.org>
1042
1043 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1044
c54aa166
DA
10452013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1046
1047 Avoid character to byte conversions in motion subroutines.
1048 * indent.h (compute_motion, vmotion): Add byte position argument.
1049 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1050 Add eassert.
1051 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1052 Use list5 for return value.
1053 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1054 Adjust comments, style and calls to compute_motion.
1055 (Fvertical_motion): Adjust call to vmotion.
1056 * window.c (Fdelete_other_windows_internal): Record window start
1057 byte position and adjust call to vmotion.
1058 (window_scroll_line_based): Likewise with call to compute_motion.
1059 Use SET_PT_BOTH.
1060 (Frecenter): Adjust calls to vmotion.
1061
3de717bd
DA
10622013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1063
1064 * lisp.h (list2i, list3i): New functions.
1065 (list4i): Move from window.c and make LISP_INLINE.
1066 * editfns.c (make_lisp_time):
1067 * fns.c (Flocale_info):
1068 * keyboard.c (parse_modifiers):
1069 * xterm.c (x_ewmh_activate_frame): Use list2i.
1070 * instel.c (signal_after_change):
1071 * nsfns.m (Fx_server_version, Fxw_color_values):
1072 * w32fns.c (Fxw_color_values, Fx_server_version):
1073 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1074 * fileio.c (Fvisited_file_modtime):
1075 * nsfns.m (Fns_display_usable_bounds):
1076 * w32.c (ltime): Use list4i.
1077
d26e478e
EZ
10782013-03-06 Eli Zaretskii <eliz@gnu.org>
1079
a611149e
EZ
1080 * search.c (find_newline_no_quit): Rename from find_next_newline.
1081 Add commentary.
1082
1083 * lisp.h (find_newline_no_quit): Rename prototype.
1084
1085 * xdisp.c (back_to_previous_line_start)
1086 (forward_to_next_line_start, get_visually_first_element)
1087 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1088 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1089 * bidi.c (bidi_find_paragraph_start): Callers of
1090 find_newline_no_quit changed.
1091
d26e478e
EZ
1092 * msdos.c: Change encoding to cp850. (Bug#13879)
1093 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1094
1af1a51a
DA
10952013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1096
1097 Coding system support cleanup and minor refactoring.
1098 * coding.h (enum coding_result_code): Remove
1099 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1100 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1101 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1102 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1103 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1104 (decode_coding_region, encode_coding_region, decode_coding_string):
1105 Remove unused compatibility macros.
1106 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1107 (record_conversion_result): Adjust user.
1108 (syms_of_coding): Likewise.
1109 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1110 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1111 (decode_coding_object): Simplify since xrealloc never returns NULL.
1112 Add eassert.
1113
0bafabe7 11142013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 1115
9b1c3271 1116 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
1117 * sysdep.c (list_system_processes)
1118 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 1119 Make it a stub in this case; otherwise the build might fail,
0845a75c 1120 and this code hasn't been tested on such hosts anyway.
725eb027 1121 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
1122 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1123 and analyzed by Jérémie Courrèges-Anglas in
1124 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 1125
ffc65bee
DA
11262013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1127
1128 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1129 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1130 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1131 * bidi.c (bidi_find_paragraph_start): Likewise.
1132 * indent.c (vmotion): Likewise.
1133
70743157
PE
11342013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1135
1136 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1137 * filelock.c: Include <c-ctype.h>.
1138 (MAX_LFINFO): New top-level constant.
1139 (lock_info_type): Remove members pid, boot_time. Add members at,
1140 dot, colon. Change user member to be the entire buffer, not a
1141 pointer. This allows us to handle the case where a foreign
1142 pid or boot time exceeds the local range. All uses changed.
1143 (LINKS_MIGHT_NOT_WORK): New constant.
1144 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1145 (defined_WINDOWSNT): Remove.
1146 (MAKE_LOCK_NAME, file_in_lock_file_name):
1147 Always use .#FILE (not .#-FILE) for the file lock,
1148 even if it is a regular file.
1149 (rename_lock_file): New function.
1150 (create_lock_file): Use it.
1151 (create_lock_file, read_lock_data):
1152 Prefer a symbolic link for the lock file, falling back on a
1153 regular file if symlinks don't work. Do not try to create
1154 symlinks on MS-Windows, due to security hassles. Stick with
1155 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1156 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1157 host may be using a Windowsish file system, and cannot use
1158 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1159 doesn't work. Don't fail merely because of a symlink-contents
1160 length limit in the current file system; fall back on regular
1161 files. Increase the symlink contents length limit to 8 KiB, this
1162 should be big enough for any real use and doesn't crunch the
1163 stack.
1164 (create_lock_file, lock_file_1, read_lock_data):
1165 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1166 (lock_file_1): Return error number, not bool. All callers changed.
1167 (ELOOP): New macro, if not already defined.
1168 (read_lock_data): Return size of lock file contents, not Lisp object.
1169 All callers changed. Handle a race condition if some other process
1170 replaces a regular-file lock with a symlink lock or vice versa,
1171 while we're trying to read the lock.
1172 (current_lock_owner): Parse contents more carefully, to help avoid
1173 confusing a regular-file lock with some other application's use
1174 of the file. Check for lock file contents being too long, or
1175 not parsing correctly.
1176 (current_lock_owner, lock_file):
1177 Allow foreign pid and boot times that exceed the local range.
1178 (current_lock_owner, lock_if_free, lock_file):
1179 Simplify allocation of lock file contents.
1180 * w32.c (sys_rename_replace): New function, containing most of
1181 the contents of the old sys_rename.
1182 (sys_rename): Use it.
1183 (fchmod): New dummy function.
1184 * w32.h (sys_rename_replace, fchmod): New decls.
1185
05e193f1
EZ
11862013-03-05 Eli Zaretskii <eliz@gnu.org>
1187
1188 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1189 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1190 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1191 <dmantipov@yandex.ru>.
1192
3bfc46eb
DA
11932013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1194
1195 * composite.c (get_composition_id, fill_gstring_header):
1196 Use make_uninit_vector where appropriate.
1197 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1198 * xselect.c (clean_local_selection_data): Likewise.
1199
84ac6f9d
PE
12002013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1201
1202 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1203 * image.c (imagemagick_load_image): Calculate height and width
1204 after flattening the image, not before.
1205
42926ec8
DA
12062013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1207
1208 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1209 * ftfont.c (ftfont_shape_by_flt): Likewise.
1210 * w32uniscribe.c (uniscribe_shape): Likewise.
1211
b5029e23
PE
12122013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1213
1214 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1215 The old approach, which fell back on DIR/.#FILE.0 through
1216 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1217 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1218 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1219 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1220 because the locking mechanism was never reliable in that case).
1221 This patch fixes this and other bugs discovered by a code
1222 inspection that was prompted by
1223 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1224 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1225 to avoid interoperability problems between the MS-Windows and
1226 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1227 instances of Emacs now ignore each others' locks.
1228 * filelock.c (defined_WINDOWSNT): New constant.
1229 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1230 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1231 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1232 regular files on MS-Windows hosts.
1233 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1234 Use SAFE_ALLOCA to avoid problems with long file names.
1235 (MAX_LFINFO): Now a local constant, not a global macro.
1236 (IS_LOCK_FILE): Remove.
1237 (lock_file_1): Don't inspect errno if symlink call succeeds;
1238 that's not portable.
1239 (lock_file): Document that this function can return if lock
1240 creation fails.
2db41375 1241 (lock_file): Don't access freed storage.
b5029e23 1242
b270d116
AS
12432013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1244
1245 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1246
81c23309
PE
12472013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1248
1249 * textprop.c: Use bool for booleans.
1250 (validate_interval_range, Fadd_text_properties)
1251 (Fremove_text_properties): Prefer bool to int when either works.
1252
18f2ac09
EZ
12532013-03-02 Eli Zaretskii <eliz@gnu.org>
1254
27a98a62
SM
1255 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1256 If the interval tree changes as a side effect of calling
18f2ac09
EZ
1257 modify_region, re-do processing starting from the call to
1258 validate_interval_range. (Bug#13743)
1259
929aeac6 12602013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
1261
1262 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1263 (Bug#13546).
1264
531e70ec
EZ
12652013-02-27 Eli Zaretskii <eliz@gnu.org>
1266
1267 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1268 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1269 access to the lock file until it is written and closed.
1270 (Bug#13807)
1271
6e65b9cc
PE
12722013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1273
1274 * callint.c (Qcall_interactively):
1275 * macros.c (Qexecute_kbd_macro):
1276 Now static.
1277
3b166f09
BG
12782013-02-26 Bastien Guerry <bzg@gnu.org>
1279
1280 * window.c (Frecenter): Tiny docstring enhancement.
1281
ecc0fdd4
PE
12822013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1283
1284 Minor textprop integer cleanup.
1285 * intervals.h, textprop.c (add_text_properties_from_list):
1286 Return void, not int, since nobody uses the return value.
1287 * textprop.c (validate_plist, add_properties, remove_properties)
1288 (Fadd_text_properties):
1289 Don't assume list length fits in int.
1290 (interval_has_all_properties, interval_has_some_properties)
1291 (interval_has_some_properties_list, add_properties, remove_properties)
1292 (Fadd_text_properties, Fremove_text_properties)
1293 (Fremove_list_of_text_properties, text_property_stickiness):
1294 Use bool for booleans.
1295 (Fadd_text_properties, Fremove_text_properties):
1296 (Fremove_list_of_text_properties):
1297 Reindent do-while as per GNU style.
1298
0248b0d7
EZ
12992013-02-25 Eli Zaretskii <eliz@gnu.org>
1300
343a2aef
EZ
1301 Implement CLASH_DETECTION for MS-Windows.
1302
1303 * filelock.c [WINDOWSNT]: Include w32.h.
1304 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1305 function of that name. Up-case the macro arguments.
1306 (IS_LOCK_FILE): New macro.
1307 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1308 (create_lock_file): New function, with body extracted from
1309 lock_file_1.
1310 [WINDOWSNT]: Implement lock files by writing a regular file with
1311 the lock information as its contents.
1312 (read_lock_data): New function, on Posix platforms just calls
1313 emacs_readlinkat.
1314 [WINDOWSNT]: Read the lock info from the file.
1315 (current_lock_owner): Call read_lock_data instead of calling
1316 emacs_readlinkat directly.
1317 (lock_file) [WINDOWSNT]: Run the file name through
1318 dostounix_filename.
1319
1320 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1321 just check if the process by that PID exists.
1322
1323 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1324 also present, as doing so will fail to error out if the file
1325 already exists.
1326
1327 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1328
0248b0d7
EZ
1329 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1330 (Fremove_list_of_text_properties): Skip all of the intervals in
1331 the region between START and END that already have resp. don't
27a98a62
SM
1332 have the requested properties, not just the first one.
1333 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
1334 properties. (Bug#13743)
1335
b5071fc7
SM
13362013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1337
1338 * callint.c (Fcall_interactively): Use the right lexical environment
1339 for `interactive' specs (bug#13811).
1340 * eval.c (Feval): Accept a lexical environment.
1341
1ddc2bd6
PE
13422013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1343
1344 Simplify data_start configuration (Bug#13783).
1345 This is a followon simplification to the fix for Bug#13650.
1346 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1347 (START_FILES): Remove. All uses removed.
1348 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1349 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1350 (buildobj.h): Use it.
1351 ($(ALLOBJS)): Depend on globals.h.
1352 (temacs$(EXEEXT)): Use $(ALLOBJS).
1353 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1354 * deps.mk (vm-limit.o):
1355 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1356 Do not depend on mem-limits.h.
1357 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1358 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1359 [__GNUC__ && !ORDINARY_LINK]: Remove.
1360 * mem-limits.h, pre-crt0.c: Remove.
1361 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1362 * unexcoff.c (etext): New decl.
1363 (make_hdr): Use DATA_START instead of start_of_data.
1364 * vm-limit.c: Move most of mem-limits.h's contents here.
1365 (data_start): New decl. It's OK if this is approximate,
1366 so simplify-away some unnecessary exactness.
1367 (POINTER): Remove; all uses removed.
1368 (data_space_start): Now char *, to avoid casts.
1369 (exceeds_lisp_ptr): New function, replacing the old
1370 EXCEEDS_LISP_PTR macro. All uses changed.
1371 (check_memory_limits): Simplify and remove casts.
1372 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1373 (memory_warnings): Use data_start instead of start_of_data.
1374
51aa2a8b
AS
13752013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1376
1377 * xdisp.c (set_message): Only check for debug-on-message if STRING
1378 is a string. (Bug#13797)
1379
1938d88c
PE
13802013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1381
1382 Fix regression introduced by July 10 filelock.c patch.
1383 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1384 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1385 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1386 and diagnosed by Andreas Schwab in
1387 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1388
fcee5028
PE
13892013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1390
1391 Assume C89 or better.
1392 * ralloc.c (SIZE, POINTER, NIL):
1393 * vm-limit.c (POINTER):
1394 Remove, replacing all uses with C89 equivalents. These old
1395 symbols were present only for porting to pre-C89 platforms.
1396
d78cf5ed
CB
13972013-02-22 Claudio Bley <claudio.bley@gmail.com>
1398
1399 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1400 This avoids warning messages reported as part of Bug#13546.
1401
6bcd97a4
KB
14022013-02-21 Ken Brown <kbrown@cornell.edu>
1403
1404 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1405
b6c2bfff
SM
14062013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1407
e11dacb5
SM
1408 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1409
b6c2bfff
SM
1410 * keyboard.c (Qcommand_execute): New var.
1411 (command_loop_1, read_char): Use it.
1412 (Fcommand_execute): Remove, replace by an Elisp implementation.
1413 (syms_of_keyboard): Adjust accordingly.
1414
f4ad7ea1 14152013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 1416
d69f1120
DC
1417 * sheap.c (report_sheap_usage): Use message, not message1, so
1418 that we don't try to create a buffer while we're in the middle
1419 of dumping Emacs. Explain why.
b6c2bfff 1420
2a14a4f1 14212013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 1422
2a14a4f1
DA
1423 * search.c (find_newline): Return byte position in bytepos.
1424 Adjust comment.
b6c2bfff
SM
1425 (find_next_newline_no_quit, find_before_next_newline):
1426 Add bytepos argument.
2a14a4f1
DA
1427 * lisp.h (find_newline, find_next_newline_no_quit)
1428 (find_before_next_newline): Adjust prototypes.
1429 * bidi.c (bidi_find_paragraph_start):
1430 * editfns.c (Fconstrain_to_field, Fline_end_position):
1431 * indent.c (compute_motion, vmotion):
1432 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1433 (get_visually_first_element, move_it_vertically_backward):
1434 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1435
872faefb 14362013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
1437
1438 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1439 resources were not orderly released.
1440
fd80c659
EZ
14412013-02-17 Eli Zaretskii <eliz@gnu.org>
1442
1443 * xdisp.c (x_draw_vertical_border): For a window that is neither
1444 the leftmost nor the rightmost, redraw both the left and the right
1445 vertical borders. (Bug#13723)
1446
2f73da9c
SM
14472013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1448
1449 * xml.c (init_libxml2_functions):
1450 * sound.c (sound_warning):
1451 * sheap.c (report_sheap_usage):
1452 * process.c (wait_reading_process_output):
1453 * msdos.c (XMenuActivate):
1454 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1455 * keyboard.c (top_level_1):
1456 * editfns.c (Fmessage, Fmessage_box):
1457 * callint.c (Fcall_interactively):
1458 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1459
fd9547e8
JD
14602013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1461
1462 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
1463 * frame.c (syms_of_frame): ... to here.
1464
f277993b
EZ
14652013-02-16 Eli Zaretskii <eliz@gnu.org>
1466
c7939585
EZ
1467 * w32.c (sys_chown): Remove unused function.
1468
cd91fb4b
EZ
1469 * w32term.c <input_signal_count>: Declare 'volatile'
1470 unconditionally. (Bug#9066)
1471
f277993b
EZ
1472 * w32.c (set_errno): Reset h_errno and don't set it to any other
1473 value. Set errno instead.
1474 (check_errno): Reset h_errno.
1475 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1476 (sys_gethostname, sys_getservbyname, sys_getpeername)
1477 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1478 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1479 h_errno.
1480 (sys_gethostbyname): Set h_errno only errors detected.
1481
e454145b
PE
14822013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1483
1484 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1485
bcf7fe2a
EZ
14862013-02-15 Eli Zaretskii <eliz@gnu.org>
1487
ef9c57e2
EZ
1488 * keyboard.c (read_char): Fix calculation of auto-save time out
1489 when auto-save-timeout is less than 4. (Bug#13720)
1490
ef862e20 1491 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 1492 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 1493
bcf7fe2a
EZ
1494 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1495 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1496 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1497 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1498 make sure errno is set to an appropriate value. (Bug#13546)
1499 (socket_to_fd): Add assertion against indexing fd_info[] with a
1500 value that is out of bounds.
1501 (sys_accept): If fd is negative, do not set up the child_process
1502 structure for reading.
1503
0063fdb1
DA
15042013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1505
1506 * composite.c (fill_gstring_header): Remove useless prototype.
1507 Break long line.
1508 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1509 * print.c (PRINTDECLARE, print_object):
1510 * search.c (compile_pattern, fast_looking_at, search_buffer):
1511 (simple_search, boyer_moore, Freplace_match):
1512 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1513 (get_overlay_arrow_glyph_row, display_mode_element):
1514 (decode_mode_spec_coding, message3):
1515 * xfaces.c (face_at_string_position): Use bool for booleans.
1516 Adjust comments.
1517
648e5523 15182013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 1519
35b3a27e
PE
1520 Fix AIX port (Bug#13650).
1521 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1522 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1523 was #undeffed earlier, so it cannot be used as a macro here.
1524 Use the constant and not the macro.
35b3a27e 1525
648e5523 15262013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 1527
0e4e7b74
EZ
1528 * w32proc.c (new_child): If no vacant slots are found in
1529 child_procs[], make another pass looking for slots whose process
1530 has exited or died. (Bug#13546)
1531
6e432f0c
EZ
1532 * w32.c (sys_pipe): When failing due to file descriptors above
1533 MAXDESC, set errno to EMFILE.
1534 (_sys_read_ahead): Update cp->status when failing to read serial
1535 communications input, so that the status doesn't stay at
1536 STATUS_READ_IN_PROGRESS. (Bug#13546)
1537
51b3a99c
JD
15382013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1539
1540 * gtkutil.c (tb_size_cb): New function.
1541 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1542
e31560a7
SM
15432013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1544
1545 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1546 an event.
1547
fe336261
SM
15482013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1549
1550 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1551
5a655b9f
DA
15522013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1553
1554 * font.c (font_range): Add pos_byte argument. Adjust comment
1555 and break long line.
1556 * font.h (font_range): Adjust prototype.
1557 * composite.c (autocmp_chars): Pass byte position to font_range.
1558 Break long line. Remove useless prototype and format comment.
1559
1a359750
GM
15602013-02-13 Glenn Morris <rgm@gnu.org>
1561
1562 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1563
01fcc3a5 15642013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 1565
f53f992a
PE
1566 Improve AIX port some more (Bug#13650).
1567 With this, it should be as good as it was in 23.3, though it's
1568 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1569 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1570 * unexaix.c (start_of_text): Remove.
1571 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1572 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1573 (orig_load_scnptr, orig_data_scnptr):
1574 Now off_t, not long, since they are file offsets.
1575 (make_hdr): Use _data, not start_of_data ().
1576 This is the key part of the fix.
1577 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1578 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1579
4458c255
PE
1580 * pre-crt0.c (data_start): Initialize to 1.
1581 This ports to compilers that optimize the external declaration
1582 'int x = 0;' as if it were 'int x;' to shrink the executable.
1583
227be86d
PE
1584 Improve AIX port (Bug#13650).
1585 This doesn't fix the bug, but it makes progress: Emacs builds now.
1586 * unexaix.c: Include inttypes.h, stdarg.h.
1587 (report_error, report_error_1): Mark as _Noreturn.
1588 (report_error): Don't report the wrong errno.
1589 (report_error_1): Now varargs. All callers changed.
1590 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1591 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1592 (write_ptr): Use %p to print address rather than %lx and a cast
1593 to unsigned long. Grow buffer a bit, to be safer.
1594
01fcc3a5 15952013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
1596
1597 * bidi.c (bidi_resolve_neutral): After finding the next
1598 non-neutral character, accept NEUTRAL_ON type as well, because
1599 directional control characters, such as LRE and RLE, have their
1600 type converted to that by bidi_resolve_weak. This avoids aborts
1601 when LRE/RLE follows a run of neutrals.
1602 (bidi_move_to_visually_next): Assert that return value of
1603 bidi_peek_at_next_level is non-negative. Negative values will
1604 cause an infloop.
1605
83be8524
PE
16062013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1607
1608 Minor getenv-related fixes.
1609 * callproc.c (Fcall_process_region) [!DOS_NT]:
1610 Avoid unnecessary duplicate call to getenv.
1611 * callproc.c (init_callproc):
1612 * dispnew.c (init_display):
1613 * sysdep.c (sys_subshell):
1614 Omit unnecessary cast of getenv or egetenv.
1615
45b2b768
JB
16162013-02-13 Juanma Barranquero <lekktu@gmail.com>
1617
1618 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1619 Update dependencies.
1620
33b49d71
EZ
16212013-02-12 Eli Zaretskii <eliz@gnu.org>
1622
1623 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1624 marker's position.
1625 (display_line): Set w->region_showing to the value of
1626 it->region_beg_charpos, not to -1. This fixes redisplay
1627 optimization when cursor is moved up after M->. (Bug#13623)
1628 (Bug#13626)
c4131562
EZ
1629 (try_scrolling): Scroll text up more if point is too close to ZV
1630 and inside the scroll margin. This makes sure point is moved
1631 outside the scroll margin in these cases.
33b49d71
EZ
1632
1633 * window.h (struct window): region_showing can no longer be
1634 negative.
1635
b09a4810
PE
16362013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1637
a84b7c53
PE
1638 Tune by using memchr and memrchr.
1639 * doc.c (Fsnarf_documentation):
1640 * fileio.c (Fsubstitute_in_file_name):
1641 * search.c (find_newline, scan_newline):
1642 * xdisp.c (pos_visible_p, display_count_lines):
1643 Use memchr and memrchr rather than scanning byte-by-byte.
1644 * search.c (find_newline): Rename from scan_buffer.
1645 Omit first arg TARGET, as it's always '\n'. All callers changed.
1646
b09a4810
PE
1647 Clean up read_key_sequence a tiny bit more.
1648 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1649 (read_key_sequence): Remove unused locals.
1650
99d0d6dc
SM
16512013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1652
1653 Clean up read_key_sequence a bit; reread active keymaps after first event.
1654 * keyboard.c (read_char, read_char_x_menu_prompt)
1655 (read_char_minibuf_menu_prompt):
1656 Replace nmaps+maps with a single `map' arg.
1657 (follow_key): Operate on a single map.
1658 (active_maps): New function.
1659 (test_undefined): Also return true for nil bindings.
1660 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1661 a single (composed) keymap. Remember `first_event' to choose the right
1662 set of active keymaps. Recompute the set of keymaps after receiving
1663 the first event. Remove GOBBLE_FIRST_EVENT.
1664 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1665 * keyboard.h (read_char): Update declaration.
1666 * lread.c (read_filtered_event): Adjust call to read_char.
1667
f5e1b680
EZ
16682013-02-11 Eli Zaretskii <eliz@gnu.org>
1669
99d0d6dc
SM
1670 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1671 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
1672 in the window. (Bug#13675)
1673
f74de345
DA
16742013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1675
1676 * marker.c (set_marker_internal): If desired position is passed
1677 as a marker, avoid call to buf_charpos_to_bytepos.
1678 * window.c (Fset_window_point): Omit redundant type checking.
1679 (Fset_window_start): Likewise. Format comment.
1680 (window_scroll_pixel_based): Use set_marker_restricted_both
1681 with character and byte positions obtained from an iterator.
1682 (Fset_window_configuration): Use set_marker_restricted_both.
1683 * xdisp.c (message_dolog): Likewise.
1684
a4ba3963
EZ
16852013-02-10 Eli Zaretskii <eliz@gnu.org>
1686
99d0d6dc
SM
1687 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1688 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
1689 too far. This speeds up some redisplay operations. (Bug#13675)
1690
68643cde
DA
16912013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1692
1693 * syntax.c (scan_sexps_forward): Fix byte position calculation
1694 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1695
7ba11bee
PE
16962013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1697
1698 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1699 that was not needed.
1700
eff1c190
PE
17012013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1702
1703 Minor hashing refactoring.
1704 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1705 (sxhash_float): Return EMACS_UINT, for consistency with the other
1706 hash functions.
1707 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1708 non-static inline function and therefore can't use static vars.
1709 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1710 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1711 with the other hash functions.
1712
6b48c831
EZ
17132013-02-09 Eli Zaretskii <eliz@gnu.org>
1714
4dde2087
EZ
1715 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1716 XXXXXX part of the temporary file pattern is not downcased even
1717 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 1718
8549f9e8
EZ
1719 * xdisp.c (decode_mode_spec): Remove handling of %t.
1720
6b48c831
EZ
1721 * msdos.c (careadlinkatcwd): Remove.
1722
75a65c7e
SM
17232013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1724
1725 * lread.c (skip_dyn_bytes): New function (bug#12598).
1726 (read1): Use it. Use getc instead of READCHAR to read bytes.
1727 (load_each_byte): Remove. Update users.
1728
8ca30920
DA
17292013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1730
1731 * search.c (scan_buffer): Calculate end byte position just once.
1732 (scan_newline): Do not recalculate start_byte.
1733 (search_command): Use eassert.
1734 * syntax.c (struct lisp_parse_state): New member location_byte.
1735 (scan_sexps_forward): Record from_byte and avoid redundant
1736 character to byte position calculation ...
1737 (Fparse_partial_sexp): ... here. Break too long line.
1738
25721f5b
DA
17392013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1740
1741 * lisp.h (make_uninit_vector): New function.
1742 * alloc.c (Fvector, Fmake_byte_code):
1743 * ccl.c (Fregister_ccl_program):
1744 * charset.c (Fdefine_charset_internal, define_charset_internal):
1745 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1746 * composite.c (syms_of_composite):
1747 * font.c (Fquery_font, Ffont_info, syms_of_font):
1748 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1749 * ftfont.c (ftfont_shape_by_flt):
1750 * indent.c (recompute_width_table):
1751 * nsselect.m (clean_local_selection_data):
1752 * syntax.c (init_syntax_once):
1753 * w32unsubscribe.c (uniscribe_shape):
1754 * window.c (Fcurrent_window_configuration):
1755 * xfaces.c (Fx_family_fonts):
1756 * xselect.c (selection_data_to_lisp_data): Use it.
1757
9a9d91d9
DA
17582013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1759
1760 * coding.c (Fdefine_coding_system_internal): Use AREF where
1761 argument is known to be a vector.
1762 * fns.c (Flocale_info): Likewise for ASET.
1763 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1764 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1765
6871e574
JD
17662013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1767
1768 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1769 height.
1770
1771 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1772 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1773 updateCollectionBehaviour.
1774
1775 * nsterm.m (NEW_STYLE_FS): Remove.
1776 (ns_last_use_native_fullscreen): New variable.
1777 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1778 (x_set_window_size): Do not take title bar and tool bar into account
1779 if isFullscreen returns YES.
1780 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1781 (check_native_fs): New function.
1782 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1783 (ns_term_init): Remove NEW_STYLE_FS.
1784 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1785 and tool bar if isFullscreen returns NO.
1786 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1787 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1788 with HAVE_NATIVE_FS.
1789 (window:willUseFullScreenPresentationOptions:): New method.
1790 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1791 Hide toolbar if not enabled (Bug#13444).
1792 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1793 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1794 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1795 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1796 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1797 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1798 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1799 (syms_of_nsterm): Add ns-use-native-fullscreen.
1800
3f011c7f
PE
18012013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1802
1803 * fileio.c (Qchoose_write_coding_system): Now static.
1804
86f7c0fe
EZ
18052013-02-04 Eli Zaretskii <eliz@gnu.org>
1806
1807 * xdisp.c (window_buffer_changed): region_showing can be negative,
1808 which still means region is being displayed.
1809 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
1810 whole window when showing region and the mark has changed.
1811 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
1812 (display_line): If it->region_beg_charpos is non-zero, set the
1813 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1814
1815 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1816 not bitfield of 1 bit.
1817
5257b701
DC
18182013-02-03 Daniel Colascione <dancol@dancol.org>
1819
1820 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1821 daemon mode works on cygw32 when Emacs is installed and not just
1822 during development.
1823
8ea41ea9
PE
18242013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1825
1826 Avoid file time stamp bug on MS-Windows (Bug#13149).
1827 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1828 as FAT32 doesn't update time stamps when truncating them.
1829 Also, check that a file time stamp is not a multiple of 100 ns;
1830 this should catch all instances of the problem on MS-Windows,
1831 as its native file system resolution is 100 ns or worse, and
1832 checking for a non-multiple of 100 ns should impose only a small
1833 overhead on systems with ns resolution.
1834
94fbc901 18352013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 1836
e7ac588e
EZ
1837 Avoid encoding file names on MS-Windows when they need to be run
1838 through dostounix_filename.
1839 * w32.c (normalize_filename): Accept an additional argument
1840 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1841 downcase it even if w32-downcase-file-names is non-nil.
1842 (dostounix_filename): Accept an additional argument MULTIBYTE and
1843 pass it to normalize_filename.
1844 (emacs_root_dir): Adjust.
1845
1846 * msdos.h (dostounix_filename): Adjust prototype.
1847
1848 * w32.h (dostounix_filename): Adjust prototype.
1849
1850 * msdos.c (dostounix_filename): Accept an additional argument and
1851 ignore it.
1852 (init_environment): Adjust callers of dostounix_filename.
1853
1854 * fileio.c (Ffile_name_directory, file_name_as_directory)
1855 (directory_file_name, Fexpand_file_name)
1856 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1857 dostounix_filename.
1858 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1859 non-nil.
1860 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1861 variables, as egetenv is case-insensitive for DOS_NT.
1862
1863 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1864 with an encoded file name.
1865
99d0d6dc
SM
1866 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1867 Adjust calls to dostounix_filename.
e7ac588e
EZ
1868
1869 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1870
1871 * unexw32.c (unexec): Adjust call to dostounix_filename.
1872
1873 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1874
1875 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1876 dostounix_filename.
1877
1878 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1879 dostounix_filename.
1880
e7c3fb06
EZ
1881 * callproc.c (Fcall_process): Make sure program name in PATH and
1882 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1883 is passed to exec/spawnve, which fails unless the file-name
1884 encoding is UTF-8.
1885
18a80473
EZ
1886 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1887 even if w32-quote-process-args is nil.
1888
35e85499
PE
18892013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1890
1891 Fix timestamp bug when write-region appends nothing (Bug#13149).
1892 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1893 the file's time stamp doesn't change if Emacs happens to write nothing
1894 to the file, and on a buggy file system this could cause Emacs to
1895 incorrectly infer that the file system doesn't have the bug.
1896 Avoid this problem by inhibiting the inference in this case.
1897
422ff52b
DA
18982013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1899
1900 * window.h (struct window): Convert base_line_number, base_line_pos
1901 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1902 Convert region_showing member from Lisp_Object to bitfield.
1903 Remove sequence_number member. Adjust comments.
1904 * window.c (sequence_number): Remove.
1905 (make_window): Initialize column_number_displayed.
1906 * print.c (print_object): Follow the printed representation of
1907 frames and print window pointer to distinguish between windows.
1908 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1909 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1910 (wset_column_number_displayed, wset_region_showing): Remove.
1911 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1912 (try_scrolling, try_cursor_movement, redisplay_window)
1913 (try_window_reusing_current_matrix, try_window_id, display_line)
1914 (display_mode_lines, decode_mode_spec): Adjust users.
1915 * .gdbinit (pwinx): Do not print sequence_number.
1916
8654f9d7
PE
19172013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1918
1919 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1920 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1921 * dired.c: Include <fcntl.h>.
1922 (open_directory): New function, which uses open and fdopendir
1923 rather than opendir. DOS_NT platforms still use opendir, though.
1924 (directory_files_internal, file_name_completion): Use it.
1925 (file_attributes): New function, with most of the old Ffile_attributes.
1926 (directory_files_internal, Ffile_attributes): Use it.
1927 (file_attributes, file_name_completion_stat): First arg is now fd,
1928 not dir name. All uses changed. Use fstatat rather than lstat +
1929 stat.
1930 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1931 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1932 (emacs_readlinkat): New function, with much of the old
1933 Ffile_symlink_p, but with an fd argument for speed.
1934 It uses readlinkat rather than careadlinkatcwd, so that it
1935 need not assume the working directory.
1936 (Ffile_symlink_p): Use it.
1937 * filelock.c (current_lock_owner): Use emacs_readlinkat
1938 rather than emacs_readlink.
1939 * lisp.h (emacs_readlinkat): New decl.
1940 (READLINK_BUFSIZE, emacs_readlink): Remove.
1941 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1942 (emacs_norealloc_allocator, emacs_readlink): Remove.
1943 This stuff is moved to fileio.c.
1944 * w32.c (fstatat, readlinkat): New functions.
1945 (careadlinkat): Don't check that fd == AT_FDCWD.
1946 (careadlinkatcwd): Remove; no longer needed.
1947
9dbda100
GM
19482013-01-31 Glenn Morris <rgm@gnu.org>
1949
1950 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
1951 (Fwrite_region): Update for new choose_write_coding_system args.
1952 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
1953 (syms_of_fileio): Add choose-write-coding-system.
1954
3f82a88a 19552013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
1956
1957 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1958 (sys_close): Zero out the flags for the file descriptor before
1959 closing it. (Bug#13546)
1960
806fed21 1961 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
1962 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1963 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
1964 DBCS. (Bug#13553)
1965
6ee4509a
EZ
1966 * w32.c (w32_get_long_filename, init_environment, readlink):
1967 Support file names encoded in DBCS codepages.
26854e9c
EZ
1968 (readlink): Use the current file-name-coding-system, not the ANSI
1969 codepage, to decode and handle targets of symlinks.
6ee4509a 1970
cf01a359
EZ
19712013-01-28 Eli Zaretskii <eliz@gnu.org>
1972
1973 * w32.c (opendir): Now accepts a 'const char *'.
1974
6fd326b7
DA
19752013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1976
1977 Remove obsolete redisplay code. See the discussion at
1978 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1979 * dispnew.c (preemption_period, preemption_next_check): Remove.
1980 (Vredisplay_preemption_period): Likewise.
1981 (update_frame, update_single_window, update_window, update_frame_1):
1982 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1983 used, following the 2012-06-22 change.
1984
d8cd7742
EZ
19852013-01-25 Eli Zaretskii <eliz@gnu.org>
1986
1987 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1988
266fee4f
DA
19892013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1990
1991 * font.c (num_fonts): Remove the leftover from old
1992 debugging code. Adjust comment style here and there.
59e624b3
DA
1993 * insdel.c (insert_1): Remove.
1994 * lisp.h (insert_1): Remove prototype.
1995 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 1996
830e46e6 19972013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
1998
1999 * w32.c (max_filename_mbslen): New function.
2000 (normalize_filename, readdir): Use it to detect locales where ANSI
2001 encoding of file names uses a double-byte character set (DBCS).
2002 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
2003 CharNextExA, instead of incrementing a 'char *' pointer.
2004 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 2005
81abbb95
EZ
2006 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2007 request of memory reservation to 1.7GB. (Bug#13065)
2008
830e46e6 20092013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
2010
2011 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2012 at check_extra_latin label. (Bug#13505)
2013
fd3ceb09
DA
20142013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2015
2016 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2017 Avoid redundant calls to strlen.
2018
edfa7fa0
DA
20192013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2020
2021 Drop async_visible and async_iconified fields of struct frame.
2022 This is possible because async input is gone; for details, see
2023 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2024 * frame.h (struct frame): Remove async_visible and async_iconified
2025 members, convert garbaged to unsigned bitfield. Adjust comments.
2026 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2027 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2028 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2029 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2030 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2031 * w32term.c: Ditto.
2032 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2033 properly. Likewise for obscured.
2034 * xterm.c: Ditto.
266fee4f 2035 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
2036 properly.
2037 * nsterm.m: Ditto.
2038 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2039
5ad86e34
DA
20402013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2041
2042 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2043 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2044
b09cca6a
SM
20452013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2046
2047 * xdisp.c (message2, message2_nolog): Remove functions.
2048 (message3, message3_nolog): Extract nbytes and multibyteness directly
2049 from the string. Change all callers.
2050 (message3_nolog): Don't set message_enable_multibyte since set_message
2051 will reset it anyway.
2052 (message1, message1_nolog): Use message3.
2053 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2054 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2055 (set_message): Drop all but the second arg, which has to be a string.
2056 (set_message_1): Simplify now that we know that a1 is NULL and the
2057 second arg is a string.
2058 * frame.h (struct frame): Remove `message_buf' field.
2059 Use glyphs_initialized_p instead.
2060 (FRAME_MESSAGE_BUF): Remove macro.
2061 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2062 * lisp.h (message2, message2_nolog): Remove declarations.
2063 (message3, message3_nolog): Update declarations.
2064 * keyboard.c (read_char_minibuf_menu_text)
2065 (read_char_minibuf_menu_width): Remove vars.
2066 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2067 to correctly handle multibyte strings.
2068 * frame.c (delete_frame): Don't free message_buf any more.
2069 * editfns.c (message_text, message_length): Remove vars.
2070 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2071 * fileio.c (auto_save_error): Use message3 instead of message2.
2072 * dispnew.c (adjust_frame_message_buffer): Remove function.
2073
54ab1c5a
EZ
20742013-01-23 Eli Zaretskii <eliz@gnu.org>
2075
2076 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2077 real estate used for the tool bar and the menu bar.
2078
6c27465b
DA
20792013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2080
2081 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2082 hidden buffer is prepared to modification (Bug#13164).
2083
9d93ce29
DA
20842013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2085
2086 * window.h (struct window): Change window_end_valid member from
2087 Lisp_Object to a bitfield. Adjust comments.
2088 (wset_window_end_valid): Remove.
2089 * window.c (adjust_window_count): Clear window_end_valid.
2090 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2091 (Fwindow_line_height, set_window_buffer, Frecenter)
2092 (Fsplit_window_internal, Fdelete_other_windows_internal)
2093 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2094 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2095 * xdisp.c (check_window_end, reconsider_clip_changes)
2096 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2097 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2098 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2099
1dcb8ea2
DA
21002013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2101
2102 * xdisp.c (mark_window_display_accurate): Simplify the loop
2103 assuming that the only one of vchild, hchild or buffer window
2104 slots is non-nil. Call mark_window_display_accurate_1 for
2105 the leaf windows only.
2106 (mark_window_display_accurate_1): Always assume leaf window.
2107 Adjust comment.
2108
b41b8a7e
PE
21092013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2110
593a5f2e
PE
2111 * emacs.c (Qkill_emacs_hook): Now static.
2112
b41b8a7e
PE
2113 * fileio.c (Finsert_file_contents): Simplify.
2114 Remove unnecessary assignments and tests.
2115
84e5ed96
EZ
21162013-01-21 Eli Zaretskii <eliz@gnu.org>
2117
2118 * w32.c (acl_set_file): Don't test for errors unless
2119 set_file_security returns FALSE. Avoids spurious errors when
2120 saving files.
2121
2ef88fd4
DA
21222013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2123
2124 * fileio.c (Finsert_file_contents): Revert code introduced at
2125 2013-01-18 in favor of the simpler and generally better fix.
2126 Save stack space by removing 'buffer' and reusing 'read_buf'
2127 where appropriate.
2128
d7a0a7c9
PE
21292013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2130
2131 * lisp.h (eabs): Define unconditionally (Bug#13419).
2132 The old "#if !defined (eabs)" was an unnecessary revenant of back
2133 when this macro was called "abs". Document 'eabs' better.
2134
795e7a5b 21352013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
2136
2137 * fns.c (Frandom): Doc fix.
2138
59ac2d13
EZ
21392013-01-19 Eli Zaretskii <eliz@gnu.org>
2140
2141 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2142 segfault when there are lots of overlays.
2143
2144 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
2145 when there are lots of overlays.
2146 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
2147 for the details and a way to reproduce.
2148
b3fbb395
PE
21492013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2150
3a955a1f
PE
2151 * fileio.c: Use O_APPEND to append.
2152 This corresponds better to the natural interpretation of "append",
2153 and avoids the need to open the output file twice, or to invoke
2154 lseek when APPEND is neither nil nor a number.
2155 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2156 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2157 file possibly twice, and lseeking to its end; this avoids the
2158 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2159 at the same time: the combination is never needed and apparently
2160 it doesn't work with DOS_NT.
2161
21cd50b8
PE
2162 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2163 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2164
b3fbb395
PE
2165 Allow floating-point file offsets.
2166 Problem reported by Vitalie Spinu in
2167 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2168 * fileio.c (emacs_lseek): Remove.
2169 (file_offset): New function.
2170 (Finsert_file_contents, Fwrite_region): Use it.
2171
73c14218
CY
21722013-01-19 Chong Yidong <cyd@gnu.org>
2173
2174 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2175 aborting on Fsignal (Bug#13289).
2176
6a9465f3
EZ
21772013-01-19 Eli Zaretskii <eliz@gnu.org>
2178
2179 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2180 set_file_security as failure due to insufficient privileges.
2181 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 2182 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 2183
fa705c99
PE
21842013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2185
9fe43ff6
PE
2186 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2187 The bug was observed on Ubuntu operating inside a virtual machine,
2188 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2189 The workaround introduces a race condition on non-buggy hosts,
2190 but it's an unlikely race and anyway there's a nearly identical
2191 nearby race that can't be fixed.
2192 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2193 New static vars.
2194 (Fwrite_region): Test for file system time stamp bug.
2195 (init_fileio): New function.
2196 * lisp.h (init_fileio): Declare it.
2197 * emacs.c (main): Call it.
2198
fa705c99
PE
2199 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2200 and make it more consistent with other stat-failure diagnostics.
2201
e07469fa
DA
22022013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2203
99d0d6dc
SM
2204 Fix crash when inserting data from non-regular files.
2205 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
2206 for the error description produced by valgrind.
2207 * fileio.c (read_non_regular): Rename to read_contents.
2208 Free Lisp_Save_Value object used to pass parameters.
2209 (read_non_regular_quit): Rename to read_contents_quit.
2210 (Finsert_file_contents): Redesign internal file reading loop to adjust
2211 gap and end positions after each read and so help make_gap to work
2212 properly. Do not signal an I/O error too early and so do not leave
2213 not yet decoded characters in a buffer, which was the reason of
2214 redisplay crash. Use list2 to build return value. Adjust comments.
2215
67722112
PE
22162013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2217
2218 Close a race when statting and reading files (Bug#13149).
2219 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2220 This avoids a race if the file is renamed between stat and open.
2221 This race is not the problem originally noted in Bug#13149;
2222 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2223
468afbac
DA
22242013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2227 objects, related functions and macros.
2228 (make_save_value): Adjust prototype.
2229 (make_save_pointer): New prototype.
2230 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2231 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2232 * alloc.c (format_save_value): Rename to make_save_value.
2233 (make_save_pointer): New function.
2234 (record_xmalloc): Use make_save_pointer.
2235 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2236 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2237 Change users of make_save_value to make_save_pointer.
2238 Likewise for format_save_value and make_save_value.
2239
0e70695a
DA
22402013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2241
2242 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2243 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2244 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2245 debugging stubs.
2246
963ea40f
PE
22472013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2248
2249 * alloc.c (free_save_value): Now static.
2250
3346c1d0
DA
22512013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2252
2253 * keymap.c (map_keymap_internal): Use format_save_value.
2254 (map_keymap_char_table_item): Adjust accordingly.
2255 * fileio.c (non_regular_fd, non_regular_inserted)
2256 (non_regular_nbytes): Remove.
99d0d6dc
SM
2257 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2258 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
2259 (read_non_regular): Use XSAVE_ macros to extract parameters.
2260 Adjust comment.
2261 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2262 format_save_value.
2263 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2264
2b30549c
DA
22652013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2266
2267 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2268 extraction from any Lisp_Save_Value slot. Add type checking.
2269 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2270 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2271 * xselect.c: All users changed.
2272
1b971ac1
DA
22732013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2274
2275 Some convenient bits to deal with Lisp_Save_Values.
2276 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2277 (allocate_misc): Remove prototype.
2278 (format_save_value): New prototype.
2279 * alloc.c (allocate_misc): Revert back to static.
2280 (format_save_value): New function to build Lisp_Save_Value
2281 object with the specified internal structure.
2282 (make_save_value): Reimplement using format_save_value.
2283 * editfns.c (save_excursion_save): Use format_save_value.
2284 (save_excursion_restore): Use XSAVE_OBJECT.
2285
c50cf2ea
PE
22862013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2287
2288 Avoid needless casts with XSAVE_POINTER.
2289 * alloc.c (mark_object) [GC_MARK_STACK]:
2290 * dired.c (directory_files_internal_unwind):
2291 * fileio.c (do_auto_save_unwind):
2292 * gtkutil.c (pop_down_dialog):
2293 * keymap.c (map_keymap_char_table_item):
2294 * lread.c (load_unwind):
2295 * nsmenu.m (pop_down_menu):
2296 * print.c (print_object) [GC_MARK_STACK]:
2297 * xfns.c (clean_up_file_dialog):
2298 * xmenu.c (cleanup_widget_value_tree):
2299 Omit casts between XSAVE_POINTER and a pointer type.
2300
9d5a1260
DA
23012013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2302
2303 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2304 * eval.c (eval_sub): Protect `form' from being GCed before its
2305 car and cdr becomes protected with the backtrace entry.
2306
73ebd38f
DA
23072013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2308
2309 Make Lisp_Save_Value more versatile storage for up to four objects.
2310 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2311 (struct Lisp_Save_Value): New layout. Adjust comments.
2312 (XSAVE_POINTER): New macro.
2313 (XSAVE_INTEGER): Likewise.
2314 (allocate_misc): Add prototype.
2315 (free_misc): Likewise.
2316 * alloc.c (allocate_misc): Now global.
2317 (free_misc): Likewise. Adjust comment.
2318 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2319 (free_save_value): Likewise.
2320 (mark_object): Likewise.
2321 * editfns.c (save_excursion_save): Pack everything within
2322 Lisp_Save_Value and so avoid xmalloc.
2323 (save_excursion_restore): Adjust to match new layout. Use free_misc
2324 because we do not allocate extra memory any more. Add eassert.
2325 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2326 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2327 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2328 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2329 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2330
b826986f
JD
23312013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2332
2333 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2334 (nsfont_draw): Remove disabling of LCD smoothing.
2335 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 2336 Bug#11484 with LCD smoothing on.
b826986f 2337
c0511b57 23382013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 2339
b6f960a0
PE
2340 Fix SIGDANGER handlers, for AIX (Bug#13408).
2341 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2342 Move handlers here from emacs.c; they were out of place.
2343
616763d5
JD
23442013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2345
2346 * xterm.c (syms_of_xterm): Adjust documentation for
2347 scroll-bar-adjust-thumb-portion.
2348
0b59090b 23492012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
2350
2351 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2352 determine whether scroll bar thumb size should be adjusted or
2353 not. Use variable for MOTIF.
2354
2355 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2356 GTK.
2357
7bc916b4
JD
23582013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2359
eac4d08f
JD
2360 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2361 event is generated.
2362 (doCommandBySelector:): Set processingCompose to NO.
2363
7bc916b4
JD
2364 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2365 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2366 (nsfont_list_family): Add block/unblock_input calls.
2367 (nsfont_open): Move block_input earlier. Add unblock_input before early
2368 return.
2369 (nsfont_draw): Add block/unblock_input calls.
2370
bdc9b756
PE
23712013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2372
2373 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2374 for old_charpos and old_bytepos.
2375
ee56a6dc
PE
23762013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2377
2378 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2379 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2380 Clear tzvalbuf_in_environ if this workaround is in effect.
2381 Problem and fix reported by Kazuhiro Ito.
2382
9fc9a531
AH
23832013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2384
99d0d6dc
SM
2385 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2386 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
2387
2388 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2389 doc string cross-reference(s).
2390
2391 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2392 string cross-reference(s).
2393
6020559a
DA
23942013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2395
2396 Avoid unnecessary byte position calculation for the gap movement.
2397 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2398 anyway, all of them should use move_gap_both instead.
2399 * lisp.h (move_gap): Remove prototype.
2400 * insdel.c (move_gap): Remove.
2401 (move_gap_both): Add eassert.
2402 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2403 * xml.c (parse_region): Likewise.
2404
b8956427
PE
24052013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2406
2407 emacsclient -t should not suspend Emacs server (Bug#13387)
2408 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2409 New functions.
2410 * term.c (init_tty): Use them instead of rolling our own code.
2411 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2412 switches from 'signal' to 'pthread_sigmask', which is safer in
2413 multithreaded applications.
2414 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2415 which has already arranged for that.
2416 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2417 This is the main part of the bug fix.
2418
0b59090b 24192013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
2420
2421 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2422 x_last_font_name (Bug#13403).
2423
58cc0a01
DA
24242013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2425
2426 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2427 the type of per-buffer values where appropriate.
2428 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2429 predicate, which is how it's really used now. Adjust comment.
2430 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2431 * buffer.c (buffer_slot_type_mismatch): Remove.
2432 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2433 predicate. Adjust comment.
2434 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2435 fill-column, left-margin, tab-width, buffer-saved-size,
2436 left-margin-width, right-margin-width, left-fringe-width,
2437 right-fringe-width, scroll-bar-width and buffer-display-count.
2438 Use Qstringp for default-directory, buffer-file-name,
2439 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2440 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2441 line-spacing.
2442 * data.c (store_symval_forwarding): Adjust to call the predicate.
2443
5104861e
JB
24442013-01-09 Juanma Barranquero <lekktu@gmail.com>
2445
2446 * w32.c (get_name_and_id, acl_set_file):
2447 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2448
eefd7278
DA
24492013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2450
2451 * lisp.h (make_gap_1): New prototype.
2452 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2453 gap size values.
2454 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2455 naming convention.
2456 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 2457 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
2458 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2459 (make_gap_1): New function to adjust the gap of any buffer.
2460 * coding.c (coding_alloc_by_making_gap): Use it.
2461 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2462 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2463
073ca75b
JL
24642013-01-08 Juri Linkov <juri@jurta.org>
2465
2466 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2467 of (supports :underline (:style wave)). (Bug#13000)
2468
3bace969
AH
24692013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2470
2471 * undo.c (Fprimitive_undo): Move to simple.el.
2472 (syms_of_undo): Remove declarations for Sprimitive_undo.
2473
63a63bd4
SM
24742013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2475
2476 * keyboard.c (echo_add_key): Rename from echo_add_char.
2477
56ed110a
CY
24782013-01-06 Chong Yidong <cyd@gnu.org>
2479
2480 * keyboard.c (echo_add_char): New function, factored out from
2481 echo_char. Don't add a space if the previous echo string was
2482 empty (Bug#13255).
2483 (echo_char): Use it.
2484 (read_key_sequence): When echoing mock input, ensure that the
2485 trailing dash is properly added.
2486
b630991b
EZ
24872013-01-05 Eli Zaretskii <eliz@gnu.org>
2488
2489 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2490 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
2491 digits for buffer positions, before misalignment starts.
2492 Display "0" for integer "object" field.
b630991b
EZ
2493 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2494 Display the newline glyph more unambiguously.
2495
f032a318
YM
24962013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2497
2498 * nsterm.m (ns_draw_underwave):
2499 * w32term.c (w32_draw_underwave):
2500 * xterm.c (x_draw_underwave): Make underwave look more triangular
2501 and also degrade gracefully for small fonts. (Bug#13000)
2502
4240dd3c
YM
2503 * nsterm.m (ns_draw_text_decoration):
2504 * w32term.c (x_draw_glyph_string):
2505 * xterm.c (x_draw_glyph_string): Don't use previous underline
2506 thickness and position if previous underline type is underwave.
2507
553081a5
SM
25082013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2509
2510 * fileio.c (Ffile_acl): Undocument return format.
2511
9539d465 25122013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
2513
2514 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2515
71376d4b
PE
25162013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2517
2518 Simplify via eabs.
2519 * dired.c (file_name_completion):
2520 * doc.c (get_doc_string):
2521 * floatfns.c (round2):
2522 * font.c (font_score, font_delete_unmatched):
2523 * fringe.c (compute_fringe_widths):
2524 * lread.c (read_list):
2525 * minibuf.c (Ftry_completion):
2526 * term.c (tty_ins_del_lines):
2527 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2528 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2529
a7f11948
EZ
25302012-12-31 Eli Zaretskii <eliz@gnu.org>
2531
2532 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
2533 correctly.
2534 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
2535 for the bug this caused.
2536
84cc1ab6
PE
25372012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2538
2539 * coding.c (Qmac): Now static.
2540
5a1d858b
JD
25412012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2542
2543 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2544 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2545 handlebox_widget. Set toolbar_in_hbox to false/true, set
2546 toolbar_is_packed to true.
2547 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2548 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2549 Show all on TOOLBAR_TOP_WIDGET.
2550 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2551 by TOOLBAR_TOP_WIDGET.
2552 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2553 Check toolbar_is_packed.
8b745d92
JD
2554 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2555 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2556 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2557 false.
2558 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2559 (xg_update_menubar): Update title only if
2560 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2561 (xg_update_submenu): Skip tearoff only if
2562 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2563 (xg_initialize): Initialize xg_detached_menus only if
2564 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
2565
2566 * xterm.h (struct x_output): Surround handlebox_widget with
2567 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2568 toolbar_in_hbox is bool.
2569
d5e5e7b4 25702012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
2571
2572 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2573 (LIBS_GNUSTEP): Define.
2574 (LIBES): Add $(LIBS_GNUSTEP).
2575 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2576
d5e5e7b4 25772012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
2578
2579 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2580 continuation glyph on a TTY with an indication of an empty line.
2581 (Bug#13277)
2582
e7ae8039
EZ
25832012-12-29 Eli Zaretskii <eliz@gnu.org>
2584
ccad023b
EZ
2585 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2586 file's SELinux context or ACLs successfully set, nil otherwise.
2587 (Bug#13298)
8d23a331 2588 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 2589
e7ae8039
EZ
2590 * w32proc.c (reader_thread): Avoid passing NULL handles to
2591 SetEvent and WaitForSingleObject.
2592
7456e13f
PE
25932012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2594
2595 Port EXTERNALLY_VISIBLE to Clang 3.2.
2596 * conf_post.h (__has_attribute): New macro.
2597 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2598
1ab0c851
GM
25992012-12-27 Glenn Morris <rgm@gnu.org>
2600
2601 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2602 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2603
82e2a1f0 26042012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 2605
63a63bd4
SM
2606 * fileio.c (file_name_as_directory, directory_file_name):
2607 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
2608 came from a multibyte or a unibyte Lisp string; all callers
2609 adjusted. Don't assume the input string is always multibyte.
2610 (Bug#13262)
2611 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2612 don't ENCODE_FILE them, and return a unibyte string if the input
2613 was unibyte.
2614 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2615 don't assume the input strings will always be multibyte. If the
2616 input strings are multibyte, decode strings obtained from C
2617 library functions.
2618
8847a0de
DA
26192012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2620
2621 * lisp.h (toplevel): Add two notices to the comment about
2622 defining a new Lisp data type.
6cda572a
DA
2623 * print.c (print_object): If Lisp_Save_Value object's pointer
2624 is the address of a memory area containing Lisp_Objects, try
2625 to print them.
2626 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 2627
4b298d5a
DA
26282012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2629
2630 * keyboard.c (record_asynch_buffer_change): Initialize an event
2631 only if it's really needed.
2632 * frame.h (enum output_method): Remove output_mac member since
2633 it's a leftover from the deleted code.
2634 * frame.c (Fframep): Adjust user here ...
2635 * terminal.c (Fterminal_live_p): ... and here.
2636 * coding.c (Qmac): Now here because it's only used to denote
2637 end-of-line encoding type.
2638 (syms_of_coding): DEFSYM it.
2639 * frame.h (Qmac): Remove duplicated declaration.
2640
12384b01
PE
26412012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2642
2643 * window.c (select_window_1): Now static, since it's used only here.
2644
f1665bdc
EZ
26452012-12-25 Eli Zaretskii <eliz@gnu.org>
2646
2647 * window.c (window_body_cols): Subtract display margins from the
2648 window body width on TTYs as well. See
2649 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2650 for the original report.
2651
9a0d4f34
DA
26522012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2653
2654 * xdisp.c (redisplay_window): Remove inner local variable
2655 because the outer shadowed one has the same meaning.
cd78d9b1
DA
2656 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2657 set but never used.
2658 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2659 (xg_create_tool_bar): Adjust users.
9a0d4f34 2660
f9e7c67e
DA
26612012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2662
2663 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2664 * buffer.c (Fget_buffer_create): Use it to set compact field of
2665 struct buffer_text to avoid accessing an uninitialized value
2666 when compact_buffer is called for the first time.
2667 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
2668 (Fset_buffer_modified_p): Use buffer_window_count to check
2669 whether the buffer is displayed in some window.
2670 * xdisp.c (message_dolog): Likewise.
f9e7c67e 2671
299614f3
EZ
26722012-12-23 Eli Zaretskii <eliz@gnu.org>
2673
40ff07a5
EZ
2674 * w32.c (acl_set_file): If setting the file security descriptor
2675 fails, and the new DACL is identical to the existing one, silently
2676 return success. This fixes problems for users backing up their
2677 own files without having the necessary privileges for setting
2678 security descriptors.
2679
299614f3
EZ
2680 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2681 values.
2682 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2683 after WaitForSingleObject returns normally. This expedites reader
2684 thread shutdown when delete_child triggers it.
2685 (reap_subprocess): More accurate commentary for why we call
2686 delete_child only when cp->fd is negative.
2687
2688 * w32.c (sys_close): Do not call delete_child on a subprocess
2689 whose handle is not yet closed. Instead, set its file descriptor
2690 to a negative value, so that reap_subprocess will call
63a63bd4
SM
2691 delete_child on that subprocess when its SIGCHLD arrives.
2692 This avoids closing handles used for communications between sys_select
299614f3
EZ
2693 and reader_thread, which doesn't give sys_select a chance to
2694 notice that the process exited and invoke the SIGCHLD handler for
2695 it.
2696
cf162aee
JD
26972012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2698
2699 * nsfns.m (Fns_do_applescript): Run event loop until script has
2700 been executed (Bug#12969).
2701 (ns_run_ascript): Chech as_script for nil, set to nil after
2702 executing script.
2703
94900bfe
MR
27042012-12-22 Martin Rudalics <rudalics@gmx.at>
2705
2706 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2707
b2faf49c
EZ
27082012-12-22 Eli Zaretskii <eliz@gnu.org>
2709
2710 * w32term.c (w32fullscreen_hook): New function.
2711 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2712
7efa3fb3
EZ
27132012-12-21 Eli Zaretskii <eliz@gnu.org>
2714
bb085aed
EZ
2715 * fileio.c (Finsert_file_contents): Doc fix.
2716
7efa3fb3
EZ
2717 * w32proc.c (new_child, delete_child, find_child_pid): For a
2718 subprocess, consider its slot being in use as long as its process
2719 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2720 slot when a new process is started immediately after killing
2721 another one, without waiting enough time for the first process to
2722 be reaped and resources allocated for it be orderly freed.
2723 (Bug#13086)
2724 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2725
c1f02afa
CY
27262012-12-21 Chong Yidong <cyd@gnu.org>
2727
2728 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2729
5bec25eb
CY
2730 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2731
a4b0cca1 27322012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
2733
2734 * w32.c (get_name_and_id): Always pass NULL as the first argument
2735 of lookup_account_sid. Avoids crashes with UNC file names that
2736 refer to DFS domains, not to specific machine names. (Bug#12621)
2737 Remove now unused argument FNAME; all callers changed.
2738 (get_file_owner_and_group): Remove now unused argument FNAME; all
2739 callers changed.
2740
34b4b7eb
CY
27412012-12-21 Chong Yidong <cyd@gnu.org>
2742
2743 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2744 error for invalid chars, don't check for a nil return value.
2745
13002885
DA
27462012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2747
2748 Avoid calls to CHAR_TO_BYTE if byte position is known.
2749 * editfns.c (make_buffer_string_both): Use move_gap_both.
2750 (Fbuffer_string): Use make_buffer_string_both.
2751 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2752 Adjust comment.
2753 (buf_bytepos_to_charpos): Likewise.
2754 (charpos_to_bytepos): Remove.
2755 * fileio.c (Finsert_file_contents): Use move_gap_both.
2756 * search.c (Freplace_match): Likewise.
9a0d4f34 2757 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
2758 names for byte positions.
2759 * lisp.h (charpos_to_bytepos): Remove prototype.
2760 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2761 * insdel.c (move_gap): Likewise.
2762
99e9311c
PE
27632012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2764
2765 * xdisp.c (redisplay_internal): Remove now-unused local.
2766
e02230bf
SM
27672012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2768
2769 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2770 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 2771 proper value of frame-local variables (bug#13225).
e02230bf 2772
1687fb14
DA
27732012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2774
2775 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2776 Rename 4th argument since it may be buffer or string. Adjust comment.
2777 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2778
a2f07cd2
DA
27792012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2780
2781 * coding.c (Fdetect_coding_region): Do not check start and end with
2782 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2783 (code_convert_region): Likewise.
2784
474d441e
EZ
27852012-12-18 Eli Zaretskii <eliz@gnu.org>
2786
2787 * w32.c (acl_get_file, acl_set_file): Run the file name through
2788 map_w32_filename, and resolve any symlinks in the file name, like
2789 Posix platforms do.
2790 (acl_set_file): Call revert_to_self, if any privileges were
2791 enabled.
2792
8725c076
JB
27932012-12-17 Juanma Barranquero <lekktu@gmail.com>
2794
2795 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2796 ($(BLD)/w32.$(O)): Update dependencies.
2797
1e101a4b
SM
27982012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2799
2800 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2801 propagate redisplay's scrolling (if any) to the right window.
2802 (redisplay_internal): Use ensure_selected_frame.
2803 (display_mode_lines): Complete last fix.
2804 * window.c (select_window_1): New func, extracted from select_window.
2805 (select_window): Use it.
2806 * window.h (select_window_1): Declare.
2807
66447e07
EZ
28082012-12-17 Eli Zaretskii <eliz@gnu.org>
2809
2810 Emulate Posix ACL APIs on MS-Windows.
2811 * w32.c: Include sddl.h and sys/acl.h.
2812 (SDDL_REVISION_1): Define if not already defined.
2813 (g_b_init_get_security_descriptor_dacl)
2814 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2815 (g_b_init_is_valid_security_descriptor)
2816 (g_b_init_set_file_security): New static flags.
2817 (globals_of_w32): Initialize them to zero.
2818 (SetFileSecurity_Name): New string constant.
2819 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2820 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2821 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2822 (IsValidSecurityDescriptor_Proc): New typedefs.
2823 (get_file_security, get_security_descriptor_owner)
2824 (get_security_descriptor_group): Set errno to ENOTSUP.
2825 (set_file_security, get_security_descriptor_dacl)
2826 (is_valid_security_descriptor, convert_sd_to_sddl)
2827 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2828 (acl_free, acl_get_file, acl_set_file): New functions.
2829
2830 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2831
207a7ef0
PE
28322012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2833
2834 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2835 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2836 for some of that bug's symptoms can now cause Emacs to abort.
2837 Remove the workaround.
2838 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2839 The bug that caused SIGCHLD to get lost has been fixed, and the
2840 workaround for it can now cause Emacs to abort.
2841
17fdfc15
PE
28422012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2843
2844 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2845 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2846 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2847
7c3d167f
RF
28482012-12-16 Romain Francoise <romain@orebokech.com>
2849
2850 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2851 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 2852 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
2853 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2854
2855 * Makefile.in (LIBACL_LIBS): New macro.
2856 (LIBES): Use it.
2857
7d80ea23
PE
28582012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2859
2860 * fileio.c (internal_delete_file): Use bool for boolean.
2861
b0728617
EZ
28622012-12-15 Eli Zaretskii <eliz@gnu.org>
2863
2864 Fix bug #13079 on MS-Windows with temp files not being deleted.
2865 * w32.h (_child_process): New members input_file and
2866 pending_deletion.
2867 (register_child): First argument is now pid_t.
2868 (record_infile, record_pending_deletion): New prototypes.
2869
2870 * w32proc.c (new_child): Initialize input_file and
2871 pending_deletion members of the child.
2872 (delete_child): Delete the child's temporary input file, if any,
2873 that is pending deletion.
2874 (register_child): First argument is now pid_t.
2875 (record_infile, record_pending_deletion): New functions.
2876 (reap_subprocess): Fix a typo in DebPrint string.
2877 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2878
2879 * fileio.c (internal_delete_file): Return an int again: non-zero
2880 if delete-file succeeds, zero otherwise.
2881
2882 * lisp.h (internal_delete_file): Adjust prototype.
2883
2884 * callproc.c (Fcall_process): Don't overwrite infile with result
2885 of DECODE_FILE.
2886 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2887 asynchronous subprocess, record the name of the input file name,
2888 if any.
2889 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2890 delete the file, record it as pending deletion when the subprocess
2891 exits.
2892
7e90af26
EZ
28932012-12-14 Eli Zaretskii <eliz@gnu.org>
2894
2895 * editfns.c [HAVE_PWD_H]: Include grp.h.
2896
2897 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2898
97976f9f
PE
28992012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2900
2901 Fix permissions bugs with setgid directories etc. (Bug#13125)
2902 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2903 to mark it as a placeholder. The old value was often wrong.
2904 The only user of this attribute has been changed to use
2905 file-ownership-preserved-p instead, with its new group arg.
2906 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2907
26ec1f49
SM
29082012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2909
ad966fe7
SM
2910 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2911 Keep selected_window and selected_frame in sync.
26ec1f49 2912
5c207910
EZ
29132012-12-14 Eli Zaretskii <eliz@gnu.org>
2914
2915 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2916 try to get accurate owner and group information from NT file
2917 security APIs. This is to make most callers of 'stat' and
2918 'lstat', which don't need that information, much faster.
2919
26ec1f49
SM
2920 * dired.c (Ffile_attributes) [WINDOWSNT]:
2921 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
2922 owner and group information from 'lstat'.
2923
893f52d8
PE
29242012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2925
4c95c9a5
PE
2926 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2927 as that confuses set-auto-coding, so insist on the head-read
2928 returning the full 1024 bytes. Let lseek compute the tail offset;
2929 less work for us. Do not ignore I/O errors when reading the tail.
2930
893f52d8
PE
2931 * xdisp.c: Minor style fixes.
2932 (init_iterator): Hoist assignment out of if-expression.
2933 (markpos_of_region): Callers now test for sign, not for -1.
2934
40d1e434
DA
29352012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2936
2937 Minor redisplay optimization when the region length is zero.
2938 * xdisp.c (markpos_of_region): New function.
2939 (init_iterator): Do not highlight the region of zero length.
2940 (redisplay_window): Check whether the region is of non-zero length.
2941 (try_cursor_movement): Allow if the region length is zero.
2942 (try_window_reusing_current_matrix, try_window_id): Likewise.
2943
727f9739 29442012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
2945
2946 * search.c (search_buffer): Check the inverse translations of each
2947 character in pattern when the buffer being searched is unibyte.
2948 (Bug#13084)
2949
727f9739 29502012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
2951
2952 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2953 files, fixing a regression from 24.2.
645c6a30 2954 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 2955
d20704ef
PE
29562012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2957
2958 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2959 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2960 Remove unnecessary S_ISLNK test, as (contra the comments) this
2961 function can't copy symlinks. Improve quality of error message
2962 when attempting to copy files that are neither regular files nor
2963 directories.
2964
2dd61a9b
DA
29652012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2966
2967 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2968 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2969 * window.c (Frecenter):
2970 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2971 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2972
cc98b684
DC
29732012-12-12 Daniel Colascione <dancol@dancol.org>
2974
1e101a4b 2975 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
2976 the dumped Emacs is not a sparse file, greatly improving Cygwin
2977 "make bootstrap" performance.
2978
38e791fd
MA
29792012-12-11 Michael Albinus <michael.albinus@gmx.de>
2980
2981 * inotify.c (inotify_callback): Generate an Emacs event for every
2982 incoming inotify event.
2983
f9d1448f
EZ
29842012-12-11 Eli Zaretskii <eliz@gnu.org>
2985
2986 * xdisp.c (handle_face_prop): Fix logic of computing
2987 it->start_of_box_run_p.
2988 (append_space_for_newline): If the glyph row is R2L, reset the
2989 iterator's end_of_box_run_p flag before prepending the space glyph.
2990 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2991 iterator's start_of_box_run_p flag before prepending the stretch.
2992 (append_glyph, produce_image_glyph, append_composite_glyph)
2993 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2994 left_box_line_p and right_box_line_p flags of the glyph for R2L
2995 glyph rows. (Bug#13011)
2996
c6afe371
DA
29972012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2998
2999 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3000 if changed buffer is not shown in a window.
3001 * insdel.c (prepare_to_modify_buffer): Likewise.
3002 * window.c (replace_buffer_in_windows_safely): Do nothing
3003 if buffer is not shown in a window.
3004 (Fforce_window_update): Likewise if string or buffer argument
3005 is passed.
3006
1b47babd
EZ
30072012-12-11 Eli Zaretskii <eliz@gnu.org>
3008
3009 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3010 encoded_file_name, which is what it is.
3011
4c1acb95
DA
30122012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3013
3014 Consistently use marker_position and marker_byte_position.
3015 * fringe.c (Ffringe_bitmaps_at_pos):
3016 * indent.c (Fvertical_motion):
3017 * insdel.c (prepare_to_modify_buffer):
3018 * keyboard.c (make_lispy_position):
3019 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3020 (window_scroll_pixel_based, displayed_window_lines)
3021 (Fset_window_configuration):
3022 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3023 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3024 Replace direct access to marker fields with calls
3025 to marker_position and/or marker_byte_position.
3026
0eeb69fe
JB
30272012-12-11 Juanma Barranquero <lekktu@gmail.com>
3028
3029 * makefile.w32-in (SIG2STR_H): New macro.
3030 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3031 ($(BLD)/w32notify.$(O)): Update dependencies.
3032
1cf1bbd5
DC
30332012-12-10 Daniel Colascione <dancol@dancol.org>
3034
8db4b52f
DC
3035 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3036 Windows file notification functionality unless WINDOWSNT.
3037
1cf1bbd5
DC
3038 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3039 declarations.
3040
3041 * w32fns.c (cache_system_info): Initialize the global hinst
3042 variable here so various initialization calls DTRT.
3043
1e101a4b 3044 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
3045 (hinst): Remove unneeded extern declaration.
3046 (_start): Remove initialization of above variables; remove
3047 initialization of hinst, as cache_system_info now does that.
3048
3049 * emacs.c (main): Call cache_system_info early in startup; we
3050 previously weren't calling it in Cygwin builds.
3051
26ec1f49
SM
3052 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3053 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
3054 and link it to Emacs.
3055
98a07056
DA
30562012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3057
3058 Per-buffer window counters.
3059 * buffer.h (struct buffer): New member window_count.
3060 (buffer_window_count): New function.
3061 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3062 Initialize window_count.
3063 (Fkill_buffer): Verify window_count for the buffer being killed.
3064 (modify_overlay): Do not force redisplay if buffer is not shown
3065 in any window.
3066 (init_buffer_once): Initialize window_count for buffer_defaults
3067 and buffer_local_symbols.
3068 * window.h (buffer_shared): Remove declaration.
3069 (wset_buffer): Convert from inline ...
3070 * window.c (wset_buffer): ... to an ordinary function.
3071 (adjust_window_count): New function.
3072 (make_parent_window): Use it.
3073 * xdisp.c (buffer_shared): Remove.
3074 (redisplay_internal, redisplay_window): Adjust users.
3075 (buffer_shared_and_changed): Use per-buffer window counter.
3076
2b8c9064
EZ
30772012-12-10 Eli Zaretskii <eliz@gnu.org>
3078
3079 Support for filesystem notifications on MS-Windows.
3080 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3081 and this is a TTY frame, signal the caller that keyboard input is
3082 available.
3083
3084 * w32xfns.c (drain_message_queue): Now returns an int: an
3085 indication whether any WM_EMACS_FILENOTIFY messages were found in
3086 the queue.
3087
3088 * w32inevt.c (handle_file_notifications): New function.
3089 (w32_console_read_socket): Call it to process file notifications.
3090
3091 * w32console.c (initialize_w32_display): Record the main thread ID
3092 in dwMainThreadId.
3093
3094 * deps.mk (inotify.o): New dependency list.
3095
3096 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3097
3098 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3099 (WM_EMACS_END): Bump value by 1.
3100 (notification_buffer_in_use, file_notifications)
3101 (notifications_size, notifications_desc): Declare.
3102 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3103 Add prototypes.
3104
3105 * w32term.c (lispy_file_action, queue_notifications): New functions.
3106 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3107 <Qrenamed_to>: New symbols.
3108 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3109
3110 * w32notify.c: New file, implements file event notifications for
3111 MS-Windows.
3112
3113 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3114 by posting it to the w32_read_socket queue.
3115
1e101a4b 3116 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
3117
3118 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3119 (GLOBAL_SOURCES): Add w32notify.c
3120 ($(BLD)/w32notify.$(O)): New set of dependencies.
3121
3122 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3123
1e101a4b
SM
3124 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3125 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
3126 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3127 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3128 w32notify-handle-event by default.
3129
3130 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3131 syms_of_w32notify.
3132
81606b10
RS
31332012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3134
2b8c9064 3135 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 3136 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
3137
3138 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3139
3140 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3141 (syms_of_keyboard): DEFSYM it.
3142 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3143 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3144 Qfile_inotify events.
3145 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3146 special-event-map to inotify-handle-event.
3147
3148 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3149
3150 * Makefile.in (base_obj): Add inotify.o.
3151
3152 * inotify.c: New file.
3153
265c2fbf 31542012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
3155
3156 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3157
265c2fbf 31582012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
3159
3160 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3161 DWORD_PTR, for compatibility with 64-bit builds.
3162
a06ae17d 3163 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
3164 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3165 (system_process_attributes): Use SIZE_T rather than DWORD, for
3166 compatibility with 64-bit builds.
3167
265c2fbf 31682012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
3169
3170 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3171
265c2fbf 31722012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
3173
3174 * indent.c (Fvertical_motion): If a display string will be
3175 displayed on the left or the right margin, don't consider it as a
3176 factor in cursor positioning. (Bug#13108)
3177
265c2fbf 31782012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
3179
3180 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3181
5f460827
PE
31822012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3183
3184 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3185 for string length.
3186
a16e75cd
EZ
31872012-12-08 Eli Zaretskii <eliz@gnu.org>
3188
3189 * w32.c (unsetenv): Return 0 if the input string is too long.
3190
5745a7df
PE
31912012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3192
3193 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3194 * alloc.c (xputenv): New function.
3195 * dbusbind.c (Fdbus_init_bus):
3196 * emacs.c (main):
3197 * xterm.c (x_term_init):
3198 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3199 * editfns.c (initial_tz): Move static var decl up.
3200 (tzvalbuf_in_environ): New static var.
3201 (init_editfns): Initialize these two static vars.
3202 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3203 Save old TZ value on stack, if it's small.
3204 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3205 instead, use xputenv+unsetenv to set and restore TZ.
3206 (environbuf): Remove static var. All uses removed.
3207 (Fset_time_zone_rule): Do not save TZ and environ;
3208 no longer needed here.
3209 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3210 Move to inside set_time_zone_rule; they don't need file scope any more.
3211 (set_time_zone_rule): Maintain the TZ=value string separately.
3212 (syms_of_editfns): Don't initialize initial_tz;
3213 init_editfns now does it.
3214 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3215 * lisp.h (xputenv): New decl.
3216
c56efa40
FP
32172012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3218
3219 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3220
75ceee05
EZ
32212012-12-08 Eli Zaretskii <eliz@gnu.org>
3222
3223 * w32.c (unsetenv, sys_putenv): New functions.
3224
1b6dbfeb
CY
32252012-12-08 Chong Yidong <cyd@gnu.org>
3226
3227 * editfns.c (Finsert_char): Make the error message more
3228 informative (Bug#12992).
3229
d983a10b
PE
32302012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3231
7be78020
PE
3232 Simplify get_lim_data.
3233 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3234 Remove USG and vlimit methods; no longer used these days.
3235 Add #error catchall just in case.
3236
d983a10b
PE
3237 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3238 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3239 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3240 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3241 (deleted_pid_list, Fdelete_process, create_process)
3242 (record_child_status_change, handle_child_signal, deliver_child_signal)
3243 (init_process_emacs, syms_of_process):
3244 Assume SIGCHLD is defined.
3245 (parse_signal): Remove. All uses removed.
3246 (abbr_to_signal): New static function.
3247 (Fsignal_process): Use it to convert signal names to ints.
3248 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3249 kill (getpgrp (), ...).
3250 (emacs_sigaction_init): Assume SIGCHLD is defined.
3251 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3252 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3253 * syssignal.h (EMACS_KILLPG): Remove.
3254 All uses replaced by 'kill' with a negative pid.
3255 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3256 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3257
9cdde1e2
PE
32582012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3259
3260 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3261 This will cause a production Emacs to dump core instead of
3262 infinite-looping.
3263
822995f8
DA
32642012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3265
3266 * frame.c (make_frame): Do not set window's buffer to t.
3267 * window.c (Fsplit_window_internal): Likewise. Previously it was
3268 used to indicate that the window is being set up. Now we use
3269 set_window_buffer for all new windows, so the condition in ...
3270 (Fset_window_buffer): ... is always true and can be removed.
3271
ed08365b
DA
32722012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3273
3274 Convenient macro to check whether the buffer is hidden.
3275 * buffer.h (BUFFER_HIDDEN_P): New macro.
3276 * frame.c (make_frame): Use it. Adjust comment.
3277 * buffer.c (candidate_buffer): New function.
3278 (Fother_buffer, other_buffer_safely): Use it.
3279
e86f5134
EZ
32802012-12-06 Eli Zaretskii <eliz@gnu.org>
3281
3282 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3283 if the child process is still running. Instead, exit the wait
3284 loop and return zero. (Bug#13086)
3285
1700db3c
DA
32862012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3287
3288 * frame.h (x_char_width, x_char_height): Remove prototypes.
3289 * w32term.h (x_char_width, x_char_height): Likewise.
3290 * xfns.c (x_char_width, x_char_height): Remove.
3291 * w32fns.c (x_char_width, x_char_height): Likewise.
3292 * nsfns.c (x_char_width, x_char_height): Likewise.
3293 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3294 all window frames.
3295 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3296 * keyboard.c (command_loop_1): Remove prototype.
3297 (command_loop_2, top_level_1): Add static to match prototype.
3298
35fb8050
PE
32992012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3300
3301 Fix a recently-introduced delete-process race condition.
3302 * callproc.c, process.h (record_kill_process):
3303 New function, containing part of the old call_process_kill.
3304 (call_process_kill): Use it.
3305 This does not change call_process_kill's behavior.
3306 * process.c (Fdelete_process): Use record_kill_process to fix a
3307 race condition that could cause Emacs to lose track of a child.
3308
565212e5
DA
33092012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3310
3311 Avoid code duplication between prev_frame and next_frame.
3312 * frame.c (candidate_frame): New function. Add comment.
3313 (prev_frame, next_frame): Use it. Adjust comment.
3314
d8ad4d3f 33152012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
3316
3317 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3318 fails, signal an error instead of continuing with an empty
3319 string. (Bug#13079)
7c2fcf9b
EZ
3320 Encode expanded temp file pattern before passing it to mkstemp or
3321 mktemp.
d3cefd13 3322
2e7cddd3
EZ
3323 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3324 Encode the file name before passing it to dostounix_filename, in
3325 case it will downcase it (under w32-downcase-file-names).
3326 (Bug#12933)
3327
644d3f0d
PE
33282012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3329
3330 Minor call-process cleanups.
3331 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3332 at the same time as other platforms, to simplify analysis.
3333 No need for fd0_volatile since we have synch_process_fd.
3334 Avoid needless emacs_close; arg is always negative.
3335
396376f1
AS
33362012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3337
3338 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3339 processes.
3340
350f51ad
DA
33412012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3342
3343 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3344 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3345 and mouse_face_hidden members to a bitfields.
3346 * frame.h (struct frame): Remove set-but-not-used space_width member.
3347 (FRAME_SPACE_WIDTH): Remove.
3348 * nsterm.m, w32term.c, xterm.c: Adjust users.
3349 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3350 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3351 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3352 members to a bitfields.
3353
bc9dbce6
PE
33542012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3355
bb5f74ee
PE
3356 Don't let call-process be a zombie factory (Bug#12980).
3357 Fixing this bug required some cleanup of the signal-handling code.
3358 As a side effect, this change also fixes a longstanding rare race
3359 condition whereby Emacs could mistakenly kill unrelated processes,
3360 and it fixes a bug where a second C-g does not kill a recalcitrant
3361 synchronous process in GNU/Linux and similar platforms.
3362 The patch should also fix the last vestiges of Bug#9488,
3363 a bug which has mostly been fixed on the trunk by other changes.
3364 * callproc.c, process.h (synch_process_alive, synch_process_death)
3365 (synch_process_termsig, sync_process_retcode):
3366 Remove. All uses removed, to simplify analysis and so that
3367 less consing is done inside critical sections.
3368 * callproc.c (call_process_exited): Remove. All uses replaced
3369 with !synch_process_pid.
3370 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3371 These take the role of what used to be in unwind-protect arg.
3372 All uses changed.
3373 (block_child_signal, unblock_child_signal):
3374 New functions, to avoid races that could kill innocent-victim processes.
3375 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3376 (call_process_kill): Record killed processes as deleted, so that
3377 zombies do not clutter up the system. Do this inside a critical
3378 section, to avoid a race that would allow the clutter.
3379 (call_process_cleanup): Fix code so that the second C-g works again
3380 on common platforms such as GNU/Linux.
3381 (Fcall_process): Create the child process in a critical section,
3382 to fix a race condition. If creating an asynchronous process,
3383 record it as deleted so that zombies do not clutter up the system.
3384 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3385 light of these changes. Omit unnecessary call to emacs_close
3386 before failure, as the unwind-protect code does that.
3387 * callproc.c (call_process_cleanup):
3388 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3389 * process.c (record_deleted_pid): New function, containing
3390 code refactored out of Fdelete_process.
3391 (Fdelete_process): Use it.
3392 (process_status_retrieved): Remove. All callers changed to use
3393 child_status_change.
3394 (record_child_status_change): Remove, folding its contents into ...
3395 (handle_child_signal): ... this signal handler. Now, this
3396 function is purely a handler for SIGCHLD, and is not called after
3397 a synchronous waitpid returns; the synchronous code is moved to
3398 wait_for_termination. There is no need to worry about reaping
3399 more than one child now.
3400 * sysdep.c (get_child_status, child_status_changed): New functions.
3401 (wait_for_termination): Now takes int * status and bool
3402 interruptible arguments, too. Do not record child status change;
3403 that's now the caller's responsibility. All callers changed.
3404 Reimplement in terms of get_child_status.
3405 (wait_for_termination_1, interruptible_wait_for_termination):
3406 Remove. All callers changed to use wait_for_termination.
3407 * syswait.h: Include <stdbool.h>, for bool.
3408 (record_child_status_change, interruptible_wait_for_termination):
3409 Remove decls.
3410 (record_deleted_pid, child_status_changed): New decls.
3411 (wait_for_termination): Adjust to API changes noted above.
3412
bc9dbce6
PE
3413 * bytecode.c, lisp.h (Qbytecode): Remove.
3414 No longer needed after 2012-11-20 interactive-p changes.
3415
3cf3c607
EZ
34162012-12-03 Eli Zaretskii <eliz@gnu.org>
3417
3418 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3419 the scroll margin, move point outside the margin. (Bug#13055)
3420
005c8d13
JD
34212012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3422
3423 * gtkutil.c (my_log_handler): New function.
3424 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3425
20edc1c9
DA
34262012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3427
3428 * lisp.h (modify_region): Rename to...
3429 (modify_region_1): ...new prototype.
3430 * textprop.c (modify_region): Now static. Adjust users.
3431 * insdel.c (modify_region): Rename to...
3432 (modify_region_1): ...new function to work with current buffer.
3433 Adjust comment and users. Use true and false for booleans.
3434
62c2e5ed
DA
34352012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3436
3437 * alloc.c (free_save_value): New function.
3438 (safe_alloca_unwind): Use it.
3439 * lisp.h (free_save_value): New prototype.
3440 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3441 Add comment.
3442 (save_excursion_restore): Adjust to match saved data structure.
3443 Use free_save_value to offload some work from GC. Drop obsolete
3444 #if 0 code.
3445
c5bc2d1d 34462012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
3447
3448 * fileio.c (Vauto_save_list_file_name): Doc fix.
3449
c5bc2d1d 34502012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
3451
3452 * w32fns.c: Remove prototype of atof.
1e101a4b 3453 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 3454 builds.
1e101a4b 3455 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
3456
3457 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3458 with 64-bit builds.
3459
3460 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3461 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3462 defined.
3463
c5bc2d1d 34642012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 3465
a9de9f0c 3466 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 3467
21e54a94
PE
34682012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3469
2dd2e622
PE
3470 Fix xpalloc confusion after memory is exhausted.
3471 * alloc.c (xpalloc): Comment fix.
3472 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3473 and signals an error, do not clear charset_table_size, as
3474 charset_table is still valid.
3475 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3476
21e54a94
PE
3477 Use execve to avoid need to munge environ (Bug#13054).
3478 * callproc.c (Fcall_process):
3479 * process.c (create_process):
3480 Don't save and restore environ; no longer needed.
3481 * callproc.c (child_setup):
3482 Use execve, not execvp, to preserve environ.
3483
3e5490f7
PE
34842012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3485
3486 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3487
75b4f59c
YM
34882012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3489
3490 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3491 display for sliced images (Bug#10500).
3492
3493 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3494
f8aff4c6
JB
34952012-11-30 Juanma Barranquero <lekktu@gmail.com>
3496
3497 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3498 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3499
3940b924
DA
35002012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3501
3502 * xdisp.c (window_outdated): Remove eassert since it hits
3503 some suspicious corner cases (see Bug#13007 and Bug#13012).
3504 (mode_line_update_needed): New function.
3505 (redisplay_internal, redisplay_window): Use it.
3506 (ensure_selected_frame): New function.
3507 (redisplay_internal, unwind_redisplay): Use it.
3508 (redisplay_internal): Move comment about buffer_shared...
3509 (buffer_shared_and_changed): ...near to its real use.
3510
4a9204fe
PE
35112012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3512
3513 * callproc.c (Fcall_process): Don't misreport vfork failure.
3514
60aeceb8
PE
35152012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3516
3517 * callproc.c (Fcall_process): Fix vfork portability problems.
3518 Do not assume that fd[0], count, filefd, and save_environ survive
3519 vfork. Fix bug whereby wrong errno value could be reported for
3520 pipe failure. Some minor cleanups, too, as follows. Move buf and
3521 bufsize to the context where they're needed. Change new_argv to
3522 be of type char **, as this is more convenient and avoids casts.
3523 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3524 Now local constants, not macros.
3525
00dc3ead
KH
35262012-11-18 Kenichi Handa <handa@gnu.org>
3527
3528 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3529 for the variable "f".
3530
e1bf05c1
KH
35312012-11-13 Kenichi Handa <handa@gnu.org>
3532
3533 * font.c (font_unparse_xlfd): Exclude special characters from the
3534 generating XLFD name.
3535
22626a85
PE
35362012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3537
350e0088
PE
3538 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3539 * dired.c (stat_uname, stat_gname):
3540 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3541
22626a85
PE
3542 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3543 * dired.c (directory_files_internal, file_name_completion):
3544 Assume EAGAIN and EINTR are defined.
350e0088 3545
22626a85
PE
3546 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3547 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3548 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3549 * lread.c (readbyte_from_file): Assume EINTR is defined.
3550 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3551 Assume EIO and EAGAIN are defined.
3552 * unexcoff.c (write_segment): Assume EFAULT is defined.
3553
5c9cf0a3 35542012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
3555
3556 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3557 (Bug#11964)
3558
22294a56
EZ
3559 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3560 highlighting on the frame was cleared. Prevents assertion
3561 violations when repeatedly clicking on the "Top" link of the
3562 "bread-crumbs" in Info buffers.
3563
5fbab051
PE
35642012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3565
3566 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3567
bcd77a2b
KB
35682012-11-24 Ken Brown <kbrown@cornell.edu>
3569
3570 * keyboard.c (HAVE_MOUSE):
3571 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3572 were always defined.
3573
d125ca15 35742012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 3575
24becea4
EZ
3576 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3577 between bpos_covered and bpos_max. This fixes cursor display when
3578 several display strings follow each other.
3579
8654a41b
EZ
3580 * .gdbinit (pgx): If the glyph's object is a string, display the
3581 pointer to string data, rather than the value of the string object
3582 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3583
cb5867b1
EZ
3584 * indent.c (Fvertical_motion): If the starting position is covered
3585 by a display string, return to one position before that, to avoid
3586 overshooting it inside move_it_to. (Bug#12930)
3587
f418b22e
DA
35882012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3589
3590 * frame.h (struct frame): Remove display_preempted member
3591 since all users are dead long ago.
3592 * nsterm.h (struct x_output): Use the only dummy member.
3593 * w32menu.c (pending_menu_activation): Remove since not
3594 really used.
3595 (set_frame_menubar): Adjust user.
3596 * w32term.h (struct x_output): Drop outdated #if 0 code.
3597 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
3598 asked_for_visible and menubar_active members.
3599 Drop unused pending_menu_activation member.
f418b22e
DA
3600 * xterm.h (struct x_output): Drop outdated #if 0 code.
3601 Use bitfields for explicit_parent, asked_for_visible,
3602 has_been_visible and net_wm_state_hidden_seen members.
3603
a879f0ea
EZ
36042012-11-23 Eli Zaretskii <eliz@gnu.org>
3605
3606 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3607 of a literal "/". (Bug#12955)
3608 (gl-stamp): Invoke fc.exe directly, not through cmd.
3609
95ef7787
PE
36102012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3611
3612 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3613 * dired.c: Assume HAVE_DIRENT_H.
3614 (NAMLEN): Remove, replacing with ...
3615 (dirent_namelen): New function. All uses changed. Use the GNU macro
3616 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3617 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3618 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3619 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3620 $(NT_INC)/dirent.h.
3621 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3622 * ndir.h: Rename to ../nt/inc/dirent.h.
3623 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3624 Do not include <dirent.h>; no longer needed.
3625 * w32.c: Include <dirent.h> rather than "ndir.h".
3626
12645ae6
CY
36272012-11-23 Chong Yidong <cyd@gnu.org>
3628
3629 * xftfont.c (xftfont_open): Remove duplicate assignment.
3630
5c747675
DA
36312012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3632
3633 * alloc.c (Fgarbage_collect): Unblock input after clearing
3634 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3635 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3636 * msdos.c (IT_frame_up_to_date): Use it here...
3637 * w32term.c (w32_frame_up_to_date): ...here...
3638 * xterm.c (XTframe_up_to_date): ...and here...
3639 * nsterm.m (ns_frame_up_to_date): ...but not here.
3640 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3641 Adjust users.
3642 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3643 Do not check whether GC is in progress.
3644
6ceeb5f1
DA
36452012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3646
3647 * xdisp.c (window_buffer_changed): New function.
3648 (update_menu_bar, update_tool_bar): Use it to
3649 simplify large 'if' statements.
3650 (redisplay_internal): Generalize commonly used
3651 'tail' and 'frame' local variables.
3652
ec84768f
EZ
36532012-11-22 Eli Zaretskii <eliz@gnu.org>
3654
3655 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3656 with Windows system header.
3657
9239d970
PE
36582012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3659
3660 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3661 * alloc.c: Assume unistd.h exists.
3662 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3663 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3664 (getwd) [USG]: Remove; no longer needed.
3665 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3666 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3667 * w32.h (getcwd): Remove decl.
3668
954bba56
SM
36692012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3670
3671 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3672 Make it set selected_window as well.
3673 (update_tool_bar): Use it.
3674
6ef2e5ef 36752012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
3676
3677 * emacs.c (main): Set the G_SLICE environment variable for all
3678 Cygwin builds, not just GTK builds. See
3679 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3680
6ef2e5ef 36812012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
3682
3683 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3684 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3685 Define for the MSVC compiler.
3686
6ef2e5ef 3687 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
3688
3689 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3690 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3691 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
3692 dostounix_filename assumes it gets a unibyte string.
3693 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
3694 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3695
eadf1faa
SM
36962012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3697
3698 Conflate Qnil and Qunbound for `symbol-function'.
3699 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3700 * lread.c (init_obarray): Set `function' fields to Qnil.
3701 * eval.c (Fcommandp): Ignore Qunbound.
3702 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3703 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3704 Test NILP rather than Qunbound.
3705 (Ffmakunbound): Set to Qnil.
3706 (Fsymbol_function): Never signal an error.
3707 (Finteractive_form): Ignore Qunbound.
3708
b83fdfa9
PE
37092012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3710
3711 * eval.c (interactive_p): Remove no-longer-used decl.
3712
952580c5
DA
37132012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3714
3715 * xdisp.c (buffer_shared): Adjust comment.
3716 (buffer_shared_and_changed): New function.
3717 (prepare_menu_bars, redisplay_internal): Use it to
3718 decide whether all windows or frames should be updated.
ea6de9b1
DA
3719 (window_outdated): New function.
3720 (text_outside_line_unchanged_p, redisplay_window): Use it.
3721 (redisplay_internal): Likewise. Fix indentation.
952580c5 3722
23ba2705
SM
37232012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3724
3725 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3726 (syms_of_eval): Remove corresponding defsubr.
3727 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3728
6e9f7997
DC
37292012-11-19 Daniel Colascione <dancol@dancol.org>
3730
3731 * w32fns.c (Fx_file_dialog):
3732 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3733 cygwin_convert_file_name*.
3734
3735 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3736 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3737
552a1590
PE
37382012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3739
3740 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3741
2ac9538d 37422012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
3743
3744 * w32select.c: Include w32common.h before w32term.h, so that
3745 windows.h gets included before w32term.h uses some of its
3746 features, see below.
3747
23ba2705
SM
3748 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3749 New typedefs.
3750 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3751 New prototypes.
d8715cdf
EZ
3752 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3753
2ac9538d 37542012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
3755
3756 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3757 (ns_select): Return at once if events are held (Bug#12834).
3758
2ac9538d 37592012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 3760
3761 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3762 Needed following 2012-10-20 change. (Bug#12902)
3763
c1f7ba3a
JB
37642012-11-18 Juanma Barranquero <lekktu@gmail.com>
3765
3766 * w32proc.c (waitpid): Remove unused label get_result.
3767
a75ce9d3
JB
37682012-11-17 Juanma Barranquero <lekktu@gmail.com>
3769
3770 * makefile.w32-in (SYSWAIT_H): New macro.
3771 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3772 ($(BLD)/sysdep.$(O)): Update dependencies.
3773
49cdacda
PE
37742012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3775
3776 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3777 * callproc.c (relocate_fd): Assume F_DUPFD.
3778 * emacs.c, term.c (O_RDWR): Remove.
3779 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3780 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3781 * nsterm.m: Assume <fcntl.h> exists.
3782 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3783 (create_pty, Fmake_network_process, server_accept_connection)
3784 (wait_reading_process_output, init_process_emacs):
3785 Assume O_NONBLOCK.
3786 (wait_reading_process_output): Put in a special case for WINDOWSNT
3787 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3788 It's not clear this is needed, but it's a more-conservative change.
3789 (create_process): Assume FD_CLOEXEC.
3790 (create_process, create_pty): Assume O_NOCTTY.
3791 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3792 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3793 Omit if not DOS_NT, since F_GETFL is not defined there.
3794 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3795 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3796 (O_NOCTTY): Remove.
3797 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3798 lack it, since gnulib guarantees this.
3799 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3800
22bae83f
EZ
38012012-11-17 Eli Zaretskii <eliz@gnu.org>
3802
6ad30855
EZ
3803 * w32.c (faccessat): Pretend that directories have the execute bit
3804 set. Emacs expects that, e.g., in files.el:cd-absolute.
3805
22bae83f
EZ
3806 * w32proc.c (create_child): Don't clip the PID of the child
3807 process to fit into an Emacs integer, as this is no longer a
3808 restriction.
3809 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3810 reaping only the process specified by PID argument, if that is
3811 positive. Use PID instead of dead_child to know which process to
3812 reap. Wait for the child to die only if WNOHANG is not in
3813 OPTIONS.
3814 (sys_select): Don't set dead_child.
3815
3816 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3817 as it is no longer needed.
3818
3819 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3820 no longer needed.
3821 (record_child_status_change): Remove the setting of
3822 record_at_most_one_child for the !WNOHANG case.
3823
a631d0e0
PE
38242012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3825
3826 Fix problems in ns port found by static checking.
3827 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3828 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3829 not to process group.
3830 (ns_select): Use emacs_write, not write, as that's more robust
3831 in the presence of signals.
3832 (fd_handler:): Check for read errors.
3833
d56f2e49
GM
38342012-11-16 Glenn Morris <rgm@gnu.org>
3835
3836 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3837
96e05507 38382012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
3839
3840 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3841
96e05507 38422012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
3843
3844 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3845 use the same value of thread handle.
3846 (start_timer_thread): If the timer thread exited (due to error),
3847 clean up by closing the two handles it used. Duplicate the caller
3848 thread's handle here, so it gets duplicated only once, when
3849 launching the timer thread. Set priority of the timer thread, not
3850 the caller thread.
3851 (getitimer): Don't duplicate the caller thread's handle here.
3852 (Bug#12832)
3853
96e05507 38542012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
3855
3856 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3857 called (Bug#12834).
3858
3d082a26
PE
38592012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3860
3861 Remove no-longer-used pty_max_bytes variable.
3862 * process.c (pty_max_bytes): Remove; unused.
3863 (send_process): Do not set it.
3864
b72c161c
JB
38652012-11-15 Juanma Barranquero <lekktu@gmail.com>
3866
3867 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3868 Update dependencies.
3869
bf20ea80
PE
38702012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3873 This follows up on the 2012-09-29 patch that removed indirection
3874 for the 'function' field. Reported by Sergey Vinokurov in
3875 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3876
14f20728
EZ
38772012-11-14 Eli Zaretskii <eliz@gnu.org>
3878
3879 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3880 different name, as the MS runtime does not have such a function,
3881 and probably never will.) All callers changed. Ignore DIRFD
3882 value if PATH is an absolute file name, to match Posix spec
3883 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3884 symlinks.
3885
77731919
DA
38862012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3887
3888 * xdisp.c (echo_area_display, redisplay_internal):
3889 Omit redundant check whether frame_garbaged is set.
3890
73dcdb9f
PE
38912012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3892
3893 Use faccessat, not access, when checking file permissions (Bug#12632).
3894 This fixes a bug that has been present in Emacs since its creation.
3895 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3896 which must set some sort of record. (Torek's bug report was against
3897 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3898 same common flaw.) See Torek's Usenet posting
3899 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3900 Posted: Fri Apr 8 14:18:56 1983.
3901 * Makefile.in (LIB_EACCESS): New macro.
3902 (LIBES): Use it.
3903 * callproc.c (init_callproc):
3904 * charset.c (init_charset):
3905 * fileio.c (check_existing, check_executable, check_writable)
3906 (Ffile_readable_p):
3907 * lread.c (openp, load_path_check):
3908 * process.c (allocate_pty):
3909 * xrdb.c (file_p):
3910 Use effective UID when checking permissions, not real UID.
3911 * callproc.c (init_callproc):
3912 * charset.c (init_charset):
3913 * lread.c (load_path_check, init_lread):
3914 Test whether directories are accessible, not merely whether they exist.
3915 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3916 * fileio.c (check_existing, check_executable, check_writable)
3917 (Ffile_readable_p):
3918 Use symbolic names instead of integers for the flags, as they're
3919 portable now.
3920 (check_writable): New arg AMODE. All uses changed.
3921 Set errno on failure.
3922 (Ffile_readable_p): Use faccessat, not stat + open + close.
3923 (Ffile_writable_p): No need to call check_existing + check_writable.
3924 Just call check_writable and then look at errno. This saves a syscall.
3925 dir should never be nil; replace an unnecessary runtime check
3926 with an eassert. When checking the parent directory of a nonexistent
3927 file, check that the directory is searchable as well as writable, as
3928 we can't create files in unsearchable directories.
3929 (file_directory_p): New function, which uses 'stat' on most platforms
3930 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3931 (Ffile_directory_p, Fset_file_times): Use it.
3932 (file_accessible_directory_p): New function, which uses a single
3933 syscall for efficiency.
3934 (Ffile_accessible_directory_p): Use it.
3935 * xrdb.c (file_p): Use file_directory_p.
3936 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3937 * lread.c (openp): When opening a file, use fstat rather than
3938 stat, as that avoids a permissions race. When not opening a file,
3939 use file_directory_p rather than stat.
3940 (dir_warning): First arg is now a usage string, not a format.
3941 Use errno. All uses changed.
3942 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3943 that merely introduced a race.
3944 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3945 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3946 and similarly for the other O_* flags.
3947 * w32.c (sys_faccessat): Rename from sys_access and switch to
3948 faccessat's API. All uses changed.
3949 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3950 (magic_db): Rename from magic_file_p.
3951 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3952 char *, so that we don't have to test for file existence
3953 separately from opening the file for reading. This removes a race
3954 fixes a permission-checking problem, and simplifies the code.
3955 All uses changed.
3956 (file_p): Remove; no longer needed.
3957
2a14f83b
DA
39582012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3959
3960 Omit glyphs initialization at startup.
3961 * dispnew.c (glyphs_initialized_initially_p): Remove.
3962 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3963 (Fredraw_frame): Move actual code from here...
c7085245 3964 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
3965 (Fredraw_display): Use redraw_frame.
3966 * xdisp.c (clear_garbaged_frames): Likewise.
3967
f78ee6af 39682012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
3969
3970 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3971 passed to pint2str and pint2hrstr to be at most the size of the
3972 frame's decode_mode_spec_buffer. This avoids crashes with very
3973 large values of FIELD_WIDTH argument to decode_mode_spec.
3974 (Bug#12867)
3975
b95a9c0c
PE
39762012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3977
3978 Fix a race with verify-visited-file-modtime (Bug#12863).
3979 Since at least 1991 Emacs has ignored an mtime difference of no
3980 more than one second, but my guess is that this was to work around
3981 file system bugs that were fixed long ago. Since the race is
3982 causing problems now, let's remove that code.
3983 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3984 whose time stamp is off by no more than a second. Insist that the
3985 file time stamps match exactly.
3986
be49ba74
DA
39872012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3988
3989 * frame.h (struct frame): Convert external_tool_bar member to
3990 1-bit unsigned bitfield.
3991 * termhooks.h (struct terminal): Remove mouse_moved member since
3992 all users are long dead. Adjust comment on mouse_position_hook.
3993
5b04e9f9
DA
39942012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3995
3996 Simplify by using FOR_EACH_FRAME here and there.
3997 * frame.c (next_frame, prev_frame, other_visible_frames)
3998 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3999 * w32term.c (x_window_to_scroll_bar): Likewise.
4000 * window.c (window_list): Likewise.
4001 * xdisp.c (x_consider_frame_title): Likewise.
4002 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4003 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4004 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4005 * xmenu.c (menubar_id_to_frame): Likewise.
4006 * xselect.c (frame_for_x_selection): Likewise.
4007 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4008 (x_window_to_menu_bar): Likewise.
4009 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4010
76ae24d7
PE
40112012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4012
12cc4337
PE
4013 * data.c (Qdefalias_fset_function): Now static.
4014
76ae24d7
PE
4015 Another tweak to vectorlike_header change.
4016 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4017 Remove, and replace all uses with ...
4018 (next_in_free_list, set_next_in_free_list):
4019 New functions, which respect C's aliasing rules better.
4020
1479c557
PE
40212012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4022
4023 * window.c (list4i): Rename from 'quad'. All uses changed.
4024 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4025
11235c03
JB
40262012-11-11 Juanma Barranquero <lekktu@gmail.com>
4027
4028 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4029 warning about mixing declarations and code in ISO C90.
4030
6baf66d5 40312012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
4032
4033 * window.c (Fsplit_window_internal): Set combination limit of
4034 new parent window to t iff Vwindow_combination_limit is t;
4035 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 4036 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 4037
6baf66d5 40382012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
4039
4040 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4041 amount when the scroll margins are too large. When scrolling
4042 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
4043 scroll margin within a reasonable number of screen lines.
4044 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
4045 point is positioned many lines beyond the window top/bottom.
4046 (Bug#12811)
4047
508f51f5
EZ
4048 * ralloc.c (relinquish): If real_morecore fails to return memory
4049 to the system, don't crash; instead, leave the last heap
4050 unchanged and return. (Bug#12774)
4051
32e5c58c
SM
40522012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4053
4054 * lisp.h (AUTOLOADP): New macro.
4055 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4056 * data.c (Ffset): Remove special ad-advice-info handling.
4057 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4058 (Fsubr_arity): CSE.
4059 (Finteractive_form): Simplify.
4060 (Fquo): Don't insist on having at least 2 arguments.
4061 (Qdefalias_fset_function): New var.
4062
719b0aa5
JD
40632012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4064
4ab15c3e
JD
4065 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4066
719b0aa5
JD
4067 * nsfont.m (Qcondensed, Qexpanded): New variables.
4068 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4069 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4070
535cc8e9
DA
40712012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4072
4073 Fix recently introduced crash on MS-Windows (Bug#12839).
4074 * w32term.h (struct scroll_bar): Use convenient header.
4075 (SCROLL_BAR_VEC_SIZE): Remove.
4076 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4077
7d377c48
DA
40782012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4079
4080 Tweak last vectorlike_header change.
4081 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4082 vectorlike object on the free list. This is introduced to avoid
4083 some (but not all) pointer casting and aliasing problems, see
4084 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4085 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4086 objects.
4087 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4088
7ad27466
JD
40892012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4090
32e5c58c 4091 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
4092 been removed, so remove them here also.
4093
57618ecf
SM
40942012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4095
4096 * doc.c (Fdocumentation): Handle new property
4097 dynamic-docstring-function to replace the old ad-advice-info.
4098
53371430
PE
40992012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4100
4101 * fns.c (Qeql, hashtest_eq): Now static.
4102
61ddb1b9
SM
41032012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4104
4105 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4106 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4107 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4108 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4109
04a2d0d3
PE
41102012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4111
4112 Use same hash function for hashfn_profiler as for hash_string etc.
4113 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4114 * lisp.h (sxhash_combine): New inline function, with the contents
4115 of the old SXHASH_COMBINE.
4116 * profiler.c (hashfn_profiler): Use it, instead of having a
4117 special hash function containing a comparison that always yields 1.
4118
de5ef41a
SM
41192012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4120
4121 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4122 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4123 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4124 Remove unused vars.
4125
a23c4171
JD
41262012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4127
4128 * image.c (xpm_make_color_table_h): Fix compiler error because
4129 make_hash_table changed.
4130
0b59090b 41312012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
4132
4133 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4134
b7432bb2
SM
41352012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4136
4137 Use ad-hoc comparison function for the profiler's hash-tables.
4138 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4139 (make_log): Use them.
4140 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4141 call Fequal any more.
4142 (Ffunction_equal): New function.
4143 (cmpfn_profiler, hashfn_profiler): New functions.
4144 (syms_of_profiler): Initialize them.
4145 * lisp.h (struct hash_table_test): New struct.
4146 (struct Lisp_Hash_Table): Use it.
4147 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4148 * fns.c (make_hash_table): Take a struct to describe the test.
4149 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4150 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4151 (hash_lookup, hash_remove_from_table): Move assertion checking of
4152 hashfn result here. Check hash-equality before calling cmpfn.
4153 (Fmake_hash_table): Adjust call to make_hash_table.
4154 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4155 (syms_of_fns): Initialize them.
4156 * emacs.c (main): Move syms_of_fns earlier.
4157 * xterm.c (syms_of_xterm):
4158 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4159 * print.c (print_object): Adjust to new hash-table struct.
4160 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4161
88002743
EZ
41622012-11-08 Eli Zaretskii <eliz@gnu.org>
4163
4164 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4165 value of w32-scroll-lock-modifier is neither nil nor one of the
4166 known key modifiers. (Bug#12806)
4167
914adc42
DA
41682012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4169
4170 Shrink struct vectorlike_header to the only size field.
4171 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4172 Adjust comment.
4173 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4174 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4175 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4176 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4177 information from the vector header. Adjust comment.
4178 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4179 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4180 layout.
4181 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4182 (struct vectorlike_header): Remove next member. Adjust comment.
4183 (struct Lisp_Subr): Add convenient header. Adjust comment.
4184 (allocate_pseudovector): Adjust prototype.
4185 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4186 (sweep_string, lisp_malloc): Remove useless prototypes.
4187 (enum mem_type): Adjust comment.
4188 (NEXT_IN_FREE_LIST): New macro.
4189 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4190 (Fmake_bool_vector): Likewise.
4191 (struct large_vector): New type to represent allocation unit for
4192 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4193 (large_vectors): Change type to struct large_vector.
4194 (allocate_vector_from_block): Simplify.
4195 (PSEUDOVECTOR_NBYTES): Replace with...
4196 (vector_nbytes): ...new function. Adjust users.
4197 (sweep_vectors): Adjust processing of large vectors.
4198 (allocate_vectorlike): Likewise.
4199 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4200 Add easserts. Adjust XSETPVECTYPESIZE usage.
4201 (allocate_buffer): Use BUFFER_PVEC_INIT.
4202 (live_vector_p): Adjust to match large vector.
4203 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4204 * buffer.h (struct buffer): Add next member.
4205 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4206 New macros.
4207 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4208 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4209 (copy_hash_table): Adjust to match vector header change.
4210 * lread.c (defsubr): Use XSETPVECTYPE.
4211 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4212 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4213 (xvecsize): New command.
4214
c66f21ea
DA
42152012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4216
4217 * keyboard.c (event_to_kboard): Do not dereference
4218 frame_or_window field of SELECTION_REQUEST_EVENT
4219 and SELECTION_CLEAR_EVENT events (Bug#12814).
4220 * xterm.h (struct selection_input_event): Adjust comment.
4221
eb147960
EZ
42222012-11-07 Eli Zaretskii <eliz@gnu.org>
4223
dab72075
EZ
4224 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4225 such as Scroll Lock, if the respective keys are treated as
4226 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 4227 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 4228
5890e400
DA
42292012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4230
4231 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4232
b6b3b294
PE
42332012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4234
4235 Restore some duplicate definitions (Bug#12814).
4236 This undoes part of the 2012-11-03 changes. Some people build
4237 with plain -g rather than with -g3, and they need the duplicate
4238 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4239 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4240 Define as macros, as well as as enums or as constants.
4241
e770aad5
JD
42422012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4243
4244 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4245 to keypad keys (Bug#12816).
4246
68f8f1c0
PE
42472012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4248
4249 Minor adjustments of recently-changed frame functions.
4250 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4251 known to be a frame (we're in the FRAMEP branch).
4252 * lisp.h (Qframep): Remove decl. frame.h declares this.
4253 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4254 since they're meant for Lisp fixnum values.
4255
72f94d4b
DA
42562012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4257
4258 * window.c (Fwindow_combination_limit): Revert to the only
4259 required argument and adjust docstring as suggested in
4260 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4261 by Martin Rudalics <rudalics@gmx.at>.
4262
d9f07150
DA
42632012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4264
4265 Widely used frame validity and checking functions.
4266 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4267 * frame.c (decode_live_frame, decode_any_frame): New functions.
4268 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4269 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4270 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4271 (Fframe_pointer_visible_p): Use decode_any_frame.
4272 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4273 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4274 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4275 (Fframe_focus): Likewise. Allow zero number of arguments.
4276 Adjust docstring.
4277 (frame_buffer_list, frame_buffer_predicate): Remove.
4278 * lisp.h (frame_buffer_predicate): Remove prototype.
4279 * buffer.c (Fother_buffer): Use decode_any_frame.
4280 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4281 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4282 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4283 (Fclose_font, Ffont_info): Use decode_live_frame.
4284 * fontset.c (check_fontset_name): Likewise.
4285 * terminal.c (Fframe_terminal): Likewise.
4286 * w32fns.c (check_x_frame): Likewise.
4287 * window.c (Fminibuffer_window, Fwindow_at)
4288 (Fcurrent_window_configuration): Likewise.
4289 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4290 Likewise. Allow zero number of arguments. Adjust docstring.
4291 * dispnew.c (Fredraw_frame): Likewise.
4292 * xfaces.c (frame_or_selected_frame): Remove.
4293 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4294 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4295 (Fframe_face_alist): Use decode_live_frame.
4296 * xfns.c (check_x_frame): Likewise.
4297
89bc0592
DA
42982012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4299
4300 * window.c (quad): New function.
4301 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4302 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4303 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4304 (Fwindow_line_height): Use it.
4305 (Fwindow_fringes): Use list3.
4306 (Fwindow_scroll_bars): Use list4.
4307 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4308 (Fwindow_combination_limit): Allow zero number of arguments.
4309
c8e3a9c3
EZ
43102012-11-05 Eli Zaretskii <eliz@gnu.org>
4311
4312 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4313
8e2417bf 4314 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 4315 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 4316 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 4317
209c6a58
CY
43182012-11-05 Chong Yidong <cyd@gnu.org>
4319
4320 * process.c (wait_reading_process_output): Revert previous change.
4321
8148369c
PE
43222012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4323
dd0333b6
PE
4324 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4325 This removes code that has been obsolete since around 1990.
4326 * callproc.c (Fcall_process):
4327 * emacs.c (main):
4328 * process.c (create_process):
4329 * term.c (dissociate_if_controlling_tty):
4330 Assume setsid exists.
4331 * callproc.c (child_setup): Assume setpgid exists and behaves as
4332 per POSIX.1-1988 or later.
4333 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4334 * emacs.c (shut_down_emacs):
4335 * sysdep.c (sys_suspend, init_foreground_group):
4336 Assume getpgrp behaves as per POSIX.1-1998 or later.
4337 * msdos.c (setpgrp): Remove.
4338 (tcgetpgrp, setpgid, setsid): New functions.
4339 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4340 * term.c (no_controlling_tty): Remove; unused.
4341 * w32proc.c (setpgrp): Remove.
4342 (setsid, tcgetpgrp): New functions.
4343
8148369c
PE
4344 Simplify by assuming __fpending.
4345 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4346 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4347 Do not assume that __fpending's result fits in int.
4348
76abf5e5
PE
43492012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4350
06b63c9b
PE
4351 Remove EMACS_OUTQSIZE+sleep hack.
4352 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
4353 than 2400 bps, which throttled Emacs by having it sleep.
4354 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
4355 was added, and anyway those old terminals are long dead.
4356 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4357 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4358
76abf5e5
PE
4359 Fix data-loss with --version (Bug#9574).
4360 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4361 as we can't assume that emacs_strerror is initialized, and strerror
4362 is good enough here.
4363 (main): Invoke atexit earlier, to catch earlier instances of
4364 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4365
8f31e74b
MM
43662012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4367
4368 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4369 (keyDown): Remap keypad keys to X11 virtual key codes.
4370
0d879dca
PE
43712012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4372
7ccfb720
PE
4373 Fix data-loss with --batch (Bug#9574).
4374 * emacs.c: Include <close-stream.h>.
4375 (close_output_streams): New function.
4376 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4377 and handles errors appropriately.
4378 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4379 does that now.
4380
0b3d4a47
PE
4381 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4382 The symptom is a diagnostic "GLib-WARNING **: In call to
4383 g_spawn_sync(), exit status of a child process was requested but
4384 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4385 waitpid(), so exit status can't be returned." The diagnostic
4386 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4387 The real bug is a race condition between Emacs and glib: Emacs
4388 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4389 so that glib can't find it. Work around the bug by invoking
4390 waitpid only on subprocesses that Emacs itself creates.
4391 * process.c (create_process, record_child_status_change):
4392 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
4393 know the pid rather than having the callee infer it.
4394 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
4395 (create_process): Set new 'alive' member if child is created.
4396 (process_status_retrieved): New function.
4397 (record_child_status_change): Use it.
4398 Accept negative 1st argument, which means to wait for the
4399 processes that Emacs already knows about. Move special-case code
4400 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4401 processes that have already been waited for, by testing and
4402 clearing new 'alive' member.
4403 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4404 now does this internally.
4405 (handle_child_signal): Let record_child_status_change do all
4406 the work, since we do not want to reap all exited child processes,
4407 only the child processes that Emacs itself created.
4408 * process.h (Lisp_Process): New boolean member 'alive'.
4409
0d879dca
PE
4410 Omit duplicate definitions no longer needed with gcc -g3.
4411 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4412 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4413 Define only as macros. There's no longer any need to also define
4414 these symbols as enums or as constants, since we now assume
4415 gcc -g3 when debugging.
4416
3478f4b5
EZ
44172012-11-03 Eli Zaretskii <eliz@gnu.org>
4418
4419 * lisp.mk: Adjust comments to the fact that term/internal is now
4420 loaded from loadup.el.
4421
4422 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4423 (msdos_fatal_signal): New function.
4424 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4425 its argument list.
4426
4427 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4428 for GCC versions before 4.
4429 (emacs_raise): Define to call msdos_fatal_signal.
4430
4431 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4432 iterator when starting in the middle of a display or overlay
4433 string. (Bug#12745)
4434
85fabcb7
CY
44352012-11-03 Chong Yidong <cyd@gnu.org>
4436
4437 * process.c (wait_reading_process_output): Clean up the last
4438 change.
4439
893cc455
CY
44402012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4441
4442 * process.c (wait_reading_process_output): Avoid a race condition
4443 with SIGIO delivery (Bug#11536).
4444
0f7b074f
CY
44452012-11-03 Chong Yidong <cyd@gnu.org>
4446
4447 * buffer.c (cursor_type): Untabify docstring.
4448
3737fee7
DA
44492012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4450
4451 * frame.h (struct frame): Drop can_have_scroll_bars member
4452 which is meaningless for a long time. Adjust comments.
4453 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4454 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4455
b6a9e8b1
DA
44562012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4457
4458 * window.c (decode_next_window_args): Update window arg after
4459 calling decode_live_window and so fix crash reported at
4460 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4461 by Juanma Barranquero <lekktu@gmail.com>.
4462 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4463 * font.c (Ffont_at): Likewise.
4464
600d4768
JD
44652012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4466
4467 * widget.c (resize_cb): New function.
4468 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4469 (EmacsFrameResize): Check if all is up to date before changing frame
4470 size.
4471
1005b4b9
EZ
44722012-11-02 Eli Zaretskii <eliz@gnu.org>
4473
4474 Implement backtrace output for fatal errors on MS-Windows.
4475 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4476 (BACKTRACE_LIMIT_MAX): New macro.
4477 (w32_backtrace): New function.
4478 (emacs_abort): Use w32_backtrace when the user chooses not to
4479 attach a debugger. Update the text of the abort dialog.
4480
b9e9df47
DA
44812012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4482
4483 Window-related stuff cleanup here and there.
4484 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4485 Use decode_any_window.
4486 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4487 * xdisp.c (Fformat_mode_line): Likewise.
4488 * font.c (Ffont_at): Use decode_live_window.
4489 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4490 * window.c (decode_next_window_args): Likewise.
4491 (decode_any_window): Remove static.
4492 * window.h (decode_any_window): Add prototype.
4493 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4494 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4495 respectively.
4496
2b371ff7
DA
44972012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4498
4499 Remove pad from struct input_event.
4500 * termhooks.h (struct input_event): Remove padding field.
4501 Adjust comment.
4502 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4503 member is never cons for a long time. Adjust comment.
4504 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4505 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4506 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4507 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4508
7e8b50d9
EZ
45092012-11-01 Eli Zaretskii <eliz@gnu.org>
4510
4511 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4512
322aea6d
PE
45132012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4514
4515 Fix crash when using Emacs as commit editor for git (Bug#12697).
4516 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4517 and it is configured in conf_post.h.
4518 (Fcall_process): Don't invoke both setsid and setpgid; the former
4519 is enough, if it exists.
4520 * callproc.c (Fcall_process, child_setup):
4521 * process.c (create_process): Use setpgid.
4522 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4523 for the real thing.
4524 * dispnew.c (init_display): Initialize the foreground group
4525 if we are running a tty display.
4526 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4527 * lisp.h (init_foreground_group): New decl.
4528 * sysdep.c (inherited_pgroup): New static var.
4529 (init_foreground_group, tcsetpgrp_without_stopping)
4530 (narrow_foreground_group, widen_foreground_group): New functions.
4531 (init_sys_modes): Narrow foreground group.
4532 (reset_sys_modes): Widen foreground group.
4533
220cb2bd
MA
45342012-10-31 Michael Albinus <michael.albinus@gmx.de>
4535
4536 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4537
218e997a
MR
45382012-10-31 Martin Rudalics <rudalics@gmx.at>
4539
4540 * minibuf.c (read_minibuf): Restore current buffer since
4541 choose_minibuf_frame calling Fset_frame_selected_window may
4542 change it (Bug#12766).
4543
02615da0
JD
45442012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4545
4546 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4547
aee5b18e
KH
45482012-10-30 Kenichi Handa <handa@gnu.org>
4549
4550 * font.c (Ffont_at): If WINDOW is specified and it is not
4551 displaying the current buffer, signal an error.
4552
ba116008
DC
45532012-10-29 Daniel Colascione <dancol@dancol.org>
4554
de5ef41a
SM
4555 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4556 In preparation for fixing bug#12739, move these functions from
ba116008
DC
4557 here...
4558
4559 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
4560 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4561 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 4562
640bf8ad
EZ
45632012-10-28 Eli Zaretskii <eliz@gnu.org>
4564
4565 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4566 (timer_loop, getitimer, setitimer): Use it instead of
4567 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4568 'clock'.
4569 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4570 literal 10000.
4571
64ccff5f
JD
45722012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4573
4574 * nsterm.m (NO_APPDEFINED_DATA): New define.
4575 (last_appdefined_event_data): New variable
4576 (last_appdefined_event): Remove.
4577 (ns_select): Initialize t from last_appdefined_event_data instead
4578 of [last_appdefined_event data1].
4579 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4580 remove last_appdefined_event (Bug#12698).
4581
e483264c
SM
45822012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4583
4584 * frame.c (x_set_font): Catch internal error.
4585
6c16c13e
EZ
45862012-10-27 Eli Zaretskii <eliz@gnu.org>
4587
e483264c
SM
4588 Avoid overflow in w32 implementation of interval timers.
4589 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
4590 actually executes.
4591 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
4592 'volatile ULONGLONG' types. All the other data which was
4593 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
4594 (GetThreadTimes_Proc): New typedef.
4595 (w32_get_timer_time): New function, returns a suitable time value
4596 for the timer.
4597 (timer_loop): Enter critical section when accessing ULONGLONG
4598 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
4599 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4600 Remove unused variable.
6c16c13e
EZ
4601 (init_timers): Initialize s_pfn_Get_Thread_Times.
4602 (start_timer_thread): Don't assign itimer->caller_thread here.
4603 (getitimer): Assign itimer->caller_thread here.
4604 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 4605 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 4606
ccc83f50
EZ
46072012-10-26 Eli Zaretskii <eliz@gnu.org>
4608
4609 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4610 mouse movement events if the menu bar is active. This avoids
4611 producing a busy "hour-glass" cursor by Windows if the mouse
4612 pointer is positioned over a tooltip shown for some menu item.
4613
69deda53
PE
46142012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4615
4616 Don't assume process IDs fit in int.
4617 * emacs.c (shut_down_emacs) [!DOS_NT]:
4618 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4619 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4620 Use pid_t, not int, to store process IDs, as 'int'
4621 is not wide enough on a few platforms (e.g., AIX and IRIX).
4622
7e70a152
KH
46232012-10-23 Kenichi Handa <handa@gnu.org>
4624
4625 The following change is to make face-font-rescale-alist work
4626 correctly for non-ASCII fonts.
4627
4628 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4629 (font_open_for_lface): Handle Vface_font_rescale_alist.
4630
49238e7f
CY
46312012-10-23 Chong Yidong <cyd@gnu.org>
4632
4633 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4634
5ec86886
JD
46352012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4636
ef446959
JD
4637 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4638 for screen font.
4639 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4640
5ec86886
JD
4641 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4642 event (Bug#12681).
4643
ee7a418d
GM
46442012-10-21 Glenn Morris <rgm@gnu.org>
4645
4646 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4647
4973679b
PE
46482012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4649
4650 Port to OpenBSD 5.1.
4651 * frame.c (Fmouse_position, Fmouse_pixel_position):
4652 * xdisp.c (produce_stretch_glyph):
4653 Declare local vars only when they're needed.
4654 This is clearer and avoids a warning on OpenBSD about unused vars.
4655 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4656 This is safer, and avoids OpenBSD warnings about unused vars.
4657 * keyboard.c (record_menu_key): Remove unnecessary decl.
4658 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4659 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4660 as our definition clashes with OpenBSD's.
4661 * xfaces.c (load_face_colors, check_lface_attrs)
4662 (get_lface_attributes_no_remap, get_lface_attributes)
4663 (lface_fully_specified_p, x_supports_face_attributes_p)
4664 (tty_supports_face_attributes_p, face_fontset, realize_face)
4665 (realize_x_face, realize_tty_face):
4666 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4667 merely Lisp_Object *. This is more informative and avoids
4668 a warning on OpenBSD about accessing beyond an object's size.
4669
c664f463
CY
46702012-10-20 Chong Yidong <cyd@gnu.org>
4671
4672 * lread.c (Fload): Doc fix (Bug#12592).
4673
6ec83f92 46742012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
4675
4676 * font.c (Ffont_at): Fix previous change.
4677
d2824928
EZ
46782012-10-19 Eli Zaretskii <eliz@gnu.org>
4679
e483264c
SM
4680 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4681 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
4682 for the reasons.
4683
d2824928
EZ
4684 * alloc.c (NSTATICS): Decrease to 0x800.
4685
f60d391f
SM
46862012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4687
4a0e1924 4688 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
4689 error (bug#12677).
4690
1a9327d5
JD
46912012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4692
4693 * nsterm.m (ns_select): Check writefds before call to
4694 FD_ISSET (Bug#12668).
4695
14145a1e
DC
46962012-10-18 Daniel Colascione <dancol@dancol.org>
4697
4698 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4699 (staticpro): If we run out of staticpro slots, die with an
4700 informative error instead of just calling emacs_abort.
4701
1f76f6f5
MR
47022012-10-18 Martin Rudalics <rudalics@gmx.at>
4703
4704 Fix two flaws reported by Dmitry Antipov.
4705 * window.c (Ftemp_output_buffer_show): Remove.
4706 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4707 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4708
fcf14875
EZ
47092012-10-17 Eli Zaretskii <eliz@gnu.org>
4710
1f76f6f5
MR
4711 * makefile.w32-in ($(BLD)/w32.$(O)):
4712 ($(BLD)/vm-limit.$(O)):
4713 ($(BLD)/term.$(O)):
4714 ($(BLD)/unexw32.$(O)):
4715 ($(BLD)/fileio.$(O)):
a68089e4
EZ
4716 ($(BLD)/dispnew.$(O)): Update dependencies.
4717
4718 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4719 Add prototypes.
4720
4721 * w32proc.c: Include ctype.h.
4722
4723 * w32.h (init_environment, check_windows_init_file)
4724 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4725 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4726 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4727 (sys_link): Add prototypes.
4728
4729 * w32.c: Include w32select.h.
4730 (sys_access, e_malloc, sys_select): Add prototypes.
4731 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4732
4733 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4734
4735 * unexw32.c: Include lisp.h and w32.h.
4736
4737 * term.c [WINDOWSNT]: Include w32term.h.
4738
4739 * process.c [WINDOWSNT]: Add prototype of sys_select.
4740
4741 * fileio.c [WINDOWSNT]: Include w32.h.
4742
4743 * dispnew.c [WINDOWSNT]: Include w32.h.
4744
fcf14875
EZ
4745 * cygw32.c (Fcygwin_convert_path_to_windows)
4746 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4747 Lisp_Object values. (Bug#12661)
4748
4749 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4750 to Lisp_Object. (Bug#12661)
4751
fe0b1ec4
KH
47522012-10-17 Kenichi Handa <handa@gnu.org>
4753
4754 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4755 invalidate.
4756
d556ebf9
DA
47572012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4758
4759 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 4760 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 4761
f0863a54
DA
47622012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4763
4764 Do not verify indirection counters of killed buffers (Bug#12579).
4765 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4766 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4767
12fbe755
DA
47682012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4769
4770 * alloc.c (Fmake_byte_code): Fix typo in comment.
4771 * print.c (print_interval): Define as static to match prototype.
4772 * indent.c (disptab_matches_widthtab, recompute_width_table):
4773 Convert to eassert.
4774
61655b89
DA
47752012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4776
4777 * editfns.c (get_system_name): Remove.
4778 * lisp.h (get_system_name): Remove prototype.
4779 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4780 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4781
9520f2f2
DC
47822012-10-15 Daniel Colascione <dancol@dancol.org>
4783
4784 * dbusbind.c: Add comment explaining reason for previous change.
4785
dca778d5
MR
47862012-10-15 Martin Rudalics <rudalics@gmx.at>
4787
4788 * window.c (Fwindow_end): Rewrite check whether cached position
4789 can be used (Bug#12600).
4790 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4791 Set windows_or_buffers_changed.
4792
3e0341b0
DC
47932012-10-15 Daniel Colascione <dancol@dancol.org>
4794
4795 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4796 enabled by undefining the symbol "interface", which the platform
4797 headers define to something incompatible.
4798
33d4113c
DC
47992012-10-14 Daniel Colascione <dancol@dancol.org>
4800
4801 * image.c (init_tiff_functions, init_imagemagick_functions)
4802 (init_svg_functions): Fix cygw32 build break by using these
4803 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4804
a36fb15e
JD
48052012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4806
4807 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4808
537f336d
JD
48092012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4810
4811 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4812
0ba06a77
KH
48132012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4814
4815 * coding.c (detect_coding): Set coding->id before calling
4816 this->detector.
4817
ce2fe65a
AS
48182012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4819
4820 * fileio.c: Formatting fixes.
4821
d6453ce4
PE
48222012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4823
4824 Fix some stat-related races.
4825 * fileio.c (Fwrite_region): Avoid race condition if a file is
4826 removed or renamed by some other process immediately after Emacs
4827 writes it but before Emacs stats it. Do not assume that stat (or
4828 fstat) succeeds.
4829 * image.c (slurp_file): Resolve the file name with fopen + fstat
4830 rather than stat + fopen.
4831 (pbm_read_file) [0]: Remove unused code with stat race.
4832 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4833 Remove ineffective code with stat race.
4834
06485aa8
SM
48352012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4836
4837 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4838
167e3640
JD
48392012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4840
4841 * nsterm.m (hold_event_q): New static variable.
4842 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4843 ! q_event_ptr.
4844 (hold_event): New function.
4845 (ns_read_socket): If hold_event_q have events, store them and
4846 return (Bug#12384).
4847 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4848 is zero (Bug#12384).
4849
c40239df
JB
48502012-10-12 Juanma Barranquero <lekktu@gmail.com>
4851
4852 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4853
bb385a92
EZ
48542012-10-12 Eli Zaretskii <eliz@gnu.org>
4855
2a9f1099
EZ
4856 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4857
bb385a92
EZ
4858 * fileio.c (check_existing): New function.
4859 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4860 instead of calling 'stat', when what's needed is to check whether
4861 a file exists. This avoids expensive system calls on MS-Windows.
4862 (Bug#12587)
4863
8599b23a 4864 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
4865
4866 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4867 determine whether a file exists and is not a directory.
4868
4869 * lisp.h (check_existing): Add prototype.
4870
2b9c2e68
JD
48712012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4872
4873 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4874
81749a23
GM
48752012-10-12 Glenn Morris <rgm@gnu.org>
4876
4877 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4878
5253a5fd
SM
48792012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4880
389a94a5
SM
4881 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4882
5253a5fd
SM
4883 * eval.c (Fautoload): Remember previous autoload status in load-history.
4884
7cded46f
PE
48852012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4886
4887 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4888 * lread.c (load_each_byte, new_backquote_flag, readchar)
4889 (read_filtered_event, lisp_file_lexically_bound_p)
4890 (safe_to_load_version, Fload, complete_filename_p, openp)
4891 (build_load_history, readevalloop, read_escape, read1)
4892 (string_to_number, read_vector, read_list):
4893 * macros.c (Fstart_kbd_macro):
4894 * marker.c (CONSIDER):
4895 * menu.c (parse_single_submenu, digest_single_submenu)
4896 (find_and_return_menu_selection, Fx_popup_menu):
4897 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4898 (Ftry_completion):
4899 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4900 (ns_menu_show):
4901 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4902 (xmenu_show, xdialog_show):
4903 Use bool for booleans.
4904 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4905 as it's not a predicate. All uses changed. Omit unnecessary
4906 buffer termination.
4907
549c3414
DA
49082012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4909
4910 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4911 (save_excursion_restore): Do not restore mark if it was not saved.
4912
e85aafe7
PE
49132012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4914
fd2f90cf
PE
4915 * marker.c (cached_modiff): EMACS_INT, not int.
4916
c1af190b
PE
4917 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4918 instead of having a wrong decl.
e85aafe7
PE
4919 * nsmenu.m (waiting_for_input): Remove wrong decl.
4920
e738ca56
PE
49212012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4922
9fa1de30
PE
4923 keyboard.c, keymap.c: Use bool for booleans.
4924 * dispnew.c (sit_for): Distinguish between 3-way display_option
4925 and boolean do_display.
4926 * keyboard.c (single_kboard, this_command_key_count_reset)
4927 (waiting_for_input, echoing, immediate_quit, input_pending)
4928 (interrupt_input, interrupts_deferred, pop_kboard)
4929 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4930 (command_loop_1, adjust_point_for_property)
4931 (safe_run_hooks_error, input_polling_used, read_char):
4932 (help_char_p, readable_events, kbd_buffer_events_waiting)
4933 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4934 (lucid_event_type_list_p, get_input_pending):
4935 (gobble_input, menu_separator_name_p, menu_bar_item)
4936 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4937 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4938 (keyremap_step, test_undefined, read_key_sequence)
4939 (detect_input_pending, detect_input_pending_ignore_squeezables)
4940 (detect_input_pending_run_timers, requeued_events_pending_p)
4941 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4942 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4943 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4944 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4945 (accessible_keymaps_1, Fkey_description, push_key_description):
4946 (shadow_lookup, struct where_is_internal_data)
4947 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4948 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4949 (describe_map, describe_vector):
4950 * menu.c (single_menu_item):
4951 * nsmenu.m (ns_update_menubar):
4952 * process.c (wait_reading_process_output):
4953 * search.c (scan_buffer, scan_newline):
4954 Use bool for boolean.
4955 * keyboard.c (timers_run, swallow_events)
4956 (detect_input_pending_run_timers):
4957 * process.c (wait_reading_process_output):
4958 Use unsigned for counter where wraparound-on-overflow is desired,
4959 since unsigned is guaranteed to have that behavior and signed is not.
4960 (read_char): Use ptrdiff_t for string length.
4961 (get_input_pending): Remove first argument, since it was always
4962 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4963 and behave as if it had that value. Return new value of
4964 input_pending. All callers changed.
4965 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4966 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4967 a string length.
4968 * keymap.c (push_key_description): Omit last arg, which was always 1.
4969 All callers changed.
4970
e738ca56
PE
4971 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4972
29f21cdf
JB
49732012-10-10 Juanma Barranquero <lekktu@gmail.com>
4974
4975 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4976 ($(BLD)/term.$(O)): Update dependencies.
4977
6aea7528
DA
49782012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4979
4980 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4981 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4982 initializer for PVEC_NORMAL_VECTOR.
4983
5f3f57be
PE
49842012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4985
4986 Clean out old termopts cruft.
4987 * termopts.h (flow_control, meta_key): Remove unused decls.
4988 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4989 Don't include termopts.h.
4990
3e98c68e
DA
49912012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4992
4993 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4994
77e344e5
PE
49952012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4996
4997 * commands.h (immediate_quit): Remove duplicate decl.
4998
5683d7cd
JD
49992012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5000
5001 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5002 caching.
5003 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 5004 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 5005
cf5fc6db
EZ
50062012-10-09 Eli Zaretskii <eliz@gnu.org>
5007
b15736e6
EZ
5008 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5009 match what GetLastError returns. Explain why the function is
5010 needed.
5011
cf5fc6db
EZ
5012 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5013 'is_tooltip_frame', to avoid confusion with its global namesake.
5014
f99714ce
DC
50152012-10-08 Daniel Colascione <dancol@dancol.org>
5016
5017 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
5018 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5019 build that caused Emacs to display the hourglass cursor forever.
f99714ce 5020
fd59cb29
GM
5021 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5022 which is broken under remote desktop, calculate the number of
5023 colors available for a display based on the display's number of
5024 planes and number of bits per pixel per plane. (bug#10397).
5025
62c480c9 50262012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 5027
62c480c9
JD
5028 * nsfont.m (Vfonts_in_cache): New variable.
5029 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5030 are used. Add cached fonts to Vfonts_in_cache.
5031 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5032
607446ba
JB
50332012-10-08 Juanma Barranquero <lekktu@gmail.com>
5034
fd5125ad
JB
5035 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5036 in nt/config.nt.
46979e0b
JB
5037 (FONT_H): Define after FRAME_H.
5038 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5039 Update dependencies.
fd5125ad 5040
607446ba
JB
5041 * w32term.c: Remove leftover declaration of keyboard_codepage.
5042
b6f4e300
EZ
50432012-10-08 Eli Zaretskii <eliz@gnu.org>
5044
c54ebba4
EZ
5045 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5046 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5047 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5048 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
5049 ($(BLD)/unexw32.$(O)):
5050 ($(BLD)/w32.$(O)):
5051 ($(BLD)/w32console.$(O)):
5052 ($(BLD)/w32fns.$(O)):
5053 ($(BLD)/w32heap.$(O)):
5054 ($(BLD)/w32menu.$(O)):
15c720a3 5055 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 5056
b6f4e300
EZ
5057 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5058 'const char *'.
5059 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5060
501199a3
DC
50612012-10-08 Daniel Colascione <dancol@dancol.org>
5062
5063 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5064 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5065 accidental message numbering hole. Change other messages to
5066 match.
5067
5068 * w32select.h (HAVE_W32SELECT): Remove.
5069
5070 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 5071 w32common.h instead of w32heap.h.
501199a3
DC
5072
5073 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5074 (get_allocation_unit, get_processor_type, get_w32_major_version)
5075 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5076 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5077 (OS_NT, os_subtype, cache_system_info): Move declarations to
5078 w32common.
5079
5080 * w32heap.c: Include w32common.h.
5081 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
5082 (w32_minor_version, w32_build_number, w32_subtype):
5083 Remove duplicate definitions.
501199a3
DC
5084
5085 * w32fns.c: Include w32common.h; include w32heap.h only in
5086 WINDOWSNT.
5087
5088 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5089 Use `report_file_error' instead of `error' in order to better
5090 inform users of what went wrong. Increase NTGUI_UNICODE file
5091 dialog box file name length to 32k, the maximum allowed by the NT
5092 kernel.
5093
5094 * w32common.h: New file.
5095 (ROUND_UP, ROUND_DOWN, get_page_size)
5096 (get_allocation_unit, get_processor_type, get_w32_major_version)
5097 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5098 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5099 (OS_NT, os_subtype, cache_system_info): Move here.
5100
5101 * unexw32.c, unexcw.c: Include w32common.h.
5102
5103 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5104 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5105 to call syms_of_w32select.
5106
5107 * cygw32.h: Remove obsolete EXFUN declarations.
5108
5109 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5110
5111 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5112 of w32inevt.o from SOME_MACHINE_OBJECTS.
5113
93aa5c81
DC
51142012-10-08 Daniel Colascione <dancol@dancol.org>
5115
5116 * image.c: Permanent fix for JPEG compilation issue --- limit
5117 jpeglib `boolean' redefinition to Cygwin builds.
5118
d424f3d8
EZ
51192012-10-08 Eli Zaretskii <eliz@gnu.org>
5120
8ee4c6ce
EZ
5121 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5122
d424f3d8
EZ
5123 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5124 Cygwin.
5125
e08348a0
DC
51262012-10-08 Daniel Colascione <dancol@dancol.org>
5127
5128 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5129 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5130 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5131 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5132 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5133 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5134 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5135 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5136 now a supported configuration.
5137
5138 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 5139 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
5140
5141 * conf_post.h:
5142 (_DebPrint) declare tracing facility for W32 debugging. We need
5143 to unify tracing later.
5144
5145 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5146 unconditional use of W32 Unicode functions. Cygwin runs only on
5147 100% Unicode operating systems.
5148
5149 * cygw32.c: New file. Define Cygwin-specific facilities.
5150 (Fcygwin_convert_path_to_windows)
5151 (Fcygwin_convert_path_from_windows): New user functions for
5152 accessing Cygwin path-munging routines.
5153
5154 * cygw32.h: New file.
5155 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5156 UTF-16LE strings temporarily inside non-Lisp-visible string
5157 objects.
5158
5159 (w32_strerror): Just what it says on the tin.
5160
5161 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5162 also run for Cygwin; both systems have the same problem with using
5163 GUI facilities in a forked child. Also call syms_of_cygw32,
5164 syms_of_w32select in correct places.
5165
5166 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5167 needs fork-then-exec for daemon launching.
5168
5169 * font.h: Include frame.h.
5170
5171 * image.c: Use the image library cache machinery only when we're
5172 compiling for native WINDOWSNT; Cygwin can use shared libraries
5173 like any other Unixlike system.
5174
5175 * keyboard.c: Clarify a comment regarding the input loop.
5176
5177 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5178 functions directly instead of trying to detect at runtime that our
5179 host operating system supports them. We make this change for two
5180 reasons: Cygwin lacks support for the multibyte character
5181 conversion functions used by the legacy menu code, and Cygwin
5182 never needs to rely on non-Unicode APIs.
5183
5184 * unexw32.c (hinst): Declare extern.
5185
5186 * w32.c: Change header order;
5187 (w32_strerror): Move to w32fns.c because we need it for
5188 non-WINDOWSNT builds.
5189
5190 * w32.h: Add #error macro to make sure we don't include w32.h for
5191 Cygwin builds. Remove w32select declarations.
5192
5193 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 5194 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
5195
5196 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5197 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5198 POSIXy alternative.
5199 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5200 (w32_major_version, w32_minor_version, w32_build_number)
5201 (os_subtype, sound_type): Define here
5202 (w32_defined_color): Make color parameter const for consistency
5203 with other _defined_color functions.
5204 (w32_createwindow): Unconditionally call w32_init_class instead of
5205 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5206 through the code is complex and unnecessary because class
5207 registration is practically free.
5208 (w32_name_of_message): New EMACSDEBUG-only function.
5209 (Fset_message_beep): Move here
5210 (Fx_open_connection): Require that the display name for Windows be
5211 "w32" for consistency, emacsclient disambiguation, and maybe, one
5212 day, multi-window-system support.
5213 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5214 Cygwin files for W32 GUI facilities, since these clearly don't
5215 expect Cygwin names.
5216 (_DebPrint): Define.
5217 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5218 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5219 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5220 (w32_last_error): Remove.
5221
5222 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5223
5224 * w32heap.c (syspage_mask): Declare here.
5225 (cache_system_info): Remove.
5226
5227 * w32inevt.c (faked_key): Define globally, not statically.
5228 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5229 (w32_console_toggle_lock_key): Move to w32fns.c.
5230
5231 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5232
5233 * w32proc.c (_DebPrint): Move to w32fns.c.
5234 * w32select.c: Include string.h, stdio.h for Cygwin.
5235 * w32select.h: New File.
5236
5237 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5238 get_osfhandle.
5239 (w32_message_fd): New variable. Under Cygwin, holds the file
5240 descriptor the system used to tell us about pending thread
5241 messages.
5242
5243 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5244 that prevented compilation under non-WINDOWSNT systems.
5245
5246 (w32_initialize): Open /dev/windows and assign it to
5247 w32_message_fd. Provide w32 feature.
5248
5249 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5250 (WM_EMACS_INPUT_READY): add.
5251 (prepend_msg, w32_message_fd): Declare globally.
5252
5253 * w32xfns.c:
5254 (keyboard_handle): Use only when WINDOWSNT.
5255 (notify_msg_ready): New function. Posts a message to the main
5256 thread's message queue under CYGWIN, which wakes up the main
5257 thread from select(2) by making the /dev/windows file descriptor
5258 ready. Under WINDOWSNT, it sets an event the same way the old
5259 code did.
5260
5261 (post, prepend_msg): Actually call notify_msg_ready instead of
5262 setting the input event directly.
5263
98daa893
EZ
52642012-10-07 Eli Zaretskii <eliz@gnu.org>
5265
5266 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5267 but it still has blocs in it, don't return it to the system,
5268 instead of aborting. (Bug#12402)
5269
3bc0a2f7
JD
52702012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5271
8ad5b73b 5272 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 5273
335f5ae4
JD
5274 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5275 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
5276 (syms_of_nsterm): Remove comment about Panther and above for
5277 ns-antialias-text.
335f5ae4
JD
5278 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5279 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5280 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5281
5282 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5283 MAC_OS_X_VERSION_10_4.
5284
8ad5b73b
JD
5285 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5286 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
5287
5288 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5289
5290 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5291 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5292
3bc0a2f7
JD
5293 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5294 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
5295 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5296 Remove ns_in_resize check.
3bc0a2f7
JD
5297 (ns_clear_frame_area): Remove resize handle code.
5298
5299 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
5300 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5301 Remove ns_in_resize check.
3bc0a2f7 5302
c622b48f
PE
53032012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5304
5305 Improve sys_siglist detection.
5306 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5307 defined as a macro, as is done in Solaris.
5308 (sys_siglist_entries): New macro.
5309 (save_strsignal): Use it.
5310 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5311 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5312
04fafa46
JD
53132012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5314
5315 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5316 fullscreen/Fullscreen.
5317
5318 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5319 tobar_height is new.
5320
5321 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5322 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5323 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5324 (windowDidResize:): Check for correct window if old style fullscreen.
5325 Capitalize word in comment. Remove incorrect comment.
5326 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5327 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5328 error in drawing background.
1f9f395d 5329 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
5330 Set toolbar values to zero, save old height in tobar_height.
5331 Restore tool bar height when leaving fullscreen.
5332 (canBecomeMainWindow): New function.
5333
c6e21c03
PE
53342012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5335
5336 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5337
0d9f584b
EZ
53382012-10-05 Eli Zaretskii <eliz@gnu.org>
5339
a65fbb5f
EZ
5340 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5341
0d9f584b 5342 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
5343 that time stamps of directories could also be changed.
5344 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
5345 FILE_WRITE_ATTRIBUTES access rights.
5346
5347 * fileio.c (Fset_file_times): Special-case ignoring errors for
5348 directories only on MSDOS, not on MS-Windows.
5349
e8757f09 53502012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
5351
5352 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5353
7604f298
EZ
53542012-10-04 Eli Zaretskii <eliz@gnu.org>
5355
5356 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5357 see whether CreateFile failed.
5358
88d69b7d
PE
53592012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5360
5361 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5362 to avoid similar races.
5363 * keyboard.c (pending_signals): Now bool, not int.
5364
7509f454
PE
5365 Port timers to OpenBSD, plus check for timer failures.
5366 OpenBSD problem reported by Han Boetes.
5367 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5368 and/or setitimer.
5369 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5370 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5371 like OpenBSD, which has timer_settime but does not declare it.
5372 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5373 whether to use itimerspec-related primitives. All uses of
5374 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5375
a3c5c0c5
PE
53762012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5377
5378 * profiler.c (handle_profiler_signal): Fix a malloc race
5379 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5380
914e743b
JD
53812012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5382
5383 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5384
d8ab37a8
EZ
53852012-10-02 Eli Zaretskii <eliz@gnu.org>
5386
5387 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5388 consistent with the change in return value of 'safe_strsignal'.
5389
b3ecad33
PE
53902012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5391
0a99eee1
PE
5392 Prefer plain 'static' to 'static inline' (Bug#12541).
5393 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5394 (bidi_set_sor_type, bidi_push_embedding_level)
5395 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5396 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5397 (bidi_cache_search, bidi_cache_ensure_space)
5398 (bidi_cache_iterator_state, bidi_cache_find)
5399 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5400 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5401 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5402 Now 'static', not 'static inline'.
5403
b3ecad33
PE
5404 Count overruns when profiling; change units to ns.
5405 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5406 Give extra weight to samples after overruns, to attempt to count
5407 the time more accurately.
5408 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5409 the underlying primitives nominally do ns.
5410 (Fprofiler_cpu_start): Document the change. Mention that
5411 the sampling intervals are only approximate.
5412
090cf9db
SM
54132012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5414
5415 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5416
5417 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5418 case for the special 0 coding-system.
5419
5420 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5421 (Fmake_overlay): Remove redundant tests.
64edc777 5422 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 5423
81550bf4
JB
54242012-10-02 Juanma Barranquero <lekktu@gmail.com>
5425
5426 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5427 Update dependencies.
5428
aa1ba90e
PE
54292012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5430
5431 Fix a malloc race condition involving strsignal.
5432 A signal can arrive in the middle of a malloc, and Emacs's signal
5433 handler can invoke strsignal, which can invoke malloc, which is
5434 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5435 Fix it by altering the signal handler so that it does not invoke
5436 strsignal.
5437 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5438 * process.c (status_message): Use const pointer, in case strsignal
5439 is #defined to safe_strsignal.
5440 * sysdep.c (sys_siglist, init_signals): Always define and
5441 initialize a substitute sys_siglist if the system does not define
5442 one, even if HAVE_STRSIGNAL.
5443 (safe_strsignal): Rename from strsignal. Always define,
5444 using sys_siglist. Return a const pointer.
5445 * syssignal.h (safe_strsignal): New decl.
5446 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5447
ace917bd
EZ
54482012-10-01 Eli Zaretskii <eliz@gnu.org>
5449
5450 * w32proc.c (timer_loop): Fix code that waits for timer
5451 expiration, to avoid high CPU usage.
5452
9eb71b9c
SM
54532012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5454
5455 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5456 (sweep_weak_table): Remove redundant prototypes.
5457
b3317662
FP
54582012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5459
5460 * emacs.c: Move the inclusion of TERM_HEADER after including
5461 windows.h on WINDOWSNT. This avoids compilation problems with
5462 MSVC.
5463
f0e5f225
EZ
54642012-10-01 Eli Zaretskii <eliz@gnu.org>
5465
2d7d1608
EZ
5466 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5467 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5468 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5469 as the previous version used 'void *'.
5470
5471 * ralloc.c (ROUNDUP): Fix last change.
5472 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5473 'size_t'.
5474
f0e5f225
EZ
5475 * w32proc.c <disable_itimers>: New static flag.
5476 (init_timers): Initialize it to zero, after creating the critical
5477 sections used by the timer threads.
5478 (term_timers): Set to 1 before deleting the critical sections.
5479 (getitimer, setitimer): If disable_itimers is non-zero, return an
5480 error indication without doing anything. Reported by Fabrice
5481 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
5482 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5483 return results.
5484 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5485 support timers.
f0e5f225
EZ
5486
5487 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5488 term_ntproc after all the other bookkeeping, to get timers working
5489 as long as possible.
5490
82ef37c1
PE
54912012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5492
b3a4c387
PE
5493 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5494 Suggested by Juri Linkov in
5495 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5496
b0ab8123
PE
5497 Prefer plain 'static' to 'static inline' (Bug#12541).
5498 With static functions, modern compilers inline pretty well by
5499 themselves; advice from programmers often hurts as much as it helps.
5500 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5501 this change shrinks the text size of the Emacs executable by 1.1%
5502 without affecting CPU significantly in my benchmark.
5503 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5504 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5505 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5506 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5507 (bset_auto_fill_function, bset_auto_save_file_format)
5508 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5509 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5510 (bset_cache_long_line_scans, bset_case_fold_search)
5511 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5512 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5513 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5514 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5515 (bset_header_line_format, bset_indicate_buffer_boundaries)
5516 (bset_indicate_empty_lines, bset_invisibility_spec)
5517 (bset_left_fringe_width, bset_major_mode, bset_mark)
5518 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5519 (bset_name, bset_overwrite_mode, bset_pt_marker)
5520 (bset_right_fringe_width, bset_save_length)
5521 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5522 (bset_scroll_up_aggressively, bset_selective_display)
5523 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5524 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5525 (set_buffer_overlays_after):
5526 * category.c (bset_category_table):
5527 * charset.c (read_hex):
5528 * coding.c (produce_composition, produce_charset)
5529 (handle_composition_annotation, handle_charset_annotation)
5530 (char_encodable_p):
5531 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5532 (assign_row, set_frame_matrix_frame, make_current)
5533 (add_row_entry):
5534 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5535 * fns.c (maybe_resize_hash_table):
5536 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5537 * gmalloc.c (register_heapinfo):
5538 * image.c (lookup_image_type):
5539 * intervals.c (set_interval_object, set_interval_left)
5540 (set_interval_right, copy_interval_parent, rotate_right)
5541 (rotate_left, balance_possible_root_interval):
5542 * keyboard.c (kset_echo_string, kset_kbd_queue)
5543 (kset_keyboard_translate_table, kset_last_prefix_arg)
5544 (kset_last_repeatable_command, kset_local_function_key_map)
5545 (kset_overriding_terminal_local_map, kset_real_last_command)
5546 (kset_system_key_syms, clear_event, set_prop):
5547 * lread.c (digit_to_number):
5548 * marker.c (attach_marker, live_buffer, set_marker_internal):
5549 * nsterm.m (ns_compute_glyph_string_overhangs):
5550 * process.c (pset_buffer, pset_command)
5551 (pset_decode_coding_system, pset_decoding_buf)
5552 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5553 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5554 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5555 * syntax.c (bset_syntax_table, dec_bytepos):
5556 * terminal.c (tset_param_alist):
5557 * textprop.c (interval_has_some_properties)
5558 (interval_has_some_properties_list):
5559 * window.c (wset_combination_limit, wset_dedicated)
5560 (wset_display_table, wset_hchild, wset_left_fringe_width)
5561 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5562 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5563 (wset_right_fringe_width, wset_right_margin_cols)
5564 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5565 (wset_vertical_scroll_bar_type, wset_window_parameters):
5566 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5567 (wset_column_number_displayed, wset_region_showing)
5568 (window_box_edges, run_window_scroll_functions)
5569 (append_glyph_string_lists, prepend_glyph_string_lists)
5570 (append_glyph_string, set_glyph_string_background_width)
5571 (append_glyph, append_composite_glyph)
5572 (take_vertical_position_into_account):
5573 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5574 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5575 (lface_hash, lface_same_font_attributes_p, lookup_face):
5576 * xml.c (libxml2_loaded_p):
5577 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5578 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5579 Now 'static', not 'static inline'.
5580
05584c31
PE
5581 * bidi.c: Tune.
5582 (bidi_copy_it): Do the whole copy with a single memcpy.
5583 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5584
86ec63ba
PE
5585 Revert the FOLLOW-SYMLINKS change for file-attributes.
5586 Doing it right would require several changes to Tramp, and there's
5587 not enough time to get that tested before the freeze today.
5588 * dired.c (directory_files_internal, Ffile_attributes):
5589 Undo last change.
5590
82ef37c1
PE
5591 * frame.c (x_report_frame_params): Port better to wider ints.
5592 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5593 or that pointers can be printed in 15 decimal digits.
5594 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5595
62aba0d4
FP
55962012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5597
5598 Support x64 build on MS-Windows.
5599 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5600 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5601 compatibility with x64.
5e4daaf3 5602 (x_get_focus_frame): Add prototype.
62aba0d4
FP
5603
5604 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5605 defining an XRectangle structure.
5606
5607 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5608 arithmetics for compatibility with x64.
5609
5610 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5611 compatibility with x64.
5612
5613 * w32heap.h: Adjust prototypes and declarations.
5614
5615 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5616 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5617 DWORD, long, and unsigned long, for compatibility with x64.
5618 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5619 (sbrk): Argument is now of type ptrdiff_t.
5620
5621 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5622 less than 0x0500.
5623 (w32_msg_pump): Use WPARAM type for 'result'.
5624
5625 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5626 architecture.
5627 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5628 compatibility with x64.
5629
5630 * vm-limit.c (lim_data): Now size_t.
5631 (check_memory_limits): Adjust prototypes of real_morecore and
5632 __morecore to receive argument of type ptrdiff_t. Use size_t for
5633 five_percent and data_size.
5634
5635 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5636 variables, for compatibility with x64.
5637 (rva_to_section, offset_to_section, relocate_offset)
5638 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5639 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5640 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5641 for compatibility with x64.
5642
5643 * sysdep.c (STDERR_FILENO): Define if not already defined.
5644
5645 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5646 (__morecore): Argument type is now ptrdiff_t.
5647 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5648 (relinquish): Use ptrdiff_t type for 'excess'.
5649 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5650
5651 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5652 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5653 instead of a literal number.
5654
5655 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5656 (min): Define only if not already defined.
5657
5658 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5659 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5660 hosts.
5661
5662 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5663 'bitmaps' is a pointer.
5664
5665 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5666
5667 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5668
e7a2937b
PE
56692012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5670
5671 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5672 * dired.c (directory_files_internal, Ffile_attributes):
5673 New arg follow_symlinks. All uses changed.
5674
b43d62ae
SM
56752012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5676
5677 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5678
c06c382a
EZ
56792012-09-30 Eli Zaretskii <eliz@gnu.org>
5680
5681 Support atimers and CPU profiler via profile.c on MS-Windows.
5682 * w32proc.c (sig_mask, crit_sig): New static variables.
5683 (sys_signal): Support SIGALRM and SIGPROF.
5684 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 5685 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
5686 sigfillset, and sigprocmask are no longer no-ops.
5687 (sigismember): New function.
5688 (struct itimer_data): New definition.
5689 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5690 (crit_prof): New static variables.
5691 (MAX_SINGLE_SLEEP): New definition.
5692 (timer_loop, stop_timer_thread, term_timers, init_timers)
5693 (start_timer_thread, getitimer, setitimer): New functions.
5694 (alarm): No longer a no-op, calls setitimer.
5695
5696 * w32.c (term_ntproc): Call term_timers.
5697 (init_ntproc): Make sure all signals are unblocked at startup, to
5698 erase any traces of dumping. Call init_timers.
5699
5700 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5701 Windows-specific code to display the hourglass mouse pointer is no
5702 longer used.
5703 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5704 to hourglass timer expiration.
5705 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5706 Remove, no longer used.
b43d62ae
SM
5707 (w32_note_current_window, show_hourglass, hide_hourglass):
5708 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
5709 window systems.
5710 (syms_of_w32fns): Don't initialize hourglass_timer.
5711
5712 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5713 WINDOWSNT as well.
5714 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5715
5716 * w32.h (init_timers, term_timers): Add prototypes.
5717
95402d5f
KH
57182012-09-30 Kenichi Handa <handa@gnu.org>
5719
5720 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5721 to the buffer relocation which may be caused by ccl_driver.
5722
dd946752
JD
57232012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5724
d7e642cc
JD
5725 * xfns.c (Fx_file_dialog): Update comment.
5726
5727 * w32fns.c (Fx_file_dialog): Update comment.
5728
5729 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5730 Initialize panel name field if OSX >= 10.6.
5731
5732 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5733
dd946752
JD
5734 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5735
5736 * nsterm.m (NEW_STYLE_FS): New define.
5737 (ns_fullscreen_hook, windowWillEnterFullScreen)
5738 (windowDidEnterFullScreen, windowWillExitFullScreen)
5739 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5740 (setFSValue): New functions.
5741 (EmacsFSWindow): New implementation.
5742 (canBecomeKeyWindow): New function for EmacsFSWindow.
5743 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5744 (dealloc): Release nonfs_window if in fullscreen.
5745 (updateFrameSize:): Call windowDidMove to update top/left.
5746 (windowWillResize:toSize:): Check if frame is still maximized.
5747 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5748 next_maximized, maximized_width, maximized_height and nonfs_window.
5749 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5750 tbar_height.
5751 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 5752 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
5753
5754 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5755 (EmacsView): Add variables for fullscreen.
5756 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5757 (EmacsFSWindow): New interface for fullscreen.
5758
427730eb
JB
57592012-09-30 Juanma Barranquero <lekktu@gmail.com>
5760
5761 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5762
48de8b12
CY
57632012-09-30 Chong Yidong <cyd@gnu.org>
5764
5765 * fns.c (Frandom): Doc fix.
5766
5938d519
MR
57672012-09-30 Martin Rudalics <rudalics@gmx.at>
5768
5769 * window.c (Vwindow_combination_limit): New default value.
5770 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5771
cb5b0266
PE
57722012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5773
5774 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5775 Suggested by Eli Zaretskii in
5776 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5777
84f72efd
EZ
57782012-09-30 Eli Zaretskii <eliz@gnu.org>
5779
5780 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5781 HAVE_TIMER_SETTIME is defined.
5782
9d4dcdc9
PE
57832012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5784
d89460ed
PE
5785 Profiler improvements: more-accurate timers, overflow checks.
5786 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5787 signal.h, setjmp.h. Include systime.h instead.
5788 (saturated_add): New function.
5789 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5790 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5791 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5792 New static vars.
84f72efd 5793 (enum profiler_cpu_running): New enum.
d89460ed
PE
5794 (profiler_cpu_running): Now of that enum type, not bool.
5795 All uses changed to store the new value.
5796 (handle_profiler_signal): Rename from sigprof_handler_1,
5797 for consistency with other handlers. Do not check whether
5798 cpu_log is a hash-table if garbage collecting, since it
5799 doesn't matter in that case.
5800 (deliver_profiler_signal): Rename from sigprof_handler,
5801 for consistency with other handlers.
5802 (setup_cpu_timer): New function, with much of what used to be in
5803 Fprofiler_cpu_start. Check for out-of-range argument.
5804 Prefer timer_settime if available, and prefer
5805 thread cputime clocks, then process cputime clocks, then
5806 monotonic clocks, to the old realtime clock. Use make_timeval
5807 to round more-correctly when falling back to setitimer.
5808 (Fprofiler_cpu_start): Use it.
5809 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5810 Don't assume that passing NULL as the 2nd argument of setitimer
5811 is the same as passing a pointer to all-zero storage.
5812 Ignore SIGPROF afterwards.
5813 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5814 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5815 non-fatal signal handlers. Ignore SIGPROF on startup.
5816 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5817 in profiler.c, since sysdep.c now uses it.
5818
9d4dcdc9
PE
5819 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5820 Suggested by Eli Zaretskii in
5821 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5822
8e5691a0
JB
58232012-09-29 Juanma Barranquero <lekktu@gmail.com>
5824
5825 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5826
e7c1b6ef
SM
58272012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5828
5829 * lisp.h (struct backtrace): Remove indirection for `function' field.
5830 * xdisp.c (redisplay_internal):
5831 * profiler.c (record_backtrace, sigprof_handler_1):
5832 * alloc.c (Fgarbage_collect):
5833 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5834 (Fbacktrace_frame): Adjust accordingly.
5835
e61d39cd 58362012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
5837
5838 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5839 (Frun_hook_with_args_until_failure): Doc fixes.
5840
404043ea
EZ
58412012-09-28 Eli Zaretskii <eliz@gnu.org>
5842
5843 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5844 Qautomatic_redisplay and change the symbol name. All users changed.
5845
704d3f45
TM
58462012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5847
5848 * profiler.c (sigprof_handler): Fix race condition.
5849
757140ff
GM
58502012-09-28 Glenn Morris <rgm@gnu.org>
5851
5852 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5853
a615a3ae
PE
58542012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 Check more robustly for timer_settime.
89d17fd0
PE
5857 * Makefile.in (LIB_TIMER_TIME): New macro.
5858 (LIBES): Add it.
a615a3ae
PE
5859 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5860 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5861 call timer_settime.
5862
3670daf7
TM
58632012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5864
5865 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5866
6a586b7f
JB
58672012-09-26 Juanma Barranquero <lekktu@gmail.com>
5868
5869 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5870
41c8bfcf
PE
58712012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 * character.h (MAYBE_UNIFY_CHAR): Remove.
5874 * charset.c, charset.h (maybe_unify_char): Now static.
5875 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5876 Since this stuff is now private to charset.c, there's no need for
5877 a public macro and no need to inline by hand.
5878
3a880af4 58792012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
908589fd
AS
5880 Stefan Monnier <monnier@iro.umontreal.ca>
5881 Juanma Barranquero <lekktu@gmail.com>
611b7507 5882
3a880af4
SM
5883 * profiler.c: New file.
5884 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
5885 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5886 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
5887 * emacs.c (main): Call syms_of_profiler.
5888 * alloc.c (Qautomatic_gc): New constant.
5889 (MALLOC_PROBE): New macro.
5890 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5891 (total_bytes_of_live_objects): New function.
5892 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5893 Call malloc_probe for the memory profiler.
5894 (syms_of_alloc): Define Qautomatic_gc.
5895 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5896 race condition.
5897 (struct backtrace): Move definition...
5898 * lisp.h (struct backtrace): ..here.
5899 (Qautomatic_gc, profiler_memory_running): Declare vars.
5900 (malloc_probe, syms_of_profiler): Declare functions.
5901 * xdisp.c (Qautomatic_redisplay): New constant.
5902 (redisplay_internal): Record itself in backtrace_list.
5903 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 5904
5938d519 59052012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
59062012-09-25 Juanma Barranquero <lekktu@gmail.com>
5907
5908 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5909
e26fd2e4
PE
59102012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5911
5912 Prefer POSIX timers if available.
5913 They avoid a race if the timer is too close to the current time.
5914 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5915 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 5916 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 5917
eedec3ee
EZ
59182012-09-25 Eli Zaretskii <eliz@gnu.org>
5919
5920 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5921 CHAR_STRING_ADVANCE.
5922 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5923 STRING_CHAR_ADVANCE.
5924
aa15c6bb
JB
59252012-09-25 Juanma Barranquero <lekktu@gmail.com>
5926
5927 Move Vlibrary_cache to emacs.c and reset before dumping.
5928
5929 * lisp.h (reset_image_types): Declare.
5930 [WINDOWSNT] (Vlibrary_cache): Declare.
5931
5932 * image.c (reset_image_types): New function.
5933
5934 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5935 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5936 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5937
5938 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5939 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5940
5941 * w32.h (Vlibrary_cache): Do not declare.
5942
54d629be
EZ
59432012-09-25 Eli Zaretskii <eliz@gnu.org>
5944
16b22fef
EZ
5945 * w32proc.c (sys_signal): Handle all signals defined by the
5946 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5947 handlers for signals supported by Windows. Don't override
5948 term_ntproc as the handler for SIGABRT.
5949 (sigaction): Rewrite to call sys_signal instead of duplicating its
5950 code.
5951 (sys_kill): Improve commentary.
5952
5953 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5954 consistency with a signature of a signal handler. All callers
5955 changed.
5956 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5957 install term_ntproc as a signal handler for SIGABRT, as that
5958 should be done by the dumped Emacs.
5959
5960 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5961
5962 * w32select.c (term_w32select): Protect against repeated
5963 invocation by setting clipboard_owner to NULL after calling
5964 DestroyWindow.
5965
5966 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5967 and term_ntproc to their modified signatures.
5968
54d629be
EZ
5969 * character.c (char_string, string_char): Remove calls to
5970 MAYBE_UNIFY_CHAR. See the discussion starting at
5971 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5972 for the details.
5973
59f7af81
CY
59742012-09-25 Chong Yidong <cyd@gnu.org>
5975
5976 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5977
22e8cf4a
SM
59782012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5979
5980 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5981 when encountering an unknown bytecode.
5982
578098f3
PE
59832012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5984
5985 image.c, indent.c: Use bool for booleans.
5986 * dispextern.h (struct image_type): Members valid_p, load, init
5987 now return bool, not int. All uses changed.
5988 * image.c: Omit unnecessary static decls.
5989 (x_create_bitmap_mask, x_build_heuristic_mask):
5990 Return void, not int, since callers don't care about the return value.
5991 (x_create_bitmap_mask, define_image_type, valid_image_p)
5992 (struct image_keyword, parse_image_spec, image_spec_value)
5993 (check_image_size, image_background)
5994 (image_background_transparent, x_clear_image_1)
5995 (postprocess_image, lookup_image, x_check_image_size)
5996 (x_create_x_image_and_pixmap, xbm_image_p)
5997 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5998 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5999 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6000 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6001 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6002 (png_image_p, init_png_functions, png_load_body, png_load)
6003 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6004 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6005 (init_gif_functions, gif_load, imagemagick_image_p)
6006 (imagemagick_load_image, imagemagick_load, svg_image_p)
6007 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6008 (gs_load):
6009 * nsimage.m (ns_load_image):
6010 * nsterm.m (ns_defined_color):
6011 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6012 * xfns.c (x_defined_color):
6013 * xterm.c (x_alloc_lighter_color_for_widget)
6014 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6015 (x_alloc_lighter_color):
6016 * indent.c (disptab_matches_widthtab, current_column)
6017 (scan_for_column, string_display_width, indented_beyond_p)
6018 (compute_motion, vmotion, Fvertical_motion):
6019 Use bool for booleans.
6020
a5f2b6ec
CY
60212012-09-24 Chong Yidong <cyd@gnu.org>
6022
6023 * chartab.c (Fset_char_table_default): Obsolete function removed.
6024
18e27ea8
PE
60252012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6026
afea8a8a
PE
6027 Move pid_t related decls out of lisp.h.
6028 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6029 (interruptible_wait_for_termination):
6030 Move these decls from lisp.h to syswait.h, since they use pid_t.
6031 Needed on FreeBSD; see Herbert J. Skuhra in
6032 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6033 * callproc.c: Include syswait.h.
6034
18e27ea8
PE
6035 gnutls.c, gtkutil.c: Use bool for boolean.
6036 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6037 (emacs_gnutls_handle_error):
6038 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6039 (xg_hide_tooltip, xg_create_frame_widgets)
6040 (create_dialog, xg_uses_old_file_dialog)
6041 (xg_get_file_with_chooser, xg_get_file_with_selection)
6042 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6043 (xg_item_label_same_p, xg_update_menubar)
6044 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6045 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6046 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6047 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6048 (update_frame_tool_bar, free_frame_tool_bar):
6049 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6050 * nsmenu.m (ns_update_menubar):
6051 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6052 * xfns.c (Fx_show_tip) [USE_GTK]:
6053 Use bool for boolean.
6054 * gtkutil.c (xg_update_frame_menubar):
6055 * xmenu.c (update_frame_menubar):
6056 Return void, not int, since caller ignores return value.
6057 * gtkutil.c (xg_change_toolbar_position):
6058 Return void, not 1.
6059
af0e9f75
JB
60602012-09-23 Juanma Barranquero <lekktu@gmail.com>
6061
6062 * makefile.w32-in (BLOCKINPUT_H): Remove.
6063 (SYSSIGNAL_H): New macro.
6064 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6065 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6066 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6067 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6068 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6069 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6070 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6071 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6072 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6073 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6074 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6075 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6076 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6077 ($(BLD)/w32xfns.$(O)): Update dependencies.
6078
5101529e
EZ
60792012-09-23 Eli Zaretskii <eliz@gnu.org>
6080
6081 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6082 fatal_error_backtrace.
6083
6084 * w32proc.c (sys_kill): Undo last change: don't do anything when
6085 invoked to deliver SIGABRT to our own process. This is now
6086 handled by emacs_raise.
6087
2c3ee0ad
JB
60882012-09-23 Juanma Barranquero <lekktu@gmail.com>
6089
6090 * w32term.c (w32_read_socket): Remove leftover reference to
6091 interrupt_input_pending.
6092
62a1d661
PE
60932012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6094
6095 Do not use SA_NODEFER.
6096 Problem reported by Dani Moncayo in
6097 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6098 * alloc.c (die):
6099 * sysdep.c (emacs_abort): Do not reset signal handler.
6100 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6101 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6102 wanted even on POSIXish hosts, and it doesn't work on Windows.
6103
a0942b9a
JD
61042012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6105
6106 * xterm.c (x_term_init): Call fixup_locale before and after calling
6107 gtk_init (Bug#12392).
6108
d07ff9db
CY
61092012-09-23 Chong Yidong <cyd@gnu.org>
6110
6111 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6112 Vdynamic_library_alist.
6113
6114 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6115 (Fgnutls_available_p): Caller changed.
6116
6117 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6118 (Flibxml_parse_xml_region): Likewise.
6119
6120 * dispextern.h (struct image_type): Remove arg from init function.
6121
6122 * image.c (Finit_image_library, lookup_image_type)
6123 (define_image_type): Remove now-unneeded second arg.
6124 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6125 (init_tiff_functions, init_gif_functions, init_svg_functions):
6126 Arglist and w32_delayed_load calling convention changed.
6127 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 6128 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 6129
4d7e6e51
PE
61302012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6131
6132 Simplify and avoid signal-handling races (Bug#12471).
6133 * alloc.c (die):
6134 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6135 Avoid recursive loop if there's a fatal error in the function itself.
6136 * atimer.c (pending_atimers):
6137 * blockinput.h: Don't include "atimer.h"; no longer needed.
6138 (interrupt_input_pending): Remove. All uses removed.
6139 pending_signals now counts both atimers and ordinary interrupts.
6140 This is less racy than having three separate pending-signal flags.
6141 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6142 (input_blocked_p):
6143 Rename from their upper-case counterparts BLOCK_INPUT,
6144 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6145 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6146 This makes it easier to access volatile variables more accurately.
6147 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6148 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6149 that's more reliable if the code is buggy and sets
6150 interrupt_input_blocked to a negative value. All uses changed.
6151 * atimer.c (deliver_alarm_signal):
6152 Remove. No need to deliver this to the parent; any thread can
6153 handle this signal now. All uses replaced by underlying handler.
6154 * atimer.c (turn_on_atimers):
6155 * dispnew.c (handle_window_change_signal):
6156 * emacs.c (handle_danger_signal):
6157 * keyboard.c (kbd_buffer_get_event):
6158 Don't reestablish signal handler; not needed with sigaction.
6159 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6160 (UNBLOCK_INPUT_TO):
6161 Rework to avoid unnecessary accesses to volatile variables.
6162 (UNBLOCK_INPUT_TO): Now a function.
6163 (totally_unblock_input, unblock_input): New decls.
6164 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6165 (init_data): Remove. Necessary stuff now done in init_signal.
6166 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6167 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6168 (fatal_error_code): Remove; no longer needed.
6169 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6170 it doesn't always backtrace. All uses changed. No need to reset
6171 signal to default, since sigaction and/or die does that for us now.
6172 Use emacs_raise (FOO), not kill (getpid (), FOO).
6173 (main): Check more-accurately whether we're dumping.
6174 Move fatal-error setup to sysdep.c
6175 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6176 * gtkutil.c (xg_get_file_name, xg_get_font):
6177 Remove no-longer-needed signal-mask manipulation.
6178 * keyboard.c, process.c (POLL_FOR_INPUT):
6179 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6180 * keyboard.c (read_avail_input): Remove.
6181 All uses replaced by gobble_input.
6182 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6183 (kbd_buffer_store_event_hold, gobble_input):
6184 (record_asynch_buffer_change) [USABLE_SIGIO]:
6185 (store_user_signal_events):
6186 No need to mess with signal mask.
6187 (gobble_input): If blocking input and there are terminals, simply
6188 set pending_signals to 1 and return. All hooks changed to not
6189 worry about whether input is blocked.
6190 (process_pending_signals): Clear pending_signals before processing
6191 them, in case a signal comes in while we're processing.
6192 By convention callers now test pending_signals before calling us.
6193 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6194 New functions, to support changes to blockinput.h.
6195 (handle_input_available_signal): Now extern.
6196 (reinvoke_input_signal): Remove. All uses replaced by
6197 handle_async_input.
6198 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
6199 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6200 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
6201 Clear sigmask reliably, even if Fsignal returns, which it can.
6202 Omit unnecessary accesses to volatile var.
6203 (quit_throw_to_read_char): No need to restore sigmask.
6204 * keyboard.c (gobble_input, handle_user_signal):
6205 * process.c (wait_reading_process_output):
6206 Call signal-handling code rather than killing ourselves.
6207 * lisp.h: Include <float.h>, for...
6208 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6209 (pending_signals): Now volatile.
6210 (syms_of_data): Now const if IEEE floating point.
6211 (handle_input_available_signal) [USABLE_SIGIO]:
6212 (terminate_due_to_signal, record_child_status_change): New decls.
6213 * process.c (create_process): Avoid disaster if memory is exhausted
6214 while we're processing a vfork, by tightening the critical section
6215 around the vfork.
6216 (send_process_frame, process_sent_to, handle_pipe_signal)
6217 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6218 ignores SIGPIPE.
6219 (send_process): No need for setjmp/longjmp any more, since the
6220 SIGPIPE stuff is now gone. Instead, report an error if errno
6221 is EPIPE.
6222 (record_child_status_change): Now extern. PID and W are now args.
6223 Return void, not bool. All callers changed.
6224 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6225 Remove. All uses removed. This bug should be fixed now in a
6226 different way.
6227 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6228 and record the child status change directly. This avoids the
6229 need to futz with the signal mask.
6230 (process_fatal_action): Move here from emacs.c.
6231 (emacs_sigaction_flags): New function, containing
6232 much of what used to be in emacs_sigaction_init.
6233 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6234 caught by emacs, to make races less likely.
6235 (deliver_process_signal): Rename from handle_on_main_thread.
6236 All uses changed.
6237 (BACKTRACE_LIMIT_MAX): Now at top level.
6238 (thread_backtrace_buffer, threadback_backtrace_pointers):
6239 New static vars.
6240 (deliver_thread_signal, deliver_fatal_thread_signal):
6241 New functions, for more-accurate delivery of thread-specific signals.
6242 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6243 (deliver_arith_signal): Handle in this thread, not
6244 in the main thread, since it's triggered by this thread.
6245 (maybe_fatal_sig): New function.
6246 (init_signals): New arg DUMPING so that we can be more accurate
6247 about whether we're dumping. Caller changed.
6248 Treat thread-specific signals differently from process-general signals.
6249 Block all signals while handling fatal error; that's safer.
6250 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6251 on IEEE hosts.
6252 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6253 Ignore SIGPIPE unless batch.
6254 (emacs_backtrace): Output backtrace for the appropriate thread,
6255 which is not necessarily the main thread.
6256 * syssignal.h: Include <stdbool.h>.
6257 (emacs_raise): New macro.
6258 * xterm.c (x_connection_signal): Remove; no longer needed
6259 now that we use sigaction.
6260 (x_connection_closed): No need to mess with sigmask now.
6261 (x_initialize): No need to reset SIGPIPE handler here, since
6262 init_signals does this for us now.
6263
8f4635e9
JD
62642012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6265
6266 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 6267 background rect may be larger (Bug#12245).
8f4635e9 6268
3296976d
CY
62692012-09-23 Chong Yidong <cyd@gnu.org>
6270
6271 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6272
d41e491e
PE
62732012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6274
6275 * .gdbinit: Just stop at fatal_error_backtrace.
6276 See Stefan Monnier's request in
6277 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6278 Remove no-longer-used query of system type.
6279
c88b867f
CY
62802012-09-22 Chong Yidong <cyd@gnu.org>
6281
6282 * search.c (Freplace_match): Doc fix (Bug#12325).
6283
6284 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6285
6286 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6287 (Fline_end_position): Doc fix.
6288
6289 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6290
bb4d86b4
CY
62912012-09-22 Chong Yidong <cyd@gnu.org>
6292
6293 * dispextern.h (struct image_type): Add new slot, storing a type
6294 initialization function.
6295
6296 * image.c (define_image_type): Call the image initializer function
6297 if it is defined. Arguments and return value changed.
6298 (valid_image_p, make_image): Callers changed.
6299 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
6300 (gif_type, imagemagick_type, svg_type, gs_type):
6301 Add initialization functions.
bb4d86b4
CY
6302 (Finit_image_library): Call lookup_image_type.
6303 (CHECK_LIB_AVAILABLE): Macro deleted.
6304 (lookup_image_type): Call define_image_type here, rather than via
6305 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6306 (syms_of_image): Move define_image_type calls for xbm_type and
6307 pbm_type to lookup_image_type.
6308
df9685f3
EZ
63092012-09-22 Eli Zaretskii <eliz@gnu.org>
6310
6311 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6312 'idle_timers' from here ...
6313 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6314 lists, to avoid infloops when the timer does something stupid,
6315 like reinvoke itself with the same or smaller time-out.
6316 (Bug#12447)
6317
8e17c9ba
MR
63182012-09-22 Martin Rudalics <rudalics@gmx.at>
6319
6320 * window.c (Fsplit_window_internal): Handle only Qt value of
6321 Vwindow_combination_limit separately.
6322 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
6323 (Vwindow_combination_limit): New default value.
6324 Rewrite doc-string.
8e17c9ba 6325
589bd69b
EZ
63262012-09-22 Eli Zaretskii <eliz@gnu.org>
6327
6328 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6329 the new overlay string. (Bug#10159)
6330
01108e3f
PE
63312012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6332
6333 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6334 or that fprintf is async-signal-safe. POSIX doesn't require
6335 either assumption.
6336
82f8cd94
CY
63372012-09-22 Chong Yidong <cyd@gnu.org>
6338
6339 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6340 (Bug#8207).
6341
3cccbd87
KH
63422012-09-22 Kenichi Handa <handa@gnu.org>
6343
6344 * composite.c (composition_reseat_it): Handle the case that a
6345 grapheme cluster is not covered by a single font (Bug#12352).
6346
09c01941
CY
63472012-09-21 Chong Yidong <cyd@gnu.org>
6348
6349 * image.c (define_image_type): Avoid adding duplicate types to
6350 image_types (Bug#12463). Suggested by Jörg Walter.
6351
acfa068f 63522012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
6353
6354 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6355 (print_load_command_name): Add case LC_DATA_IN_CODE.
6356 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6357
acfa068f 63582012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
6359
6360 * eval.c (Frun_hook_with_args_until_success)
6361 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6362
acfa068f 63632012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
6364
6365 * fileio.c (Ffile_selinux_context): Only call freecon when
6366 lgetfilecon succeeded.
6367 (Fset_file_selinux_context): Likewise. (Bug#12444)
6368
acfa068f 63692012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
6370
6371 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6372 reordering, locate the cursor by calling set_cursor_from_row; if
6373 that fails, clear the desired glyph matrix before returning a
6374 failure indication to the caller. Fixes leaving garbled display
6375 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
6376 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6377 scrolling through multibyte text.
aa36e4d2 6378
e99f70c8
SM
63792012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6380
6381 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6382 calling mark_vectorlike since that's the one that marks the window.
6383 (mark_discard_killed_buffers): Mark the final cdr.
6384 * window.h (struct window): Move prev/next_buffers to the
6385 non-standard fields.
6386 * window.c (make_window): Initialize prev/next_buffers manually.
6387
f75beb47
PE
63882012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6389
6390 Omit unused arg EXPECTED from socket hooks.
6391 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6392 * nsterm.m (ns_term_init):
6393 * termhooks.h (struct terminal.read_socket_hook):
6394 * w32inevt.c (w32_console_read_socket):
6395 * w32term.c (w32_read_socket):
6396 * xterm.c (XTread_socket):
6397 Omit unused arg EXPECTED. All callers changed.
6398 (store_user_signal_events): Return void, not int, since callers no
6399 longer care about the return value. All uses changed.
6400
b019b76a
JB
64012012-09-20 Juanma Barranquero <lekktu@gmail.com>
6402
6403 * w32gui.h (XParseGeometry): Do not declare.
6404
05642592
PE
64052012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6406
e4bce92a 6407 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 6408 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
6409 <http://bugs.gnu.org/12471#8> (last line).
6410
05642592
PE
6411 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6412 (XParseGeometry): Now static. Substitute extremal values for
6413 values that are out of range.
6414
e543ae91
JD
64152012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6416
6417 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6418
6419 * nsfns.m (XParseGeometry): Remove.
6420 (Fx_create_frame): Call x_set_offset to correctly interpret
6421 top_pos in geometry.
6422
3a880af4 6423 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
6424 (Fx_parse_geometry): If there is a space in string, call
6425 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6426
45ba16c7
EZ
64272012-09-17 Eli Zaretskii <eliz@gnu.org>
6428
c8b9f1bc
EZ
6429 * search.c (scan_buffer): Use character positions in calls to
6430 region_cache_forward and region_cache_backward, not byte
6431 positions. (Bug#12196)
6432
b4c932a2
EZ
6433 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6434 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6435
45ba16c7
EZ
6436 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6437 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6438 emacs_blocked_malloc, now deleted.
6439
eeceac93
PE
64402012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6441
6442 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6443 The workaround was for improving performance on Solaris 2.4, but
6444 is getting in the way now. Emacs will still work if someone is
6445 still running Solaris 2.4 in a museum somewhere; Sun dropped
6446 support for Solaris 2.4 in 2003.
6447 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6448 * process.c (create_process) [HAVE_WORKING_VFORK]:
6449 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6450 since Emacs no longer uses vfork on that platform.
6451
78f83752
GM
64522012-09-17 Glenn Morris <rgm@gnu.org>
6453
6454 * emacs.c: Use COPYRIGHT.
6455
634b8cac
PE
64562012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6457
0caaedb1
PE
6458 Remove configure's --without-sync-input option (Bug#12450).
6459 When auditing signal-handling in preparation for cleaning it up,
6460 I found that SYNC_INPUT has race conditions and would be a real
6461 pain to fix. Since it's an undocumented and deprecated
6462 configure-time option, now seems like a good time to remove it.
6463 Also see <http://bugs.gnu.org/11080#16>.
6464 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6465 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6466 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6467 (malloc_hysteresis):
6468 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6469 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6470 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6471 (dont_register_blocks, bytes_used_when_reconsidered)
6472 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6473 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6474 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 6475 Remove. All uses removed.
0caaedb1
PE
6476 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6477 implementation, one that depends on whether the new macro
6478 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6479 is defined.
6480 * atimer.c (run_timers, handle_alarm_signal):
6481 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6482 (handle_async_input, process_pending_signals)
6483 (handle_input_available_signal, init_keyboard):
6484 * nsterm.m (ns_read_socket):
6485 * process.c (wait_reading_process_output):
6486 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6487 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6488 (emacs_write):
6489 * xterm.c (XTread_socket):
6490 Assume SYNC_INPUT.
6491 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6492 * eval.c (handling_signal): Remove. All uses removed.
6493 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6494 All uses replaced with the SYNC_INPUT version.
6495 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6496 Remove decls.
6497 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6498 Now static.
6499
634b8cac
PE
6500 * font.c (Ffont_shape_gstring): Remove unused local.
6501
83da1b55
GM
65022012-09-16 Glenn Morris <rgm@gnu.org>
6503
518650a5
GM
6504 * Makefile.in (clean): No longer run nextstep's clean.
6505
83da1b55
GM
6506 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6507 (ns_frag): Remove.
6508 (ns-app): Move here from ns.mk, and simplify.
6509 (clean): Simplify nextstep entry.
6510 * ns.mk: Remove file.
6511
85a43e2e
KH
65122012-09-17 Kenichi Handa <handa@gnu.org>
6513
6514 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6515 not covert the last few charactes.
6516
ba13e616 65172012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
6518
6519 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6520 here, but just check the validity of glyphs in the glyph-string.
6521
a8c729af
MR
65222012-09-16 Martin Rudalics <rudalics@gmx.at>
6523
3a880af4
SM
6524 * window.c (Fwindow_parameter, Fset_window_parameter):
6525 Accept any window as argument (Bug#12452).
a8c729af 6526
c077c059
JD
65272012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6528
6529 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6530 to ns_term_init to avoid memory leak.
6531
6532 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6533 explicit retain/release.
6534 (ns_term_init): Only allow one display. Initialize outerpool and
6535 ns_*_types.
6536
39a57ad0
PE
65372012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6538
6539 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6540 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6541 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6542 the Microsoft problem in a different way, by altering ../nt/config.nt.
6543
7105c8cb
EZ
65442012-09-15 Eli Zaretskii <eliz@gnu.org>
6545
6546 * w32xfns.c:
6547 * w32uniscribe.c:
6548 * w32term.c:
6549 * w32select.c:
6550 * w32reg.c:
6551 * w32proc.c:
6552 * w32menu.c:
6553 * w32inevt.c:
6554 * w32heap.c:
6555 * w32font.c:
6556 * w32fns.c:
6557 * w32console.c:
6558 * w32.c:
6559 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6560 by lisp.h. This completes removal of setjmp.h inclusion
6561 erroneously announced in the previous commit. (Bug#12446)
6562
6563 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6564 more accurate.
6565
6566 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6567 not defined as a macro. The latter happens on MS-Windows.
6568 (Bug#12446)
6569
0328b6de
PE
65702012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6573 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 6574 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
6575 only reason for the instance was because "lisp.h" was included.
6576 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6577 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6578 and _longjmp with the new symbols. Emacs already uses _setjmp if
6579 available, so this change affects only POSIXish hosts that have
6580 sigsetjmp but not _setjmp, such as some versions of Solaris and
6581 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6582 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6583 (png_load_body) [HAVE_PNG]:
6584 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6585 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6586 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6587 since PNG requires jmp_buf. This is the only exception to the
6588 general rule that we now use sys_setjmp and sys_longjmp.
6589 This exception is OK since this code does not change the signal
6590 mask or longjmp out of a signal handler.
6591
2af03429
PE
65922012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6593
6594 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6595 Include "syssignal.h", for 'main_thread'.
6596
2f294edf
DA
65972012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6598
6599 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
6600 * insdel.c (replace_range, replace_range_2):
6601 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
6602 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6603 Remove redundant check before calling offset_intervals.
6604
6b533e9c
MR
66052012-09-14 Martin Rudalics <rudalics@gmx.at>
6606
6607 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6608 current buffer (Bug#12387).
6609
2a7931e3
JB
66102012-09-14 Juanma Barranquero <lekktu@gmail.com>
6611
6612 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6613
c18e885b
PE
66142012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6615
6616 Use a more backwards-compatible timer format (Bug#12430).
6617 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6618 vector element, not from the 4th, since PSECS is now at the end.
6619 (Fcurrent_idle_time): Doc fix.
6620
d59a1afb
DA
66212012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6622
6623 Function to mark objects and remove killed buffers at once.
6624 * alloc.c (discard_killed_buffers): Rename to ...
6625 (mark_discard_killed buffers) ... new name. Add marking
6626 of remaining objects. Fix comment. Adjust users.
6627 (mark_object): Do not touch frame buffer lists here.
6628 * frame.c (delete_frame): Reset frame buffer lists here.
6629
5f0cb45a
PE
66302012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6631
8ea47e3a
PE
6632 Better workaround for GNOME bug when --enable-gcc-warnings.
6633 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6634 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6635 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6636
4a4bbad2
PE
6637 Simplify SIGIO usage (Bug#12408).
6638 The code that dealt with SIGIO was crufty and confusing, e.g., it
6639 played tricks like "#undef SIGIO" but these tricks were not used
6640 consistently. Simplify mostly by not #undeffing standard symbols,
6641 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6642 or not as we please) rather than "defined SIGIO" (standard symbol
6643 that we probably shouldn't #undef).
6644 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6645 Modules that need it can include it.
6646 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6647 * dispextern.h (ignore_sigio): New decl.
6648 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6649 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6650 * emacs.c (shut_down_emacs):
6651 * keyboard.c (kbd_buffer_store_event_hold):
6652 Use ignore_sigio rather than invoking 'signal' directly.
6653 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6654 for FIONREAD.
6655 (FIONREAD, SIGIO): Do not #undef.
6656 (tty_read_avail_input): Use #error rather than a syntax error.
6657 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6658 for I_PIPE, used by SETUP_SLAVE_PTY.
6659 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6660 * sysdep.c (croak): Remove; no longer needed. This bit of
6661 temporary code, with Fred N. Fish's comment that it's temporary,
6662 has been in Emacs since at least 1992!
6663 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6664 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6665 * syssignal.h (croak): Remove decl.
6666 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6667 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6668 now that we're termios-only.
6669 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6670 * term.c (dissociate_if_controlling_tty): Use #error rather than
6671 a run-time error.
6672
5f0cb45a
PE
6673 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6674 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6675 to work around GNOME bug 683906.
6676 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6677 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6678 This works around GCC bug 54561.
6679
40bce90b
PE
66802012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6681
6682 More fixes for 'volatile' and setjmp/longjmp.
6683 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6684 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6685 (png_load_body) [HAVE_PNG]:
6686 (jpeg_load_body) [HAVE_JPEG]:
6687 New function, with most of the old parent function's body.
6688 (png_load) [HAVE_PNG]:
6689 (jpeg_load) [HAVE_JPEG]:
6690 Invoke the new function, to avoid longjmp munging our locals.
6691 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6692 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6693 longjmp is passed 2, as the C standard doesn't guarantee this.
6694 Instead, store the failure code into mgr->failure_code.
6695
bfeae2cf
SM
66962012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6697
6698 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6699 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6700 (syms_of_keyboard): Remove support for unread-command-char.
6701
8099e36b
EZ
67022012-09-12 Eli Zaretskii <eliz@gnu.org>
6703
6704 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6705 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6706 violation. (Bug#12426)
6707
92547ff9
PE
67082012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6709
6710 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6711
45b82ad0
SM
67122012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6713
6714 * eval.c: Add `inhibit-debugger'.
6715 (Qinhibit_debugger): New symbol.
6716 (call_debugger): Bind it instead of Qdebug_on_error.
6717 (maybe_call_debugger): Test Vinhibit_debugger.
6718 (syms_of_eval): Define inhibit-debugger.
6719 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6720 (syms_of_xdisp): Remove inhibit-debug-on-message.
6721
5779a1dc
PE
67222012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6723
50f2e553
PE
6724 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6725 If a nonvolatile local variable is written before a _longjmp to
6726 the frame containing the variable, and is read after the _longjmp,
6727 the value read is indeterminate. Some local variables of type
6728 'struct handler' and 'struct catchtag' are used in this way, so
6729 mark each of their slots as volatile if the slot can be set before
6730 _longjmp and read afterwards.
6731 * lisp.h (struct handler): var and chosen_clause are now volatile.
6732 (struct catchtag): val, next, and pdlcount are now volatile.
6733
ae1d87e2
PE
6734 * bidi.c (bidi_push_it, bidi_pop_it):
6735 * fns.c (copy_hash_table):
6736 * image.c (define_image_type):
6737 * keyboard.c (kbd_buffer_store_event_hold):
6738 * process.c (Fprocess_send_eof):
6739 * xfaces.c (x_create_gc) [HAVE_NS]:
6740 * xgselect.c (xg_select):
6741 Prefer assignment to memcpy when either will do.
6742
5779a1dc
PE
6743 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6744 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6745 time an item is removed. No need to mark this function 'inline';
6746 the compiler knows better than we do.
6747
c4c9756b
JD
67482012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6749
6750 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6751 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6752 to change_frame_size (Bug#12388).
6753 (windowDidResize:): Pass YES to updateFrameSize.
6754
6755 * nsterm.h: Add delay parameter to updateFrameSize.
6756
d73e321c
DA
67572012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6758
6759 Discard killed buffers from deleted window and frame objects.
6760 This reduces an amount of references to killed buffers and
6761 helps GC to reclaim them faster.
6762 * alloc.c (discard_killed_buffers): New function.
6763 (mark_object): Use it for deleted windows and frames.
6764 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 6765 or deleted frame, restore its global binding.
d73e321c
DA
6766 * data.c (swap_in_global_binding): Add GC notice.
6767 (swap_in_symval_forwarding): Use convenient set_blv_where.
6768 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6769 * window.h: ... to here.
6770
e578f381
DA
67712012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6772
6773 Convenient macro to check whether the buffer is live.
6774 * buffer.h (BUFFER_LIVE_P): New macro.
6775 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6776 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6777
3057e615
YM
67782012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6779
6780 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6781 composition cases (Bug#12364).
6782
6783 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6784 overhang of succeeding glyphs overlapping box cursor.
6785
6786 * w32term.c (x_draw_glyph_string): Likewise.
6787
6fda35f2
PE
67882012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6789
c990426a
PE
6790 Simplify, document, and port floating-point (Bug#12381).
6791 The porting part of this patch fixes bugs on non-IEEE platforms
6792 with frexp, ldexp, logb.
6793 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6794 Now static.
6795 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6796 support, by removing commented-out code and briefly listing the
6797 C89 functions excluded. The commented-out stuff was confusing
6798 maintenance, e.g., we thought we needed cbrt but it was commented out.
6799 (logb): Remove decl; no longer needed.
6800 (isfinite): New macro, if not already supplied.
6801 (isnan): Don't replace any existing macro.
6802 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6803 are present on all C89 platforms.
6804 (Ffrexp): Do not special-case zero, as frexp does the right thing
6805 for that case.
6806 (Flogb): Do not use logb, as it doesn't have the desired meaning
6807 on hosts that use non-base-2 floating point. Instead, stick with
6808 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6809 frexp, to avoid getting an unspecified result.
6810
6fda35f2
PE
6811 * xdisp.c (Qinhibit_debug_on_message): Now static.
6812
16130a58
JD
68132012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6814
6815 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6816 NSBezierPath (Bug#12131).
6817
d105a573
CY
68182012-09-10 Chong Yidong <cyd@gnu.org>
6819
6820 * fns.c (Fdelq, Fdelete): Doc fix.
6821
ff55dfe8
PE
68222012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6823
6824 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6825 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6826
e7032e7c
SM
68272012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6828
6829 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6830 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6831 Use it.
6832
e9957956
EZ
68332012-09-09 Eli Zaretskii <eliz@gnu.org>
6834
aba05ce9
EZ
6835 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6836 left fringe if the window has a left margin. This avoids leaving
6837 traces of the cursor because its leftmost pixel is not drawn over.
6838
e9957956
EZ
6839 * dispnew.c (update_window_line): When the left margin area of a
6840 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6841 that screen line. (Bug#12277)
6842
f6196b87
PE
68432012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6844
6845 Assume C89 or later for math functions (Bug#12381).
6846 This simplifies the code, and makes it a bit smaller and faster,
6847 and (most important) makes it easier to clean up signal handling
6848 since we can stop worring about floating-point exceptions in
6849 library code. That was a problem before C89, but the problem
6850 went away many years ago on all practical Emacs targets.
6851 * data.c, image.c, lread.c, print.c:
6852 Don't include <math.h>; no longer needed.
6853 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6854 might be autoconfigured, as that never happens.
6855 * data.c (fmod):
6856 * doprnt.c (DBL_MAX_10_EXP):
6857 * print.c (DBL_DIG):
6858 Remove. C89 or later always defines these.
6859 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6860 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6861 (arith_error, domain_error, domain_error2):
6862 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6863 no longer needed -- we simply return what C returns. All uses removed.
6864 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6865 the wrapped code.
6866 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6867 Remove. All uses expanded, as these macros are no longer used
6868 more than once and are now more trouble than they're worth.
6869 (Ftan): Use tan, not sin / cos.
6870 (Flogb): Assume C89 frexp.
6871 (fmod_float): Assume C89 fmod.
6872 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6873 (init_floatfns): Remove. All uses removed.
6874
9d7f1863
JD
68752012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6876
6877 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6878 compositeToPoint for OSX < 10.6 (Bug#12390).
6879
eabf0404
PE
68802012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6881
6882 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6883 This produces more-accurate results.
6884
0b3b1d23
JD
68852012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6886
6887 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6888 changes (Bug#12088).
6889
6dcef6ec
CY
68902012-09-08 Chong Yidong <cyd@gnu.org>
6891
6892 * syntax.c (Fstring_to_syntax): Doc fix.
6893
aa7d57c5
JD
68942012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6895
6896 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6897 in the internal border.
6898 (x_set_window_size): Remove static variables and their usage.
6899 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
6900 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6901 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
6902 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6903 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6904 (ns_fix_rect_ibw): Remove.
6905 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6906 (ns_dumpglyphs_box_or_relief): Ditto.
6907 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6908 adjustment.
6909 (ns_dumpglyphs_image): Ditto.
fc0c31f8 6910 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
6911 border adjustment.
6912 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6913 their usage. Add fringe_extended_p and its use as in other terms.
6914 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6915 scroll bar was removed.
6916 (updateFrameSize): New function.
6917 (windowDidResize): Move code to updateFrameSize and call it.
6918
6919 * nsterm.h (EmacsView): Add updateFrameSize.
6920
1a5432bc
CY
69212012-09-07 Chong Yidong <cyd@gnu.org>
6922
b4f5313e
CY
6923 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6924
1a5432bc
CY
6925 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6926
1a4f1e9b
PE
69272012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6928
6929 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
6930 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6931 Problem introduced when merging patches. Noted by Eli Zaretskii in
6932 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
6933 * floatfns.c: Comment fix.
6934 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6935 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6936 and anyway the declaration is harmless even if SIGDANGER is not defined.
6937 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6938 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6939 source files not surprisingly expected syssignal.h to define, or
6940 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6941 Include <sys/ioctl.h>, for FIONREAD.
6942 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6943 This eliminates a problem whereby other files mysteriously had
6944 to include "syssignal.h" before including "systty.h" if they
6945 wanted to use "#ifdef SIGIO".
6946
bc8000ff
EZ
69472012-09-07 Eli Zaretskii <eliz@gnu.org>
6948
3e6d6928
EZ
6949 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6950
6951 * w32.c (sigemptyset): Empty the set.
6952 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6953
bc8000ff
EZ
6954 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6955
b4fa72f2
DA
69562012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6957
6958 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6959 (mark_object): Likewise for frame objects.
6960
30730c93
PE
69612012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6962
6963 * syssignal.h (handle_on_main_thread): Always declare,
6964 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6965 This ports to platforms without HAVE_PTHREAD.
6966
2fe28299
PE
69672012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6968
6969 Signal-handler cleanup (Bug#12327).
6970 Emacs's signal handlers were written in the old 4.2BSD style with
6971 sigblock and sigmask and so forth, and this led to some
6972 inefficiencies and confusion. Rewrite these to use
6973 pthread_sigmask etc. without copying signal sets around. Also,
6974 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6975 'signal', and instead use functions that do not attempt to take
6976 over the system name space. This patch causes Emacs's text
6977 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6978 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6979 Do not include <signal.h> or "syssignal.h", as these
6980 modules do not use signals.
6981 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6982 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6983 Do not include <signal.h>, as "syssignal.h" does that for us now.
6984 * atimer.c (sigmask_atimers): New function.
6985 (block_atimers, unblock_atimers): New functions,
6986 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6987 All uses replaced.
6988 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6989 no longer needed here.
6990 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 6991 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
6992 * sysdep.c (struct save_signal): New member 'action', replacing
6993 old member 'handler'.
6994 (save_signal_handlers, restore_signal_handlers):
6995 Use sigaction instead of 'signal' to save and restore.
6996 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6997 New function. All users of 'signal' modified to use set_sighandler
6998 if they're writeonly, and to use sys_signal if they're read+write.
6999 (emacs_sigaction_init, forwarded_signal): New functions.
7000 (sys_signal): Remove. All uses replaced by calls to sigaction
7001 and emacs_sigaction_init, or by direct calls to 'signal'.
7002 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7003 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7004 all uses replaced by pthread_sigmask etc. calls.
7005 * syssignal.h: Include <signal.h>.
7006 (emacs_sigaction_init, forwarded_signal): New decls.
7007 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7008 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7009 (sigmask, sys_sigmask): Remove; no longer needed.
7010 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7011 (sigblock, sigunblock, sigfree):
7012 (sigsetmask) [!defined sigsetmask]:
7013 Remove. All uses replaced by pthread_sigmask.
7014 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7015 no longer need to be replaced, and its typical old uses
7016 are now done via emacs_sigaction_init and sigaction.
7017 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7018 (sys_sigdel): Remove; unused.
7019 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7020
0216c128
EZ
70212012-09-06 Eli Zaretskii <eliz@gnu.org>
7022
7023 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7024 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7025
c752cfa9
DA
70262012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7027
7028 Explicitly mark buffer_defaults and buffer_local_symbols.
7029 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7030 mark_local_symbols here.
7031 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7032 since special buffers aren't marked here any more.
7033 (allocate_buffer): Chain new buffer with all_buffers here...
7034 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7035 not here.
7036 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7037 (syms_of_buffer): Remove staticpro of the above.
7038 (init_buffer_once): Set names for buffer_defaults and
7039 buffer_local_symbols.
7040
a864ef14
PE
70412012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7042
7043 Use bool for booleans in font-related modules.
7044 * font.c (font_intern_prop, font_style_to_value)
7045 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7046 (generate_otf_features, font_check_otf_features, font_check_otf)
7047 (font_match_p, font_list_entities, font_at):
7048 * fontset.c (fontset_id_valid_p, reorder_font_vector
7049 (fontset_find_font, Fset_fontset_font)
7050 (face_suitable_for_char_p) [0]:
7051 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7052 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7053 (m17n_flt_initialized, ftfont_shape_by_flt):
7054 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7055 * nsfont.m (nsfont_draw):
7056 * w32font.c (w32font_draw):
7057 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7058 Use bool for booleans.
7059 * font.h: Adjust to above API changes.
7060 (struct font, struct font_driver, struct font_driver_list):
7061 Use bool for booleans.
7062 (struct font): Remove useless member encoding_type.
7063 All users removed.
7064 * fontset.c, xftfont.c: Omit unnecessary static decls.
7065
0699fc18
DA
70662012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7067
7068 * alloc.c (mark_object): Revert window marking code
7069 since it's unsafe for the Fset_window_configuration.
7070
20ef56db
PE
70712012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7072
2fe28299 7073 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
7074 Be more systematic about preserving errno whenever a signal
7075 handler returns, even if it's not in the main thread. Do this by
7076 renaming signal handlers to distinguish between signal delivery
7077 and signal handling. All uses changed.
7078 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7079 * data.c (deliver_arith_signal): Rename from arith_error.
7080 * dispnew.c (deliver_window_change_signal): Rename from
7081 window_change_signal.
7082 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7083 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7084 * keyboard.c (deliver_input_available_signal): Rename from
7085 input_available_signal.
7086 (deliver_user_signal): Rename from handle_user_signal.
7087 (deliver_interrupt_signal): Rename from interrupt_signal.
7088 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7089 (deliver_child_signal): Rename from sigchld_handler.
7090 * atimer.c (handle_alarm_signal):
7091 * data.c (handle_arith_signal):
7092 * dispnew.c (handle_window_change_signal):
7093 * emacs.c (handle_fatal_signal, handle_danger_signal):
7094 * keyboard.c (handle_input_available_signal):
7095 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7096 * process.c (handle_pipe_signal, handle_child_signal):
7097 New functions, with the actual signal-handling code taken from the
7098 original respective signal handlers, sans the sporadic attempts to
7099 preserve errno, since that's now done by handle_on_main_thread.
7100 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7101 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7102 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7103 Move to sysdep.c.
7104 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7105 Move initialization of main_thread to sysdep.c's init_signals.
7106 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7107 our usage, and simplifies the mainline code.
7108 (record_child_status_change): New static function, as a helper
7109 for handle_child_signal, and with most of the old child handler's
7110 contents.
7111 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7112 (handle_child_signal): Use the above.
7113 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7114 Moved here from emacs.c.
7115 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7116 code moved here from emacs.c's main function.
7117 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
7118 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7119 This lets callers save and restore errno properly.
20ef56db 7120
e3ccf108
DA
71212012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7122
7123 Remove redundant or unused things here and there.
7124 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7125 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7126 * editfns.c (Fcompare_buffer_substrings): Likewise.
7127 * frame.h (struct terminal, struct font_driver_list):
7128 Remove redundant declarations.
7129 * window.h (Qleft, Qright): Likewise.
7130
697e1e39
DA
71312012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7132
7133 Do not mark objects from deleted buffers, windows and frames.
7134 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7135 (mark_object): Likewise for windows and frames.
7136
c1ca42ca
DA
71372012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7138
7139 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7140 buffer_defaults and buffer_local_symbols as valid objects.
7141 Return special value to denote them.
7142
014d93be
PE
71432012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7144
f75d7a91
PE
7145 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7146 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7147 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7148 (file_name_absolute_p, Fsubstitute_in_file_name):
7149 (check_executable, check_writable, Ffile_accessible_directory_p)
7150 (Fset_file_selinux_context, Fdefault_file_modes)
7151 (Finsert_file_contents, choose_write_coding_system)
7152 (Fwrite_region, build_annotations, a_write, e_write)
7153 (Fdo_auto_save):
7154 * filelock.c (boot_time_initialized, get_boot_time)
7155 (get_boot_time_1, lock_file_1, within_one_second):
7156 * floatfns.c (in_float):
7157 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7158 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7159 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7160 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7161 * window.c (compare_window_configurations):
7162 Use bool for booleans.
7163 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7164 (Fdefault_file_modes): Now mode_t, not int, for modes.
7165 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7166 (internal_delete_file): Now returns void, not a (boolean) int,
7167 since nobody was looking at the return value.
7168 * lisp.h, window.h: Adjust to above API changes.
7169
014d93be
PE
7170 * xdisp.c (set_message): Simplify and reindent last change.
7171
776f29e1
JB
71722012-09-05 Juanma Barranquero <lekktu@gmail.com>
7173
7174 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7175
7f7e0167
LI
71762012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7177
7178 * eval.c (call_debugger): Make the function non-static so that we
7179 can call it from set_message.
7180
7181 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7182 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7183
cf29dd84
PE
71842012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7185
7186 Give more-useful info on a fatal error (Bug#12328).
7187 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7188 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7189 of doing the work ourselves.
7190 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7191 do most of the work.
7192 (fatal_error_backtrace): New function, taken from the guts
7193 of the old fatal_error_signal, but with a new option to output
7194 a backtrace.
7195 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7196 info about the signal than just its number.
7197 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7198 * sysdep.c: Include <execinfo.h>
7199 (emacs_backtrace): New function, taken partly from the previous
7200 code of the 'die' function.
7201 (emacs_abort): Call fatal_error_backtrace rather than abort.
7202
972debf2
SM
72032012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7204
7205 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7206 eager (load-time) macro-expansion.
7207 * lisp.mk (lisp): Add macroexp.
7208
1088b922
PE
72092012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7210
7211 Simplify redefinition of 'abort' (Bug#12316).
7212 Do not try to redefine the 'abort' function. Instead, redo
7213 the code so that it calls 'emacs_abort' rather than 'abort'.
7214 This removes the need for the NO_ABORT configure-time macro
7215 and makes it easier to change the abort code to do a backtrace.
7216 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7217 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7218 Remove; sysdep.c's emacs_abort now takes its place.
7219 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7220 'abort' changed to use 'emacs_abort'.
7221 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7222 (abort) [!defined abort]: Rename to ...
7223 (emacs_abort): ... new name.
7224 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7225 the place of the old 'abort' in emacs.c.
7226 * w32.c, w32fns.c (abort): Do not #undef.
7227 * w32.c (emacs_abort): Rename from w32_abort.
7228
30934d33
EZ
72292012-09-04 Eli Zaretskii <eliz@gnu.org>
7230
7231 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7232 offsets[j].dv, since the y axis of the screen coordinates points
7233 down, while the y axis of the font definition coordinates points
7234 up. This fixes display of Arabic diacritics such as KASRA and
7235 KASRATAN. (Bug#11860)
7236
af26b72c
PE
72372012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7238
7239 Be more systematic about _setjmp vs setjmp.
7240 * alloc.c (test_setjmp, mark_stack):
7241 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7242 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7243 (png_load, my_error_exit, jpeg_load):
7244 * process.c (send_process_trap, send_process):
7245 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7246 The underscored versions are up to 30x faster on some hosts.
7247 Formerly, the code used setjmp+longjmp sometimes and
7248 _setjmp+_longjmp at other times, with no particular reason to
7249 prefer setjmp+longjmp.
7250
26d4541d
PE
72512012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7252
d42f4f0f 7253 Fix minor problem found by static checking.
26d4541d 7254 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 7255
c5e28e39
MR
72562012-09-03 Martin Rudalics <rudalics@gmx.at>
7257
7258 * buffer.c (Fdelete_all_overlays): New function.
7259
3eab3ca9
CY
72602012-09-03 Chong Yidong <cyd@gnu.org>
7261
7262 * gtkutil.c: Add extern decl for Qxft.
7263
c04889f8
PE
72642012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7265
1882aa38
PE
7266 * emacs.c, eval.c: Use bool for boolean.
7267 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7268 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7269 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7270 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7271 (main, decode_env_path, Fdaemon_initialized):
7272 * eval.c (call_debugger, Finteractive_p, interactive_p):
7273 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7274 (maybe_call_debugger, Fbacktrace):
7275 * process.c (read_process_output, exec_sentinel):
7276 Use bool for booleans.
7277 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7278 All callers changed.
7279 * eval.c (interactive_p): Omit always-true boolean argument
7280 EXCLUDE_SUBRS_P. All callers changed.
7281 * dispextern.h, lisp.h: Reflect above API changes.
7282 * firstfile.c (dummy): Use the address of 'main', whose signature
7283 won't change, instead of the address of 'initialize', whose
7284 signature just changed from int to bool.
7285 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7286 * msdos.c (fatal_error_in_progress): ... from here.
7287 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7288 of incrementing it.
7289 (redisplay_internal, unwind_redisplay): Simply clear
7290 REDISPLAYING_P when unwinding, instead of saving its previous,
7291 always-false value and then restoring it.
7292
a411ac43
PE
7293 Clean up some extern decls.
7294 Mostly, this hoists extern decls out of .c files and into .h files.
7295 That way, we're more likely to catch errors if the interfaces change.
7296 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7297 declare xg_mark_data.
7298 * dispextern.h (x_frame_parm_handlers):
7299 * font.h (Qxft):
7300 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7301 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7302 (Qultra_bold, Qoblique, Qitalic):
7303 Move extern decl here from .c file.
7304 * alloc.c (xg_mark_data) [USE_GTK]:
7305 * doc.c (Qclosure):
7306 * eval.c (Qlexical_binding):
7307 * fns.c (time) [!HAVE_UNISTD_H]:
7308 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7309 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7310 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7311 * lread.c (Qinternal_interpreter_environment):
7312 * minibuf.c (Qbuffer):
7313 * process.c (QCfamily, QCfilter):
7314 * widget.c (free_frame_faces):
7315 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7316 * xfont.c (x_clear_errors):
7317 * xterm.c (x_frame_parm_handlers):
7318 Remove now-redundant extern decls.
7319 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7320 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7321 Now static.
7322 * xfaces.c: Remove unnecessary static decls.
7323 * xterm.c (updating_frame): Remove decl of nonexistent object.
7324
c04889f8
PE
7325 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7326 when building globals.h, as the objects that are not built on
7327 this host are not needed to compile C files on this host.
7328
8b339673
JD
73292012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7330
7331 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7332
7333 * frame.h: Add missing prototype for x_wm_set_size_hint.
7334
a08d4ba7
PE
73352012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7336
7337 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7338 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7339 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7340 (Fsubstitute_command_keys):
7341 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7342 (save_excursion_save, save_excursion_restore)
7343 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7344 (format_time_string, general_insert_function)
7345 (make_buffer_string, make_buffer_string_both)
7346 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7347 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7348 (copy_text, insert_1, insert_1_both, insert_from_string)
7349 (insert_from_string_before_markers, insert_from_string_1)
7350 (insert_from_buffer, insert_from_buffer_1, replace_range)
7351 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7352 (del_range_2, modify_region):
7353 * intervals.c (intervals_equal, balance_possible_root_interval)
7354 (adjust_intervals_for_insertion, merge_properties_sticky)
7355 (graft_intervals_into_buffer, lookup_char_property)
7356 (adjust_for_invis_intang, set_point_both)
7357 (get_property_and_range, compare_string_intervals)
7358 (set_intervals_multibyte_1, set_intervals_multibyte):
7359 * keyboard.c (decode_timer):
7360 Use bool for boolean.
7361 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7362 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7363
48c948de
CY
73642012-09-02 Chong Yidong <cyd@gnu.org>
7365
7366 * keymap.c (push_key_description): Print M-TAB as C-M-i
7367 (Bug#11758).
7368
6c49a40b
JB
73692012-09-02 Juanma Barranquero <lekktu@gmail.com>
7370
7371 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7372 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7373 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7374 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7375 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7376 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7377 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7378
4dfbd238
EZ
73792012-09-01 Eli Zaretskii <eliz@gnu.org>
7380
7e510e28
EZ
7381 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7382 more than one grapheme cluster passed to the shaper: compute the
7383 offset adjustment values separately for each cluster. (Bug#11860)
7384
4dfbd238
EZ
7385 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7386 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7387 about implicit conversions from integer to pointer.
7388
86571ae0
DC
73892012-09-01 Daniel Colascione <dancol@dancol.org>
7390
7391 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7392 system used too early.
7393
0e23ef9d
PE
73942012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 Better seed support for (random).
7397 * emacs.c (main): Call init_random.
7398 * fns.c (Frandom): Set the seed from a string argument, if given.
7399 Remove long-obsolete Gentzel cruft.
7400 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7401 (init_random): New function.
7402
17a2cbbd
DC
74032012-09-01 Daniel Colascione <dancol@dancol.org>
7404
7405 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7406 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7407 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7408 x_wm_set_size_hint, x_query_colors, x_real_positions,
7409 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7410 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7411 all of which have been moved to common code.
7412
7413 * xfaces.c: Include TERM_HEADER instead of listing all possible
7414 window-system headers.
7415
7416 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7417 to match header.
7418
7419 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7420 directly accessing frame internals.
7421
f18cbb28 7422 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
7423 globals_of_w32font.
7424
7425 * process.c: Include TERM_HEADER instead of listing all possible
7426 window-system headers.
7427
3a880af4
SM
7428 * nsterm.h: Remove declarations now in frame.h.
7429 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
7430
7431 * menu.c: Include TERM_HEADER instead of listing all possible
7432 window-system headers.
7433
7434 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7435 window system.
7436
7437 * keyboard.c: Include TERM_HEADER instead of listing all possible
7438 window-system headers.
7439
7440 * image.c: Include TERM_HEADER instead of listing all possible
7441 window-system headers. Declare Vlibrary_cache when compiling for
7442 Windows.
7443
7444 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7445 window system declarations.
7446
7447 * frame.h: Move common functions here: set_frame_menubar,
7448 x_set_window_size, x_sync, x_get_focus_frame,
7449 x_set_mouse_position, x_set_mouse_pixel_position,
7450 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7451 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7452 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7453 x_activate_menubar, x_real_positions, x_bitmap_icon,
7454 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7455 and x_query_colors.
7456
7457 * frame.c: Include TERM_HEADER instead of listing all possible
7458 window-system headers.
7459
7460 * font.c: Include TERM_HEADER instead of listing all possible
7461 window-system headers.
7462
7463 * emacs.c: Include TERM_HEADER.
7464
f18cbb28
EZ
7465 * dispnew.c: Include TERM_HEADER instead of listing all possible
7466 window-system headers.
17a2cbbd 7467
f18cbb28 7468 * ccl.h: Include character.h.
17a2cbbd
DC
7469
7470 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7471 the current window system; include in list of objects to link into
7472 Emacs.
7473
c650a5de
DA
74742012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7475
7476 Remove mark_ttys function and fix tty_display_info initialization.
7477 * lisp.h (mark_ttys): Remove prototype.
7478 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7479 to mark_ttys because all possible values of 'top_frame' slot are
7480 the frames which are reachable from Vframe_list.
7481 * term.c (mark_ttys): Remove.
7482 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7483
4e0f6479
DA
74842012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7485
7486 Change struct frame bitfields from unsigned char to unsigned.
7487 * frame.h (struct frame): Change type of 'display_preempted',
7488 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7489 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7490 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7491 bitfields from unsigned char to unsigned.
7492
8b96a52c
DA
74932012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7494
7495 Remove unused member of struct x_output and struct w32_output.
7496 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7497 * w32term.h (struct w32_output): Likewise.
7498
b4444c8a
JD
74992012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7500
7501 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7502 does not become zero (Bug#12234).
7503
b98521db
PE
75042012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7505
7506 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7507 for GCC 4.7.1 x86-64.
7508
31d02438
GM
75092012-08-30 Glenn Morris <rgm@gnu.org>
7510
7511 * lread.c (init_lread): For out-of-tree builds, only add the
7512 source directory's site-lisp dir to the load-path if it exists,
7513 consistent with in-tree builds. (Bug#12302)
7514
7f8941d8
JD
75152012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7516
7517 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 7518 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
7519 (windowShouldClose:): Set window_closed.
7520 (dealloc): New member, free button_values.
fc0c31f8
JB
7521 (process_dialog:): Make member function. Remove window argument,
7522 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
7523 in button_values.
7524 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 7525 with tag. Remove return self, declare return value as void.
7f8941d8
JD
7526 (addString:row:): Remove return self, declare return value as void.
7527 (addSplit): Remove return self, declare return value as void.
7528 (clicked:): Remove return self, declare return value as void.
fc0c31f8 7529 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
7530 (initFromContents:isQuestion:): Adjust call to process_dialog.
7531 Code formatting change.
7532 (timeout_handler:): Set timer_fired to YES.
7533 (runDialogAt:): Set timer_fired to NO.
7534 Handle click on close button as quit.
7535
7536 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7537 Add window_closed and button_values. Add void as return value for
7538 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7539 Add process_dialog as new member.
7540
eada0861 75412012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 7542
eada0861
GM
7543 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7544 is not one of the heaps we manage. (Bug#12242)
7545
75462012-08-28 Glenn Morris <rgm@gnu.org>
7547
7548 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7549
457294dd
MR
75502012-08-28 Martin Rudalics <rudalics@gmx.at>
7551
7552 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
7553 auto-buffer-name window parameter. Install revision of reverted
7554 fix.
457294dd 7555
4f2daf31
DA
75562012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7557
7558 Do not allow to set major mode for a dead buffer.
7559 * buffer.c (Fset_buffer_major_mode): Signal an error
7560 if the buffer is dead.
7561 (Fother_buffer, other_buffer_safely): Remove redundant
7562 nested declaration.
7563
66322887
DA
75642012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7565
7566 Always use set_buffer_if_live to restore original buffer at unwind.
7567 * buffer.h (record_unwind_current_buffer): New function.
7568 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7569 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7570 * undo.c, window.c: Adjust users.
7571 * buffer.c (set_buffer_if_live): Fix comment.
7572
a3d794a1
DA
75732012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7574
7575 Fix usage of set_buffer_internal.
7576 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7577 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7578 * coding.c (decode_coding): Omit redundant test.
7579 * fileio.c (decide_coding_unwind): Likewise.
7580 * fns.c (secure_hash): Likewise.
7581 * insdel.c (modify_region): Likewise.
7582 * keyboard.c (command_loop_1): Likewise.
7583 * print.c (PRINTFINISH): Likewise.
7584 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7585
59ea14cd
PE
75862012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7587
7588 * dispnew.c: Use bool for boolean.
7589 (frame_garbaged, display_completed, delayed_size_change)
7590 (fonts_changed_p, add_window_display_history)
7591 (add_frame_display_history, verify_row_hash)
7592 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7593 (row_equal_p, realloc_glyph_pool)
7594 (allocate_matrices_for_frame_redisplay)
7595 (showing_window_margins_p)
7596 (adjust_frame_glyphs_for_frame_redisplay)
7597 (build_frame_matrix_from_leaf_window, make_current)
7598 (mirrored_line_dance, mirror_line_dance, update_frame)
7599 (update_window_tree, update_single_window)
7600 (check_current_matrix_flags, update_window, update_text_area)
7601 (update_window_line, set_window_update_flags, scrolling_window)
7602 (update_frame_1, scrolling, buffer_posn_from_coords)
7603 (do_pending_window_change, change_frame_size)
7604 (change_frame_size_1, sit_for):
7605 Use bool for boolean.
7606 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7607 and remove last int (actually boolean) argument, which was always 0.
7608 All callers changed.
7609 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7610 * dispextern.h (struct composition_it): Use bool for boolean.
7611 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7612 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7613 * dired.c (file_name_completion):
7614 Use bool for boolean. (This was missed in an earlier change.)
7615
95072a94
MR
76162012-08-27 Martin Rudalics <rudalics@gmx.at>
7617
7618 * window.c (Fset_window_configuration): Revert first part of
7619 last change.
7620
0f19feff
JD
76212012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7622
7623 * nsterm.h (NSPanel): New class variable dialog_return.
7624
3a880af4
SM
7625 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7626 Initialize dialog_return.
0f19feff
JD
7627 (windowShouldClose:): Use stop instead of stopModalWithCode.
7628 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7629 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7630 event.
7631 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7632 modal loop returns.
7633
f10fe38f
PE
76342012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7635
de1339b0
PE
7636 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7637 * composite.c (find_composition, composition_gstring_p)
7638 (composition_reseat_it, find_automatic_composition):
7639 * data.c (let_shadows_buffer_binding_p)
7640 (let_shadows_global_binding_p, set_internal, make_blv)
7641 (Fmake_variable_buffer_local, Fmake_local_variable)
7642 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7643 (cons_to_signed, arith_driver):
7644 * dbusbind.c (xd_in_read_queued_messages):
7645 * dired.c (directory_files_internal, file_name_completion):
7646 Use bool for booleans.
7647 * dired.c (file_name_completion):
7648 * process.h (fd_callback):
7649 Omit int (actually boolean) argument. It wasn't being used.
7650 All uses changed.
7651 * composite.h, lisp.h: Reflect above API changes.
7652
f10fe38f
PE
7653 * cmds.c, coding.c: Use bool for booleans.
7654 * cmds.c (move_point, Fself_insert_command):
7655 * coding.h (struct composition status, struct coding_system):
7656 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7657 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7658 (emacs_mule_char, decode_coding_emacs_mule)
7659 (encode_coding_emacs_mule, detect_coding_iso_2022)
7660 (decode_coding_iso_2022, encode_invocation_designation)
7661 (encode_designation_at_bol, encode_coding_iso_2022)
7662 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7663 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7664 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7665 (encode_coding_raw_text, detect_coding_charset)
7666 (decode_coding_charset, encode_coding_charset, detect_eol)
7667 (detect_coding, get_translation_table, produce_chars)
7668 (consume_chars, reused_workbuf_in_use)
7669 (make_conversion_work_buffer, code_conversion_save)
7670 (decode_coding_object, encode_coding_object)
7671 (detect_coding_system, char_encodable_p)
7672 (Funencodable_char_position, code_convert_region)
7673 (code_convert_string, code_convert_string_norecord)
7674 (Fset_coding_system_priority):
7675 * fileio.c (Finsert_file_contents):
7676 Use bool for booleans.
7677 * coding.h, lisp.h: Reflect above API changes.
7678 * coding.c: Remove unnecessary static function decls.
7679 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7680 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7681 not a boolean 'int', since callers never look at the return value.
7682 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7683 * coding.h (decoding_buffer_size, encoding_buffer_size)
7684 (emacs_mule_string_char): Remove unused extern decls.
7685 (struct iso_2022_spec, struct coding_system):
7686 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7687 (struct emacs_mule_spec): Remove unused field 'full_support'.
7688 All initializations removed.
7689 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7690
5474c384
DA
76912012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7692
f10fe38f 7693 Fix spare memory change (Bug#12286).
5474c384
DA
7694 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7695 (valid_lisp_object_p): Likewise.
7696
c4b6914d
MR
76972012-08-27 Martin Rudalics <rudalics@gmx.at>
7698
7699 * window.c (Fset_window_configuration): Record any window's old
7700 buffer if it's replaced (see Bug#8789). If the new current
7701 buffer doesn't appear in the selected window, go to its old
7702 point (Bug#12208).
7703
35aaa1ea
DA
77042012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7705
7706 Special MEM_TYPE_SPARE to denote reserved memory.
7707 * alloc.c (enum mem_type): New memory type.
7708 (refill_memory_reserve): Use new type for spare memory.
7709 This prevents live_cons_p and live_string_p from incorrect
7710 detection of uninitialized objects from spare memory as live.
7711
6af64513
PE
77122012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7713
8b2e00a3
PE
7714 Spelling fixes.
7715 * Makefile.in (.PHONY): versioclean -> versionclean.
7716
b52d6985
PE
7717 Remove unused external symbols.
7718 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7719 * window.c (Qwindow_valid_p, decode_valid_window):
7720 Now static, not extern.
7721 * data.c (Qinterval): Remove; unused.
7722 (syms_of_data): Do not define 'interval'.
7723 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7724 * window.h (decode_valid_window):
7725 Remove decls.
7726
d5172d4f
PE
7727 * character.c, charset.c, chartab.c: Use bool for booleans.
7728 * character.c (lisp_string_width, string_count_byte8)
7729 (string_escape_byte8):
7730 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7731 (load_charset_map_from_file, map_charset_chars)
7732 (Fdefine_charset_internal, define_charset_internal)
7733 (Fdeclare_equiv_charset, find_charsets_in_text)
7734 (Ffind_charset_region, char_charset, Fiso_charset):
7735 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7736 (sub_char_table_set, sub_char_table_set_range)
7737 (char_table_set_range, optimize_sub_char_table)
7738 (map_sub_char_table):
7739 Use bool for boolean.
7740 * character.c (str_to_unibyte): Omit last boolean argument; it was
7741 always 0. All callers changed.
7742 * character.h, charset.h: Adjust to match previous changes.
7743 * character.h (char_printable_p): Remove decl of nonexistent function.
7744 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7745 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7746 are all boolean, so make them single-bit bitfields.
7747
6af64513
PE
7748 * lisp.h (ASET): Remove attempt to detect side effects.
7749 It was meant to be temporary and it often doesn't work,
7750 because when IDX has side effects the behavior of IDX==IDX
7751 is undefined. See Stefan Monnier in
7752 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7753
e1f29348
BR
77542012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7755
7756 * lisp.h (functionp): New function (extracted from Ffunctionp).
7757 (FUNCTIONP): Use it.
7758 * eval.c (Ffunctionp): Use it.
7759
17c05d74
PE
77602012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7761
0f46bc75
PE
7762 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7763 as that's faster and simpler than static storage. Don't bother
7764 with the g_main_context_query overhead if g_main_context_pending
7765 says no events are pending.
7766 (gfds, gfds_size): Remove these static vars.
7767 (xgselect_initialize): Remove; no longer needed.
7768 All uses and decls removed.
7769
ee4c0f69
PE
7770 * emacs.c (fatal_error_signal_hook): Remove.
7771 All uses removed. This leftover from old code was always 0.
7772
17c05d74
PE
7773 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7774 * casefiddle.c (casify_object, casify_region):
7775 * casetab.c (set_case_table):
7776 * category.c, category.h (word_boundary_p):
7777 * category.h (CHAR_HAS_CATEGORY):
7778 Use bool for booleans, instead of int.
7779
391ceac5
EZ
77802012-08-25 Eli Zaretskii <eliz@gnu.org>
7781
7782 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7783
2f221583
PE
77842012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7785
f4a681b0
PE
7786 On assertion failure, print backtrace if available.
7787 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7788 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7789 * Makefile.in (LIB_EXECINFO): New macro.
7790 (LIBES): Use it.
7791
2f221583
PE
7792 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7793 * bytecode.c (exec_byte_code):
7794 * callint.c (check_mark, Fcall_interactively):
7795 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7796 (getenv_internal, sync_process_alive, call_process_exited):
7797 * lisp.h (USE_SAFE_ALLOCA):
7798 Use bool for booleans, instead of int.
7799 * lisp.h, process.h: Adjust prototypes to match above changes.
7800 * callint.c (Fcall_interactively): Don't assume the mark's
7801 offset fits in 'int'.
7802
37ef52bb
PE
78032012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7804
7805 * buffer.c, buffer.h: Use bool for boolean.
7806 * buffer.c (reset_buffer_local_variables)
7807 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7808 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7809 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7810 (overlay_touches_p, overlay_strings, Foverlay_put)
7811 (report_overlay_modification, call_overlay_mod_hooks):
7812 (mmap_enlarge, mmap_set_vars):
7813 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7814 Use bool for booleans, instead of int.
7815 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7816 since the 1-or-0 return value is always ignored anyway.
7817 (mmap_initialized_p):
7818 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7819 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7820
2cc21167
PE
78212012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7822
7823 * bidi.c: Use bool for boolean.
7824 This is a bit more readable, and makes the text segment of bidi.o
7825 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7826 Presumably it's faster too.
7827 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7828 Now bool.
7829 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7830 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7831 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7832 (bidi_explicit_dir_char, bidi_level_of_next_char)
7833 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7834 Use bool for booleans, instead of int.
7835 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7836 (bidi_unshelve_cache): Adjust decls to match code.
7837
7db4ddf4
MR
78382012-08-23 Martin Rudalics <rudalics@gmx.at>
7839
7840 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7841 argument.
7842
b1bb8011
PE
78432012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7844
7845 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7846 * atimer.h: Include <stdbool.h>.
7847
ff687885
DN
78482012-08-22 Dan Nicolaescu <dann@gnu.org>
7849
7850 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7851 compile time tests instead of run time tests on systems that do
7852 not use them.
7853 (FRAME_MAC_P): Remove leftover from deleted code.
7854 * frame.c (syms_of_frame): Remove leftover from deleted code.
7855
4ce7a138
JD
78562012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7857
7858 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7859
d733ec6d
PE
78602012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7861
7862 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7863 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 7864 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
7865 (fontset_add): Return void, for FONTSET_ADD.
7866
d0d2d26f
PE
78672012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7868
fce31d69
PE
7869 * alloc.c: Use bool for booleans.
7870 (gc_in_progress, abort_on_gc)
7871 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7872 (dont_register_blocks) [GC_MALLOC_CHECK]:
7873 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7874 (check_string_bytes, make_specified_string, memory_full)
7875 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7876 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7877 (mark_stack, valid_pointer_p, make_pure_string)
7878 (Fgarbage_collect, survives_gc_p, gc_sweep):
7879 Use bool for booleans, instead of int.
7880 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7881 Remove unused local.
7882 * alloc.c (PURE_POINTER_P):
7883 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7884 * editfns.c (Fformat):
7885 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7886 (Fdo_auto_save):
7887 * fns.c (sweep_weak_table):
7888 * lisp.h (suppress_checking, push_message, survives_gc_p)
7889 (make_pure_string, gc_in_progress, abort_on_gc):
7890 * lread.c (readchar, read1):
7891 * print.c (Fprin1_to_string):
7892 * xdisp.c (push_message):
7893 Use bool for booleans affected directly or indirectly by
7894 alloc.c's changes.
7895
d0d2d26f
PE
7896 Make recently-introduced setters macros.
7897 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7898 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7899 (set_fontset_default, set_fontset_fallback): Rename from their
7900 upper-case counterparts, and make them functions rather than macros.
7901 This is more consistent with the other recently-introduced setters.
7902 These don't need to be inline, since they're local.
7903
d18e2bb6
JD
79042012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7905
7906 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7907 the loop (Bug#12247).
7908
1b9d9d16
PE
79092012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7910
7911 * lisp.h (vcopy): Use memcpy rather than our own loop.
7912 This fixes a performance regression introduced by the recent
7913 addition of vcopy. This means 'vcopy' will need to be modified
7914 for a copying collector, but that's OK. Also, tighten the
7915 checking in the assertion.
7916
b2f09701
EZ
79172012-08-21 Eli Zaretskii <eliz@gnu.org>
7918
7919 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7920 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7921 non-base glyph for the width of the base character, according to
e1f29348
BR
7922 what x_draw_composite_glyph_string_foreground expects.
7923 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
7924 expectations, to produce correct width of the composed character.
7925 Reverse the sign of the DU offset produced by ScriptPlace.
7926
9b994fed
PE
79272012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7928
7929 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7930
086ca913
DA
79312012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7932
7933 Avoid direct writes to contents member of struct Lisp_Vector.
7934 * lisp.h (vcopy): New function to copy data into vector.
7935 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7936 * fns.c (Ffillarray): Use ASET.
7937 * keyboard.c (timer_check_2): Use AREF and ASET.
7938 (append_tool_bar_item, Frecent_keys): Use vcopy.
7939 * lread.c (read_vector): Use ASET.
7940 * msdos.c (Frecent_doskeys): Use vcopy.
7941 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7942 (Finternal_merge_in_global_face): Use ASET and vcopy.
7943 * xfont.c (xfont_list_pattern): Likewise.
7944
5481664a
MR
79452012-08-21 Martin Rudalics <rudalics@gmx.at>
7946
7947 * window.c (Fwindow_point): For the selected window always return
7948 the position of its buffer's point.
7949 (Fset_window_point): For the selected window always go in its
7950 buffer to the specified position.
7951
6d470bdd
DA
79522012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7953
7954 Setter macros for fontsets.
7955 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7956 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7957 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7958 Adjust users.
7959
24564fe1
GM
79602012-08-20 Glenn Morris <rgm@gnu.org>
7961
7962 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7963 Don't assume that `ln -f' works.
7964
0a05a035
EZ
79652012-08-20 Eli Zaretskii <eliz@gnu.org>
7966
7967 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7968 and later about non-assignments with no effect. See discussion at
7969 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7970 details.
7971
e46f2325
DA
79722012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7973
7974 Inline setter functions for Lisp_Objects slots of struct specbinding.
7975 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7976 Adjust users.
7977
734fbd86
MR
79782012-08-20 Martin Rudalics <rudalics@gmx.at>
7979
7980 * window.c (select_window): Always make selected window's buffer
7981 current.
7982
f1a95992
DA
79832012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7984
7985 Use AREF and ASET for docstrings of category tables.
7986 * category.h (CATEGORY_DOCSTRING): Use AREF.
7987 (SET_CATEGORY_DOCSTRING): Use ASET.
7988 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7989
e83064be
DA
79902012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7991
7992 Inline setter functions for hash table members.
7993 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7994 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7995 (set_hash_key_and_value, set_hash_index, set_hash_next)
7996 (set_hash_hash): New functions.
7997 * charset.c, fns.c: Adjust users.
7998
4ce60d2e
DA
79992012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8000
8001 Inline getter and setter functions for per-buffer values.
8002 * buffer.h (per_buffer_default, set_per_buffer_default)
8003 (per_buffer_value, set_per_buffer_value): New functions.
8004 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8005 * buffer.c, data.c: Adjust users.
8006
c06c9690
JB
80072012-08-20 Juanma Barranquero <lekktu@gmail.com>
8008
8009 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8010
32bd4250
PE
80112012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8012
bad03192 8013 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
8014 as gnulib does this if the system doesn't.
8015 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
8016 Remove declaration. MS-Windows declares it on stdlib.h which is
8017 included by conf_post.h.
b69a6d22
PE
8018 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8019 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8020 * vm-limit.c: Include <unistd.h>, for 'environ'.
8021
22d7feb2
PE
8022 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8023 (start_of_data): Remove decl; mem-limits.h provides it.
8024
32bd4250
PE
8025 * xdisp.c (handle_invisible_prop): Make it a bit faster
8026 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8027
450809af
CY
80282012-08-19 Chong Yidong <cyd@gnu.org>
8029
8030 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8031 ends (Bug#3874).
8032
9e677988
AS
80332012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8034
6b1319ce
AS
8035 * .gdbinit: Use call instead of set when calling a function in the
8036 inferior.
8037
9e677988
AS
8038 * data.c (set_internal): Don't use set_blv_found.
8039 (Fkill_local_variable): Likewise.
8040
d7191076
AA
80412012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8042
8043 * nsfont.m (ns_ascii_average_width): Ensure the string
8044 ascii_printable is initialized with a null-terminated character
8045 array. Otherwise, it can contain undesired extra characters.
8046
e757f1c6
PE
80472012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8048
8049 port new setting code to Sun C 5.8 2005/10/13
8050 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8051 Return void, not Lisp_Object. Otherwise, the compiler
8052 complains about (A?B:C) where B is void and C is Lisp_Object
8053 when compiling CHAR_TABLE_SET, due to the recent change to
8054 the API of sub_char_table_set_contents.
8055
a999ce26
CY
80562012-08-18 Chong Yidong <cyd@gnu.org>
8057
8058 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8059 for the string case (Bug#3874).
8060
3f22b86f
PE
80612012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8062
39eb03f1
PE
8063 * buffer.h (BSET): Remove (Bug#12215).
8064 Replace all uses with calls to new setter functions.
8065 (bset_bidi_paragraph_direction, bset_case_canon_table)
8066 (bset_case_eqv_table, bset_directory, bset_display_count)
8067 (bset_display_time, bset_downcase_table)
8068 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8069 (bset_last_selected_window, bset_local_var_alist)
8070 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8071 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8072 (bset_width_table):
8073 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8074 (bset_auto_fill_function, bset_auto_save_file_format)
8075 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8076 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8077 (bset_cache_long_line_scans, bset_case_fold_search)
8078 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8079 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8080 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8081 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8082 (bset_header_line_format, bset_indicate_buffer_boundaries)
8083 (bset_indicate_empty_lines, bset_invisibility_spec)
8084 (bset_left_fringe_width, bset_major_mode, bset_mark)
8085 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8086 (bset_name, bset_overwrite_mode, bset_pt_marker)
8087 (bset_right_fringe_width, bset_save_length)
8088 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8089 (bset_scroll_up_aggressively, bset_selective_display)
8090 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8091 (bset_word_wrap, bset_zv_marker):
8092 * category.c (bset_category_table):
8093 * syntax.c (bset_syntax_table):
8094 New setter functions.
8095
6a09a33b
PE
8096 * process.h (PSET): Remove (Bug#12215).
8097 Replace all uses with calls to new setter functions.
8098 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8099 (PROCESS_INLINE): New macro.
8100 (pset_childp): New setter function.
8101 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8102 * process.c (PROCESS_INLINE):
8103 Define to EXTERN_INLINE, so that the corresponding functions
8104 are compiled into code.
8105 (pset_buffer, pset_command, pset_decode_coding_system)
8106 (pset_decoding_buf, pset_encode_coding_system)
8107 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8108 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8109 (pset_type, pset_write_queue): New setter functions.
8110
e8c17b81
PE
8111 * window.h (WSET): Remove (Bug#12215).
8112 Replace all uses with calls to new setter functions.
8113 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8114 (WINDOW_INLINE): New macro.
8115 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8116 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8117 (wset_total_lines, wset_vertical_scroll_bar)
8118 (wset_window_end_pos, wset_window_end_valid)
8119 (wset_window_end_vpos): New setter functions.
8120 * window.c (WINDOW_INLINE):
8121 Define to EXTERN_INLINE, so that the corresponding functions
8122 are compiled into code.
8123 (wset_combination_limit, wset_dedicated, wset_display_table)
8124 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8125 (wset_new_normal, wset_new_total, wset_next_buffers)
8126 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8127 (wset_prev_buffers, wset_right_fringe_width)
8128 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8129 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8130 (wset_window_parameters):
8131 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8132 (wset_column_number_displayed, wset_region_showing):
8133 New setter functions.
8134
3f22b86f
PE
8135 * termhooks.h (TSET): Remove (Bug#12215).
8136 Replace all uses with calls to new setter functions.
8137 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8138 (TERMHOOKS_INLINE): New macro.
8139 (tset_charset_list, tset_selection_alist): New setter functions.
8140 * terminal.c (TERMHOOKS_INLINE):
8141 Define to EXTERN_INLINE, so that the corresponding functions
8142 are compiled into code.
8143 (tset_param_alist): New setter function.
8144
742af32f
PE
81452012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8146
15dbb4d6
PE
8147 * keyboard.h (KSET): Remove (Bug#12215).
8148 Replace all uses with calls to new setter functions.
8149 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8150 (KEYBOARD_INLINE): New macro.
8151 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8152 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8153 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8154 New setter functions.
8155 * keyboard.c (KEYBOARD_INLINE):
8156 Define to EXTERN_INLINE, so that the corresponding functions
8157 are compiled into code.
8158 (kset_echo_string, kset_kbd_queue)
8159 (kset_keyboard_translate_table, kset_last_prefix_arg)
8160 (kset_last_repeatable_command, kset_local_function_key_map)
8161 (kset_overriding_terminal_local_map, kset_real_last_command)
8162 (kset_system_key_syms): New setter functions.
8163
f00af5b1
PE
8164 * frame.h (FSET): Remove (Bug#12215).
8165 Replace all uses with calls to new setter functions.
8166 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8167 (FRAME_INLINE): New macro.
8168 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8169 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8170 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8171 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8172 (fset_param_alist, fset_root_window, fset_scroll_bars)
8173 (fset_selected_window, fset_title, fset_tool_bar_items)
8174 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8175 * frame.c (FRAME_INLINE):
8176 Define to EXTERN_INLINE, so that the corresponding functions
8177 are compiled into code.
8178 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8179
0c94c8d6
PE
8180 A few more naming-convention fixes for getters and setters.
8181 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8182 and rename from buffer_overlays_set_before.
8183 (set_buffer_overlays_after): Move here from buffer.h, and rename
8184 from buffer_overlays_set_after.
8185 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8186 All uses changed.
8187 (set_buffer_intervals): Rename from buffer_set_intervals.
8188 * intervals.c (set_interval_object): Move here from intervals.h,
8189 and rename from interval_set_object.
8190 (set_interval_left): Move here from intervals.h, and rename from
8191 interval_set_left.
8192 (set_interval_right): Move here from intervals.h, and rename from
8193 interval_set_right.
8194 (copy_interval_parent): Move here from intervals.h, and rename from
8195 interval_copy_parent.
8196 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8197 (set_interval_plist): Rename from interval_set_plist.
8198 Return void, not Lisp_Object, since no caller uses the result.
8199 * lisp.h (string_intervals): Rename from string_get_intervals.
8200 (set_string_intervals): Rename from string_set_intervals.
8201
34dabdb7
PE
8202 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8203 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 8204 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
8205 All uses changed. See the end of
8206 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8207
742af32f
PE
8208 * lisp.h (CSET): Remove (Bug#12215).
8209 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8210 (set_char_table_purpose): New functions,
8211 replacing CSET. All uses changed. For example, replace
8212 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 8213 "set_char_table_parent (char_table, parent);".
742af32f
PE
8214 The old version was confusing because it used the same name
8215 'parent' for two different things.
8216
a04e2c62
DA
82172012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8218
8219 Functions to get and set Lisp_Object fields of buffer-local variables.
8220 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8221 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8222 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8223 * data.c, eval.c, frame.c: Adjust users.
8224
383dcbf9
CY
82252012-08-17 Chong Yidong <cyd@gnu.org>
8226
8227 * xfaces.c (merge_face_vectors): If the target font specfies a
8228 font spec, make the font's attributes take precedence over
8229 directly-specified attributes.
8230 (merge_face_ref): Recognize :font.
8231
44386687
DA
82322012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8233
8234 Do not use memcpy for copying intervals.
8235 * intervals.c (reproduce_interval): New function.
8236 (reproduce_tree, reproduce_tree_obj): Use it.
8237 (reproduce_tree_obj): Remove prototype.
8238
927c7216
PE
82392012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8240
8241 * lisp.h (duration_to_sec_usec): Remove unused decl.
8242
93044f7b
AA
82432012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8244
8245 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8246 to an allocated instance of NSString, not to the class itself.
8247
9851e4a5
JB
82482012-08-17 Juanma Barranquero <lekktu@gmail.com>
8249
8250 * makefile.w32-in (C_CTYPE_H): New macro.
8251 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8252 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8253 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8254
620f13b0
PE
82552012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8256
8257 Use ASCII tests for character types.
8258 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8259 * xfns.c, xterm.c:
8260 Don't include <ctype.h>; was not needed.
8261 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8262 * sysdep.c, xfaces.c:
8263 Include <c-ctype.h> instead of <ctype.h>.
8264 * nsterm.m: Include <c-ctype.h>.
8265 * charset.c (read_hex):
8266 * doc.c (Fsnarf_documentation):
8267 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8268 (DRIVE_LETTER) [DOS_NT]:
8269 (Ffile_name_directory, Fexpand_file_name)
8270 (Fsubstitute_in_file_name):
8271 * font.c (font_parse_xlfd, font_parse_fcname):
8272 * frame.c (x_set_font_backend):
8273 * gtkutil.c (xg_get_font):
8274 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8275 * nsimage.m (hexchar):
8276 * nsterm.m (ns_xlfd_to_fontname):
8277 * sysdep.c (system_process_attributes):
8278 * xfaces.c (hash_string_case_insensitive):
8279 Use C-locale tests instead of locale-specific tests for character
8280 types, since we want the ASCII interpretation here, not the
8281 interpretation suitable for whatever happens to be the current locale.
8282
52162052
MR
82832012-08-16 Martin Rudalics <rudalics@gmx.at>
8284
8285 Consistently check windows for validity/liveness
8286 (Bug#11984, Bug#12025, Bug#12026).
8287 * lisp.h (CHECK_VALID_WINDOW): New macro.
8288 * window.c (decode_window): Rename to decode_live_window.
8289 (decode_valid_window, Fwindow_valid_p): New functions.
8290 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8291 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8292 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8293 (Fwindow_prev_sibling, Fwindow_combination_limit)
8294 (Fset_window_combination_limit, Fwindow_use_time)
8295 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8296 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8297 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8298 (Fwindow_hscroll, Fset_window_hscroll)
8299 (Fwindow_redisplay_end_trigger)
8300 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8301 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8302 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8303 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8304 (Fwindow_end, Fset_window_point, Fset_window_start)
8305 (Fpos_visible_in_window_p, Fwindow_line_height)
8306 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8307 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8308 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8309 (Fset_window_parameter, Fwindow_display_table)
8310 (Fset_window_display_table, Fdelete_other_windows_internal)
8311 (Fset_window_buffer, Fset_window_new_total)
8312 (Fset_window_new_normal, Fdelete_window_internal)
8313 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8314 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8315 (Fwindow_scroll_bars): Check whether argument window is a valid or
8316 live window. Update doc-strings.
8317 (syms_of_window): New symbol Qwindow_valid_p.
8318 * keyboard.c (Fposn_at_x_y): Check whether argument
8319 frame_or_window denotes a valid window.
8320
2751c80f
DA
83212012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8322
8323 Fix previous char table change.
8324 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8325 * chartab.c (optimize_sub_char_table): Likewise.
8326
032a42c8
CY
83272012-08-16 Chong Yidong <cyd@gnu.org>
8328
a2d19368
CY
8329 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8330
032a42c8
CY
8331 * xfont.c (xfont_open):
8332 * xftfont.c (xftfont_open): Set the font's max_width field.
8333
8334 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8335 min_width to space_width and average_width to the average over
8336 printable ASCII characters.
8337 (ns_char_width): Code cleanup.
8338 (ns_ascii_average_width): New utility function.
8339
8340 * font.h (struct font): Update comments.
8341
a098c930
DA
83422012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8343
032a42c8 8344 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
8345 * lisp.h (CSET): New macro.
8346 (char_table_set_extras, char_table_set_contents)
8347 (sub_char_table_set_contents): New function.
8348 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8349 * syntax.c: Adjust users.
8350
8be3a09c
SM
83512012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8352
8353 * eval.c (eval_sub): Bind lexical-binding.
8354 * lread.c (Qlexical_binding): Make non-static.
8355
ac4845a6
JD
83562012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8357
ddee6515
JD
8358 * nsmenu.m (popupSession): Remove.
8359 (pop_down_menu): Remove endModalSession.
8360 (timeout_handler:): New method.
8361 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8362 Call runModalForWindow. Check timer_fired when it returns.
8363 If not set, cancel timer and break out of loop.
8364 Otherwise loop again, with a new timeout.
8365
8366 * nsterm.m: Include fcntl.h if present.
8367 (fd_entry, t_readfds, inNsSelect): Remove.
8368 (select_writefds, select_valid, select_timeout, selfds)
8369 (select_mutex, apploopnr): Add.
8370 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8371 Otherwise call kbd_buffer_store_event.
8372 (ns_send_appdefined): Remove release of fd_entry.
8373 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8374 Increment and decrement apploopnr.
8375 (ns_select): If no file descriptors, just do a NSTimer.
8376 Otherwise copy read/write masks and start select thread (fd_handler).
8377 Start main loop and wait for application defined event.
8378 Inform select thread to stop selecting after main loop is exited.
8379 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 8380 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
8381 (fd_handler:): Loop forever, wait for info from the main thread
8382 to either start or stop selecting. When select returns, send
8383 and appdefined event.
8384 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8385 If not call kbd_buffer_store_event.
8386
8387 * nsterm.h (EmacsApp): fd_handler takes id argument.
8388 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8389
ac4845a6
JD
8390 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8391
eb424fe3
EZ
83922012-08-15 Eli Zaretskii <eliz@gnu.org>
8393
8394 * region-cache.c (move_cache_gap): Update gap_len using the actual
8395 growth of the boundaries array. Do not change cache_len.
8396 (Bug#12196)
8397
4e6a86c6
DA
83982012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8399
8400 Generalize and cleanup font subsystem checks.
8401 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
8402 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8403 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 8404
5bf192ca
DA
84052012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8406
8407 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8408
f2045622
CY
84092012-08-15 Chong Yidong <cyd@gnu.org>
8410
8be3a09c
SM
8411 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8412 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8413 extract the font descriptor instead of just the font name.
8414 In that case, return a font spec instead of a string.
f2045622
CY
8415 (x_last_font_name): Move to this file from xfns.c.
8416
8417 * xfns.c (Fx_select_font): The return value can also be a font
8418 spec. Move x_last_font_name management to gtkutil.c.
8419
8420 * xfaces.c: Make font weight and style symbols non-static.
8421
7f6feb56
SM
84222012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8423
8424 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8425 (bug#12117).
8426
fecbd8ff
SM
84272012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8428
8429 * alloc.c (Fgarbage_collect): Use plural form consistently.
8430
9b8d5165
EZ
84312012-08-14 Eli Zaretskii <eliz@gnu.org>
8432
8433 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8434 iteration through the command loop. Fixes a problem whereby mouse
8435 movements are ignored until the first mouse click.
8436
f5d9e83a
PE
84372012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8438
8439 Use bool, not int, for Lisp booleans.
8440 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8441 makes Emacs a bit smaller and presumably a bit faster.
8442 * lisp.h: Include <stdbool.h>.
8443 (struct Lisp_Boolfwd, defvar_bool):
8444 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8445 * regex.c [!emacs]: Include <stdbool.h>.
8446 (false, true): Remove; <stdbool.h> does this for us now.
8447
55802e4a
CY
84482012-08-14 Chong Yidong <cyd@gnu.org>
8449
4abcdac8
CY
8450 * character.c (Fcharacterp): Doc fix (Bug#12076).
8451
8452 * data.c (Findirect_variable): Doc fix (Bug#11040).
8453
55802e4a
CY
8454 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8455
8456 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 8457 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 8458
8e99d072
BR
84592012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8460
8461 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8462 (bug#12022).
8463
08908aca
MR
84642012-08-14 Martin Rudalics <rudalics@gmx.at>
8465
8466 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8467 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8468 * minibuf.c (choose_minibuf_frame, read_minibuf):
8469 * w32fns.c (x_create_tip_frame):
8470 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8471 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8472
56120d6f
PE
84732012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8474
8475 * intervals.c (offset_intervals): Remove obsolete comment.
8476
67b77c0b
AS
84772012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8478
8479 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8480
f48b82fd
GR
84812012-08-14 Gergely Risko <gergely@risko.hu>
8482
8483 * coding.c (decode_coding): Record buffer modification before
8484 disabling undo_list (Bug#11773).
8485
fd318b54
DA
84862012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8487
8488 Revert and cleanup some recent overlay changes.
8489 * buffer.h (enum overlay_type): Remove.
8490 (buffer_get_overlays, buffer_set_overlays): Likewise.
8491 (buffer_set_overlays_before, buffer_set_overlays_after):
8492 New function. Adjust users.
8493 (unchain_both): Add eassert.
8494
41a62dd9
DA
84952012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8496
8497 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8498
5884c324
PE
84992012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8500
8501 * gtkutil.c (xg_mark_data): Don't assume C99.
8502
ca06f160
JD
85032012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8504
8505 * gtkutil.c (xg_frame_tb_info): New struct.
8506 (TB_INFO_KEY): New define.
8507 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8508 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8509 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8510 if not present.
8511 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 8512 is up to date. Otherwise store new data.
ca06f160
JD
8513 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8514
7864a3f7
DA
85152012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8516
8517 Use KSET for write access to Lisp_Object members of struct kboard.
8518 * keyboard.h (KSET): New macro.
8519 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8520 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8521 * xterm.c: Adjust users.
8522
4c31be61
DA
85232012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8524
8525 Use BSET for write access to Lisp_Object members of struct buffer.
8526 * buffer.h (BSET): New macro.
8527 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8528 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8529 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8530 * window.c, xdisp.c, xfns.c: Adjust users.
8531
14ae4239
BT
85322012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8533
8534 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8535
32bcadb4
JD
85362012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8537
3d29b2ce 8538 * nsterm.m (not_in_argv): New function.
fc0c31f8 8539 (application:openFile, application:openTempFile:):
3d29b2ce
JD
8540 (application:openFileWithoutUI:, application:openFiles:): Open file
8541 if not_in_argv returns non-zero (bug#12171).
8542
32bcadb4 8543 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
8544 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8545 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
8546 (xg_get_font_name): Use those functions/macros here.
8547 Reported by Frans Oilinki <moilinki@gmail.com>.
8548
9ff9402d 85492012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
8550
8551 * unexmacosx.c (copy_data_segment): Copy initialized data in
8552 statically linked libraries from input file rather than memory.
8553
db74a5fc
YM
8554 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8555 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8556 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8557
25e65510
GM
85582012-08-10 Glenn Morris <rgm@gnu.org>
8559
8560 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8561 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8562
7961135c
DA
85632012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8564
8565 Fix last change to allow compilation with low optimization levels.
8566 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8567 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8568
42b3a444
DA
85692012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8570
8571 Use common inline syntax in intervals.h.
8572 * intervals.h (INTERVALS_INLINE): New macro.
8573 Change all users from LISP_INLINE.
8574
9fb0c957
DA
85752012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8576
8577 Define Qnone once for all platforms.
8578 * frame.c (Qnone): Define here.
8579 (syms_of_frame): DEFSYM it.
8580 * lisp.h (Qnone): New declaration.
8581 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8582 * xfns.c: Remove duplication. Adjust users.
8583
65e8ee52
DA
85842012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8585
8586 Remove unused macros from intervals.h.
8587 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8588 * intervals.c: Adjust comment.
8589
9b855fd6
EZ
85902012-08-10 Eli Zaretskii <eliz@gnu.org>
8591
8592 * w32fns.c <w32_unicode_gui>: New static variable.
8593 (globals_of_w32fns): Initialize it according to os_subtype.
8594 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8595 testing os_subtype.
8596
39cb9e56 85972012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
8598 Eli Zaretskii <eliz@gnu.org>
8599
8600 Fix bug #10299 with Unicode characters sent by customized
8601 keyboards created by MSKLC.
8602 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8603 (w32_init_class): Use it to initialize the Emacs class with either
8604 ANSI or Unicode API calls.
8605 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8606 later.
8607 (w32_wnd_proc): If the character code sent by WM_CHAR or
8608 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8609 original message. Call DefWindowProcW on NT and later.
8610
9374581a
GM
86112012-08-10 Glenn Morris <rgm@gnu.org>
8612
4b94e8cf
GM
8613 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8614
9374581a
GM
8615 * lisp.h (DIRECTORY_SEP): Let configure set it.
8616
a2752828
DA
86172012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8618
8619 Use TSET for write access to Lisp_Object slots of struct terminal.
8620 * termhooks.h (TSET): New macro.
8621 * coding.c, terminal.c, xselect.c: Adjust users.
8622
cc92c454
SM
86232012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8624
8625 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8626 the failing expression, include them in the error message.
8627 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8628 * lisp.h (internal_condition_case_n): Update declaration.
8629
4cb3e6b3
DA
86302012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8631
8632 Inline functions to examine and change buffer overlays.
8633 * buffer.c (unchain_both): New function.
8634 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8635 (buffer_has_overlays): New function.
8636 (enum overlay_type): New enum.
8637 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8638 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8639
8707c1e5
DA
86402012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8641
8642 Inline functions to examine and change buffer intervals.
8643 * alloc.c (mark_interval_tree): Remove.
8644 (MARK_INTERVAL_TREE): Simplify.
8645 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8646 * intervals.c (buffer_balance_intervals): New function.
8647 (graft_intervals_into_buffer): Adjust indentation.
8648 (set_intervals_multibyte): Simplify.
8649 * buffer.h (BUF_INTERVALS): Remove.
8650 (buffer_get_intervals, buffer_set_intervals): New function.
8651 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8652 * intervals.c, textprop.c: Adjust users.
8653
ad8c997f
DA
86542012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8655
8656 Inline functions to examine and change string intervals.
8657 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8658 (string_get_intervals, string_set_intervals): New function.
8659 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8660 * lread.c, print.c, textprop.c: Adjust users.
8661
32ac3a6b
GM
86622012-08-08 Glenn Morris <rgm@gnu.org>
8663
8664 * lisp.mk (lisp): Remove language/persian.elc.
8665
77c7bcb1
DA
86662012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8667
8668 Cleanup intervals.
8669 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8670 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
8671 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8672 Adjust comment. Move under #if 0.
77c7bcb1
DA
8673 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8674 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8675
9c08a8d4
DA
86762012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8677
8678 Check total length of intervals with eassert.
8679 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8680 * intervals.c: Change all users to eassert.
8681
26d16b35
EZ
86822012-08-07 Eli Zaretskii <eliz@gnu.org>
8683
14ae4239
BT
8684 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8685 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
8686 INTERNAL_FIELD in Lisp_Cons.
8687
c644523b
DA
86882012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8689
8690 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8691 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8692 name since all xname users are fixed long time ago. Do not
8693 use INTERNAL_FIELD.
8694 (set_symbol_name, set_symbol_function, set_symbol_plist):
8695 (set_symbol_next, set_overlay_plist): New function.
8696 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8697 (struct Lisp_Overlay): Likewise.
8698 (CVAR, MVAR, SVAR): Remove.
8699 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8700 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8701 * xterm.c: Adjust users.
8702 * .gdbinit: Change to use name field of struct Lisp_Symbol
8703 where appropriate.
8704
6a3d20cc
DA
87052012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8706
8707 Basic functions to set Lisp_Object and pointer slots of intervals.
8708 * intervals.h (interval_set_parent, interval_set_object):
8709 (interval_set_left, interval_set_right, interval_set_plist):
8710 (interval_copy_parent): New function.
8711 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
8712 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8713 Adjust indentation.
6a3d20cc
DA
8714 (INTERVAL_SIZE): Remove. Adjust users.
8715 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8716
4d2b044c
DA
87172012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8718
8719 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8720 * process.h (PGET): Remove.
8721 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8722 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8723
d3d50620
DA
87242012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8725
8726 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8727 * window.h (WGET): Remove.
8728 (struct window): Do not use INTERNAL_FIELD.
8729 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8730 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8731 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8732 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8733 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8734 Adjust users.
8735
d10a51dc
CY
87362012-08-07 Chong Yidong <cyd@gnu.org>
8737
8738 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8739 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8740 (Fdelete_window_internal): Signal an error if the window is not on
8741 a live frame (Bug#12025).
8742
e69b0960
DA
87432012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8744
8745 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8746 * frame.h (FGET): Remove.
8747 (struct frame): Do not use INTERNAL_FIELD.
8748 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8749 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8750 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8751 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8752
25a20a3a
JB
87532012-08-06 Juanma Barranquero <lekktu@gmail.com>
8754
8755 * w32.c: Silence compiler warnings.
8756 (map_w32_filename): Remove unused variable `is_fat'.
8757 (chase_symlinks): Add parentheses around expression.
8758
1c6f11f4
GM
87592012-08-06 Glenn Morris <rgm@gnu.org>
8760
1db4583a
GM
8761 * sysdep.c: Respect BROKEN_GETWD.
8762
1c6f11f4
GM
8763 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8764 Let configure handle it.
8765 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8766
2b90362b
DA
87672012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8768
8769 Use GCALIGNMENT where appropriate.
8770 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8771 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8772 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8773
5f50daf2
EZ
87742012-08-06 Eli Zaretskii <eliz@gnu.org>
8775
14ae4239
BT
8776 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8777 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 8778
cbcc7007
SM
87792012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8780
8781 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8782 that should be sufficient for everyone.
8783
4d365fa4
JD
87842012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8785
8786 * keyboard.c (timer_check_2): Add break so timer_check returns next
8787 timeout.
8788
dd86bd82
DA
87892012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8790
8791 Fix Windows build errors introduced after converting to WGET and WSET.
8792 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8793 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8794
054e1668
JD
87952012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8796
8797 * nsterm.m (ns_frame_rehighlight): Use FSET.
8798
8799 * nsmenu.m (ns_update_menubar): Use FSET.
8800
21238f11
DA
88012012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8802
8803 Separate read and write access to Lisp_Object slots of Lisp_Process.
8804 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8805 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8806
077288cf
DA
88072012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8808
8809 Separate read and write access to Lisp_Object slots of struct window.
8810 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8811 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8812 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8813 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8814 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8815 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8816 Adjust users.
8817
71688bd7
DA
88182012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8819
8820 Fix Windows build errors introduced after converting to FGET and FSET.
8821 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8822 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8823 (w32_judge_scroll_bars): Change to use FSET.
8824 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8825
f99bac93
DA
88262012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8827
8828 Fix replacement typo.
8829 * window.c (replace_window): Set root_window instead of
8830 selected_window. This fixes a total window subsystem
8831 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8832
8c2a0f2d
GM
88332012-08-06 Glenn Morris <rgm@gnu.org>
8834
8835 * lisp.mk (lisp): Add language/persian.elc.
8836
edd74c35
DA
88372012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8838
8839 Separate read and write access to Lisp_Object slots of struct frame.
8840 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8841 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8842 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8843 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8844 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8845
8671676c
AS
88462012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8847
8848 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8849
663e2b3f
DA
88502012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8851
8852 Generalize common compile-time constants.
8853 * lisp.h (header_size, bool_header_size, word_size): Now here.
8854 (struct Lisp_Vector): Add comment.
8855 (struct Lisp_Bool_Vector): Move up to define handy constants.
8856 (VECSIZE, PSEUDOVECSIZE): Simplify.
8857 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8858 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8859 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8860 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8861 * xfont.c, xmenu.c: Use word_size where appropriate.
8862
d32e47af
LM
88632012-08-05 Lawrence Mitchell <wence@gmx.li>
8864
8865 * search.c (Freplace_match): Treat \? in the replacement text
8866 literally (Bug#8161).
8867
e5d9c0d1
CY
88682012-08-05 Chong Yidong <cyd@gnu.org>
8869
8870 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8871 * frame.c (Vdelete_frame_functions):
8872 * emacs.c (Vkill_emacs_hook): Doc fix.
8873
8da0576b
EZ
88742012-08-04 Eli Zaretskii <eliz@gnu.org>
8875
8876 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8877 --with-x-toolkit=no builds.
8878 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8879
02676e5d
CY
88802012-08-04 Chong Yidong <cyd@gnu.org>
8881
8882 * syntax.c (Fmodify_syntax_entry): Doc fix.
8883
97147da9
EZ
88842012-08-04 Eli Zaretskii <eliz@gnu.org>
8885
76151e2c
EZ
8886 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8887 * w32.c (init_environment): Change the default values of many
8888 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
8889 them into environment when they were not already defined.
8890 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 8891 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
8892 (check_windows_init_file): Now external, not static.
8893 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
8894 called when Vload_path is already set up.
8895
8896 * w32.h (check_windows_init_file): Add prototype.
8897
8898 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8899 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8900 compatibility with Posix platforms.
8901 (main): Move the call to check_windows_init_file to here from
8902 w32.c.
8903 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8904 any, in the DEFALT argument into the root of the Emacs build or
8905 installation tree, as appropriate.
8906
8907 * callproc.c (init_callproc_1): Call decode_env_path instead of
8908 doing its equivalent by hand.
8909 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8910 the code that sets Vexec_path run on MS-Windows.
8911
8912 * lread.c (init_lread): Add comments to #ifdef's.
8913
97147da9
EZ
8914 * msdos.c (dos_set_window_size, IT_update_begin)
8915 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8916 instead of direct references.
8917
185ee146
PE
89182012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8919
8920 Export DEFAULT_REHASH_* to GDB.
8921 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8922 Now constants, not macros.
8923
8834c57a
PE
89242012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8925
98c6f1e3
PE
8926 Remove unnecessary casts involving pointers.
8927 These casts are no longer needed now that we assume C89 or later,
8928 since they involve casting to or from void *.
8929 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8930 (make_pure_float, make_pure_vector):
8931 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8932 * macros.c (Fstart_kbd_macro):
8933 * menu.c (find_and_return_menu_selection):
8934 * minibuf.c (read_minibuf_noninteractive):
8935 * sysdep.c (closedir):
8936 * xdisp.c (x_produce_glyphs):
8937 * xfaces.c (compare_fonts_by_sort_order):
8938 * xfns.c (x_real_positions, select_visual):
8939 * xselect.c (x_stop_queuing_selection_requests)
8940 (x_get_window_property, x_get_window_property_as_lisp_data):
8941 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8942 Remove unnecessary pointer casts.
8943 * alloc.c (record_xmalloc): New function.
8944 * lisp.h (record_xmalloc): New decl.
8945 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8946 more like a function. This is because the pointer cast is not
8947 needed. All uses changed.
8948 * print.c (print_string, print_error_message): Avoid length recalc.
8949
8834c57a
PE
8950 Improve fix for macroexp crash with debugging (Bug#12118).
8951 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8952 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8953 not supposed to be invoked from the garbage collector.
8954 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8955 (gc_aset): New function, which is like ASET but can be
8956 used in the garbage collector.
8957 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8958 (set_hash_index): Use it instead of ASET.
8959
6dad7178
EZ
89602012-08-03 Eli Zaretskii <eliz@gnu.org>
8961
8962 Support symlinks on latest versions of MS-Windows.
8963 * w32.c: Include winioctl.h and aclapi.h.
8964 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8965 (revert_to_self): Forward declarations of static functions.
8966 <static BOOL g_b_init_get_security_info>:
8967 <g_b_init_create_symbolic_link>: New static flags.
8968 (globals_of_w32): Initialize them to zero.
8969 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8970 (map_w32_filename): Improve commentary. Simplify switch.
8971 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8972 headers (most versions of MinGW w32api don't).
8973 (get_security_info, create_symbolic_link)
8974 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8975 New functions.
8976 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8977 in the argument file name.
8978 (sys_access): Call unc_volume_file_attributes only if
8979 GetFileAttributes fails with network-related error codes.
8980 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8981 have the required privileges.
14ae4239 8982 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
8983 get_file_security_desc.
8984 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
8985 with addition of handling of symlinks and support for 'lstat'.
8986 If possible, get file's attributes and security information by
6dad7178
EZ
8987 handle, not by name. Produce S_IFLNK bit for symlinks, when
8988 called from 'lstat'.
8989 (stat, lstat): New functions, call 'stat_worker'.
8990 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8991 symlinks when the underlying filesystem supports them.
8992
f162bcc3
PE
89932012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8994
79ea6c20
PE
8995 Fix macroexp crash on Windows with debugging (Bug#12118).
8996 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8997 checking subscripts; problem introduced with the recent
8998 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8999 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9000 since it's used in non-static inline functions now.
9001
c0ce93fd
PE
9002 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9003 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 9004
f162bcc3
PE
9005 Use C99-style 'extern inline' if available.
9006 * buffer.h (BUFFER_INLINE):
9007 * category.h (CATEGORY_INLINE):
9008 * character.h (CHARACTER_INLINE):
9009 * charset.h (CHARSET_INLINE):
9010 * composite.h (COMPOSITE_INLINE):
9011 * dispextern.h (DISPEXTERN_INLINE):
9012 * lisp.h (LISP_INLINE):
9013 * systime.h (SYSTIME_INLINE):
9014 New macro, replacing 'static inline' in this header.
9015 * buffer.h, category.h, character.h, charset.h, composite.h:
9016 * dispextern.h, lisp.h, systime.h:
9017 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9018 * alloc.c (LISP_INLINE):
9019 * buffer.c (BUFFER_INLINE):
9020 * category.c (CATEGORY_INLINE):
9021 * character.c (CHARACTER_INLINE):
9022 * charset.c (CHARSET_INLINE):
9023 * composite.c (COMPOSITE_INLINE):
9024 * dispnew.c (DISPEXTERN_INLINE):
9025 * sysdep.c (SYSTIME_INLINE):
9026 Define to EXTERN_INLINE, so that the corresponding functions
9027 are compiled into code.
9028 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9029 (INLINE_HEADER_END): New macros.
9030 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9031 since it's used in non-static inline functions now.
a8333d03 9032 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 9033
837b365b
GM
90342012-08-02 Glenn Morris <rgm@gnu.org>
9035
d66b744d
GM
9036 * s/: Remove empty directory.
9037
837b365b
GM
9038 * s/ms-w32.h: Move to ../nt/inc.
9039 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9040 Update for new ms-w32.h location.
9041
13294f95
PE
90422012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9043
9044 Port to Solaris 8.
9045 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9046
90df0db3
GM
90472012-08-02 Glenn Morris <rgm@gnu.org>
9048
9049 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9050 hard-coding the path separator.
9051
4939150c
PE
90522012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9053
9054 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9055 This how ASET and AREF are supposed to work, and makes
9056 it easier to think about future improvements. See
9057 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9058 * charset.h (set_charset_attr): New function.
9059 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9060 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9061 (aref_addr): New function. All uses of &AREF(...) changed.
9062 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9063 (set_hash_index): New functions. All lvalue-style uses of
9064 HASH_KEY etc. changed.
9065 * keyboard.c (set_prop): New function. All lvalue-style uses
9066 of PROP changed.
9067
947b2afd
AA
90682012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9069
9070 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9071 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 9072 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
9073 * nsfns.m (ns_set_name_as_filename): Likewise.
9074 * nsmenu.m (ns_update_menubar): Likewise.
9075 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9076
4f5d0325
EZ
90772012-08-01 Eli Zaretskii <eliz@gnu.org>
9078
2008beae
EZ
9079 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9080 Adapt to latest changes in field names of the corresponding Lisp
288479f6 9081 objects.
2008beae 9082
4f5d0325
EZ
9083 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9084
fe3cc771
GM
90852012-08-01 Glenn Morris <rgm@gnu.org>
9086
9087 * s/msdos.h: Remove file.
9088 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9089 * Makefile.in (S_FILE): Remove.
9090 (config_h): Remove S_FILE.
9091
c90acc54
JB
90922012-08-01 Juanma Barranquero <lekktu@gmail.com>
9093
9094 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9095 Remove; moved to nt/config.nt.
9096
d8a05828
DA
90972012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9098
9099 Use INTERNAL_FIELD for conses and overlays.
9100 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9101 Remove obsolete comment.
9102 (MVAR): New macro.
9103 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9104 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9105
8271d590
DA
91062012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9107
9108 Use INTERNAL_FIELD for symbols.
9109 * lisp.h (SVAR): New macro. Adjust users.
9110 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9111 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9112
3193acd2
DA
91132012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9114
9115 Use INTERNAL_FIELD for processes.
9116 * process.h (PVAR): New macro. Adjust style.
9117 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9118 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9119
3a45383a
DA
91202012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9121
9122 Use INTERNAL_FIELD for windows.
9123 * window.h (WVAR): New macro.
9124 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9125 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9126 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9127 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9128 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9129 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9130
c1dbc63c
PE
91312012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9132
9133 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9134
5c0c0e8a
GM
91352012-08-01 Glenn Morris <rgm@gnu.org>
9136
9137 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9138 Move to configure.ac.
9139
552a99b4
JB
91402012-08-01 Juanma Barranquero <lekktu@gmail.com>
9141
9142 * makefile.w32-in (CONFIG_H): Update dependencies.
9143 (CONF_POST_H): New macro.
9144
9145 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9146
8d8e2dfe
GM
91472012-07-31 Glenn Morris <rgm@gnu.org>
9148
bc96620a
GM
9149 * Makefile.in (S_FILE): No longer set by configure.
9150
476b1b2d
GM
9151 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9152 is available.
9153 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9154
b2c7a106
GM
9155 * process.h (NULL_DEVICE):
9156 * emacs.c (SEPCHAR):
9157 * editfns.c (USER_FULL_NAME): Let configure set them.
9158
d53d062a
GM
9159 * s/README, s/template.h: Remove files.
9160
4515017f
GM
9161 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9162
8d8e2dfe
GM
9163 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9164 Move to configure.ac.
9165
5b20b3cc
EZ
91662012-07-31 Eli Zaretskii <eliz@gnu.org>
9167
1e0afd9a
EZ
9168 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9169 resulting renaming of 'struct frame' members.
9170
5b20b3cc
EZ
9171 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9172
9173 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9174 after introduction of FVAR.
9175
f1310128
JD
91762012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9177
79e721e0
JD
9178 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9179
9180 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9181 instead of compositeToPoint.
9182 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9183
8d7c7eed 9184 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 9185
e34f7f79
DA
91862012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9187
9188 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9189 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 9190 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
9191 (BVAR): Change to use INTERNAL_FIELD.
9192 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9193 (KVAR): Change to use INTERNAL_FIELD.
9194 * frame.h (FVAR): New macro.
9195 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
9196 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9197 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9198 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
9199 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9200
c09bfb2f
DA
92012012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9202
9203 Miscellaneous fixes for non-default X toolkits.
9204 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9205 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9206 Move under #ifdef USE_LUCID.
9207 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9208 definition and usage to avoid warnings.
9209
14c114ae
JD
92102012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9211
9212 * nsterm.m (openFiles): Fix previous checkin.
9213
3bd21e82
PE
92142012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9215
9216 * indent.c (compute_motion): Remove unused local.
9217
c1529ded
GM
92182012-07-31 Glenn Morris <rgm@gnu.org>
9219
400d5621
GM
9220 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9221
268e2432
GM
9222 * conf_post.h [USG5_4]:
9223 Move remaining contents of s/usg5-4-common.h here.
9224 * s/usg5-4-common.h: Remove file.
9225
7552f3ee
GM
9226 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9227 * s/irix6-5.h: Remove file.
9228
6a381852
GM
9229 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9230 * s/darwin.h: Remove file.
9231
c1529ded
GM
9232 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9233 * s/hpux10-20.h: Remove file, which is now empty.
9234
b429a4ee
GM
92352012-07-30 Glenn Morris <rgm@gnu.org>
9236
9237 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9238 * Makefile.in (config_h): Add conf_post.h.
9239 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9240
adff3182
JD
92412012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9242
9243 * nsterm.m (ns_do_open_file): New variable.
b9031d69 9244 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
9245 (openFile, openTempFile, openFileWithoutUI, openFiles):
9246 Open files only if ns_do_open_file.
adff3182 9247
c32af1e4
PE
92482012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9249
7393bcbb
PE
9250 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9251 This no-op macro hasn't been needed for many years.
9252 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9253
c32af1e4
PE
9254 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9255 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9256 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9257 gdb_make_enums_visible.
9258 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9259 (DIRECTORY_SEP): Now a constant, not a macro.
9260
302fc036
EZ
92612012-07-30 Eli Zaretskii <eliz@gnu.org>
9262
9263 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9264 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9265
9266 * w32term.c <w32_keyboard_codepage>: Renamed from
9267 keyboard_codepage and now external. All users changed.
9268
9269 * w32term.h: Add declaration of w32_keyboard_codepage.
9270
9271 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9272 the codepage to translate keys to Unicode. If this argument is
9273 -1, use the value returned by GetConsoleCP. All callers changed.
9274
88fb40b4
PE
92752012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9276
0aee6912
PE
9277 Update .PHONY listings in makefiles.
9278 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9279 bootstrap-clean, distclean, maintainer-clean, versioclean,
9280 extraclean, frc.
9281
88fb40b4
PE
9282 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9283 This is a bit clearer. Fix some commentary typos.
9284
0a763bd1
GM
92852012-07-30 Glenn Morris <rgm@gnu.org>
9286
32bac6d6
GM
9287 * s/netbsd.h: Let configure include signal.h if needed.
9288 Remove file, which is now empty.
9289
b65e7c46
GM
9290 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9291 Let configure set them.
9292 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9293 No more need to undefine.
0a763bd1 9294
169304bd
AS
92952012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9296
9297 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9298 non-single-byte char when adding meta modifier. (Bug#12090)
9299
6cd7a139
DA
93002012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9301
9302 Convert safe_call to use variable number of arguments.
9303 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9304 (safe_call2): Fix comment.
9305 * lisp.h (safe_call): Adjust prototype.
9306 * coding.c (encode_coding_object): Change to use safe_call2.
9307 * xfaces.c (merge_face_heights): Change to use safe_call1.
9308
d34d6ffc
GM
93092012-07-30 Glenn Morris <rgm@gnu.org>
9310
7b8a48e4 9311 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 9312 does that unconditionally. Remove file, which is now empty.
7b8a48e4 9313
d34d6ffc
GM
9314 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9315 Remove empty files.
9316
03a660a6
PE
93172012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9318
9319 Export to GDB most of lisp.h's remaining object-like macros.
9320 * lisp.h (min, max): Move earlier, because they're used earlier now.
9321 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9322 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9323 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9324 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9325 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9326 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9327 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9328 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9329 Now constants, for GDB. They need not be macros.
9330 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9331 Now constants, for GDB, as well as macros, for static initializers.
9332 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9333 Move to after the definition of struct Lisp_Char_Table,
9334 since the former now needs that type defined.
9335 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9336 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9337 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9338 New enums, for gdb_make_enums_visible.
9339 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 9340 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
9341 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9342 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9343 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9344 enum maxargs, enum MAX_ALLOCA.
9345 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9346 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9347 no longer needed, now that they are done in lisp.h.
9348
e499d0ee
DA
93492012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9350
9351 Cleanup string bytes checking.
9352 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9353 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9354 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9355 (check_sblock, compact_small_strings): Simplify.
9356
d5040d2d
PE
93572012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9358
9359 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9360 These macros are confusing and no longer need to be defined, as
9361 the enum values now suffice. All uses replaced with definiens.
9362 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9363
7f259ae6
JB
93642012-07-29 Juanma Barranquero <lekktu@gmail.com>
9365
9366 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9367 ($(BLD)/w32console.$(O)): Update dependencies.
9368
7e63e0c3
DA
93692012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9370
9371 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9372 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9373 time. Adjust users.
9374 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9375
ffd817eb
JD
93762012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9377
9378 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9379 setting sitelisp (Bug#12010).
9380
417a7a0e
EZ
93812012-07-29 Eli Zaretskii <eliz@gnu.org>
9382
14ae4239 9383 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
9384
9385 * w32heap.c (cache_system_info):
9386 * w32.c (sys_rename):
9387 * w32proc.c (find_child_console, sys_kill): All users changed.
9388
387d4d92
PE
93892012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9390
9391 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9392
55a6cca6
EZ
93932012-07-29 Eli Zaretskii <eliz@gnu.org>
9394
9395 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9396
dbcf001c
DA
93972012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9398
9399 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
9400 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9401 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 9402
e2688e4a
DA
94032012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9404
9405 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9406 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9407 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9408 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9409 (replace_range, replace_range_2, del_range_2): Change to eassert.
9410 * marker.c (byte_char_debug_check): Adjust style.
9411
b46a6a83
PE
94122012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9413
9414 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9415 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9416 long-ago-commented-out code that talks about "WIN32".
9417 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9418 All uses changed.
9419
e32a5799
PE
94202012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9421
9422 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9423 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9424 Simplify by using alignof.
9425 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9426 * lisp.h: Include <stdalign.h>.
9427 (GCALIGNMENT): New macro and constant.
9428 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9429 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9430 (stdalign): New macro, if not already defined.
9431
df81cd29
EZ
94322012-07-28 Eli Zaretskii <eliz@gnu.org>
9433
01bd1b0d
EZ
9434 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9435 * w32inevt.c: Include w32inevt.h.
9436 (w32_read_console_input): New inline function, calls either
9437 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9438 w32_console_unicode_input.
9439 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9440 (w32_kbd_patch_key, key_event): Use the codepage returned by
9441 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9442 (key_event): use uChar.UnicodeChar only if
9443 w32_console_unicode_input is non-zero.
9444
9445 * w32console.c: Include w32heap.h.
9446 <w32_console_unicode_input>: New global variable.
9447 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9448 family of Windows, zero otherwise.
9449
9450 * w32inevt.h: Declare w32_console_unicode_input.
9451
df81cd29
EZ
9452 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9453 --without-x. (Bug#11742)
9454
c20fdd9e
PE
94552012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9456
9457 Adjust GDB to reflect pvec_type changes (Bug#12036).
9458 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
9459 2012-07-04 changes to pseudovector representation.
9460 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 9461
32770973 94622012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
9463
9464 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9465 bus address.
9466 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9467
3438fe21
EZ
94682012-07-27 Eli Zaretskii <eliz@gnu.org>
9469
bcfbc9de
EZ
9470 * alloc.c (listn): Fix the order the arguments are consed onto the
9471 list.
9472
3438fe21
EZ
9473 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9474 enumeration constants, as PURE and HEAP are too general, and clash
9475 with other headers and sources, such as gmalloc.c and the
9476 MS-Windows system headers. All users changed.
9477
eeaea515
DA
94782012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9479
9480 Revert last save_excursion_save and save_excursion_restore changes.
9481 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9482 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9483
073c88c2
DA
94842012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9485
9486 Fix recently-introduced typos in Windows port.
9487 Reported by Martin Rudalics <rudalics@gmx.at>.
9488 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 9489 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 9490
4706125e
PE
94912012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9492
9493 Improve GDB symbol export (Bug#12036).
9494 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9495 arms of an 'if', not using conditional expressions; otherwise GDB
9496 complains about the types in the unevaluated arm when the argument
9497 is an integer literal.
9498 (xgetint): Simplify expression.
9499 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9500 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9501 Zaretskii in <http://bugs.gnu.org/12036#13>.
9502 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9503 needed now that we have gdb_make_enums_visible.
9504 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9505 (enum enum_USE_LSB_TAG):
9506 New enum types, packaging up enums that need to be exported to GDB.
9507
694b6c97
DA
95082012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9509
9510 Utility function to make a list from specified amount of objects.
9511 * lisp.h (enum constype): New datatype.
9512 (listn): New prototype.
9513 * alloc.c (listn): New function.
9514 (Fmemory_use_count, syms_of_alloc): Use it.
9515 * buffer.c (syms_of_buffer): Likewise.
9516 * callint.c (syms_of_callint): Likewise.
9517 * charset.c (define_charset_internal): Likewise.
9518 * coding.c (syms_of_coding): Likewise.
9519 * keymap.c (syms_of_keymap): Likewise.
9520 * search.c (syms_of_search): Likewise.
9521 * syntax.c (syms_of_syntax): Likewise.
9522 * w32.c (init_environment): Likewise.
9523 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9524 * xdisp.c (syms_of_xdisp): Likewise.
9525 * xfns.c (syms_of_xfns): Likewise.
9526
6195f384
DA
95272012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9528
9529 Fast save_excursion_save and save_excursion_restore.
9530 * lisp.h (struct Lisp_Excursion): New data type.
9531 (PVEC_EXCURSION): New pseudovector type.
9532 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9533 to deal with it. Adjust comments.
9534 (init_marker, attach_marker): New prototype.
9535 (unchain_marker): Adjust prototype.
9536 * marker.c (attach_marker): Change to global.
9537 (init_marker): New function.
9538 * alloc.c (Fmake_marker, build_marker): Use it.
9539 (build_marker): More easserts.
9540 (mark_object): Handle struct Lisp_Excursion.
9541 * editfns.c (save_excursion_save, save_excursion_restore):
9542 Reimplement to use struct Lisp_Excursion. Add comments.
9543
5eceb8fb
PE
95442012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9545
9546 Fix export of symbols to GDB (Bug#12036).
9547 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9548 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9549 emacs.c, as this is a more-suitable home. Had this been done earlier
9550 the fix for 12036 would have avoided some of the problems noted in
9551 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9552 would have been more obvious.
562157c8
PE
9553 * emacs.c: Do not include <verify.h>; no longer needed.
9554 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
9555 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9556 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9557 Remove; now done in lisp.h.
9558 * lisp.h (PUBLISH_TO_GDB): New macro.
9559 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9560 (DATA_SEG_BITS): Use it.
9561 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9562 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9563 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9564 not be usable in #if. This simplifies things.
9565
d6749401
JB
95662012-07-26 Juanma Barranquero <lekktu@gmail.com>
9567
9568 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9569
1781b9e9
PE
95702012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9571
d89518db 9572 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
9573 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9574 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9575 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9576 Adjust to changes in lisp.h and emacs.c, by using
9577 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9578 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9579 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9580 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9581 instead of gdb_valbits.
9582 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9583 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9584 instead of gdb_array_mark_flag.
9585 (xboolvector): Get size from $->size, not $->header.size.
9586 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9587 (xreload, hook-run, hookpost-run): Remove.
9588 * emacs.c: Include <verify.h>.
9589 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9590 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9591 Remove.
9592 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9593 (gdb_USE_LSB_TAG): New enum constants.
9594 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9595 Also define these as enum constants, so they're visible to GDB.
9596 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9597 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9598 as constants, so they're visible to GDB.
9599 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9600 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9601 Now enum constants, not macros, so they're visible to GDB.
9602 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9603 more convenient now. All uses changed.
9604 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9605 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9606
3628596a
DA
96072012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9608
9609 Explicitly free restriction data that are not needed anymore.
9610 * editfns.c (save_restriction_restore): Free restriction data.
9611
7abaf5cc
SM
96122012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9613
9614 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9615 add argument, tune behavior, and adjust all callers.
9616
71f88e00
PE
96172012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9618
9619 Use typedef for EMACS_INT, EMACS_UINT.
9620 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9621 than macros. This simplifies debugging in the usual case, since
9622 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9623 and it allows expressions involving EMACS_INT casts.
9624 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9625
57ec3034
JD
96262012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9627
9628 * nsterm.m (ns_read_socket): Return early if there is a modal
9629 window (Bug#12043).
9630
8137e7b3
MR
96312012-07-25 Martin Rudalics <rudalics@gmx.at>
9632
9633 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9634 that FOCUS-FRAME can be omitted.
9635
04e9897c
DA
96362012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9637
9638 Adjust buffer text indirection counters at the end of Fkill_buffer.
9639 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9640 buffer is definitely dead. This should really fix an issue reported
9641 by Christoph Scholtes again. (Bug#12007).
9642 (init_buffer_once): Initialize indirection counters of
9643 buffer_defaults and buffer_local_symbols (for sanity and safety).
9644
8a0484e1
EZ
96452012-07-24 Eli Zaretskii <eliz@gnu.org>
9646
9647 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9648 and continuation glyphs on tooltip frames, leave them at zero.
9649 Avoids continued lines in tooltips. (Bug#11832)
9650
fa691a83
DA
96512012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9652
9653 Simplify copy_overlay.
04e9897c 9654 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
9655 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9656
436bc8e0
EZ
96572012-07-23 Eli Zaretskii <eliz@gnu.org>
9658
9659 * print.c (print_object): Don't crash when a frame's name is nil
9660 or invalid. (Bug#12025)
9661
9662 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9663 it signals an error when a tooltip frame is being created.
9664
d7a7fda3
DA
96652012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9666
9667 Cleanup miscellaneous objects allocation and initialization.
9668 * alloc.c (allocate_misc): Change to static. Add argument to
9669 specify the subtype. Adjust comment and users.
9670 (build_overlay): New function.
9671 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9672 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9673 (allocate_misc): Remove prototype.
9674 (build_overlay): Add prototype.
9675
96762012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
9677
9678 Swap buffer text indirection counters in Fbuffer_swap_text.
9679 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9680 This avoids crash reported by Christoph Scholtes at
9681 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9682
9d7fa573
JD
96832012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9684
9685 * nsmenu.m (Popdown_data): New struct.
9686 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9687 free Popdown_data.
9688 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9689 (initWithContentRect): Make imgView and contentView non-static
9690 and autorelease them. Also autorelease img and matrix (Bug#12005).
9691 (dealloc): Remove (Bug#12005).
9692
0dd6d66d
DA
96932012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9694
9695 Adjust consing_since_gc when objects are explicitly freed.
9696 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9697 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9698 (free_cons, free_misc): Subtract object size from consing_since_gc.
9699
d36d71df
DA
97002012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9701
9702 Simplify and cleanup markers positioning code.
9703 * marker.c (attach_marker): More useful eassert.
9704 (live_buffer, set_marker_internal): New function.
9705 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9706 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9707
fb9ea40f
PE
97082012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9709
9710 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9711 as it's limited by the amount of memory, not by INT_MAX.
9712
2d5c5f7d
EZ
97132012-07-21 Eli Zaretskii <eliz@gnu.org>
9714
07fb592e
EZ
9715 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9716 in special-event-map. See the discussion at
9717 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9718 for the reasons.
9719
37a9eac8 9720 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
9721 info.dwItemData. Fixes crashes on 64-bit Windows.
9722 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 9723
c4328746
JD
97242012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9725
fc0c31f8 9726 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 9727 (conversationIdentifier): Return value is NSInteger.
784051c4 9728 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 9729
6e5d1c12
CY
97302012-07-21 Chong Yidong <cyd@gnu.org>
9731
9732 * window.c (decode_any_window): Signal an error if the window is
9733 on a dead frame (Bug#11984).
9734
9928463d
DA
97352012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9736
9737 Add indirection counting to speed up Fkill_buffer.
9738 * buffer.h (struct buffer): New member.
9739 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9740 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9741 base buffer indirection counter.
9742 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9743 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9744 through buffer list if indirection counter is 0.
9745
f8643a6b
DA
97462012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9747
9748 Extend the value returned by Fgarbage_collect with heap statistics.
9749 * alloc.c (Qheap): New symbol.
9750 (syms_of_alloc): DEFSYM it.
9751 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9752 (Fmemory_free): Remove.
9753 (syms_of_alloc): Don't defsubr it.
9754 * buffer.c (Fcompact_buffer): Remove.
9755 (syms_of_buffer): Don't defsubr it.
9756
dac616ff
DA
97572012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9758
9759 Make maybe_gc inline.
9760 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9761 * lisp.h (consing_since_gc, gc_relative_threshold)
9762 (memory_full_cons_threshold): Revert declaration.
9763 (maybe_gc): Remove prototype, define as inline.
9764 * alloc.c: Remove old commented-out code.
9765 (consing_since_gc, gc_relative_threshold)
9766 (memory_full_cons_threshold): Revert to global.
9767 (maybe_gc): Remove.
9768
d7ea76b4
DA
97692012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9770
9771 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9772 * lisp.h (build_unibyte_string): New function.
9773 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9774 * sysdep.c, w32fns.c, xfns.c: Use it.
9775 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9776 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9777 Adjust users accordingly.
9778 * font.h (font_open_by_name): Adjust prototype.
9779
765e61e3
DA
97802012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9781
9782 Cleanup calls to Fgarbage_collect.
9783 * lisp.h (maybe_gc): New prototype.
9784 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9785 Remove declarations.
9786 * alloc.c (maybe_gc): New function.
9787 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9788 Make them static.
9789 * bytecode.c (MAYBE_GC): Use maybe_gc.
9790 * eval.c (eval_sub, Ffuncall): Likewise.
9791 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9792 to avoid dependency from auto-save feature.
9793
52b852c7
PE
97942012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9795
9796 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9797 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9798 'for_each_per_buffer_object_at'.
9799 All uses changed. It's better to use upper-case for macros that
9800 cannot be implemented as functions, to give the reader a clue
9801 that they're special.
9802
5db81e33
SM
98032012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9804
9805 * alloc.c (Fgarbage_collect): Tweak docstring.
9806
5b835e1d
DA
98072012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9808
9809 Tweak the value returned from Fgarbage_collect again.
9810 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9811 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9812 Adjust documentation.
9813 (total_vector_bytes): Rename to total_vector_slots, adjust
9814 accounting.
9815 (total_free_vector_bytes): Rename to total_free_vector_slots,
9816 adjust accounting.
9817 (Qstring_bytes, Qvector_slots): New symbols.
9818 (syms_of_alloc): DEFSYM them.
9819
9cd47b72
DA
98202012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9821
9822 Buffer compaction primitive which may be used from Lisp.
9823 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9824 (syms_of_buffer): Register Fcompact_buffer.
9825 * alloc.c (Fgarbage_collect): Use compact_buffer.
9826 * buffer.h (compact_buffer): New prototype.
9827 (struct buffer_text): New member.
9828
d17337e5
DA
98292012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9830
9831 New macro to iterate over all buffers, miscellaneous cleanups.
9832 * lisp.h (all_buffers): Remove declaration.
9833 * buffer.h (all_buffers): Add declaration, with comment.
9834 (for_each_buffer): New macro.
9835 * alloc.c (Fgarbage_collect, mark_object): Use it.
9836 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9837 (init_buffer): Likewise.
9838 * data.c (Fset_default): Likewise.
9839 * coding.c (code_conversion_restore): Remove redundant check
9840 for dead buffer.
9841 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9842
60cfd278
AS
98432012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9844
9845 Fix bug that created negative-length intervals.
9846 * intervals.c (merge_interval_right, merge_interval_left):
9847 Do not zero out this interval if it is absorbed by its children,
9848 as this interval's total length doesn't change in that case. See
9849 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9850
d06714cb
PE
98512012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9852
83713154
PE
9853 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9854 when invoking (make-bool-vector N t) and N is a positive
9855 multiple of 8 -- the last 8 bits were mistakenly cleared.
9856
d06714cb
PE
9857 Remove some struct layout assumptions in bool vectors.
9858 * alloc.c (bool_header_size): New constant.
9859 (header_size, word_size): Move earlier, as they're now used earlier.
9860 Use 'word_size' in a few more places, where it's appropriate.
9861 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9862 padding before the data member of a bool vector.
9863 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9864 than doing the check by hand with an abort ().
9865
464d5a5e
SM
98662012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9867
5fbc0409
SM
9868 * eval.c (Fdefvar): Don't check constants since we only set the var if
9869 it's not yet defined anyway (bug#11904).
9870
464d5a5e
SM
9871 * lisp.h (last_undo_boundary): Declare new var.
9872 * keyboard.c (command_loop_1): Set it.
9873 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9874 were auto-added by the command loop (bug#11774).
9875
8dc2e44a
AS
98762012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9877
9878 * w32font.c (Qsymbol): Remove local definition.
9879 (syms_of_w32font): Don't DEFSYM it.
9880
169925ec
DA
98812012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9882
9883 Fix sweep_vectors to handle large bool vectors correctly.
9884 * alloc.c (sweep_vectors): Account total_vector_bytes for
9885 bool vectors larger than VBLOCK_BYTES_MAX.
9886
5fbfb018
CY
98872012-07-18 Chong Yidong <cyd@gnu.org>
9888
9889 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9890 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9891
3ab6e069
DA
98922012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9893
9894 Return more descriptive data from Fgarbage_collect.
9895 Suggested by Stefan Monnier in
9896 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9897 * alloc.c (bounded_number): New function.
9898 (total_buffers, total_vectors): New variable.
9899 (total_string_size): Rename to total_string_bytes, adjust users.
9900 (total_vector_size): Rename to total_vector_bytes, adjust users.
9901 (sweep_vectors): Account total_vectors and total_vector_bytes.
9902 (Fgarbage_collect): New return value. Adjust documentation.
9903 (gc_sweep): Account total_buffers.
9904 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9905 (VECTOR_SIZE): Remove.
9906 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9907 (Qinterval, Qmisc): New symbols.
9908 (syms_of_data): Initialize them.
9909 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9910 (Qcons, Qbuffer): New declarations.
9911
6d02fe5b
PE
99122012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9913
9914 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9915 Round up, not down. Improve doc.
9916
b7ffe040
DA
99172012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9918
9919 Restore old code in allocate_string_data to avoid Faset breakage.
9920 Reported by Julien Danjou <julien@danjou.info> in
9921 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9922 * alloc.c (allocate_string_data): Restore old code with minor
9923 adjustments, fix comment to explain this subtle issue.
9924
4dc7c8d5
SM
99252012-07-17 Eli Zaretskii <eliz@gnu.org>
9926
9927 Remove FILE_SYSTEM_CASE.
9928 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9929
9930 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9931 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9932 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9933 call-process-region passes it through expand-file-name.
9934
9935 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9936
99372012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9938
9939 Fix crash when creating indirect buffer (Bug#11917)
9940 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9941 Don't handle unbound variables specially if non-zero.
9942 (Fbuffer_local_variables): Pass zero.
9943 (clone_per_buffer_values): Pass non-zero.
9944
99452012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9946
9947 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9948 to make the loop interruptible.
9949
99502012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9951
9952 * gnutls.c (emacs_gnutls_handshake): Only retry if
9953 GNUTLS_E_INTERRUPTED.
9954
cce7fefc
DA
99552012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9956
9957 Cleanup and convert miscellaneous checks to eassert.
9958 * alloc.c (mark_interval): Fix comment, partially rephrase
9959 old comment from intervals.h (see below).
9960 * intervals.c (find_interval, adjust_intervals_for_insertion)
9961 (delete_interval, adjust_intervals_for_deletion)
9962 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9963 Convert to eassert.
9964 (adjust_intervals_for_insertion, make_new_interval):
9965 Remove obsolete and unused code.
9966 * intervals.h (struct interval): Remove obsolete comment.
9967 * textprotp.c (erase_properties): Remove unused code.
9968 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9969 (Fremove_list_of_text_properties): Convert to eassert.
9970
9ea10cc3
CY
99712012-07-17 Chong Yidong <cyd@gnu.org>
9972
9973 * editfns.c (Finsert_char): Doc fix.
9974
3900d5de
DA
99752012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9976
9977 Fix previous change to make Fmemory_free always accurate.
9978 * alloc.c (make_interval): Update total_free_intervals.
9979 (make_float): Likewise for total_free_floats.
9980 (free_cons, Fcons): Likewise for total_free_conses.
9981 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9982 Likewise for total_free_vector_bytes.
9983 (Fmake_symbol): Likewise for total_free_symbols.
9984 (bytes_free): Remove.
9985
7098646f
DA
99862012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9987
9988 Simple free memory accounting feature.
9989 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9990 (sweep_vectors): Accumulate size of free vectors.
9991 (Fgarbage_collect): Setup bytes_free.
9992 (Fmemory_free): New function.
9993 (syms_of_alloc): Register it.
9994
22657b40
DA
99952012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9996
9997 Cleanup overlays checking.
9998 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9999 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10000 eassert and OVERLAYP.
10001 (sort_overlays): Change to use OVERLAYP.
10002
ddfc8813
RK
100032012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10004
10005 * editfns.c (Finsert_char): Make it interactive, and make the
10006 second arg optional. Copy interactive spec and docstring from
10007 ucs-insert.
10008
7c26cf3c
PE
100092012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10010
10011 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10012 Unlike the other wrapped functions, fabs has an unspecified
10013 effect on errno.
10014
5d127af9
JD
100152012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10016
10017 * nsterm.m (keyDown): Interpret flags without left/right bits
10018 as the left key (Bug#11670).
10019
6a0dd1d7
DA
100202012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10021
10022 Remove empty and useless init functions.
10023 * lisp.h (init_character_once, init_fns, init_image)
10024 (init_filelock, init_sound): Remove prototype.
10025 * character.c (init_character_once): Remove.
10026 * filelock.c (init_filelock): Likewise.
10027 * fns.c (init_fns): Likewise.
10028 * image.c (init_image): Likewise.
10029 * sound.c (init_sound): Likewise.
10030 * emacs.c (main): Adjust accordingly.
10031
7a6136fd
DA
100322012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10033
10034 * gtkutil.h: Tiny cleanups.
10035 (use_old_gtk_file_dialog): Remove useless declaration.
10036 (xg_uses_old_file_dialog): Add suggested const attribute.
10037
ce811ad9
EZ
100382012-07-15 Eli Zaretskii <eliz@gnu.org>
10039
10040 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10041 (bidi_paragraph_init): Use it to limit search forward for a strong
10042 directional character in abnormally large paragraphs full of
10043 neutral or weak characters. (Bug#11943)
10044
c9adfeaa
SF
100452012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10046
10047 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10048 the toolbar (Bug#9451).
10049 (xg_make_tool_item): Give the widget event box a transparent
10050 background.
10051
fff62aa9
DA
100522012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10053
10054 Cleanup basic allocation variables and functions.
10055 * alloc.c (ignore_warnings, init_intervals, init_float)
10056 (init_cons, init_symbol, init_marker): Remove.
10057 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10058 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10059 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10060 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10061 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10062 (staticidx, init_alloc_once, init_strings, free_ablock):
10063 Remove redundant initialization.
10064 * fns.c (init_weak_hash_tables): Remove.
10065 * lisp.h (init_weak_hash_tables): Remove prototype.
10066
9730daca
DA
100672012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10068
10069 Use zero_vector where appropriate.
10070 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10071 accordingly.
10072 * lisp.h (zero_vector): New declaration.
10073 * font.c (null_vector): Remove.
10074 (syms_of_font): Remove initialization and staticpro.
10075 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10076 * keymap.c (Faccessible_keymaps): Likewise.
10077
2e2d2a13
LL
100782012-07-15 Leo Liu <sdl.web@gmail.com>
10079
10080 * fringe.c: Fix typo in comments.
10081
cd276f6e
LL
100822012-07-14 Leo Liu <sdl.web@gmail.com>
10083
10084 * fringe.c: Add a new bitmap exclamation-mark.
10085
5a1131d9
EZ
100862012-07-14 Eli Zaretskii <eliz@gnu.org>
10087
10088 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10089
10090 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10091 (HAVE_MENUS): Don't define, defined by editing config.in with
10092 msdos/sed2v2.inp.
10093 (GMALLOC_INHIBIT_VALLOC): Don't define.
10094 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10095
22e983b7
JB
100962012-07-14 Juanma Barranquero <lekktu@gmail.com>
10097
10098 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10099
5b3f250f
GM
101002012-07-14 Glenn Morris <rgm@gnu.org>
10101
10102 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10103 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10104 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10105
33d63ff4
GM
101062012-07-13 Glenn Morris <rgm@gnu.org>
10107
5b633342
GM
10108 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10109
33d63ff4
GM
10110 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10111 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10112
b55b9f85
JD
101132012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10114
0dc8cf50
JD
10115 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10116 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10117 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10118 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10119 where appropriate.
10120 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10121 as boolean expression.
10122 (x_set_window_size): Remove unused variable toolbar.
10123 (ns_get_color_default, ns_mod_to_lisp): Remove.
10124 (ns_mouse_position): Remove unused variables xchar and ychar.
10125 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10126 (ns_set_vertical_scroll_bar): Remove unused variable count.
10127 (ns_delete_terminal): Remove unused variable i.
10128 (ns_term_init): Remove unused variables r, g and b.
10129 (mouseDown): Remove unused variable window.
10130 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10131 (initFrameFromEmacs): Remove unused variable vbextra.
10132 (mouseEntered): Remove unused variables p and dpyinfo.
10133 (mouseExited): Remove unused variables p and r.
10134 (ns_define_frame_cursor, ns_clear_frame_area)
10135 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10136 (menuDown): Assign [sender tag] to variable and cast the variable.
10137
10138 * nsterm.h (menuDown): Add id as type to argument sender.
10139 (ns_display_info_for_name): Add Lisp_Object argument.
10140 (ns_term_init): Add Lisp_Object argument.
10141 (ns_map_event_to_object): Add void argument.
10142 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10143 prototype with arguments and only declare if __OBJC__.
10144 (nxatoms_of_nsselect): Add void argument.
10145 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10146 (ns_alloc_autorelease_pool): Add void argument.
10147 (ns_release_autorelease_pool): Add void* argument.
10148 (ns_get_defaults_value): Add const char* argument.
10149
10150 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10151 (initFromContents): Use SSDATA where appropriate.
10152 (ns_update_menubar): Add braces to ambigous if-else.
10153 (initWithTitle): Put () around assignment in if statement.
10154 (ns_menu_show): Remove unused variables window and keymap.
10155 (update_frame_tool_bar): Remove unused variable selected_p.
10156 (initWithContentRect): Remove unused variable this_cmd_name.
10157
10158 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10159 appropriate.
10160 (setXBMColor): Remove unused variable len.
10161 (setPixmapData): Put () around assignment in loop statement.
10162
10163 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10164 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10165 where appropriate.
10166 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10167 around assignment in loop statement.
10168 (nsfont_open): Remove unused variable i.
10169 (nsfont_open): Remove unused variable len.
10170 (nsfont_draw): Remove unused variable cs.
10171
10172 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10173 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10174 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10175 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10176 (Fns_font_name, Fns_perform_service)
10177 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10178 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10179 (ns_set_name): Remove unused variable view.
10180 (x_set_menu_bar_lines): Remove unused variable olines.
10181 (x_set_tool_bar_lines): Remove unused variable root_window.
10182 (Fns_list_colors): Put () around assignment in while statement.
10183 (Fns_perform_service): Remove unused variable len.
10184 (Fns_display_usable_bounds): Remove unused variable top.
10185 (syms_of_nsfns): Remove unused variable i.
10186
b55b9f85
JD
10187 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10188 memcpy (Bug#11907).
10189
ed9265fc 101902012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
10191
10192 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10193 and free it with DestroyExceptionInfo (Bug#11558).
10194
ef099b57
JB
101952012-07-13 Juanma Barranquero <lekktu@gmail.com>
10196
10197 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10198 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10199 Set here, not in nt/config.nt.
10200
ea814a5d
EZ
102012012-07-13 Eli Zaretskii <eliz@gnu.org>
10202
10203 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10204 cursor overflow into the last glyph on display line when the right
10205 fringe is off. (Bug#11832)
10206
1a952767
PE
102072012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10208
10209 * xdisp.c (produce_special_glyphs): Now static.
10210 * dispextern.h (produce_special_glyphs): Remove decl.
10211
983188fd
GM
102122012-07-13 Glenn Morris <rgm@gnu.org>
10213
8d7c7eed 10214 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
10215 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10216
983188fd
GM
10217 * s/usg5-4-common.h (USG, USG5):
10218 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10219 * s/sol2-6.h (SOLARIS2):
10220 * s/irix6-5.h (IRIX6_5):
10221 * s/hpux10-20.h (USG, USG5, HPUX):
10222 * s/gnu-linux.h (USG, GNU_LINUX):
10223 * s/freebsd.h (BSD_SYSTEM):
10224 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10225 * s/cygwin.h (CYGWIN):
10226 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10227 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10228
d1e68667 102292012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
10230
10231 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 10232
6de0e799
GM
102332012-07-13 Glenn Morris <rgm@gnu.org>
10234
739ae010
GM
10235 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10236
dbee5793
GM
10237 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10238
6de0e799
GM
10239 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10240 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10241
b82da769
GM
102422012-07-12 Glenn Morris <rgm@gnu.org>
10243
4fae5a7a 10244 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
10245
10246 * process.c (init_process_emacs): Rename from init_process.
10247 The old name is also the name of a Mach system call.
10248 * lisp.h, emacs.c: Update for this name change.
10249 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10250 longer needed.
10251
5a979817
EZ
102522012-07-12 Eli Zaretskii <eliz@gnu.org>
10253
10254 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10255 memmove call that removes glyphs covered by the left truncation
10256 glyph. Improve commentary.
10257 (display_line): Fix display of continuation glyphs on GUI frames
10258 when the right fringe is turned off and variable-size fonts are
10259 used in the window. Move the code that appends a stretch glyph to
10260 produce_special_glyphs, so that it could be used for truncation
10261 and continuation glyphs alike.
10262 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10263 glyph of a suitably computed width, to align the special glyphs at
10264 the window margin. Code moved from display_line. (Bug#11832)
10265
3e91a053
GM
102662012-07-12 Glenn Morris <rgm@gnu.org>
10267
ba9e4b84
GM
10268 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10269
10270 * s/gnu-linux.h, s/hpux10-20.h:
10271 Do not unconditionally define HAVE_XRMSETDATABASE.
10272
3e91a053
GM
10273 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10274
b300b1f4
PE
102752012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10276
10277 Fix typos that broke OS X build.
10278 Reported by Randal L. Schwartz in
10279 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10280 * nsterm.m (ns_timeout): Add missing local decl.
10281 (ns_get_color): snprintf -> sprintf, to fix typo.
10282
6e777848
GM
102832012-07-12 Glenn Morris <rgm@gnu.org>
10284
3f922c37
GM
10285 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10286 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10287 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10288 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10289
0ab7b23a
GM
10290 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10291 Move PTY_OPEN to configure.
10292
6e777848
GM
10293 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10294 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10295 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10296
4a7edc24
DA
102972012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10298
10299 Use empty_unibyte_string where applicable.
10300 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10301 * lread.c (read1): Likewise.
10302 * xsettings.c (syms_of_xsettings): Likewise.
10303
308aab79
GM
103042012-07-12 Glenn Morris <rgm@gnu.org>
10305
42bd1719
GM
10306 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10307 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
10308 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10309 * s/hpux10-20.h (RUN_TIME_REMAP):
10310 * s/bsd-common.h (TABDLY): Move to configure.
10311
10312 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10313
10314 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10315
ea0bbd17 10316 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 10317 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
10318
10319 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 10320
308aab79
GM
10321 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10322 * s/template.h: Move NARROWPROTO to configure.
10323
ee1cf5cf
GM
103242012-07-11 Glenn Morris <rgm@gnu.org>
10325
30fe9bf4
GM
10326 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10327 unused since 2011-01-17 change to systty.h.
10328
ee1cf5cf
GM
10329 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10330 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10331 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10332
63e47e07
PE
103332012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10334
10335 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10336
c43fb4c3
GM
103372012-07-11 Glenn Morris <rgm@gnu.org>
10338
10339 * s/darwin.h, s/gnu-linux.h, s/template.h:
10340 Move INTERRUPT_INPUT to configure.
10341
e8df9267
DA
103422012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10343
10344 Minor adjustments to interning code.
10345 * lisp.h (intern, intern_c_string): Redefine as static inline
10346 wrappers for intern_1 and intern_c_string_1, respectively.
10347 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
10348 * lread.c (intern_1, intern_c_string_1, oblookup):
10349 Simplify Vobarray checking.
e8df9267
DA
10350 * font.c (font_intern_prop): Likewise. Adjust comment.
10351 * w32font.c (intern_font_name): Likewise.
10352
34348bd4
AS
103532012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10354
d96a1e0c
AS
10355 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10356
34348bd4
AS
10357 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10358 of Fcar/Fcdr if possible.
10359 * font.c (check_otf_features): Likewise.
10360 * fontset.c (Fnew_fontset): Likewise.
10361 * gnutls.c (Fgnutls_boot): Likewise.
10362 * minibuf.c (read_minibuf): Likewise.
10363 * msdos.c (IT_set_frame_parameters): Likewise.
10364 * xmenu.c (Fx_popup_dialog): Likewise.
10365 * w32menu.c (Fx_popup_dialog): Likewise.
10366
c8add24e
GM
103672012-07-11 Glenn Morris <rgm@gnu.org>
10368
4b575b3c
GM
10369 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10370 since nothing has defined it on these platforms.
10371
09f4e3b0
GM
10372 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10373 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10374
172bedef
GM
10375 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10376 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10377 Move CLASH_DETECTION to configure.
10378
249685df
GM
10379 * s/gnu.h: Remove file, which is now empty.
10380
c8add24e
GM
10381 * s/gnu.h, s/gnu-linux.h:
10382 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10383
b41253a3
JW
103842012-07-11 John Wiegley <johnw@newartisans.com>
10385
10386 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10387 function attribute, so we only use it if it exists in the
10388 compiler.
10389
d923b542
DA
103902012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10391
10392 Avoid call to strlen in fast_c_string_match_ignore_case.
10393 * search.c (fast_c_string_match_ignore_case): Change to use
10394 length argument. Adjust users accordingly.
10395 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10396
5ebbef1d
PE
103972012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10398
bb352260
PE
10399 Assume mkdir, rmdir.
10400 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10401 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10402
57054ddd
PE
10403 Assume rename.
10404 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10405
b747d3f7
PE
10406 Assume perror.
10407 * s/hpux10-20.h (HAVE_PERROR): Remove.
10408 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10409 Remove dummy definition, as this problem was obsolete long ago.
10410
5ebbef1d
PE
10411 Assume strerror.
10412 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10413
984e7f30
DA
104142012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10415
10416 Avoid calls to strlen in font processing functions.
10417 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
10418 (font_open_by_name): Change to use length argument.
10419 Adjust users accordingly.
d923b542
DA
10420 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10421 Adjust prototypes.
10422 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10423 Change to return ptrdiff_t.
984e7f30
DA
10424 (xfont_list_pattern, xfont_match): Use length returned by
10425 xfont_decode_coding_xlfd.
10426 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10427
20e94fdd
GM
104282012-07-11 Glenn Morris <rgm@gnu.org>
10429
9d596af3
GM
10430 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10431 Move DONT_REOPEN_PTY to configure.
10432
20e94fdd
GM
10433 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10434 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10435
e99a530f
PE
104362012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10437
22ffb973
PE
10438 Remove "#define unix" that is no longer needed (Bug#11905).
10439 * s/aix4-2.h (unix): Remove; no longer needed.
10440
e9a9ae03
PE
10441 EMACS_TIME simplification (Bug#11875).
10442 This replaces macros (which typically do not work in GDB)
10443 with functions, typedefs and enums, making the code easier to debug.
10444 The functional style also makes code easier to read and maintain.
10445 * systime.h: Include <sys/time.h> on all hosts, not just if
10446 WINDOWSNT, since 'struct timeval' is needed in general.
10447 (EMACS_TIME): Now a typedef, not a macro.
10448 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10449 not macros.
10450 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10451 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10452 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10453 (EMACS_TIME_LE): Now functions, not macros.
10454 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10455 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10456 which are not functions. All uses rewritten to use:
10457 (make_emacs_time): New function.
10458 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10459 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10460 not functions. All uses rewritten to use the following, respectively:
10461 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10462 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 10463 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
10464 * fileio.c (Fcopy_file):
10465 * xterm.c (XTflash): Get the current time closer to when it's used.
10466 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10467
ffacb126
PE
10468 * bytecode.c (targets): Suppress -Woverride-init warnings.
10469
e99a530f
PE
10470 Simplify by avoiding confusing use of strncpy etc.
10471 * doc.c (Fsnarf_documentation):
10472 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10473 * frame.c (Fmake_terminal_frame):
10474 * gtkutil.c (get_utf8_string):
10475 * lread.c (openp):
10476 * nsmenu.m (ns_update_menubar):
10477 * regex.c (regerror):
10478 Prefer memcpy to strncpy and strncat when either will do.
10479 * fileio.c (Fsubstitute_in_file_name):
10480 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10481 (menu_separator_name_p):
10482 * nsmenu.m (ns_update_menubar):
10483 Prefer memcmp to strncmp when either will do.
10484 * nsterm.m: Include <ftoastr.h>.
10485 (ns_get_color):
10486 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10487 Prefer snprintf to strncpy.
10488 * nsterm.m (ns_term_init):
10489 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10490 * nsterm.m (ns_term_init):
10491 Avoid the need for strncpy, by using build_string or
10492 make_unibyte_string directly. Use dtoastr, not snprintf.
10493 * process.c (Fmake_network_process): Diagnose service names that
10494 are too long, rather than silently truncating them or creating
10495 non-null-terminated names.
10496 (Fnetwork_interface_info): Likewise, for interface names.
10497 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10498 Prefer sprintf to strncat.
10499 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10500 Prefer vsnprintf to vsprintf + strncpy.
10501
c59592b3
GM
105022012-07-10 Glenn Morris <rgm@gnu.org>
10503
10504 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10505 Clarify fallback case.
10506
7d7bbefd
DA
105072012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10508
10509 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10510 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10511 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 10512 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
10513 where argument type is known to be a Lisp_Cons.
10514
3a4c8000
TT
105152012-07-10 Tom Tromey <tromey@redhat.com>
10516
10517 * bytecode.c (BYTE_CODE_THREADED): New macro.
10518 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10519 (enum byte_code_op): New type.
10520 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10521 (exec_byte_code): Use them. Use token threading when applicable.
10522
2a0213a6
DA
105232012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10524
10525 Optimize pure C strings initialization.
10526 * lisp.h (make_pure_string): Fix prototype.
10527 (build_pure_c_string): New function, defined as static inline. This
10528 provides a better opportunity to optimize away calls to strlen when
10529 the function is called with compile-time constant argument.
10530 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10531 argument, adjust users accordingly. Use build_pure_c_string where
10532 appropriate.
10533 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10534 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10535 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10536
cb1caeaf
DA
105372012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10538
10539 Avoid calls to strlen in miscellaneous functions.
10540 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10541 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10542 * lread.c (openp): Likewise.
10543
c293e30c
DA
105442012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10545
10546 Avoid calls to strlen in path processing functions.
10547 * fileio.c (file_name_as_directory): Add comment. Change to add
10548 srclen argument and return the length of result. Adjust users
10549 accordingly.
10550 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
10551 swap 1st and 2nd arguments to obey the common convention.
10552 Adjust users accordingly.
c293e30c
DA
10553 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10554
9e059e3f
GM
105552012-07-10 Glenn Morris <rgm@gnu.org>
10556
d02eb359
GM
10557 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10558 Move PENDING_OUTPUT_COUNT definition to configure.
10559
882cf227
GM
10560 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10561 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10562 * s/gnu.h (DATA_START): Move definitions to configure.
10563
af6e839f
GM
10564 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10565 We include usg5-4-common.h, which defines them both.
10566
40289a12
GM
10567 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10568 O_RDONLY already includes it).
10569
9e059e3f
GM
10570 Stop ns builds setting the EMACSLOADPATH environment variable.
10571 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10572 Now it does not set EMACSLOADPATH, just returns the load-path string.
10573 * nsterm.h: Update accordingly.
10574 * lread.c [HAVE_NS]: Include nsterm.h.
10575 (init_lread) [HAVE_NS]: Use ns_load_path.
10576 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10577
7c4e8ec0
GM
105782012-07-09 Glenn Morris <rgm@gnu.org>
10579
d4f600ff
GM
10580 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10581 since the included bsd-common.h does so.
10582
cbb31951
GM
10583 Stop ns builds setting the EMACSPATH environment variable.
10584 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10585 (ns_init_paths): Do not set EMACSPATH.
10586 * nsterm.h (ns_exec_path): Add it.
10587 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10588 Use ns_exec_path.
10589
7c4e8ec0
GM
10590 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10591
26bccfae
PE
105922012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10593
a0bee46f
PE
10594 * process.c (wait_reading_process_output): 'waitchannels' was unset
10595 when read_kbd || !NILP (wait_for_cell); fix this.
10596
5994c183
PE
10597 Add GCC-style 'const' attribute to functions that can use it.
10598 * character.h (char_resolve_modifier_mask):
10599 * keyboard.h (make_ctrl_char):
10600 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10601 (init_character_once, next_almost_prime, init_fns, init_image)
10602 (flush_pending_output, init_sound):
10603 * mem-limits.h (start_of_data):
10604 * menu.h (finish_menu_items):
10605 Add ATTRIBUTE_CONST.
10606 * emacs.c (DEFINE_DUMMY_FUNCTION):
10607 Declare the dummy function with ATTRIBUTE_CONST.
10608 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10609 Add decls with ATTRIBUTE_CONST.
10610
26bccfae
PE
10611 Minor improvements to make_formatted_string.
10612 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10613 where int is good enough, as vsprintf returns an int.
10614 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10615
a8290ec3
DA
106162012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10617
10618 Use make_formatted_string to avoid double length calculation.
10619 * lisp.h (make_formatted_string): New prototype.
10620 * alloc.c (make_formatted_string): New function.
10621 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 10622 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
10623 * editfns.c (Fcurrent_time_zone): Likewise.
10624 * filelock.c (get_boot_time): Likewise.
10625 * frame.c (make_terminal_frame, set_term_frame_name)
10626 (x_report_frame_params): Likewise.
10627 * image.c (gs_load): Likewise.
10628 * minibuf.c (get_minibuffer): Likewise.
10629 * msdos.c (dos_set_window_size): Likewise.
10630 * process.c (make_process): Likewise.
10631 * xdisp.c (ensure_echo_area_buffers): Likewise.
10632 * xsettings.c (apply_xft_settings): Likewise.
10633
d01ba2f1
GM
106342012-07-09 Glenn Morris <rgm@gnu.org>
10635
10636 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10637 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10638 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10639 * nsterm.h (ns_etc_directory): Add it.
10640 * callproc.c [HAVE_NS]: Include nsterm.h.
10641 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10642
f1f924b6
DA
106432012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10644
10645 Move marker debugging code under MARKER_DEBUG.
10646 * marker.c (MARKER_DEBUG): Move marker debugging code under
10647 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10648 for bootstrap with --enable-checking (~3x slowdown reported
10649 by Juanma Barranquero <lekktu@gmail.com>).
10650 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10651
ab531b66
PE
106522012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10653
10654 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10655 See <http://bugs.gnu.org/11825#29>.
10656
c4b3bc8a
EZ
106572012-07-08 Eli Zaretskii <eliz@gnu.org>
10658
10659 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10660 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
10661 (display_line): Add commentary about displaying truncation glyphs
10662 on GUI frames.
10663 (produce_special_glyphs): Move here from term.c.
10664
10665 * term.c (produce_special_glyphs): Move to xdisp.c.
10666
10667 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10668 section.
c4b3bc8a 10669
b676b881
AS
106702012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10671
f17c5273
AS
10672 * xdisp.c (display_line): Avoid warning about implicit declaration
10673 of FRAME_FONT.
10674
298819b9
AS
10675 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10676
b676b881
AS
10677 * lisp.h: Remove empty conditional.
10678
6045c4fd
PE
106792012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10680
b3350bf9
PE
10681 * lread.c (load_path_check): Now static.
10682
6045c4fd
PE
10683 Fix some minor --with-ns problems found by static checking.
10684 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10685 (x_set_font) [!HAVE_X_WINDOWS]:
10686 * image.c (xpm_load_image) [HAVE_NS]:
10687 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10688 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10689 Remove unused local.
10690 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10691 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10692 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10693 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10694 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10695 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10696 Fix pointer signedness problem.
10697 * xfaces.c (FRAME_X_FONT_TABLE):
10698 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10699
929e7845
GM
107002012-07-07 Glenn Morris <rgm@gnu.org>
10701
10702 * lread.c (load_path_check): New function, split from init_lread.
10703 (init_lread): Reorganize. Motivation:
10704 If EMACSLOADPATH is set, check/warn about that rather than the
10705 defaults, which we are not going to use. Hence we can remove
10706 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10707 Don't warn if site-lisp directories are missing.
10708 If not installed, start from a blank load-path, since
10709 PATH_LOADSEARCH refers to the eventual installation directories.
10710
58dd0aa4
EZ
107112012-07-07 Eli Zaretskii <eliz@gnu.org>
10712
10713 Support truncation and continuation glyphs on GUI frames, when
10714 fringes are disabled. (Bug#11832)
10715 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
10716 continuation glyphs even if on GUI frames.
10717 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
10718 or both, are absent.
10719 (start_display, move_it_in_display_line_to): Handle the case of a
10720 GUI frame without a fringe to display continuation or truncation
10721 glyphs.
10722 (insert_left_trunc_glyphs): Support GUI frames: make sure
10723 truncation glyphs overwrite enough glyphs from the current line to
10724 have sufficient space in pixels.
10725 (display_line): Support truncation and continuation glyphs on GUI
10726 frames. If some spare pixels are left on the line after inserting
10727 the truncation glyphs, fill that space with a stretch glyph of a
10728 suitably computed width.
10729
10730 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10731 produce_glyphs, to support GUI sessions.
10732
31571fd7
PE
107332012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10734
5a16b9bc
PE
10735 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10736
f3047c75
PE
10737 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10738
31571fd7
PE
10739 Do not require float-time's arg to fit in time_t (Bug#11825).
10740 This works better on hosts where time_t is unsigned, and where
10741 float-time is applied to the (negative) difference between two times.
10742 * editfns.c (decode_time_components): Last arg is now double *,
10743 not int *, and means to store all the result as a double, without
10744 worrying about whether the seconds part fits in time_t.
10745 All callers changed.
10746 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10747 All callers changed.
10748 (Ffloat_time): Do not fail merely because the specified time falls
10749 outside of time_t range.
10750
4516fbef
GM
107512012-07-07 Glenn Morris <rgm@gnu.org>
10752
10753 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10754 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10755 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10756
07adc2c6
JB
107572012-07-07 Juanma Barranquero <lekktu@gmail.com>
10758
10759 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10760 Update dependencies.
10761
10762 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10763
fd573f31
PE
107642012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10765
fee5959d
PE
10766 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10767 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10768 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10769 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10770 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10771 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10772
fd573f31
PE
10773 * xfont.c (compare_font_names): Redo to omit the need for casts.
10774
ddadbc0e
AS
107752012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10776
fca8d6b6
AS
10777 * xfns.c (Fx_change_window_property): Doc fix.
10778 * w32fns.c (Fx_change_window_property): Doc fix.
10779
ddadbc0e
AS
10780 * w32fns.c (Fx_window_property): Accept the same arguments as the
10781 X Windows version. Doc fix.
10782 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10783
ed9265fc 107842012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
10785 Eli Zaretskii <eliz@gnu.org>
10786
10787 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10788 Windows-specific code from nt/config.nt moved here.
10789 Obsolete settings removed.
10790
216ee680
PE
107912012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10792
10793 * process.c: Avoid unnecessary calls to gettime.
10794 (wait_reading_process_output): Don't get the time of day
10795 when gobbling data immediately and not waiting, as there's no need
10796 for it in that case. This removes a FIXME.
10797
bdd091e4
JD
107982012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10799
10800 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10801 is defined (Bug#11768).
10802
9d44f8ce
DA
108032012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10804
10805 Fix marker debugging code.
10806 * marker.c (byte_char_debug_check): Do not perform the check
10807 if buffer is not multibyte.
090bd7cb
JB
10808 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10809 Call byte_char_debug_check with correct arguments.
9d44f8ce 10810
90fc4786
DA
108112012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10812
10813 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
10814 * marker.c (byte_char_debug_check, count_markers):
10815 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
10816 (byte_debug_flag): Remove.
10817 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10818 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10819
7b7ae965
DA
108202012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10821
4e57b342
DA
10822 Avoid code repetition in marker-related functions.
10823 * marker.c (attach_marker): New function.
10824 (Fset_marker, set_marker_restricted, set_marker_both)
10825 (set_marker_restricted_both): Use it.
10826 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10827 Consistently rename charno to charpos.
10828 (marker_position): Add eassert.
10829 (marker_byte_position): Convert to eassert.
10830
108312012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10832
10833 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 10834 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 10835 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 10836
657924ff
DA
108372012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10838
10839 Introduce fast path for the widely used marker operation.
10840 * alloc.c (build_marker): New function.
10841 * lisp.h (build_marker): New prototype.
10842 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10843 * composite.c (autocmp_chars): Likewise.
10844 * editfns.c (buildmark): Remove.
10845 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10846 (save_restriction_save): Use build_marker.
10847 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10848 * window.c (save_window_save): Likewise.
10849
041a49a6
DA
108502012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10851
10852 Do not use Fdelete_overlay in delete_all_overlays
10853 to avoid redundant calls to unchain_overlay.
10854 * buffer.c (drop_overlay): New function.
10855 (delete_all_overlays, Fdelete_overlay): Use it.
10856 * minibuf.c (get_minibuffer): Fix comment.
10857
7dca65a4
PE
108582012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10859
10860 Port to OpenBSD 5.1 amd64.
10861 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10862 This is needed for OpenBSD, and should be harmless on all BSD systems.
10863 Also, include <sys/sysctl.h>, as it should be available on all
10864 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10865 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10866 use p_pid member, not kp_proc.pid.
10867
8eb876e2
GM
108682012-07-06 Glenn Morris <rgm@gnu.org>
10869
10870 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10871
38182d90
PE
108722012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10873
10874 More xmalloc and related cleanup.
10875 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10876 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10877 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10878 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10879 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10880 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10881 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10882 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10883 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10884 * xterm.c:
10885 Omit needless casts involving void * pointers and allocation.
10886 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10887 as the former is more robust if P's type is changed.
10888 Prefer xzalloc to xmalloc + memset 0.
10889 Simplify malloc-or-realloc to realloc.
10890 Don't worry about xmalloc returning a null pointer.
10891 Prefer xstrdup to xmalloc + strcpy.
10892 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10893 growing it.
10894 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10895 alloca of a constant.
10896
6dd5a677
EZ
108972012-07-05 Eli Zaretskii <eliz@gnu.org>
10898
10899 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10900 hscroll is larger than the line width. Fixes long and futile
10901 looping inside extend_face_to_end_of_line (on a TTY) producing
10902 glyphs that are not needed and thrown away.
10903
6b312f0f
DA
109042012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10905
10906 * marker.c (set_marker_restricted_both): Simplify by using
10907 clip_to_bounds.
10908
f520ef9b
PE
109092012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10910
10911 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10912
383b7c95
JD
109132012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10914
10915 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10916 not defined (Bug#11768).
10917 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10918 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10919 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10920 followed by gtk_box_set_homogeneous (Bug#11768).
10921 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
10922 (update_theme_scrollbar_width, xg_create_scroll_bar):
10923 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
10924 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10925 (is_box_type): New function (Bug#11768).
10926 (xg_tool_item_stale_p): Call is_box_type.
5293d758 10927 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
10928 with default display (Bug#11768).
10929
d6e7bf45
EZ
109302012-07-05 Eli Zaretskii <eliz@gnu.org>
10931
10932 * xdisp.c (window_hscroll_limited): New function.
10933 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10934 coordinates when window's hscroll is set to insanely large
10935 values. (Bug#11857)
10936
431391ec
JB
109372012-07-05 Juanma Barranquero <lekktu@gmail.com>
10938
10939 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10940 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10941
23f86fce
DA
109422012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10943
10944 Cleanup xmalloc.
10945 * lisp.h (xzalloc): New prototype. Omit needless casts.
10946 * alloc.c (xzalloc): New function. Omit needless casts.
10947 * charset.c: Omit needless casts. Convert all calls to
10948 xmalloc with following memset to xzalloc.
10949 * dispnew.c: Likewise.
10950 * fringe.c: Likewise.
10951 * image.c: Likewise.
10952 * sound.c: Likewise.
10953 * term.c: Likewise.
10954 * w32fns.c: Likewise.
10955 * w32font.c: Likewise.
10956 * w32term.c: Likewise.
10957 * xfaces.c: Likewise.
10958 * xfns.c: Likewise.
10959 * xterm.c: Likewise.
10960 * atimer.c: Omit needless casts.
10961 * buffer.c: Likewise.
10962 * callproc.c: Likewise.
10963 * ccl.c: Likewise.
10964 * coding.c: Likewise.
10965 * composite.c: Likewise.
10966 * doc.c: Likewise.
10967 * doprnt.c: Likewise.
10968 * editfns.c: Likewise.
10969 * emacs.c: Likewise.
10970 * eval.c: Likewise.
10971 * filelock.c: Likewise.
10972 * fns.c: Likewise.
10973 * gtkutil.c: Likewise.
10974 * keyboard.c: Likewise.
10975 * lisp.h: Likewise.
10976 * lread.c: Likewise.
10977 * minibuf.c: Likewise.
10978 * msdos.c: Likewise.
10979 * print.c: Likewise.
10980 * process.c: Likewise.
10981 * region-cache.c: Likewise.
10982 * search.c: Likewise.
10983 * sysdep.c: Likewise.
10984 * termcap.c: Likewise.
10985 * terminal.c: Likewise.
10986 * tparam.c: Likewise.
10987 * w16select.c: Likewise.
10988 * w32.c: Likewise.
10989 * w32reg.c: Likewise.
10990 * w32select.c: Likewise.
10991 * w32uniscribe.c: Likewise.
10992 * widget.c: Likewise.
10993 * xdisp.c: Likewise.
10994 * xmenu.c: Likewise.
10995 * xrdb.c: Likewise.
10996 * xselect.c: Likewise.
10997
0497dc44
PE
109982012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10999
11000 * fileio.c (time_error_value): Check the right error number.
11001 Problem reported by Troels Nielsen in
11002 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11003
356e7178
PE
110042012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11005
4e71fd89
PE
11006 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11007 This should be fixed in a better way; see Eli Zaretskii in
11008 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11009 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11010
f0941253
PE
11011 * fileio.c (time_error_value): Rename from special_mtime.
11012 The old name's problems were noted by Eli Zaretskii in
11013 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11014
065c9eb4
PE
11015 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11016 This variable's comment says Emacs needs at least one GDB-visible
11017 symbol of type enum pvec_type, to work around GDB problems.
11018 The symbol's value doesn't matter.
11019
356e7178
PE
11020 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11021 that causes compilation to fail on pre-C99 compilers.
11022
ed9265fc 110232012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
11024
11025 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11026 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11027
3884d954
DA
110282012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11029
d209e2fb 11030 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
11031 headers for buffer_defaults and buffer_local_symbols.
11032 Reported by Juanma Barranquero <lekktu@gmail.com>.
11033
ee28be33
SM
110342012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11035
11036 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11037 * lisp.h (enum pvec_type): Use fewer bits.
11038 (PSEUDOVECTOR_SIZE_BITS): New constant.
11039 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11040 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11041 change in pvec_type.
11042 (PSEUDOVECTOR_TYPEP): New macro.
11043 (TYPED_PSEUDOVECTORP): Use it.
11044 * fns.c (internal_equal): Adapt code to extract pvectype.
11045 * emacs.c (gdb_pvec_type): Update type.
11046 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11047 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11048 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11049 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11050 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11051 abusing vector->header.next.nbytes.
11052 (live_vector_p): Use PVEC_TYPE.
11053 (mark_object): Adapt code to extract pvectype. Use switch.
11054
c7f2cd7f
PE
110552012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11056
11057 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11058 Tighten new eassert a bit.
11059
8ce70ed2
DA
110602012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11061
11062 Fix compilation with --enable-gcc-warnings and -O1
11063 optimization level.
11064 * doprnt.c (doprnt): Change type of tem to int, initialize
11065 to avoid compiler warning. Add eassert.
11066 * search.c (simple_search): Initialize match_byte to avoid
11067 compiler warning. Add eassert.
11068
dea7f1e5
PE
110692012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11070
24a212eb
PE
11071 Avoid weird behavior with large horizontal scrolls.
11072 Without this change, for example, large hscroll values would
11073 mess up Emacs's display on Fedora 15 x86, presumably due to
11074 overflows in int calculations in the display code.
11075 Also, if buffers had long lines, Emacs would freeze.
11076 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11077 (set_window_hscroll): New function, containing the old guts of
11078 Fset_window_hscroll. Return the clipped value.
11079 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11080 This avoids the need to check against PTRDIFF_MAX.
11081
dea7f1e5
PE
11082 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11083
76046526
DA
110842012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11085
11086 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11087
39adff0d
PE
110882012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11089
63807d47
PE
11090 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11091 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11092 since GCC 4.4.6 issues a bogus warning for them.
11093
39adff0d
PE
11094 Fix bugs in file timestamp newness comparisons.
11095 * fileio.c (Ffile_newer_than_file_p):
11096 * lread.c (Fload): Use full timestamp resolution of files,
11097 not just the 1-second resolution, so that files that are only
11098 slightly newer still count as newer.
11099 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11100 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11101
dbeed9a6
PE
111022012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11103
11104 * fileio.c: Improve handling of file time marker. (Bug#11852)
11105 (special_mtime): New function.
11106 (Finsert_file_contents, Fverify_visited_file_modtime):
11107 Use it to set special mtime values consistently.
11108
636334d6
AS
111092012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11110
11111 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11112 marker for non-existing file. (Bug#11852)
11113
e2017fe2
GM
111142012-07-03 Glenn Morris <rgm@gnu.org>
11115
11116 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11117 and did not make it into globals.h).
11118
404dbd37
TT
111192012-07-03 Tom Tromey <tromey@redhat.com>
11120
11121 * window.c (Fset_window_margins, Fset_window_fringes)
11122 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11123 * textprop.c (Fprevious_property_change): No longer static.
11124 * syntax.c (Fsyntax_table_p): No longer static.
11125 * process.c (Fget_process, Fprocess_datagram_address): No longer
11126 static.
11127 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11128 * keyboard.c (Fcommand_execute): No longer static.
11129 Remove EXFUN.
11130 * insdel.c (Fcombine_after_change_execute): No longer static.
11131 * image.c (Finit_image_library): No longer static.
11132 * fileio.c (Fmake_symbolic_link): No longer static.
11133 * eval.c (Ffetch_bytecode): No longer static.
11134 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
11135 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11136 No longer static.
404dbd37
TT
11137 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11138 static.
11139 * dired.c (Ffile_attributes): No longer static.
11140 * composite.c (Fcomposition_get_gstring): No longer static.
11141 * callproc.c (Fgetenv_internal): No longer static.
11142
11143 * ccl.h: Remove EXFUNs.
11144 * buffer.h: Remove EXFUNs.
11145 * dispextern.h: Remove EXFUNs.
11146 * intervals.h: Remove EXFUNs.
11147 * fontset.h: Remove EXFUN.
11148 * font.h: Remove EXFUNs.
11149 * dosfns.c (system_process_attributes): Remove EXFUN.
11150 * keymap.h: Remove EXFUNs.
11151 * lisp.h: Remove EXFUNs.
11152 * w32term.h: Remove EXFUNs.
11153 * window.h: Remove EXFUNs.
11154 * xsettings.h: Remove EXFUN.
11155 * xterm.h: Remove EXFUN.
11156
8e4fd1e1
GM
111572012-07-03 Glenn Morris <rgm@gnu.org>
11158
11159 * lisp.h (Frandom): Make it visible to C.
11160 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11161 buffer for invisible buffers. (Bug#1229)
11162
ca95b3eb
DA
111632012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11164
11165 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11166 values which aren't power of 2.
14ae4239 11167 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 11168 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
11169 accordingly.
11170
7555c33f
SM
111712012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11172
11173 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11174
11175 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11176
d12e8f5a
DA
111772012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11178
11179 * alloc.c (allocate_vector_block): Remove redundant
11180 calls to mallopt if DOUG_LEA_MALLOC is defined.
11181 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11182 avoid calls to mallopt if zero_vector is returned.
11183
296094c3
DA
111842012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11185
11186 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11187 is enabled, avoid dereferencing NULL current_sblock if
11188 running undumped.
11189
36429c89
DA
111902012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11191
11192 Cleanup basic buffer management.
11193 * buffer.h (struct buffer): Change layout to use generic vector
11194 marking code. Fix some comments. Change type of 'clip_changed'
11195 to bitfield. Remove unused #ifndef old.
11196 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11197 (GET_OVERLAYS_AT): Fix indentation.
11198 (for_each_per_buffer_object_at): New macro.
11199 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11200 (Fbuffer_local_variables): Use it.
11201 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11202 * alloc.c (allocate_buffer): Adjust to match new layout of
11203 struct buffer. Fix comment.
11204 (mark_overlay): New function.
11205 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11206 Lisp area of struct buffer.
11207 (mark_object): Use it. Adjust marking of misc objects
11208 and related comments.
11209
3b3e4cac
PE
112102012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11211
11212 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11213 wrapper that is not needed because the wrapped code is a no-op (zero
11214 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11215 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11216
cf5c0175
DA
112172012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11218
11219 * alloc.c (mark_buffer): Simplify. Remove prototype.
11220 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 11221 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
11222 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11223 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 11224
ca26824c
GM
112252012-06-30 Glenn Morris <rgm@gnu.org>
11226
2e4c5312
GM
11227 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11228
ca26824c
GM
11229 * epaths.in (PATH_SITELOADSEARCH): New.
11230 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11231 This is rather than relying on --enable-locallisppath elements
11232 having "site-lisp" in their names. (Bug#10208#25, 11658)
11233
0d23c240
EZ
112342012-06-30 Eli Zaretskii <eliz@gnu.org>
11235
c9240d7a
EZ
11236 * w32proc.c (sys_select): Accept and ignore one more argument.
11237
11238 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11239
0d23c240 11240 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 11241 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
11242
11243 * sysdep.c: Don't include dos.h and dosfns.h.
11244
11245 * process.c (sys_select):
11246 * msdos.c (sys_select): Accept one more argument and ignore it.
11247
11248 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11249 adapt data types and code to that.
11250
11251 * dosfns.c:
11252 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11253 which clashes with the gnulib function of the same name.
11254
af5a5a98
AS
112552012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11256
c5e4379c
AS
11257 * font.c (font_style_to_value, font_style_symbolic)
11258 (font_prop_validate_style): Add type checks for values in
11259 font_style_table.
11260
af5a5a98
AS
11261 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11262 argument.
11263 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11264 uses.
11265
8d38f461
EZ
112662012-06-29 Eli Zaretskii <eliz@gnu.org>
11267
2e5a6631
EZ
11268 * xdisp.c (try_window_id): Undo last change.
11269
8d38f461
EZ
11270 * w32.c (getwd): Adjust commentary about startup_dir.
11271 (init_environment): Always call sys_access, even in non-MSVC
11272 builds. Don't chdir to the directory of the Emacs executable.
11273 This undoes code from 1997 which was justified by the need to
11274 "avoid conflicts when removing and renaming directories". But its
11275 downside was that every relative file name was being interpreted
11276 relative to the directory of the Emacs executable, which can never
11277 be TRT. In particular, it broke sys_access when called with
11278 relative file names.
11279 (sys_access): Map GetLastError to errno.
11280
2af3565e
DA
112812012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11282
11283 * window.h (struct window): Change type of 'fringes_outside_margins'
11284 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 11285 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
11286 Adjust comment.
11287 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11288 to ptrdiff_t.
11289
c8d3a25c 112902012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 11291
c8d3a25c
GM
11292 * gnutls.c (emacs_gnutls_handshake):
11293 Add QUIT to make the loop interruptible.
57570cd3 11294
c8d3a25c 112952012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 11296
c8d3a25c
GM
11297 * charset.c (init_charset): Make lack of etc/charsets fatal.
11298
3e984ee8
DA
112992012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11300
11301 * editfns.c (region_limit): Fix type mismatch.
11302
ef884f23
DA
113032012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11304
11305 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11306 undefined. Convert from xassert to eassert.
11307 * nsmenu.m: Convert from xassert to eassert.
11308 * nsterm.m: Likewise.
11309
7d7e0027
SM
113102012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11311
11312 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11313
aa754e6a
PE
113142012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11315
11316 Avoid integer overflow on scroll-left and scroll-right.
11317 * window.c (HSCROLL_MAX): New macro.
11318 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11319 overflow when requested scroll falls outside ptrdiff_t range.
11320
80b00b08
DA
113212012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11322
11323 * window.h (struct window): Change type of 'hscroll',
11324 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11325 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11326 Adjust users accordingly.
11327 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11328 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11329 from EMACS_INT to ptrdiff_t.
11330 (make_window): Omit redundant initialization.
11331
62b2bcf6
JB
113322012-06-28 Juanma Barranquero <lekktu@gmail.com>
11333
11334 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11335
45942c7d
DA
113362012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11337
11338 * window.h (struct window): Change type of 'use_time' and
11339 'sequence_number' from Lisp_Object to int.
11340 * frame.c (make_frame): Adjust users accordingly.
11341 * print.c (print_object): Likewise.
11342 * window.c (select_window, Fwindow_use_time, make_parent_window)
11343 (make_window): Likewise.
11344
e509cfa6
DA
113452012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11346
11347 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11348 enabled with --enable-checking=[all,glyphs] configure option.
11349 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11350 adjust comments accordingly.
11351 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11352 undefined, adjust comments accordingly.
11353 * image.c: Likewise.
11354 * scroll.c: Likewise.
11355 * w32fns.c: Likewise.
11356 * w32term.c: Likewise.
11357 * xdisp.c: Likewise.
11358 * xfaces.c: Likewise.
11359 * xfns.c: Likewise.
11360 * xterm.c: Likewise.
11361
a54e2c05
DA
113622012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11363
11364 Generalize run-time debugging checks.
11365 * dispextern.h (XASSERTS): Remove.
11366 * fontset.c (xassert): Remove.
11367 Convert from xassert to eassert.
11368 * alloc.c: Convert from xassert to eassert.
11369 * bidi.c: Likewise.
11370 * dispnew.c: Likewise.
11371 * fns.c: Likewise.
11372 * fringe.c: Likewise.
11373 * ftfont.c: Likewise.
11374 * gtkutil.c: Likewise.
11375 * image.c: Likewise.
11376 * keyboard.c: Likewise.
11377 * menu.c: Likewise.
11378 * process.c: Likewise.
11379 * scroll.c: Likewise.
11380 * sound.c: Likewise.
11381 * term.c: Likewise.
11382 * w32console.c: Likewise.
11383 * w32fns.c: Likewise.
11384 * w32term.c: Likewise.
11385 * window.c: Likewise.
11386 * xdisp.c: Likewise.
11387 * xfaces.c: Likewise.
11388 * xfns.c: Likewise.
11389 * xselect.c: Likewise.
11390 * xterm.c: Likewise.
11391
1ec4b7b2
SM
113922012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11393
11394 * fns.c (maybe_resize_hash_table): Output message when growing the
11395 purify-hashtable.
11396
2014308a
DA
113972012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11398
11399 * alloc.c (allocate_string_data): Remove dead code.
11400 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11401 avoid GCC warning about unused macro.
11402
246155eb
DA
114032012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11404
11405 * alloc.c (allocate_string): Omit intervals initialization.
11406 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11407 as in make_pure_string and make_pure_c_string.
11408
43184b7b
DA
114092012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11410
d209e2fb 11411 * alloc.c (allocate_string): Fix last change.
43184b7b 11412
3fe6dd74
DA
114132012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11414
d209e2fb 11415 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
11416 to memset, add explicit initialization where appropriate.
11417
1ba6038a
GM
114182012-06-27 Glenn Morris <rgm@gnu.org>
11419
11420 * lisp.mk (lisp): Remove paths.elc.
11421
c89926a5
CY
114222012-06-27 Chong Yidong <cyd@gnu.org>
11423
11424 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11425
ed6b3510
JW
114262012-06-26 John Wiegley <johnw@newartisans.com>
11427
1ec4b7b2 11428 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
11429 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11430
ed6b3510
JW
11431 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11432 when building with Clang.
11433
8edd4a2b
SM
114342012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11435
11436 * eval.c (Fapply): Allow calling it with a single argument.
11437
f6f62d1b
EZ
114382012-06-26 Eli Zaretskii <eliz@gnu.org>
11439
11440 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11441 _stricmp and _strnicmp.
11442 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11443
62efea5e
DA
114442012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11445
11446 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11447 allocated window.
11448 (allocate_process): Likewise for new process.
8edd4a2b 11449 (allocate_terminal): Change to use offsetof.
62efea5e
DA
11450 (allocate_frame): Likewise.
11451 * frame.c (make_frame): Omit redundant initialization.
11452 * window.c (make_parent_window): Use memset.
11453 (make_window): Omit redundant initialization.
11454 * process.c (make_process): Omit redundant initialization.
11455 * terminal.c (create_terminal): Likewise.
11456
42997f4d
DA
114572012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11458
11459 * term.c (delete_tty): Remove redundant call to memset.
11460
1130ecfc
DA
114612012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11462
11463 * alloc.c: Remove build_string.
11464 * lisp.h: Define build_string as static inline. This provides
11465 a better opportunity to optimize away calls to strlen when the
11466 function is called with compile-time constant argument.
11467 * image.c (imagemagick_error): Convert to build_string.
11468 * w32proc.c (sys_spawnve): Likewise.
11469 * xterm.c (x_term_init): Likewise.
11470
cf38a720
PE
114712012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11472
99027bdd
PE
11473 Use sprintf return value instead of invoking strlen on result.
11474 In the old days this wasn't portable, since some sprintf
11475 implementations returned char *. But they died out years ago and
11476 Emacs already assumes sprintf returns int.
11477 Similarly for float_to_string.
11478 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11479 * ccl.c (ccl_driver):
11480 * character.c (string_escape_byte8):
11481 * data.c (Fnumber_to_string):
11482 * doprnt.c (doprnt):
11483 * print.c (print_object):
11484 * xdisp.c (message_dolog):
11485 * xfns.c (syms_of_xfns):
11486 Use sprintf or float_to_string result to avoid need to call strlen.
11487 * data.c (Fnumber_to_string):
11488 Use make_unibyte_string, since the string must be ASCII.
11489 * lisp.h, print.c (float_to_string): Now returns int length.
11490 * term.c (produce_glyphless_glyph):
11491 Use sprintf result rather than recomputing it.
11492
cf38a720
PE
11493 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11494 * Makefile.in (ALL_CFLAGS):
11495 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11496 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11497
3511c784
DA
114982012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11499
0a08eb21 11500 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
11501 strcasecmp if available.
11502 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11503
fb7da12e
AS
115042012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11505
11506 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11507 Avoid comma operator.
11508 * menu.c (push_submenu_start, push_submenu_end)
11509 (push_left_right_boundary, push_menu_pane): Likewise.
11510 * msdos.c (dos_rawgetc): Likewise.
11511
afa2ffd8
DA
115122012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11513
11514 * xfns.c (xic_create_fontsetname): Remove redundant calls
11515 to memset.
11516
b3b4476b
PE
115172012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11518
4495ff38
PE
11519 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11520 sprintf already null-terminates its output.
11521
b3b4476b
PE
11522 * xfns.c (x_window): Remove redundant cast.
11523
b00876c9
DA
115242012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11525
11526 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11527 `const char *' to `char *' to avoid compiler warning.
11528
d188e26b
PE
115292012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11530
885d1d74
PE
11531 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11532 instead of truncating it to 63 (admittedly a generous limit).
11533
d188e26b
PE
11534 * process.c: Fix spelling and caps in comments.
11535
e2f560b1
DN
115362012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11537
e86db54b 11538 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
11539 * sysdep.c (setpgrp): Remove definition, not used in this file.
11540
7583a3a1
JB
115412012-06-24 Juanma Barranquero <lekktu@gmail.com>
11542
11543 * makefile.w32-in: Update dependencies.
11544
696056c2
EZ
115452012-06-24 Eli Zaretskii <eliz@gnu.org>
11546
11547 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11548 (SYSTIME_H): Add nt/inc/sys/time.h.
11549
11550 * systime.h [WINDOWSNT]: Include sys/time.h.
11551
11552 * s/ms-w32.h (struct timespec): Definition moved from
11553 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11554
845ca893
PE
115552012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11556
11557 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11558 * buffer.h (buffer_slot_type_mismatch):
11559 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11560 * eval.c (unwind_to_catch):
11561 * image.c (my_png_error, my_error_exit):
11562 * keyboard.c (quit_throw_to_read_char, user_error)
11563 (Fexit_recursive_edit, Fabort_recursive_edit):
11564 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11565 (wrong_type_argument, buffer_overflow, __executable_start)
11566 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11567 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11568 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11569 (fatal):
11570 (child_setup) [!DOS_NT]:
11571 * lread.c (end_of_file_error, invalid_syntax):
11572 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11573 * puresize.h (pure_write_error):
11574 * search.c (matcher_overflow):
11575 * sound.c (sound_perror, alsa_sound_perror):
11576 * sysdep.c, syssignal.h (croak):
11577 * term.c (maybe_fatal, vfatal):
11578 * textprop.c (text_read_only):
11579 * undo.c (user_error):
11580 * unexmacosx.c (unexec_error):
11581 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11582 Use _Noreturn rather than NO_RETURN.
11583 No need for separate decl merely because of _Noreturn.
11584 * sound.c (sound_warning, parse_sound):
11585 Remove unnecessary forward decls.
11586
f1dd8073
PE
115872012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11588
11589 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11590 * lisp.h (WAIT_READING_MAX): New macro.
11591 * dispnew.c (Fsleep_for, sit_for):
11592 * keyboard.c (kbd_buffer_get_event):
11593 * process.c (Faccept_process_output):
11594 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11595 This improves on the previous patch, which introduced a bug
11596 when time_t is unsigned and as wide as intmax_t.
11597 See <http://bugs.gnu.org/9000#51>.
11598
b82c1755
EZ
115992012-06-23 Eli Zaretskii <eliz@gnu.org>
11600
11601 * dispnew.c (sit_for, Fsleep_for):
11602 * keyboard.c (kbd_buffer_get_event):
11603 * process.c (Faccept_process_output): Avoid compiler warnings when
11604 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11605
ca300656
JB
116062012-06-23 Juanma Barranquero <lekktu@gmail.com>
11607
049ec95b
JB
11608 * makefile.w32-in: Update dependencies.
11609
ca300656
JB
11610 * w32.c (ltime): Add return type and declare static.
11611 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11612
db7b8d06
PE
116132012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11614
11615 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11616 Privately reported by Herbert J. Skuhra.
11617 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11618 All uses changed.
11619 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11620 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11621
0bd8297f
EZ
116222012-06-23 Eli Zaretskii <eliz@gnu.org>
11623
96512555
EZ
11624 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11625 last argument of make_unibyte_string.
11626
0bd8297f
EZ
11627 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11628 language ID in the event parameters.
11629
11630 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11631 event.code, not the obscure "character set ID".
11632
63def6b6
CY
116332012-06-23 Chong Yidong <cyd@gnu.org>
11634
11635 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11636
e8a02204
EZ
116372012-06-23 Eli Zaretskii <eliz@gnu.org>
11638
388cdec0
EZ
11639 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11640 * w32.c (fdutimens): New function.
11641
11642 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11643
11644 * s/ms-w32.h (pselect): Redirect to sys_select.
11645
11646 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11647
e8a02204
EZ
11648 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11649 in the logic of incrementing and decrementing the value of
11650 use_relocatable_buffers.
11651
d054f3fb
PE
116522012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11653
11654 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11655 Privately reported by Herbert J. Skuhra.
11656 [__FreeBSD__]: Remove "*/" typo after "#include".
11657 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11658 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11659 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11660 Don't assume EMACS_TIME and struct timeval are the same type.
11661
d35af63c
PE
116622012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11663
11664 Support higher-resolution time stamps (Bug#9000).
11665 The time stamps are only nanosecond-resolution at the C level,
11666 since that's the best that any real-world system supports now.
11667 But they are picosecond-resolution at the Lisp level, as that's
11668 easy, and leaves room for future OS improvements.
11669
11670 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11671 (LIBES): Use it.
11672
11673 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11674 Don't get current time unless it's needed.
11675
11676 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11677 now provides it if it's absent.
11678 (start_atimer): Port to higher-res time stamps.
11679 Check for time stamp overflow. Don't get current time more
11680 often than is needed.
11681
11682 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11683 Include systime.h, not time.h.
11684 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11685
11686 * dired.c: Include stat-time.h.
11687 (Ffile-attributes): File times now have higher resolution.
11688
11689 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11690 (struct image): Timestamp now has higher resolution.
11691
11692 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11693 has at least microseconds now. All uses removed.
11694 (update_frame, update_single_window, update_window, update_frame_1)
11695 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 11696 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
11697
11698 * editfns.c (time_overflow): Now extern.
11699 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11700 (float-time, Fformat_time_string, Fcurrent_time_string)
11701 (Fcurrent_time_zone): Accept and generate higher-resolution
11702 time stamps.
11703 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11704 (decode_time_components, lisp_seconds_argument): New functions.
11705 (make_time): Now static.
11706 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11707 Report an error if the time is invalid, rather than having the caller
11708 do that.
11709
11710 * fileio.c: Include <stat-time.h>
11711 (Fcopy_file): Copy higher-resolution time stamps.
11712 Prefer to set the time stamp via a file descriptor if that works.
11713 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11714 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11715 (Fvisited_file_modtime, Fset_visited_file_modtime):
11716 Support higher-resolution time stamps.
11717
11718 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11719
11720 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11721
11722 * image.c (prepare_image_for_display, clear_image_cache)
11723 (lookup_image): Port to higer-resolution time stamps.
11724
11725 * keyboard.c (start_polling, bind_polling_period):
11726 Check for time stamp overflow.
11727 (read_char, kbd_buffer_get_event, timer_start_idle)
11728 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11729 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11730 Port to higher-resolution time stamps. Do not assume time_t is signed.
11731 (decode_timer): New function. Timers are now vectors of length 9,
11732 not 8, to accommodate the picosecond component.
11733 (timer_check_2): Use it.
11734
11735 * nsterm.m (select_timeout, timeval_subtract): Remove.
11736 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11737 as they're a bit more accurate and handle overflow better.
11738 (ns_select): Change prototype to be compatible with pselect.
11739 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11740 * nsterm.h (ns_select): Adjust prototype.
11741
11742 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11743 us-resolution time stamps.
11744 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11745
11746 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11747
11748 * lisp.h (time_overflow): New decl.
11749 (wait_reading_process_output): First arg is now intmax_t, not int,
11750 to accommodate larger waits.
11751
11752 * process.h (struct Lisp_Process.read_output_delay):
11753 Now counts nanoseconds, not microseconds.
11754 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11755 EMACS_HAS_USECS.
11756 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11757 (wait_reading_process_output):
11758 Port to ns-resolution time stamps.
11759 (Faccept_process_output, wait_reading_process_output):
11760 Check for time stamp overflow. Do not assume time_t is signed.
11761 (select_wrapper): Remove; we now use pselect.
11762 (Fprocess_attributes): Now generates ns-resolution time stamps.
11763
11764 * sysdep.c: Include utimens.h. Don't include utime.h
11765 or worry about struct utimbuf; gnulib does that for us now.
11766 (gettimeofday): Remove; gnulib provides a substitute.
11767 (make_timeval): New function.
11768 (set_file_times): Now sets ns-resolution time stamps.
11769 New arg FD; all uses changed.
11770 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11771 (system_process_attributes):
11772 Now returns ns-resolution time stamp. All uses changed.
11773 Check for time stamp overflow.
11774
11775 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11776 provides a substitute now.
11777
11778 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11779 since it guarantees struct timespec.
11780 (EMACS_TIME): Now struct timespec, so that we can support
11781 ns-resolution time stamps.
11782 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11783 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11784 (EMACS_USECS): Remove.
11785 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11786 so multiply the arg by 1000 before storing it.
11787 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11788 New macros.
11789 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11790 Port to ns-resolution time stamps.
11791 (EMACS_TIME_NEG_P): Remove; replaced by....
11792 (EMACS_TIME_SIGN): New macro.
11793 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11794 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11795 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11796 (make_timeval, make_lisp_time, decode_time_components): New decls.
11797 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11798 that it mishandled time_t overflow. You can't compare by subtracting!
11799 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11800 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11801
11802 * term.c: Include <sys/time.h>.
11803 (timeval_to_Time): New function, for proper overflow wraparound.
11804 (term_mouse_position, term_mouse_click): Use it.
11805
11806 * undo.c (record_first_change): Support higher-resolution time stamps
11807 in the undo buffer.
11808 (Fprimitive_undo): Use them when restoring time stamps.
11809
11810 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11811 (w32_get_internal_run_time):
11812 Port to higher-resolution Emacs time stamps.
11813 (ltime): Now accepts single 64-bit integer, as that's more convenient
11814 for callers.
11815
11816 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11817
11818 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11819 for compatibility with pselect. Support ns-resolution time stamps.
11820
11821 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11822
11823 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11824 Check for time stamp overflow, and support ns-resolution time stamps.
11825
11826 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11827 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11828 (timeval_subtract): Remove; no longer needed.
11829 (XTflash, XTring_bell, x_wait_for_event):
11830 Port to ns-resolution time stamps. Don't assume time_t is signed.
11831
b6a92dfe
CY
118322012-06-22 Chong Yidong <cyd@gnu.org>
11833
11834 * xdisp.c (x_consider_frame_title): Revert last change.
11835
d251c37c
EZ
118362012-06-22 Eli Zaretskii <eliz@gnu.org>
11837
11838 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11839 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11840 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11841 staticidx goes up to 1597 out of 1600 = 0x640.)
11842
f10deafb
PE
118432012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11844
11845 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11846 Otherwise, the umask might be mistakenly 0 while handling input signals.
11847
ec6de1e2
SM
118482012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11849
11850 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11851
28be1ada
DA
118522012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11853
11854 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11855 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11856 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11857 access to `contents' member of Lisp_Vector objects with AREF and ASET
11858 where appropriate.
11859
c6bf3022
CY
118602012-06-19 Chong Yidong <cyd@gnu.org>
11861
11862 * frame.c (delete_frame): When selecting a frame on a different
11863 text terminal, do not alter the terminal's top-frame.
11864
11865 * xdisp.c (format_mode_line_unwind_data): Record the target
11866 frame's selected window and its terminal's top-frame.
11867 (unwind_format_mode_line): Restore them.
11868 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11869 Callers changed.
11870 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11871 since tty frames can be explicitly named.
11872 (prepare_menu_bars): Likewise.
11873
11874 * term.c (Ftty_top_frame): New function.
11875
defd4196
PE
118762012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11877
11878 Port byte-code-meter to modern targets.
11879 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11880 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 11881 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
11882 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11883 (METER_1, METER_2): Simplify.
11884
1053a871
SM
118852012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11886
11887 * data.c (Fdefalias): Return `symbol' (bug#11686).
11888
b7e8d081
MR
118892012-06-18 Martin Rudalics <rudalics@gmx.at>
11890
11891 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
11892 gets killed during executing of this function (Bug#11665).
11893 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
11894 (Vkill_buffer_query_functions): In doc-string say that functions
11895 run by this hook should not change the current buffer.
11896
7ea2b339
PE
118972012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11898
11899 Fix recently-introduced process.c problems found by static checking.
11900 * process.c (write_queue_push, write_queue_pop, send_process):
11901 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11902 (write_queue_pop): Fix pointer signedness problem.
11903 (send_process): Remove unused local.
11904
96a313a1
CY
119052012-06-17 Chong Yidong <cyd@gnu.org>
11906
11907 * xdisp.c (redisplay_internal): No need to redisplay terminal
11908 frames that are not on top.
11909
20ca2e94
TN
119102012-06-17 Troels Nielsen <bn.troels@gmail.com>
11911
11912 * process.c (make_process): Initialize write_queue.
11913 (write_queue_push, write_queue_pop): New functions.
11914 (send_process): Use them to maintain correct ordering of process
11915 writes (Bug#10815).
11916
9a900ca9
PE
119172012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11918
310fbfa8
PE
11919 * lisp.h (eassert): Assume C89 or later.
11920 This removes the need for CHECK.
11921 (CHECK): Remove. Its comments about always evaluating its
11922 argument were confusing, as 'eassert' typically does not evaluate
11923 its argument.
11924
27bb1ca4
PE
11925 * coding.c (produce_chars): Use ptrdiff_t, not int.
11926
9a900ca9
PE
11927 * xterm.c (x_draw_underwave): Check for integer overflow.
11928 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11929
41b7f8bc 119302012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
11931
11932 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11933 referenced (Bug#11583).
11934
9b0e3eba
AA
119352012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11936
11937 Implement wave-style variant of underlining.
11938 * dispextern.h (face_underline_type): New enum.
11939 (face): Add field for underline type.
11940 * nsterm.m (ns_draw_underwave): New function.
11941 (ns_draw_text_decoration): Use it.
11942 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11943 New functions.
11944 (x_draw_glyph_string): Use them.
11945 * xfaces.c (Qline, Qwave): New Lisp objects.
11946 (check_lface_attrs, merge_face_ref)
1053a871
SM
11947 (Finternal_set_lisp_face_attribute, realize_x_face):
11948 Handle wave-style underline face attributes.
9b0e3eba
AA
11949 * xterm.c (x_draw_underwave): New function.
11950 (x_draw_glyph_string): Use it.
11951
0fb52f11
JB
119522012-06-16 Juanma Barranquero <lekktu@gmail.com>
11953
11954 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11955 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11956 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11957 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11958 ($(BLD)/w32select.$(O)): Update dependencies.
11959
e5560ff7
AS
119602012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11961
11962 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11963 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11964 * character.c (_fetch_multibyte_char_p): Remove.
11965 * alloc.c: Include "character.h" before "buffer.h".
11966 * bidi.c: Likewise.
11967 * buffer.c: Likewise.
11968 * bytecode.c: Likewise.
11969 * callint.c: Likewise.
11970 * callproc.c: Likewise.
11971 * casefiddle.c: Likewise.
11972 * casetab.c: Likewise.
11973 * category.c: Likewise.
11974 * cmds.c: Likewise.
11975 * coding.c: Likewise.
11976 * composite.c: Likewise.
11977 * dired.c: Likewise.
11978 * dispnew.c: Likewise.
11979 * doc.c: Likewise.
11980 * dosfns.c: Likewise.
11981 * editfns.c: Likewise.
11982 * emacs.c: Likewise.
11983 * fileio.c: Likewise.
11984 * filelock.c: Likewise.
11985 * font.c: Likewise.
11986 * fontset.c: Likewise.
11987 * fringe.c: Likewise.
11988 * indent.c: Likewise.
11989 * insdel.c: Likewise.
11990 * intervals.c: Likewise.
11991 * keyboard.c: Likewise.
11992 * keymap.c: Likewise.
11993 * lread.c: Likewise.
11994 * macros.c: Likewise.
11995 * marker.c: Likewise.
11996 * minibuf.c: Likewise.
11997 * nsfns.m: Likewise.
11998 * nsmenu.m: Likewise.
11999 * print.c: Likewise.
12000 * process.c: Likewise.
12001 * regex.c: Likewise.
12002 * region-cache.c: Likewise.
12003 * search.c: Likewise.
12004 * syntax.c: Likewise.
12005 * term.c: Likewise.
12006 * textprop.c: Likewise.
12007 * undo.c: Likewise.
12008 * unexsol.c: Likewise.
12009 * w16select.c: Likewise.
12010 * w32fns.c: Likewise.
12011 * w32menu.c: Likewise.
12012 * window.c: Likewise.
12013 * xdisp.c: Likewise.
12014 * xfns.c: Likewise.
12015 * xmenu.c: Likewise.
12016 * xml.c: Likewise.
12017 * xselect.c: Likewise.
12018
2f07e6af
EZ
120192012-06-16 Eli Zaretskii <eliz@gnu.org>
12020
1053a871
SM
12021 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12022 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 12023 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
12024 row.
12025 (handle_face_prop): Use chunk-relative overlay string index when
12026 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
12027 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12028 the rightmost. (Bug#11720)
2f07e6af 12029
29b83cec
AS
120302012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12031
12032 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12033 (CATEGORY_MEMBER): Enforce 1/0 value.
12034 * category.c (_temp_category_set): Remove.
12035
4c5501e9
EZ
120362012-06-16 Eli Zaretskii <eliz@gnu.org>
12037
12038 * window.c (Fdelete_other_windows_internal)
12039 (Fdelete_window_internal): Don't access frame's mouse highlight
12040 info of the initial frame. (Bug#11677)
12041
2b570124
PE
120422012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12043
e93864f9
PE
12044 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12045 Assume USE_2_TAGS_FOR_INTS.
12046 (xreload): Adjust $tagmask width to match recent lisp.h change.
12047
2b570124
PE
12048 Simplify lisp.h in minor ways that should not affect code.
12049 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12050 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12051 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12052 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12053 (INTTYPEBITS): New macro, for clarity.
12054 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
12055 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12056 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
12057 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12058 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12059
81755f69
JB
120602012-06-13 Juanma Barranquero <lekktu@gmail.com>
12061
12062 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12063
16192a57
GM
120642012-06-13 Glenn Morris <rgm@gnu.org>
12065
12066 * s/bsd-common.h (BSD4_3):
12067 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12068
646b5f55
AS
120692012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12070
12071 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12072 instead of union.
12073 (XLI, XIL): Define.
1053a871
SM
12074 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12075 Use them.
12076 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 12077 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 12078 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
12079 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12080 * frame.c (delete_frame): Remove outdated comment.
12081 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12082 USE_LISP_UNION_TYPE.
12083 (Fw32_unregister_hot_key): Likewise.
12084 (Fw32_toggle_lock_key): Likewise.
12085 * w32menu.c (add_menu_item): Likewise.
12086 (w32_menu_display_help): Use XIL instead of checking
12087 USE_LISP_UNION_TYPE.
12088 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12089 (init_heap): Likewise.
12090 * w32term.c (w32_read_socket): Update comment.
12091
1d3823c9
GM
120922012-06-13 Glenn Morris <rgm@gnu.org>
12093
c62ff706
GM
12094 * s/usg5-4-common.h, src/s/unixware.h:
12095 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12096
1d3823c9
GM
12097 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12098
bfe3e0a2
PE
120992012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12100
12101 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12102 * alloc.c (make_number) [!defined make_number]:
12103 Remove, as lisp.h always defines this now.
12104 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12105 (roundup_size): Verify that it is a power of 2.
12106 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12107 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12108 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12109 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12110 USE_LSB_TAG now is always defined to be either 0 or 1.
12111 All uses changed.
12112 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12113 code works fine either way, and efficiency is not a concern here,
12114 as the union type is for debugging, not for production.
12115 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12116 Use an inline function on all platforms when using the union type,
12117 since this is simpler and 'static inline' can be used portably
12118 within Emacs now.
12119 (LISP_INITIALLY_ZERO): New macro.
12120 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12121 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12122
45fa9c0f
GM
121232012-06-12 Glenn Morris <rgm@gnu.org>
12124
b4492cba
GM
12125 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12126
12127 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 12128
45fa9c0f
GM
12129 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12130 Move BROKEN_SIGIO to configure.
12131
12132 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12133 Move NO_TERMIO to configure.
12134
0e25d334
CY
121352012-06-12 Chong Yidong <cyd@gnu.org>
12136
12137 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12138 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12139 MagickExportImagePixels is undefined.
12140
43682bb6
PE
121412012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12142
12143 * image.c (imagemagick_load_image): Remove unused label.
12144
a9be7d2b
GM
121452012-06-11 Glenn Morris <rgm@gnu.org>
12146
12147 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12148 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12149 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12150 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12151
3017f87f
SM
121522012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12153
12154 * alloc.c (make_byte_code): New function.
12155 (Fmake_byte_code): Use it. Don't purify here.
12156 * lread.c (read1): Use it as well to avoid extra allocation.
12157
1b9b4cf4
CY
121582012-06-11 Chong Yidong <cyd@gnu.org>
12159
12160 * image.c (imagemagick_load_image): Implement transparency.
12161
95988fcf
AS
121622012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12163
12164 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12165 account for preceding backslashes. (Bug#11663)
12166
cd4eb164
CY
121672012-06-09 Chong Yidong <cyd@gnu.org>
12168
12169 * term.c: Support italics in capable terminals (Bug#9652).
12170 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12171 (turn_on_face): Output using TS_enter_italic_mode if available.
12172 Don't handle unused blinking and alt-charset cases.
12173 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12174 and tty_alt_charset_p cases.
12175 (tty_capable_p, init_tty): Support italics.
12176
12177 * termchar.h (struct tty_display_info): Add field for italics.
12178 Remove unused blink field.
12179
12180 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12181 Handle slant.
12182
12183 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12184 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12185 tty_alt_charset_p. Add tty_italic_p.
12186
ff88beb8
MA
121872012-06-09 Michael Albinus <michael.albinus@gmx.de>
12188
12189 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12190 dbus_type_is_basic if available.
12191 (xd_extract_signed, xd_extract_unsigned): Rename from
12192 extract_signed and extract_unsigned, respectively. Adapt callers.
12193
44286096
CY
121942012-06-09 Chong Yidong <cyd@gnu.org>
12195
1682701f
CY
12196 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12197
44286096
CY
12198 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12199 case (Bug#9752).
12200
d86feb17
PE
122012012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12202
12203 * xdisp.c (vmessage): Treat frame message as multibyte.
12204 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12205 would generate the diagnostic "Making \302\247 buffer-local while
12206 let-bound!".
12207
d5c20fe8
EZ
122082012-06-08 Eli Zaretskii <eliz@gnu.org>
12209
12210 * dispnew.c (showing_window_margins_p): Undo last change, which
12211 was done due to an inadvertent commit.
12212 (adjust_frame_glyphs_for_frame_redisplay): Do call
12213 showing_window_margins_p.
12214
513749ee
SM
122152012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12216
12217 * eval.c (Fmake_var_non_special): New primitive.
12218 (syms_of_eval): Defsubr it.
12219 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12220
d4a8f5c1
JB
122212012-06-08 Juanma Barranquero <lekktu@gmail.com>
12222
12223 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12224 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12225
8bbbc977
EZ
122262012-06-08 Eli Zaretskii <eliz@gnu.org>
12227
12228 * alloc.c (allocate_vectorlike): Fix last change.
12229
f3372c87
DA
122302012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12231
12232 Block-based vector allocation of small vectors.
12233 * lisp.h (struct vectorlike_header): New field `nbytes',
12234 adjust comment accordingly.
12235 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 12236 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
12237 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12238 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
f4ad7ea1
JB
12239 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12240 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12241 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
f3372c87
DA
12242 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12243 (roundup_size): New constant.
12244 (struct vector_block): New data type.
12245 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 12246 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
12247 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12248 (sweep_vectors): New functions.
12249 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 12250 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
12251 or equal to VBLOCK_BYTES_MAX.
12252 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12253 (init_alloc_once): Add call to init_vectors.
12254
4f18a4ed
SM
122552012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12256
12257 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12258
86f158bc
PE
122592012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12260
12261 * doprnt.c (doprnt): Truncate multibyte char correctly.
12262 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12263 would mishandle a string argument "Xc" if X was a multibyte
12264 character of length 2: it would truncate after X's first byte
12265 rather than including all of X.
12266
c5cfcbe0
CY
122672012-06-06 Chong Yidong <cyd@gnu.org>
12268
12269 * buffer.c (word_wrap): Doc fix.
12270
c05cf390
PE
122712012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12272
12273 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12274
0c3461de
GM
122752012-06-03 Glenn Morris <rgm@gnu.org>
12276
12277 * xdisp.c (tool-bar-style): Doc fix.
12278
c71232db
UM
122792012-06-03 Ulrich Müller <ulm@gentoo.org>
12280
12281 * Makefile.in (PAXCTL): Define.
12282 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12283 binary via PaX flags if the paxctl utility is available.
12284 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12285 Restore PaX flags to their default. (Bug#11398)
12286
383f7350
CY
122872012-06-03 Chong Yidong <cyd@gnu.org>
12288
12289 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12290 buffer (Bug#11226).
12291
5f2c76c6
CY
122922012-06-03 Chong Yidong <cyd@gnu.org>
12293
12294 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12295 (note_mode_line_or_margin_highlight): If there is no help echo,
12296 use mode-line-default-help-echo. Handle the case where the mouse
12297 position is past the end of the mode line string.
12298
12299 * buffer.c (buffer_local_value_1): New function, split from
12300 Fbuffer_local_value; can return Qunbound.
12301 (Fbuffer_local_value): Use it.
12302 (Vmode_line_format): Docstring tweaks.
12303
773d47f6
PE
123042012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12305
12306 * sysdep.c (system_process_attributes): Improve comment.
12307
f2d6a3df
SM
123082012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12309
12310 * keyboard.c: Export real-this-command to Elisp.
12311 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12312 and DEFVAR it. Update all users.
12313
63810350
PE
123142012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12315
7bd5c1f4
PE
12316 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12317
63810350
PE
12318 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12319 Convert pctcpu and pctmem to Lisp float properly.
12320 Let the compiler fold better, as 100.0/0x8000 is exact.
12321
a2821611
AS
123222012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12323
12324 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12325 cons_block.
12326
5fceba1d
PE
123272012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12328
12329 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12330
c98ff5dd
DA
123312012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12332
12333 For a 'struct window', replace some Lisp_Object fields to
12334 bitfields where appropriate, remove unused fields.
12335 * window.h (struct window): Remove unused 'last_mark_x' and
12336 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 12337 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
12338 Change type of 'force_start', 'optional_new_start',
12339 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 12340 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 12341
ca34e0be
PE
123422012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12343
12344 Pacify gcc -Wdouble-precision when using Xaw.
12345 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12346 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12347 Use 'float' consistently, rather than 'float' in most places
12348 and 'double' in a couple of places.
12349
efc00ab1 123502012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
12351
12352 * xdisp.c (handle_stop): Detect whether we have overlay strings
12353 loaded by testing it->current.overlay_string_index to be
12354 non-negative, instead of checking whether n_overlay_strings is
12355 positive. (Bug#11587)
12356
efc00ab1 123572012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
12358
12359 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12360
12361 * doc.c (Fsubstitute_command_keys): Doc fix.
12362
efc00ab1 123632012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
12364
12365 * search.c (search_buffer): Remove calls to
12366 r_alloc_inhibit_buffer_relocation, as it is now called by
12367 maybe_unify_char, which was the cause of relocation of buffer text
12368 in bug#11519.
12369
efc00ab1 123702012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
12371
12372 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12373 for the duration of call to load_charset, to avoid problems with
12374 callers of maybe_unify_char that access buffer text through C
12375 pointers.
12376
12377 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12378 decrement the inhibition flag, instead of just setting or
12379 resetting it.
12380
ba93a187
PE
123812012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12382
12383 Remove obsolete '#define static' cruft.
12384 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12385 This #undef was "temporary" in 2000; it is no longer needed
12386 now that '#define static' has gone away.
12387 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12388 (gray_bitmap_bits): Remove; no longer needed.
12389 All uses replaced with definiens.
12390 * xterm.c: Include "bitmaps/gray.xbm".
12391
9e4bf381
PE
123922012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12393
12394 Clean up __executable_start, monstartup when --enable-profiling.
12395 The following changes affect the code only when profiling.
12396 * dispnew.c (__executable_start): Rename from safe_bcopy.
12397 Define only on platforms that need it.
12398 * emacs.c: Include <sys/gmon.h> when profiling.
12399 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12400 (__executable_start): Remove decl, since lisp.h does it now.
12401 (safe_bcopy): Remove decl; no longer has that name.
12402 (main): Coalesce #if into single bit of code, for simplicity.
12403 Cast pointers to uintptr_t, since standard libraries want integers
12404 and not pointers.
12405 * lisp.h (__executable_start): New decl.
12406
32d72c2f
GM
124072012-05-31 Glenn Morris <rgm@gnu.org>
12408
12409 * image.c (Fimagemagick_types): Doc fix.
12410
baac5bc7
JM
124112012-05-30 Jim Meyering <meyering@redhat.com>
12412
12413 * callproc.c (Fcall_process_region): Include directory component
12414 in mkstemp error message (Bug#11586).
12415
72cb32cf
PE
124162012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12417
12418 * alloc.c, lisp.h (make_pure_vector): Now static.
12419
61b108cc
SM
124202012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12421
12422 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12423 Move to byte-run.el.
12424 (Fautoload): Do the hash-doc more carefully.
12425 * data.c (Fdefalias): Purify definition, except for keymaps.
12426 (Qdefun): Move from eval.c.
12427 * lisp.h (Qdefun): Remove.
12428 * lread.c (read1): Tiny simplification.
12429
471fe23d
TN
124302012-05-29 Troels Nielsen <bn.troels@gmail.com>
12431
934f3f58 12432 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
12433 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12434 Bug#9642, but explicitly check that the buffer the overlay would
12435 be moved to is live and rearrange lines to make sure that errors
12436 will not put the overlay in an inconsistent state.
12437 (Fdelete_overlay): Cosmetics.
12438
85d0efd1
EZ
124392012-05-28 Eli Zaretskii <eliz@gnu.org>
12440
12441 * w32term.c (my_bring_window_to_top): New function.
12442 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
12443 could be different from the original one.
12444 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
12445 (Bug#11513)
12446
12447 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12448 by calling BringWindowToTop.
12449
12450 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12451 (WM_EMACS_END): Increase by one.
12452
da92a98c
PE
124532012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12454
12455 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12456 This avoids undefined behavior that might cause the eassert
12457 to not catch an out-of-range value.
12458
74d1f848
JB
124592012-05-28 Juanma Barranquero <lekktu@gmail.com>
12460
12461 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12462 Update dependencies.
12463
9e1a06fc
EZ
124642012-05-27 Eli Zaretskii <eliz@gnu.org>
12465
12466 * bidi.c (bidi_mirror_char): Fix last change.
12467
f3dd7312
AS
124682012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12469
12470 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12471 when referring to sectname field in printf format.
12472
81899c91
PE
124732012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12474
57b81a9f
PE
12475 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12476 Only r_alloc_inhibit_buffer_relocation needed to be added;
12477 the others were already declared.
12478
81899c91
PE
12479 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12480 before checking whether it's out of range. Put the check inside
12481 eassert. See
12482 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12483
33017faf 124842012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
12485
12486 * callproc.c (Fcall_process): Restore a line that was accidentally
12487 commented out in the 2011-02-13 change (bug#11547).
12488
33017faf 124892012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
12490
12491 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12492 defined on ralloc.c.
12493
12494 * buffer.c [REL_ALLOC]: Remove prototypes of
12495 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12496 they are now on lisp.h.
12497
12498 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12499
12500 * search.c (search_buffer): Use it to inhibit relocation of buffer
12501 text while re_search_2 is doing its job, because re_search_2 is
12502 passed C pointers to buffer text. (Bug#11519)
12503
23415acf
EZ
12504 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12505 Update value to 24.
12506
44e27368
EZ
12507 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12508 state after an additional call to move_it_in_display_line_to, keep
12509 the values of it->max_ascent and it->max_descent found for the
12510 entire line.
12511 (pos_visible_p): Revert the comparison against bottom_y to what it
12512 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12513 (Bug#11464)
12514
c1892f11
PE
125152012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12516
12517 Fix coding-related core dumps with gcc -ftrapv.
12518 The code was computing A - B, where A and B are pointers, and B is
12519 random garbage. This can lead to core dumps on platforms that
12520 have special pointer registers, and it also leads to core dumps on
12521 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12522 A - B only when B is initialized properly.
12523 * coding.c (coding_set_source, coding_set_destination): Return void.
12524 (coding_change_source, coding_change_destinations): New functions,
12525 with the old behaviors of coding_set_source and coding_set_destination.
12526 All callers that need an offset changed to use these new functions.
12527
eb7afdad
GM
125282012-05-26 Glenn Morris <rgm@gnu.org>
12529
12530 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12531
f12fdf02
EZ
125322012-05-26 Eli Zaretskii <eliz@gnu.org>
12533
53a63be6 12534 Extend mouse support on W32 text-mode console.
61b108cc
SM
12535 * xdisp.c (draw_row_with_mouse_face):
12536 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 12537
eb3f6f01 12538 * w32console.c: Include window.h.
61b108cc
SM
12539 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12540 New functions.
eb3f6f01
EZ
12541 (initialize_w32_display): Initialize mouse-highlight data.
12542
53a63be6
EZ
12543 * w32inevt.c: Include termchar.h and window.h.
12544 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12545 moves, call note_mouse_highlight. If help_echo changed, call
12546 gen_help_event to produce help-echo message in the echo area.
12547 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12548 highlight info.
12549
4cfd81f6
PE
125502012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12551
12552 * lread.c (read1): Simplify slightly to avoid an overflow warning
12553 with GCC 4.7.0 on x86-64.
12554
4446092a
EZ
125552012-05-26 Eli Zaretskii <eliz@gnu.org>
12556
12557 * bidi.c (bidi_mirror_char): Revert last change: an int is
12558 definitely wide enough here.
12559
42b2a986 125602012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 12561
42b2a986 12562 Fix integer width and related bugs (Bug#9874).
eb106a49 12563 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
12564 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12565 (string_bytes, check_sblock, allocate_string_data):
12566 (compact_small_strings, Fmake_bool_vector, make_string)
12567 (make_unibyte_string, make_multibyte_string)
12568 (make_string_from_bytes, make_specified_string)
12569 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12570 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12571 (mark_vectorlike):
12572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12573 (allocate_pseudovector):
12574 Use int, not EMACS_INT, where int is wide enough.
12575 (inhibit_garbage_collection, Fgarbage_collect):
12576 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12577 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12578 int might not be wide enough.
12579 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12580 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12581 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12582 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12583 (bidi_level_of_next_char, bidi_move_to_visually_next):
12584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12585 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12586 (Fkill_buffer, Fset_buffer_major_mode)
12587 (advance_to_char_boundary, Fbuffer_swap_text)
12588 (Fset_buffer_multibyte, overlays_at, overlays_in)
12589 (overlay_touches_p, struct sortvec, record_overlay_string)
12590 (overlay_strings, recenter_overlay_lists)
12591 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12592 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12593 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12594 (Foverlay_recenter, last_overlay_modification_hooks_used)
12595 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
12597 (validate_region): Omit unnecessary test for b <= e,
12598 since that's guaranteed by the previous test.
d311d28c
PE
12599 (adjust_overlays_for_delete): Avoid pos + length overflow.
12600 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12601 (report_overlay_modification):
12602 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12603 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12604 Omit pointer cast, which isn't needed anyway, and doesn't work
12605 after the EMACS_INT -> ptrdiff_t change.
02481186 12606 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
12607 * buffer.h: Adjust decls to match defn changes elsewhere.
12608 (struct buffer_text, struct buffer):
12609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12610 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
12611 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12612 not int, to avoid needless 32-bit limit on 64-bit hosts.
12613 (exec_byte_code): Use tighter memory-full test, one that checks
12614 for alloca overflow. Don't compute the address of the object just
12615 before an array, as that's not portable. Use EMACS_INT, not
12616 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
12617 * callint.c (Fcall_interactively):
12618 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12619 * callproc.c (call_process_kill, Fcall_process):
12620 Don't assume pid_t fits into an Emacs fixnum.
12621 (call_process_cleanup, Fcall_process, child_setup):
12622 Don't assume pid_t fits into int.
12623 (call_process_cleanup, Fcall_process, delete_temp_file)
12624 (Fcall_process_region):
12625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12626 (Fcall_process): Simplify handling of volatile integers.
12627 Use int, not EMACS_INT, where int will do.
12628 * casefiddle.c (casify_object, casify_region, operate_on_word)
12629 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12630 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12631 (casify_object): Avoid integer overflow when overallocating buffer.
12632 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 12633 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
12634 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12635 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12636 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12637 integers are now checked earlier. All uses replaced with XINT.
12638 (ccl_driver):
12639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12640 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
12641 (ccl_driver, Fregister_code_conversion_map):
12642 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
12643 (resolve_symbol_ccl_program): Check that vector header is in range.
12644 Always copy the vector, so that we can check its contents reliably
12645 now rather than having to recheck each instruction as it's being
12646 executed. Check that vector words fit in 'int'.
12647 (ccl_get_compiled_code, Fregister_ccl_program)
12648 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12649 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12650 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12651 contents are in range.
12652 (Fccl_execute_on_string): Check that status is in range.
12653 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12654 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12655 Accept and return EMACS_INT, not int, because callers can pass values
12656 out of 'int' range.
12657 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12658 (multibyte_chars_in_text, parse_str_as_multibyte)
12659 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12660 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12661 (string_escape_byte8, Fget_byte):
12662 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 12663 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
12664 avoid mishandling large integers.
12665 * character.h: Adjust decls to match defn changes elsewhere.
12666 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12667 (Ffind_charset_region):
12668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12669 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12670 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 12671 Don't assume fixnum fits in int.
d311d28c
PE
12672 (load_charset_map_from_vector, Fmap_charset_chars):
12673 Remove now-unnecessary CHECK_NATNUMs.
12674 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
12675 Don't rely on undefined behavior with signed left shift overflow.
12676 Don't assume unsigned int fits into fixnum, or that fixnum fits
12677 into unsigned int. Don't require max_code to be a valid fixnum;
12678 that's not true for gb10830 4-byte on a 32-bit host. Allow
12679 invalid_code to be a cons, for the same reason. Require code_offset
12680 to be a character. Avoid int overflow if max_char is close
12681 to INT_MAX.
12682 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12683 this is intended anyway and avoids some undefined behavior.
12684 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12685 INDEX_TO_CODE_POINT, as that's what it expects.
12686 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
12687 * charset.h (DECODE_CHAR): Return int, not unsigned;
12688 this is what was intended anyway, and it avoids undefined behavior.
12689 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12690 integer-overflow issues.
12691 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12692 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12693 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
12694 * chartab.c (Fmake_char_table, Fset_char_table_range)
12695 (uniprop_get_decoder, uniprop_get_encoder):
12696 Don't assume fixnum fits in int.
12697 * cmds.c (move_point): New function, that does the gist of
12698 Fforward_char and Fbackward_char, but does so while checking
12699 for integer overflow more accurately.
c96e5d6a 12700 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
12701 (Fforward_line, Fend_of_line, internal_self_insert)
12702 (internal_self_insert):
12703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12704 Fix a FIXME, by checking for integer overflow when calculating
12705 target_clm and actual_clm.
12706 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 12707 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
12708 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12709 (coding_alloc_by_making_gap, alloc_destination)
12710 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12711 (encode_coding_utf_16, detect_coding_emacs_mule)
12712 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12713 (detect_coding_iso_2022, decode_coding_iso_2022)
12714 (encode_invocation_designation, encode_designation_at_bol)
12715 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12716 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12717 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12718 (encode_coding_ccl, encode_coding_raw_text)
12719 (detect_coding_charset, decode_coding_charset)
12720 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12721 (produce_composition, produce_charset, produce_annotation)
12722 (decode_coding, handle_composition_annotation)
12723 (handle_charset_annotation, consume_chars, decode_coding_gap)
12724 (decode_coding_object, encode_coding_object, detect_coding_system)
12725 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12726 (code_convert_region, code_convert_string)
8f50130c
PE
12727 (Fdefine_coding_system_internal)
12728 (coding_set_source, coding_set_destination):
d311d28c
PE
12729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12730 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12731 (Fdefine_coding_system_internal):
12732 Don't assume fixnums fit in int.
12733 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 12734 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
12735 (Funencodable_char_position, Fcheck_coding_systems_region)
12736 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 12737 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 12738 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 12739 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 12740 Don't access memory outside of the args array.
d311d28c 12741 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
12742 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12743 result of ENCODE_CHAR.
d311d28c
PE
12744 * coding.h: Adjust decls to match defn changes elsewhere.
12745 (struct coding_system):
12746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12747 * composite.c (get_composition_id, find_composition)
12748 (run_composition_function, update_compositions)
12749 (compose_text, composition_gstring_put_cache)
12750 (composition_gstring_p, composition_gstring_width)
12751 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12752 (composition_compute_stop_pos, composition_reseat_it)
12753 (composition_update_it, struct position_record)
12754 (find_automatic_composition, composition_adjust_point)
12755 (Fcomposition_get_gstring, Ffind_composition_internal):
12756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12757 (update_compositions):
12758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12759 * composite.h: Adjust decls to match defn changes elsewhere.
12760 (struct composition):
12761 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12762 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12763 Do not attempt to compute the address of the object just before a
12764 buffer; this is not portable.
12765 (Faref, Faset):
12766 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12767 (Faset): Use int, not EMACS_INT, where int is wide enough.
12768 (Fstring_to_number): Don't assume fixnums fit in int.
12769 (Frem): Don't assume arg is nonnegative.
12770 * dbusbind.c (xd_append_arg): Check for integers out of range.
12771 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 12772 (extract_signed, extract_unsigned): New functions.
243e0530
PE
12773 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12774 (xd_get_connection_references): Return ptrdiff_t, not int.
12775 All uses changed.
12776 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12777 (xd_read_message_1):
12778 Use int, not unsigned, where the dbus API uses int.
12779 (Fdbus_message_internal): Don't overflow mtype.
12780 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
12781 * dired.c (directory_files_internal, file_name_completion, scmp)
12782 (file_name_completion_stat):
12783 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12784 (file_name_completion): Don't overflow matchcount.
12785 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12786 * dispextern.h: Adjust decls to match defn changes elsewhere.
12787 (struct text_pos, struct glyph, struct bidi_saved_info)
12788 (struct bidi_string_data, struct bidi_it, struct composition_it)
12789 (struct it):
12790 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12791 (struct display_pos, struct composition_it, struct it):
12792 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12793 * dispnew.c (increment_matrix_positions)
12794 (increment_row_positions, mode_line_string)
12795 (marginal_area_string):
12796 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 12797 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
12798 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12799 (duration_to_sec_usec): New function, to check for overflow better.
12800 (Fsleep_for, sit_for): Use it.
12801 * doc.c (get_doc_string, store_function_docstring):
12802 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12803 (get_doc_string, Fsnarf_documentation):
12804 Use int, not EMACS_INT, where int is wide enough.
12805 (get_doc_string):
12806 Use SAFE_ALLOCA, not alloca.
12807 Check for overflow when converting EMACS_INT to off_t.
12808 * doprnt.c (doprnt):
12809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12810 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12811 Don't assume uid_t fits into fixnum.
12812 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12813 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12814 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12815 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12816 (general_insert_function)
12817 (Finsert_char, make_buffer_string, make_buffer_string_both)
12818 (update_buffer_properties, Fbuffer_substring)
12819 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12820 (Fsubst_char_in_region, check_translation)
12821 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12822 (transpose_markers, Ftranspose_regions):
12823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12824 (clip_to_bounds): Move to lisp.h as an inline function).
12825 (Fconstrain_to_field): Don't assume integers are nonnegative.
12826 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12827 (Fsubst_char_in_region, Fsave_restriction):
12828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12829 (Femacs_pid): Don't assume pid_t fits into fixnum.
12830 (lo_time): Use int, not EMACS_INT, when int suffices.
12831 (lisp_time_argument): Check for usec out of range.
12832 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
12833 (Fuser_login_name, Fuser_full_name): Signal an error
12834 if a uid argument is out of range, rather than relying on
12835 undefined behavior.
c8d5c857
PE
12836 (Fformat_time_string): Remove now-unnecessary check.
12837 lisp_time_argument checks for out-of-range usec now.
243e0530 12838 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
12839 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12840 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12841 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12842 (init_cmdargs, Fdump_emacs):
12843 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12844 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12845 the bottom (typically) 32 bits of the fixnum.
12846 * eval.c (specpdl_size, call_debugger):
12847 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12848 (when_entered_debugger, Fbacktrace_debug):
12849 Don't assume fixnum can fit in int.
12850 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12851 the object just before a buffer; this is not portable.
12852 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12853 (grow_specpdl, unbind_to):
12854 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12855 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12856 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 12857 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
12858 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12859 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12861 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12862 (a_write, e_write):
12863 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12864 (Fcopy_file, non_regular_nbytes, read_non_regular)
12865 (Finsert_file_contents):
12866 Use int, not EMACS_INT, where int is wide enough.
12867 (READ_BUF_SIZE): Verify that it fits in int.
12868 (Finsert_file_contents): Check that counts are in proper range,
12869 rather than assuming fixnums fit into ptrdiff_t etc.
12870 Don't assume fixnums fit into int.
125b3835 12871 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
12872 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12873 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
12874 (string_char_to_byte, string_byte_to_char)
12875 (string_make_multibyte, string_to_multibyte)
12876 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12877 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12878 (substring_both, Fdelete, internal_equal, Ffillarray)
12879 (Fclear_string, mapcar1)
12880 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12881 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12882 (larger_vector, make_hash_table, maybe_resize_hash_table)
12883 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12884 (Fmaphash, secure_hash):
12885 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12886 (concat): Check for string index and length overflow.
12887 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12888 (Frequire):
12889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12890 (larger_vector): New API (vec, incr_min, size_max) replaces old
12891 one (vec, new_size, init). This catches size overflow.
12892 INIT was removed because it was always Qnil.
12893 All callers changed.
12894 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12895 the upper bound on a hash table index size.
12896 (make_hash_table, maybe_resize_hash_table): Use it.
12897 (secure_hash): Computer start_byte and end_byte only after
12898 they're known to be in ptrdiff_t range.
12899 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12900 (Ffont_get_glyphs, Ffont_at):
12901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12902 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12903 (Flist_fonts, Fopen_font):
12904 Don't assume fixnum can fit in int.
12905 (check_gstring): Don't assume index can fit in int.
12906 (font_match_p): Check that fixnum is a character, not a nonnegative
12907 fixnum, since the later code needs to stuff it into an int.
12908 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12909 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12910 conversion overflow issues.
12911 (Fopen_font): Check for integer out of range.
12912 (Ffont_get_glyphs): Don't assume index can fit in int.
12913 * font.h: Adjust decls to match defn changes elsewhere.
12914 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12915 integer overflow.
12916 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12917 printmax_t, where ptrdiff_t is wide enough.
12918 (Finternal_char_font):
12919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12920 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12921 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12922 (Fset_frame_position, x_set_frame_parameters)
12923 (x_set_line_spacing, x_set_border_width)
12924 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12925 Check that fixnums are in proper range for system types.
12926 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12928 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12929 Use SAFE_ALLOCA_LISP, not alloca.
12930 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12931 intptr_t is wide enough.
12932 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12933 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12934 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12935 Check for fixnum out of range.
12936 * ftfont.c (ftfont_list): Don't assume index fits in int.
12937 Check that fixnums are in proper range for system types.
12938 (ftfont_shape_by_flt):
12939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
12940 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12941 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12942 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12943 Check that fixnums are in proper range for system types.
12944 * gnutls.h: Adjust decls to match defn changes elsewhere.
12945 * gtkutil.c (xg_dialog_run):
12946 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12947 (update_frame_tool_bar):
12948 Check that fixnums are in proper range for system types.
12949 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 12950 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
12951 * indent.c (last_known_column, last_known_column_point):
12952 (current_column_bol_cache):
12953 (skip_invisible, current_column, check_display_width):
12954 (check_display_width, scan_for_column, current_column_1)
12955 (Findent_to, Fcurrent_indentation, position_indentation)
12956 (indented_beyond_p, Fmove_to_column, compute_motion):
12957 (Fcompute_motion, Fvertical_motion):
12958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12959 (last_known_column_modified): Use EMACS_INT, not int.
12960 (check_display_width):
12961 (Fcompute_motion):
12962 Check that fixnums and floats are in proper range for system types.
12963 (compute_motion): Don't assume index or fixnum fits in int.
12964 (compute_motion, Fcompute_motion):
12965 Use int, not EMACS_INT, when it is wide enough.
12966 (vmotion): Omit local var start_hpos that is always 0; that way
12967 we don't need to worry about overflow in expressions involving it.
12968 * indent.h: Adjust decls to match defn changes elsewhere.
12969 (struct position):
12970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12971 Use int, not EMACS_INT, where int is wide enough.
12972 Remove unused members ovstring_chars_done and tab_offset;
12973 all uses removed.
12974 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12975 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12976 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12977 (make_gap, copy_text, insert, insert_and_inherit)
12978 (insert_before_markers, insert_before_markers_and_inherit)
12979 (insert_1, count_combining_before, count_combining_after)
12980 (insert_1_both, insert_from_string)
12981 (insert_from_string_before_markers, insert_from_string_1)
12982 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12983 (adjust_after_replace, adjust_after_insert, replace_range)
12984 (replace_range_2, del_range, del_range_1, del_range_byte)
12985 (del_range_both, del_range_2, modify_region)
12986 (prepare_to_modify_buffer, signal_before_change)
12987 (signal_after_change, Fcombine_after_change_execute):
12988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12989 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12990 (balance_an_interval, split_interval_right, split_interval_left)
12991 (find_interval, next_interval, update_interval)
12992 (adjust_intervals_for_insertion, delete_node, delete_interval)
12993 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12994 (static_offset_intervals, offset_intervals)
12995 (merge_interval_right, merge_interval_left, make_new_interval)
12996 (graft_intervals_into_buffer, temp_set_point_both)
12997 (temp_set_point, set_point, adjust_for_invis_intang)
12998 (set_point_both, move_if_not_intangible, get_property_and_range)
12999 (get_local_map, copy_intervals, copy_intervals_to_string)
13000 (compare_string_intervals, set_intervals_multibyte_1):
13001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13002 * intervals.h: Adjust decls to match defn changes elsewhere.
13003 (struct interval):
13004 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13005 * keyboard.c (this_command_key_count, this_single_command_key_start)
13006 (before_command_key_count, before_command_echo_length, echo_now)
13007 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13008 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13009 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13010 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13011 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13012 (last_non_minibuf_size, last_point_position, echo_truncate)
13013 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13014 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13015 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13016 (stuff_buffered_input):
13017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13018 (last_auto_save, command_loop_1, read_char):
13019 Use EMACS_INT, not int, to avoid integer overflow.
13020 (record_char): Avoid overflow in total_keys computation.
13021 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13022 * keyboard.h: Adjust decls to match defn changes elsewhere.
13023 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13024 (Fkey_description, Fdescribe_vector, Flookup_key):
13025 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13026 (click_position): New function, to check that positions are in range.
13027 (Fcurrent_active_maps):
13028 (describe_command):
13029 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13030 (Faccessible_keymaps, Fkey_description):
13031 (preferred_sequence_p):
13032 Don't assume fixnum can fit into int.
13033 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13034 Check for integer overflow in size calculations.
13035 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13036 avoid mishandling large integers.
13037 * lisp.h: Adjust decls to match defn changes elsewhere.
13038 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13039 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13040 (struct Lisp_Marker):
13041 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13042 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
13043 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13044 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13045 All callers changed.
13046 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13047 Assume the arg has valid form, since it always does.
13048 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13049 unsigned integer system type.
13050 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13051 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13053 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13054 (duration_to_sec_usec): New decl.
13055 * lread.c (read_from_string_index, read_from_string_index_byte)
13056 (read_from_string_limit, readchar, unreadchar, openp)
13057 (read_internal_start, read1, oblookup):
13058 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13059 (Fload, readevalloop, Feval_buffer, Feval_region):
13060 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13061 (openp): Check for out-of-range argument to 'access'.
13062 (read1): Use int, not EMACS_INT, where int is wide enough.
13063 Don't assume fixnum fits into int.
6efdadfd 13064 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
13065 (read_filtered_event): Use duration_to_sec_usec
13066 to do proper overflow checking on durations.
d311d28c
PE
13067 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13068 in size calculation.
13069 (Fexecute_kbd_macro):
13070 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13071 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13072 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13073 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13074 (set_marker_both, set_marker_restricted_both, marker_position)
13075 (marker_byte_position, Fbuffer_has_markers_at):
13076 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13077 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 13078 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
13079 It now merely ensures that the menu is large enough, without
13080 necessarily growing it, as this avoids some integer overflow issues.
13081 All callers changed.
13082 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13083 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13084 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13085 Use SAFE_ALLOCA_LISP, not alloca.
13086 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13087 to EMACS_INT. Check that fixnums are in proper range for system types.
13088 * minibuf.c (minibuf_prompt_width, string_to_object)
13089 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13090 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13092 (get_minibuffer, read_minibuf_unwind):
13093 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13094 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13095 this simplifies overflow checking. All callers changed.
13096 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13097 (Ftest_completion):
13098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13099 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13100 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13101 Check that fixnums are in proper range for system types.
13102 (Fx_create_frame, Fx_show_tip):
13103 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13104 * nsfont.m (ns_findfonts, nsfont_list_family):
13105 Don't assume fixnum fits in long.
13106 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13107 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13108 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13109 wide enough.
17fdb222 13110 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
13111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13112 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13113 (PRINTDECLARE, PRINTPREPARE):
13114 (strout, print_string):
13115 (print, print_preprocess, print_check_string_charset_prop)
13116 (print_object):
13117 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13118 (PRINTDECLARE):
13119 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13120 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13121 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 13122 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 13123 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
13124 (print_error_message): Use SAFE_ALLOCA, not alloca.
13125 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
13126 (print_depth, new_backquote_output, print_number_index):
13127 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
13128 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13129 (Fset_process_window_size, Fformat_network_address)
13130 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 13131 (sigchld_handler):
d311d28c 13132 Check that fixnums are in proper range for system types.
d44287d4 13133 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
13134 Check for process-ids out of pid_t range rather than relying on
13135 undefined behavior.
e4d81efc 13136 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
13137 (Fformat_network_address, read_process_output, send_process)
13138 (Fprocess_send_region, status_notify):
13139 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13140 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13141 (wait_reading_process_output, read_process_output, exec_sentinel):
13142 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13143 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13144 (Faccept_process_output): Use duration_to_sec_usec to do proper
13145 overflow checking on durations.
dde14581
PE
13146 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13147 Don't assume pid_t fits in int.
02481186
PE
13148 * process.h (struct Lisp_Process): Members tick and update_tick
13149 are now of type EMACS_INT, not int.
b62b53e8
PE
13150 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13151 configured --with-wide-int.
d311d28c
PE
13152 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13153 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13154 * search.c (looking_at_1, string_match_1):
13155 (fast_string_match, fast_c_string_match_ignore_case)
13156 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13157 (scan_newline, find_before_next_newline, search_command)
13158 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13159 (set_search_regs, wordify):
13160 (Freplace_match):
13161 (Fmatch_data):
13162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13163 (string_match_1, search_buffer, set_search_regs):
13164 (Fmatch_data):
13165 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13166 (wordify): Check for overflow in size calculation.
13167 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13168 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13169 Check that fixnums are in proper range for system types.
13170 * sound.c (struct sound_device)
13171 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13173 (Fplay_sound_internal):
13174 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 13175 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
13176 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13177 (Fparse_partial_sexp):
13178 Don't assume fixnums can fit in int.
13179 (struct lisp_parse_state, find_start_pos, find_start_value)
13180 (find_start_value_byte, find_start_begv)
13181 (update_syntax_table, char_quoted, dec_bytepos)
13182 (find_defun_start, prev_char_comend_first, back_comment):
13183 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13184 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13186 (Finternal_describe_syntax_value): Check that match_lisp is a
13187 character, not an integer, since the code stuffs it into int.
13188 (scan_words, scan_sexps_forward):
13189 Check that fixnums are in proper range for system types.
13190 (Fforward_word):
13191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13192 (scan_sexps_forward):
13193 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13194 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13195 * syntax.h: Adjust decls to match defn changes elsewhere.
13196 (struct gl_state_s):
13197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
13198 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13199 MOST_POSITIVE_FIXNUM.
d311d28c
PE
13200 * sysdep.c (wait_for_termination_1, wait_for_termination)
13201 (interruptible_wait_for_termination, mkdir):
13202 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13203 (emacs_read, emacs_write):
13204 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
13205 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13206 and double all fit in int.
d311d28c
PE
13207 * term.c (set_tty_color_mode):
13208 Check that fixnums are in proper range for system types.
13209 * termhooks.h (struct input_event):
13210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13211 * textprop.c (validate_interval_range, interval_of)
13212 (Fadd_text_properties, set_text_properties_1)
13213 (Fremove_text_properties, Fremove_list_of_text_properties)
13214 (Ftext_property_any, Ftext_property_not_all)
13215 (copy_text_properties, text_property_list, extend_property_ranges)
13216 (verify_interval_modification):
13217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13218 (Fnext_single_char_property_change)
13219 (Fprevious_single_char_property_change):
13220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
13221 (copy_text_properties):
13222 Check for integer overflow in index calculation.
d311d28c
PE
13223 * undo.c (last_boundary_position, record_point, record_insert)
13224 (record_delete, record_marker_adjustment, record_change)
13225 (record_property_change):
13226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13227 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13228 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13229 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13230 (Fx_hide_tip, Fx_file_dialog):
13231 * w32menu.c (set_frame_menubar):
13232 Use ptrdiff_t, not int, for consistency with rest of code.
13233 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13234 (select_window, Fdelete_other_windows_internal)
13235 (window_scroll_pixel_based, window_scroll_line_based)
13236 (Frecenter, Fset_window_configuration):
13237 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13238 (Fset_window_hscroll, run_window_configuration_change_hook)
13239 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 13240 (Fscroll_other_window, Frecenter):
d311d28c
PE
13241 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13242 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13243 Don't assume fixnum fits in int.
13244 (Fset_window_scroll_bars):
13245 Check that fixnums are in proper range for system types.
13246 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13247 (string_pos, c_string_pos, number_of_chars, init_iterator)
13248 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13249 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13250 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
13251 (face_before_or_after_it_pos, handle_invisible_prop)
13252 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
13253 (display_prop_intangible_p, string_buffer_position_lim)
13254 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13255 (get_overlay_strings_1, get_overlay_strings)
13256 (iterate_out_of_display_property, forward_to_next_line_start)
13257 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13258 (get_next_display_element, set_iterator_to_next)
13259 (get_visually_first_element, compute_stop_pos_backwards)
13260 (handle_stop_backwards, next_element_from_buffer)
13261 (move_it_in_display_line_to, move_it_in_display_line)
13262 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13263 (add_to_log, message_dolog, message_log_check_duplicate)
13264 (message2, message2_nolog, message3, message3_nolog
13265 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13266 (current_message_1, truncate_echo_area, truncate_message_1)
13267 (set_message, set_message_1, store_mode_line_noprop)
13268 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13269 (text_outside_line_unchanged_p, check_point_in_composition)
13270 (reconsider_clip_changes)
13271 (redisplay_internal, set_cursor_from_row, try_scrolling)
13272 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13273 (redisplay_window, find_last_unchanged_at_beg_row)
13274 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13275 (trailing_whitespace_p, find_row_edges, display_line)
13276 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13277 (display_mode_element, store_mode_line_string)
13278 (pint2str, pint2hrstr, decode_mode_spec)
13279 (display_count_lines, display_string, draw_glyphs)
13280 (x_produce_glyphs, x_insert_glyphs)
13281 (rows_from_pos_range, mouse_face_from_buffer_pos)
13282 (fast_find_string_pos, mouse_face_from_string_pos)
13283 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13285 (safe_call, init_from_display_pos, handle_fontified_prop)
13286 (handle_single_display_spec, load_overlay_strings)
13287 (with_echo_area_buffer, setup_echo_area_for_printing)
13288 (display_echo_area, echo_area_display)
13289 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13290 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
13291 (redisplay_window, dump_glyph_row, display_mode_line)
13292 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 13293 (handle_display_spec, display_prop_string_p):
d311d28c
PE
13294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13295 (handle_single_display_spec, build_desired_tool_bar_string)
13296 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13297 (get_specified_cursor_type):
13298 Check that fixnums are in proper range for system types.
13299 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13300 (Flookup_image_map):
13301 Don't assume fixnums fit in int.
13302 (compare_overlay_entries):
13303 Avoid mishandling comparisons due to subtraction overflow.
13304 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13305 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13306 (handle_tool_bar_click):
13307 Use int, not unsigned, since we prefer signed and the signedness
13308 doesn't matter here.
13309 (get_next_display_element, next_element_from_display_vector):
13310 Use int, not EMACS_INT, when int is wide enough.
13311 (start_hourglass): Use duration_to_sec_usec to do proper
13312 overflow checking on durations.
13313 * xfaces.c (Fbitmap_spec_p):
13314 Check that fixnums are in proper range for system types.
13315 (compare_fonts_by_sort_order):
13316 Avoid mishandling comparisons due to subtraction overflow.
13317 (Fx_family_fonts, realize_basic_faces):
13318 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13319 (Fx_family_fonts):
13320 Don't assume fixnum fits in int.
13321 Use SAFE_ALLOCA_LISP, not alloca.
13322 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13323 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13324 (face_at_buffer_position, face_for_overlay_string)
13325 (face_at_string_position):
13326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13327 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13328 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13329 (Fx_show_tip):
13330 Check that fixnums are in proper range for system types.
13331 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13332 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13333 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13334 (Fx_change_window_property): Don't assume fixnums fit in int.
13335 * xfont.c (xfont_chars_supported):
13336 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13337 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13338 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13339 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13340 * xml.c (parse_region):
13341 * xrdb.c (magic_file_p):
13342 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13343 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13344 (x_get_local_selection, x_reply_selection_request)
13345 (x_handle_selection_request, wait_for_property_change):
13346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13347 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13348 short is wide enough.
13349 (x_send_client_event): Don't assume fixnum fits in int.
13350 * xterm.c (x_x_to_emacs_modifiers):
13351 Don't assume EMACS_INT overflows nicely into int.
13352 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13353 may come from Lisp.
13354 (handle_one_xevent): NATNUMP can eval its arg twice.
13355 (x_connection_closed):
13356 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13357 * xterm.h: Adjust decls to match defn changes elsewhere.
13358 (struct scroll_bar): Use struct vectorlike_header
13359 rather than rolling our own approximation.
13360 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13361
c6574eb5
GM
133622012-05-25 Glenn Morris <rgm@gnu.org>
13363
13364 * lisp.mk (lisp): Update for more files being compiled now.
13365
e8d32c7e
SM
133662012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13367
48def666
SM
13368 * lread.c: Remove `read_pure' which makes no difference.
13369 (read_pure): Remove var.
13370 (unreadpure): Remove function.
13371 (readevalloop): Don't call read_list with -1 flag.
13372 (read1, read_vector): Don't test read_pure any more.
13373 (read_list): Simplify.
13374
e8d32c7e
SM
13375 * fileio.c, character.h: Minor style tweaks.
13376
4b2addb7
DA
133772012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13378
13379 * window.h (clip_changed): Remove useless declaration.
13380
584461b2
JB
133812012-05-22 Juanma Barranquero <lekktu@gmail.com>
13382
13383 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13384 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13385
34374650
PE
133862012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13387
13388 Remove src/m/*.
13389 This directory predates autoconf and is no longer needed nowadays.
13390 Move its few remaining bits of functionality to where they're needed.
13391 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13392 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13393 * m/template.h: Remove.
13394 * Makefile.in (M_FILE): Remove. All uses removed.
13395 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13396 * lisp.h (USE_LSB_TAG):
13397 * mem-limits.h (EXCEEDS_LISP_PTR):
13398 Use VAL_MAX, not VALBITS, in #if.
13399 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13400 (EMACS_UINT): Define unconditionally now.
13401 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13402 (BITS_PER_EMACS_INT): New constants, replacing
13403 what used to be in config.h, but not useful in #if.
13404 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13405 define them any more.
13406 (VAL_MAX): New macro.
13407 (VALMASK): Use it.
13408 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13409 BITS_PER_EMACS_INT, in #if.
13410 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13411 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13412 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13413 * s/ms-w32.h (DATA_START):
13414 Move here from removed file m/intel386.h.
13415 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13416 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13417
261cb4bb
PE
134182012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13419
13420 Assume C89 or later.
13421 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13422 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13423 (xrealloc):
13424 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13425 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13426 * textprop.c, tparam.c (NULL): Remove.
13427 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13428 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13429 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13430 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13431 * xterm.c (input_signal_count): Assume volatile works.
13432
ff23cd9f
KB
134332012-05-21 Ken Brown <kbrown@cornell.edu>
13434
13435 * xgselect.c (xg_select): Fix first argument in call to 'select'
13436 (bug#11508).
13437
1b170bc6
KB
134382012-05-20 Ken Brown <kbrown@cornell.edu>
13439
13440 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 13441 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 13442
b2f4d39f
KB
134432012-05-19 Ken Brown <kbrown@cornell.edu>
13444
13445 * xfns.c (x_in_use): Remove `static' qualifier.
13446 * xterm.h (x_in_use): Declare.
13447 * xgselect.c: Include xterm.h.
13448 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13449 and `display_arg' (bug#9754).
13450
003fdae2
PE
134512012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13452
9232a6d9
PE
13453 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13454
003fdae2
PE
13455 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13456 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13457
784b56e2
EZ
134582012-05-18 Eli Zaretskii <eliz@gnu.org>
13459
13460 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13461
13462 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 13463 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
13464
13465 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13466 reference to image_cache->refcount.
13467 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13468
a0a79cde
JL
134692012-05-17 Juri Linkov <juri@jurta.org>
13470
13471 * search.c (Fword_search_regexp, Fword_search_backward)
13472 (Fword_search_forward, Fword_search_backward_lax)
13473 (Fword_search_forward_lax): Move functions to isearch.el
13474 (bug#10145, bug#11381).
13475
b0572523
PE
134762012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13477
13478 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13479
9660f5fc
SM
134802012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13481
13482 * lread.c (init_obarray): Declare Qt and Qnil as special.
13483
4374de83
GM
134842012-05-14 Glenn Morris <rgm@gnu.org>
13485
13486 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 13487 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 13488
dc44c39a
PE
134892012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13490
078c97cb
PE
13491 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13492
dc44c39a
PE
13493 * unexaix.c: Port to more-recent AIX compilers.
13494 (report_error, report_error_1, make_hdr, copy_sym)
13495 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13496 Make arguments const char *, not char *, to avoid violations of C
13497 standard and to fix some AIX warnings reported by Gilles Pion.
13498
e18afed7 134992012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
13500
13501 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13502 already have overlays loaded.
13503 (handle_single_display_spec): Before returning without displaying
13504 fringe bitmap, synchronize the bidi iterator with the main display
13505 iterator, by calling iterate_out_of_display_property.
13506 (iterate_out_of_display_property): Detect buffer iteration by
13507 testing that it->string is a Lisp string.
13508 (get_next_display_element): When the current object is exhausted,
13509 and there's something on it->stack, call set_iterator_to_next to
13510 proceed with what's on the stack, instead of returning zero.
13511 (set_iterator_to_next): If called at the end of a Lisp string,
13512 proceed to consider_string_end without incrementing string
13513 position. Don't increment display vector index past the end of
13514 the display vector. (Bug#11417)
c8fb9dc6
EZ
13515 (pos_visible_p): Don't report a position visible when move_it_to
13516 stopped at the last line of window, which happens to be scanned
13517 backwards by the bidi iteration. (Bug#11464)
ac268e67 13518
e18afed7 135192012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
13520
13521 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13522 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
13523 are on a TTY, and thus unable to display on the fringes.
13524 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
13525 so we need to signal to the caller that this is a "replacing"
13526 display spec. This fixes display when the spec is invalid or we
13527 are on a TTY.
13528
e18afed7 135292012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
13530
13531 * unexaix.c (make_hdr): Fix typo in prototype.
13532 This bug broke the build on AIX. Problem reported by Gilles Pion.
13533
9d0a235a
MA
135342012-05-14 Michael Albinus <michael.albinus@gmx.de>
13535
13536 * keyboard.c (kbd_buffer_get_event): Read special events also in
13537 batch mode. (Bug#11415)
13538
9e6b06ed
GM
135392012-05-12 Glenn Morris <rgm@gnu.org>
13540
13541 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13542
c1a1d7a3
EZ
135432012-05-12 Eli Zaretskii <eliz@gnu.org>
13544
13545 * lisp.mk (lisp): Add newcomment.elc.
13546
3fe7cdc8
GM
135472012-05-12 Glenn Morris <rgm@gnu.org>
13548
13549 * Makefile.in (MKDIR_P): New, set by configure.
13550 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13551
53f7d2c0
PE
135522012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13553
13554 Remove unused function hourglass_started.
13555 * dispextern.h (hourglass_started):
13556 * w32fns.c (hourglass_started):
13557 * xdisp.c (hourglass_started): Remove.
13558
75aafb17
JB
135592012-05-10 Juanma Barranquero <lekktu@gmail.com>
13560
13561 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13562 Update dependencies.
13563
12959e8e
PE
135642012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13565
97107e2e
PE
13566 * xgselect.c (xg_select): Put maxfds+1 into a var.
13567 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13568
12959e8e
PE
13569 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13570
836d29b3
DA
135712012-05-10 Dave Abrahams <dave@boostpro.com>
13572
13573 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13574 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13575
5cb67954
MA
135762012-05-09 Michael Albinus <michael.albinus@gmx.de>
13577
13578 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 13579 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
13580 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13581 Initialize xd_registered_buses.
13582
3478ec45
PE
135832012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13584
b263a6b0
PE
13585 Untag more efficiently if USE_LSB_TAG.
13586 This is based on a proposal by YAMAMOTO Mitsuharu in
13587 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13588 For an admittedly artificial (nth 8000 longlist) benchmark on
13589 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13590 Emacs's overall text size by 1%.
13591 * lisp.h (XUNTAG): New macro.
13592 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13593 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13594 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13595 * eval.c (Fautoload):
13596 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13597 * frame.h (XFRAME): Use XUNTAG.
13598
3478ec45
PE
13599 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13600 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13601 Remove unportable assumptions about print widths of types like
13602 dbus_uint32_t.
13603 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13604 intptr_t when converting between pointer and integer, to avoid GCC
13605 warnings about wrong width.
13606
666b903b 136072012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
13608
13609 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13610 stack for each reader_thread, instead of defaulting to 8MB
13611 determined by the linker. This avoids failures in creating
13612 subprocesses on Windows 7, see the discussion in this thread:
13613 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13614
b120cc17
JC
136152012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13616
13617 Fix up display of the *Minibuf-0* buffer in the mini window.
13618 * keyboard.c (read_char): Don't clear the echo area if there's no
13619 message to clear.
13620 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 13621 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 13622
9a4b36f8
MA
136232012-05-07 Michael Albinus <michael.albinus@gmx.de>
13624
13625 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13626 batch mode.
13627
e5f9458f
CY
136282012-05-06 Chong Yidong <cyd@gnu.org>
13629
13630 * lisp.mk (lisp): Update.
13631
eceeb5fc 136322012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
13633
13634 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13635
71873e2b
SM
136362012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13637
13638 * data.c (PUT_ERROR): New macro.
13639 (syms_of_data): Use it. Add new error type `user-error'.
13640 * undo.c (user_error): New function.
13641 (Fprimitive_undo): Use it.
13642 * print.c (print_error_message): Adjust print style for `user-error'.
13643 * keyboard.c (user_error): New function.
13644 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13645
ab0fa4e4
PE
136462012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13647
13648 Do not limit current-time-string to years 1000..9999.
13649 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13650 (Fcurrent_time_string): Support any year that is supported by the
13651 underlying localtime representation. Don't use asctime, as it
13652 has undefined behavior for years outside the range -999..9999.
13653
7ed806a7
PE
136542012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13655
13656 Fix race conditions involving setenv, gmtime, localtime, asctime.
13657 Without this fix, interrupts could mess up code that uses these
13658 nonreentrant functions, since setting TZ invalidates existing
13659 tm_zone or tzname values, and since most of these functions return
13660 pointers to static storage.
13661 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13662 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13663 Grow the critical sections to include not just invoking
13664 localtime/gmtime, but also accessing these functions' results
13665 including their tm_zone values if any, and any related TZ setting.
13666 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
13667 so that the struct tm is saved in the critical section.
13668 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
13669 motivated by the fact that memory allocation needs to be outside
13670 the critical section.
13671
0c16dfed
DA
136722012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13673
13674 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13675 with RESET_INTERVAL.
13676
13677 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13678 Remove duplicated buffer name initialization.
13679
3f83ace8
JM
136802012-05-02 Jim Meyering <jim@meyering.net>
13681
13682 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13683
c7b8541e
JM
13684 * xfns.c (x_window): Use xstrdup (Bug#11375).
13685
90207a15 136862012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
13687
13688 * xdisp.c (pos_visible_p): If already at a newline from the
13689 display string before the 'while' loop, don't walk back the glyphs
13690 from it3.glyph_row. Solves assertion violation when the display
13691 string begins with a newline (egg.el). (Bug#11367)
13692
b593d6a9
AH
136932012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13694
13695 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13696 Move to simple.el.
13697
4737362e
GM
136982012-05-01 Glenn Morris <rgm@gnu.org>
13699
99cf43f9
GM
13700 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13701 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13702 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13703 All were removed before 23.1.
13704
9311dcff
GM
13705 * dispnew.c: Remove HAVE_LIBNCURSES test;
13706 it is always true on relevant platforms.
13707
4d5c6349
GM
13708 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13709 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13710
4737362e
GM
13711 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13712
74dd3a6b
AS
137132012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13714
13715 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13716 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13717 Remove.
13718
13c379ee
PE
137192012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13720
13721 Do not avoid creating empty evaporating overlays (Bug#9642).
13722 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13723 That is, do not delete an evaporating overlay if it becomes
13724 empty after its bounds are adjusted to fit within its buffer.
13725 This fix caused other problems, and I'm reverting it until we get
13726 to the bottom of them.
13727
a8e7d6d7 137282012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
13729
13730 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13731
a8e7d6d7 137322012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
13733
13734 * xdisp.c (pos_visible_p): If the window start position is beyond
13735 ZV, start the display from buffer beginning. Prevents assertion
13736 violation in init_iterator when the minibuffer window is scrolled
13737 via the scroll bar.
13738
13739 * window.c (window_scroll_pixel_based): Likewise.
13740
a8e7d6d7 137412012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
13742
13743 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13744
a8e7d6d7 137452012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
13746
13747 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13748 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13749
a8e7d6d7 137502012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 13751
b593d6a9
AH
13752 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13753 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 13754
1c6900d9
EZ
137552012-04-26 Eli Zaretskii <eliz@gnu.org>
13756
4c3fa1d9
EZ
13757 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13758 display element, check also the underlying string or buffer
13759 character. (Bug#11341)
13760
1c6900d9
EZ
13761 * w32menu.c: Include w32heap.h.
13762 (add_menu_item): If the call to AppendMenuW (via
13763 unicode_append_menu) fails, disable Unicode menus only if we are
13764 running on Windows 9X/Me.
13765
42bf8205
AS
137662012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13767
13768 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13769 (xgetint): Add missing shift for LSB tags.
13770
b1bac16e
MR
137712012-04-24 Martin Rudalics <rudalics@gmx.at>
13772
13773 * keyboard.c (read_char): Don't wipe echo area for select window
13774 events: These might get delayed via `mouse-autoselect-window'
13775 (Bug#11304).
13776
d69621cc
JB
137772012-04-24 Juanma Barranquero <lekktu@gmail.com>
13778
13779 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13780 manipulation of :loaded-from data.
13781
02fd101b
JB
137822012-04-23 Juanma Barranquero <lekktu@gmail.com>
13783
13784 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13785 now a cons (bug#11311).
13786
888bec30
PE
137872012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13788
89a438bd
PE
13789 Do not create empty overlays with the evaporate property (Bug#9642).
13790 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13791 if it becomes empty after its bounds are adjusted to fit within
13792 its buffer. Without this fix, in a nonempty buffer (let ((o
13793 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13794 yields an empty overlay that has the evaporate property, which is
13795 not supposed to happen.
13796
1068fe4d
PE
13797 Fix minor GTK3 problems found by static checking.
13798 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13799 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13800 (struct _EmacsFixedClass, emacs_fixed_get_type):
13801 Move decls here from emacsgtkfixed.h, since they needn't be public.
13802 (emacs_fixed_get_type): Now static.
13803 (emacs_fixed_class_init): Omit unused local.
13804 (emacs_fixed_child_type): Remove; unused.
13805 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13806 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13807 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13808 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13809 (EMACS_FIXED_GET_CLASS): Remove; unused.
13810 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13811
888bec30
PE
13812 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13813 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13814
de85e130
PE
138152012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13816
d0baac98 13817 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 13818 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
13819 (__malloc_size_t, __malloc_ptrdiff_t):
13820 Remove. All uses removed, replaced by the definiens if needed,
13821 since we can assume C89 or better now.
13822 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13823 (protect_malloc_state, align, get_contiguous_space)
13824 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13825 (malloc_atfork_handler_child, malloc_enable_thread)
13826 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13827 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13828 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13829 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13830 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13831 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13832 Define using prototypes, not old style.
13833 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13834 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13835 (align): Don't assume that signed integer overflow wraps around.
13836 Omit unused local var.
13837 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13838 (_free_internal_nolock, memalign, mallochook, reallochook):
13839 Omit no-longer-needed casts.
13840 (valloc): Use getpagesize, not __getpagesize.
13841 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13842 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13843
de85e130
PE
13844 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13845
dcbf5805
MA
138462012-04-22 Michael Albinus <michael.albinus@gmx.de>
13847
13848 Move functions from C to Lisp. Make non-blocking method calls
13849 the default. Implement further D-Bus standard interfaces.
13850
13851 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13852 (QCdbus_request_name_allow_replacement)
13853 (QCdbus_request_name_replace_existing)
13854 (QCdbus_request_name_do_not_queue)
13855 (QCdbus_request_name_reply_primary_owner)
13856 (QCdbus_request_name_reply_in_queue)
13857 (QCdbus_request_name_reply_exists)
13858 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13859 (QCdbus_registered_serial, QCdbus_registered_method)
13860 (QCdbus_registered_signal): New Lisp objects.
13861 (XD_DEBUG_MESSAGE): Use sizeof.
13862 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13863 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13864 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13865 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13866 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13867 (xd_signature, xd_append_arg): Allow float for integer types.
13868 (xd_get_connection_references): New function.
b593d6a9
AH
13869 (xd_get_connection_address): Rename from xd_initialize.
13870 Return cached address.
dcbf5805
MA
13871 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13872 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13873 level.
13874 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 13875 Return number of refcounts.
dcbf5805
MA
13876 (Fdbus_get_unique_name): Make stronger parameter check.
13877 (Fdbus_message_internal): New defun.
13878 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13879 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13880 (Fdbus_send_signal, Fdbus_register_service)
13881 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13882 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13883 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13884 (Vdbus_compiled_version, Vdbus_runtime_version)
13885 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13886 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13887 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
13888 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13889 Adapt docstring.
dcbf5805 13890
52828e02
PE
138912012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13892
da05bc4c
PE
13893 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13894 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13895 Do not assume ptrdiff_t is the same width as 'int'.
13896
52828e02
PE
13897 * alloc.c: Handle unusual debugging option combinations.
13898 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13899 since the two debugging options are incompatible.
13900 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13901 is defined.
13902 (mem_init, mem_insert, mem_insert_fixup):
13903 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13904 (NEED_MEM_INSERT): Remove; no longer needed.
13905
f01769f9
LL
139062012-04-22 Leo Liu <sdl.web@gmail.com>
13907
13908 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13909
5790543d
PE
139102012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13911
13912 * sysdep.c [__FreeBSD__]: Minor cleanups.
13913 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13914 Use Emacs indenting style more consistently. Avoid some casts.
13915 Use 'double' consistently rather than mixing 'float' and 'double'.
13916
b91b7e4d
EW
139172012-04-21 Eduard Wiebe <usenet@pusto.de>
13918
b593d6a9
AH
13919 * sysdep.c (list_system_processes, system_process_attributes):
13920 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 13921
6114eb15
AS
139222012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13923
13924 * lisp.mk (lisp): Update.
13925
2f38dff7
PE
139262012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13927
13928 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13929 It is never used otherwise.
13930
4ae29f89
SM
139312012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13932
13933 * print.c (print_preprocess): Only check print_depth if print-circle
13934 is nil.
13935 (print_object): Check for cycles even when print-circle is nil and
13936 print-gensym is t, but only check print_depth if print-circle is nil.
13937
f30d612a
CY
139382012-04-20 Chong Yidong <cyd@gnu.org>
13939
13940 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13941 set the status to "failed" and ensure that sentinel is run.
13942
c07a4c0b 139432012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
13944
13945 * process.c (Fset_process_inherit_coding_system_flag)
13946 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 13947 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 13948
c07a4c0b 139492012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
13950
13951 * xdisp.c (string_buffer_position_lim): Limit starting position to
13952 BEGV.
13953 (set_cursor_from_row): If called for a mode-line or header-line
13954 row, return zero immediately.
13955 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
13956 farther than the first row after the header line, if any.
13957 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
13958 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13959
c07a4c0b 139602012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13961
4ae29f89
SM
13962 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13963 (bug#11238).
ad3a2b41 13964
c07a4c0b 139652012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 139662012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
13967
13968 configure: new option --enable-gcc-warnings (Bug#11207)
13969 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13970 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13971 (ALL_CFLAGS): Use new macros rather than old.
13972 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13973 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13974 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13975 -Wunused-result, -Wunused-variable. This should go away once
13976 the Emacs and Gnulib regex code is merged.
13977 (xmalloc, xrealloc): Now static.
13978
aba027e8
PE
139792012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13980
13981 * dired.c (Fsystem_groups): Remove unused local.
13982
e5a36063
GM
139832012-04-17 Glenn Morris <rgm@gnu.org>
13984
13985 * dired.c (Fsystem_users): Doc fix.
13986
316411f0
DA
139872012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13988
13989 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13990 (syms_of_dired): Add them.
13991
9426aba4
PE
139922012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13993
b62a57be
PE
13994 Fix minor alloc.c problems found by static checking.
13995 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13996 New extern decls, to avoid calling undeclared functions.
13997 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13998 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13999 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14000 (NEED_MEM_INSERT): New macro.
14001 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 14002 Remove one incorrect comment and fix another.
b62a57be 14003
3539f31f
PE
14004 Fix minor ralloc.c problems found by static checking.
14005 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14006 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14007 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14008 (r_alloc_sbrk): Now static.
14009
a041960a
PE
14010 Improve ralloc.c interface checking.
14011 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14012 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14013 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14014 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14015 [REL_ALLOC]: ... to here, to check interface.
14016 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14017 Remove decls. This fixes an "It stinks!".
14018
9426aba4
PE
14019 * alloc.c (which_symbols): Fix alignment issue / type clash.
14020
d55c12ed
AS
140212012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14022
14023 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14024 (struct Lisp_Misc_Any): Likewise.
14025 (struct Lisp_Free): Likewise.
14026 * alloc.c (union aligned_Lisp_Symbol): Define.
14027 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14028 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14029 (union aligned_Lisp_Misc): Define.
14030 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14031 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 14032 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 14033
b948ce8b
PE
140342012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14035
14036 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14037 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14038 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14039 * s/netbsd.h, s/sol2-6.h:
14040 Remove definition of GC_MARK_STACK, since the default now works.
14041 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14042 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14043 no longer the default.
14044 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14045
35dc09a1 140462012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14047
35dc09a1
GM
14048 * lread.c (lisp_file_lexically_bound_p):
14049 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 14050
35dc09a1
GM
140512012-04-14 Eli Zaretskii <eliz@gnu.org>
14052
14053 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14054 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14055
140562012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14057
14058 * nsterm.m (constrainFrameRect): Always constrain when there is only
14059 one screen (Bug#10962).
14060
bcd86815
KB
140612012-04-13 Ken Brown <kbrown@cornell.edu>
14062
14063 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14064
c25df26e
RT
140652012-04-13 Reuben Thomas <rrt@sc3d.org>
14066
14067 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14068
0fc59f1e
DC
140692012-04-11 Daniel Colascione <dancol@dancol.org>
14070
14071 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14072 against is gone. It's better to use vfork now so that when Cygwin
14073 gains a new, working vfork, we use it automatically (bug#10398).
14074
de8c03dc
SM
140752012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14076
14077 * window.c (save_window_save): Obey window-point-insertion-type.
14078
2f097256
GM
140792012-04-11 Glenn Morris <rgm@gnu.org>
14080
14081 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14082
453b951e
SM
140832012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14084
14085 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14086
75f1671a 140872012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
14088
14089 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14090 (force_quit_count): New var.
14091 (handle_interrupt): Use it.
14092
2a8ce227
JB
140932012-04-10 Juanma Barranquero <lekktu@gmail.com>
14094
14095 * w32.c (w32_delayed_load): Record the full path of the library
14096 being loaded (bug#10424).
14097
935396c0
GM
140982012-04-09 Glenn Morris <rgm@gnu.org>
14099
05920a43
GM
14100 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14101 not just in the obarray, before snarfing them. (Bug#11036)
14102
935396c0
GM
14103 * Makefile.in ($(leimdir)/leim-list.el):
14104 Pass EMACS rather than BUILT_EMACS.
14105
a18ecafa
TZ
141062012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14107
14108 * process.c (make_process):
14109 * process.h: Add integer `gnutls_handshakes_tried' member to
14110 process struct.
14111
6bbef4e5
JC
14112 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14113 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
14114
14115 * gnutls.c (gnutls_log_function2i): Convenience log function.
14116 (emacs_gnutls_read): Use new log functions,
14117 `gnutls_handshakes_tried' process member, and
14118 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14119 attempts per process (connection).
14120
b4d3bc10
CY
141212012-04-09 Chong Yidong <cyd@gnu.org>
14122
14123 * eval.c (Fuser_variable_p, user_variable_p_eh)
14124 (lisp_indirect_variable): Functions deleted.
14125 (Fdefvar): Caller changed.
14126
14127 * callint.c (Finteractive, Fcall_interactively):
14128 * minibuf.c (Fread_variable): Callers changed.
14129
70f4d973
EZ
141302012-04-09 Eli Zaretskii <eliz@gnu.org>
14131
14132 * xdisp.c (set_cursor_from_row): If the display string appears in
14133 the buffer at position that is closer to point than the position
14134 after the display string, display the cursor on the first glyph of
14135 the display string. Fixes cursor display when a 'display' text
14136 property immediately follows invisible text. (Bug#11094)
14137
cb3c2e3e
PE
141382012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14139
14140 composite.c: use 'double' consistently
14141 * composite.c (get_composition_id): Use 'double' consistently
14142 instead of converting 'float' to 'double' and vice versa; this is
14143 easier to understand and avoids a GCC warning.
14144
fd06db5d
GM
141452012-04-09 Glenn Morris <rgm@gnu.org>
14146
50fe702a
GM
14147 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14148 preparation for dumping it with emacs. (Bug#4789)
14149 (leimdir): New variable.
14150 ($(leimdir)/leim-list.el): New rule.
14151 (emacs$(EXEEXT)): Depend on leim-list.el.
14152
fd06db5d
GM
14153 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14154 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14155 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14156
55c131ee
AS
141572012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14158
14159 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14160 proper alignment.
14161
9209588f
JB
141622012-04-07 Juanma Barranquero <lekktu@gmail.com>
14163
14164 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14165 Remove unused local variable.
14166
e3fb2efb
PE
141672012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14168
14169 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14170 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14171 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14172 objects, as mark_maybe_pointer will catch them otherwise.
14173 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14174 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14175
b5385551
PE
141762012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14177
14178 Fix typo that broke non-Windows builds.
14179 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14180
9078ead6
EZ
141812012-04-07 Eli Zaretskii <eliz@gnu.org>
14182
14183 Support building on MS-Windows with libxml2.
14184
14185 * makefile.w32-in (OBJ2): Add xml.$(O).
14186 (GLOBAL_SOURCES): Add xml.c.
14187 ($(BLD)/xml.$(O)): New dependency list.
14188
14189 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14190 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14191 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14192 [!WINDOWSNT]: New macros.
14193 (init_libxml2_functions, libxml2_loaded_p): New functions.
14194 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14195 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14196 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14197 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14198 linked in).
6bbef4e5
JC
14199 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14200 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
14201 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14202
14203 * emacs.c: Don't include libxml/parser.h.
14204 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14205 xmlCleanupParser directly.
14206
14207 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14208
3811fdf3
EZ
142092012-04-07 Eli Zaretskii <eliz@gnu.org>
14210
14211 * indent.c (Fvertical_motion): If there is a display string at
14212 point, use it.vpos to compute how many lines to backtrack after
14213 move_it_to point. (Bug#11133)
14214
2f8e16b2
EZ
142152012-04-06 Eli Zaretskii <eliz@gnu.org>
14216
14217 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14218 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14219 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14220 macros related to unification of CJK characters. For the details,
14221 see the discussion following the message here:
14222 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14223
3d439cd1
CY
142242012-04-04 Chong Yidong <cyd@gnu.org>
14225
14226 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14227
8bc53d00
EZ
142282012-04-01 Eli Zaretskii <eliz@gnu.org>
14229
14230 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14231 instead of alloca. (Bug#11138)
14232
3b0512a3
AS
142332012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14234
14235 * w32menu.c (is_simple_dialog): Properly check lisp types.
14236 (Bug#11141)
14237
8427ddd2
EZ
142382012-03-31 Eli Zaretskii <eliz@gnu.org>
14239
979022ef
EZ
14240 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14241 position we get to after a call to move_it_to fails the
14242 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14243 only if we wind up in a string from display property. (Bug#11063)
14244
a6b1c7cc
EZ
14245 * window.c (Fdelete_other_windows_internal): Invalidate the row
14246 and column information about mouse highlight, so that redisplay
14247 restores it after reallocating the glyph matrices. (Bug#7464)
14248
8427ddd2
EZ
14249 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14250 string comes from a `display' text property, use the buffer
14251 position of that property as if we actually saw that position in
14252 the row's glyphs.
697ba24b
EZ
14253 (move_it_by_lines): Remove the assertion that
14254 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14255 violated when there's a before-string at the beginning of a line.
14256 (Bug#11063)
8427ddd2 14257
65a0a738
EZ
142582012-03-30 Eli Zaretskii <eliz@gnu.org>
14259
14260 * xdisp.c (append_space_for_newline): If the default face was
14261 remapped, use the remapped face for the appended newline.
14262 (extend_face_to_end_of_line): Use the remapped default face for
14263 extending the face to the end of the line.
14264 (display_line): Call extend_face_to_end_of_line when the default
14265 face was remapped. (Bug#11068)
14266
581355cc
EZ
142672012-03-29 Eli Zaretskii <eliz@gnu.org>
14268
14269 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14270
e8fc049f
SM
142712012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14272
14273 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14274
4fb9a543
GM
142752012-03-27 Glenn Morris <rgm@gnu.org>
14276
14277 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14278 Doc fixes.
14279
679910f1
KH
142802012-03-26 Kenichi Handa <handa@m17n.org>
14281
14282 * dispextern.h (struct glyph): Fix previous change. Change the
14283 bit length of glyphless.ch to 25 (Bug#11082).
14284
90d49b7f
CY
142852012-03-26 Chong Yidong <cyd@gnu.org>
14286
14287 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14288 (command_loop_1): Use it; inhibit selection update for
14289 handle-select-window too (Bug#8996).
14290
f514f6f0
FP
142912012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14292
e8fc049f 14293 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 14294
bf43fa51
KH
142952012-03-25 Kenichi Handa <handa@m17n.org>
14296
14297 * dispextern.h (struct glyph): Change the bit length of
14298 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14299
8a0c01dd
EZ
143002012-03-24 Eli Zaretskii <eliz@gnu.org>
14301
14302 * s/ms-w32.h (tzname): Include time.h before redirecting to
14303 _tzname. Fixes the MSVC build. (Bug#9960)
14304
7d1c3a76
AS
143052012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14306
8ed79523
AS
14307 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14308 characters.
14309
7d1c3a76
AS
14310 * xterm.c (XTread_socket): Only modify handling_signal if
14311 !SYNC_INPUT. (Bug#11080)
14312
e99a9b8b
EZ
143132012-03-23 Eli Zaretskii <eliz@gnu.org>
14314
14315 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14316 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14317 when fetching a multibyte character consumes more bytes than
14318 CHAR_BYTES returns, due to unification of CJK characters in
14319 string_char. (Bug#11073)
14320
5063c0e1
TN
143212012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14322
14323 * process.c (wait_reading_process_output): Handle pty disconnect
14324 by refraining from sending oneself a SIGCHLD (bug#10933).
14325
9f851fbd
CY
143262012-03-22 Chong Yidong <cyd@gnu.org>
14327
14328 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14329
5063c0e1 14330 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
14331 Mark string as coming from a prefix property.
14332 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14333 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14334
fb5b8aca
CY
143352012-03-21 Chong Yidong <cyd@gnu.org>
14336
14337 * xfaces.c (Vface_remapping_alist): Doc fix.
14338
62356a1b
EZ
143392012-03-20 Eli Zaretskii <eliz@gnu.org>
14340
14341 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
14342 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14343 Doc fixes.
62356a1b 14344
025de85b
CY
143452012-03-20 Chong Yidong <cyd@gnu.org>
14346
14347 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14348 to reflect default non-nil value of redisplay-dont-pause.
14349
4827f94e
KH
143502012-03-19 Kenichi Handa <handa@m17n.org>
14351
14352 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14353 it fit in a valid range (Bug#11003).
14354
e50a24a2
EZ
143552012-03-18 Eli Zaretskii <eliz@gnu.org>
14356
14357 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14358 that is not from display property, accept the row as a "cursor
14359 row" if one of the string's character has a non-nil `cursor'
14360 property. Fixes cursor positioning when there are newlines in
14361 overlay strings, e.g. in icomplete.el. (Bug#11035)
14362
9af5ed87
PE
143632012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14364
14365 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14366
d1f55f16
CY
143672012-03-12 Chong Yidong <cyd@gnu.org>
14368
14369 * eval.c (inhibit_lisp_code): Rename from
14370 inhibit_window_configuration_change_hook; move from window.c.
14371
14372 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14373 * window.c (run_window_configuration_change_hook)
14374 (syms_of_window): Callers changed.
14375
66c5eebd
CY
143762012-03-11 Chong Yidong <cyd@gnu.org>
14377
413df973
CY
14378 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14379
66c5eebd
CY
14380 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14381
1de11f56
CY
143822012-03-10 Chong Yidong <cyd@gnu.org>
14383
14384 * frame.c (other_visible_frames): Don't assume the selected frame
14385 is visible (Bug#10955).
14386
cae07000
SM
143872012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14388
14389 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14390
89c94350
JD
143912012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14392
14393 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14394 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14395 zero (Bug#10954).
14396
999dd333
GM
143972012-03-03 Glenn Morris <rgm@gnu.org>
14398
01a6dcc8 14399 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 14400
de0100f2
EZ
144012012-03-02 Eli Zaretskii <eliz@gnu.org>
14402
14403 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14404 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
14405 (redisplay_window, next_element_from_string): Fix typos in
14406 comments.
3e441275
EZ
14407 (redisplay_window): Pass to move_it_vertically the margin in
14408 pixels, not in screen lines.
de0100f2 14409
96a72ee9
GM
144102012-03-02 Glenn Morris <rgm@gnu.org>
14411
14412 * buffer.c (buffer-list-update-hook): Doc fix.
14413
312508d7
EZ
144142012-02-29 Eli Zaretskii <eliz@gnu.org>
14415
14416 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14417 push_it before setting up the iterator for the first overlay
14418 string, even if we have an empty string loaded.
14419 (next_overlay_string): If there's an empty string on the iterator
14420 stack, pop the stack. (Bug#10903)
14421
27f3c637
PE
144222012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14423
14424 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14425 Suggested by Stefan Monnier in
14426 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14427 * alloc.c (widen_to_Lisp_Object): New static function.
14428 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14429 and widening them to Lisp_Objects. This would work even if
14430 USE_LSB_TAG is defined and wide integers are used, which might
14431 happen in a future version of Emacs.
14432
3c9dfce6
CY
144332012-02-25 Chong Yidong <cyd@gnu.org>
14434
fa74b241
CY
14435 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14436 Doc fix.
14437
3c9dfce6
CY
14438 * xselect.c (Fx_selection_exists_p): Doc fix.
14439 (x_clipboard_manager_save_all): Print an informative message
14440 before saving to clipboard manager.
14441
9486df08
CY
144422012-02-24 Chong Yidong <cyd@gnu.org>
14443
14444 * keyboard.c (process_special_events): Handle all X selection
14445 requests in kbd_buffer, not just the next one (Bug#8869).
14446
f01d3321
CY
144472012-02-23 Chong Yidong <cyd@gnu.org>
14448
14449 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14450 call when setting menu-bar-lines and tool-bar-lines parameters.
14451 (unwind_create_frame_1): New helper function.
14452
14453 * window.c (inhibit_window_configuration_change_hook): New var.
14454 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 14455 (syms_of_window): Initialize it.
f01d3321 14456
86b847b6
CY
144572012-02-22 Chong Yidong <cyd@gnu.org>
14458
14459 * xterm.c (x_draw_image_relief): Add missing type check for
14460 Vtool_bar_button_margin (Bug#10743).
14461
a59225b1
CY
144622012-02-21 Chong Yidong <cyd@gnu.org>
14463
14464 * fileio.c (Vfile_name_handler_alist): Doc fix.
14465
14466 * buffer.c (Fget_file_buffer): Protect against invalid file
14467 handler return value.
14468
310f5bd4
PE
144692012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14470
cb3a28cc
PE
14471 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14472 when computing $valmask.
14473
310f5bd4
PE
14474 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14475 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14476 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14477 It's useless in that case, and it can cause problems on hosts
14478 that allocate halves of EMACS_INT values separately.
14479 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14480 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14481 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14482 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14483 it avoids undefined behavior on hosts where shifting right by more
14484 than the word width has undefined behavior.
14485
2375c96a
CY
144862012-02-19 Chong Yidong <cyd@gnu.org>
14487
14488 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14489 (Funhandled_file_name_directory, Ffile_name_as_directory)
14490 (Fdirectory_file_name, Fexpand_file_name)
14491 (Fsubstitute_in_file_name): Protect against invalid file handler
14492 return values (Bug#10845).
14493
3eb49e71
EZ
144942012-02-18 Eli Zaretskii <eliz@gnu.org>
14495
14496 * .gdbinit (pitx): Fix incorrect references to fields of the
14497 iterator stack.
14498
7b926f3f
CY
144992012-02-17 Chong Yidong <cyd@gnu.org>
14500
14501 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14502
11273115
PE
145032012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14504
14505 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14506 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14507
c3a70e2b
CY
145082012-02-15 Chong Yidong <cyd@gnu.org>
14509
14510 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14511 marked as special. Also, starting docstrings with * is obsolete.
14512
0ca43699
AS
145132012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14514
14515 * gnutls.c (emacs_gnutls_write): Fix last change.
14516
2e8f3c56
LI
145172012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14518
14519 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14520 send_process.
14521
af70074f
SM
145222012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14523
14524 * keymap.c (Fsingle_key_description): Handle char ranges.
14525
95986d52
CY
145262012-02-12 Chong Yidong <cyd@gnu.org>
14527
afd83bd1
CY
14528 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14529 as that creates a dangerous corner case.
14530
95986d52
CY
14531 * window.c (Fdelete_window_internal): Invalidate the mouse
14532 highlight (Bug#9904).
14533
bd7da63e
GM
145342012-02-12 Glenn Morris <rgm@gnu.org>
14535
14536 * xselect.c (Fx_own_selection_internal)
14537 (Fx_get_selection_internal, Fx_disown_selection_internal)
14538 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14539 * nsselect.m (Fx_own_selection_internal)
14540 (Fx_disown_selection_internal, Fx_selection_exists_p)
14541 (Fx_selection_owner_p, Fx_get_selection_internal):
14542 Sync docs and argument specs with the xselect.c versions.
14543
77abcbc2
LI
145442012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14545
14546 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14547
90b671e2
EZ
145482012-02-11 Eli Zaretskii <eliz@gnu.org>
14549
1c0ca0b7
EZ
14550 * w32select.c (Fx_selection_exists_p): Sync doc string and
14551 argument list with xselect.c. (Bug#10783)
14552
14553 * w16select.c (Fx_selection_exists_p): Sync doc string and
14554 argument list with xselect.c. (Bug#10783)
90b671e2 14555
49241268
GM
145562012-02-10 Glenn Morris <rgm@gnu.org>
14557
14558 * fns.c (Fsecure_hash): Doc fix.
14559
f998bbe7 145602012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
14561
14562 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14563
0992bd9c
CY
145642012-02-07 Chong Yidong <cyd@gnu.org>
14565
14566 * buffer.c (Fbuffer_local_variables)
14567 (buffer_lisp_local_variables): Handle unbound vars correctly;
14568 don't let Qunbound leak into Lisp.
14569
af008560
GM
145702012-02-07 Glenn Morris <rgm@gnu.org>
14571
dd605cc4
GM
14572 * image.c (Fimagemagick_types): Doc fix.
14573
af008560
GM
14574 * image.c (imagemagick-render-type): Change it from a lisp object
14575 to an integer. Move the doc here from the lisp manual.
14576 Treat all values not equal to 0 the same.
14577
1449fa1d
CY
145782012-02-06 Chong Yidong <cyd@gnu.org>
14579
14580 * doc.c (store_function_docstring): Avoid applying docstring of
14581 alias to base function (Bug#2603).
14582
3723ec07
AS
145832012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14584
14585 * .gdbinit (pp1, pv1): Remove redundant defines.
14586 (pr): Use pp.
14587
79c1cc1e
CY
145882012-02-04 Chong Yidong <cyd@gnu.org>
14589
14590 * nsterm.m: Declare a global (Bug#10694).
14591
d7f29f8e
EZ
145922012-02-04 Eli Zaretskii <eliz@gnu.org>
14593
cae07000
SM
14594 * w32.c (get_emacs_configuration_options):
14595 Include --enable-checking, if specified, in the return value.
d7f29f8e 14596
3b95a6f9
MR
145972012-02-04 Martin Rudalics <rudalics@gmx.at>
14598
14599 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14600 after rounding frame sizes. (Bug#9723)
14601
d6fa96a6
EZ
146022012-02-04 Eli Zaretskii <eliz@gnu.org>
14603
14604 * keyboard.c (adjust_point_for_property): Don't position point
14605 before BEGV. (Bug#10696)
14606
df0b2940
PE
146072012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14608
14609 Handle overflow when computing char display width (Bug#9496).
14610 * character.c (char_width): Return EMACS_INT, not int.
14611 (char_width, c_string_width): Check for overflow when
14612 computing the width; this is possible now that individual
14613 characters can have unbounded width. Problem introduced
14614 by merge from Emacs 23 on 2012-01-19.
14615
6bee44d6
MA
146162012-02-02 Michael Albinus <michael.albinus@gmx.de>
14617
14618 * dbusbind.c (Fdbus_register_method): Mention the return value
14619 :ignore in the docstring.
14620
44f92739
GM
146212012-02-02 Glenn Morris <rgm@gnu.org>
14622
1b9f60cc
GM
14623 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14624
44f92739
GM
14625 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14626 Unconditionally set to t. (Bug#10673)
14627 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14628 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14629 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14630
c5d3843c
KH
146312012-02-02 Kenichi Handa <handa@m17n.org>
14632
14633 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14634 0, do not call append_composite_glyph.
14635
159462d4 146362012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
14637
14638 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14639 NULL (Bug#6988).
14640 (x_produce_glyphs): If the component of a composition is a null
14641 string, set it->pixel_width to 1 to avoid zero-width glyph.
14642
78cef877
EZ
146432012-02-01 Eli Zaretskii <eliz@gnu.org>
14644
14645 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14646 first 2 arguments are identical. This makes inserting large
14647 output from a subprocess an order of magnitude faster on
14648 MS-Windows, where all sbrk'ed memory is always contiguous.
14649
97897668
GM
146502012-01-31 Glenn Morris <rgm@gnu.org>
14651
14652 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 14653 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
14654 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14655
31fd3586
GM
146562012-01-29 Glenn Morris <rgm@gnu.org>
14657
14658 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14659
0e24a8b2
CY
146602012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14661
14662 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14663
cc0adcb0
CY
146642012-01-28 Chong Yidong <cyd@gnu.org>
14665
14666 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14667
acc28cb9
CY
146682012-01-26 Chong Yidong <cyd@gnu.org>
14669
9c69cfb7
CY
14670 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14671
acc28cb9
CY
14672 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14673 repeat counts (Bug#10507).
14674
48da7392
GM
146752012-01-26 Glenn Morris <rgm@gnu.org>
14676
14677 * lread.c (syms_of_lread): Doc fix.
14678
14af5f7f
CY
146792012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14680
14681 * coding.c (encode_designation_at_bol): Change return value to
14682 EMACS_INT.
14683
0b21c100
CY
146842012-01-25 Chong Yidong <cyd@gnu.org>
14685
14686 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14687
3c2907f7
CY
146882012-01-21 Chong Yidong <cyd@gnu.org>
14689
14690 * floatfns.c (Fcopysign): Make the second argument non-optional,
14691 since nil is not allowed anyway.
14692
959ad23f
AS
146932012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14694
14695 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14696 (send_process): Likewise.
14697
34a02f46
MR
146982012-01-19 Martin Rudalics <rudalics@gmx.at>
14699
14700 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
14701 (Vwindow_persistent_parameters): Do not use Qstate.
14702 Rewrite doc-strings.
34a02f46 14703
1259009a 147042012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
14705
14706 * character.c (char_width): New function.
70d4fdf6
GM
14707 (Fchar_width, c_string_width, lisp_string_width):
14708 Use char_width (Bug#9496).
25ed9e61 14709
6a6ee00d
MR
147102012-01-16 Martin Rudalics <rudalics@gmx.at>
14711
14712 * window.c (Vwindow_persistent_parameters): New variable.
14713 (Fset_window_configuration, save_window_save): Handle persistent
14714 window parameters.
14715
c85efaf7
EZ
147162012-01-14 Eli Zaretskii <eliz@gnu.org>
14717
14718 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14719 thrashing the stack of the thread. (Bug#9087)
14720
5944709e
PE
147212012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14722
14723 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14724
e71f5d99
EZ
147252012-01-11 Eli Zaretskii <eliz@gnu.org>
14726
14727 * xdisp.c (rows_from_pos_range): Handle the case where the
14728 highlight ends on a newline. (Bug#10464)
14729 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14730 he end column for display of highlight that ends on a newline
14731 before a R2L line.
14732
ce316182
GM
147332012-01-11 Glenn Morris <rgm@gnu.org>
14734
14735 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14736 from load-path also when installation-directory is nil. (Bug#10208)
14737
5b43da69
GM
147382012-01-10 Glenn Morris <rgm@gnu.org>
14739
74cc8ff9
GM
14740 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14741
7d8d6e4e
GM
14742 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14743 Update template values to be closer to their typical values these days.
5b43da69 14744
a0db8d43
EZ
147452012-01-09 Eli Zaretskii <eliz@gnu.org>
14746
14747 * xdisp.c (rows_from_pos_range): Accept additional argument
14748 DISP_STRING, and accept any glyph in a row whose object is that
14749 string as eligible for mouse highlight. Fixes mouse highlight of
14750 display strings from overlays. (Bug#10464)
14751
9a0115ab 147522012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 14753
b9110d6a 14754 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
14755 * fileio.c (auto_saving_dir_umask): New static var.
14756 (Fmake_directory_internal): Use it.
14757 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14758 creating the directory. The old code temporarily assigns
14759 too-generous permissions to the directory.
14760 (do_auto_save_eh): Clear it.
b9110d6a 14761 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
14762 that the var is always cleared.
14763
6c1bd3f3
EZ
147642012-01-07 Eli Zaretskii <eliz@gnu.org>
14765
14766 * search.c (scan_buffer): Pass character positions to
14767 know_region_cache, not byte positions. (Bug#6540)
14768
069d2b50
L
147692012-01-07 LynX <_LynX@bk.ru> (tiny change)
14770
14771 * w32.c (sys_rename): Report EXDEV when rename of a directory
14772 fails because the target is on another logical disk. (Bug#10284)
14773
75bf0d33
DB
147742012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14775
14776 * xterm.c (x_embed_request_focus): New function.
14777
14778 * xterm.h: Add prototype.
14779
14780 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14781
1c6e5a32
GM
147822012-01-05 Glenn Morris <rgm@gnu.org>
14783
14784 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14785
651e947e
EZ
147862012-01-01 Eli Zaretskii <eliz@gnu.org>
14787
14788 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14789 Load gnutls_transport_set_lowat only if GnuTLS version is below
14790 2.11.1.
14791 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14792 GnuTLS versions below 2.11.1.
14793
3778cdd8
AL
147942011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14795
14796 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14797 to the doc string advising against its use for altering the way
14798 windows are scrolled.
14799
0e5317f7
KH
148002011-12-28 Kenichi Handa <handa@m17n.org>
14801
14802 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14803 coding-system ASCII compatible only when it does not produce BOM
14804 on encoding (Bug#10383).
14805
93d5ca1f
JD
148062011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14807
14808 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14809 can scroll.
14810 (create_and_show_popup_menu): Always use menu_position_func for
14811 Gtk3 (Bug#10361).
14812
ca22b785
AS
148132011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14814
14815 * callint.c (Fcall_interactively): Don't truncate prompt string.
14816
d048e1e6
EZ
148172011-12-23 Eli Zaretskii <eliz@gnu.org>
14818
14819 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14820 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 14821 resumed from there (after widening). (Bug#10360)
d048e1e6 14822
5ccaba1f
JD
148232011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14824
14825 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14826
204ee57f
JD
148272011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14828
b81d40f0
JB
14829 * nsterm.m (x_free_frame_resources):
14830 Release f->output_data.ns->miniimage.
204ee57f
JD
14831 (ns_index_color): Fix indentation. Do not retain
14832 color_table->colors[i].
14833
14834 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14835 before returning.
14836
14837 * nsfns.m (x_set_background_color): Assign return value from
14838 ns_index_color to face-background instead of NSColor*.
14839 (ns_implicitly_set_icon_type): Fix indentation.
14840 Change assignment in for loop to comparison.
14841
14842 * emacs.c (ns_pool): New variable.
14843 (main): Assign ns_pool.
14844 (Fkill_emacs): Call ns_release_autorelease_pool.
14845
14846 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14847 autorelease fdesc, release fdAttrs and tdict.
14848 (ns_get_covering_families): Release charset.
14849 (ns_findfonts): Release NSFontDescriptor created with new.
14850 (ns_uni_to_glyphs): Fix indentation.
14851 (setString): Release attrStr before assigning new value.
14852
c803b2b7
JD
148532011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14854
678f4426
JD
14855 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14856 and NS_IMPL_COCOA.
14857 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14858 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14859
cd394be1 148602011-12-18 David Reitter <reitter@cmu.edu>
678f4426 14861
5fecd5fc
JD
14862 * nsterm.m (ns_term_init): Subscribe for notifications
14863 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14864 to method trackingNotification in EmacsMenu.
14865
14866 * nsmenu.m (trackingMenu): New variable.
3771cb17 14867 (trackingNotification): New method (from Aquamacs).
5fecd5fc 14868 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 14869 from Aquamacs (Bug#7030).
678f4426
JD
14870
148712011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 14872
c803b2b7
JD
14873 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14874 (symbol_to_nsstring): Fix indentation.
14875 (ns_symbol_to_pb): New function.
cae07000
SM
14876 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14877 (Fns_rotate_cut_buffers_internal): Remove.
14878 (Fns_store_selection_internal): Rename from
c803b2b7
JD
14879 Fns_store_cut_buffer_internal.
14880 (ns_get_foreign_selection, Fx_own_selection_internal)
14881 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
14882 (Fns_get_selection_internal, Fns_store_selection_internal):
14883 Use ns_symbol_to_pb and check if return value is nil.
14884 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14885 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
14886 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14887 renamed to Sns_store_selection_internal.
14888 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14889 and remove this function.
14890 (ns_handle_selection_clear): Remove, never used.
14891 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14892 here.
14893
e1b01a3a
KB
148942011-12-17 Ken Brown <kbrown@cornell.edu>
14895
14896 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14897 GID is unknown (Bug#10257).
14898
2adb6e85
PE
148992011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14900
14901 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14902 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14903 which caused a build failure on GNU/Linux IA-64. This problem was
14904 introduced by my 2011-10-07 patch.
14905
d1d7b339
JL
149062011-12-15 Juri Linkov <juri@jurta.org>
14907
14908 * image.c (imagemagick_error): New function. (Bug#10112)
14909 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14910 Use `imagemagick_error' where ImageMagick functions return
14911 `MagickFalse'.
14912 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14913 proper order.
14914
100d5755
KH
149152011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14916
14917 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14918 fill background (Bug#8992).
14919
454592a6
MR
149202011-12-13 Martin Rudalics <rudalics@gmx.at>
14921
14922 * window.c (Vwindow_combination_resize)
14923 (Vwindow_combination_limit): Use t instead of non-nil in
14924 doc-strings.
61d4b438
MR
14925 (Vrecenter_redisplay): Add first sentence of doc-string on
14926 separate line.
53524d93 14927 (Frecenter): Fix doc-string typo.
454592a6 14928
3633e3aa
KH
149292011-12-11 Kenichi Handa <handa@m17n.org>
14930
14931 * coding.c (Funencodable_char_position): Pay attention to the
14932 buffer text relocation (Bug#9389).
14933
7b9d523a 149342011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 14935
7b9d523a
JD
14936 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14937 gtk_init (Bug#10100).
14938
b73189c6
EZ
149392011-12-10 Eli Zaretskii <eliz@gnu.org>
14940
14941 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14942 IT->string is nil. (Bug#10263)
14943
f7dfe5d6
JD
149442011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14945
83faebb4
JD
14946 * nsterm.h (x_free_frame_resources): Declare.
14947
f7dfe5d6
JD
14948 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14949 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14950
14951 * nsterm.h (ns_get_defaults_value): Declare.
14952
14953 * nsterm.m (ns_default): Call ns_get_defaults_value.
14954
7cd4e72c
EZ
149552011-12-09 Eli Zaretskii <eliz@gnu.org>
14956
14957 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14958 (Bug#10170)
14959
b34d7317
YM
149602011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14961
14962 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14963 that where the value of an _OBJC_* symbol points to is in the .bss
14964 section (Bug#10240).
14965
76470ad1
KH
149662011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14967
14968 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 14969 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 14970
745fff94
KH
149712011-12-08 Kenichi Handa <handa@m17n.org>
14972
14973 * ftfont.c (get_adstyle_property): Fix previous change
14974 (Bug#10233).
14975
6e44397c
JB
149762011-12-07 Juanma Barranquero <lekktu@gmail.com>
14977
14978 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14979 dirs from the default value of EMACSLOADPATH (bug#10208).
14980
7efa6272
GM
149812011-12-07 Glenn Morris <rgm@gnu.org>
14982
14983 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14984 installation and source directories as well. (Bug#10208)
14985
f6fc4d87
CY
149862011-12-06 Chong Yidong <cyd@gnu.org>
14987
14988 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14989
2bf26180
GM
149902011-12-06 Glenn Morris <rgm@gnu.org>
14991
14992 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14993 as an error, not just -1. (Bug#10217)
14994
3a6ad4f0
CY
149952011-12-05 Chong Yidong <cyd@gnu.org>
14996
14997 * keyboard.c (process_special_events): New function.
14998 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14999
75a3b399
PE
150002011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15001
15002 * coding.c (encode_designation_at_bol): Don't use uninitialized
15003 local variable (Bug#9318).
15004
c3c9e25e
KH
150052011-12-05 Kenichi Handa <handa@m17n.org>
15006
15007 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15008 return Qnil (Bug#8046, Bug#10193).
15009
5eb05ea3
KH
150102011-12-05 Kenichi Handa <handa@m17n.org>
15011
15012 * coding.c (encode_designation_at_bol): New args charbuf_end and
15013 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
15014 (coding_set_source): Return how many bytes coding->source was
15015 relocated.
15016 (coding_set_destination): Return how many bytes
15017 coding->destination was relocated.
15018 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 15019 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
15020
150212011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15022
15023 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15024 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15025 macro (Bug#9318).
15026
150272011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15028
15029 The following changes are to fix Bug#9318.
15030
a79703f5 15031 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
15032 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15033 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 15034 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 15035
7dbda6df
JB
150362011-12-05 Juanma Barranquero <lekktu@gmail.com>
15037
15038 * lisp.h (process_quit_flag): Fix external declaration.
15039
6d5eb5b0
SM
150402011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15041
15042 Don't macro-inline non-performance-critical code.
15043 * eval.c (process_quit_flag): New function.
15044 * lisp.h (QUIT): Use it.
15045
a0c3fad0
JD
150462011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15047
15048 * nsfns.m (get_geometry_from_preferences): New function.
15049 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15050
6c07aac2
AS
150512011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15052
15053 * emacs.c (Qkill_emacs): Define.
15054 (syms_of_emacs): Initialize it.
15055 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15056 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
15057 (quit_throw_to_read_char): Add parameter `from_signal'.
15058 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
15059 * lisp.h (QUIT): Call Fkill_emacs if requested.
15060
c052ead4
JD
150612011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15062
15063 * widget.c (update_wm_hints): Return if wmshell is null.
15064 (widget_update_wm_size_hints): New function.
15065
15066 * widget.h (widget_update_wm_size_hints): Declare.
15067
15068 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15069 widget_update_wm_size_hints (Bug#10104).
15070
9e49252b
EZ
150712011-12-03 Eli Zaretskii <eliz@gnu.org>
15072
15073 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15074 before a newline, prepare the bidi iterator for consuming the
15075 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 15076 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 15077
02b16839
JL
150782011-12-02 Juri Linkov <juri@jurta.org>
15079
15080 * search.c (Fword_search_regexp): New Lisp function created from
15081 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15082 (Fword_search_backward, Fword_search_forward)
15083 (Fword_search_backward_lax, Fword_search_forward_lax):
15084 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15085 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15086
0068070e
SM
150872011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15088
15089 * fileio.c (Finsert_file_contents): Move after-change-function call
15090 to before the "handled:" label, since all "goto handled" appear in
15091 cases where the *-change-functions have already been properly called
15092 (bug#10117).
15093
3360a3fc
AS
150942011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15095
15096 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15097 waiting for input. (Bug#10169)
15098
73d6c093
EZ
150992011-11-30 Eli Zaretskii <eliz@gnu.org>
15100
15101 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15102 verifies glyph row's hash code--we have just reallocated the
15103 glyphs, so their contents can be complete garbage. (Bug#10164)
15104
febe6bea
JB
151052011-11-30 Juanma Barranquero <lekktu@gmail.com>
15106
15107 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15108
801a4313
EZ
151092011-11-30 Eli Zaretskii <eliz@gnu.org>
15110
15111 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15112 attributes are tested _before_ calling verify_row_hash, to protect
15113 against GCC re-ordering of the tests. (Bug#10164)
15114
2b56b87e
JD
151152011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15116
15117 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15118
15119 * xterm.c (handle_one_xevent): Only set async_visible and friends
15120 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 15121 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
15122 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15123
dbf31225
PE
151242011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15125
15126 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15127 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15128 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15129 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15130 All uses changed to use GCPRO1 etc.
15131 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15132 Revert to old implementation (i.e., before 2011-03-11).
15133
1305621b
YM
151342011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15135
15136 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15137 of scroll runs so as to avoid assigning disabled bogus rows and
15138 unnecessary graphics copy operations.
15139
8c9afb46
EZ
151402011-11-27 Eli Zaretskii <eliz@gnu.org>
15141
15142 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15143 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15144 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15145 (malloc, free, realloc, calloc): Redirect to e_* only when
15146 compiling Emacs.
15147
15148 * lisp.h (GCTYPEBITS): Move before first use.
15149 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15150 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15151 this macro definition.
15152
15153 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15154 _MSC_VER.
15155
54e9e3bf
JD
151562011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15157
6d5eb5b0
SM
15158 * gtkutil.c (xg_create_frame_widgets):
15159 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
15160 present with Gtk+ 2.0.
15161
83aca1cb
PE
151622011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15163
15164 * fileio.c (Finsert_file_contents): Undo previous change; see
15165 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15166
5b76caa4
PE
151672011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15168
15169 Rename locals to avoid shadowing.
15170 * fileio.c (Finsert_file_contents):
15171 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15172 * process.c (wait_reading_process_output):
15173 Rename inner 'proc' to 'p' to avoid shadowing.
15174 Indent for consistency with usual Emacs style.
15175
8c535114
EZ
151762011-11-25 Eli Zaretskii <eliz@gnu.org>
15177
15178 * xdisp.c (redisplay_window): If cursor row is not fully visible
15179 after recentering, and scroll-conservatively is set to a large
15180 number, scroll window by a few more lines to make the cursor fully
15181 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
15182 (start_display): Don't move to the next line if the display should
15183 start at a newline that is part of a display vector or an overlay
15184 string. (Bug#10119)
8c535114 15185
fa4fdb5c
JL
151862011-11-24 Juri Linkov <juri@jurta.org>
15187
15188 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15189 after the `MagickPingImage' call. (Bug#10112)
15190
90ec88df
CY
151912011-11-23 Chong Yidong <cyd@gnu.org>
15192
15193 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15194
56e2e794
MR
151952011-11-23 Martin Rudalics <rudalics@gmx.at>
15196
15197 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15198 making another buffer current. (Bug#10114)
15199
b6e64c41
GM
152002011-11-23 Glenn Morris <rgm@gnu.org>
15201
15202 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15203
6b21de18
CY
152042011-11-23 Chong Yidong <cyd@gnu.org>
15205
15206 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15207 using it (Bug#5984).
15208
b12cd789
EZ
152092011-11-22 Eli Zaretskii <eliz@gnu.org>
15210
15211 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15212 and header-lines, as they don't have one computed for them.
15213 (Bug#10098)
15214
15215 * .gdbinit (prow): Make displayed values more self-explaining.
15216 Add row's hash code.
15217
261b6fd4
LMI
152182011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15219
15220 * process.c (wait_reading_process_output): Fix asynchrounous
15221 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 15222 (wait_reading_process_output): Add comment and URL.
261b6fd4 15223
e7cfd277
JD
152242011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15225
15226 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15227
a9b9b7f5
CY
152282011-11-21 Chong Yidong <cyd@gnu.org>
15229
15230 * window.c (Fnext_window, Fprevious_window): Doc fix.
15231
b0d15b4f
SM
152322011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15233
15234 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15235
fe7a3057
JB
152362011-11-20 Juanma Barranquero <lekktu@gmail.com>
15237
15238 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15239
d2999b1a
MR
152402011-11-20 Martin Rudalics <rudalics@gmx.at>
15241
15242 * window.c (Fset_window_combination_limit): Rename argument
15243 STATUS to LIMIT.
15244 (Vwindow_combination_limit): Remove "status" from doc-string.
15245
d5ff9cd0
AS
152462011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15247
15248 * m/ibms390.h: Remove.
15249 * m/ibms390x.h: Don't include "ibms390.h".
15250
a5bb9bd3
SM
152512011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15252
15253 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15254 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15255
cd1181db
JB
152562011-11-20 Juanma Barranquero <lekktu@gmail.com>
15257
15258 * casetab.c (Fset_case_table):
15259 * charset.c (Fcharset_after): Fix typos.
15260
615a3b8d 152612011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 15262
17e845af
PE
15263 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15264 Otherwise, valgrind does not work on some platforms.
15265 Problem reported by Andreas Schwab in
6a0bf43d
PE
15266 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15267 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15268 is set, removing the need for VIRT_ADDRESS_VARIES.
15269 (PURE_P): Use a more-efficient implementation that needs just one
15270 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15271 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15272 to 4 (xorl, subq, cmpq, setbe).
15273 * alloc.c (pure): Always extern now, since that's the
15274 VIRT_ADDR_VARIES behavior.
15275 (PURE_POINTER_P): Use a single comparison, not two, for
15276 consistency with the new puresize.h.
15277 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15278 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15279 Remove VIRT_ADDR_VARIES no longer needed.
15280
f8fe6f96
EZ
152812011-11-19 Eli Zaretskii <eliz@gnu.org>
15282
15283 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15284 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15285 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15286 behave as if the cursor position were at the window margin.
15287
15288 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15289 and the cursor position is out of bounds, behave as if the cursor
15290 position were at the window margin. (Bug#10075)
15291
df05a53c
CY
152922011-11-18 Chong Yidong <cyd@gnu.org>
15293
15294 * window.c (Fwindow_combination_limit): Make first argument
15295 non-optional, since it is meaningless for live windows like the
15296 selected window.
61ccba97 15297
2071918e
DA
152982011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15299
15300 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15301
b50a28de
SM
153022011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15303
15304 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15305 (graft_intervals_into_buffer): Simplify.
15306
015137db
EZ
153072011-11-18 Eli Zaretskii <eliz@gnu.org>
15308
15309 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15310 hash values of the two rows.
15311 (copy_row_except_pointers): Preserve the used[] arrays and the
15312 hash values of the two rows. (Bug#10035)
68c95424 15313 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
15314
15315 * xdisp.c (row_hash): New function, body extracted from
15316 compute_line_metrics.
15317 (compute_line_metrics): Call row_hash, instead of computing the
15318 hash code inline.
15319
15320 * dispnew.c (verify_row_hash): Call row_hash for computing the
15321 hash code of a row, instead of duplicating code from xdisp.c.
15322
15323 * dispextern.h (row_hash): Add prototype.
15324
a2addb04
TH
153252011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15326
15327 * frame.c (delete_frame): Don't delete the terminal when the last
15328 X frame is closed if emacs is built with GTK toolkit.
15329
df85d315
JB
153302011-11-17 Juanma Barranquero <lekktu@gmail.com>
15331
15332 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15333
a0c2d0ae
MR
153342011-11-17 Martin Rudalics <rudalics@gmx.at>
15335
15336 * window.c (Vwindow_splits): Rename to
15337 Vwindow_combination_resize. Suggested by Juri Linkov.
15338 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15339 of Vwindow_splits.
15340
58179cce
JB
153412011-11-16 Juanma Barranquero <lekktu@gmail.com>
15342
7877f373
JB
15343 * nsfns.m (Fns_font_name):
15344 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 15345
b6f67890
MR
153462011-11-16 Martin Rudalics <rudalics@gmx.at>
15347
15348 * window.h (window): Rename slot "nest" to "combination_limit".
15349 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15350 (Fset_window_nest): Rename to Fset_window_combination_limit.
15351 (Vwindow_nest): Rename to Vwindow_combination_limit.
15352 (recombine_windows, make_parent_window, make_window)
15353 (Fsplit_window_internal, saved_window)
15354 (Fset_window_configuration, save_window_save): Rename all
15355 occurrences of window_nest to window_combination_limit.
15356
c7015153
JB
153572011-11-15 Juanma Barranquero <lekktu@gmail.com>
15358
15359 * image.c (imagemagick_load_image): Fix typo.
15360
322ad6ec
EZ
153612011-11-14 Eli Zaretskii <eliz@gnu.org>
15362
15363 * xdisp.c (display_line): Move the call to
15364 highlight_trailing_whitespace before the call to
15365 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
15366 faces of all the glyphs to compute ROW's hash value.
15367 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 15368
f067b8ec
JB
153692011-11-14 Juanma Barranquero <lekktu@gmail.com>
15370
15371 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15372 just return (bug#10044).
15373
1e5b2111
EZ
153742011-11-12 Eli Zaretskii <eliz@gnu.org>
15375
7ef3cbd5
EZ
15376 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15377 with user-defined heap size. Bump the default size of the temacs
15378 heap to 27MB, to avoid memory warning when running temacs.
15379 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15380
1e5b2111
EZ
15381 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15382 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
15383 (verify_row_hash) [XASSERTS]: New function.
15384 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15385 that the hash value of glyph rows is correct.
1e5b2111 15386
89d61221
MR
153872011-11-12 Martin Rudalics <rudalics@gmx.at>
15388
15389 * window.h (window): Remove splits slot.
15390 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15391 (Fdelete_other_windows_internal, make_parent_window)
15392 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15393 (Fset_window_configuration, save_window_save): Don't deal with
15394 split status of windows.
15395 (saved_window): Remove splits slot.
15396 (Vwindow_splits): Rewrite doc-string.
15397
97f18cc8
JD
153982011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15399
15400 * xfns.c (unwind_create_frame):
15401 * nsfns.m (unwind_create_frame):
15402 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15403 Vframe_list (Bug#9999).
15404
22a648b4
DA
154052011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15406
0b381c7e 15407 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 15408
659afede
KH
154092011-11-11 Kenichi Handa <handa@m17n.org>
15410
15411 * callproc.c (Fcall_process): Set the member dst_multibyte of
15412 process_coding.
15413
9ac0394b
KH
154142011-11-11 Johan Bockgård <bojohan@gnu.org>
15415
15416 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15417 avoid a crash (bug#9496).
15418
2fbdc249
CY
154192011-11-09 Chong Yidong <cyd@gnu.org>
15420
15421 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15422 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15423
ac6b1f81
PE
154242011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15425
15426 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15427
09db192c
PE
154282011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15429
15430 Avoid some portability problems by eschewing 'extern inline' functions.
15431 The trivial performance wins aren't worth the portability hassles; see
15432 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15433 et seq.
15434 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15435 (window_box_width, window_box_left, window_box_left_offset)
15436 (window_box_right, window_box_right_offset): Undo previous change,
15437 by removing the "extern"s.
15438 * intervals.c (adjust_intervals_for_insertion)
15439 (adjust_intervals_for_deletion): Undo previous change,
15440 making these static again.
15441 (offset_intervals, temp_set_point_both, temp_set_point)
15442 (copy_intervals_to_string): No longer inline.
15443 * xdisp.c (window_text_bottom_y, window_box_width)
15444 (window_box_height, window_box_left_offset)
15445 (window_box_right_offset, window_box_left, window_box_right)
15446 (window_box): No longer inline.
15447
105216ed
CY
154482011-11-08 Chong Yidong <cyd@gnu.org>
15449
15450 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
15451 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15452 Signal an error if not a live window.
105216ed
CY
15453 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15454 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15455
ae9e237f
JB
154562011-11-07 Juanma Barranquero <lekktu@gmail.com>
15457
15458 * lisp.h (syms_of_abbrev): Remove declaration.
15459 Reported by CHENG Gao <chenggao@royau.me>.
15460
c7aa8333
EZ
154612011-11-07 Eli Zaretskii <eliz@gnu.org>
15462
15463 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15464 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15465 of temacs in GUI mode.
15466
be7f5545
MR
154672011-11-07 Martin Rudalics <rudalics@gmx.at>
15468
15469 * window.h: Declare delete_all_child_windows instead of
15470 delete_all_subwindows.
15471 * window.c (Fwindow_nest, Fset_window_nest)
15472 (Fset_window_new_total, Fset_window_new_normal)
15473 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15474 (delete_all_subwindows): Rename to delete_all_child_windows.
15475 (Fdelete_other_windows_internal, Fset_window_configuration):
15476 Call delete_all_child_windows instead of delete_all_subwindows.
15477 * frame.c (delete_frame): Call delete_all_child_windows instead
15478 of delete_all_subwindows.
15479
ca78dc43
PE
154802011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15481
15482 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15483 This is also needed for porting to any host where GC_MARK_STACK is
15484 not GC_MAKE_GCPROS_NOOPS.
15485 (which_symbols): Use it.
15486
a0241d01
KH
154872011-11-07 Kenichi Handa <handa@m17n.org>
15488
15489 * coding.c (coding_set_destination): Check coding->src_pos only
15490 when coding->src_object is a buffer (bug#9910).
15491
15492 * process.c (send_process): Set the member src_multibyte of coding
15493 to 0 (bug#9911) when sending a unibyte text.
15494
15495 * callproc.c (Fcall_process): Set the member src_multibyte of
15496 process_coding to 0 (bug#9912).
15497
a64bfdfa 154982011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
15499
15500 * xmenu.c (cleanup_widget_value_tree): New function.
15501 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15502 calling free_menubar_widget_value_tree directly (Bug#9830).
15503
cb41b32a
PE
155042011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15505
15506 Fix some portability problems with 'inline'.
15507 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15508 (window_box_width, window_box_left, window_box_left_offset)
15509 (window_box_right, window_box_right_offset): Declare extern.
15510 Otherwise, these inline functions do not conform to C99 and
15511 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15512 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15513 * intervals.c (adjust_intervals_for_insertion)
15514 (adjust_intervals_for_deletion): Now extern, because otherwise the
15515 extern inline functions 'offset_intervals' couldn't refer to it.
15516 (static_offset_intervals): Remove.
15517 (offset_intervals): Rewrite using the old contents of
15518 static_offset_intervals. The old version didn't conform to C99
15519 because an extern inline function contained a reference to an
15520 identifier with static linkage.
15521
b7041366
AS
155222011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15523
15524 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15525 GC.
15526
88a37c4d
EZ
155272011-11-06 Eli Zaretskii <eliz@gnu.org>
15528
15529 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15530 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15531 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15532 return Qleft_to_right.
15533
49745b39
CY
155342011-11-06 Chong Yidong <cyd@gnu.org>
15535
15536 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15537 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15538 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15539 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15540 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15541 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15542 (Fwindow_vscroll): Doc fix.
15543 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15544 argument, since it makes no sense to pass a live window and for
15545 consistency with window-child.
15546
1f05cd82
CS
155472011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15548
15549 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15550 support MSVC.
15551
22610910
JR
155522011-11-05 Jason Rumney <jasonr@gnu.org>
15553
15554 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15555 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15556 fonts (Bug#6029).
15557 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15558 bitwise arithmetic preventing use of unicode-sip and non-truetype
15559 opentype fonts.
15560
a06776b2
EZ
155612011-11-05 Eli Zaretskii <eliz@gnu.org>
15562
3ad924ba
EZ
15563 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15564 "emacs"-only part.
15565
a06776b2
EZ
15566 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15567 initialization code to keep similarity to xfns.c after changes
15568 from 2011-11-05.
15569
c9e7db78
JD
155702011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15571
a97f8f3f
JD
15572 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15573 (unwind_create_frame): New function (Bug#9943).
15574 (Fx_create_frame): Restructure code to be more similar to the one in
15575 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15576 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15577 Move terminal->reference_count++ just before making the frame official
15578 (Bug#9943).
15579
15580 * nsterm.m (x_free_frame_resources): New function.
15581 (x_destroy_window): Move code to x_free_frame_resources.
15582
c9e7db78 15583 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
15584 (Fx_create_frame, x_create_tip_frame):
15585 Move terminal->reference_count++ just before making the frame
75f1671a 15586 official. Move initialization of image_cache_refcount and
c9e7db78
JD
15587 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15588
a6fc3b5c
EZ
155892011-11-05 Eli Zaretskii <eliz@gnu.org>
15590
15591 Support MSVC build with newer versions of Visual Studio.
15592 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15593 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15594 nt/gmake.defs.
15595
15596 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15597 which are not supported by MSVC.
15598 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15599 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15600 bitfields.
15601 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15602 types in bitfields.
15603 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15604
15605 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15606
58179cce 156072011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
15608
15609 Support MSVC build with newer versions of Visual Studio.
15610 * w32.c: Don't include w32api.h for MSVC.
15611 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15612
15613 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15614 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15615 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15616 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15617 e_* cousins.
15618 (alloca) [_MSC_VER]: Define to _alloca.
15619
15620 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15621
15622 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15623
a58c13ed
EZ
156242011-11-04 Eli Zaretskii <eliz@gnu.org>
15625
15626 * xdisp.c (note_mouse_highlight): If either of
15627 previous/next-single-property-change returns nil, treat that as
15628 the beginning or the end of the buffer. (Bug#9955)
15629
fe0b6370
JD
156302011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15631
a58c13ed 15632 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
15633 label is not null (Bug#9951).
15634 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15635 may be NULL.
15636
89bd5ee1
EZ
156372011-11-04 Eli Zaretskii <eliz@gnu.org>
15638
15639 * window.c (Fwindow_body_size): Mention in the doc string that the
15640 return value is in frame's canonical units. (Bug#9949)
15641
84c3edb9
EZ
156422011-11-03 Eli Zaretskii <eliz@gnu.org>
15643
4e2fb5c7
EZ
15644 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15645
84c3edb9 15646 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 15647 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 15648 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 15649
bc17a887
EZ
156502011-11-01 Eli Zaretskii <eliz@gnu.org>
15651
15652 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15653 Don't stop backward scan on the continuation glyph, even though
15654 its CHARPOS is positive.
6d5eb5b0
SM
15655 (mouse_face_from_buffer_pos, note_mouse_highlight):
15656 Rename cover_string to disp_string.
bc17a887 15657
4ee88440
MR
156582011-11-01 Martin Rudalics <rudalics@gmx.at>
15659
15660 * window.c (temp_output_buffer_show): Don't use
15661 Vtemp_buffer_show_specifiers.
15662 (Vtemp_buffer_show_specifiers): Remove unused variable.
15663
c2ff3c02
EZ
156642011-10-30 Eli Zaretskii <eliz@gnu.org>
15665
15666 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15667 past the beginning of the current glyph matrix.
15668
58179cce 156692011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
15670
15671 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15672 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15673 HAVE_GTK3 (Bug#9869).
b77a6a7f 15674
3b574623
JD
15675 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15676 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15677
b77a6a7f
JD
15678 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15679
15680 * xterm.c: Declare x_handle_net_wm_state to return int.
15681 (handle_one_xevent): Check if we are iconified but don't have
15682 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15683 (get_current_wm_state): Return non-zero if not hidden,
15684 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15685 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15686 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15687 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15688
196e41e4
PE
156892011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15690
15691 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15692 so that this new function doesn't get optimized away by a
15693 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15694
021f2e1a
AS
156952011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15696
15697 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15698
8b058d44
EZ
156992011-10-29 Eli Zaretskii <eliz@gnu.org>
15700
15701 Fix the `xbytecode' command.
15702 * .gdbinit (xprintbytestr): New command.
b50a28de 15703 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
15704 (xbytecode): Print the byte-code string as well.
15705
4452fb80
EZ
157062011-10-29 Kim Storm <storm@cua.dk>
15707
8b058d44
EZ
15708 * alloc.c (which_symbols): New function.
15709
21b72067
AS
157102011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15711
15712 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15713 line. (Bug#9903)
15714
83ed7b5c
GM
157152011-10-29 Glenn Morris <rgm@gnu.org>
15716
15717 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15718 Not clear what it was for, and it causes various bugs. (Bug#9839)
15719
5a7a728b
EZ
157202011-10-28 Eli Zaretskii <eliz@gnu.org>
15721
15722 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15723 possible random value that matches one of those tested as
15724 condition to clear the mouse face.
15725
d3d0842f
CY
157262011-10-28 Chong Yidong <cyd@gnu.org>
15727
15728 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15729
31b39d13
DN
157302011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15731
15732 * window.c (make_window): Initialize phys_cursor_on_p.
15733
9aba6043
SM
157342011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15735
15736 * lisp.h (struct Lisp_Symbol): Update comments.
15737
c20992f4
JB
157382011-10-28 Juanma Barranquero <lekktu@gmail.com>
15739
15740 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15741
db4f02f2
EZ
157422011-10-28 Eli Zaretskii <eliz@gnu.org>
15743
15744 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15745 <oslsachem@gmail.com> for helping to debug this.
15746
15747 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15748 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15749 (g_b_init_get_glyph_outline_w): New static variables.
15750 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15751 (GetGlyphOutlineW_Proc): New typedefs.
15752 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
15753 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15754 New functions.
15755 (w32font_open_internal, compute_metrics):
15756 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
15757 instead of calling the "wide" APIs directly.
15758
15759 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15760
15761 * w32.h (syms_of_w32font): Add prototype.
15762
87e68db4
JB
157632011-10-27 Juanma Barranquero <lekktu@gmail.com>
15764
15765 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15766 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15767 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15768 (Fmove_to_window_line): Doc fix.
15769
435c1d67
CY
157702011-10-27 Chong Yidong <cyd@gnu.org>
15771
15772 * process.c (make_process): Set gnutls_state to NULL.
15773
15774 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15775 non-NULL, regardless of GNUTLS_INITSTAGE.
15776 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15777 an error. Set process slots as soon as we allocate them.
15778
15779 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15780
9c6c6f49
CY
157812011-10-27 Chong Yidong <cyd@gnu.org>
15782
9aba6043
SM
15783 * gnutls.c (emacs_gnutls_deinit): New function.
15784 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
15785 (Fgnutls_deinit, Fgnutls_boot): Use it.
15786
15787 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15788 (deactivate_process): Call emacs_gnutls_deinit.
15789
657d08d3
JB
157902011-10-27 Juanma Barranquero <lekktu@gmail.com>
15791
15792 * image.c (x_create_x_image_and_pixmap):
15793 * w32.c (sys_rename, w32_delayed_load):
15794 * w32font.c (fill_in_logfont):
15795 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15796
5430d399
JB
157972011-10-26 Juanma Barranquero <lekktu@gmail.com>
15798
15799 * w32fns.c (w32_default_color_map): New function,
15800 extracted from Fw32_default_color_map.
a7ef684b 15801 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 15802
fe0055fa
PE
158032011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15804
15805 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15806
e6346438
SM
158072011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15808
15809 * keyboard.c (test_undefined): New function (bug#9751).
15810 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15811
e112cc37
ET
158122011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15813
15814 * sysdep.c (init_sys_modes): Fix the check for the controlling
15815 terminal (Bug#6649).
15816
7b5d6677
EZ
158172011-10-20 Eli Zaretskii <eliz@gnu.org>
15818
15819 * dispextern.h (struct bidi_it): New member next_en_type.
15820
15821 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15822 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15823 current character, check also for next_en_type being WEAK_EN.
15824 (bidi_resolve_weak): Don't enter the expensive loop if the current
15825 position is before next_en_pos. Record the bidi type of the first
15826 non-ET, non-BN character we find, in addition to its position.
15827 (bidi_level_of_next_char): Invalidate next_en_type when
15828 next_en_pos is over-stepped.
15829
7da0b018
PE
158302011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15831
15832 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15833 * editfns.c: Rewrite current-time-zone so that it invokes
15834 the equivalent of (format-time-string "%Z") to get the time zone name.
15835 This fixes a bug when the time zone name contains characters that
15836 need converting from the system time locale to Emacs internal format.
15837 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15838 that patch fixed format-time-string to do the conversion, but
15839 I forgot to fix current-time-zone.
15840 (format_time_string): New function, containing most of
15841 what Fformat_time_string used to contain.
15842 (Fformat_time_string): Rewrite in terms of format_time_string.
15843 This doesn't change this function's behavior.
15844 (current-time-zone): Rewrite to use format_time_string.
15845 This fixes the bug reported by Michael Schierl in
15846 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15847 Jason Rumney's 2007-06-07 change worked around this bug, but
15848 didn't fix it.
15849 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15850
8547b010
EZ
158512011-10-19 Eli Zaretskii <eliz@gnu.org>
15852
15853 * xdisp.c (start_display): If the character at POS is displayed
15854 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
15855 (try_window_reusing_current_matrix): If a line ends in a display
15856 vector or the next line starts in a display vector, continue
15857 redrawing the window even though the character position of
15858 start_row was reached.
8547b010
EZ
15859 (Bug#9771, part 2)
15860
4e948d15
CY
158612011-10-18 Chong Yidong <cyd@gnu.org>
15862
15863 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15864 with nobreak-char-display too.
15865
4787455f
EZ
158662011-10-18 Eli Zaretskii <eliz@gnu.org>
15867
15868 Fix part 3 of bug#9771.
15869 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15870 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15871 non-neutral characters if the current character is a paragraph
15872 separator (a.k.a. Newline). This avoids running the same
15873 expensive loop twice, once when we consume the preceding newline
15874 and the other time when the line actually needs to be displayed.
15875 Avoid the loop when we see neutrals on the base embedding level
15876 following a character whose directionality is the same as the
15877 paragraph's. This avoids running the expensive loop when a line
15878 ends in a long sequence of neutrals, like control characters.
15879 Add assertion against STRONG_AL type. Slightly rearrange code
15880 that determines the type of a neutral given the first non-neutral
15881 that follows it.
15882 (bidi_level_of_next_char): Set next_en_pos to zero when
15883 invalidating its info.
15884
2c91f553
EZ
158852011-10-17 Eli Zaretskii <eliz@gnu.org>
15886
15887 * xdisp.c (push_display_prop): Determine whether to record string
15888 or buffer position by IT->string, not by IT->method. Allow
15889 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
15890 (move_it_vertically_backward): Don't look for character position
15891 immediately after the newline when in a continuation line.
15892 (Bug#9771, part 1)
2c91f553 15893
c7b08b0d
MR
158942011-10-15 Martin Rudalics <rudalics@gmx.at>
15895
15896 * window.c (coordinates_in_window): Rewrite and delabelize
15897 vertical border check. (Bug#5357) (Bug#9618)
15898
6b02f655
SM
158992011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15900
15901 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15902 errors in XSetWindowBorder (bug#9310).
15903
81d40c92
DA
159042011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15905
15906 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15907 avoid crash when xmalloc overrun checking is enabled.
15908
d4172c3b
EZ
159092011-10-13 Eli Zaretskii <eliz@gnu.org>
15910
15911 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15912 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15913 cursor motion with <left> and <right> arrow keys.
15914
15915 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15916 some callers set that themselves.
15917
b00eea75
EZ
159182011-10-12 Eli Zaretskii <eliz@gnu.org>
15919
15920 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15921 display string and the previous row comes from the same string and
15922 is empty. (Bug#9739) (Bug#9738)
15923
8fe012c4
SM
159242011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15925
15926 * doc.c (get_doc_string): Encode file name (bug#9735).
15927
0074aef2
EZ
159282011-10-12 Eli Zaretskii <eliz@gnu.org>
15929
79beb178
EZ
15930 * bidi.c (bidi_level_of_next_char):
15931 * xdisp.c (get_visually_first_element): Remove old incorrect
15932 comments regarding the Unicode Line Separator character.
15933
0074aef2
EZ
15934 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15935
6e4b3fbe
DA
159362011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15937
15938 * alloc.c (Fgc_status): Do not access beyond zombies array
15939 boundary if nzombies > MAX_ZOMBIES.
15940 * alloc.c (dump_zombies): Add missing format specifier.
15941
0324f3af
PE
159422011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15943
b5525cac
PE
15944 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15945 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15946
0324f3af
PE
15947 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15948 Some packages use them to denote characters with modifiers.
15949
e9b5f888
AS
159502011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15951
15952 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15953 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15954 matching a pp-number. Rename parameter var to var1.
15955
127827c0
SM
159562011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15957
15958 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15959
c8fd3bd0
GM
159602011-10-08 Glenn Morris <rgm@gnu.org>
15961
15962 * callint.c (Fcall_interactively): Give a more explicit error for the
15963 'c' case with a non-character input. (Bug#8479)
15964
352ec8ff
EZ
159652011-10-08 Eli Zaretskii <eliz@gnu.org>
15966
03669ccb
EZ
15967 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15968 lines.
7061c986
EZ
15969 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15970 lines that are hscrolled on the left.
03669ccb 15971
352ec8ff
EZ
15972 * dispnew.c (buffer_posn_from_coords): Account for a possible
15973 presence of header-line. (Bug#4426)
15974
a66cfb1c
SM
159752011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15976
6b02f655
SM
15977 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15978 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 15979
7c5ee88e
PE
159802011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15981
15982 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15983 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15984 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15985 this makes Emacs dump core during garbage collection on rare
15986 occasions. sizeof is obviously inferior to offsetof here, so
15987 stick with offsetof.
15988 (GC_POINTER_ALIGNMENT): New macro.
15989 (mark_memory): Omit 3rd (offset) arg; caller changed.
15990 Don't assume EMACS_INT alignment is the same as pointer alignment.
15991
df1bbe5b
SM
159922011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15993
15994 * keyboard.c (read_key_sequence_remapped): New var.
15995 (read_key_sequence): Compute remapping in the right buffer.
15996 (command_loop_1): Use read_key_sequence's remapping directly.
15997
51553db6
SM
159982011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15999
32c1fffd
SM
16000 * dired.c (file_name_completion): Don't expand file name.
16001 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16002 before checking file name handler.
16003
51553db6
SM
16004 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16005 they've been requested explicitly (bug#9591).
16006
b6bd1599 160072011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
16008
16009 * keymap.c (Fsingle_key_description): Use make_specified_string
16010 instead of build_string to build string from push_key_description.
16011 (Bug#5193)
16012
f701dc2a
PE
160132011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16014
4222c55d
PE
16015 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16016 This fixes a Y2038 bug on 64-bit hosts.
16017 * buffer.c (reset_buffer):
16018 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16019 (Fclear_buffer_auto_save_failure):
16020 Use 0, not -1, to represent an unset failure time, since time_t
16021 might not be signed.
16022
f701dc2a
PE
16023 Remove dependency on glibc malloc internals.
16024 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16025 Move back here from lisp.h, but with their new implementations.
16026 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16027 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16028 * charset.c (charset_table_init): New static var.
16029 (syms_of_charset): Use it instead of xmalloc. This removes a
16030 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16031 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16032 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16033 Move back to alloc.c.
16034 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16035 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16036
9ceebf39
JD
160372011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16038
16039 * nsterm.m (windowDidResize): Call x_set_window_size only when
16040 ns_in_resize is true. Otherwise set pixelwidth/height and
16041 call change_frame_size (Bug#9628).
16042
cb993c58
PE
160432011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16044
3930c88b
PE
16045 Port --enable-checking=all to Fedora 14 x86-64.
16046 * charset.c (syms_of_charset): Also account for glibc malloc's
16047 internal overhead when calculating the initial malloc maximum.
16048
cb993c58
PE
16049 Port --enable-checking=all to Fedora 14 x86.
16050 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16051 Move to lisp.h.
16052 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16053 (overrun_check_realloc, overrun_check_free):
16054 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16055 That way, xmalloc returns a properly-aligned pointer even if
16056 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16057 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16058 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16059 into account when calculating the initial malloc maximum.
16060 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16061 Move here from alloc.c, so that charset.c can use it too.
16062 Properly align; the old code wasn't right for common 32-bit hosts
16063 when configured with --enable-checking=all.
16064 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16065 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16066
31bed486
EZ
160672011-09-29 Eli Zaretskii <eliz@gnu.org>
16068
04c70788 16069 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
16070 use EDOM.
16071
fbcaa2f3
EZ
160722011-09-28 Eli Zaretskii <eliz@gnu.org>
16073
16074 * xdisp.c (compute_display_string_end): If there's no display
16075 string at CHARPOS, return -1.
16076
16077 * bidi.c (bidi_fetch_char): When compute_display_string_end
16078 returns a negative value, treat the character as a normal
16079 character not covered by a display string. (Bug#9624)
16080
a239d4e9
JB
160812011-09-28 Juanma Barranquero <lekktu@gmail.com>
16082
16083 * lread.c (Fread_from_string): Fix typo in docstring.
16084
88652fd5
EZ
160852011-09-27 Eli Zaretskii <eliz@gnu.org>
16086
16087 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16088 newline, reseat the iterator instead of bidi-iterating there one
16089 character at a time. (Bug#9610)
32c1fffd
SM
16090 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16091 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 16092
ed497dd4
AS
160932011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16094
16095 * lread.c (readevalloop): Use correct code for NBSP.
16096 (read1): Likewise. (Bug#9608)
16097
b2bf61aa
MA
160982011-09-25 Michael Albinus <michael.albinus@gmx.de>
16099
16100 * dbusbind.c (Fdbus_register_signal): When service is not
16101 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16102
32bbb17c
GM
161032011-09-25 Glenn Morris <rgm@gnu.org>
16104
16105 * buffer.c (truncate-lines): Doc fix.
16106
94e0933e
CY
161072011-09-24 Chong Yidong <cyd@stupidchicken.com>
16108
16109 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16110 (Fset_window_next_buffers): Doc fix.
16111
cddde921
GM
161122011-09-24 Glenn Morris <rgm@gnu.org>
16113
16114 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16115
1260aef1
PE
161162011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16117
25b4bfa0
PE
16118 Fix minor problems found by static checking.
16119 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
16120 * indent.c (Fvertical_motion): Fix == vs = typo.
16121
e3cbd34b
EZ
161222011-09-24 Eli Zaretskii <eliz@gnu.org>
16123
a66cfb1c
SM
16124 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16125 Default value is now t. Doc fix.
6bf7006f 16126
e3cbd34b 16127 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 16128 logic when moving up, not only when moving down. Fix the
e3cbd34b 16129 confusing name and values of the it_overshoot_expected variable;
32c1fffd 16130 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
16131
16132 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16133 CHARPOS is covered by a display string which includes newlines.
16134 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16135 is covered by a display string with embedded newlines.
16136
a3de0cbd
MA
161372011-09-24 Michael Albinus <michael.albinus@gmx.de>
16138
16139 * dbusbind.c (Fdbus_register_signal): Add match rule to
16140 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
16141 (Fdbus_register_method, Vdbus_registered_objects_table):
16142 Fix docstring.
a3de0cbd 16143
b260039d
JM
161442011-09-24 Jim Meyering <meyering@redhat.com>
16145
32c1fffd 16146 do not ignore write error for any output size
b260039d
JM
16147 The previous change was incomplete.
16148 While it makes emacs --batch detect the vast majority of stdout
16149 write failures, errors were still ignored whenever the output size is
16150 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16151 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16152 && echo FAIL: ignored write error
16153 FAIL: ignored write error
16154 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16155 && echo FAIL: ignored write error
16156 FAIL: ignored write error
16157 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16158
8eca8a7c
AS
161592011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16160
16161 * emacs.c (Fkill_emacs): In noninteractive mode exit
16162 non-successfully if a write error occurred on stdout. (Bug#9574)
16163
3341db62
EZ
161642011-09-21 Eli Zaretskii <eliz@gnu.org>
16165
16166 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16167 the xassert test.
16168
16169 * dispextern.h (struct it): Update the comment documenting what
16170 can it->OBJECT be.
16171
8c203dbf
EZ
161722011-09-20 Eli Zaretskii <eliz@gnu.org>
16173
16174 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16175 a display string, extend search for cursor position to end of row.
16176 (find_row_edges): If the row ends in a newline from a display
16177 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16178 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
16179 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16180 non-empty line. Fixes confusing cursor motion with arrow keys at
16181 the beginning of a line that starts with whitespace.
8c203dbf 16182
a4824228
LMI
161832011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16184
16185 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16186 (bug#9493).
16187
33ed493b
CY
161882011-09-18 Chong Yidong <cyd@stupidchicken.com>
16189
16190 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16191 boolean (Bug#9154).
16192
56cd55c8
EZ
161932011-09-18 Eli Zaretskii <eliz@gnu.org>
16194
16195 * xdisp.c (display_line): Record maximum and minimum buffer
16196 positions even if no glyphs were produced (e.g., by a zero-width
16197 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16198 buffer positions that will be removed from the glyph row because
16199 they don't fit.
c02dcedf
EZ
16200 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16201 column is beyond frame width: don't subtract 1 "pixel" when
16202 computing width of the stretch.
3e62b7e0
EZ
16203 (reseat_at_next_visible_line_start): Undo the change made on
16204 2011-09-17 that saved paragraph information and restored it after
16205 the call to `reseat'. (Bug#9545)
56cd55c8 16206
5ed99d36 162072011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
16208
16209 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16210 and turn window cursor on if cleared (Bug#9415).
16211
5ed99d36 162122011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
16213
16214 * search.c (boyer_moore): Take unibyte characters from pattern
16215 literally. (Bug#9458)
16216
9bade7b2
EZ
162172011-09-18 Eli Zaretskii <eliz@gnu.org>
16218
16219 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16220
e5e9d610
PE
162212011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16222
87e4427a
PE
16223 Fix minor problem found by static checking.
16224 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16225 initialized, to pacify gcc -Wuninitialized.
16226
e5e9d610
PE
16227 * fileio.c: Report proper errno when syscall falls.
16228 (Finsert_file_contents): Save and restore errno,
16229 so that report_file_error outputs the correct diagnostic.
16230 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16231
a1674f0b
EZ
162322011-09-18 Eli Zaretskii <eliz@gnu.org>
16233
16234 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16235
fbfb6dd4
EZ
162362011-09-17 Eli Zaretskii <eliz@gnu.org>
16237
16238 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16239 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16240
bb187662
EZ
162412011-09-17 Eli Zaretskii <eliz@gnu.org>
16242
1137e8b8 16243 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 16244 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
16245
16246 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16247 (bidi_find_paragraph_start): Search back for paragraph beginning
16248 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16249 (bidi_move_to_visually_next): Only trigger paragraph-related
16250 computations when the last character is a newline or at EOB, not
16251 just any NEUTRAL_B. (Bug#9470)
16252
bb187662
EZ
16253 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16254 truncated lines if point is covered by a display string. (Bug#9524)
16255
2e621251
PE
162562011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16257
16258 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16259 (cons_to_x_long): New function.
16260 (lisp_data_to_selection_data): Use it. Correct the test for
16261 short-versus-long data; it was negated. Break out of vector
16262 loop, for efficiency, when a long datum is discovered.
16263
91a15bc6
SM
162642011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16265
16266 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16267
b41c3a35
EZ
162682011-09-16 Eli Zaretskii <eliz@gnu.org>
16269
16270 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16271 GCC PR/17406) by declaring this function with external scope.
16272
7812ba2d
PE
162732011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16274
16275 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16276 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16277
cf7edc2a
AS
162782011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16279
16280 * editfns.c (Fformat): Correctly handle text properties on "%%".
16281
bd01620e
EZ
162822011-09-15 Eli Zaretskii <eliz@gnu.org>
16283
16284 * xterm.c (x_draw_composite_glyph_string_foreground):
16285 * w32term.c (x_draw_composite_glyph_string_foreground):
16286 * term.c (encode_terminal_code):
16287 * composite.c (composition_update_it, get_composition_id):
16288 * xdisp.c (get_next_display_element)
16289 (fill_composite_glyph_string): Add comments about special meaning
16290 of TAB characters in a composition.
16291
a02719a3
PE
162922011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16293
16294 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
16295 This occurs when processing a multibyte format.
16296 Problem reported by Wolfgang Jenker.
a02719a3 16297
72589a3c
JB
162982011-09-15 Johan Bockgård <bojohan@gnu.org>
16299
16300 * xdisp.c (try_cursor_movement): Only check for exact match if
16301 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16302
1c14176c
PE
163032011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16304
16305 Remove unused external symbols.
16306 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16307 * xdisp.c (calc_pixel_width_or_height): Now static.
16308 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16309 * indent.c (check_display_width):
16310 * w32term.c: Fix comment to match code.
16311 * xterm.c, xterm.h (x_catching_errors): Remove.
16312
d2eea5b5
PE
163132011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16314
16315 * xselect.c: Use signed conversions more consistently (Bug#9498).
16316 (selection_data_to_lisp_data): Assume incoming selection data are
16317 signed integers, not unsigned. This is to be consistent with
16318 outgoing selection data, which was modified to use signed integers
16319 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16320 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16321 expects long, not unsigned long.
16322
46888499
EZ
163232011-09-14 Eli Zaretskii <eliz@gnu.org>
16324
16325 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16326 computation of loop end. Reported by Johan Bockgård
16327 <bojohan@gnu.org>.
16328
ef8ef9fb
CY
163292011-09-13 Chong Yidong <cyd@stupidchicken.com>
16330
16331 * frame.c (Fother_visible_frames_p): Function deleted.
16332
fa819fed
EZ
163332011-09-12 Eli Zaretskii <eliz@gnu.org>
16334
16335 * indent.c (compute_motion): Process display vector front to back
16336 rather than the other way around. (Bug#2496)
16337
2ba8e008
SM
163382011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16339
16340 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16341
20f53c69
CY
163422011-09-11 Chong Yidong <cyd@stupidchicken.com>
16343
16344 * minibuf.c (Fread_from_minibuffer): Doc fix.
16345
d562d7a4
EZ
163462011-09-11 Eli Zaretskii <eliz@gnu.org>
16347
16348 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16349 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16350
1c4d7f3d
LMI
163512011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16352
16353 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16354 value for non-existent files.
16355
b885bf36
EZ
163562011-09-11 Eli Zaretskii <eliz@gnu.org>
16357
16358 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16359 set its "size" to -1. This will set the modtime_size field of
16360 the corresponding buffer to -1, which is what
16361 verify-visited-file-modtime expects for files that do not exist.
16362 (Bug#9139)
16363
6612f0bf
PE
163642011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16365
16366 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16367 here ...
16368 * lisp.h: ... from here. push_key_description is no longer
16369 defined in keyboard.c, so its declaration should not be in
16370 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16371 logically belongs with push_key_description.
16372
dfb3f755
PE
163732011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16374
16375 * buffer.h: Include <sys/types.h> instead of <time.h>.
16376 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16377 Problem reported by Herbert J. Skuhra.
16378
3134906c
LMI
163792011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16380
16381 * xml.c (parse_region): Make the parsing work for
16382 non-comment-starting XML files again (bug#9144).
16383
8d903f4e
AS
163842011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16385
16386 * image.c (gif_load): Fix calculation of bottom and right corner.
16387 (Bug#9468)
16388
80ad64f4
EZ
163892011-09-10 Eli Zaretskii <eliz@gnu.org>
16390
16391 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16392 redisplay in small windows.
16393
208a048d
EZ
163942011-09-09 Eli Zaretskii <eliz@gnu.org>
16395
16396 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16397
9b1c252e
MR
163982011-09-08 Martin Rudalics <rudalics@gmx.at>
16399
16400 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16401 Operate on live windows only.
16402
2949f33b
JB
164032011-09-08 Juanma Barranquero <lekktu@gmail.com>
16404
16405 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16406
e08dcafd
EZ
164072011-09-07 Eli Zaretskii <eliz@gnu.org>
16408
16409 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16410 only under bidi iteration.
16411
115b96bd
JD
164122011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16413
16414 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16415
c8199d0f
PE
164162011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16417
16418 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16419 Without this fix, the command to link temacs failed due to an
16420 undefined symbol __builtin_isnan. This is because
16421 /usr/include/iso/math_c99.h #defines isnan(x) to
16422 __builtin_isnan(x), but the bundled gcc, which identifies itself
16423 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16424 a __builtin_isnan.
16425 * floatfns.c (isnan): #undef, and then #define to a clone of
16426 what's in data.c.
16427 (Fisnan): Always define, since it's always available now.
16428 (syms_of_floatfns): Always define isnan at the Lisp level.
16429
e39b275c 164302011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
16431
16432 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16433
b2db44d9 164342011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 16435
f4af5137 16436 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
16437 The previous code assumed that file offsets (off_t values) fit in
16438 EMACS_INT variables, which is not true on typical 32-bit hosts.
16439 The code messed up by falsely reporting buffer overflow in cases
16440 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16441 when "big" contains more than 2**29 bytes, even though this
16442 inserts just one byte and does not overflow the buffer.
16443 (Finsert_file_contents): Store file offsets as off_t
16444 values, not as EMACS_INT values. Check for overflow when
16445 converting between EMACS_INT and off_t. When checking for
16446 buffer overflow or for overlap, take the offsets into account.
16447 Don't use EMACS_INT for small values where int suffices.
16448 When checking for overlap, fix a typo: ZV was used where
16449 ZV_BYTE was intended.
16450 (Fwrite_region): Don't assume off_t fits into 'long'.
16451 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16452
ecfc0a49
MA
164532011-09-05 Michael Albinus <michael.albinus@gmx.de>
16454
16455 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16456
6511acf2 164572011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 16458
0999621a 16459 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
16460
16461 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 16462 (esprintf, exprintf, evxprintf): New functions.
62f19c19 16463 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 16464 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
16465 (modify_event_symbol): Do not assume that the length of
16466 name_alist_or_stem is safe to alloca and fits in int.
16467 (Fexecute_extended_command): Likewise for function name and binding.
16468 (Frecursion_depth): Wrap around reliably on integer overflow.
16469 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16470 since some callers pass EMACS_INT values.
16471 (Fsingle_key_description): Don't crash if symbol name contains more
16472 than MAX_ALLOCA bytes.
16473 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16474 (get_minibuffer): Arg is now EMACS_INT, not int.
16475 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 16476 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
16477 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16478
2be7d702
PE
16479 * dbusbind.c (signature_cat): New function.
16480 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
16481 Do not overrun buffer; instead, report string overflow.
16482
9d1df220
PE
16483 * dispnew.c (add_window_display_history): Don't overrun buffer.
16484 Truncate instead; this is OK since it's just a log.
16485
33ef5c64
PE
16486 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16487 even if the time zone offset is outlandishly large.
16488 Don't mishandle offset == INT_MIN.
16489
66c6fdd5
PE
16490 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16491 when creating daemon; the previous buffer-overflow check was incorrect.
16492
d749b01b
PE
16493 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16494 which has the guts of the old verror function.
16495
b5cd1905
PE
16496 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16497 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16498
6e1a67fb
PE
16499 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16500 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 16501 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 16502 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
16503 length of string rather than counting it via multiple sprintfs;
16504 that's simpler and more reliable.
c21721cc
PE
16505 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16506 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16507 sprintf, in case result does not fit in int.
16508
c57b67fc
PE
16509 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16510 (fontset_from_font): Print it.
16511
8a401434
PE
16512 * frame.c (tty_frame_count): Now printmax_t, not int.
16513 (make_terminal_frame, set_term_frame_name): Print it.
16514 (x_report_frame_params): In X, window IDs are unsigned long,
16515 not signed long, so print them as unsigned.
16516 (validate_x_resource_name): Check for implausibly long names,
16517 and don't assume name length fits in 'int'.
16518 (x_get_resource_string): Don't blindly alloca invocation name;
16519 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16520 not fit in int.
16521
6e1a67fb
PE
16522 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16523 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
16524 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16525
0df02bf3
PE
16526 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16527 Use esprintf, not sprintf, in case result does not fit in int.
16528
48e30793
PE
16529 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16530 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16531 it as a large positive number.
16532 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16533 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16534
a66ff6d8
PE
16535 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16536 in case result does not fit in int.
16537
aca216ff
PE
16538 * print.c (float_to_string): Detect width overflow more reliably.
16539 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16540 buffer overrun. Don't assume list length fits in 'int'. Treat
16541 print length of 0 as 0, not as infinity; to be consistent with other
16542 uses of print length in this function. Don't overflow print length
16543 index. Don't assume hash table size fits in 'long', or that
16544 vectorlike size fits in 'unsigned long'.
16545
31c286f7
PE
16546 * process.c (make_process): Use printmax_t, not int, to format
16547 process-name gensyms.
16548
55e5faa1
PE
16549 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16550
80f2e268
PE
16551 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16552 to avoid potential buffer overrun.
16553
670741ab
PE
16554 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16555 if X resource line is longer than 512 bytes.
16556
b7163a50
PE
16557 * xfns.c (x_window): Make sprintf buffer a bit bigger
16558 to avoid potential buffer overrun.
16559
ae58ff1f
PE
16560 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16561
c43c8a6a
PE
16562 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16563
3f8236f4
PE
165642011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16565
53e9fe90 16566 Integer overflow fixes for scrolling, etc.
6511acf2
PE
16567 Without these, Emacs silently mishandles large integers sometimes.
16568 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
16569 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16570
6511acf2
PE
16571 * xdisp.c (try_window_id): Check Emacs fixnum range before
16572 converting to 'int'.
806add1d 16573
6511acf2 16574 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
16575 Check that an Emacs fixnum is in range before assigning it to 'int'.
16576 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16577 values converted from Emacs fixnums.
16578 (Frecenter): Don't wrap around a line count if it is out of 'int'
16579 range; instead, treat it as an extreme value.
16580 (Fset_window_configuration, compare_window_configurations):
16581 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16582
6511acf2
PE
16583 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16584 that can exceed INT_MAX. Check that EMACS_INT value is in range
16585 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
16586 (match_limit): Don't assume that a fixnum can fit in 'int'.
16587
6511acf2 16588 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
16589 exceed INT_MAX.
16590
6511acf2 16591 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
16592 (Fvertical_motion): Don't wrap around LINES values that don't fit
16593 in 'int'. Instead, treat them as extreme values. This is good
16594 enough for windows, which can't have more than INT_MAX lines anyway.
16595
fcb901a7
LMI
165962011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16597
0f2f6b6d
LMI
16598 * Require libxml/parser.h to avoid compilation warning.
16599
fcb901a7
LMI
16600 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16601
16602 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16603 since this reportedly can destroy thread storage.
16604
6e20a0d4
CY
166052011-08-30 Chong Yidong <cyd@stupidchicken.com>
16606
16607 * syntax.c (find_defun_start): Update all cache variables if
16608 exiting early (Bug#9401).
16609
148ae00e
EZ
166102011-08-30 Eli Zaretskii <eliz@gnu.org>
16611
f6cfbd8f
EZ
16612 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16613
148ae00e
EZ
16614 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16615 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16616 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16617
16618 * term.c (tty_append_glyph): New function.
16619 (produce_stretch_glyph): Static function and its prototype deleted.
16620
a66cfb1c
SM
16621 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16622 Add prototypes.
148ae00e 16623
c4a07a4c
PE
166242011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16625
16626 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16627 when checking :margin (Bug#9390).
16628 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 16629 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
16630 so that the name doesn't mislead. All uses changed.
16631
6bc8cd65
JB
166322011-08-28 Johan Bockgård <bojohan@gnu.org>
16633
16634 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16635 set_tty_hooks.
16636
dca4927e
EZ
166372011-08-27 Eli Zaretskii <eliz@gnu.org>
16638
16639 * xdisp.c (move_it_to): Don't bail out early when reaching
16640 position beyond to_charpos, if we are scanning backwards.
16641 (move_it_vertically_backward): When DY == 0, make sure we get to
16642 the first character in the line after the newline.
16643
f2cad773
PE
166442011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16645
16646 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16647 (ccl_driver): Do not generate an out-of-range pointer.
16648 (Fccl_execute_on_string): Remove unnecessary check for
16649 integer overflow, noted by Stefan Monnier in
16650 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16651 Remove a FIXME that didn't need fixing.
16652 Simplify the newly-introduced buffer reallocation code.
16653
0cae2cdb
JB
166542011-08-27 Juanma Barranquero <lekktu@gmail.com>
16655
16656 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16657
5fc295a4 166582011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 16659
70c60eb2 16660 Integer and memory overflow issues (Bug#9196).
726e0ab1 16661
d31850da
PE
16662 * doc.c (get_doc_string): Rework so that
16663 get_doc_string_buffer_size is the actual buffer size, rather than
16664 being 1 less than the actual buffer size; this makes xpalloc more
16665 convenient.
16666
a69fbedb
PE
16667 * image.c (x_allocate_bitmap_record, cache_image):
16668 * xselect.c (Fx_register_dnd_atom):
16669 Simplify previous changes by using xpalloc.
16670
fe5c5d37
PE
16671 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16672 since either will do and ptrdiff_t is convenient with xpalloc.
16673
0065d054
PE
16674 * charset.c (charset_table_size)
16675 (struct charset_sort_data.priority): Now ptrdiff_t.
16676 (charset_compare): Don't overflow if priorities differ greatly.
16677 (Fsort_charsets): Don't assume list length fits in int.
16678 Check for size-calculation overflow when allocating sort data.
16679 (syms_of_charset): Allocate an initial charset table that is
16680 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16681
16682 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16683
16684 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16685 The actual value is always <= INT_MAX, and leaving it unsigned made
16686 overflow checking harder.
16687
16688 * dispextern.h (struct glyph_matrix.rows_allocated)
16689 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16690 with xpalloc. The values are still always <= INT_MAX.
16691
16692 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16693
16694 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16695 (SAFE_NALLOCA): New macro.
16696
16697 * region-cache.c (struct boundary.pos, find_cache_boundary)
16698 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16699 (set_cache_region, invalidate_region_cache)
16700 (revalidate_region_cache, know_region_cache, region_cache_forward)
16701 (region_cache_backward, pp_cache):
16702 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16703 so that ptrdiff_t * can be passed to xpalloc.
16704 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16705 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16706 (pp_cache): Don't assume cache_len fits in int.
16707 * region-cache.h: Adjust extern decls to match.
16708
16709 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16710 EMACS_INT, since either will do, for xpalloc.
16711
16712 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16713 (xnmalloc, xnrealloc, xpalloc): New functions.
16714
726e0ab1
PE
16715 * bidi.c (bidi_shelve_header_size): New constant.
16716 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16717 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16718
51f30bc5 16719 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
16720 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16721 (overlay_strings):
16722 Don't update size of array until after memory allocation succeeds,
16723 because xmalloc/xrealloc may not return.
0065d054
PE
16724 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16725 now that we have proper integer overflow checking.
16726 (record_overlay_string, overlay_strings): Catch overflows when
16727 calculating size of overlay_str_buf.
726e0ab1 16728
0065d054
PE
16729 * callproc.c (Fcall_process): Check for size overflow when
16730 calculating size of args2.
16731 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16732 Normally we prefer signed values, but sticking with ptrdiff_t would
16733 require adding more-complicated checks.
726e0ab1
PE
16734
16735 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16736 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16737 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 16738 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
16739
16740 * character.c (Fstring): Check for size-calculation overflow.
16741
16742 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16743 unnecessary integer overflow. Check for size overflow.
16744 (encode_coding_object): Don't update size until xmalloc succeeds.
16745
16746 * composite.c (get_composition_id): Check for overflow in glyph
16747 length calculations.
16748
16749 Integer and memory overflow fixes for display code.
16750 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16751 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16752 (scrolling_window): Check for overflow in size calculations.
16753 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16754 Don't assume glyph table len fits in int.
16755 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16756 (row_table_size): Now ptrdiff_t, not int.
16757 (scrolling_window): Avoid overflow in size calculations.
16758 Don't update size until allocation succeeds.
16759 * fns.c (concat): Check for overflow in size calculations.
16760 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16761 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16762 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16763
16764 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16765 (get_doc_string): Check for size calculation overflow.
16766 Don't update size until allocation succeeds.
16767 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16768 EMACS_INT, where ptrdiff_t will do.
16769 (Fsubstitute_command_keys): Check for string overflow.
16770
16771 * editfns.c (set_time_zone_rule): Don't assume environment length
16772 fits in int.
16773 (message_length): Now ptrdiff_t, not int.
16774 (Fmessage_box): Don't update size until allocation succeeds.
16775 Don't assume message length fits in int.
16776 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16777
0065d054
PE
16778 * emacs.c (main): Do not reallocate argv, since there is a null at
16779 the end that can be overwritten, and this way there's no need to
16780 worry about size-calculation overflow.
16781 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
16782
16783 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16784 alloc succeeds.
16785 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16786
16787 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16788 (x_set_scroll_bar_width, x_figure_window_size):
16789 Check for integer overflow.
16790 (x_set_alpha): Do not assume XINT fits in int.
16791
16792 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16793 This is for the members text_lines, text_cols, total_lines, total_cols,
16794 where the system imposes an 'int' limit.
16795
16796 * fringe.c (Fdefine_fringe_bitmap):
16797 Don't update size until alloc works.
16798
16799 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16800 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16801
16802 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16803 Check for size-calculation overflow.
16804 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16805 do, as we prefer signed integers.
16806 (id_to_widget.max_size, id_to_widget.used)
16807 (xg_store_widget_in_map, xg_remove_widget_from_map)
16808 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16809 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16810 Use and return ptrdiff_t, not int.
16811 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16812 * gtkutil.h: Change prototypes to match the above.
16813
16814 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16815 are duplicate now that they've been promoted to lisp.h.
16816 (x_allocate_bitmap_record, x_alloc_image_color)
16817 (make_image_cache, cache_image, xpm_load):
16818 Don't update size until alloc is done.
16819 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16820 (x_detect_edges):
3256efce 16821 Check for size calculation overflow.
726e0ab1
PE
16822 (ct_colors_allocated_max): New constant.
16823 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16824 overflow.
3256efce 16825
726e0ab1
PE
16826 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16827 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16828 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16829 Use ptrdiff_t, not int, to count maps.
16830 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
16831 calculations. Don't update size until allocation succeeds.
16832 Redo calculations to avoid overflow.
726e0ab1
PE
16833 * keyboard.h: Change prototypes to match the above.
16834
16835 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16836 to count maps.
16837 (current_minor_maps): Check for size calculation overflow.
16838 * keymap.h: Change prototypes to match the above.
16839
16840 * lread.c (read1, init_obarray): Don't update size until alloc done.
16841
16842 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16843 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16844
726e0ab1
PE
16845 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16846 Now ptrdiff_t, not int.
16847 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16848 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16849
16850 * process.c (Fnetwork_interface_list): Check for overflow
16851 in size calculation.
16852
16853 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16854
16855 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16856 overflow. Don't bother calling xmalloc when xrealloc will do.
16857
16858 * search.c (Freplace_match): Check for size calculation overflow.
16859 (Fset_match_data): Don't assume list lengths fit in 'int'.
16860
16861 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16862 for command line length. Do not attempt to address one before the
16863 beginning of an array, as that's not portable.
16864
16865 * term.c (max_frame_lines): Remove; unused.
16866 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16867 not int.
16868 (encode_terminal_code, calculate_costs): Check for size
16869 calculation overflow.
16870 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16871 table lengths and related sizes. Don't update size until alloc
16872 done. Redo calculations to avoid overflow.
16873 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16874
16875 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16876 subtracting pointers.
16877 (gobble_line): Check for overflow more carefully. Don't update size
16878 until alloc done.
16879
16880 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16881 Don't update size until alloc done.
16882 Redo size calculations to avoid overflow.
16883 Check for size calculation overflow.
0065d054 16884 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
16885
16886 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16887 Use ptrdiff_t, not int, for sizes.
16888 (store_mode_line_noprop_char): Don't update size until alloc done.
16889
0065d054
PE
16890 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16891 Use ptrdiff_t, not int, for sizes.
16892 (Finternal_make_lisp_face, cache_face):
16893 Check for size calculation overflow.
16894 (cache_face): Treat size calculation overflows as if they were
16895 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
16896
16897 * xfns.c (x_encode_text, x_set_name_internal)
16898 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16899 sizes, since they can exceed INT_MAX in size. Check for size
16900 calculation overflow.
16901
0065d054
PE
16902 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16903 (xg_select): Check for size calculation overflow.
726e0ab1
PE
16904 Don't update size until alloc done.
16905
0065d054 16906 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 16907 as sprintf is limited to int lengths.
1d526e2f 16908
252c5ee1
PE
16909 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16910 (X_LONG_MIN): New macros.
864d7ce7
PE
16911 Use them to make the following changes clearer.
16912 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16913 This change doesn't affect the value now, but it may help remind
16914 future maintainers not to raise the value too much later.
16915 (SELECTION_QUANTUM): Remove, replacing with ...
16916 (selection_quantum): ... new function, which avoids overflow.
16917 All uses changed.
16918 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16919 assumption that selection length fits in 'int'.
16920 (x_reply_selection_request, x_handle_selection_request)
16921 (x_get_window_property, receive_incremental_selection)
16922 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16923 (lisp_data_to_selection_data, clean_local_selection_data):
16924 Use ptrdiff_t, not int, to record length of selection.
16925 (x_reply_selection_request, x_get_window_property)
16926 (receive_incremental_selection, x_property_data_to_lisp):
16927 Redo calculations to avoid overflow.
16928 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 16929 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
16930 something.
16931 (x_get_window_property, receive_incremental_selection)
16932 (lisp_data_to_selection_data, x_property_data_to_lisp):
16933 Check for size-calculation overflow.
16934 (x_get_window_property, receive_incremental_selection)
16935 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16936 Don't store size until memory allocation succeeds.
16937 (x_get_window_property): Plug memory leak on memory exhaustion.
16938 Don't double-block input; malloc is safe here. Don't assume 2**34
16939 - 4 fits in unsigned long. Add an xassert to check
16940 XGetWindowProperty overflow. Be more careful about overflow
16941 calculations, and distinguish size from memory overflow better.
16942 (receive_incremental_selection): When tracing, don't assume
16943 unsigned int is less than INT_MAX.
16944 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16945 harmful) conversions of unsigned short to int.
16946 (lisp_data_to_selection_data): Don't assume that integers
16947 in the range -65535 through -1 fit in an X unsigned short.
16948 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16949 result parameters unless successful. Rely on cons_to_unsigned
16950 to report problems with elements; the old code wasn't right anyway.
16951 (x_check_property_data): Check for int overflow; we cannot use
16952 a wider type due to X limits.
16953 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16954
726e0ab1 16955 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 16956
0065d054
PE
16957 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16958 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
16959 (x_color_cells): Don't store size until memory allocation succeeds.
16960 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 16961 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
16962 (x_term_init): Don't assume length fits in int (sprintf is limited
16963 to int size).
bc18e09d 16964
ebfa62c0
PE
16965 Use ptrdiff_t for composition IDs.
16966 * character.c (lisp_string_width):
16967 * composite.c (composition_table_size, n_compositions)
16968 (get_composition_id, composition_gstring_from_id):
16969 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16970 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16971 * window.c (Frecenter):
16972 Use ptrdiff_t, not int, for composition IDs.
16973 * composite.c (get_composition_id): Check for integer overflow.
16974 * composite.h: Adjust prototypes to match the above changes.
16975
d3411f89
PE
16976 Use ptrdiff_t for hash table indexes.
16977 * category.c (hash_get_category_set):
16978 * ccl.c (ccl_driver):
16979 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16980 * coding.c (coding_system_charset_list, detect_coding_system):
16981 * coding.h (struct coding_system.id):
16982 * composite.c (get_composition_id, gstring_lookup_cache):
16983 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16984 * image.c (xpm_get_color_table_h):
16985 * lisp.h (hash_lookup, hash_put):
16986 * minibuf.c (Ftest_completion):
16987 Use ptrdiff_t for hash table indexes, not int (which is too
16988 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16989 32-bit --with-wide-int hosts).
16990
e097a6fa
PE
16991 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16992 Add a FIXME comment about memory leaks.
16993 (syms_of_charset): Don't assume xmalloc returns.
16994
5637687f
PE
16995 Don't assume that stated character widths fit in int.
16996 * character.c (Fchar_width, c_string_width, lisp_string_width):
16997 * character.h (CHAR_WIDTH):
16998 * indent.c (MULTIBYTE_BYTES_WIDTH):
16999 Use sanitize_char_width to avoid undefined and/or bad behavior
17000 with outlandish widths.
a66cfb1c 17001 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
17002 now that we have two such functions. All uses changed.
17003 (sanitize_char_width): New inline function.
17004
a2271ba2
PE
17005 Don't assume that tab-width fits in int.
17006 * character.h (sanitize_width): New inline function.
17007 (SANE_TAB_WIDTH): New macro.
17008 (ASCII_CHAR_WIDTH): Use it.
17009 * indent.c (sane_tab_width): Remove. All uses replaced by
17010 SANE_TAB_WIDTH (current_buffer).
17011 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17012
18c52557
PE
17013 * fileio.c: Integer overflow issues with file modes.
17014 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17015
caeeedc1
PE
17016 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17017 Remove unreachable code.
17018 (read_hex, load_charset_map_from_file): Check for integer overflow.
17019
6df6ae42 17020 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
17021 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17022 (x_send_scroll_bar_event): Likewise. Check that the size does not
17023 exceed limits imposed by XClientMessageEvent, as well as the usual
17024 ptrdiff_t and size_t limits.
17025
b13995db
PE
17026 * keyboard.c: Overflow, signedness and related fixes.
17027 (make_lispy_movement): Use same integer type in forward decl
17028 that is used in the definition.
17029 (read_key_sequence, keyremap_step):
17030 Change bufsize argument back to int, undoing my 2011-03-30 change.
17031 We prefer signed types, and int is wide enough here.
17032 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17033 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17034 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17035 length, not size_t. Use ptrdiff_t for index, not int.
17036 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17037 possibility of integer overflow.
17038
13464394
PE
17039 Overflow, signedness and related fixes for images.
17040
17041 * dispextern.h (struct it.stack[0].u.image.image_id)
17042 (struct_it.image_id, struct image.id, struct image_cache.size)
17043 (struct image_cache.used, struct image_cache.ref_count):
17044 * gtkutil.c (update_frame_tool_bar):
17045 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17046 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17047 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17048 * nsmenu.m (update_frame_tool_bar):
17049 * xdisp.c (calc_pixel_width_or_height):
17050 * xfns.c (image_cache_refcount):
17051 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17052 on typical 64-bit hosts.
17053
17054 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17055 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17056 Omit unnecessary casts to int.
17057 (parse_image_spec): Check that integers fall into 'int' range
17058 when the callers expect that.
17059 (image_ascent): Redo ascent calculation to avoid int overflow.
17060 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17061 (lookup_image): Remove unnecessary tests.
17062 (xbm_image_p): Locals are now of int, not EMACS_INT,
17063 since parse_image_check makes sure they fit into int.
17064 (png_load, gif_load, svg_load_image):
17065 Prefer int to unsigned where either will do.
17066 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
17067 old tiff_error_handler and tiff_warning_handler.
17068 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
17069 stack buffer overflows. It uses only the features of vsnprintf
17070 that are common to both POSIX and native Microsoft.
17071 (tiff_error_handler, tiff_warning_handler): Use it.
17072 (tiff_load, gif_load, imagemagick_load_image):
17073 Don't assume :index value fits in 'int'.
17074 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17075 (imagemagick_load_image): Check that crop parameters fit into
17076 the integer types that MagickCropImage accepts. Don't assume
17077 Vimagemagick_render_type has a nonnegative value. Don't assume
17078 size_t fits in 'long'.
17079 (gs_load): Use printmax_t to print the widest integers possible.
17080 Check for integer overflow when computing image height and width.
17081
c11821d4
EZ
170822011-08-26 Eli Zaretskii <eliz@gnu.org>
17083
17084 * xdisp.c (redisplay_window): Don't force window start if point
17085 will be invisible in the resulting window. (Bug#9324)
17086
0c95fcf7
EZ
170872011-08-25 Eli Zaretskii <eliz@gnu.org>
17088
17089 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17090 the display spec is of the form `(space ...)'.
17091 (handle_display_spec): Return the value returned by
17092 handle_single_display_spec, not just 1 or zero.
17093 (handle_single_display_spec): If the display spec is of the form
17094 `(space ...)', and specifies display in the text area, return 2
17095 rather than 1.
fee65a97 17096 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
17097 accurately, and prefer exact match for point under bidi.
17098 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
17099
17100 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17101 into disp_prop; all users changed.
17102
17103 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17104 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17105 for the text covered by the display property.
17106
e4ed06f1
CY
171072011-08-25 Chong Yidong <cyd@stupidchicken.com>
17108
17109 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17110 Change return value to nil.
17111 (Frecord_buffer): Delete unused function.
17112
f67cdd7f
EZ
171132011-08-24 Eli Zaretskii <eliz@gnu.org>
17114
5980d4c6
EZ
17115 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17116 buffers, return left-to-right.
8610fe8b
EZ
17117 (set_cursor_from_row): Consider candidate row a win if its glyph
17118 represents a newline and point is on that newline. Fixes cursor
17119 positioning on the newline at EOL of R2L text within L2R
17120 paragraph, and vice versa.
17121 (try_cursor_movement): Check continued rows, in addition to
17122 continuation rows. Fixes unwarranted scroll when point enters a
17123 continued line of R2L text within an L2R paragraph, or vice versa.
17124 (cursor_row_p): Consider the case of point being equal to
17125 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17126 from the end of a short line to the beginning of a continued line
17127 of R2L text within L2R paragraph.
17128 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17129 composed characters.
5980d4c6 17130
f67cdd7f
EZ
17131 * bidi.c (bidi_check_type): Use xassert.
17132 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17133 members.
17134
bca633fb
EZ
171352011-08-23 Eli Zaretskii <eliz@gnu.org>
17136
17137 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17138 a character.
17139
4a5885a7
CY
171402011-08-23 Chong Yidong <cyd@stupidchicken.com>
17141
17142 * nsfont.m (ns_otf_to_script): Fix typo.
17143
0902a04e
KH
171442011-08-22 Kenichi Handa <handa@m17n.org>
17145
17146 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17147 extra slot even if the purpose is char-code-property-table.
17148
1a2e6670
EZ
171492011-08-23 Eli Zaretskii <eliz@gnu.org>
17150
8ddde651
EZ
17151 * xdisp.c (redisplay_window): When computing centering_position,
17152 account for the height of the header line. (Bug#8874)
17153
425cc014
EZ
17154 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17155 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17156 candidate is selected by the mouse, and that candidate has a
17157 composed character under the mouse.
17158
1a2e6670
EZ
17159 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17160 coordinates reported by pos-visible-in-window-p for a composed
17161 character in column zero.
17162
8b76d6f8
SM
171632011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17164
17165 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17166
dac347dd
EZ
171672011-08-22 Eli Zaretskii <eliz@gnu.org>
17168
17169 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17170 consider it a hit if to_charpos is anywhere in the range of the
17171 composed buffer positions.
17172
e013fb34
CY
171732011-08-22 Chong Yidong <cyd@stupidchicken.com>
17174
17175 * image.c (gif_load): Don't assume that each subimage has the same
17176 dimensions as the base image. Handle disposal method that is
17177 "undefined" by the gif spec (Bug#9335).
17178
bd1ba3e8
CY
171792011-08-20 Chong Yidong <cyd@stupidchicken.com>
17180
17181 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 17182 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 17183
54a1215b
EZ
171842011-08-19 Eli Zaretskii <eliz@gnu.org>
17185
823564e5
EZ
17186 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17187 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17188 from an Org mode buffer to a Speedbar frame.
17189
54a1215b
EZ
17190 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17191 a composition, take its buffer position from IT->cmp_it.charpos.
17192 Fixes cursor positioning at the beginning of a line that begins
17193 with a composed character.
17194
9778ebcc
EZ
171952011-08-18 Eli Zaretskii <eliz@gnu.org>
17196
0be6ee06
EZ
17197 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17198 character bidirectional type, use STRONG_L instead. Fixes crashes
17199 in a buffer produced by `describe-categories'.
17200
9778ebcc
EZ
17201 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17202 members before the level stack, so they would be saved and
17203 restored when copying iterator state. Fixes incorrect reordering
17204 around TABs covered by display properties.
17205
156bffbe
AS
172062011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17207
6b02f655 17208 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 17209
72ad093b
CY
172102011-08-17 Chong Yidong <cyd@stupidchicken.com>
17211
17212 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
17213 (internal_condition_case_2, internal_condition_case_n):
17214 Remove unnecessary aborts (Bug#9081).
72ad093b 17215
35774242
EZ
172162011-08-17 Eli Zaretskii <eliz@gnu.org>
17217
17218 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17219 has no `load' handler, try opening the file locally. (Bug#9311)
17220
db76dd85
KB
172212011-08-16 Ken Brown <kbrown@cornell.edu>
17222
17223 * gmalloc.c: Expand comment.
17224
b215eee5
EZ
172252011-08-16 Eli Zaretskii <eliz@gnu.org>
17226
17227 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17228 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17229
a4579d33
KB
172302011-08-16 Ken Brown <kbrown@cornell.edu>
17231
17232 Fix memory allocation problems in Cygwin build (Bug#9273).
17233
17234 * unexcw.c ( __malloc_initialized): Declare external variable.
17235 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17236
8b76d6f8
SM
17237 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17238 New variables.
a4579d33
KB
17239 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17240 dumped emacs.
17241 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17242 in the static heap.
17243 [CYGWIN] (special_realloc): New function.
17244 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17245 requests to realloc storage in the static heap.
17246
3ebec551
PE
172472011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17248
17249 * bidi.c (bidi_initialize): Remove unused local.
17250
9fd8be00
EZ
172512011-08-15 Eli Zaretskii <eliz@gnu.org>
17252
6b02f655
SM
17253 * bidimirror.h:
17254 * biditype.h: Remove file.
17255 * makefile.w32-in ($(BLD)/bidi.$(O)):
17256 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
17257
17258 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17259
17260 * chartab.c: Improve commentary for the uniprop_table API.
17261
32413314
EZ
17262 * bidi.c (bidi_paragraph_init): Support zero value of
17263 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
17264 (bidi_initialize): Use uniprop_table instead of including
17265 biditype.h and bidimirror.h.
32413314 17266
9fd8be00
EZ
17267 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17268 coordinates of the iterator when restoring from ppos_it.
17269 (Bug#9296)
17270
5cf2b69b
KH
172712011-08-14 Kenichi Handa <handa@m17n.org>
17272
17273 * process.c (create_process): Call setup_process_coding_systems
72ad093b 17274 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 17275
daf17d00
EZ
172762011-08-14 Eli Zaretskii <eliz@gnu.org>
17277
17278 * xdisp.c (move_it_in_display_line_to): Don't invoke
17279 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17280 ppos_it. Fixes vertical cursor motion when line beginning is
17281 covered by an image. (Bug#9296)
17282
08e3161a
JD
172832011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17284
17285 * nsterm.h (ns_run_ascript): Declare.
17286 (NSAPP_DATA2_RUNASSCRIPT): Define.
17287
17288 * nsfns.m (as_script, as_result, as_status): New static variables.
17289 (ns_run_ascript): New function.
5e617bc2 17290 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
17291 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17292 the event loop. Get status from as_status (Bug#7276).
17293
17294 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17295 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17296 the event loop (Bug#7276).
17297
a3720aa2
AS
172982011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17299
17300 * gnutls.c (QCgnutls_bootprop_priority)
17301 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17302 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17303 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17304 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17305 (QCgnutls_bootprop_verify_hostname_error)
17306 (QCgnutls_bootprop_callbacks_verify): Rename from
17307 Qgnutls_bootprop_..., all uses changed.
17308
17309 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17310 uses changed.
17311
0a0d27fb
PE
173122011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17313
19d5c50c
PE
17314 * xfaces.c (Qframe_set_background_mode): Now static.
17315 * dispextern.h (Qframe_set_background_mode): Remove decl.
17316
0a0d27fb
PE
17317 * process.c (Fnetwork_interface_info): Declare local only if needed.
17318
377538cb
JD
173192011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17320
17321 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17322 (Fnetwork_interface_list): Allocate in increments of bytes instead
17323 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17324 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17325 sockaddr.
17326 (struct ifflag_def): notrailers is smart on OSX.
17327 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17328 Get hardware address with getifaddrs if available.
17329
08fff70c
EZ
173302011-08-12 Eli Zaretskii <eliz@gnu.org>
17331
17332 * xdisp.c (iterate_out_of_display_property): xassert that
17333 IT->position is set to within IT->object's boundaries. Break from
17334 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
17335 when IT->position is set up wrongly due to some bug.
17336 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
17337 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17338 entry. Force push_it to save on the stack the current
17339 buffer/string position, to be restored by pop_it. Fix flags in
17340 the iterator structure wrt the object coming from a display
17341 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17342 properties. (Bug#9284)
17343
7be1c708 173442011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 17345
7be1c708
CY
17346 * fontset.c (fontset_get_font_group): Add proper type checks.
17347 (Bug#9172)
aac0c6e3 17348
7be1c708 173492011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 17350
7be1c708
CY
17351 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17352 and LC_VERSION_MIN_MACOSX.
17353 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17354 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 17355
97bb72a6
EZ
173562011-08-08 Eli Zaretskii <eliz@gnu.org>
17357
17358 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
17359 no-display-properties-and-no-overlays under bidi display.
17360 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 17361 properties and overlays.
97bb72a6 17362
d5617611
CY
173632011-08-08 Chong Yidong <cyd@stupidchicken.com>
17364
37e11a63
CY
17365 * editfns.c (Fset_time_zone_rule): Document relationship with the
17366 setenv function.
17367
d5617611
CY
17368 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17369 the font entity extracted from the cache (Bug#8109).
17370
58872834
CY
173712011-08-07 Chong Yidong <cyd@stupidchicken.com>
17372
17373 * composite.c (autocmp_chars): Don't reset point. That is done by
17374 restore_point_unwind (Bug#5984).
17375
75bfc667
JL
173762011-08-07 Juri Linkov <juri@jurta.org>
17377
17378 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17379 to show the arg `TIME' instead of `TIMEVAL'.
17380
d1410150
EZ
173812011-08-06 Eli Zaretskii <eliz@gnu.org>
17382
17383 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17384 display property strides EOL and includes a newline, as in
17385 longlines-mode. (Bug#9254)
75b771e4
EZ
17386 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17387 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
17388
17389 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17390 is non-zero, even if the data buffer is NULL. Fixes a crash in
17391 vertical-motion with longlines-mode. (Bug#9254)
17392
35928349
EZ
173932011-08-05 Eli Zaretskii <eliz@gnu.org>
17394
ec7cc85b
EZ
17395 * bidi.c <bidi_cache_total_alloc>: Now static.
17396 (bidi_initialize): Initialize bidi_cache_total_alloc.
17397
8b76d6f8 17398 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
17399 cache. (Bug#9221)
17400
17401 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17402 amount allocated this far in `bidi_cache_total_alloc'.
17403 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17404 non-zero, only free the data buffer without restoring the cache
17405 contents. All callers changed.
17406
17407 * dispextern.h (bidi_unshelve_cache): Update prototype.
17408
17409 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17410 (move_it_in_display_line, move_it_to)
17411 (move_it_vertically_backward, move_it_by_lines): Replace the call
17412 to xfree to an equivalent call to bidi_unshelve_cache.
17413 (move_it_in_display_line_to): Fix logic of returning
412b6358 17414 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 17415
e2e2423b
EZ
174162011-08-05 Eli Zaretskii <eliz@gnu.org>
17417
17418 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17419 came from a string character with a `cursor' property. (Bug#9229)
17420
ae9e757a
JD
174212011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17422
17423 * Makefile.in (LIB_PTHREAD): New variable.
17424 (LIBES): Add LIB_PTHREAD (Bug#9216).
17425
17426 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17427 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17428
213bd7f2
AS
174292011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17430
6b02f655 17431 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 17432
99aaf75f
JD
174332011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17434
17435 * xterm.c (x_find_topmost_parent): New function.
17436 (x_set_frame_alpha): Find topmost parent window with
17437 x_find_topmost_parent and set the property there also (bug#9181).
17438 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17439
c74e9d86
PE
174402011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17441
17442 * callproc.c (Fcall_process): Avoid vfork clobbering
17443 the local vars buffer, coding_systems, current_dir.
17444
640c8776
SM
174452011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17446
17447 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17448
f26d0e4c
PE
174492011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17450
8a10d76c
PE
17451 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17452 so that it is not optimized away.
17453
f26d0e4c
PE
17454 * xdisp.c (compute_display_string_pos): Remove unused local.
17455
55439c61
EZ
174562011-08-02 Eli Zaretskii <eliz@gnu.org>
17457
17458 Fix slow cursor motion and scrolling in large buffers with
17459 selective display, like Org Mode buffers. (Bug#9218)
17460
17461 * dispextern.h (struct bidi_it): New member disp_prop_p.
17462
17463 * xdisp.c: Remove one-slot cache of display string positions.
17464 (compute_display_string_pos): Accept an additional argument
5e617bc2 17465 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
17466 for a display string or property. If found, set DISP_PROP_P
17467 non-zero.
17468
17469 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
17470 DISP_PROP_P, and pass it to compute_display_string_pos.
17471 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
17472 non-zero. All callers of bidi_fetch_char changed.
17473
fb33fa43
SM
174742011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17475
17476 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17477
b099e063
DM
174782010-12-03 Don March <don@ohspite.net>
17479
17480 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17481 last character M-[char] is translated to ESC [char] (bug#7541).
17482
5cc7f7af
KH
174832011-08-02 Kenichi Handa <handa@m17n.org>
17484
d0fffa3f 17485 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
17486
17487 * chartab.c (uniprop_table): Make it non-static.
17488
525d5e6e
EZ
174892011-08-01 Eli Zaretskii <eliz@gnu.org>
17490
17491 * xdisp.c (forward_to_next_line_start): Accept additional argument
17492 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17493 on the newline.
17494 (reseat_at_next_visible_line_start): Use the bidi iterator state
17495 returned by forward_to_next_line_start to restore the state of
17496 it->bidi_it after backing up to previous newline. (Bug#9212)
17497
31011111
AS
174982011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17499
17500 * regex.c (re_comp): Protoize.
17501 (re_exec): Fix return type.
17502 (regexec): Fix type of `ret'. (Bug#9203)
17503
476371c4
PE
175042011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17505
e5d76069
PE
17506 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17507 This is needed if max-image-size is a floating-point number.
17508
9a79b20c
AS
175092011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17510
17511 * print.c (print_object): Print empty symbol as ##.
17512
17513 * lread.c (read1): Read ## as empty symbol.
17514
d8c2fa78
AA
175152011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17516
17517 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17518 setting frame foreground color (Bug#9175).
17519 (x_set_background_color): Likewise.
17520
ffe57a7a
AA
17521 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17522 contents (Bug#9176).
17523 (EmacsTooltip -init): Remove bezels and add shadows to
17524 tooltip windows.
17525
bf3492a5
AA
17526 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17527 or scroll bar (Bug#8470).
17528
d55e9c53
AA
17529 * nsfont.m (nsfont_open): Remove assignment to voffset and
17530 unnecessary vars hshink, expand, hd, full_height, min_height.
17531 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17532
17533 * nsterm.h (nsfont_info): Remove voffset field.
17534
d8c2fa78 175352011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
17536
17537 Implement strike-through and overline on NextStep (Bug#8863).
17538
17539 * nsfont.m (nsfont_open): Use underline position provided by font,
17540 instead of hard-coded value of 2.
17541 (nsfont_draw): Call ns_draw_text_decoration instead.
17542
17543 * nsterm.h: Add declaration for ns_draw_text_decoration.
17544
17545 * nsterm.m (ns_draw_text_decoration): New function for drawing
17546 underline, overline, and strike-through.
17547 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17548 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 17549 accommodate underlining, etc.
4843aac3 17550
4cc60b9b
EZ
175512011-07-28 Eli Zaretskii <eliz@gnu.org>
17552
bc7ece87
EZ
17553 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17554 default.
4cc60b9b 17555
476371c4
PE
175562011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17557
66606eea
PE
17558 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17559 Without this fix, if a signal arrives just after memory fills up,
17560 'malloc' might be invoked reentrantly.
17561
476371c4
PE
17562 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17563 In other words, assume that every image size is allowed, on non-X
17564 hosts. This assumption is probably wrong, but it lets Emacs compile.
17565
f3fcc40d
AS
175662011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17567
17568 * regex.c (re_iswctype): Convert return values to boolean.
17569
350c992f
EZ
175702011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17571
17572 * xdisp.c (compute_display_string_pos): Don't use cached display
17573 string position if the buffer had its restriction changed.
17574 (Bug#9184)
17575
5266b4bb
PE
175762011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17577
17578 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17579
2573a837 175802011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 17581
41f55ccd 17582 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 17583
39e378da
PE
17584 * bidi.c: Integer size and overflow fixes.
17585 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17586 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17587 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17588 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17589 (bidi_find_other_level_edge):
17590 Use ptrdiff_t instead of EMACS_INT where either will do.
17591 This works better on 32-bit hosts configured --with-wide-int.
17592 (bidi_cache_ensure_space): Check for size-calculation overflow.
17593 Use % rather than repeated addition, for better worst-case speed.
17594 Don't set bidi_cache_size until after xrealloc returns, because it
17595 might not return.
17596 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
17597 (bidi_cache_ensure_space): Also check that the bidi cache size
17598 does not exceed that of the largest Lisp string or buffer. See Eli
17599 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 17600
5e927815
PE
17601 * alloc.c (__malloc_size_t): Remove.
17602 All uses replaced by size_t. See Andreas Schwab's note
17603 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17604
ca4aa935
PE
17605 * image.c: Improve checking for integer overflow.
17606 (check_image_size): Assume that f is nonnull, since
17607 it is always nonnull in practice. This is one less thing to
17608 worry about when checking for integer overflow later.
17609 (x_check_image_size): New function, which checks for integer
17610 overflow issues inside X.
17611 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17612 This removes the need for a memory_full check.
17613 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17614 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17615 (xbm_read_bitmap_data): Change locals back to 'int', since
17616 their values must fit in 'int'.
17617 (xpm_load_image, png_load, tiff_load):
17618 Invoke x_create_x_image_and_pixmap earlier,
17619 to avoid much needless work if the image is too large.
17620 (tiff_load): Treat overly large images as if
17621 x_create_x_image_and_pixmap failed, not as malloc failures.
17622 (gs_load): Use x_check_image_size.
17623
5f8f9cc2
PE
17624 * gtkutil.c: Omit integer casts.
17625 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17626 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17627
5adf60bc
PE
17628 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17629
c8907a93
PE
17630 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17631 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17632 would wrongly return t on a 64-bit host.
17633
e3c25c68
PE
17634 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17635 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17636 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17637 and therefore cause GCC to emit a bogus diagnostic in some cases.
17638
3f791afe
PE
17639 * image.c: Integer signedness and overflow and related fixes.
17640 This is not an exhaustive set of fixes, but it's time to
17641 record what I've got.
17642 (lookup_pixel_color, check_image_size): Remove redundant decls.
17643 (check_image_size): Don't assume that arbitrary EMACS_INT values
17644 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17645 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17646 (tiff_load, imagemagick_load_image):
17647 Check for overflow in size calculations.
17648 (x_create_x_image_and_pixmap): Remove unnecessary test for
17649 xmalloc returning NULL; that can't happen.
17650 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17651 (xpm_color_bucket): Use better integer hashing function.
17652 (xpm_cache_color): Don't possibly over-allocate memory.
17653 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17654 (gif_memory_source):
17655 Use ptrdiff_t, not int or size_t, to record sizes.
17656 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17657 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17658 either works, as we prefer signed integers.
17659 (tiff_read_from_memory, tiff_write_from_memory):
17660 Return tsize_t, not size_t, since that's what the TIFF API wants.
17661 (tiff_read_from_memory): Don't fail simply because the read would
17662 go past EOF; instead, return a short read.
17663 (tiff_load): Omit no-longer-needed casts.
17664 (Fimagemagick_types): Don't assume size fits into 'int'.
17665
3cc5a532
PE
17666 Improve hashing quality when configured --with-wide-int.
17667 * fns.c (hash_string): New function, taken from sxhash_string.
17668 Do not discard information about ASCII character case; this
17669 discarding is no longer needed.
17670 (sxhash-string): Use it. Change sig to match it. Caller changed.
17671 * lisp.h: Declare it.
17672 * lread.c (hash_string): Remove, since we now use fns.c's version.
17673 The fns.c version returns a wider integer if --with-wide-int is
17674 specified, so this should help the quality of the hashing a bit.
17675
b312a492
PE
17676 * emacs.c: Integer overflow minor fix.
17677 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17678 Define only if GNU_LINUX.
17679 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17680
dfd153ae
PE
17681 * dispnew.c: Integer signedness and overflow fixes.
17682 Remove unnecessary forward decls, that were a maintenance hassle.
17683 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17684 All uses changed.
17685 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17686 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17687 (prepare_desired_row, line_draw_cost):
17688 Use int, not unsigned, where either works.
17689 (save_current_matrix, restore_current_matrix):
17690 Use ptrdiff_t, not size_t, where either works.
17691 (init_display): Check for overflow more accurately, and without
17692 relying on undefined behavior.
17693
a81d11a3
PE
17694 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17695 Remove, replacing with the new symbols in lisp.h. All uses changed.
17696 * fileio.c (make_temp_name):
17697 * filelock.c (lock_file_1, lock_file):
17698 * xdisp.c (message_dolog):
17699 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17700 Use pMd etc. instead.
17701 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17702 replacing the pWIDE etc. symbols removed from editfns.c.
17703
3300e6fd
PE
17704 * keyboard.h (num_input_events): Now uintmax_t.
17705 This is (very slightly) less likely to mess up due to wraparound.
17706 All uses changed.
17707
fd05c7e9
PE
17708 * buffer.c: Integer signedness fixes.
17709 (alloc_buffer_text, enlarge_buffer_text):
17710 Use ptrdiff_t rather than size_t when either will do, as we prefer
17711 signed integers.
17712
903fe15d
PE
17713 * alloc.c: Integer signedness and overflow fixes.
17714 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17715 (__malloc_size_t): Default to size_t, not to int.
17716 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17717 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17718 Prefer ptrdiff_t to size_t when either would do, as we prefer
17719 signed integers.
17720 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17721 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17722 Now const. Initialize with values that are in range even if char
17723 is signed.
17724 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17725 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17726 These functions do the right thing with sizes > 2**32.
17727 (check_depth): Now ptrdiff_t, not int.
17728 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17729 Adjust to new way of storing sizes. Check for size overflow bugs
17730 in rest of code.
17731 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17732 slightly wrong anyway, as it missed one instance of
17733 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17734 (refill_memory_reserve): Omit needless cast to size_t.
17735 (mark_object_loop_halt): Mark as externally visible.
17736
ac82cc6a
PE
17737 * xselect.c: Integer signedness and overflow fixes.
17738 (Fx_register_dnd_atom, x_handle_dnd_message):
17739 Use ptrdiff_t, not size_t, since we prefer signed.
17740 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17741 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17742 x_dnd_atoms_size and x_dnd_atoms_length.
17743
c2d1e36d
PE
17744 * doprnt.c: Prefer signed to unsigned when either works.
17745 * eval.c (verror):
17746 * doprnt.c (doprnt):
17747 * lisp.h (doprnt):
17748 * xdisp.c (vmessage):
17749 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17750 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17751 prefer signed arithmetic to avoid comparison confusion.
17752 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17753 but is a bit tricky.
17754
0e926e56
PE
17755 Assume freestanding C89 headers, string.h, stdlib.h.
17756 * data.c, doprnt.c, floatfns.c, print.c:
17757 Include float.h unconditionally.
17758 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17759 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17760 * regex.c: Likewise for stddef.h, string.h.
17761 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17762 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17763 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17764 (STDC_HEADERS): Remove obsolete defines.
17765 * sysdep.c: Include limits.h unconditionally.
17766
9cfdb3ec
PE
17767 Assume support for memcmp, memcpy, memmove, memset.
17768 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17769 * regex.c (memcmp, memcpy):
17770 Remove; we assume C89 now.
17771
17772 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17773 (__malloc_safe_bcopy): Remove; no longer needed.
17774
cf950e6b 17775 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
17776 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17777 well either way, and we prefer signed to unsigned.
17778
dbf38e02
LMI
177792011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17780
17781 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17782 closes the connection while we're reading (bug#9182).
17783
d6f0886c 177842011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 17785
d6f0886c
JD
17786 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17787 are specified (Bug#9168).
24e0f6b1 17788
2eb1f9e6
PE
177892011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17790
17791 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17792 Found by GCC static checking and --with-wide-int on a 32-bit host.
17793
22381272 177942011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
17795
17796 * xdisp.c (compute_display_string_pos): Fix logic of caching
17797 previous display string position. Initialize cached_prev_pos to
17798 -1. Fixes slow-down at the beginning of a buffer.
17799
f25e39b4
EZ
178002011-07-24 Eli Zaretskii <eliz@gnu.org>
17801
17802 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17803 for attrs[LFACE_FONTSET_INDEX].
17804
04c4b52e
PE
178052011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17806
17807 * xml.c (parse_region): Remove unused local
17808 that was recently introduced.
17809
c1734fbd
EZ
178102011-07-23 Eli Zaretskii <eliz@gnu.org>
17811
be18c5a5
EZ
17812 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17813 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17814
c1734fbd
EZ
17815 * xdisp.c (move_it_in_display_line_to): Record the best matching
17816 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
17817 exit if none of the characters scanned was an exact match.
17818 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
17819 when exact match is impossible due to invisible text, and the
17820 lines are truncated.
17821
a258d627
JD
178222011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17823
17824 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17825 for OSX >= 10.7.
17826
b6d5a689
EZ
178272011-07-22 Eli Zaretskii <eliz@gnu.org>
17828
0f74f785
EZ
17829 Fix a significant slow-down of cursor motion with C-n, C-p,
17830 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17831 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 17832 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
17833 (next_element_from_buffer): Call compute_stop_pos_backwards to
17834 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
17835 base_level_stop.
17836 (reseat): Don't look for prev_stop, as that could mean a very long
17837 run.
17838 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17839 <cached_disp_overlay_modiff>: Cache for last found display string
17840 position.
551918c1 17841 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
17842 about the same buffer in the same area of character positions, and
17843 the buffer wasn't changed since the time the display string
17844 position was cached.
551918c1 17845
b2d0c91a
EZ
178462011-07-22 Eli Zaretskii <eliz@gnu.org>
17847
17848 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17849 is an integer, which is important for empty lines. (Bug#9149)
17850
043604ee
CY
178512011-07-22 Chong Yidong <cyd@stupidchicken.com>
17852
17853 * frame.c (Fmodify_frame_parameters): In tty case, update the
17854 default face if necessary (Bug#4238).
17855
da4adb04
CY
178562011-07-21 Chong Yidong <cyd@stupidchicken.com>
17857
17858 * editfns.c (Fstring_to_char): No need to explain what a character
17859 is in the docstring (Bug#6576).
17860
9abd0532
LMI
178612011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17862
17863 * xml.c (parse_region): Make sure we always return a tree.
17864
36881d16
HK
178652011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17866
17867 * xml.c (parse_region): If a document contains only comments,
17868 return that, too.
17869
1e98674d
LMI
178702011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17871
17872 * xml.c (make_dom): Return comments, too.
17873
590bd467
PE
178742011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17875
17876 Port to OpenBSD.
17877 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17878 and the surrounding thread.
17879 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17880 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17881 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17882 timer goes off.
17883 * s/openbsd.h (BROKEN_SIGIO): Define.
17884 * unexelf.c (unexec) [__OpenBSD__]:
17885 Don't update the .mdebug section of the Alpha COFF symbol table.
17886
f41628b2
LMI
178872011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17888
17889 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17890 (bug#8460).
17891
b59b67c5
PE
178922011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17893
15e3a074
PE
17894 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17895 This fixes some race conditions on the permissions of any newly
17896 created file.
17897
41bed37d
PE
17898 * alloc.c (valid_pointer_p): Use pipe, not open.
17899 This fixes some permissions issues when debugging.
17900
b59b67c5
PE
17901 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17902 If fchown fails to set both uid and gid, try to set just gid,
17903 as that is sometimes allowed. Adjust the file's mode to eliminate
17904 setuid or setgid bits that are inappropriate if fchown fails.
17905
925a6be7
SM
179062011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17907
17908 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17909 to compare Lisp_Objects.
17910 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17911 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17912 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17913
52968808
AS
179142011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17915
0a6a104b
AS
17916 * lread.c (read_integer): Unread even EOF character.
17917 (read1): Likewise. Properly record start position of symbol.
17918
52968808
AS
17919 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17920 symbol character follows.
17921
9e381cdd
PE
179222011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17923
17924 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17925 This works around a problem with the previous change to Fcopy_file.
17926 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17927 and without this change, GCC might complain about discarding
17928 fchown's return value.
17929
b5641435
JB
179302011-07-16 Juanma Barranquero <lekktu@gmail.com>
17931
17932 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17933
a8031457
PE
179342011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17935
17936 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17937
dd889327
LMI
179382011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17939
750c33f7
LMI
17940 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17941 it's used from the C level.
17942
dd889327
LMI
17943 * process.c: Use the same condition for POLL_FOR_INPUT in both
17944 keyboard.c and process.c (bug#1858).
17945
87e86684
LM
179462011-07-09 Lawrence Mitchell <wence@gmx.li>
17947
17948 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17949 (Fgnutls_boot): Use it.
17950
64348f40
AS
179512011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17952
17953 * doc.c (Fsubstitute_command_keys): Revert last change.
17954
1d698799
LMI
179552011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17956
f863868c
LMI
17957 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17958 quotes the next character, and doesn't affect other longer
17959 sequences (bug#8935).
17960
1d698799
LMI
17961 * lread.c (syms_of_lread): Clarify that is isn't only
17962 `eval-buffer' and `eval-defun' that's affected by
17963 `lexical-binding' (bug#8460).
17964
aa4b6df6
EZ
179652011-07-15 Eli Zaretskii <eliz@gnu.org>
17966
17967 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 17968 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 17969
5d856da6
PE
179702011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17971
ad6042bb
PE
17972 Fix minor problems found by static checking.
17973 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17974 (elsz): Now a signed constant, not a size_t var. We prefer signed
17975 types to unsigned, to avoid integer comparison confusion. Without
17976 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17977 "cannot optimize loop, the loop counter may overflow", a symptom
17978 of the confusion.
f00bbb22 17979 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
17980 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17981
6468f31c
LMI
179822011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17983
49080b10
LMI
17984 * search.c (Fre_search_backward): Mention `case-fold-search' in
17985 all the re_search_* functions (bug#8138).
17986
6468f31c
LMI
17987 * keyboard.c (Fopen_dribble_file): Document when the file is
17988 closed (bug#8056).
17989
c965adc5
EZ
179902011-07-14 Eli Zaretskii <eliz@gnu.org>
17991
df9733bf
EZ
17992 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17993 bidi_cache_idx.
17994
0bb23927
EZ
17995 Support bidi reordering of display and overlay strings.
17996 * xdisp.c (compute_display_string_pos)
17997 (compute_display_string_end): Accept additional argument STRING.
17998 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17999 (reseat_to_string): Initialize bidi_it->string.s and
18000 bidi_it->string.schars.
18001 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
18002 NULL (avoids a crash in bidi_paragraph_init).
18003 Initialize itb.string.lstring.
0bb23927
EZ
18004 (init_iterator): Call bidi_init_it only of a valid
18005 buffer position was specified. Initialize paragraph_embedding to
18006 L2R.
18007 (reseat_to_string): Initialize the bidi iterator.
18008 (display_string): If we need to ignore text properties of
18009 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18010 original value of -1 will not work with bidi.)
18011 (compute_display_string_pos): First arg is now struct
18012 `text_pos *'; all callers changed. Support display properties on
18013 Lisp strings.
18014 (compute_display_string_end): Support display properties on Lisp
18015 strings.
18016 (init_iterator, reseat_1, reseat_to_string): Initialize the
18017 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18018 when iterating on a string not from display properties).
640c8776
SM
18019 (compute_display_string_pos, compute_display_string_end):
18020 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
18021 arrow keys.
18022 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
18023 base_level_stop; instead, set base_level_stop to BEGV.
18024 Fixes crashes in vertical-motion.
0bb23927
EZ
18025 (next_element_from_buffer): Improve commentary for when
18026 the iterator is before prev_stop.
18027 (init_iterator): Initialize bidi_p from the default value of
18028 bidi-display-reordering, not from buffer-local value. Use the
18029 buffer-local value only if initializing for buffer iteration.
18030 (handle_invisible_prop): Support invisible properties on strings
18031 that are being bidi-reordered.
18032 (set_iterator_to_next): Support bidi reordering of C strings and
18033 Lisp strings.
18034 (next_element_from_string): Support bidi reordering of Lisp
18035 strings.
18036 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
18037 (display_string): Support display of R2L glyph rows.
18038 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
18039 (init_iterator): Don't initialize it->bidi_p for strings
18040 here.
18041 (reseat_to_string): Initialize it->bidi_p for strings here.
18042 (next_element_from_string, next_element_from_c_string)
18043 (next_element_from_buffer): Add xassert's for correspondence
18044 between IT's object being iterated and it->bidi_it.string
18045 structure.
18046 (face_before_or_after_it_pos): Support bidi iteration.
18047 (next_element_from_c_string): Handle the case of the first string
18048 character that is not the first one in the visual order.
18049 (get_visually_first_element): New function, refactored from common
18050 parts of next_element_from_buffer, next_element_from_string, and
18051 next_element_from_c_string.
18052 (tool_bar_lines_needed, redisplay_tool_bar)
18053 (display_menu_bar): Force left-to-right direction. Add a FIXME
18054 comment for making that be controlled by a user option.
18055 (push_it, pop_it): Save and restore the state of the
18056 bidi iterator. Save and restore the bidi_p flag.
18057 (pop_it): Iterate out of display property for string iteration as
18058 well.
18059 (iterate_out_of_display_property): Support iteration over strings.
18060 (handle_single_display_spec): Set up it->bidi_it for iteration
18061 over a display string, and call bidi_init_it.
18062 (handle_single_display_spec, next_overlay_string)
18063 (get_overlay_strings_1, push_display_prop): Set up the bidi
18064 iterator for displaying display or overlay strings.
18065 (forward_to_next_line_start): Don't use the shortcut if
18066 bidi-iterating.
18067 (back_to_previous_visible_line_start): If handle_display_prop
18068 pushed the iterator stack, restore the internal state of the bidi
18069 iterator by calling bidi_pop_it same number of times.
18070 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18071 and we are bidi-iterating, don't decrement the iterator position;
18072 instead, set the first_elt flag in the bidi iterator, to produce
18073 the same effect.
18074 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18075 (push_display_prop): xassert that we are iterating a buffer.
18076 (push_it, pop_it): Save and restore paragraph_embedding member.
18077 (handle_single_display_spec, next_overlay_string)
18078 (get_overlay_strings_1, reseat_1, reseat_to_string)
18079 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18080 correctly. Don't assume unibyte strings are not bidi-reordered.
18081 (compute_display_string_pos)
18082 (compute_display_string_end): Fix handling the case of C string.
18083 (push_it, pop_it): Save and restore from_disp_prop_p.
18084 (handle_single_display_spec, push_display_prop): Set the
18085 from_disp_prop_p flag.
18086 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18087 (pop_it): Call iterate_out_of_display_property only if we are
18088 popping after iteration over a string that came from a display
18089 property. Fix a typo in popping stretch info. Add an assertion
18090 for verifying that the iterator position is in sync with the bidi
18091 iterator.
18092 (handle_single_display_spec, get_overlay_strings_1)
18093 (push_display_prop): Fix initialization of paragraph direction for
18094 string when that of the parent object is not yet determined.
18095 (reseat_1): Call bidi_init_it to resync the bidi
18096 iterator with IT's position. (Bug#7616)
18097 (find_row_edges): If ROW->start.pos gives position
18098 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18099 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18100 Reset the from_disp_prop_p flag.
18101 (SAVE_IT, RESTORE_IT): New macros.
18102 (pos_visible_p, face_before_or_after_it_pos)
18103 (back_to_previous_visible_line_start)
18104 (move_it_in_display_line_to, move_it_in_display_line)
18105 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18106 (try_scrolling, redisplay_window, display_line): Use them when
18107 saving a temporary copy of the iterator and restoring it back.
18108 (back_to_previous_visible_line_start, reseat_1)
18109 (init_iterator): Empty the bidi cache "stack".
18110 (move_it_in_display_line_to): If iterator ended up at
18111 EOL, but we never saw any buffer positions smaller than
18112 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18113 motion in bidi-reordered lines.
18114 (move_it_in_display_line_to): Record prev_method and prev_pos
18115 immediately before the call to set_iterator_to_next. Fixes cursor
18116 motion in bidi-reordered lines with stretch glyphs and strings
18117 displayed in margins. (Bug#8133) (Bug#8867)
18118 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18119 TO_CHARPOS.
640c8776
SM
18120 (pos_visible_p): Support positions in bidi-reordered lines.
18121 Save and restore bidi cache.
0bb23927
EZ
18122
18123 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18124 (bidi_paragraph_info): Delete unused struct.
18125 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18126 (bidi_cache_start): New variable.
18127 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18128 to zero.
18129 (bidi_cache_fetch_state, bidi_cache_search)
18130 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18131 (bidi_cache_find, bidi_peek_at_next_level)
18132 (bidi_level_of_next_char, bidi_find_other_level_edge)
18133 (bidi_move_to_visually_next): Compare cache index with
18134 bidi_cache_start rather than with zero.
18135 (bidi_fetch_char): Accept new argument STRING; all callers
18136 changed. Support iteration over a string. Support strings with
18137 display properties. Support unibyte strings. Fix the type of
18138 `len' according to what STRING_CHAR_AND_LENGTH expects.
18139 (bidi_paragraph_init, bidi_resolve_explicit_1)
18140 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
18141 (bidi_level_of_next_char, bidi_move_to_visually_next):
18142 Support iteration over a string.
0bb23927
EZ
18143 (bidi_set_sor_type, bidi_resolve_explicit_1)
18144 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18145 can now be zero (for strings); special values 0 and -1 were
18146 changed to -1 and -2, respectively.
18147 (bidi_char_at_pos): New function.
18148 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18149 Call it instead of FETCH_MULTIBYTE_CHAR.
18150 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18151 initialized to valid values.
18152 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18153 values.
18154 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18155 the test for valid cached positions. Fix the logic for looking up
18156 the sentinel state in the cache. GCPRO the Lisp string we are
18157 iterating.
18158 (bidi_push_it, bidi_pop_it): New functions.
18159 (bidi_initialize): Initialize the bidi cache start stack pointer.
18160 (bidi_cache_ensure_space): New function, refactored from part of
18161 bidi_cache_iterator_state. Don't assume the required size is just
18162 one BIDI_CACHE_CHUNK away.
18163 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18164 (bidi_count_bytes, bidi_char_at_pos): New functions.
18165 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18166 always valid if bidi_cache_idx is valid.
18167 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18168 is valid if it's going to be used.
18169 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18170 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
18171 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18172 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
18173 (bidi_find_other_level_edge, bidi_cache_start_stack):
18174 All variables related to cache indices are now EMACS_INT.
c965adc5 18175
0bb23927
EZ
18176 * dispextern.h (struct bidi_string_data): New structure.
18177 (struct bidi_it): New member `string'. Make flag members be 1-bit
18178 fields, and put them last in the struct.
640c8776
SM
18179 (compute_display_string_pos, compute_display_string_end):
18180 Update prototypes.
0bb23927
EZ
18181 (bidi_push_it, bidi_pop_it): Add prototypes.
18182 (struct iterator_stack_entry): New members bidi_p,
18183 paragraph_embedding, and from_disp_prop_p.
18184 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
18185 (bidi_shelve_cache, bidi_unshelve_cache):
18186 Declare prototypes.
0bb23927
EZ
18187
18188 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18189 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18190 and vector-like objects.
18191
18192 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18193 cache around display iteration.
18194
18195 * window.c (Fwindow_end, window_scroll_pixel_based)
18196 (displayed_window_lines, Frecenter): Save and restore the bidi
18197 cache around display iteration.
18198
3bbd2265
LMI
181992011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18200
18201 * editfns.c (Fdelete_region): Clarify the use of the named
18202 parameters (bug#6788).
18203
adc47434
MR
182042011-07-14 Martin Rudalics <rudalics@gmx.at>
18205
18206 * indent.c (Fvertical_motion): Set and restore w->pointm when
18207 saving and restoring the window's buffer (Bug#9006).
18208
837c31f8
LMI
182092011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18210
18211 * editfns.c (Fstring_to_char): Clarify just what is returned
18212 (bug#6576). Text by Eli Zaretskii.
18213
ac389d0c
JB
182142011-07-13 Juanma Barranquero <lekktu@gmail.com>
18215
18216 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18217
0be0ce47
EZ
182182011-07-13 Eli Zaretskii <eliz@gnu.org>
18219
18220 * buffer.c (mmap_find): Fix a typo.
18221
cd18e7e3
JB
182222011-07-13 Johan Bockgård <bojohan@gnu.org>
18223
18224 Fix execution of x selection hooks.
18225 * xselect.c (Qx_lost_selection_functions)
18226 (Qx_sent_selection_functions): New vars.
18227 (syms_of_xselect): DEFSYM them.
18228 (x_handle_selection_request): Pass Qx_sent_selection_functions
18229 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18230 (x_handle_selection_clear,x_clear_frame_selections):
18231 Pass Qx_lost_selection_functions rather than
18232 Vx_lost_selection_functions to Frun_hook_with_args.
18233
47ea7f44
PE
182342011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18235
ac389d0c 18236 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
18237 The old code sometimes used this field without initializing it.
18238
47ea7f44
PE
18239 * alloc.c (gc_sweep): Don't read past end of array.
18240 In theory, the old code could also have corrupted Emacs internals,
18241 though it'd be very unlikely.
18242
bc985c87
AS
182432011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18244
18245 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 18246 argument. (Bug#4026)
bc985c87 18247
0cf34688
LMI
182482011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18249
b3dadd76
LMI
18250 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18251 key" (bug#4257).
18252
0cf34688
LMI
18253 * window.c (Fset_window_start): Doc fix (bug#4199).
18254 (Fset_window_hscroll): Ditto.
18255
270768cd
PE
182562011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18257
077e3dda 18258 Fix minor new problems caught by GCC 4.6.1.
270768cd 18259 * term.c (init_tty): Remove unused local.
490011a6 18260 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 18261 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 18262 not used otherwise.
270768cd 18263
b1f58454
CY
182642011-07-12 Chong Yidong <cyd@stupidchicken.com>
18265
18266 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18267
22b9578d
LMI
182682011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18269
6e70ab07
LMI
18270 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18271 are the mini-buffer and the echo area (bug#3320).
18272
22b9578d
LMI
18273 * term.c (init_tty): Remove support for supdup, c10 and perq
18274 terminals, which are no longer supported (bug#1482).
18275
8974cc9f
JB
182762011-07-10 Johan Bockgård <bojohan@gnu.org>
18277
18278 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18279
a560d974
JD
182802011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18281
18282 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18283 for non-popups (Bug#3642).
18284
1dae0f0a
AS
182852011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18286
268c2c36 18287 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 18288 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
18289 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18290 * cm.c (losecursor): Likewise.
1dae0f0a
AS
18291 * data.c (fmod): Likewise.
18292 * dispnew.c (swap_glyphs_in_rows): Likewise.
18293 * emacs.c (memory_warning_signal): Likewise.
18294 * floatfns.c (float_error): Likewise.
18295 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18296 (otf_open, font_otf_capability, generate_otf_features)
18297 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18298 Likewise.
18299 * image.c (pbm_read_file): Likewise.
18300 * indent.c (string_display_width): Likewise.
18301 * intervals.c (check_for_interval, search_for_interval)
18302 (inc_interval_count, count_intervals, root_interval)
18303 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18304 * lread.c (defalias): Likewise.
268c2c36 18305 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
18306 * regex.c (set_image_of_range_1, set_image_of_range)
18307 (regex_grow_registers): Likewise.
18308 * sysdep.c (strerror): Likewise.
18309 * termcap.c (valid_filename_p, tprint, main): Likewise.
18310 * tparam.c (main): Likewise.
18311 * unexhp9k800.c (run_time_remap, save_data_space)
18312 (update_file_ptrs, read_header, write_header, calculate_checksum)
18313 (copy_file, copy_rest, display_header): Likewise.
18314 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18315 Likewise.
18316 * xdisp.c (check_it): Likewise.
18317 * xfaces.c (register_color, unregister_color, unregister_colors):
18318 Likewise.
18319 * xfns.c (print_fontset_result): Likewise.
18320 * xrdb.c (member, fatal, main): Likewise.
18321
99033785
PE
183222011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18323
18324 Fix minor problems found by static checking (Bug#9031).
18325 * chartab.c (char_table_set_range, map_sub_char_table):
18326 Remove unused locals.
18327 (uniprop_table): Now static.
18328 * composite.c (_work_char): Remove unused static var.
18329
9cb2ac56
JB
183302011-07-09 Juanma Barranquero <lekktu@gmail.com>
18331
18332 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18333
f25661f0
JD
183342011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18335
18336 * gtkutil.c (qttip_cb): Remove code without function.
18337
8278c4fe
EZ
183382011-07-09 Eli Zaretskii <eliz@gnu.org>
18339
18340 * w32.c (pthread_sigmask): New stub.
18341
1692ae2d 183422011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 18343
8a6ebd58 18344 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
18345 sigprocmask is portable only for single-threaded applications, and
18346 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
18347 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18348 (LIBES): Use it.
18349 * callproc.c (Fcall_process):
18350 * process.c (create_process):
18351 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18352 Use pthread_sigmask, not sigprocmask.
123403e4 18353
1b854618
JD
183542011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18355
18356 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18357 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18358 wrong (Bug#8591).
18359
3fe4b549
JD
183602011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18361
0ce7e563
JD
18362 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18363 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18364 (xg_hide_tooltip): Fix comment.
18365
3fe4b549
JD
18366 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18367 in registerServicesMenuSendTypes.
18368 (validRequestorForSendType): Don't check ns_return_types.
18369
18370 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18371 ns_return_type.
18372
5df75e47
JR
183732011-07-08 Jason Rumney <jasonr@gnu.org>
18374
22610910
JR
18375 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18376 SH_SHOW for hidden windows (Bug#5482).
18377
5df75e47
JR
18378 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18379 frame struct members of non-existent frames (Bug#6284).
18380
699c10bd
JD
183812011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18382
4393663b
JD
18383 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18384 variable firstTime not needed on OSX >= 10.6.
18385 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18386 >= 10.5. Use setKnobProportion, setDoubleValue.
18387
18388 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18389 (MAC_OS_X_VERSION_10_5): Define if not defined.
18390 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18391 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18392 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18393
18394 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 18395 cString and lossyCString on OSX >= 10.4.
4393663b 18396
58179cce 18397 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
18398 sizeToFit on OSX >= 10.2.
18399
18400 * nsimage.m (allocInitFromFile): Don't use deprecated method
18401 bestRepresentationForDevice on OSX >= 10.6.
18402
18403 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18404 to avoid warning.
18405
18406 * emacs.c: Declare unexec_init_emacs_zone.
18407
a63e0781
JD
18408 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18409
699c10bd
JD
18410 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18411
18412 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18413 on svcsMenu (Bug#8842).
18414
18415 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18416 ns_return_types.
18417 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18418
18419 * nsterm.m (QUTF8_STRING): Declare.
18420 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18421 (validRequestorForSendType): Return type is (id).
18422 Change indexOfObjectIdenticalTo to indexOfObject.
18423 Check if we have local selection before returning self (Bug#8842).
18424 (writeSelectionToPasteboard): Put local selection into paste board
18425 if we have a local selection (Bug#8842).
18426 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18427
18428 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18429 (ns_get_local_selection): Declare.
18430
54e10184
LMI
184312011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18432
9888ff71
LMI
18433 * keymap.c (describe_map_tree): Don't insert a double newline at
18434 the end of the buffer (bug#1169) and return whether we inserted
18435 something.
18436
54e10184
LMI
18437 * callint.c (Fcall_interactively): Change "reading args" to
18438 "providing args" to try to clarify what it does (bug#1010).
18439
15fa4783
KH
184402011-07-07 Kenichi Handa <handa@m17n.org>
18441
18442 * composite.c (composition_compute_stop_pos): Ignore a static
18443 composition starting before CHARPOS (Bug#8915).
18444
18445 * xdisp.c (handle_composition_prop): Likewise.
18446
a8815b00
EZ
184472011-07-07 Eli Zaretskii <eliz@gnu.org>
18448
18449 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18450 (Bug#9015)
18451
ef7b981d 184522011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
18453
18454 * character.h (unicode_category_t): New enum type.
18455
18456 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18457 (Qchar_code_property_table): New variable.
18458 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18459 (UNIPROP_COMPRESSED_FORM_P): New macros.
18460 (char_table_ascii): Uncompress the compressed values.
18461 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18462 Uncompress the compressed values.
ac389d0c 18463 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
18464 (char_table_ref_and_range): Uncompress the compressed values.
18465 (sub_char_table_set): New arg is_uniprop. Callers changed.
18466 Uncompress the compressed values.
18467 (sub_char_table_set_range): Args changed. Callers changed.
18468 (char_table_set_range): Adjuted for the above change.
18469 (map_sub_char_table): Delete args default_val and parent. Add arg
18470 top. Give decoded values to a Lisp function.
640c8776 18471 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
18472 values to a Lisp function. Gcpro more variables.
18473 (uniprop_table_uncompress)
18474 (uniprop_decode_value_run_length): New functions.
18475 (uniprop_decoder, uniprop_decoder_count): New variables.
18476 (uniprop_get_decoder, uniprop_encode_value_character)
18477 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18478 New functions.
18479 (uniprop_encoder, uniprop_encoder_count): New variables.
18480 (uniprop_get_encoder, uniprop_table)
18481 (Funicode_property_table_internal, Fget_unicode_property_internal)
18482 (Fput_unicode_property_internal): New functions.
18483 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18484 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 18485 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
18486 char-code-property-alist.
18487
640c8776 18488 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
18489 Vunicode_category_table.
18490
640c8776 18491 * font.c (font_range): Adjust for the change of
c805dec0
KH
18492 Vunicode_category_table.
18493
76b397fb
DN
184942011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18495
18496 * m/iris4d.h: Remove file, move contents ...
18497 * s/irix6-5.h: ... here.
18498
22b4128e
PE
184992011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18500
18501 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
18502 * alloc.c (mark_buffer):
18503 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18504 (clone_per_buffer_values): Don't assume that
22b4128e
PE
18505 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18506 This isn't true in general, and it's particularly not true
18507 if Emacs is configured with --with-wide-int.
18508 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18509 New macros, used in the buffer.c change.
18510
869795d6
JD
185112011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18512
18513 * xsettings.c: Use both GConf and GSettings if both are available.
18514 (store_config_changed_event): Add comment.
18515 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18516 (store_tool_bar_style_changed): New functions.
5e617bc2 18517 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
18518 (struct xsettings): Move font inside HAVE_XFT.
18519 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 18520 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 18521 Move inside HAVE_XFT.
640c8776 18522 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
18523 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18524 also.
18525 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 18526 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 18527 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
18528 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18529 (parse_settings): Move check for font inside HAVE_XFT.
18530 (read_settings, apply_xft_settings): Add comment.
18531 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18532 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18533 call store_font_name_changed.
18534 (xft_settings_event): Add comment.
18535 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18536 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18537 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18538 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18539 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
18540 (xsettings_get_system_font, xsettings_get_system_normal_font):
18541 Add comment.
869795d6 18542
d8ed26bd
PE
185432011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18544
18545 Random fixes. E.g., (random) never returned negative values.
18546 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18547 subseconds part to the entropy, as that's a bit more random.
18548 Prefer signed to unsigned, since the signedness doesn't matter and
18549 in general we prefer signed. When given a limit, use a
18550 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18551 latter isn't right if USE_2_TAGS_FOR_INTS.
18552 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18553 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18554
cabf1cac
SM
185552011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18556
18557 * textprop.c (text_property_stickiness):
18558 Obey Vtext_property_default_nonsticky.
18559 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18560 * w32fns.c (syms_of_w32fns):
18561 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18562
6e9b2be9
PE
185632011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18564
18565 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18566 This is more efficient than Ffile_directory_p and avoids a minor race.
18567
90186c68
LMI
185682011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18569
7c301272
LMI
18570 * buffer.c (Foverlay_put): Say what the return value is
18571 (bug#7835).
18572
c4f2d8d4
LMI
18573 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18574 is a directory before asking whether to use the file name
18575 (bug#7564).
ad637907
LMI
18576 (barf_or_query_if_file_exists): Make the "File is a directory"
18577 error be more correct.
c4f2d8d4 18578
90186c68
LMI
18579 * fns.c (Frequire): Remove the mention of the .gz files, since
18580 that's installation-specific, but keep the mention of
18581 `get-load-suffixes'.
18582
da64016e
PE
185832011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18584
18585 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18586 Report string overflow if the output is too long.
18587
7d47b580
JB
185882011-07-04 Juanma Barranquero <lekktu@gmail.com>
18589
a555cb87
JB
18590 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18591 (syms_of_gnutls): Remove duplicate DEFSYM for
18592 Qgnutls_bootprop_verify_hostname_error, an error for
18593 Qgnutls_bootprop_verify_error (which is no longer used).
18594
7d47b580
JB
18595 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18596 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18597 Also (re)move comments that are misplaced or no longer relevant.
18598
1e49bfab
LMI
185992011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18600
18601 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18602
1485f4c0
CY
186032011-07-03 Chong Yidong <cyd@stupidchicken.com>
18604
18605 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18606 and background color parameters if they have been changed.
18607
a9ab721e
LMI
186082011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18609
18610 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18611
cf7cff57
PE
186122011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18613
2e13213d
PE
18614 * xsettings.c (SYSTEM_FONT): Define only when used.
18615 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18616
cf7cff57
PE
18617 * keymap.c (access_keymap_1): Now static.
18618
7a8e04f7
CY
186192011-07-02 Chong Yidong <cyd@stupidchicken.com>
18620
18621 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18622 leave any prefix arg for the up event (Bug#1586).
18623
61352f62
LMI
186242011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18625
69bb1ef7
LMI
18626 * lread.c (syms_of_lread): Mention single symbols defined by
18627 `defvar' or `defconst' (bug#7154).
18628
61352f62 18629 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 18630 (Frequire): Mention get-load-suffixes.
61352f62 18631
28545e04
MR
186322011-07-02 Martin Rudalics <rudalics@gmx.at>
18633
18634 * window.h (window): Remove clone_number slot.
18635 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18636 Remove.
18637 (make_parent_window, make_window, saved_window)
18638 (Fset_window_configuration, save_window_save): Don't deal with
18639 clone numbers.
18640 * buffer.c (Qclone_number): Remove declaration.
18641 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18642
3349e122
SM
186432011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18644
18645 Add multiple inheritance to keymaps.
18646 * keymap.c (Fmake_composed_keymap): New function.
18647 (Fset_keymap_parent): Simplify.
18648 (fix_submap_inheritance): Remove.
18649 (access_keymap_1): New function extracted from access_keymap to handle
18650 embedded parents and handle lists of maps.
18651 (access_keymap): Use it.
18652 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18653 (Fcopy_keymap): Handle embedded parents.
18654 (Fcommand_remapping, define_as_prefix): Simplify.
18655 (Fkey_binding): Simplify.
18656 (syms_of_keymap): Move minibuffer-local-completion-map,
18657 minibuffer-local-filename-completion-map,
18658 minibuffer-local-must-match-map, and
18659 minibuffer-local-filename-must-match-map to Elisp.
18660 (syms_of_keymap): Defsubr make-composed-keymap.
18661 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18662 (parse_menu_item): Trivial simplification.
18663
3279eb87
GM
186642011-07-01 Glenn Morris <rgm@gnu.org>
18665
18666 * Makefile.in (SETTINGS_LIBS): Fix typo.
18667
39cb9e56 186682011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
18669
18670 * coding.c (Fencode_coding_string): Record the last coding system
18671 used, as the function doc string says (bug#8738).
18672
0949d2b6
JD
186732011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18674
18675 * xsettings.c (store_monospaced_changed): Take new font as arg and
18676 check for change against current_mono_font.
18677 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18678 (emacs_settings_constructor, emacs_settings_get_property)
18679 (emacs_settings_set_property, emacs_settings_class_init)
18680 (emacs_settings_init, gsettings_obj): Remove.
18681 (something_changedCB): New function for HAVE_GSETTINGS.
18682 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18683 with value as argument.
18684 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18685 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 18686 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
18687 "changed".
18688
18689 * xgselect.c: Add defined (HAVE_GSETTINGS).
18690 (xgselect_initialize): Ditto.
18691
18692 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18693 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18694 xg_select.
18695
bbc6b304
PE
186962011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18697
18698 * eval.c (struct backtrace): Simplify and port the data structure.
18699 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18700 signed bit field, as this assumption is not portable and it makes
18701 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18702 "char debug_on_exit : 1" as this is not portable either; instead,
18703 use the portable "unsigned int debug_on_exit : 1". Remove unused
18704 member evalargs. Remove obsolete comments about cc bombing out.
18705
9851bfc5
JD
187062011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18707
51bb811f 18708 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
18709 Let HAVE_GSETTINGS override HAVE_GCONF.
18710 (store_monospaced_changed): New function.
18711 (EMACS_SETTINGS): A new type derived from GObject to handle
18712 GSettings notifications.
18713 (emacs_settings_constructor, emacs_settings_get_property)
18714 (emacs_settings_set_property, emacs_settings_class_init):
18715 New functions.
18716 (gsettings_client, gsettings_obj): New variables.
18717 (GSETTINGS_SCHEMA): New define.
18718 (something_changedCB): Call store_monospaced_changed.
18719 (init_gsettings): New function.
18720 (xsettings_initialize): Call init_gsettings.
18721 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18722 to NULL.
18723
640c8776 18724 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
18725 GCONF_CFLAGS/LIBS.
18726
5386012d
MR
187272011-06-29 Martin Rudalics <rudalics@gmx.at>
18728
18729 * window.c (resize_root_window, grow_mini_window)
18730 (shrink_mini_window): Rename Qresize_root_window to
18731 Qwindow_resize_root_window and Qresize_root_window_vertically to
18732 Qwindow_resize_root_window_vertically.
18733
f13e0b08
PE
187342011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18735
18736 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18737
94515237
JB
187382011-06-27 Juanma Barranquero <lekktu@gmail.com>
18739
18740 * makefile.w32-in: Redesign dependencies so they reflect more
18741 clearly which files are directly included by each source file,
18742 and not through other includes.
18743
e43b6e43
MR
187442011-06-27 Martin Rudalics <rudalics@gmx.at>
18745
18746 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18747 (sort_overlays, overlay_strings): When an overlay's clone number
18748 matches the window's clone number process the overlay even if
18749 the overlay's window property doesn't match the current window.
18750
d68443dc
MR
18751 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18752 (Fwindow_hchild): Rename to Fwindow_left_child.
18753 (Fwindow_next): Rename to Fwindow_next_sibling.
18754 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
18755 (resize_window_check): Rename to window_resize_check.
18756 (resize_window_apply): Rename to window_resize_apply.
18757 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18758 (Fdelete_other_windows_internal, resize_frame_windows)
18759 (Fsplit_window_internal, Fdelete_window_internal)
18760 (grow_mini_window, shrink_mini_window)
18761 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 18762
c7e73be5
JD
187632011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18764
18765 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18766 (emacs_fixed_set_min_size): Remove.
18767 (emacs_fixed_new): Take frame as argument.
18768
18769 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18770 (_EmacsFixedPrivate): Remove minwidth/height.
18771 Add struct frame *f.
18772 (emacs_fixed_init): Initialize priv->f.
18773 (get_parent_class, emacs_fixed_set_min_size): Remove.
18774 (emacs_fixed_new): Set priv->f to argument.
18775 (emacs_fixed_get_preferred_width)
18776 (emacs_fixed_get_preferred_height): Use min_width/height from
18777 frames size_hint to set minimum and natural (Bug#8919).
18778 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18779 and use min_width/height from frames size_hint to set
18780 min_width/height (Bug#8919).
18781
18782 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
18783 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18784 Fix indentation.
c7e73be5 18785
cf99dcf8
EZ
187862011-06-26 Eli Zaretskii <eliz@gnu.org>
18787
18788 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18789 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18790 called at ZV.
18791
029529ac
CY
187922011-06-26 Chong Yidong <cyd@stupidchicken.com>
18793
18794 * process.c (wait_reading_process_output): Bypass select if
18795 waiting for a cell while ignoring keyboard input, and input is
18796 pending. Suggested by Jan Djärv (Bug#8869).
18797
7a7ef429
PE
187982011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18799
18800 Use gnulib's dup2 module instead of rolling our own.
18801 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18802
11fdef7d 188032011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
18804
18805 * dispnew.c (scrolling_window): Before scrolling, turn off a
18806 mouse-highlight in the window being scrolled.
18807
cd3520a4
JB
188082011-06-24 Juanma Barranquero <lekktu@gmail.com>
18809
18810 Move DEFSYM to lisp.h and use everywhere.
18811
18812 * character.h (DEFSYM): Move declaration...
18813 * lisp.h (DEFSYM): ...here.
18814
18815 * gnutls.c:
18816 * minibuf.c:
18817 * w32menu.c:
18818 * w32proc.c:
18819 * w32select.c: Don't include character.h.
18820
18821 * alloc.c (syms_of_alloc):
18822 * buffer.c (syms_of_buffer):
18823 * bytecode.c (syms_of_bytecode):
18824 * callint.c (syms_of_callint):
18825 * casefiddle.c (syms_of_casefiddle):
18826 * casetab.c (init_casetab_once):
18827 * category.c (init_category_once, syms_of_category):
18828 * ccl.c (syms_of_ccl):
18829 * cmds.c (syms_of_cmds):
18830 * composite.c (syms_of_composite):
18831 * dbusbind.c (syms_of_dbusbind):
18832 * dired.c (syms_of_dired):
18833 * dispnew.c (syms_of_display):
18834 * doc.c (syms_of_doc):
18835 * editfns.c (syms_of_editfns):
18836 * emacs.c (syms_of_emacs):
18837 * eval.c (syms_of_eval):
18838 * fileio.c (syms_of_fileio):
18839 * fns.c (syms_of_fns):
18840 * frame.c (syms_of_frame):
18841 * fringe.c (syms_of_fringe):
18842 * insdel.c (syms_of_insdel):
18843 * keymap.c (syms_of_keymap):
18844 * lread.c (init_obarray, syms_of_lread):
18845 * macros.c (syms_of_macros):
18846 * msdos.c (syms_of_msdos):
18847 * print.c (syms_of_print):
18848 * process.c (syms_of_process):
18849 * search.c (syms_of_search):
18850 * sound.c (syms_of_sound):
18851 * syntax.c (init_syntax_once, syms_of_syntax):
18852 * terminal.c (syms_of_terminal):
18853 * textprop.c (syms_of_textprop):
18854 * undo.c (syms_of_undo):
18855 * w32.c (globals_of_w32):
18856 * window.c (syms_of_window):
18857 * xdisp.c (syms_of_xdisp):
18858 * xfaces.c (syms_of_xfaces):
18859 * xfns.c (syms_of_xfns):
18860 * xmenu.c (syms_of_xmenu):
18861 * xsettings.c (syms_of_xsettings):
18862 * xterm.c (syms_of_xterm): Use DEFSYM.
18863
4228cf16
TZ
188642011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18865
cd3520a4 18866 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 18867
7fcccf1e
PE
188682011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18869
7efb4e0e
PE
18870 Integer and buffer overflow fixes (Bug#8873).
18871
ff5844ad
PE
18872 * print.c (printchar, strout): Check for string overflow.
18873 (PRINTPREPARE, printchar, strout):
18874 Don't set size unless allocation succeeds.
18875
90532f02
PE
18876 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18877 for sizes. Check for string overflow more accurately.
18878 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18879
6d84508d
PE
18880 * macros.c: Integer and buffer overflow fixes.
18881 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18882 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18883 Use ptrdiff_t, not int, for sizes.
18884 Don't increment bufsize until after realloc succeeds.
18885 Check for size-calculation overflow.
18886 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18887
437b2cb4
PE
18888 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18889
8b9ac8b4
PE
18890 * lread.c: Integer overflow fixes.
18891 (read_integer): Radix is now EMACS_INT, not int,
18892 to improve quality of diagnostics for out-of-range radices.
18893 Calculate buffer size correctly for out-of-range radices.
18894 (read1): Check for integer overflow in radices, and in
18895 read-circle numbers.
82cb60d3
PE
18896 (read_escape): Avoid int overflow.
18897 (Fload, openp, read_buffer_size, read1)
18898 (substitute_object_recurse, read_vector, read_list, map_obarray):
18899 Use ptrdiff_t, not int, for sizes.
18900 (read1): Use EMACS_INT, not int, for sizes.
20270765 18901 Check for size overflow.
8b9ac8b4 18902
7fcccf1e
PE
18903 * image.c (cache_image): Check for size arithmetic overflow.
18904
bfbbd7e7
PE
18905 * lread.c: Integer overflow issues.
18906 (saved_doc_string_size, saved_doc_string_length)
18907 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18908 Now ptrdiff_t, not int.
18909 (read1): Don't assume doc string length fits in int. Check for
18910 out-of-range doc string lengths.
18911 (read_list): Don't assume file position fits in int.
39019e54 18912 (read_escape): Check for hex character overflow.
bfbbd7e7 18913
4e323265
LL
189142011-06-22 Leo Liu <sdl.web@gmail.com>
18915
18916 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18917 Move to minibuffer.el.
18918
85fece3e
PE
189192011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18920
20b84ce9 18921 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
18922 The following patches are for when GLYPH_DEBUG && !XASSERT.
18923 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18924 * dispnew.c (flush_stdout):
18925 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18926 Mark as externally visible.
18927 * dispnew.c (check_window_matrix_pointers): Now static.
18928 * dispnew.c (window_to_frame_vpos):
18929 * xfns.c (unwind_create_frame):
18930 * xterm.c (x_check_font): Remove unused local.
18931 * scroll.c (CHECK_BOUNDS):
18932 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18933 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18934 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18935 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18936 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18937 Now static.
18938 (debug_method_add): Use va_list and vsprintf rather than relying
18939 on undefined behavior with wrong number of arguments.
18940 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18941 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18942 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18943 since we're not interested in debugging glyphs with old libraries.
18944 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18945 GCC 4.6.0's static checking.
18946
0766b489
PE
189472011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18948
31fd4b32
PE
18949 Integer overflow and signedness fixes (Bug#8873).
18950 A few related buffer overrun fixes, too.
18951
b79e8648
PE
18952 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18953
0766b489
PE
18954 * dispextern.h (struct face.stipple):
18955 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18956 (x_bitmap_mask, x_allocate_bitmap_record)
18957 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18958 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18959 (x_create_bitmap_from_xpm_data):
18960 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18961 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18962 (.bitmaps_last):
18963 * xfaces.c (load_pixmap):
18964 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18965 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18966 (.bitmaps_last, struct x_output.icon_bitmap):
18967 Use ptrdiff_t, not int, for bitmap indexes.
18968 (x_allocate_bitmap_record): Check for size overflow.
18969 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18970
b081724f
PE
18971 Use ptrdiff_t, not int, for overlay counts.
18972 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18973 * editfns.c (overlays_around, get_pos_property):
18974 * textprop.c (get_char_property_and_overlay):
18975 * xdisp.c (next_overlay_change, note_mouse_highlight):
18976 * xfaces.c (face_at_buffer_position):
21514da7
PE
18977 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18978 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18979 (Fnext_overlay_change, Fprevious_overlay_change)
18980 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 18981 Use ptrdiff_t, not int, for sizes.
21514da7 18982 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 18983
3de73e5e
PE
18984 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18985
2606c57b
PE
18986 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18987 (x_session_initialize): Do not assume string length fits in int.
18988
aaafe47a
PE
18989 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18990 This is unlikely, but can occur if DPI is outlandish.
18991
2674ddc8 18992 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
18993 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18994
28154962
PE
18995 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18996 * xrdb.c (magic_file_p, search_magic_path):
18997 Omit last arg SUFFIX; it was always 0. All callers changed.
18998 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18999
7de51af5
PE
19000 * xfont.c (xfont_match): Avoid need for strlen.
19001
25ed6cc3
PE
19002 * xfns.c: Don't assume strlen fits in int.
19003 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19004
4eab31dd
PE
19005 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19006 not unsigned long, as we prefer signed integers. All callers changed.
19007 Detect integer overflow in repeat count.
19008 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 19009 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 19010
171e2a58
PE
19011 * termcap.c: Don't assume sizes fit in int and never overflow.
19012 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19013 (gobble_line): Check for size-calculation overflow.
19014
ad39faca 19015 * minibuf.c (Fread_buffer):
6e5bb2dc 19016 * lread.c (intern, intern_c_string):
74ca2eb3
PE
19017 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19018 Don't assume string length fits in int.
19019
52c61c22 19020 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
19021 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19022
b5b8c9e5
PE
19023 * font.c: Don't assume string length fits in int.
19024 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19025 Use ptrdiff_t, not int.
ccd6111c
PE
19026 (font_intern_prop): Don't assume string length fits in int.
19027 Don't assume integer property fits in fixnum.
19028 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 19029
882f0d81 19030 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 19031 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
19032 Reformulate so as not to need the command string.
19033 Invoke gzip -cd rather than gunzip, as it's more portable.
19034 (lock_info_type, lock_file_1, lock_file):
19035 Don't assume pid_t and time_t fit in unsigned long.
19036 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19037 (current_lock_owner): Prefer signed type for sizes.
19038 Use memcpy, not strncpy, where memcpy is what is really wanted.
19039 Don't assume (via atoi) that time_t and pid_t fit in int.
19040 Check for time_t and/or pid_t out of range, e.g., via a network share.
19041 Don't alloca where an auto var works fine.
19042
93f4cf88
PE
19043 * fileio.c: Fix some integer overflow issues.
19044 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19045 Don't assume string length fits in int.
19046 (directory_file_name): Don't assume string length fits in long.
19047 (make_temp_name): Don't assume pid fits in int, or that its print
19048 length is less than 20.
19049
f3e92b69
PE
19050 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19051
1bfdaf10
PE
19052 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19053
35016e9a
PE
19054 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19055
3d1e65a1
PE
19056 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19057 We prefer signed integers, even for size calculations.
19058
0b963a93
PE
19059 * emacs.c: Don't assume string length fits in 'int'.
19060 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19061 (main): Don't invoke strlen when not needed.
19062
573f4b54
PE
19063 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19064 (XD_DEBUG_MESSAGE): Don't waste a byte.
19065
989f33ba
PE
19066 * callproc.c (getenv_internal_1, getenv_internal)
19067 (Fgetenv_internal):
965d34eb
PE
19068 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19069
e4d29b33
PE
19070 * lread.c (invalid_syntax): Omit length argument.
19071 All uses changed. This doesn't fix a bug, but it simplifies the
19072 code away from its former Hollerith-constant appearance, and it's
19073 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 19074 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 19075
eb49b136
PE
19076 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19077 This didn't break anything, but it didn't help either.
19078 It's confusing to put a bogus integer in a place where the actual
19079 value does not matter.
9f62aeb1 19080 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 19081 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 19082
15375a22
PE
19083 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19084 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19085 implementation.
b61cc01c
PE
19086 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19087 We prefer signed types, and the value cannot exceed the EMACS_INT
19088 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
19089 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19090 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19091 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 19092
53b2623d
PE
19093 * indent.c (sane_tab_width): New function.
19094 (current_column, scan_for_column, Findent_to, position_indentation)
19095 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 19096 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 19097
51cab52b 19098 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 19099
f2ed8a70
PE
19100 * lisp.h (lint_assume): New macro.
19101 * composite.c (composition_gstring_put_cache):
19102 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19103
abe80cc6
PE
19104 * editfns.c, insdel.c:
19105 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 19106
b02c740e
PE
19107 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19108
ebc96716
PE
19109 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19110
b4e50fa0 19111 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 19112 Use much-faster test for byte-length change.
311d5d7c 19113 Don't assume string byte-length fits in 'int'.
a4cf38e4 19114 Check that character arg fits in 'int'.
85461888 19115 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 19116
c0c1ee9f
PE
19117 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19118
a498d7f4
PE
19119 * fns.c (concat): Catch string overflow earlier.
19120 Do not rely on integer wraparound.
19121
51cab52b
PE
19122 * dispextern.h (struct it.overlay_strings_charpos)
19123 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
19124 * xdisp.c (forward_to_next_line_start)
19125 (back_to_previous_visible_line_start)
19126 (reseat_at_next_visible_line_start, next_element_from_buffer):
19127 Don't arbitrarily truncate the value of 'selective' to int.
19128
76031fad
PE
19129 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19130
5eb55db9
PE
19131 * composite.c: Don't truncate sizes to 'int'.
19132 (composition_gstring_p, composition_reseat_it)
19133 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
19134 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19135 not EMACS_UINT, for indexes.
5eb55db9 19136
0703a717
PE
19137 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19138
d6202519
PE
19139 * buffer.c: Include <verify.h>.
19140 (struct sortvec.priority, struct sortstr.priority):
8961a454 19141 Now EMACS_INT, not int.
c20998a7 19142 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
19143 (struct sortstr.size, record_overlay_string)
19144 (struct sortstrlist.size, struct sortlist.used):
19145 Don't truncate size to int.
19146 (record_overlay_string): Check for size-calculation overflow.
d6202519 19147 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 19148
d5a19415
JM
191492011-06-22 Jim Meyering <meyering@redhat.com>
19150
029529ac 19151 Don't leak an XBM-image-sized buffer
d5a19415
JM
19152 * image.c (xbm_load): Free the image buffer after using it.
19153
a9041e6c
PE
191542011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19155
19156 Port to Sun C.
19157 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19158 that Sun C diagnosed.
19159 * fns.c (secure_hash): Fix pointer signedness issue.
19160 * intervals.c (static_offset_intervals): New function.
19161 (offset_intervals): Use it.
19162
7f3f739f
LL
191632011-06-21 Leo Liu <sdl.web@gmail.com>
19164
19165 * deps.mk (fns.o):
19166 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19167 sha512.h.
19168
19169 * fns.c (secure_hash): Rename from crypto_hash_function and change
19170 the first arg to accept symbols.
5b66d427 19171 (Fsecure_hash): New primitive.
7f3f739f
LL
19172 (syms_of_fns): New symbols.
19173
76147d94
DD
191742011-06-20 Deniz Dogan <deniz@dogan.se>
19175
19176 * process.c (Fset_process_buffer): Clarify return value in
19177 docstring.
19178
7d7d0045
CY
191792011-06-18 Chong Yidong <cyd@stupidchicken.com>
19180
19181 * dispnew.c (add_window_display_history): Use BVAR.
19182
19183 * xdisp.c (debug_method_add): Use BVAR.
19184 (check_window_end, dump_glyph_matrix, dump_glyph)
19185 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19186
19187 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19188 Likewise.
19189
19190 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19191 check till after the cache is created in init_frame_faces.
19192
ff2bc410
SM
191932011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19194
19195 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19196
28177add
PE
191972011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19198
dd3482fe
PE
19199 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19200 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19201 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19202
393d71f3 19203 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
19204 * fileio.c (Finsert_file_contents):
19205 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19206 Remove the old (too-loose) buffer overflow checks.
19207 They weren't needed, since make_gap checks for buffer overflow.
19208 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19209 The old code merely checked for Emacs fixnum overflow, and relied
19210 on undefined (wraparound) behavior. The new code avoids undefined
19211 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19212
2e6813b0 19213 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
19214 Tune. Don't use wider integers than needed. Don't use alloca.
19215 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 19216
599a9e4f
PE
19217 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19218
99561444
PE
19219 * insdel.c, lisp.h (buffer_overflow): New function.
19220 (insert_from_buffer_1, replace_range, replace_range_2):
19221 * insdel.c (make_gap_larger):
19222 * editfns.c (Finsert_char):
19223 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19224
28177add
PE
19225 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19226
e69dafad
PE
192272011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19228
4baa020d 19229 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 19230
b1c46f02
PE
19231 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19232 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19233
e69dafad
PE
19234 * fileio.c: Don't assume EMACS_INT fits in off_t.
19235 (emacs_lseek): New static function.
19236 (Finsert_file_contents, Fwrite_region): Use it.
19237 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19238
566684ea
PE
19239 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19240
e6966cd6
PE
19241 * fns.c: Don't overflow int when computing a list length.
19242 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19243 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19244 truncation on 64-bit hosts. Check for QUIT every
19245 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19246 faster and is responsive enough.
19247 (Flength): Report an error instead of overflowing an integer.
19248 (Fsafe_length): Return a float if the value is not representable
19249 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 19250 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 19251 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 19252
dd0b0efb
PE
19253 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19254 (header_size, word_size): New constants.
19255 (allocate_vectorlike): Don't check size overflow here.
19256 (allocate_vector): Check it here instead, since this is the only
19257 caller of allocate_vectorlike that could cause overflow.
19258 Check that the new vector's length is representable as a fixnum.
19259
86fe5cfe
PE
19260 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19261 The previous code was bogus. For example, next_almost_prime (32)
19262 returned 39, which is undesirable as it is a multiple of 3; and
19263 next_almost_prime (24) returned 25, which is a multiple of 5 so
19264 why was the code bothering to check for multiples of 7?
19265
80e88859
PE
19266 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19267
4a2f0ad6
PE
19268 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19269
f66c7cf8
PE
19270 Variadic C functions now count arguments with ptrdiff_t.
19271 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19272 Back then I didn't know that the Emacs coding style prefers signed int.
19273 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
19274 were being counted with int, which may truncate counts on 64-bit
19275 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
19276 * lisp.h (struct Lisp_Subr.function.aMANY)
19277 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19278 Arg counts are now ptrdiff_t, not size_t.
19279 All variadic functions and their callers changed accordingly.
19280 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19281 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19282 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19283 * callint.c (Fcall_interactively): Check arg count for overflow,
19284 to avoid potential buffer overrun. Use signed char, not 'int',
19285 for 'varies' array, so that we needn't bother to check its size
19286 calculation for overflow.
19287 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19288 * eval.c (apply_lambda):
19289 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19290 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19291 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19292
a1759b76
PE
19293 * callint.c (Fcall_interactively): Don't use index var as event count.
19294
d96be9fc
PE
19295 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19296 * mem-limits.h (SIZE): Remove; no longer used.
19297
a690a978 19298 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 19299
578c21e6
PE
19300 Remove unnecessary casts.
19301 * xterm.c (x_term_init):
19302 * xfns.c (x_set_border_pixel):
19303 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19304 These aren't needed now that we assume ANSI C.
19305
96f53c6c
PE
19306 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19307 It's more likely to cause problems (due to unsigned overflow)
19308 than to cure them.
19309
83c77d31
PE
19310 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19311
ee2079f1
PE
19312 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19313
6da65536
PE
19314 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19315
7147c4a4
PE
19316 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19317
193e32d9
PE
19318 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19319
e5533da6
PE
19320 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19321
9910e595
PE
19322 GLYPH_CODE_FACE returns EMACS_INT, not int.
19323 * dispextern.h (merge_faces):
19324 * xfaces.c (merge_faces):
01103c44
PE
19325 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19326 Don't assume EMACS_INT fits in int.
9910e595 19327
2638320e
PE
19328 * character.h (CHAR_VALID_P): Remove unused parameter.
19329 * fontset.c, lisp.h, xdisp.c: All uses changed.
19330
045eb8d9
PE
19331 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19332
c1f134b5
PE
19333 * fns.c (concat): Minor tuning based on overflow analysis.
19334 This doesn't fix any bugs. Use int to hold character, instead
19335 of constantly refetching from Emacs object. Use XFASTINT, not
19336 XINT, for value known to be a character. Don't bother comparing
19337 a single byte to 0400, as it's always less.
19338
395fcb93 19339 * floatfns.c (Fexpt):
327eeec8
PE
19340 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19341
abbd3d23
PE
19342 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19343 for characters.
19344
684a03ef
PE
19345 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19346
0fed43f3
PE
19347 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19348 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19349 incorrectly succeed when S was a string, because 4294967386 was
19350 truncated before it was used.
19351
8fd02eb7
PE
19352 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19353 Otherwise, an out-of-range integer could cause undefined behavior
19354 on a 64-bit host.
19355
f8c86b69
PE
19356 * composite.c: Use int, not EMACS_INT, for characters.
19357 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19358 EMACS_INT, for values that are known to be in character range.
19359 This doesn't fix any bugs but is the usual style inside Emacs and
19360 may generate better code on 32-bit machines.
19361
34206dd2
PE
19362 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19363 This is for reasons similar to the recent CHAR_STRING fix.
19364 * charset.c (Fencode_char): Check that character arg is actually
19365 a character. Pass an int to ENCODE_CHAR.
19366 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19367 wider than 'int', as a compile-time check to prevent future regressions
19368 in this area.
19369
c5958d4c 19370 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
19371
19372 Make sure a 64-bit char is never passed to CHAR_STRING.
19373 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19374 by silently ignoring the top 32 bits, allowing some values
19375 that were far too large to be valid characters.
19376 * character.h: Include <verify.h>.
19377 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19378 arguments are no wider than unsigned, as a compile-time check
19379 to prevent future regressions in this area.
19380 * data.c (Faset):
01103c44 19381 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
19382 (Fsubst_char_in_region):
19383 * fns.c (concat):
19384 * xdisp.c (decode_mode_spec_coding):
19385 Adjust to CHAR_STRING's new requirement.
19386 * editfns.c (Finsert_char, Fsubst_char_in_region):
19387 * fns.c (concat): Check that character args are actually
19388 characters. Without this test, these functions did the wrong
19389 thing with wildly out-of-range values on 64-bit hosts.
19390
d37ca623
PE
19391 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19392 These casts should not be needed on 32-bit hosts, either.
19393 * keyboard.c (read_char):
19394 * lread.c (Fload): Remove casts to unsigned.
19395
ea204efb
PE
19396 * lisp.h (UNSIGNED_CMP): New macro.
19397 This fixes comparison bugs on 64-bit hosts.
19398 (ASCII_CHAR_P): Use it.
19399 * casefiddle.c (casify_object):
01103c44 19400 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
19401 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19402 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19403 * dispextern.h (FACE_FROM_ID):
19404 * keyboard.c (read_char): Use UNSIGNED_CMP.
19405
41cb286c
PE
19406 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19407 not to EMACS_INT, to avoid GCC warning.
19408
4a1b9832
PE
19409 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19410
55daad71
PE
19411 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19412 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19413 isn't needed on 32-bit machines.
8f95c75c 19414
01103c44
PE
19415 * buffer.c (Fgenerate_new_buffer_name):
19416 Use EMACS_INT for count, not int.
0ceccced 19417 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
19418
19419 * data.c (Qcompiled_function): Now static.
19420
c6f072e7
PE
19421 * window.c (window_body_lines): Now static.
19422
20ce5912
PE
19423 * image.c (gif_load): Rename local to avoid shadowing.
19424
9c4c5f81
PE
19425 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19426 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19427 * alloc.c (make_save_value): Integer argument is now of type
19428 ptrdiff_t, not int.
19429 (mark_object): Use ptrdiff_t, not int.
19430 * lisp.h (pD): New macro.
19431 * print.c (print_object): Use it.
19432
c0c5c8ae
PE
19433 * alloc.c: Use EMACS_INT, not int, to count objects.
19434 (total_conses, total_markers, total_symbols, total_vector_size)
19435 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
19436 (total_free_floats, total_floats, total_free_intervals)
19437 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
19438 Now EMACS_INT, not int. All uses changed.
19439 (Fgarbage_collect): Compute overall total using a double, so that
19440 integer overflow is less likely to be a problem. Check for overflow
19441 when converting back to an integer.
5a25e253
PE
19442 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19443 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19444 These were 'int' variables that could overflow on 64-bit hosts;
19445 they were never used, so remove them instead of repairing them.
211a0b2a 19446 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
19447 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19448 Previously, this ceilinged at INT_MAX, but that doesn't work on
19449 64-bit machines.
e46bb31a 19450 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 19451
c78baabf 19452 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 19453 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
19454 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19455 when a (possibly-narrower) signed value would do just as well.
19456 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 19457
c9d624c6
PE
19458 * alloc.c: Catch some string size overflows that we were missing.
19459 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19460 for convenience in STRING_BYTES_MAX.
19461 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19462 The definition here is exact; the one in lisp.h was approximate.
19463 (allocate_string_data): Check for string overflow. This catches
19464 some instances we weren't catching before. Also, it catches
19465 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19466 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19467 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 19468
c9d624c6
PE
19469 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19470 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 19471 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 19472
353032ce
PE
19473 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19474
2bccce07
PE
19475 * alloc.c (Fmake_string): Check for out-of-range init.
19476
0ac30604
SM
194772011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19478
19479 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19480
c195f2de
JD
194812011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19482
19483 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19484 xg_get_default_scrollbar_width.
19485
19486 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19487 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19488 (style_changed_cb): Call update_theme_scrollbar_width and call
19489 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19490 all frames (Bug#8505).
19491 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19492 Call gtk_window_set_resizable if HAVE_GTK3.
19493 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19494 and height if HAVE_GTK3 (Bug#8505).
19495 (scroll_bar_width_for_theme): New variable.
19496 (update_theme_scrollbar_width): New function.
19497 (xg_get_default_scrollbar_width): Move code to
19498 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19499 (xg_initialize): Call update_theme_scrollbar_width.
19500
19501 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19502
19503 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19504
e10ac9f1
MR
195052011-06-12 Martin Rudalics <rudalics@gmx.at>
19506
19507 * frame.c (make_frame): Call other_buffer_safely instead of
19508 other_buffer.
19509
19510 * window.c (temp_output_buffer_show): Call display_buffer with
19511 second argument Vtemp_buffer_show_specifiers and reset latter
19512 immediately after the call.
19513 (Vtemp_buffer_show_specifiers): New variable.
19514 (auto_window_vscroll_p, next_screen_context_lines)
19515 (Vscroll_preserve_screen_position): Remove leading asterisks from
19516 doc-strings.
19517
2d3c217e 195182011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 19519
7b7f97e8 19520 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
19521 * buffer.c (Qclone_number): Remove for now, as it's unused.
19522 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19523 (record_buffer): Remove unused local.
19524 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19525 (set_frame_buffer_list): Remove; unused.
19526 * frame.h (other_visible_frames): Remove decl.
19527 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19528 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19529 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19530 if HAVE_GPM.
19531 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19532 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19533 Define only if HAVE_GPM.
19534 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19535 (update_hints_inhibit): Remove; never set. All uses removed.
19536 * widgetprv.h (emacsFrameClassRec): Remove decl.
19537 * window.c (delete_deletable_window): Now returns void, since it
19538 wasn't returning anything.
19539 (compare_window_configurations): Remove unused locals.
19540 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19541 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
19542 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19543 the same widths as pointers. This follows up on the 2011-05-06 patch.
19544 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19545 * xterm.h: Likewise.
19546 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19547
1384b89e
JB
195482011-06-12 Juanma Barranquero <lekktu@gmail.com>
19549
19550 * makefile.w32-in: Update dependencies.
19551 (LISP_H): Add lib/intprops.h.
19552
1100a63c
CY
195532011-06-11 Chong Yidong <cyd@stupidchicken.com>
19554
19555 * image.c (gif_load): Add animation frame delay to the metadata.
19556 (syms_of_image): Use DEFSYM. New symbol `delay'.
19557
6198ccd0
MR
195582011-06-11 Martin Rudalics <rudalics@gmx.at>
19559
19560 * window.c (delete_deletable_window): Re-add.
19561 (Fset_window_configuration): Rewrite to handle dead buffers and
19562 consequently deletable windows.
19563 (window_tree, Fwindow_tree): Remove. Supply functionality in
19564 window.el.
19565 (compare_window_configurations): Simplify code.
19566
b6e3633c
AS
195672011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19568
1ab0dee5
AS
19569 * image.c (imagemagick_load_image): Fix type mismatch.
19570 (Fimagemagick_types): Likewise.
19571
b6e3633c
AS
19572 * window.h (replace_buffer_in_windows): Declare.
19573
9397e56f
MR
195742011-06-11 Martin Rudalics <rudalics@gmx.at>
19575
19576 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19577 Qclone_number. Remove external declaration of Qdelete_window.
19578 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19579 code.
640c8776
SM
19580 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19581 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
19582 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19583 buffer list implementation.
19584 (other_buffer_safely): New function.
19585 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19586 calls to replace_buffer_in_windows and
19587 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19588 if allowed.
19589 (record_buffer): Inhibit quitting and rewrite using quittable
19590 functions. Run Qbuffer_list_update_hook if allowed.
19591 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
19592 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19593 Move switch-to-buffer to window.el.
9397e56f
MR
19594 (bury-buffer): Move to window.el.
19595 (Vbuffer_list_update_hook): New variable.
19596
19597 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19598 section.
19599
19600 * window.h (resize_frame_windows): Move up in code.
19601 (Fwindow_frame): Remove EXFUN.
19602 (replace_buffer_in_all_windows): Remove prototype.
19603 (replace_buffer_in_windows_safely): Add prototype.
19604
19605 * window.c: Declare Qdelete_window static again. Move down
19606 declaration of select_count.
19607 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19608 (Fother_window): Move to window.el.
19609 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19610 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19611 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19612 window.el.
19613 (replace_buffer_in_windows): Implement by calling
19614 Qreplace_buffer_in_windows.
19615 (replace_buffer_in_all_windows): Remove with some functionality
19616 moved into replace_buffer_in_windows_safely.
19617 (replace_buffer_in_windows_safely): New function.
19618 (select_window_norecord, select_frame_norecord): Move in front
19619 of run_window_configuration_change_hook. Remove now obsolete
19620 declarations.
640c8776
SM
19621 (Fset_window_buffer): Rewrite doc-string.
19622 Call Qrecord_window_buffer.
9397e56f
MR
19623 (keys_of_window): Move binding for other-window to window.el.
19624
b50691aa
CY
196252011-06-11 Chong Yidong <cyd@stupidchicken.com>
19626
19627 * dispextern.h (struct image): Replace data member, whose int_val
19628 and ptr_val fields were not used by anything, with a single
19629 lisp_val object.
19630
19631 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19632 (gif_clear_image, gif_load, imagemagick_load_image)
19633 (gs_clear_image, gs_load): Callers changed.
19634
3f754b86
PE
196352011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19636
cca69397
PE
19637 * buffer.h: Include <time.h>, for time_t.
19638 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19639
109e28d0
PE
19640 Fix minor problems found by static checking.
19641
60737f02
PE
19642 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19643
4b66faf3
PE
19644 Make identifiers static if they are not used in other modules.
19645 * data.c (Qcompiled_function, Qframe, Qvector):
19646 * image.c (QimageMagick, Qsvg):
19647 * minibuf.c (Qmetadata):
19648 * window.c (resize_window_check, resize_root_window): Now static.
19649 * window.h (resize_window_check, resize_root_window): Remove decls.
19650
109e28d0
PE
19651 * window.c (window_deletion_count, delete_deletable_window):
19652 Remove; unused.
46a4ce9e
PE
19653 (window_body_lines): Now static.
19654 (Fdelete_other_windows_internal): Mark vars as initialized.
19655 Make sure 'resize_failed' is initialized.
19656 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19657 (resize_window_apply): Remove unused local.
19658 * window.h (delete_deletable_window): Remove decl.
19659
109e28d0 19660 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
19661 (imagemagick_load_image): Fix pointer signedness problem by changing
19662 last arg from unsigned char * to char *. All uses changed.
19663 Also, fix a local for similar reasons.
19664 Remove unused locals. Remove locals to avoid shadowing.
19665 (fn_rsvg_handle_free): Remove; unused.
19666 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 19667 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 19668
3f754b86
PE
19669 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19670
2547adb1
CY
196712011-06-10 Chong Yidong <cyd@stupidchicken.com>
19672
19673 * image.c (gif_load): Fix omitted cast error introduced by
19674 2011-06-06 change.
19675
2c8e37d4
MR
196762011-06-10 Martin Rudalics <rudalics@gmx.at>
19677
19678 * window.h (resize_proportionally, orig_total_lines)
19679 (orig_top_line): Remove from window structure.
19680 (set_window_height, set_window_width, change_window_heights)
19681 (Fdelete_window): Remove prototypes.
19682 (resize_frame_windows): Remove duplicate declaration.
19683
440a42e3
EZ
196842011-06-10 Eli Zaretskii <eliz@gnu.org>
19685
19686 * window.h (resize_frame_windows, resize_window_check)
19687 (delete_deletable_window, resize_root_window)
19688 (resize_frame_windows): Declare prototypes.
19689
19690 * window.c (resize_window_apply): Make definition be "static" to
19691 match the prototype.
19692
562dd5e9
MR
196932011-06-10 Martin Rudalics <rudalics@gmx.at>
19694
19695 * window.c: Remove declarations of Qwindow_size_fixed,
19696 window_min_size_1, window_min_size_2, window_min_size,
19697 size_window, window_fixed_size_p, enlarge_window, delete_window.
19698 Remove static from declaration of Qdelete_window, it's
19699 temporarily needed by Fbury_buffer.
19700 (replace_window): Don't assign orig_top_line and
19701 orig_total_lines.
19702 (Fdelete_window, delete_window): Remove. Window deletion is
19703 handled by window.el.
640c8776
SM
19704 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19705 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
19706 (Fdelete_other_windows): Remove. Deleting other windows is
19707 handled by window.el.
19708 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19709 handled in window.el.
19710 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19711 Window minimum sizes are handled in window.el.
19712 (shrink_windows, size_window, set_window_height)
19713 (set_window_width, change_window_heights, window_height)
19714 (window_width, CURBEG, CURSIZE, enlarge_window)
19715 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19716 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19717 handled in window.el.
19718 (make_dummy_parent): Rename to make_parent_window and give it a
19719 second argument horflag.
19720 (make_window): Don't set resize_proportionally any more.
19721 (Fsplit_window): Remove. Windows are split in window.el.
19722 (save_restore_action, save_restore_orig_size)
19723 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19724 Resize mini windows in window.el.
19725 (grow_mini_window, shrink_mini_window): Implement by calling
19726 Qresize_root_window_vertically, resize_window_check and
19727 resize_window_apply.
640c8776
SM
19728 (saved_window, Fset_window_configuration, save_window_save):
19729 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
19730 resize_proportionally.
19731 (window_min_height, window_min_width): Move to window.el.
19732 (keys_of_window): Move bindings for delete-other-windows,
19733 split-window, delete-window and enlarge-window to window.el.
19734
19735 * buffer.c: Temporarily extern Qdelete_window.
19736 (Fbury_buffer): Temporarily call Qdelete_window instead of
19737 Fdelete_window (Fbury_buffer will move to window.el soon).
19738
19739 * frame.c (set_menu_bar_lines_1): Remove code handling
19740 orig_top_line and orig_total_lines.
19741
19742 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19743 set_window_height but set heights directly.
19744 (change_frame_size_1): Use resize_frame_windows.
19745
19746 * xdisp.c (init_xdisp): Don't use set_window_height but set
19747 heights directly.
19748
640c8776
SM
19749 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19750 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
19751 run_window_configuration_change_hook.
19752
19753 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19754 instead of change_window_heights and run
19755 run_window_configuration_change_hook.
19756
1a13852e
MR
197572011-06-09 Martin Rudalics <rudalics@gmx.at>
19758
19759 * window.c (replace_window): Rename second argument REPLACEMENT to
19760 NEW. New third argument SETFLAG. Rewrite.
19761 (delete_window, make_dummy_parent): Call replace_window with
19762 third argument 1.
19763 (window_list_1): Move down in code.
19764 (run_window_configuration_change_hook): Move set_buffer part
19765 before select_frame_norecord part in order to unwind correctly.
19766 Rename count1 to count.
19767 (recombine_windows, delete_deletable_window, resize_root_window)
19768 (Fdelete_other_windows_internal)
19769 (Frun_window_configuration_change_hook, make_parent_window)
19770 (resize_window_check, resize_window_apply, Fresize_window_apply)
19771 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
19772 (Fdelete_window_internal, Fresize_mini_window_internal):
19773 New functions.
1a13852e
MR
19774 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19775
f3d1777e
MR
197762011-06-08 Martin Rudalics <rudalics@gmx.at>
19777
496e208e
MR
19778 * window.h (window): Add some new members to window structure -
19779 normal_lines, normal_cols, new_total, new_normal, clone_number,
19780 splits, nest, prev_buffers, next_buffers.
19781 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 19782 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 19783
f3d1777e
MR
19784 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19785 Remove.
496e208e
MR
19786 (make_dummy_parent): Set new members of windows structure.
19787 (make_window): Move down in code. Handle new members of window
19788 structure.
19789 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19790 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19791 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19792 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
19793 (Fset_window_next_buffers, Fset_window_clone_number):
19794 New functions.
496e208e
MR
19795 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19796 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19797 Doc-string fixes.
19798 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19799 Argument WINDOW can be now internal window too.
19800 (Fwindow_use_time): Move up in code.
19801 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19802 Rewrite doc-string.
19803 (Fset_window_configuration, saved_window)
19804 (Fcurrent_window_configuration, save_window_save): Handle new
19805 members of window structure.
b9e809c2
MR
19806 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19807 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19808 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19809 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19810 Qget_mru_window, Qresize_root_window,
19811 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19812 Qauto_buffer_name; staticpro them.
f3d1777e 19813
abde8f8c
MR
198142011-06-07 Martin Rudalics <rudalics@gmx.at>
19815
19816 * window.c (Fwindow_total_size, Fwindow_left_column)
19817 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19818 (Fwindow_list_1): New functions.
19819 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
19820 (Fwindow_width, Fscroll_left, Fscroll_right):
19821 Use window_body_cols instead of window_box_text_cols.
19822 (delete_window, Fset_window_configuration):
19823 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
19824 (delete_all_subwindows): Take a window as argument and not a
19825 structure. Rewrite.
190b47e6
MR
19826 (window_loop): Remove handling of GET_LRU_WINDOW and
19827 GET_LARGEST_WINDOW.
19828 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
19829
19830 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
19831 window_box_text_cols. delete_all_subwindows now takes a
19832 Lisp_Object as argument.
abde8f8c 19833
640c8776
SM
19834 * indent.c (compute_motion, Fcompute_motion):
19835 Use window_body_cols instead of window_box_text_cols.
abde8f8c 19836
fa8a67e6
MR
19837 * frame.c (delete_frame): Call delete_all_subwindows with root
19838 window as argument.
19839
a54e3482
DC
198402011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19841
19842 * fns.c (Fputhash): Document return value.
19843
60002bf5
CY
198442011-06-06 Chong Yidong <cyd@stupidchicken.com>
19845
19846 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19847
0c671da6 198482011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 19849
b862a52a 19850 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 19851
be44ca6c
PE
19852 Check for overflow when converting integer to cons and back.
19853 * charset.c (Fdefine_charset_internal, Fdecode_char):
19854 Use cons_to_unsigned to catch overflow.
19855 (Fencode_char): Use INTEGER_TO_CONS.
19856 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19857 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19858 * data.c (long_to_cons, cons_to_long): Remove.
19859 (cons_to_unsigned, cons_to_signed): New functions.
19860 These signal an error for invalid or out-of-range values.
19861 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19862 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19863 * font.c (Ffont_variation_glyphs):
19864 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19865 * lisp.h: Include <intprops.h>.
19866 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19867 (cons_to_signed, cons_to_unsigned): New decls.
19868 (long_to_cons, cons_to_long): Remove decls.
19869 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19870 (Fprimitive_undo): Use CONS_TO_INTEGER.
19871 * xfns.c (Fx_window_property): Likewise.
19872 * xselect.c: Include <limits.h>.
19873 (x_own_selection, selection_data_to_lisp_data):
19874 Use INTEGER_TO_CONS.
19875 (x_handle_selection_request, x_handle_selection_clear)
19876 (x_get_foreign_selection, Fx_disown_selection_internal)
19877 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19878 (lisp_data_to_selection_data): Use cons_to_unsigned.
19879 (x_fill_property_data): Use cons_to_signed.
19880 Report values out of range.
19881
d1f3d2af
PE
19882 Check for buffer and string overflow more precisely.
19883 * buffer.h (BUF_BYTES_MAX): New macro.
19884 * lisp.h (STRING_BYTES_MAX): New macro.
19885 * alloc.c (Fmake_string):
19886 * character.c (string_escape_byte8):
19887 * coding.c (coding_alloc_by_realloc):
19888 * doprnt.c (doprnt):
19889 * editfns.c (Fformat):
19890 * eval.c (verror):
19891 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19892 since they may not be the same number.
19893 * editfns.c (Finsert_char):
19894 * fileio.c (Finsert_file_contents):
19895 Likewise for BUF_BYTES_MAX.
19896
dd52fcea
PE
19897 * image.c: Use ptrdiff_t, not int, for sizes.
19898 (slurp_file): Switch from int to ptrdiff_t.
19899 All uses changed.
19900 (slurp_file): Check that file size fits in both size_t (for
19901 malloc) and ptrdiff_t (for sanity and safety).
19902
7f9bbdbb
PE
19903 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19904 if b->modtime has its maximal value.
19905
dfe18f82
PE
19906 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19907
84acfcf0
PE
19908 Don't assume time_t can fit into int.
19909 * buffer.h (struct buffer.modtime): Now time_t, not int.
19910 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19911 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19912
ccd9a01a
PE
19913 Minor fixes for signed vs unsigned integers.
19914 * character.h (MAYBE_UNIFY_CHAR):
19915 * charset.c (maybe_unify_char):
19916 * keyboard.c (read_char, reorder_modifiers):
19917 XINT -> XFASTINT, since the integer must be nonnegative.
19918 * ftfont.c (ftfont_spec_pattern):
19919 * keymap.c (access_keymap, silly_event_symbol_error):
19920 XUINT -> XFASTINT, since the integer must be nonnegative.
19921 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19922 since it makes no difference and we prefer signed.
19923 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19924 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19925 nonnegative.
19926
d6d100dd
SM
199272011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19928
19929 * window.h (Fwindow_frame): Declare.
19930
2b6148e4
PE
199312011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19932
19933 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19934 (SPARE_MEMORY): Always define.
19935 (LARGE_REQUEST): Remove.
19936 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19937
f230ecc9
MR
199382011-06-06 Martin Rudalics <rudalics@gmx.at>
19939
727e958e
MR
19940 * lisp.h: Move EXFUNS for Fframe_root_window,
19941 Fframe_first_window and Fset_frame_selected_window to window.h.
19942
19943 * window.h: Move EXFUNS for Fframe_root_window,
19944 Fframe_first_window and Fset_frame_selected_window here from
19945 lisp.h.
19946
19947 * frame.c (Fwindow_frame, Fframe_first_window)
19948 (Fframe_root_window, Fframe_selected_window)
19949 (Fset_frame_selected_window): Move to window.c.
19950 (Factive_minibuffer_window): Move to minibuf.c.
19951 (Fother_visible_frames_p): New function.
19952
19953 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19954
f230ecc9
MR
19955 * window.c (decode_window, decode_any_window): Move up in code.
19956 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19957 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
19958 (Fwindow_buffer): Move up and rewrite doc-string.
19959 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19960 (Fwindow_prev): New functions.
727e958e
MR
19961 (Fwindow_frame): Move here from frame.c. Accept any window as
19962 argument.
19963 (Fframe_root_window, Fframe_first_window)
19964 (Fframe_selected_window): Move here from frame.c. Accept frame
19965 or arbitrary window as argument. Update doc-strings.
19966 (Fminibuffer_window): Move up in code.
19967 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
19968 (Fset_frame_selected_window): Move here from frame.c.
19969 Marginal rewrite.
727e958e
MR
19970 (Fselected_window, select_window, Fselect_window): Move up in
19971 code. Minor doc-string fixes.
f230ecc9 19972
4d09bcf6
PE
199732011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19974
19975 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19976 Do not assume that spare memory exists; that assumption is valid
19977 only if SYSTEM_MALLOC.
19978 (LARGE_REQUEST): New macro, so that the issue of large requests
19979 is separated from the issue of spare memory.
19980
810928a2
AS
199812011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19982
172418ad
AS
19983 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19984 format. (Bug#8806)
19985
43f862f7
AS
19986 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19987
810928a2
AS
19988 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19989 before statements.
19990
a059fe24
JD
199912011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19992
19993 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19994
19995 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19996
19997 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19998 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19999
989bf368
JB
200002011-06-05 Juanma Barranquero <lekktu@gmail.com>
20001
20002 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20003
4b80f674
CY
200042011-06-04 Chong Yidong <cyd@stupidchicken.com>
20005
20006 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20007 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
20008 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20009 New error handlers.
4b80f674
CY
20010 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20011 Obey Vx_select_enable_clipboard_manager. Catch errors in
20012 x_clipboard_manager_save (Bug#8779).
20013 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 20014 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 20015
99a33b77 200162011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
20017
20018 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20019
99a33b77 200202011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
20021
20022 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20023 in the current matrix if keep_current_p is non-zero.
20024
8264569d
EZ
200252011-06-04 Eli Zaretskii <eliz@gnu.org>
20026
20027 * bidi.c (bidi_level_of_next_char): Fix last change.
20028
57f97249
EZ
200292011-06-03 Eli Zaretskii <eliz@gnu.org>
20030
fec2107c 20031 Support bidi reordering of text covered by display properties.
57f97249 20032
fec2107c
EZ
20033 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20034 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20035 (bidi_cache_search, bidi_cache_iterator_state)
20036 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
20037 (bidi_level_of_next_char, bidi_move_to_visually_next):
20038 Support character positions inside a run of characters covered by a
fec2107c
EZ
20039 display string.
20040 (bidi_paragraph_init, bidi_resolve_explicit_1)
20041 (bidi_level_of_next_char): Call bidi_fetch_char and
20042 bidi_fetch_char_advance instead of FETCH_CHAR and
20043 FETCH_CHAR_ADVANCE.
20044 (bidi_init_it): Initialize new members.
20045 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20046 definitions.
20047 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20048 instead of using explicit *_CHAR codes.
d6d100dd
SM
20049 (bidi_resolve_explicit, bidi_resolve_weak):
20050 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
20051 bidirectional text is supported only in multibyte buffers.
20052 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20053 it to initialize the frame_window_p member of struct bidi_it.
20054 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20055 (bidi_resolve_explicit, bidi_resolve_weak)
20056 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20057 bidi_it->nchars is non-positive.
20058 (bidi_level_of_next_char): Don't try to lookup the cache for the
20059 next/previous character if nothing is cached there yet, or if we
20060 were just reseat()'ed to a new position.
c40e2fb2 20061
0e14fe90
EZ
20062 * xdisp.c (set_cursor_from_row): Set start and stop points
20063 according to the row's direction when priming the loop that looks
20064 for the glyph on which to display cursor.
20065 (single_display_spec_intangible_p): Function deleted.
20066 (display_prop_intangible_p): Reimplement to call
20067 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
20068 Accept 3 additional arguments needed by handle_display_spec.
20069 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
20070 values: lists, `(when COND...)' forms, etc.
20071 (single_display_spec_string_p): Support property values that are
20072 lists with the argument STRING its top-level element.
20073 (display_prop_string_p): Fix the condition for processing a
20074 property that is a list to be consistent with handle_display_spec.
fec2107c 20075 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
20076 last portion of handle_display_prop.
20077 (compute_display_string_pos): Accept additional argument
20078 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20079 value of a `display' property is a "replacing spec".
20080 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20081 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20082 the display property, but just return a value indicating whether
20083 the display property will replace the characters it covers.
20084 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20085 frame_window_p members of struct bidi_it.
d6d100dd
SM
20086 (compute_display_string_pos, compute_display_string_end):
20087 New functions.
fec2107c
EZ
20088 (push_it): Accept second argument POSITION, where pop_it should
20089 jump to continue iteration.
20090 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 20091
fec2107c
EZ
20092 * keyboard.c (adjust_point_for_property): Adjust the call to
20093 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
20094
20095 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
20096 (bidi_init_it): Update prototypes.
20097 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
20098 (compute_display_string_pos, compute_display_string_end):
20099 Declare prototypes.
fec2107c
EZ
20100 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20101 EMACS_INT.
fc6f18ce 20102
40087514 201032011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 20104
57f53182
PE
20105 Malloc failure behavior now depends on size of allocation.
20106 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20107 * lisp.h: Change signatures accordingly.
20108 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20109 All callers changed. (Bug#8762)
20110
20111 * gnutls.c: Use Emacs's memory allocators.
20112 Without this change, the gnutls library would invoke malloc etc.
20113 directly, which causes problems on non-SYNC_INPUT hosts, and which
20114 runs afoul of improving memory_full behavior. (Bug#8761)
20115 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20116 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20117 xfree instead of the default malloc, realloc, free.
20118 (Fgnutls_boot): No need to check for memory allocation failure,
20119 since xmalloc does that for us.
20120
ac32cd99 20121 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
20122 * category.c (hash_get_category_set):
20123 * ccl.c (ccl_driver):
20124 * charset.c (Fdefine_charset_internal):
20125 * charset.h (struct charset.hash_index):
20126 * composite.c (get_composition_id, gstring_lookup_cache)
20127 (composition_gstring_put_cache):
20128 * composite.h (struct composition.hash_index):
20129 * dispextern.h (struct image.hash):
20130 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20131 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20132 (hashfn_equal, hashfn_user_defined, make_hash_table)
20133 (maybe_resize_hash_table, hash_lookup, hash_put)
20134 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20135 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20136 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20137 * image.c (make_image, search_image_cache, lookup_image)
20138 (xpm_put_color_table_h):
20139 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 20140 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 20141 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 20142 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
20143 * alloc.c (allocate_vectorlike):
20144 Check for overflow in vector size calculations.
20145 * ccl.c (ccl_driver):
20146 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
20147 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20148 need to be updated by these changes.
40087514
PE
20149 * fns.c (make_hash_table, maybe_resize_hash_table):
20150 Check for integer overflow with large hash tables.
0de4bb68
PE
20151 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20152 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20153 (SXHASH_REDUCE): New macro.
20154 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20155 Use it instead of discarding useful hash info with large hash values.
20156 (sxhash_float): New function.
20157 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20158 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
20159 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20160 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
20161 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20162 Adjust signatures to match updated version of code.
20163 (consing_since_gc): Now EMACS_INT, since a single hash table can
20164 use more than INT_MAX bytes.
20165
698d32e2
DN
201662011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20167
20168 Make it possible to build with GCC-4.6+ -O2 -flto.
20169
20170 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20171
fd6fa53f
SM
201722011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20173
20174 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20175 Call minibuffer-inactive-mode.
20176
864db017
JB
201772011-05-31 Juanma Barranquero <lekktu@gmail.com>
20178
20179 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20180 Update dependencies.
20181
2ad0baf4
DN
201822011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20183
20184 * data.c (init_data): Remove code for UTS, this system is not
20185 supported anymore.
20186
4fcc2638
DN
201872011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20188
20189 Don't force ./temacs to start in terminal mode.
20190
20191 * frame.c (make_initial_frame): Initialize faces in all cases, not
20192 only when CANNOT_DUMP is defined.
20193 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20194
c56e0fd5
DN
201952011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20196
20197 * dispnew.c (add_window_display_history): Use const for the string
20198 pointer. Remove declaration, not needed.
20199
333d54da 202002011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 20201
55d4c1b2 20202 Use 'inline', not 'INLINE'.
333d54da 20203 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
20204 * alloc.c, fontset.c (INLINE): Remove.
20205 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20206 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20207 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20208 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20209 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20210
738db178
DN
202112011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20212
20213 Make it possible to run ./temacs.
20214
20215 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20216 syms_of_callproc does the same thing. Remove test for
20217 "initialized", do it in the caller.
20218 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20219
620c53a6
SM
202202011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20221
20222 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20223 (read_minibuf): Use get_minibuffer.
20224 (syms_of_minibuf): Use DEFSYM.
20225 (Qmetadata): New var.
20226 * data.c (Qbuffer): Don't make it static.
20227 (syms_of_data): Use DEFSYM.
20228
e003a292
PE
202292011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20230
20231 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20232 (CCL_CODE_MIN): New macro.
20233
ed008a6d
PE
202342011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20235
3687c2ef
PE
20236 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20237
ed008a6d
PE
20238 * eval.c (Qdebug): Now static.
20239 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20240 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20241 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20242
d66c4c7c
CY
202432011-05-29 Chong Yidong <cyd@stupidchicken.com>
20244
20245 * image.c: Various fixes to ImageMagick code comments.
20246 (Fimagemagick_types): Doc fix.
20247
5fbc2025
PE
202482011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20249
0196f88a
PE
20250 Minor fixes prompted by GCC 4.6.0 warnings.
20251
20252 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20253
5fbc2025
PE
20254 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20255 (x_clipboard_manager_save_all): Move extern decl to ...
20256 * xterm.h: ... here, so that it can be checked for consistency.
20257
1dd3c2d9
CY
202582011-05-29 Chong Yidong <cyd@stupidchicken.com>
20259
20260 * xselect.c (x_clipboard_manager_save_frame)
20261 (x_clipboard_manager_save_all): New functions.
20262 (Fx_clipboard_manager_save): Lisp function deleted.
20263
20264 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20265 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20266
20267 * xterm.h: Update prototype.
20268
5ba6571d
WX
202692011-05-28 William Xu <william.xwl@gmail.com>
20270
20271 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20272 exiting (Bug#8239).
20273
3eaff834
JM
202742011-05-28 Jim Meyering <meyering@redhat.com>
20275
e1900994 20276 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
20277 * fns.c (to_uchar): Define.
20278 (crypto_hash_function): Use it to convert some newly-signed
20279 variables to unsigned, to avoid sign-extension bugs. For example,
20280 without this change, (md5 "truc") would evaluate to
20281 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20282 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 20283 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 20284
0f6990a7
PE
202852011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20286
20287 Integer overflow fixes.
c8a9ca5a 20288
08686060
PE
20289 * dbusbind.c: Serial number integer overflow fixes.
20290 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
20291 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20292 to hold a serial number that is too large for a fixnum.
20293 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20294 Check for serial numbers out of range. Decode any serial number
59568bf0 20295 that was so large that it became a float. (Bug#8722)
08686060 20296
2d1fc3c7
PE
20297 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20298 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20299 Use XFASTINT rather than XUINT when numbers are nonnegative.
20300 (xd_append_arg, Fdbus_method_return_internal):
20301 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20302 arguments, check that Lisp number is nonnegative, rather than
59568bf0 20303 silently wrapping negative numbers around. (Bug#8722)
30217ff0 20304 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 20305 (Bug#8722)
2d1fc3c7 20306
c8a9ca5a
PE
20307 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20308
519e1d69
PE
20309 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20310
6df6ae42 20311 ccl: Add integer overflow checks.
30569699
PE
20312 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20313 (IN_INT_RANGE): New macros.
20314 (ccl_driver): Use them to check for integer overflow when
20315 decoding a CCL program. Many of the new checks are whether XINT (x)
20316 fits in int; it doesn't always, on 64-bit hosts. The new version
20317 doesn't catch all possible integer overflows, but it's an
847044ea 20318 improvement. (Bug#8719)
30569699 20319
c11285dc
PE
20320 * alloc.c (make_event_array): Use XINT, not XUINT.
20321 There's no need for unsigned here.
20322
fdccd48e
PE
20323 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20324 This follows up to the 2011-05-06 change that substituted uintptr_t
20325 for EMACS_INT. This case wasn't caught back then.
20326
37910ab2
PE
20327 Rework Fformat to avoid integer overflow issues.
20328 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20329 now (part of C89). Include <verify.h>.
20330 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20331 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20332 (Fformat): Avoid the prepass trying to compute sizes; it was only
20333 approximate and thus did not catch overflow reliably. Instead, walk
20334 through the format just once, formatting and computing sizes as we go,
20335 checking for integer overflow at every step, and allocating a larger
20336 buffer as needed. Keep track separately whether the format is
20337 multibyte. Keep only the most-recently calculated precision, rather
20338 than them all. Record whether each argument has been converted to
20339 string. Use EMACS_INT, not int, for byte and char and arg counts.
20340 Support field widths and precisions larger than INT_MAX. Avoid
20341 sprintf's undefined behavior with conversion specifications such as %#d
20342 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20343 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20344 formatting out-of-range floating point numbers with int
9173deec 20345 formats. (Bug#8668)
37910ab2 20346
2e6578fb
PE
20347 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20348
0ae6bdee
PE
20349 * data.c: Avoid integer truncation in expressions involving floats.
20350 * data.c: Include <intprops.h>.
20351 (arith_driver): When there's an integer overflow in an expression
20352 involving floating point, convert the integers to floating point
20353 so that the resulting value does not suffer from catastrophic
20354 integer truncation. For example, on a 64-bit host (* 4
20355 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20356 Do not rely on undefined behavior after integer overflow.
20357
de883a70
PE
20358 merge count_size_as_multibyte, parse_str_to_multibyte
20359 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 20360 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
20361 Check for integer overflow.
20362 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20363 since it's now a duplicate of the other. This is more of
20364 a character than a buffer op, so better that it's in character.c.
20365 * fns.c, print.c: Adjust to above changes.
20366
2ff916cb
PE
203672011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20368
20369 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20370
f1b54466
PE
203712011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20372
fb1ac845
PE
20373 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20374 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20375 (x_clipboard_manager_save): Now static.
20376 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20377
f1b54466
PE
20378 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20379 (crypto_hash_function): Now static.
20380 Fix pointer signedness problems. Avoid unnecessary initializations.
20381
a9f737ee
CY
203822011-05-27 Chong Yidong <cyd@stupidchicken.com>
20383
20384 * termhooks.h (Vselection_alist): Make it terminal-local.
20385
20386 * terminal.c (create_terminal): Initialize it.
20387
20388 * xselect.c: Support for clipboard managers.
20389 (Vselection_alist): Move to termhooks.h as terminal-local var.
20390 (LOCAL_SELECTION): New macro.
20391 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20392 (symbol_to_x_atom): Remove gratuitous arg.
20393 (x_handle_selection_request, lisp_data_to_selection_data)
20394 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
20395 (x_own_selection, x_get_local_selection, x_convert_selection):
20396 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
20397 (some_frame_on_display): Delete unused function.
20398 (Fx_own_selection_internal, Fx_get_selection_internal)
20399 (Fx_disown_selection_internal, Fx_selection_owner_p)
20400 (Fx_selection_exists_p): New optional frame arg.
20401 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20402 (x_handle_selection_clear): Don't treat other terminals with the
20403 same keyboard specially. Use the terminal-local Vselection_alist.
20404 (x_clear_frame_selections): Use Frun_hook_with_args.
20405
20406 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20407
20408 * xterm.h: Add support for those atoms.
20409
e067f0c1
CY
204102011-05-26 Chong Yidong <cyd@stupidchicken.com>
20411
20412 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20413 (converted_selections, conversion_fail_tag): New global variables.
20414 (x_selection_request_lisp_error): Free the above.
20415 (x_get_local_selection): Remove unnecessary code.
20416 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
20417 of converted selections stored in converted_selections.
20418 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
20419 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20420 (x_convert_selection): New function.
20421 (x_handle_selection_event): Simplify.
20422 (x_get_foreign_selection): Don't ignore incoming requests while
20423 waiting for an answer; this will fail when we implement
20424 SAVE_TARGETS, and seems unnecessary anyway.
20425 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20426 (Vx_sent_selection_functions): Doc fix.
20427
0f4aebc0
LL
204282011-05-26 Leo Liu <sdl.web@gmail.com>
20429
20430 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20431
e61124cd
YM
204322011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20433
20434 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20435
20436 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20437 for fringe update if it has periodic bitmap.
ac389d0c 20438 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
20439 and fringe_bitmap_periodic_p.
20440
20441 * fringe.c (get_fringe_bitmap_data): New function.
20442 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20443 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20444 row. Mark glyph row for fringe update if periodicity changed.
20445
20446 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20447 for fringe update unless it has periodic bitmap.
20448
f16d9837
KH
204492011-05-25 Kenichi Handa <handa@m17n.org>
20450
20451 * xdisp.c (get_next_display_element): Set correct it->face_id for
20452 a static composition.
20453
e1b90ef6
LL
204542011-05-24 Leo Liu <sdl.web@gmail.com>
20455
20456 * deps.mk (fns.o):
20457 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20458
20459 * fns.c (crypto_hash_function, Fsha1): New function.
20460 (Fmd5): Use crypto_hash_function.
20461 (syms_of_fns): Add Ssha1.
20462
7400048f
PE
204632011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20464
20465 * gnutls.c: Remove unused macros.
20466 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20467 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20468 Remove macros that are defined and never used.
20469 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20470
abb71cf4
CY
204712011-05-22 Chong Yidong <cyd@stupidchicken.com>
20472
20473 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20474 (Fx_get_selection_internal): Minor cleanup.
20475 (Fx_own_selection_internal): Rename arguments for consistency with
20476 select.el.
20477
6307db39
PE
204782011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20479
20480 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20481
f3d4e0a4
CY
204822011-05-22 Chong Yidong <cyd@stupidchicken.com>
20483
20484 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20485
4d8ade89
YM
204862011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20487
20488 * dispnew.c (scrolling_window): Don't exclude the case that the
20489 last enabled row in the desired matrix touches the bottom boundary.
20490
32078c8d
GM
204912011-05-21 Glenn Morris <rgm@gnu.org>
20492
20493 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
20494 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20495 and add some more files.
32078c8d 20496
7285dc67
EZ
204972011-05-20 Eli Zaretskii <eliz@gnu.org>
20498
20499 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20500 report_file_error introduced by the change from 2011-05-07.
20501
89d1bd22
PE
205022011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20503
20504 * systime.h (Time): Define only if emacs is defined.
20505 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20506 where the include path doesn't have X11/X.h by default. See
20507 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20508
cd394be1 205092011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
20510
20511 * composite.c (find_automatic_composition): Fix previous change.
20512
b9704ad9
GM
205132011-05-20 Glenn Morris <rgm@gnu.org>
20514
20515 * lisp.mk: New file, split from Makefile.in.
20516 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20517 (shortlisp): Remove.
20518 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20519
4a720484
GM
205202011-05-19 Glenn Morris <rgm@gnu.org>
20521
20522 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20523 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20524 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20525 (lisp): Set the order to that of loadup.el.
20526 (shortlisp): Make it a copy of $lisp.
20527 (SOME_MACHINE_LISP): Remove.
20528 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20529 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20530
a28d4396
KH
205312011-05-18 Kenichi Handa <handa@m17n.org>
20532
20533 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20534 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20535 (find_automatic_composition): Mostly rewrite for efficiency.
20536
a2b1fa8e
JB
205372011-05-18 Juanma Barranquero <lekktu@gmail.com>
20538
20539 * makefile.w32-in: Update dependencies.
20540
8e1f5610
CS
205412011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20542
20543 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 20544 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 20545
7025ee00 205462011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 20547
cdfa6eab
PE
20548 Fix some integer overflow issues, such as string length overflow.
20549
06d6db33
PE
20550 * insdel.c (count_size_as_multibyte): Check for string overflow.
20551
2b4560a8
PE
20552 * character.c (lisp_string_width): Check for string overflow.
20553 Use EMACS_INT, not int, for string indexes and lengths; in
20554 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20555 the resulting string length overflows an EMACS_INT; instead,
20556 report a string overflow if no precision given. When checking for
20557 precision exhaustion, use a check that cannot possibly have
20558 integer overflow. (Bug#8675)
20559 * character.h (lisp_string_width): Adjust to new signature.
20560
cb93f9be
PE
20561 * alloc.c (string_overflow): New function.
20562 (Fmake_string): Use it. This doesn't change behavior, but saves
20563 a few bytes and will simplify future changes.
20564 * character.c (string_escape_byte8): Likewise.
20565 * lisp.h (string_overflow): New decl.
20566
1a1f3366
PE
20567 Fixups, following up to the user-interface timestamp change.
20568 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20569 for UI timestamps, instead of unsigned long.
9fbd6841
PE
20570 * msdos.c (mouse_get_pos): Likewise.
20571 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
20572 * w32gui.h (Time): Define by including "systime.h" rather than by
20573 declaring it ourselves. (Bug#8664)
20574
d4e3e4d3
PE
20575 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20576 * image.c (clear_image_cache): Likewise.
20577
f6a24d19
PE
20578 * term.c (term_mouse_position): Don't assume time_t wraparound.
20579
08dc5ae6
PE
20580 Be more systematic about user-interface timestamps.
20581 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
20582 and sometimes 'EMACS_UINT', to represent these timestamps.
20583 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
20584 This makes the code easier to follow, and makes it easier to catch
20585 integer overflow bugs such as Bug#8664.
20586 * frame.c (Fmouse_position, Fmouse_pixel_position):
20587 Use Time, not unsigned long, for user-interface timestamps.
20588 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20589 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20590 * keyboard.h (last_event_timestamp): Likewise.
20591 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20592 * menu.h (xmenu_show): Likewise.
20593 * term.c (term_mouse_position): Likewise.
20594 * termhooks.h (struct input_event.timestamp): Likewise.
20595 (struct terminal.mouse_position_hook): Likewise.
20596 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20597 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20598 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20599 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20600 what it was before.
20601 * menu.h, termhooks.h: Include "systime.h", for Time.
20602
8e55734a
PE
20603 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20604 Don't assume that the difference between two unsigned long values
20605 can fit into an integer. At this point, we know button_down_time
20606 <= event->timestamp, so the difference must be nonnegative, so
20607 there's no need to cast the result if double-click-time is
20608 nonnegative, as it should be; check that it's nonnegative, just in
20609 case. This bug is triggered when events are more than 2**31 ms
86db42d2 20610 apart (about 25 days). (Bug#8664)
8e55734a 20611
841f1b75 20612 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 20613 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 20614
3e26f69c
PE
20615 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20616 that always fit in int. Use a sentinel instead of a counter, to
20617 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
20618 * frame.h (struct frame): Use int for menu_bar_items_used
20619 instead of EMACS_INT, since it always fits in int.
3e26f69c 20620
5cc152c0
PE
20621 * menu.c (grow_menu_items): Check for int overflow.
20622
d89eb65e
PE
20623 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20624
5235bd3e
PE
20625 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20626 Before, the code was not consistent. These values cannot exceed
20627 2**31 - 1 so there's no need to make them unsigned.
20628 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20629 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20630 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20631 as modifiers.
20632 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20633
bc827e23
PE
20634 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20635 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20636 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20637 presumably because the widths might not match.
20638
78eb494e
PE
20639 * window.c (size_window): Avoid needless test at loop start.
20640
04f2d78b
CB
206412011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20642
20643 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20644
d2fc7e3d 206452011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
20646
20647 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20648
d2fc7e3d 206492011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
20650
20651 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20652 `width' to `bar_area_x' and `bar_area_width', respectively.
20653 (x_scroll_run): Take account of fringe background extension.
20654
04f2d78b
CB
20655 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20656 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
20657 `bar_area_width', respectively.
20658 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20659 background extension.
20660
79b70037
GM
206612011-05-10 Jim Meyering <meyering@redhat.com>
20662
20663 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20664
2f142cc5
JB
206652011-05-10 Juanma Barranquero <lekktu@gmail.com>
20666
20667 * image.c (Finit_image_library): Return t for built-in image types,
20668 like pbm and xbm. (Bug#8640)
20669
57679c86
AS
206702011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20671
20672 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20673
888c9e86
EZ
206742011-05-07 Eli Zaretskii <eliz@gnu.org>
20675
b0512a1d
EZ
20676 * w32console.c (Fset_screen_color): Doc fix.
20677 (Fget_screen_color): New function.
20678 (syms_of_ntterm): Defsubr it.
20679
7285dc67
EZ
20680 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20681 unlink the temporary file if Fcall_process didn't create it in the
20682 first place.
20683 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20684 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
20685 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20686 cue to call_process_cleanup not to close that handle.
20687
4d3fcc8e
BK
206882011-05-07 Ben Key <bkey76@gmail.com>
20689
20690 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20691 one of two shell specific rules, either bootstrap-temacs-CMD or
20692 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20693 to the previous implementation of the bootstrap-temacs rule.
20694 The bootstrap-temacs-CMD rule is similar to the previous
20695 implementation of the bootstrap-temacs rule except that it
20696 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20697 variable.
20698
20699 These changes, along with some changes to nt/configure.bat,
20700 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20701 earlier fix to add support for --cflags and --ldflags options
20702 that include quotes so that it works whether make uses cmd or
20703 sh as the shell.
20704
b4289b64
MA
207052011-05-06 Michael Albinus <michael.albinus@gmx.de>
20706
20707 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20708 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20709 is a constant.
20710 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20711 a string. Handle both cases.
20712 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20713 (Fdbus_register_method): Use Qinvalid_function.
20714
af4c0e28
JB
207152011-05-06 Juanma Barranquero <lekktu@gmail.com>
20716
20717 * makefile.w32-in: Update dependencies.
20718 (LISP_H): Add inttypes.h and stdin.h.
20719 (PROCESS_H): Add unistd.h.
20720
c51453d9
EZ
207212011-05-06 Eli Zaretskii <eliz@gnu.org>
20722
20723 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20724 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20725
8ff0ac3c 207262011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 20727
4c4b566b
PE
20728 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20729
aab2b9b5
PE
20730 * term.c (vfatal): Remove stray call to va_end.
20731 It's not needed and the C Standard doesn't allow it here anyway.
20732
c378da0b
PE
20733 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20734 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20735
288b08c7
PE
20736 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20737 bytes.
20738
e3601888
PE
20739 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20740
db6c0e74
PE
20741 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20742
dd5963ea
PE
20743 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20744
88c9450f
PE
20745 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20746
2f9442b8
PE
20747 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20748
c032b5f8
PE
20749 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20750 * charset.c (Fdefine_charset_internal): Don't initialize
20751 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 20752 32-bit int (Bug#8600).
a108c10b
PE
20753
20754 * lread.c (read_integer): Be more consistent with string-to-number.
20755 Use string_to_number to do the actual conversion; this avoids
20756 rounding errors and fixes some other screwups. Without this fix,
20757 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20758 (digit_to_number): Move earlier, for benefit of read_integer.
20759 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 20760 not a digit in any supported base. (Bug#8602)
a108c10b 20761
ad5f9eea
PE
20762 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20763
aec1708a
PE
20764 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20765 to match comment at start of function. This also removes a
20766 GCC warning about overflow in a 32+64-bit port.
20767
47be4ab5
PE
20768 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20769
371cac43
PE
20770 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20771 Reported by Stefan Monnier in
20772 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
20773 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20774 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 20775
d01a7826
PE
20776 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20777 (EMACS_UINTPTR): Likewise, with uintptr_t.
20778
7fd47d5c
PE
20779 * lisp.h: Prefer 64-bit EMACS_INT if available.
20780 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20781 on 32-bit hosts that have 64-bit int, so that they can access
20782 large files.
122b0c86
PE
20783 However, temporarily disable this change unless the temporary
20784 symbol WIDE_EMACS_INT is defined.
7fd47d5c 20785
8727937b
PE
20786 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20787
8ac068ac
PE
20788 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20789 This removes an assumption that EMACS_INT and long are the same
20790 width as pointers. The assumption is true for Emacs porting targets
20791 now, but we want to make other targets possible.
20792 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20793 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20794 In the rest of the code, change types of integers that hold casted
20795 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20796 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20797 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20798 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20799 No need to cast type when ORing.
20800 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20801 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20802 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20803 assume EMACS_INT is the same width as char *.
20804 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20805 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20806 Remove no-longer-needed casts.
20807 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20808 (xg_tool_bar_help_callback, xg_make_tool_item):
20809 Use EMACS_INTPTR to hold an integer
20810 that will be cast to void *; this can avoid a GCC warning
20811 if EMACS_INT is not the same width as void *.
20812 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20813 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20814 (current_message_1, set_message_1):
20815 Use a local to convert to proper width without a cast.
20816 * xmenu.c (dialog_selection_callback): Likewise.
20817
ede49d71
PE
20818 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20819 Also, don't assume VALBITS / RAND_BITS is less than 5,
20820 and don't rely on undefined behavior when shifting a 1 left into
20821 the sign bit.
20822 * lisp.h (get_random): Change signature to match.
20823
2f30ecd0
PE
20824 * lread.c (hash_string): Use size_t, not int, for hash computation.
20825 Normally we prefer signed values; but hashing is special, because
20826 it's better to use unsigned division on hash table sizes so that
20827 the remainder is nonnegative. Also, size_t is the natural width
20828 for hashing into memory. The previous code used 'int', which doesn't
20829 retain enough info to hash well into very large tables.
20830 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20831
2a866e7b
PE
20832 * dbusbind.c: Don't possibly lose pointer info when converting.
20833 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20834 Use XPNTR rather than XHASH, so that the high-order bits of
20835 the pointer aren't lost when converting through void *.
20836
51639eac
PE
20837 * eval.c (Fautoload): Don't double-shift a pointer.
20838
92394119
PE
20839 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20840
dbdb9a7c
JB
208412011-05-06 Juanma Barranquero <lekktu@gmail.com>
20842
20843 * gnutls.c (DEF_GNUTLS_FN):
20844 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20845
db7a0b4f
AS
208462011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20847
20848 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20849 marker. (Bug#8610)
20850
cd394be1 208512011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
20852
20853 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20854 New version that can reserve upto 2GB of heap space.
20855
f7ff1b0f 208562011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
20857
20858 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20859
639c109b
TZ
208602011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20861
20862 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20863 `gnutls_certificate_set_x509_key_file'.
20864
d2127135
JB
208652011-05-05 Juanma Barranquero <lekktu@gmail.com>
20866
20867 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20868 Update dependencies.
20869
e968f4f3
JB
208702011-05-04 Juanma Barranquero <lekktu@gmail.com>
20871
20872 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20873 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20874 Remove unused parameter `fildes'.
20875 * process.c (read_process_output, send_process): Don't pass it.
20876
84d358f0
JB
208772011-05-04 Juanma Barranquero <lekktu@gmail.com>
20878
20879 Fix previous change: the library cache is defined in w32.c.
20880 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20881 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20882
0898ca10
JB
208832011-05-04 Juanma Barranquero <lekktu@gmail.com>
20884
20885 Implement dynamic loading of GnuTLS on Windows.
20886
20887 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20888 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20889 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20890 Declare.
20891
20892 * gnutls.c (Qgnutls_dll): Define.
20893 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20894 (gnutls_*): Declare function pointers.
20895 (init_gnutls_functions): New function to initialize function pointers.
20896 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20897 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20898 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20899 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20900 (emacs_gnutls_write, emacs_gnutls_read)
20901 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20902 (Fgnutls_available_p): New function.
20903 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20904 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20905 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20906
20907 * image.c: Include w32.h.
20908 (Vimage_type_cache): Delete.
20909 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20910 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20911 (w32_delayed_load): Move to w32.c.
20912
20913 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20914
20915 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20916 (w32_delayed_load): Move from image.c. When loading a library, record
20917 its filename in the :loaded-from property of the library id.
20918 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20919 Initialize and staticpro them.
20920 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20921
20922 * process.c: Include lisp.h before w32.h, not after.
20923 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20924 instead of gnutls_record_check_pending.
20925
20926 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20927
ff4de4aa
TZ
209282011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20929
20930 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20931 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20932 as passed in.
20933
abe95abb
JD
209342011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20935
20936 * xterm.c (x_set_frame_alpha): Do not set property on anything
20937 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20938
e16e55d4
JB
209392011-05-02 Juanma Barranquero <lekktu@gmail.com>
20940
20941 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20942
bafcf6a5
JB
209432011-05-02 Juanma Barranquero <lekktu@gmail.com>
20944
20945 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20946 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20947 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20948 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20949 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20950 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20951 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20952 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20953 (Qgnutls_bootprop_callbacks_verify): Make static.
20954
e7a6747f
AS
209552011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20956
19ed11ba
AS
20957 * callproc.c: Indentation fixup.
20958
e7a6747f 20959 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
20960 (wait_for_termination, interruptible_wait_for_termination):
20961 Move after wait_for_termination_1.
e7a6747f 20962
1ef14cb4
LMI
209632011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20964
20965 * sysdep.c (interruptible_wait_for_termination): New function
20966 which is like wait_for_termination, but allows keyboard
20967 interruptions.
20968
20969 * callproc.c (Fcall_process): Add (:file "file") as an option for
20970 the STDOUT buffer.
20971 (Fcall_process_region): Ditto.
20972
330d880c
EZ
209732011-04-30 Eli Zaretskii <eliz@gnu.org>
20974
8db90b73
EZ
20975 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20976 rather than `XVECTOR (FOO)->size'.
20977
330d880c
EZ
20978 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20979 inttypes.h, as a gnulib replacement is used if it not available in
20980 system headers.
20981
15cbd324
EZ
209822011-04-21 Eli Zaretskii <eliz@gnu.org>
20983
20984 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20985 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20986 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20987
20988 * coding.c (coding_alloc_by_realloc): Error out if destination
20989 will grow beyond MOST_POSITIVE_FIXNUM.
20990 (decode_coding_emacs_mule): Abort if there isn't enough place in
20991 charbuf for the composition carryover bytes. Reserve an extra
20992 space for up to 2 characters produced in a loop.
20993 (decode_coding_iso_2022): Abort if there isn't enough place in
20994 charbuf for the composition carryover bytes.
20995
209962011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 20997
ae940cca
EZ
20998 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20999 aborting when %lld or %lll format is passed.
21000 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21001 %llo or %llx format is passed. (Bug#8545)
21002
03ab8921
EZ
21003 * window.c (window_scroll_line_based): Use a marker instead of
21004 simple variables to record original value of point. (Bug#7952)
21005
afda1437
EZ
21006 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21007 produced by %s or %c overflows available buffer space. (Bug#8545)
21008
f76dee0c
PE
210092011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21010
21011 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 21012 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 21013
fdc5744d
JB
210142011-04-28 Juanma Barranquero <lekktu@gmail.com>
21015
21016 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21017
638f053a
JB
210182011-04-28 Juanma Barranquero <lekktu@gmail.com>
21019
21020 * keyboard.c (Qdelayed_warnings_hook): Define.
21021 (command_loop_1): Run `delayed-warnings-hook'
21022 if Vdelayed_warnings_list is non-nil.
21023 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21024 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21025
d178f871
EZ
210262011-04-28 Eli Zaretskii <eliz@gnu.org>
21027
21028 * doprnt.c (doprnt): Don't return value smaller than the buffer
21029 size if the message was truncated. (Bug#8545).
21030
b124fd93
JB
210312011-04-28 Juanma Barranquero <lekktu@gmail.com>
21032
21033 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21034 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21035
e810457d
PE
210362011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21037
21038 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21039
ea51cceb
JB
210402011-04-27 Juanma Barranquero <lekktu@gmail.com>
21041
21042 * makefile.w32-in: Update dependencies.
21043
94dcfacf
EZ
210442011-04-27 Eli Zaretskii <eliz@gnu.org>
21045
21046 Improve `doprnt' and its usage. (Bug#8545)
21047 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21048 `format_end'. Remove support for %l as a conversion specifier.
21049 Don't use xrealloc. Improve diagnostics when the %l size modifier
21050 is used. Update the commentary.
21051
21052 * eval.c (verror): Simplify calculation of size_t.
21053
21054 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21055 messages.
21056
f61f41d7
PE
210572011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21058
21059 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21060 change.
21061
96fb4434
PE
210622011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21063
21064 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21065 This makes this file independent of the recent pseudovector change.
21066
671875da 210672011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 21068
69e9b5a3
PE
21069 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21070
b5f869a7 21071 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 21072 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 21073 Remove unused local.
c8926152 21074 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 21075
841a1577 21076 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
21077 GCC 4.6.0 optimizes based on type-based alias analysis.
21078 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
21079 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21080 != &v->size, and therefore "v->size = 1; b->size = 2; return
21081 v->size;" must therefore return 1. This assumption is incorrect
21082 for Emacs, since it type-puns struct Lisp_Vector * with many other
21083 types. To fix this problem, this patch adds a new type struct
f904488f 21084 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
21085 and pseudovectors, and helps optimizing compilers not get fooled
21086 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21087 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
21088 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21089 the size member.
eab3844f
PE
21090 (XSETPVECTYPE): Rewrite in terms of new macro.
21091 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21092 This is a bit clearer, and further avoids the possibility of
21093 undesirable aliasing.
21094 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 21095 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
21096 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21097 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
21098 (ASIZE): Now uses header.size rather than size.
21099 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
21100 to avoid the hassle of writing XVECTOR (foo)->header.size.
21101 (struct vectorlike_header): New type.
eab3844f
PE
21102 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21103 object, to help avoid aliasing.
21104 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21105 (SUBRP): Likewise, since Lisp_Subr is a special case.
21106 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21107 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21108 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 21109 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
21110 changed to be "header.size" and "header.next".
21111 * buffer.h (struct buffer): Likewise.
21112 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21113 * frame.h (struct frame): Likewise.
21114 * process.h (struct Lisp_Process): Likewise.
21115 * termhooks.h (struct terminal): Likewise.
21116 * window.c (struct save_window_data, struct saved_window): Likewise.
21117 * window.h (struct window): Likewise.
21118 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21119 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21120 * buffer.c (init_buffer_once): Likewise.
21121 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21122 special case.
21123 * process.c (Fformat_network_address): Use local var for size,
21124 for brevity.
21125
0df1eac5
PE
21126 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21127
847ab9d1 21128 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
21129 * data.c (atof): Remove decl; no longer used or needed.
21130 (digit_to_number): Move to lread.c.
21131 (Fstring_to_number): Use new string_to_number function, to be
21132 consistent with how the Lisp reader treats infinities and NaNs.
21133 Do not assume that floating-point numbers represent EMACS_INT
21134 without losing information; this is not true on most 64-bit hosts.
21135 Avoid double-rounding errors, by insisting on integers when
21136 parsing non-base-10 numbers, as the documentation specifies.
21137 * lisp.h (string_to_number): New decl, replacing ...
21138 (isfloat_string): Remove.
bc0a5c13 21139 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 21140 (read1): Do not accept +. and -. as integers; this
452f4150
PE
21141 appears to have been a coding error. Similarly, do not accept
21142 strings like +-1e0 as floating point numbers. Do not report
21143 overflow for integer overflows unless the base is not 10 which
21144 means we have no simple and reliable way to continue.
21145 Break out the floating-point parsing into a new
21146 function string_to_number, so that Fstring_to_number parses
21147 floating point numbers consistently with the Lisp reader.
04f2d78b 21148 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
21149 (E_CHAR, EXP_INT): Remove, replacing with ...
21150 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21151 (string_to_number): New function, replacing isfloat_string.
21152 This function checks for valid syntax and produces the resulting
21153 Lisp float number too. Rework it so that string-to-number
bc0a5c13 21154 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
21155 so that overflow for non-base-10 numbers is reported only when
21156 there's no portable and simple way to convert to floating point.
452f4150 21157
67769ffc
PE
21158 * textprop.c (set_text_properties_1): Rewrite for clarity,
21159 and to avoid GCC warning about integer overflow.
21160
c20db43f
PE
21161 * intervals.h (struct interval): Use EMACS_INT for members
21162 where EMACS_UINT might cause problems. See
21163 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21164 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21165 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21166 All uses changed.
37aa2f85
PE
21167 (offset_intervals): Tell GCC not to worry about length overflow
21168 when negating a negative length.
c20db43f 21169
2538aa2f
PE
21170 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21171 (overrun_check_free): Likewise.
21172
f2d3008d
PE
21173 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21174 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21175 word size.
21176
ec8df744
PE
21177 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21178 (gnutls_make_error): Rename local to avoid shadowing.
21179 (gnutls_emacs_global_deinit): ifdef out; not used.
21180 (Fgnutls_boot): Use const for pointer to readonly storage.
21181 Comment out unused local. Fix pointer signedness problems.
21182
640ee02d
PE
21183 * lread.c (openp): Don't stuff size_t into an 'int'.
21184 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21185 about possible signed overflow.
21186
6048fb2a
PE
21187 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21188 (GDK_KEY_g): Don't define if already defined.
21189 (xg_prepare_tooltip): Avoid pointer signedness problem.
21190 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21191
fa3c87e1
PE
21192 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21193 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21194
2172544b
PE
21195 * xfns.c (Fx_window_property): Simplify a bit,
21196 to make a bit faster and to avoid GCC 4.6.0 warning.
21197 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21198
9b821a21
PE
21199 * fns.c (internal_equal): Don't assume size_t fits in int.
21200
3c616cfa
PE
21201 * alloc.c (compact_small_strings): Tighten assertion a little.
21202
c2982e87
PE
21203 Replace pEd with more-general pI, and fix some printf arg casts.
21204 * lisp.h (pI): New macro, generalizing old pEd macro to other
21205 conversion specifiers. For example, use "...%"pI"d..." rather
21206 than "...%"pEd"...".
21207 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 21208 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
21209 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21210 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21211 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21212 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21213 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21214 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21215 64-bit hosts.
21216 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21217 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21218 * print.c (safe_debug_print, print_object): Likewise.
21219 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21220 to int.
6f04d126
PE
21221 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21222 avoiding the 0 flag, which is not portable.
c2982e87
PE
21223 * process.c (Fmake_network_process): Use pI to avoid cast.
21224 * region-cache.c (pp_cache): Likewise.
21225 * xdisp.c (decode_mode_spec): Likewise.
21226 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21227 behavior on 64-bit hosts with printf arg.
6f04d126 21228 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
21229 (x_stop_queuing_selection_requests): Likewise.
21230 (x_get_window_property): Don't truncate byte count to an 'int'
21231 when tracing.
0b432f21 21232
5e073ec7
PE
21233 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21234 here, since it parses constructs like leading '-' and spaces,
21235 which are not wanted; and it overflows with large numbers.
21236 Instead, simply match F[0-9]+, which is what is wanted anyway.
21237
36372bf9
PE
21238 * alloc.c: Remove unportable assumptions about struct layout.
21239 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21240 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21241 (allocate_vectorlike, make_pure_vector): Use the new macros,
21242 plus offsetof, to remove unportable assumptions about struct layout.
21243 These assumptions hold on all porting targets that I know of, but
21244 they are not guaranteed, they're easy to remove, and removing them
21245 makes further changes easier.
21246
0b432f21
PE
21247 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21248 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
21249 (string_overrun_cookie): Now const. Use initializers that
21250 don't formally overflow signed char, to avoid warnings.
000098c1
PE
21251 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21252 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
21253 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21254 multiple of sizeof (EMACS_INT); it need not be, if
21255 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 21256 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 21257
895009e1
JB
212582011-04-26 Juanma Barranquero <lekktu@gmail.com>
21259
21260 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21261
6a7a1b0b
TZ
212622011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21263
21264 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 21265 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
21266 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21267
841a1577 212682011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
21269
21270 * lisp.h (Qdebug): List symbol.
895009e1 21271 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
21272 * keyboard.c (debug-on-event): New variable.
21273 (handle_user_signal): Break into debugger when debug-on-event
21274 matches the current signal symbol.
21275
f2d3ba6f
DN
212762011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21277
21278 * alloc.c (check_sblock, check_string_bytes)
21279 (check_string_free_list): Convert to standard C.
21280
42ce4c63
TZ
212812011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21282
21283 * w32.c (emacs_gnutls_push): Fix typo.
21284
825cd63c
EZ
212852011-04-25 Eli Zaretskii <eliz@gnu.org>
21286
fb11d64d
EZ
21287 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21288 "cast to pointer from integer of different size".
21289
825cd63c
EZ
21290 Improve doprnt and its use in verror. (Bug#8545)
21291 * doprnt.c (doprnt): Document the set of format control sequences
21292 supported by the function. Use SAFE_ALLOCA instead of always
21293 using `alloca'.
21294
21295 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21296 is one byte too soon. Don't use xrealloc; instead xfree and
21297 xmalloc anew.
21298
e061a11b
TZ
212992011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21300
21301 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21302 callbacks stage.
21303
21304 * gnutls.c: Renamed global_initialized to
21305 gnutls_global_initialized. Added internals for the
21306 :verify-hostname-error, :verify-error, and :verify-flags
21307 parameters of `gnutls-boot' and documented those parameters in the
21308 docstring. Start callback support.
9173deec
JB
21309 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21310 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21311 on error. Return error code.
e061a11b
TZ
21312 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21313 (emacs_gnutls_read): Likewise.
21314 (Fgnutls_boot): Return handshake error code.
21315 (emacs_gnutls_handle_error): New function.
21316 (wsaerror_to_errno): Likewise.
21317
21318 * w32.h (emacs_gnutls_pull): Add prototype.
21319 (emacs_gnutls_push): Likewise.
21320
21321 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21322 (emacs_gnutls_push): Likewise.
21323
213242011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21325
21326 * process.c (wait_reading_process_output): Check if GnuTLS
21327 buffered some data internally if no FDs are set for TLS
21328 connections.
21329
21330 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21331 (LIBS): Link to USER_LIBS.
21332 ($(BLD)/gnutls.$(0)): New target.
21333
fa6996bc
EZ
213342011-04-24 Eli Zaretskii <eliz@gnu.org>
21335
eb35682e
EZ
21336 * xdisp.c (handle_single_display_spec): Rename the
21337 display_replaced_before_p argument into display_replaced_p, to
21338 make it consistent with the commentary. Fix typos in the
21339 commentary.
21340
e2ad650c
EZ
21341 * textprop.c (syms_of_textprop): Remove dead code.
21342 (copy_text_properties): Delete obsolete commentary about an
21343 interface that was deleted long ago. Fix typos in the description
21344 of arguments.
21345
1b2de274
EZ
21346 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21347 to changes in oldXMenu/XMenu.h from 2011-04-16.
21348 <menu_help_message, prev_menu_help_message>: Constify.
21349 (IT_menu_make_room): menu->help_text is now `const char **';
21350 adjust.
21351
21352 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21353 to changes in oldXMenu/XMenu.h from 2011-04-16.
21354 (struct XMenu): Declare `help_text' `const char **'.
21355
21356 * xfaces.c <Qunspecified>: Make extern again.
21357
21358 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 21359 required by POSIX.
1b2de274 21360
762b15be
EZ
21361 * doc.c (get_doc_string): Improve the format passed to `error'.
21362
21363 * doprnt.c (doprnt): Improve commentary.
21364
21365 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21366
21367 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21368 them with etags.
21369
f1052e5d
EZ
21370 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21371 changes in globals.h immediately force recompilation.
762b15be
EZ
21372 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21373 $(CURDIR)/s/ms-w32.h.
21374 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 21375
fa6996bc
EZ
21376 * character.c (Fchar_direction): Function deleted.
21377 (syms_of_character): Don't defsubr it.
21378 <char-direction-table>: Deleted.
21379
e6c3da20
EZ
213802011-04-23 Eli Zaretskii <eliz@gnu.org>
21381
21382 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21383 * doprnt.c: Include limits.h.
21384 (SIZE_MAX): New macro.
04f2d78b
CB
21385 (doprnt): Return a size_t value. 2nd arg is now size_t.
21386 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
21387 Improve overflow protection. Support `l' modifier for integer
21388 conversions. Support %l conversion. Don't assume an EMACS_INT
21389 argument for integer conversions and for %c.
21390
21391 * lisp.h (doprnt): Restore prototype.
21392
21393 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21394 $(SRC)/character.h.
21395
21396 * Makefile.in (base_obj): Add back doprnt.o.
21397
21398 * deps.mk (doprnt.o): Add back prerequisites.
21399 (callint.o): Depend on character.h.
21400
21401 * eval.c (internal_lisp_condition_case): Include the handler
21402 representation in the error message.
21403 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21404 when breaking from the loop.
21405
21406 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21407
21408 * callint.c (Fcall_interactively): When displaying error message
21409 about invalid control letter, pass the character's codepoint, not
21410 a pointer to its multibyte form. Improve display of the character
21411 in octal and display also its hex code.
21412
21413 * character.c (char_string): Use %x to display the (unsigned)
21414 codepoint of an invalid character, to avoid displaying a bogus
21415 negative value.
21416
21417 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21418 `error', not SYMBOL_NAME itself.
21419
21420 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21421 character arguments to `error'.
21422
21423 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21424 to `error' in error message about FINAL_CHAR argument. Make sure
21425 FINAL_CHAR is a character, and use %c when it is passed as
21426 argument to `error'.
21427
4ffd0d6b 214282011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
21429
21430 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21431
21432 * w32.c: Include <time.h>.
21433 (sys_localtime): New function.
21434
4ffd0d6b 214352011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
21436
21437 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21438
4ffd0d6b 21439 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 21440
4ffd0d6b 214412011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 21442
4ffd0d6b
GM
21443 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21444 zombies (Bug#8467).
aac0c6e3 21445
04c56954
EZ
214462011-04-19 Eli Zaretskii <eliz@gnu.org>
21447
21448 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21449 gl_state.e_property when gl_state.object is Qt.
21450
21451 * insdel.c (make_gap_larger): Remove limitation of buffer size
21452 to <= INT_MAX.
21453
16a43933
CY
214542011-04-18 Chong Yidong <cyd@stupidchicken.com>
21455
21456 * xdisp.c (lookup_glyphless_char_display)
21457 (produce_glyphless_glyph): Handle cons cell entry in
21458 glyphless-char-display.
21459 (Vglyphless_char_display): Document it.
21460
21461 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21462 glyphless-char-display.
21463
4581706e
CY
214642011-04-17 Chong Yidong <cyd@stupidchicken.com>
21465
21466 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21467
21468 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21469
21470 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21471 definition for no-X builds.
21472
4887c6e2 214732011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 21474
fd35b6f9
PE
21475 Static checks with GCC 4.6.0 and non-default toolkits.
21476
5c1ccb01
PE
21477 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21478
006c5daa
PE
21479 * process.c (keyboard_bit_set): Define only if SIGIO.
21480 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21481 (send_process): Repair possible setjmp clobbering.
21482
efc736d3
PE
21483 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21484
4e2fe2e6
PE
21485 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21486
f97334a2
PE
21487 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21488
4e75f29d
PE
21489 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21490 Define only if needed.
21491
90efadd1
PE
21492 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21493 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 21494 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 21495
3c647824
PE
21496 * dispextern.h (struct redisplay_interface): Rename param
21497 to avoid shadowing.
e264f262 21498 * termhooks.h (struct terminal): Likewise.
761383f4 21499 * xterm.c (xembed_send_message): Likewise.
3c647824 21500
b58c5c4a
PE
21501 * insdel.c (make_gap_smaller): Define only if
21502 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21503
cad59032
PE
21504 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21505 it.
21506
c339dc2e
PE
21507 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21508 so that we aren't warned about unused symbols.
21509
91a3e27b
PE
21510 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21511
399c71d3 21512 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 21513
8ffc96f5
PE
21514 * xfns.c (x_real_positions): Mark locals as initialized.
21515
eef9bc79
PE
21516 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21517
098db9dd
PE
21518 * xterm.c: Fix problems found by static analysis with other toolkits.
21519 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
21520 (x_dispatch_event): Declare static if USE_GTK, and
21521 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 21522 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 21523 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
21524 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21525 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 21526
eb18f6cc
PE
21527 * xmenu.c (menu_help_callback): Pointer type fixes.
21528 Use const pointers when pointing at readonly data. Avoid pointer
21529 signedness clashes.
21530 (FALSE): Remove unused macro.
21531 (update_frame_menubar): Remove unused decl.
21532
1fe72bf8
PE
21533 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21534
60d9e1db
PE
21535 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21536 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21537 (single_menu_item): Rename local to avoid shadowing.
21538
39261c26
PE
21539 * keyboard.c (make_lispy_event): Remove unused local var.
21540
018c5e19
PE
21541 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21542 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21543
63d2b86e
PE
21544 * bitmaps: Change bitmaps from unsigned char back to the X11
21545 compatible char. Avoid the old compiler warnings about
21546 out-of-range initializers by using, for example, '\xab' rather
21547 than 0xab.
21548
aefd87e1
PE
21549 * xgselect.c (xgselect_initialize): Check vs interface
21550 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21551
bf501fb9
PE
21552 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21553
e9829fdf
PE
21554 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21555 to read-only memory.
21556
1086c095
PE
21557 * fns.c (vector): Remove; this old hack is no longer needed.
21558
2baccd04 21559 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 21560 Remove unused var.
dde42981 21561 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 21562
72391843 21563 * xrdb.c (x_load_resources): Omit unused local.
3565b346 21564
436c16df 21565 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 21566 (x_window): Rename locals to avoid shadowing.
dc5ddd85 21567 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 21568
92bb796d 21569 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 21570 (x_term_init): Remove local to avoid shadowing.
92bb796d 21571
764430a3 21572 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
21573
21574 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21575 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21576
d1dfb56c
EZ
215772011-04-16 Eli Zaretskii <eliz@gnu.org>
21578
c4354cb4
EZ
21579 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21580
d1dfb56c
EZ
21581 Fix regex.c, syntax.c and friends for buffers > 2GB.
21582 * syntax.h (struct gl_state_s): Declare character position members
21583 EMACS_INT.
21584
21585 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21586
04f2d78b
CB
21587 * textprop.c (verify_interval_modification, interval_of):
21588 Declare arguments EMACS_INT.
d1dfb56c
EZ
21589
21590 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21591 EMACS_INT.
21592
21593 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21594
21595 * indent.c (Fvertical_motion): Local variable it_start is now
21596 EMACS_INT.
21597
21598 * regex.c (re_match, re_match_2, re_match_2_internal)
21599 (bcmp_translate, regcomp, regexec, print_double_string)
21600 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21601 (re_compile_pattern, re_exec): Declare arguments and local
21602 variables `size_t' and `ssize_t' and return values `regoff_t', as
21603 appropriate.
21604 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21605 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21606 <compile_stack_type>: `size' and `avail' are now `size_t'.
21607
21608 * regex.h <regoff_t>: Use ssize_t, not int.
21609 (re_search, re_search_2, re_match, re_match_2): Arguments that
21610 specify buffer/string position and length are now ssize_t and
21611 size_t. Return type is regoff_t.
21612
613052cd
BK
216132011-04-16 Ben Key <bkey76@gmail.com>
21614
21615 * nsfont.m: Fixed bugs in ns_get_family and
21616 ns_descriptor_to_entity that were caused by using free to
21617 deallocate memory blocks that were allocated by xmalloc (via
21618 xstrdup). This caused Emacs to crash when compiled with
21619 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21620 --enable-checking=xmallocoverrun). xfree is now used to
21621 deallocate these memory blocks.
21622
4170f62f 216232011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 21624
71b41406
PE
21625 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21626
9587a89d
PE
21627 emacs_write: Accept and return EMACS_INT for sizes.
21628 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21629 et seq.
21630 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21631 Accept and return EMACS_INT.
21632 (emacs_gnutls_write): Return the number of bytes written on
21633 partial writes.
21634 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
21635 (emacs_read, emacs_write): Remove check for negative size, as the
21636 Emacs source code has been audited now.
9587a89d
PE
21637 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21638 (emacs_read, emacs_write): Use it.
273a5f82
PE
21639 * process.c (send_process): Adjust to the new signatures of
21640 emacs_write and emacs_gnutls_write. Do not attempt to store
21641 a byte offset into an 'int'; it might overflow.
9587a89d 21642 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 21643
3e047f51
PE
21644 * sound.c: Don't assume sizes fit in 'int'.
21645 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 21646 Return EMACS_INT, not int.
3e047f51 21647 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
21648 Accept EMACS_INT, not int.
21649 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
21650 record read return values.
21651
cc39a9db
BK
216522011-04-15 Ben Key <bkey76@gmail.com>
21653
c9d0ec6d
JB
21654 * keyboard.c (Qundefined): Don't declare static since it is used
21655 in nsfns.m.
21656 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21657 static since they are used in nsfont.m.
cc39a9db 21658
6c60eb9f
SM
216592011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21660
21661 * process.c (Qprocessp): Don't declare static.
21662 * lisp.h (Qprocessp): Declare again.
21663
7990b61a
JB
216642011-04-15 Juanma Barranquero <lekktu@gmail.com>
21665
21666 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21667
5d4cb038
PE
216682011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21669
8bd7b830 21670 Improve C-level modularity by making more things 'static'.
cd64ea1d 21671
e3b27b31
PE
21672 Don't publish debugger-only interfaces to other modules.
21673 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21674 (verify_bytepos, count_markers): Move decls to the only modules
21675 that need them.
21676 * region-cache.h (pp_cache): Likewise.
21677 * window.h (check_all_windows): Likewise.
21678 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21679
5d4cb038
PE
21680 * sysdep.c (croak): Now static, if
21681 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21682 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
21683
21684 * alloc.c (refill_memory_reserve): Now static if
21685 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21686 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 21687
e87b6180
PE
21688 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21689 Define only if USE_LUCID.
21690
ac64929e
PE
21691 * xrdb.c (x_customization_string, x_rm_string): Now static.
21692
6f37259d
PE
21693 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21694 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21695
1683e3ab
PE
21696 * xdisp.c (draw_row_with_mouse_face): Now static.
21697 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21698
de9c2632
PE
21699 * window.h (check_all_windows): Mark externally visible.
21700
2b96acb7
PE
21701 * window.c (window_deletion_count): Now static.
21702
21703 * undo.c: Make symbols static if they're not exported.
21704 (last_undo_buffer, last_boundary_position, pending_boundary):
21705 Now static.
21706
50436f33
PE
21707 * textprop.c (interval_insert_behind_hooks): Now static.
21708 (interval_insert_in_front_hooks): Likewise.
21709
64520e5c
PE
21710 * term.c: Make symbols static if they're not exported.
21711 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21712 (max_frame_lines, tty_set_terminal_modes):
21713 (tty_reset_terminal_modes, tty_turn_off_highlight):
21714 (get_tty_terminal): Now static.
21715 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21716 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 21717 HAVE_WINDOW_SYSTEM.
64520e5c
PE
21718 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21719 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21720
1fa53021
PE
21721 * sysdep.c: Make symbols static if they're not exported.
21722 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21723 Now static.
21724 (sigprocmask_set, full_mask): Remove; unused.
21725 (wait_debugging): Mark as visible.
21726 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21727 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21728
d4b43b22
PE
21729 * syntax.c (syntax_temp): Define only if !__GNUC__.
21730
b7c513d0
PE
21731 * sound.c (current_sound_device, current_sound): Now static.
21732
989b29ad
PE
21733 * search.c (searchbufs, searchbuf_head): Now static.
21734
13a55a78
PE
21735 * scroll.c (scroll_cost): Remove; unused.
21736 * dispextern.h (scroll_cost): Remove decl.
21737
de68a1fc
PE
21738 * region-cache.h (pp_cache): Mark as externally visible.
21739
40ccffa6
PE
21740 * process.c: Make symbols static if they're not exported.
21741 (process_tick, update_tick, create_process, chan_process):
21742 (Vprocess_alist, proc_buffered_char, datagram_access):
21743 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21744 (deactivate_process): Mark defn as static, as well as decl.
21745 * lisp.h (create_process): Remove decl.
21746 * process.h (chan_process, Vprocess_alist): Remove decls.
21747
ad64fc97
PE
21748 * print.c: Make symbols static if they're not exported.
21749 (print_depth, new_backquote_output, being_printed, print_buffer):
21750 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21751 (print_interval, print_number_index, initial_stderr_stream):
21752 Now static.
21753 * lisp.h (Fprinc): Remove decl.
21754 (debug_output_compilation_hack): Mark as externally visible.
21755
adddb265
PE
21756 * sysdep.c (croak): Move decl from here to syssignal.h.
21757 * syssignal.h (croak): Put it here, so the API can be checked when
21758 'croak' is called from dissociate_if_controlling_tty.
21759
1717ede2
PE
21760 * minibuf.c: Make symbols static if they're not exported.
21761 (minibuf_save_list, choose_minibuf_frame): Now static.
21762 * lisp.h (choose_minibuf_frame): Remove decl.
21763
fa5fb2bc
PE
21764 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21765
1e3890d1
PE
21766 * lread.c: Make symbols static if they're not exported.
21767 (read_objects, initial_obarray, oblookup_last_bucket_number):
21768 Now static.
21769 (make_symbol): Remove; unused.
21770 * lisp.h (initial_obarray, make_symbol): Remove decls.
21771
8a1414fa
PE
21772 * keyboard.c: Make symbols static if they're not exported.
21773 (single_kboard, recent_keys_index, total_keys, recent_keys):
21774 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21775 (this_single_command_key_start, echoing, last_auto_save):
21776 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21777 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21778 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21779 (Vlispy_mouse_stem, double_click_count):
21780 Now static.
21781 (force_auto_save_soon): Define only if SIGDANGER.
21782 (ignore_mouse_drag_p): Now static if
21783 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21784 (print_help): Remove; unused.
21785 (stop_character, last_timer_event): Mark as externally visible.
21786 * keyboard.h (ignore_mouse_drag_p): Declare only if
21787 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21788 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21789 * lisp.h (echoing): Remove decl.
21790 (force_auto_save_soon): Declare only if SIGDANGER.
21791 * xdisp.c (redisplay_window): Simplify code, to make it more
21792 obvious that ignore_mouse_drag_p is not accessed if !defined
21793 USE_GTK && !defined HAVE_NS.
21794
93ea6e8f
PE
21795 * intervals.c: Make symbols static if they're not exported.
21796 (merge_properties_sticky, merge_interval_right, delete_interval):
21797 Now static.
21798 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21799
77382fcc
PE
21800 * insdel.c: Make symbols static if they're not exported.
21801 However, leave prepare_to_modify_buffer alone. It's never
21802 called from outside this function, but that appears to be a bug.
21803 (combine_after_change_list, combine_after_change_buffer):
4889fc82 21804 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
21805 (adjust_after_replace_noundo): Remove; unused.
21806 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 21807 (signal_before_change): Remove decls.
77382fcc 21808
9306c32e
PE
21809 * indent.c (val_compute_motion, val_vmotion): Now static.
21810
cd44d2eb
PE
21811 * image.c: Make symbols static if they're not exported.
21812 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21813 if USE_GTK.
21814 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21815 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21816
ad9a7a06
PE
21817 * fringe.c (standard_bitmaps): Now static.
21818 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21819
81626931
PE
21820 * frame.c: Make symbols static if they're not exported.
21821 (x_report_frame_params, make_terminal_frame): Now static.
21822 (get_frame_param): Now static, unless HAVE_NS.
21823 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21824 (x_get_resource_string): Remove; not used.
21825 * frame.h (make_terminal_frame, x_report_frame_params):
21826 (x_get_resource_string); Remove decls.
21827 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21828 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21829
239f9db9
PE
21830 * font.c, fontset.c: Make symbols static if they're not exported.
21831 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21832 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21833 * font.c (font_close_object): Now static.
21834 * font.h (font_close_object): Remove.
21835 * fontset.c (FONTSET_OBJLIST): Remove.
21836 (free_realized_fontset) #if-0 the body, which does nothing.
21837 (face_suitable_for_char_p): #if-0, as it's never called.
21838 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
21839 * xfaces.c (face_at_string_position):
21840 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
21841 since 0 is always ASCII.
21842
dfcf3579
PE
21843 * fns.c (weak_hash_tables): Now static.
21844
5045092b
PE
21845 * fileio.c: Make symbols static if they're not exported.
21846 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21847 (Vwrite_region_annotation_buffers): Now static.
21848
57a96f5c
PE
21849 * eval.c: Make symbols static if they're not exported.
21850 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21851 * lisp.h (backtrace_list): Remove decl.
21852
35f08c38
PE
21853 * emacs.c: Make symbols static if they're not exported.
21854 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21855 (fatal_error_code, fatal_error_signal_hook, standard_args):
21856 Now static.
21857 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21858 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21859 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21860 * lisp.h (fatal_error_signal_hook): Remove decl.
21861 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21862
f44bd759
PE
21863 * editfns.c: Move a (normally-unused) function to its only use.
21864 * editfns.c, lisp.h (get_operating_system_release): Remove.
21865 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21866 worth the hassle of breaking this out.
21867
b532497d
PE
21868 * xterm.c: Make symbols static if they're not exported.
21869 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21870 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21871 (x_destroy_window, x_delete_display):
21872 Now static.
21873 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21874 (x_mouse_leave): Remove; unused.
21875 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21876 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21877 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21878 Remove decls.
21879 (x_mouse_leave): Declare only if WINDOWSNT.
21880 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21881 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21882 USE_X_TOOLKIT.
21883
1675728f
PE
21884 * ftxfont.c: Make symbols static if they're not exported.
21885 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21886 HAVE_FREETYPE.
21887 * font.h (ftxfont_driver): Likewise.
21888
e4cebfca
PE
21889 * xfns.c: Make symbols static if they're not exported.
21890 (x_last_font_name, x_display_info_for_name):
21891 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21892 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21893 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21894 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21895 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21896 (last_show_tip_args): Now static.
21897 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21898 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21899 (x_screen_planes): Remove; unused.
21900 * dispextern.h (x_screen_planes): Remove decl.
21901
5bf46f05
PE
21902 * dispnew.c: Make symbols static if they're not exported.
21903 * dispextern.h (redraw_garbaged_frames, scrolling):
21904 (increment_row_positions): Remove.
21905 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21906 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21907 Now static.
21908 (redraw_garbaged_frames): Remove; unused.
21909
435f4c28
PE
21910 * xfaces.c: Make symbols static if they're not exported.
21911 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21912 Remove decls.
21913 * xterm.h (defined_color): Remove decls.
21914 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21915 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21916 (menu_face_changed_default, defined_color, free_realized_face):
21917 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21918 (ascii_face_of_lisp_face): Remove; unused.
21919
8524aef3
PE
21920 * xdisp.c: Make symbols static if they're not exported.
21921 * dispextern.h (scratch_glyph_row, window_box_edges):
21922 (glyph_to_pixel_coords, set_cursor_from_row):
21923 (get_next_display_element, set_iterator_to_next):
21924 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21925 (show_mouse_face): Remove decls
21926 * frame.h (message_buf_print): Likewise.
21927 * lisp.h (pop_message, set_message, check_point_in_composition):
21928 Likewise.
21929 * xterm.h (set_vertical_scroll_bar): Likewise.
21930 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21931 (message_buf_print, scratch_glyph_row, displayed_buffer):
21932 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21933 (get_next_display_element, show_mouse_face, window_box_edges):
21934 (frame_to_window_pixel_xy, check_point_in_composition):
21935 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21936 (glyph_to_pixel_coords): Remove; unused.
21937
16390cd2
PE
21938 * dired.c (file_name_completion): Now static.
21939
21940 * dbusbind.c (xd_in_read_queued_messages): Now static.
21941
a25f4dfa
PE
21942 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21943 * data.c (circular_list_error): Remove.
21944
14a9c8df
PE
21945 * commands.h (last_point_position, last_point_position_buffer):
21946 (last_point_position_window): Remove decls.
21947 * keyboard.c: Make these variables static.
21948
04f2d78b
CB
21949 * coding.h (coding, code_convert_region, encode_coding_gap):
21950 Remove decls.
74ab6df5
PE
21951 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21952 (iso_code_class, detect_coding, code_convert_region): Now static.
21953 (encode_coding_gap): Remove; unused.
21954
38dfbee1
PE
21955 * chartab.c (chartab_chars, chartab_bits): Now static.
21956
a2cb4e63
PE
21957 * charset.h (charset_iso_8859_1): Remove decl.
21958 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21959 Now static.
21960
127198fd
PE
21961 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21962 * ccl.c (Vccl_program_table): Now static.
21963 (check_ccl_update): Remove; unused.
21964
d85b608f
PE
21965 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21966 * category.h: ... from here.
21967 * category.c (check_category_table, set_category_set): Now static.
21968
31cd66f3
PE
21969 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21970 * lisp.h: Remove these decls.
21971
c358e587
PE
21972 * buffer.c (buffer_count): Remove unused var.
21973
e78aecca
PE
21974 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21975 so that it's not optimized away.
21976 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21977 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21978 exported only to the debugger.
21979
e192d7d3 21980 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 21981 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 21982
92470028
PE
21983 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21984 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21985 was inaccessible from Lisp.
21986 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21987 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21988
244ed907
PE
21989 alloc.c: Import and export fewer symbols, and remove unused items.
21990 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21991 is defined.
21992 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21993 it's not optimized away by whole-program optimization.
21994 (message_enable_multibyte, free_misc): Remove.
21995 (catchlist, handlerlist, mark_backtrace):
21996 Declare only if BYTE_MARK_STACK.
21997 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21998 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21999 (message_enable_multibyte): Remove decl.
22000 (free_misc, interval_free_list, float_block, float_block_index):
22001 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22002 (cons_free_list, last_marked_index):
22003 Now static.
22004 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22005 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22006 (mark_backtrace): Define only if BYTE_MARK_STACK.
22007 * xdisp.c (message_enable_multibyte): Now static.
22008
61c2b50e 22009 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
22010 This makes it easier for human readers (and static analyzers)
22011 to see whether these variables are used from other modules.
22012 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22013 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22014 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22015 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22016 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22017 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22018 * xmenu.c, xselect.c:
22019 Declare Q* vars static if they are not used in other modules.
22020 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22021 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22022 Remove decls of unexported vars.
22023 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22024
95c82688
PE
22025 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22026
16a97296
PE
22027 Make Emacs functions such as Fatom 'static' by default.
22028 This makes it easier for human readers (and static analyzers)
22029 to see whether these functions can be called from other modules.
22030 DEFUN now defines a static function. To make the function external
22031 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
22032 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22033 (Finit_image_library):
16a97296
PE
22034 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22035 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22036 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22037 Remove decls, since these functions are now static.
22038 (Funintern, Fget_internal_run_time): New decls, since these functions
22039 were already external.
95c82688 22040
16a97296
PE
22041 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22042 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22043 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22044 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22045 * keyboard.c, keymap.c, lread.c:
22046 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22047 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22048 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22049 Mark functions with DEFUE instead of DEFUN,
22050 if they are used in other modules.
22051 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22052 decls for now-static functions.
22053 * buffer.h (Fdelete_overlay): Remove decl.
22054 * callproc.c (Fgetenv_internal): Mark as internal.
22055 * composite.c (Fremove_list_of_text_properties): Remove decl.
22056 (Fcomposition_get_gstring): New forward static decl.
22057 * composite.h (Fcomposite_get_gstring): Remove decl.
22058 * dired.c (Ffile_attributes): New forward static decl.
22059 * doc.c (Fdocumntation_property): New forward static decl.
22060 * eval.c (Ffetch_bytecode): New forward static decl.
22061 (Funintern): Remove extern decl; now in .h file where it belongs.
22062 * fileio.c (Fmake_symbolic_link): New forward static decl.
22063 * image.c (Finit_image_library): New forward static decl.
22064 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22065 * intervals.h (Fprevious_property_change):
22066 (Fremove_list_of_text_properties): Remove decls.
22067 * keyboard.c (Fthis_command_keys): Remove decl.
22068 (Fcommand_execute): New forward static decl.
22069 * keymap.c (Flookup_key): New forward static decl.
22070 (Fcopy_keymap): Now static.
22071 * keymap.h (Flookup_key): Remove decl.
22072 * process.c (Fget_process): New forward static decl.
22073 (Fprocess_datagram_address): Mark as internal.
22074 * syntax.c (Fsyntax_table_p): New forward static decl.
22075 (skip_chars): Remove duplicate decl.
22076 * textprop.c (Fprevious_property_change): New forward static decl.
22077 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22078 Now internal.
22079 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22080 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22081
785bbd42
PE
22082 * editfns.c (Fformat): Remove unreachable code.
22083
8b913b57
AS
220842011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22085
22086 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22087 change. (Bug#8496)
22088
a6744a35
EZ
220892011-04-13 Eli Zaretskii <eliz@gnu.org>
22090
22091 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22092 when at ZV. (Bug#8487)
22093
e7974947
AS
220942011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22095
baad03f0
AS
22096 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22097 (Bug#8437)
22098 * keyboard.c (parse_tool_bar_item): Likewise.
22099 * sound.c (sound_cleanup, alsa_close): Likewise.
22100 * termcap.c (tgetent): Likewise.
22101 * xfns.c (x_default_font_parameter): Likewise.
22102 * xsettings.c (read_and_apply_settings): Likewise.
22103
e7974947
AS
22104 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22105 (overrun_check_free): Protoize.
22106
28272684
PE
221072011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22108
22109 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22110 since callers should never pass a negative size.
22111 Change the signature to match that of plain 'read' and 'write'; see
22112 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22113 * lisp.h: Update prototypes of emacs_write and emacs_read.
22114
11997c76
EZ
221152011-04-11 Eli Zaretskii <eliz@gnu.org>
22116
22117 * xdisp.c (redisplay_window): Don't try to determine the character
22118 position of the scroll margin if the window start point w->startp
e896f03c 22119 is outside the buffer's accessible region. (Bug#8468)
11997c76 22120
8a2cbd72
EZ
221212011-04-10 Eli Zaretskii <eliz@gnu.org>
22122
22123 Fix write-region and its subroutines for buffers > 2GB.
22124 * fileio.c (a_write, e_write): Modify declaration of arguments and
22125 local variables to support buffers larger than 2GB.
22126 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22127
22128 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22129 argument, local variables, and return value.
22130
22131 * lisp.h: Update prototypes of emacs_write and emacs_read.
22132
22133 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22134
4073e537 221352011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 22136
1ebfdcb6
PE
22137 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22138
b2ded58d
PE
22139 Fix more problems found by GCC 4.6.0's static checks.
22140
7d66342c
PE
22141 * xdisp.c (vmessage): Use a better test for character truncation.
22142
bbf47d44
PE
22143 * charset.c (load_charset_map): <, not <=, for optimization,
22144 and to avoid potential problems with integer overflow.
9248994d 22145 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 22146 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 22147 * editfns.c (Fformat): Likewise.
1e69125e 22148 * syntax.c (skip_chars): Likewise.
3befa583 22149
e3019616
PE
22150 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22151 This also lets GCC 4.6.0 generate slightly better loop code.
22152
becfa255
PE
22153 * callint.c (Fcall_interactively): <, not <=, for optimization.
22154 (Fcall_interactively): Count the number of arguments produced,
22155 not the number of arguments given. This is simpler and lets GCC
22156 4.6.0 generate slightly better code.
22157
dae0cd48
PE
22158 * ftfont.c: Distingish more carefully between FcChar8 and char.
22159 The previous code passed unsigned char * to a functions like
22160 strlen and xstrcasecmp that expect char *, which does not
22161 conform to the C standard.
22162 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22163 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22164 char * when the C standard requires it.
22165
76032d70
PE
22166 * keyboard.c (read_char): Remove unused var.
22167
eb3f1cc8
PE
22168 * eval.c: Port to Windows vsnprintf (Bug#8435).
22169 Include <limits.h>.
22170 (SIZE_MAX): Define if the headers do not.
22171 (verror): Do not give up if vsnprintf returns a negative count.
22172 Instead, grow the buffer. This ports to Windows vsnprintf, which
22173 does not conform to C99. Problem reported by Eli Zaretskii.
22174 Also, simplify the allocation scheme, by avoiding the need for
22175 calling realloc, and removing the ALLOCATED variable.
22176
70476b54
PE
22177 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22178
12020a9e
PE
22179 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22180 But keep the doprint source code for now, as we might revamp it
22181 and use it again (Bug#8435).
ea6c7ae6
PE
22182 * lisp.h (doprnt): Remove.
22183 * Makefile.in (base_obj): Remove doprnt.o.
22184 * deps.mk (doprnt.o): Remove.
22185
5fdb398c
PE
22186 error: Print 32- and 64-bit integers portably (Bug#8435).
22187 Without this change, on typical 64-bit hosts error ("...%d...", N)
22188 was used to print both 32- and 64-bit integers N, which relied on
22189 undefined behavior.
61bdb816 22190 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
22191 * lisp.h (error, verror): Mark as printf-like functions.
22192 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22193 Report overflow in size calculations when allocating printf buffer.
22194 Do not truncate output string at its first null byte.
22195 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22196 Truncate the output at a character boundary, since vsnprintf does not
22197 do that.
22198 * charset.c (check_iso_charset_parameter): Convert internal
22199 character to string before calling 'error', since %c now has the
22200 printf meaning.
22201 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22202 overflow when computing char to be passed to 'error'. Do not
22203 pass Lisp_Object to 'error'; pass the integer instead.
22204 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22205 formatted with plain %d.
22206
b189fa66
PE
22207 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22208
bff87ef0
PE
22209 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22210
7e2cac20
PE
22211 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22212
ce4d90b5
PE
22213 * xterm.c (x_catch_errors): Remove duplicate declaration.
22214
266c9547
PE
22215 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22216
79c49ad2
PE
22217 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22218
368f4090
JM
222192011-04-10 Jim Meyering <meyering@redhat.com>
22220
22221 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22222 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22223 return ssize_t not "int", and use size_t as the buffer length.
22224 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22225 * gnutls.h: Update declarations.
22226 * process.c (read_process_output): Use ssize_t, to match.
22227 (send_process): Likewise.
22228
a32d4040
CY
222292011-04-09 Chong Yidong <cyd@stupidchicken.com>
22230
22231 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22232
8546720e 222332011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 22234
04f2d78b
CB
22235 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22236 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 22237
8546720e
GM
22238 * xterm.c (handle_one_xevent):
22239 * xmenu.c (create_and_show_popup_menu):
22240 * xselect.c (x_decline_selection_request)
22241 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 22242
0a2f5c1a 222432011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
22244
22245 Fix some uses of `int' instead of EMACS_INT.
22246 * search.c (string_match_1, fast_string_match)
22247 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22248 (scan_buffer, find_next_newline_no_quit)
22249 (find_before_next_newline, search_command, Freplace_match)
22250 (Fmatch_data): Make some `int' variables be EMACS_INT.
22251
22252 * xdisp.c (display_count_lines): 3rd argument and return value now
22253 EMACS_INT. All callers changed.
22254 (pint2hrstr): Last argument is now EMACS_INT.
22255
22256 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22257 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22258 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22259 (decode_coding_utf_16, decode_coding_emacs_mule)
22260 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22261 (decode_coding_ccl, decode_coding_charset)
22262 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22263 (decode_coding_iso_2022, decode_coding_emacs_mule)
22264 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22265 <char_offset, last_offset>: Declare EMACS_INT.
22266 (encode_coding_utf_8, encode_coding_utf_16)
22267 (encode_coding_emacs_mule, encode_invocation_designation)
22268 (encode_designation_at_bol, encode_coding_iso_2022)
22269 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22270 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22271 Declare EMACS_INT.
22272 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22273 (encode_invocation_designation): Last argument P_NCHARS is now
22274 EMACS_INT.
22275 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22276 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22277
22278 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22279 All users changed.
22280
22281 * ccl.c (Fccl_execute_on_string): Declare some variables
22282 EMACS_INT.
22283
8546720e 222842011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
22285
22286 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22287
4e19a977
CS
222882011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22289
22290 * process.c (Fformat_network_address): Doc fix.
22291
87302331
R
222922011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22293
ee7683eb 22294 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 22295
cbb59342
CY
222962011-04-08 Chong Yidong <cyd@stupidchicken.com>
22297
22298 * keyboard.c (read_char): Call Lisp function help-form-show,
22299 instead of using internal_with_output_to_temp_buffer.
22300 (Qhelp_form_show): New var.
e0d38eeb 22301 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
22302
22303 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22304
22305 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22306
e67a13ab
CY
223072011-04-06 Chong Yidong <cyd@stupidchicken.com>
22308
04f2d78b
CB
22309 * process.c (Flist_processes): Remove to Lisp.
22310 (list_processes_1): Delete.
e67a13ab 22311
973f782d
EZ
223122011-04-06 Eli Zaretskii <eliz@gnu.org>
22313
7c106b1e
EZ
22314 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22315
973f782d
EZ
22316 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22317
41cf7d1a 223182011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 22319
ca23cc88
PE
22320 Fix more problems found by GCC 4.6.0's static checks.
22321
f390e2d5
PE
22322 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22323
42eea0d0
PE
22324 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22325
b69769da 22326 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 22327
f9541e84
PE
22328 * xdisp.c (vmessage): Mark as a printf-like function.
22329
13841b55
PE
22330 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22331
c136c10f
PE
22332 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22333
5e2d4a30
PE
22334 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22335 printf-like functions.
22336 (tiff_load): Add casts to remove these marks before passing them
22337 to system-supplied API.
22338
583f48b9
PE
22339 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22340
b25d760e
PE
22341 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22342 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
22343 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22344 directly, rather than having caller test rule sign. This avoids
22345 some unnecessary tests.
22346 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22347 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22348 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 22349
bc7b6697 22350 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 22351 (xfont_open): Avoid unnecessary tests.
bc7b6697 22352
27ccc379
PE
22353 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22354
dcd5c89a
PE
22355 * composite.h, composite.c (composition_gstring_put_cache):
22356 Use EMACS_INT, not int, for length.
22357
b13a45c6
PE
22358 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22359 breaking out part of COMPOSITION_DECODE_RULE.
22360 (COMPOSITION_DECODE_RULE): Use it.
22361 * composite.c (get_composition_id): Remove unused local vars,
22362 by using the new macro.
22363
1e792e4d
PE
22364 * textprop.c (set_text_properties_1): Change while to do-while,
22365 since the condition is always true at first.
22366
dc6c6455 22367 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
22368 (interval_deletion_adjustment): Return unsigned value.
22369 All uses changed.
dc6c6455 22370
aba7731a
PE
22371 * process.c (list_processes_1, create_pty, read_process_output):
22372 (exec_sentinel): Remove vars that were set but not used.
afd4052b 22373 (create_pty): Remove unnecessary "volatile"s.
bc57d757 22374 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 22375 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 22376 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 22377
fdfc4bf3
PE
22378 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22379
fca8fe46 22380 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 22381 (update_syntax_table): Use unsigned instead of int.
fca8fe46 22382
06a0259a 22383 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 22384 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 22385 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 22386
e7b9e80f
PE
22387 * print.c (print_error_message): Avoid int overflow.
22388
56201685
PE
22389 * font.c (font_list_entities): Redo for clarity,
22390 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22391
78834453 22392 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 22393 (font_score): Avoid potential overflow in diff calculation.
78834453 22394
0bc0b309 22395 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 22396 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 22397
e610eaca
PE
22398 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22399
b895abce
PE
22400 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22401 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22402 can always succeed if overflow has undefined behavior.
22403
1f1d9321 22404 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 22405 (wordify): Omit three unnecessary tests.
1f1d9321 22406
c59478bc
PE
22407 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22408 All callers changed. This avoids the need for an unused var.
22409
79b73827
PE
22410 * casefiddle.c (casify_region): Remove var that is set but not used.
22411
a4db5dfe
PE
22412 * dired.c (file_name_completion): Remove var that is set but not used.
22413
43aae36e
PE
22414 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22415
2a47c44d 22416 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 22417 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 22418
a37c69bf
PE
22419 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22420 Check for integer overflow on size calculations.
22421
328ab8e7
PE
22422 * buffer.c (Fprevious_overlay_change): Remove var that is set
22423 but not used.
22424
e5a2a5cb
PE
22425 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22426 Remove vars that are set but not used.
8d84a6eb 22427 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 22428 (timer_check_2): Mark vars as initialized.
e5a2a5cb 22429
a60e5f68
PE
22430 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22431
f661cb61 22432 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 22433 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 22434
f0397f5a
PE
22435 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22436 that are set but not used.
22437
8664db06 22438 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 22439 if XCreateBitmapFromData fails (Bug#8410).
8664db06 22440
6abdaa4a
PE
22441 * xselect.c (x_get_local_selection, x_handle_property_notify):
22442 Remove vars that are set but not used.
22443
0ce7538d 22444 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 22445 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 22446
9ae848fc
PE
22447 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22448 Remove var that is set but not used.
0b918413
PE
22449 (scroll_bar_windows_size): Now size_t, not int.
22450 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22451 Check for overflow.
9ae848fc 22452
a5a62657
PE
22453 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22454 (map_tty_color) [!defined MSDOS]: Likewise.
22455
5c5cdd39
PE
22456 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22457
66ebf983
PE
22458 * coding.c: Remove vars that are set but not used.
22459 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22460 All callers changed.
22461 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22462 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22463 (decode_coding_charset): Remove vars that are set but not used.
22464
1be4d761
PE
22465 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22466 that is set but not used.
22467
47553fa8
PE
22468 * print.c (print_object): Remove var that is set but not used.
22469
1f7196bf 22470 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
22471 The gnulib version avoids calling malloc in the usual case,
22472 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22473 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22474 * filelock.c (current_lock_owner): Likewise.
22475 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22476 * sysdep.c: Include allocator.h, careadlinkat.h.
22477 (emacs_no_realloc_allocator): New static constant.
22478 (emacs_readlink): New function.
fdb61804
PE
22479 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22480 ../lib/careadlinkat.h.
d1fdcab7 22481
f84c17c7
SM
224822011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22483
22484 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22485 first non-nil return value).
22486
ef3862ad
JD
224872011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22488
22489 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22490 if not defined (Bug#8403).
22491
376a7006
JB
224922011-04-02 Juanma Barranquero <lekktu@gmail.com>
22493
22494 * xdisp.c (display_count_lines): Remove parameter `start',
22495 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22496 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22497 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22498 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22499 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22500 and thereabouts. All callers changed.
22501 (get_per_char_metric): Remove parameter `f', unused since
22502 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22503
6ca3801d
JM
225042011-04-02 Jim Meyering <meyering@redhat.com>
22505
22506 do not dereference NULL upon failed strdup
22507 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22508 (ns_get_family): Likewise.
22509
d8e2b5ba
JB
225102011-04-02 Juanma Barranquero <lekktu@gmail.com>
22511
22512 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22513
8c74fcbd
JD
225142011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22515
22516 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22517 later (Bug#8403).
22518
7200d79c
SM
225192011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22520
03408648 22521 Add lexical binding.
7200d79c 22522
03408648
SM
22523 * window.c (Ftemp_output_buffer_show): New fun.
22524 (Fsave_window_excursion):
22525 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22526
22527 * lread.c (lisp_file_lexically_bound_p): New function.
22528 (Fload): Bind Qlexical_binding.
22529 (readevalloop): Remove `evalfun' arg.
22530 Bind Qinternal_interpreter_environment.
22531 (Feval_buffer): Bind Qlexical_binding.
22532 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22533 Mark as dynamic.
22534 (syms_of_lread): Declare `lexical-binding'.
22535
22536 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22537
22538 * keyboard.c (eval_dyn): New fun.
22539 (menu_item_eval_property): Use it.
ca105506
SM
22540
22541 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 22542
03408648
SM
22543 * fns.c (concat, mapcar1): Accept byte-code-functions.
22544
22545 * eval.c (Fsetq): Handle lexical vars.
22546 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22547 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22548 (FletX, Flet): Obey lexical binding.
22549 (Fcommandp): Handle closures.
22550 (Feval): New `lexical' arg.
22551 (eval_sub): New function extracted from Feval. Use it almost
22552 everywhere where Feval was used. Look up vars in lexical env.
22553 Handle closures.
22554 (Ffunctionp): Move from subr.el.
22555 (Ffuncall): Handle closures.
22556 (apply_lambda): Remove `eval_flags'.
22557 (funcall_lambda): Handle closures and new byte-code-functions.
22558 (Fspecial_variable_p): New function.
22559 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22560 but without exporting it to Lisp.
23aba0ea 22561
23aba0ea 22562 * doc.c (Fdocumentation, store_function_docstring):
03408648 22563 * data.c (Finteractive_form): Handle closures.
23aba0ea 22564
03408648
SM
22565 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22566 interactive spec.
ba83908c 22567
04f2d78b
CB
22568 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22569 New byte-codes.
03408648
SM
22570 (exec_byte_code): New function extracted from Fbyte_code to handle new
22571 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 22572
03408648 22573 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 22574
03408648 22575 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 22576
e2abce01
JB
225772011-03-31 Juanma Barranquero <lekktu@gmail.com>
22578
22579 * xdisp.c (redisplay_internal): Fix prototype.
22580
63696a73 225812011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 22582
63696a73 22583 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
22584 (try_scrolling): Use it when setting scroll_limit.
22585 Limit scrolling to 100 screen lines.
63696a73
EZ
22586 (redisplay_window): Even when falling back on "recentering",
22587 position point in the window according to scroll-conservatively,
22588 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22589
22590 (try_scrolling): When point is above the window, allow searching
22591 as far as scroll_max, or one screenful, to compute vertical
22592 distance from PT to the scroll margin position. This prevents
22593 try_scrolling from unnecessarily failing when
22594 scroll-conservatively is set to a value slightly larger than the
22595 window height. Clean up the case of PT below the margin at bottom
22596 of window: scroll_max can no longer be INT_MAX. When aggressive
22597 scrolling is in use, don't let point enter the opposite scroll
22598 margin as result of the scroll.
22599 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
22600 threshold of 100 lines for never-recentering scrolling.
22601
e4cc2dfc
JB
226022011-03-31 Juanma Barranquero <lekktu@gmail.com>
22603
22604 * dispextern.h (move_it_by_lines):
22605 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22606 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22607 (message_log_check_duplicate): Remove parameters `prev_bol' and
22608 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22609 (redisplay_internal): Remove parameter `preserve_echo_area',
22610 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22611
22612 * indent.c (Fvertical_motion):
22613 * window.c (window_scroll_pixel_based, Frecenter):
22614 Don't pass `need_y_p' to `move_it_by_lines'.
22615
1c470562
SM
226162011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22617
44f230aa
SM
22618 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22619 steal a few bits to be more compact.
22620 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22621 Remove unneeded casts.
22622
1c470562
SM
22623 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22624
888adce9
ZK
226252011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22626
22627 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22628 binding" message (bug#7967).
22629
f838ed7b
PE
226302011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22631
77861b95
PE
22632 Fix more problems found by GCC 4.6.0's static checks.
22633
de6dbc14
PE
22634 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22635 Remove unused local var.
22636
f838ed7b
PE
22637 * editfns.c (Fmessage_box): Remove unused local var.
22638
792c7b2b
PE
22639 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22640 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22641 Omit unused local vars.
c499e557 22642 * window.c (shrink_windows): Omit unused local var.
b01a1c29 22643 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
22644 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22645 Omit unused local var.
22646
ba0165e1
PE
22647 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22648 Don't assume string length fits in int.
32ad8845 22649 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 22650 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 22651
3c59b4c9
PE
22652 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22653 instead of alloca (Bug#8344).
22654
a3eed478 22655 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 22656 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 22657
eb4d412d
PE
22658 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22659
1658b401
PE
22660 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22661 concerns.
22662
22663 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22664
22665 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 22666
9a2c6e05
PE
22667 * keyboard.c (syms_of_keyboard): Use the same style as later
22668 in this function when indexing through an array. This also
22669 works around GCC bug 48267.
22670
03d0a109
PE
22671 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22672
44f730c8
PE
22673 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22674
fe75f926
PE
22675 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22676 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22677
ffa8c828
PE
22678 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22679 This avoids undefined behavior on integer overflow, and is a bit
22680 more convenient anyway since it is compared to a size_t variable.
22681
c5101a77
PE
22682 Variadic C functions now count arguments with size_t, not int.
22683 This avoids an unnecessary limitation on 64-bit machines, which
22684 caused (substring ...) to crash on large vectors (Bug#8344).
22685 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22686 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 22687 All variadic functions and their callers changed accordingly.
c5101a77
PE
22688 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22689 * data.c (arith_driver, float_arith_driver): Likewise.
22690 * editfns.c (general_insert_function): Likewise.
22691 * eval.c (struct backtrace.nargs, interactive_p)
22692 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22693 (funcall_lambda, mark_backtrace): Likewise.
22694 * fns.c (concat): Likewise.
22695 * frame.c (x_set_frame_parameters): Likewise.
22696 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22697 0 if not found, not -1. All callers changed.
22698
dd3f25f7
PE
22699 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22700 (stack_copy_size): Now size_t, not int.
22701 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22702
461c2ab9
JB
227032011-03-28 Juanma Barranquero <lekktu@gmail.com>
22704
22705 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22706 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22707 All callers changed.
22708
22709 * lisp.h (multibyte_char_to_unibyte):
22710 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22711 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22712 * character.h (CHAR_TO_BYTE8):
22713 * cmds.c (internal_self_insert):
22714 * editfns.c (general_insert_function):
22715 * keymap.c (push_key_description):
22716 * search.c (Freplace_match):
22717 * xdisp.c (message_dolog, set_message_1): All callers changed.
22718
f6d62986
SM
227192011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22720
22721 * keyboard.c (safe_run_hook_funcall): New function.
22722 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22723 don't set the hook to nil, but remove the offending function instead.
22724 (Qcommand_hook_internal): Remove, unused.
22725 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22726 Vcommand_hook_internal.
22727
22728 * eval.c (enum run_hooks_condition): Remove.
22729 (funcall_nil, funcall_not): New functions.
22730 (run_hook_with_args): Call each function through a `funcall' argument.
22731 Remove `cond' argument, now redundant.
22732 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22733 (Frun_hook_with_args_until_failure): Adjust accordingly.
22734 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22735
1db5b1ad
JB
227362011-03-28 Juanma Barranquero <lekktu@gmail.com>
22737
22738 * dispextern.h (string_buffer_position): Remove declaration.
22739
22740 * print.c (strout): Remove parameter `multibyte', unused since
22741 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22742
22743 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22744 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22745 All callers changed.
22746
22747 * w32.c (_wsa_errlist): Use braces for struct initializers.
22748
22749 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22750 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22751 All callers changed.
22752 (string_buffer_position): Likewise. Also, make static (it's never
22753 used outside xdisp.c).
22754 (cursor_row_p): Remove parameter `w', unused since
22755 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22756 (decode_mode_spec): Remove parameter `precision', introduced during
22757 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22758 All callers changed.
22759
5ffb62aa
JD
227602011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22761
22762 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22763
461c2ab9 227642011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
22765
22766 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22767 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22768 (ns_update_auto_hide_menu_bar): New functions.
22769 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22770 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22771 ns_constrain_all_frames.
22772 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22773 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22774
5c380ffb
JD
227752011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22776
22777 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22778
9af30bdf
GM
227792011-03-27 Glenn Morris <rgm@gnu.org>
22780
22781 * syssignal.h: Replace RETSIGTYPE with void.
22782 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22783 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22784 Replace SIGTYPE with void everywhere.
22785 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22786 * s/template.h (SIGTYPE): Remove commented out definition.
22787
e2abce01
JB
227882011-03-26 Eli Zaretskii <eliz@gnu.org>
22789
22790 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22791 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22792
f868cd8a
JB
227932011-03-26 Juanma Barranquero <lekktu@gmail.com>
22794
59eb0929
JB
22795 * w32.c (read_unc_volume): Use parameter `henum', instead of
22796 global variable `wget_enum_handle'.
22797
22798 * keymap.c (describe_vector): Remove parameters `indices' and
22799 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22800 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22801
f868cd8a
JB
22802 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22803
22804 * keyboard.c (timer_check): Remove parameter `do_it_now',
22805 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22806 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22807 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22808
22809 * keyboard.c (read_char):
22810 * w32menu.c (w32_menu_display_help):
22811 * xmenu.c (show_help_event, menu_help_callback):
22812 Adjust calls to `show_help_echo'.
22813
22814 * gtkutil.c (xg_maybe_add_timer):
22815 * keyboard.c (readable_events):
22816 * process.c (wait_reading_process_output):
22817 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22818
22819 * insdel.c (adjust_markers_gap_motion):
22820 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22821 (gap_left, gap_right): Don't call it.
22822
2ecf6fdb
CY
228232011-03-25 Chong Yidong <cyd@stupidchicken.com>
22824
22825 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22826 incurred during fontification.
22827
6b1f9ba4
JB
228282011-03-25 Juanma Barranquero <lekktu@gmail.com>
22829
22830 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22831 (DEFVAR_PER_BUFFER): Don't pass it.
22832
22833 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22834 (scrolling_window): Don't pass it.
22835
0f4a96b5
JB
228362011-03-25 Juanma Barranquero <lekktu@gmail.com>
22837
22838 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22839
22840 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22841 and `suffix'.
22842 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22843 of variables specific to SELinux and computation of `encoded_absname'.
22844
22845 * image.c (XPutPixel): Remove unused variable `height'.
22846
22847 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22848
22849 * unexw32.c (get_section_info): Remove unused variable `section'.
22850
22851 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22852 (system_process_attributes): Remove unused variable `sess'.
22853 (sys_read): Remove unused variable `err'.
22854
22855 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22856 (w32_wnd_proc): Remove unused variable `isdead'.
22857 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22858 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22859 (x_create_tip_frame): Remove unused variable `tem'.
22860
22861 * w32inevt.c (w32_console_read_socket):
22862 Remove unused variable `no_events'.
22863
22864 * w32term.c (x_draw_composite_glyph_string_foreground):
22865 Remove unused variable `width'.
22866
1149507c
JB
228672011-03-24 Juanma Barranquero <lekktu@gmail.com>
22868
22869 * w32term.c (x_set_glyph_string_clipping):
22870 Don't pass uninitialized region to CombineRgn.
22871
9c88f339
JB
228722011-03-23 Juanma Barranquero <lekktu@gmail.com>
22873
22874 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22875 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22876 (Fx_close_connection): Remove unused variable `i'.
22877
22878 * w32font.c (w32font_draw): Return number of glyphs.
22879 (w32font_open_internal): Remove unused variable `i'.
22880 (w32font_driver): Add missing initializer.
22881
22882 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22883 (fill_in_menu): Remove unused variable `items_added'.
22884
22885 * w32term.c (last_mouse_press_frame): Remove static global variable.
22886 (w32_clip_to_row): Remove unused variable `f'.
22887 (x_delete_terminal): Remove unused variable `i'.
22888
22889 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22890 (NOTHING): Remove unused static global variable.
22891 (uniscribe_check_otf): Remove unused variable `table'.
22892 (uniscribe_font_driver): Add missing initializers.
22893
dee091a3
JD
228942011-03-23 Julien Danjou <julien@danjou.info>
22895
22896 * term.c (Fsuspend_tty, Fresume_tty):
22897 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22898 * window.c (temp_output_buffer_show):
22899 * insdel.c (signal_before_change):
22900 * frame.c (Fhandle_switch_frame):
22901 * fileio.c (Fdo_auto_save):
22902 * emacs.c (Fkill_emacs):
22903 * editfns.c (save_excursion_restore):
22904 * cmds.c (internal_self_insert):
22905 * callint.c (Fcall_interactively):
22906 * buffer.c (Fkill_all_local_variables):
22907 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22908 Use Frun_hooks.
0f4a96b5 22909 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 22910 unconditionally since it does the check itself.
dee091a3 22911
2c520ab5 229122011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 22913
c9c49752
PE
22914 Fix more problems found by GCC 4.5.2's static checks.
22915
8abc3f12
PE
22916 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22917 the first time through the loop, since we know p0 < p1 then.
22918 This also avoids a gcc -Wstrict-overflow warning.
22919
a2d26660
PE
22920 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22921 leading to a memory leak, possible in functions like
22922 load_charset_map_from_file that can allocate an unbounded number
b12ef411 22923 of objects (Bug#8318).
a2d26660 22924
916c72e9
PE
22925 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22926 that could (at least in theory) be that large.
22927
19ab8a18
PE
22928 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22929 This is less likely to overflow, and avoids undefined behavior if
22930 overflow does occur. All callers changed. Use strtoul to scan
22931 for the unsigned long integer.
b7cbbd6f
PE
22932 (pint2hrstr): Simplify and tune code slightly.
22933 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 22934
f0641eff
PE
22935 * scroll.c (do_scrolling): Work around GCC bug 48228.
22936 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22937
7f650bb9
PE
22938 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22939 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
22940 (validate_x_resource_name): Simplify count usage.
22941 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 22942
37dd57d1
PE
22943 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22944 fail (Bug#8306).
81e56e61 22945
699979fc 22946 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 22947
401bf9b4
PE
22948 * process.c (Fmake_network_process): Use socklen_t, not int,
22949 where POSIX says socklen_t is required in portable programs.
22950 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 22951 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
22952 (Fmake_network_process, server_accept_connection):
22953 (wait_reading_process_output, read_process_output):
22954 Likewise.
22955
b93aacde
PE
22956 * process.c: Rename or move locals to avoid shadowing.
22957 (list_processes_1, Fmake_network_process):
22958 (read_process_output_error_handler, exec_sentinel_error_handler):
22959 Rename or move locals.
4dc343ee 22960 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 22961 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 22962 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 22963 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 22964 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 22965
af8a867c 22966 Make tparam.h and terminfo.c consistent.
44f230aa
SM
22967 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22968 Include tparam.h instead, since it declares them.
af8a867c
PE
22969 * cm.h (PC): Remove extern decl; tparam.h now does this.
22970 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22971 * terminfo.c: Include tparam.h, to check interfaces.
22972 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22973 (tparam): Adjust signature to match interface in tparam.h;
22974 this removes some undefined behavior. Check that outstring and len
22975 are zero, which they always are with Emacs.
22976 * tparam.h (PC, BC, UP): New extern decls.
22977
0248044d 22978 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 22979 (xftfont_open): Rename locals to avoid shadowing.
0248044d 22980
8ff096c1 22981 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
22982 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22983 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 22984 (ftfont_list): Remove unused local.
49eaafba
PE
22985 (get_adstyle_property, ftfont_pattern_entity):
22986 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22987 Rename locals to avoid shadowing.
8ff096c1 22988
e2be39f6
PE
22989 * xfont.c (xfont_list_family): Mark var as initialized.
22990
c9735e30
PE
22991 * xml.c (make_dom): Now static.
22992
8f5201ae
PE
22993 * composite.c (composition_compute_stop_pos): Rename local to
22994 avoid shadowing.
b246f932
PE
22995 (composition_reseat_it): Remove unused locals.
22996 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 22997 (composition_update_it): Mark var as initialized.
11b61122
PE
22998 (find_automatic_composition): Mark vars as initialized,
22999 with a FIXME (Bug#8290).
8f5201ae 23000
760fbc2c
PE
23001 character.h: Rename locals to avoid shadowing.
23002 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23003 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23004 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23005 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23006 to avoid shadowing.
23007
ff08eb85
PE
23008 * textprop.c (property_change_between_p): Remove; unused.
23009
fc7bf025
PE
23010 * intervals.c (interval_start_pos): Now static.
23011
235d7abc
PE
23012 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23013
44f230aa
SM
23014 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23015 Rename locals to avoid shadowing.
3e7d6594 23016
50060332
PE
23017 * sound.c (wav_play, au_play, Fplay_sound_internal):
23018 Fix pointer signedness.
d01f234b 23019 (alsa_choose_format): Remove unused local var.
c83b8872
PE
23020 (wav_play): Initialize a variable to 0, to prevent undefined
23021 behavior (Bug#8278).
50060332 23022
c4fc4e30
PE
23023 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23024
918436ed
PE
23025 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23026
c939f91b
PE
23027 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23028 clobbering (Bug#8298).
b9c7f648
PE
23029 * sysdep.c (sys_subshell): Likewise.
23030 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 23031
6bd8c144
PE
23032 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23033 This should get cleaned up, so that child_setup has the
23034 same signature on all platforms.
23035
7710357c 23036 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 23037 (relocate_fd): Rename locals to avoid shadowing.
7710357c 23038
c59da222
CY
230392011-03-22 Chong Yidong <cyd@stupidchicken.com>
23040
23041 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23042 not to be necessary, and produces flickering.
23043
66b87493
GM
230442011-03-20 Glenn Morris <rgm@gnu.org>
23045
23046 * config.in: Remove file.
23047
45b6f6d5
JB
230482011-03-20 Juanma Barranquero <lekktu@gmail.com>
23049
23050 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23051 are now in src/globals.h.
23052 (syms_of_minibuf): Remove spurious & from previous change.
23053
cd394be1 230542011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
23055
23056 * minibuf.c (completing-read-function): New variable.
23057 (completing-read-default): Rename from completing-read.
23058 (completing-read): Call completing-read-function.
23059
b14e3e21
CY
230602011-03-19 Juanma Barranquero <lekktu@gmail.com>
23061
23062 * xfaces.c (Fx_load_color_file):
23063 Read color file from absolute filename (bug#8250).
23064
f2b726e6
JB
230652011-03-19 Juanma Barranquero <lekktu@gmail.com>
23066
23067 * makefile.w32-in: Update dependencies.
23068
09f6ff02
EZ
230692011-03-17 Eli Zaretskii <eliz@gnu.org>
23070
23071 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23072
29a6015a
PE
230732011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23074
a3a6c54e
PE
23075 Fix more problems found by GCC 4.5.2's static checks.
23076
b766f867
PE
23077 * process.c (make_serial_process_unwind, send_process_trap):
23078 (sigchld_handler): Now static.
23079
be02381c
PE
23080 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23081 That way, the code declares only the vars that it needs.
23082 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23083 * s/cygwin.h (PTY_ITERATION): Likewise.
23084 * s/darwin.h (PTY_ITERATION): Likewise.
23085 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23086
57048744
PE
23087 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23088 * process.c (allocate_pty): Don't declare stb unless it's needed.
23089
7914961c 23090 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
23091 (CONSTANTLIM): Remove; unused.
23092 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23093 Define only if needed.
7914961c 23094
b3967b18
PE
23095 * unexelf.c (unexec): Name an expression,
23096 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
23097 Use a different way to cause a compilation error if anyone uses
23098 n rather than nn, a way that does not involve shadowing.
73366a00 23099 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 23100
29a6015a
PE
23101 * deps.mk (unexalpha.o): Remove; unused.
23102
43cfc33e 23103 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 23104 * unexec.h: New file.
ce701a33
PE
23105 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23106 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23107 Depend on unexec.h.
23108 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23109 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23110 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 23111 Change as necessary to match prototype in unexec.h.
ce701a33 23112
01f44d5a
PE
23113 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23114 shadowing.
4f63c6bb 23115 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 23116
a6670b0b
PE
23117 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23118 Rename locals to avoid shadowing.
23119
cef2010d 23120 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 23121 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 23122
d4d7173a
PE
23123 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23124
f08b802a
PE
23125 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23126 warning when compiling print.c.
23127
3ddb0639
PE
23128 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23129 instead of using an uninitialized var.
5ad03b97 23130 (font_sort_entities): Mark var as initialized.
3ddb0639 23131
170a2692
PE
23132 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23133
e663c700
PE
23134 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23135 pointers to constants.
89bc529a 23136 (font_parse_fcname): Remove unused vars.
7b81e2d0 23137 (font_delete_unmatched): Now static.
ea838e10 23138 (font_get_spec): Remove; unused.
13a547c6
PE
23139 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23140 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23141 Rename or move locals to avoid shadowing.
e663c700 23142
2a80c887 23143 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 23144 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 23145
1384fa33 23146 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 23147 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 23148
8b2c52e9
PE
23149 * alloc.c (mark_backtrace): Move decl from here ...
23150 * lisp.h: ... to here, so that it can be checked.
23151
475545b5 23152 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 23153 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
23154 (lisp_indirect_variable): Name an expression,
23155 to avoid gcc -Wbad-function-cast warning.
1faed8ae 23156 (Fdefvar): Rename locals to avoid shadowing.
475545b5 23157
b1349114 23158 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 23159 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 23160 Use const pointer when appropriate.
b1349114 23161
a2928364
PE
23162 * lisp.h (get_system_name, get_operating_system_release):
23163 Move decls here, to check interfaces.
23164 * process.c (get_operating_system_release): Move decl to lisp.h.
23165 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
23166 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23167 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23168 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
23169 (Fformat_time_string, Fencode_time, Finsert_char):
23170 (Ftranslate_region_internal, Fformat):
23171 Rename or remove local vars to avoid shadowing.
9710023e 23172 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 23173
a415e694
PE
23174 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23175 avoid shadowing.
23176
8ef4622d
PE
23177 * lisp.h (eassert): Check that the argument compiles, even if
23178 ENABLE_CHECKING is not defined.
23179
946f9a5b
PE
23180 * data.c (Findirect_variable): Name an expression, to avoid
23181 gcc -Wbad-function-cast warning.
112396d6 23182 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 23183 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
23184 (Fmake_variable_buffer_local, Fmake_local_variable):
23185 Mark variables as initialized.
52746918 23186 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 23187
e5aab7e7 23188 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
23189 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23190 Rename locals to avoid shadowing.
dff45157
PE
23191 (mark_stack): Move local variables into the #ifdef region where
23192 they're used.
7bc26fdb
PE
23193 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23194 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23195 needed otherwise.
23196 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23197 (GC_STRING_CHARS): Remove; not used.
d40d4be1 23198 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 23199
e5aab7e7
PE
23200 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23201 avoids undefined behavior in theory.
23202
4da60324
PE
23203 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23204
88043301
PE
23205 Use functions, not macros, for up- and down-casing (Bug#8254).
23206 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23207 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23208 to use the following functions instead of these macros.
23209 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23210 EMACS_INT, since callers assume the returned value fits in int.
23211 (upcase1): Likewise, for UPCASE_TABLE.
23212 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 23213 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 23214 the race-condition problem in the old DOWNCASE.
88043301 23215
19ed5445
PE
23216 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23217 Rename locals to avoid shadowing.
23218 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
23219 (regex_compile, re_search_2, re_match_2_internal):
23220 Remove unused local vars.
952db0d7
PE
23221 (FREE_VAR): Rewrite so as not to use empty "else",
23222 which gcc can warn about.
da053e48 23223 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
23224 (RETALLOC_IF): Define only if needed.
23225 (WORDCHAR_P): Likewise. This one is never needed, but is used
23226 only in a comment talking about a compiler bug, so put inside
23227 the #if 0 of that comment.
23228 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23229 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23230 Remove; unused.
19ed5445 23231
1f3561e4 23232 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
23233 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23234 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 23235
ded6f8f7
PE
23236 * search.c (simple_search): Remove unused var.
23237
dbd37a95
PE
23238 * dired.c (compile_pattern): Move decl from here ...
23239 * lisp.h: ... to here, so that it can be checked.
23240 (struct re_registers): New forward decl.
23241
7e47afad
PE
23242 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23243
85f24f61
PE
23244 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23245 All uses changed.
23246 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23247 Rename locals to avoid shadowing.
5671df8f 23248 (Fvertical_motion): Mark locals as initialized.
85f24f61 23249
181aa2be 23250 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 23251 (casify_region): Mark local as initialized.
181aa2be 23252
930d429c
PE
23253 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23254
7082eac6
PE
23255 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23256 New macros, so that the caller can use some names other than
23257 gcpro1, gcpro2, etc.
23258 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23259 of the new macros.
23260 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23261 argument, for consistency with GCPRO2_VAR, etc: it is now the
23262 prefix of the variable, not the variable itself. All uses
23263 changed.
38b2c076
PE
23264 * dired.c (directory_files_internal, file_name_completion):
23265 Rename locals to avoid shadowing.
23266
15206ed9
PE
23267 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23268 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23269 dired.c's scmp function, had undefined behavior.
23270 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23271 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23272 * buffer.h: ... to here, because these macros use current_buffer,
23273 and the new implementation with inline functions needs to have
23274 current_buffer in scope now, rather than later when the macros
23275 are used.
23276 (downcase, upcase1): New static inline functions.
23277 (DOWNCASE, UPCASE1): Reimplement using these functions.
23278 This avoids undefined behavior in expressions like
23279 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23280 from race conditions in accessing the global variables
23281 case_temp1 and case_temp2.
23282 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23283 * lisp.h (case_temp1, case_temp2): Remove their decls.
23284 * character.h (ASCII_CHAR_P): Move from here ...
23285 * lisp.h: ... to here, so that the inline functions mentioned
23286 above can use them.
23287
4a6bea26
PE
23288 * dired.c (directory_files_internal_unwind): Now static.
23289
f14b7e14
PE
23290 * fileio.c (file_name_as_directory, directory_file_name):
23291 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23292 Now static.
2893f146
PE
23293 (file_name_as_directory): Use const pointers when appropriate.
23294 (Fexpand_file_name): Likewise. In particular, newdir might
23295 point at constant storage, so make it a const pointer.
fd4ead52 23296 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
23297 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23298 signedness issues.
f839df0c
PE
23299 (Fset_file_times, Finsert_file_contents, auto_save_error):
23300 Rename locals to avoid shadowing.
f14b7e14 23301
5716756e 23302 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
23303 (Ftry_completion, Fall_completions): Rename or remove locals
23304 to avoid shadowing.
5716756e 23305
b4c3046a
PE
23306 * marker.c (bytepos_to_charpos): Remove; unused.
23307
b45db522
PE
23308 * lisp.h (verify_bytepos, count_markers): New decls,
23309 so that gcc does not warn that these functions aren't declared.
23310
85876d07
PE
23311 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23312 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 23313 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 23314 (copy_text): Remove unused local var.
85876d07 23315
03d78a21 23316 * filelock.c (within_one_second): Now static.
b3dd38ab 23317 (lock_file_1): Rename local to avoid shadowing.
03d78a21 23318
5df8f01b
PE
23319 * buffer.c (fix_overlays_before): Mark locals as initialized.
23320 (fix_start_end_in_overlays): Likewise. This function should be
23321 simplified by using pointers-to-pointers, but that's a different
23322 matter.
b1d876f1 23323 (switch_to_buffer_1): Now static.
8f54f30a
PE
23324 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23325 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 23326
a70072c9 23327 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 23328 Fix pointer signedness issue.
edced198
PE
23329 (sys_subshell): Mark local as volatile if checking for lint,
23330 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 23331 (MAXPATHLEN): Define only if needed.
a70072c9 23332
a0977c44
PE
23333 * process.c (serial_open, serial_configure): Move decls from here ...
23334 * systty.h: ... to here, so that they can be checked.
23335
a884fdcc
PE
23336 * fns.c (get_random, seed_random): Move extern decls from here ...
23337 * lisp.h: ... to here, so that they can be checked.
23338
604efe86 23339 * sysdep.c (reset_io): Now static.
b8950c94 23340 (wait_for_termination_signal): Remove; unused.
604efe86 23341
38fc62d9
PE
23342 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23343 (copy_keymap_item, append_key, push_text_char_description):
23344 Now static.
1004a21a 23345 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 23346 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
23347 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23348 (describe_map_tree):
23349 Rename locals to avoid shadowing.
38fc62d9 23350
2f2650da
PE
23351 * keyboard.c: Declare functions static if they are not used elsewhere.
23352 (echo_char, echo_dash, cmd_error, top_level_2):
23353 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
23354 (read_char, kbd_buffer_get_event, make_lispy_position):
23355 (make_lispy_event, make_lispy_movement, apply_modifiers):
23356 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23357 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23358 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 23359 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 23360 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 23361
a053e86c 23362 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
23363 (mark_kboards): Move decl here ...
23364 * alloc.c (mark_kboards): ... from here.
a053e86c 23365
4752793e
PE
23366 * lisp.h (force_auto_save_soon): New decl.
23367
74f10ca7 23368 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
23369 (DEFINE_DUMMY_FUNCTION): New macro.
23370 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23371 Use it.
c03cd23f
PE
23372 (main): Add casts to avoid warnings
23373 if GCC considers string literals to be constants.
74f10ca7 23374
022e70d4
PE
23375 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23376
59d6fe83
PE
23377 * dbusbind.c: Pointer signedness fixes.
23378 (xd_signature, xd_append_arg, xd_initialize):
23379 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23380 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23381 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23382 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23383
78320123
PE
23384 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23385 if GCC considers string literals to be constants.
49cebcca 23386 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 23387
35ac2a97
SM
233882011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23389
fb103ca9
SM
23390 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23391 (print_preprocess, print_object): New macro to fix last change.
23392
35ac2a97
SM
23393 * print.c (print_preprocess): Don't forget font objects.
23394
62973b41
JB
233952011-03-16 Juanma Barranquero <lekktu@gmail.com>
23396
23397 * emacs.c (USAGE3): Doc fixes.
23398
0e48bb22
AS
233992011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23400
23401 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23402 structure.
23403
7684e57b
JB
234042011-03-14 Juanma Barranquero <lekktu@gmail.com>
23405
23406 * lisp.h (VWindow_system, Qfile_name_history):
23407 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23408 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23409 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23410
23411 * w32select.c: Don't #include "keyboard.h".
c96bbc66 23412 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
23413
23414 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23415 * w32console.c (detect_input_pending, read_input_pending)
23416 (encode_terminal_code):
23417 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23418 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23419 (w32_system_caret_y, Qfile_name_history):
23420 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23421 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23422 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23423 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23424 * w32proc.c (Qlocal, report_file_error):
23425 * w32term.c (Vwindow_system, updating_frame):
23426 * w32uniscribe.c (initialized, uniscribe_font_driver):
23427 Remove unneeded extern declarations.
23428
2aa46d6c
CY
234292011-03-14 Chong Yidong <cyd@stupidchicken.com>
23430
c96bbc66 23431 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 23432
cffc6f3b
CY
234332011-03-13 Chong Yidong <cyd@stupidchicken.com>
23434
23435 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23436 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23437 These macros can no longer be used for assignment.
23438
44f230aa
SM
23439 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23440 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
23441 (record_buffer_markers, fetch_buffer_markers): New functions for
23442 recording and fetching special buffer markers.
23443 (set_buffer_internal_1, set_buffer_temp): Use them.
23444
23445 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23446
23447 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23448
23449 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23450 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23451
23452 * xdisp.c (hscroll_window_tree):
23453 (reconsider_clip_changes): Use PT instead of BUF_PT.
23454
d251f04b
EZ
234552011-03-13 Eli Zaretskii <eliz@gnu.org>
23456
23457 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23458 $(EMACS_ROOT)/lib/intprops.h.
23459
f0c77cd1
PE
234602011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23461
3eca4629
PE
23462 Fix more problems found by GCC 4.5.2's static checks.
23463
7c86ee98
PE
23464 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23465 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
23466 (xg_free_frame_widgets): Make it clear that a local variable is
23467 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
23468 (gdk_window_get_screen): Make it clear that this macro is needed
23469 only if USE_GTK_TOOLTIP.
1e5524e7
PE
23470 (int_gtk_range_get_value): New function, which avoids a diagnostic
23471 from gcc -Wbad-function-cast.
23472 (xg_set_toolkit_scroll_bar_thumb): Use it.
23473 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23474 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
23475 (get_utf8_string, xg_get_file_with_chooser):
23476 Rename locals to avoid shadowing.
23477 (create_dialog): Move locals to avoid shadowing.
7c86ee98 23478
41729b81
PE
23479 * xgselect.c (xg_select): Remove unused var.
23480
f0c77cd1
PE
23481 * image.c (four_corners_best): Mark locals as initialized.
23482 (gif_load): Initialize transparent_p to zero (Bug#8238).
23483 Mark another local as initialized.
ec6cf4c6 23484 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 23485
ce0ad53d 23486 * image.c (clear_image_cache): Now static.
d5d5a617 23487 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 23488 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
23489 (x_edge_detection): Remove unnecessary cast that
23490 gcc -Wbad-function-cast diagnoses.
2037898d 23491 (gif_load): Fix pointer signedness.
6ae141d6
PE
23492 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23493 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 23494
33383987 234952011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 23496
d32df629
PE
23497 Improve quality of tests for time stamp overflow.
23498 For example, without this patch (encode-time 0 0 0 1 1
23499 1152921504606846976) returns the obviously-bogus value (-948597
23500 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23501 reports time overflow. See
23502 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
23503 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23504 * editfns.c: Include limits.h and intprops.h.
23505 (TIME_T_MIN, TIME_T_MAX): New macros.
23506 (time_overflow): Move earlier, to before first use.
23507 (hi_time, lo_time): New functions, for an accurate test for
23508 out-of-range times.
23509 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23510 (Fget_internal_run_time): Don't assume time_t fits in int.
23511 (make_time): Use list2 instead of Fcons twice.
23512 (Fdecode_time): More accurate test for out-of-range times.
23513 (check_tm_member): New function.
23514 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
23515 (lisp_time_argument): Don't rely on undefined left-shift and
23516 right-shift behavior when checking for time stamp overflow.
8be6f318 23517
fe31d94c
PE
23518 * editfns.c (time_overflow): New function, refactoring common code.
23519 (Fformat_time_string, Fdecode_time, Fencode_time):
23520 (Fcurrent_time_string): Use it.
23521
8be6f318
PE
23522 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23523 * dired.c (make_time): Move to ...
23524 * editfns.c (make_time): ... here.
23525 * systime.h: Note the move.
23526
09d9db2c 235272011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 23528
126bc0dc
YM
23529 * fringe.c (update_window_fringes): Remove unused variables.
23530
c47cbdfd
YM
23531 * unexmacosx.c (copy_data_segment): Also copy __got section.
23532 (Bug#8223)
23533
7ac80be9
EZ
235342011-03-12 Eli Zaretskii <eliz@gnu.org>
23535
c96bbc66 23536 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
23537 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23538 Constify `char *' arguments and their references according to
23539 prototypes in tparam.h.
23540
ecb0f94d 23541 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 23542
7ac80be9
EZ
23543 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23544 Adapt all references accordingly.
23545
23546 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23547
ef1fd07e
TT
235482011-03-11 Tom Tromey <tromey@redhat.com>
23549
23550 * buffer.c (syms_of_buffer): Remove obsolete comment.
23551
7ef4b50c
EZ
235522011-03-11 Eli Zaretskii <eliz@gnu.org>
23553
23554 * termhooks.h (encode_terminal_code): Declare prototype.
23555
23556 * msdos.c (encode_terminal_code): Don't declare prototype.
23557
23558 * term.c (encode_terminal_code): Now external again, used by
23559 w32console.c and msdos.c.
23560
44f230aa
SM
23561 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23562 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 23563
4b1ec863 235642011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 23565
1714f52b 23566 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 23567
4b1ec863
PE
23568 * fringe.c (update_window_fringes): Mark locals as initialized
23569 (Bug#8227).
23570 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 23571
524c7aa6
PE
23572 * alloc.c (mark_fringe_data): Move decl from here ...
23573 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23574 to check its interface.
23575 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23576
a5c0af81 23577 * fontset.c (free_realized_fontset): Now static.
7519b8cd 23578 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 23579 (fontset_font): Mark local as initialized.
a9a06e0b 23580 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 23581
b4716021
PE
23582 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23583
811e9bac 23584 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 23585 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
23586 (x_own_selection, Fx_disown_selection_internal): Rename locals
23587 to avoid shadowing.
23588 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 23589
7e3ab302
PE
23590 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23591 so that the caller can use some name other than gcpro1.
23592 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
23593 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23594 (Fx_backspace_delete_keys_p):
23595 Use them to avoid shadowing, and rename vars to avoid shadowing.
23596 (x_decode_color, x_set_name, x_window): Now static.
6b437900 23597 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 23598 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
23599 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23600 Remove unused locals.
7e3ab302
PE
23601 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23602 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23603 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23604 macros.
f78faa98 23605
e2b13473
PE
23606 * xterm.h (x_mouse_leave): New decl.
23607
77f23912
PE
23608 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23609 Remove unused functions.
cdf4ba58
PE
23610 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23611 (x_calc_absolute_position): Now static.
7411c686 23612 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 23613 Don't declare local "event" unless it's used.
ed7bf3a5
PE
23614 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23615 unless they are used.
38d0b34a
PE
23616 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23617 (x_fatal_error_signal): Remove; not used.
a6067996
PE
23618 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23619 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23620 (x_error_catcher, x_connection_closed, x_error_handler):
23621 (x_error_quitter, xembed_send_message, x_iconify_frame):
23622 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 23623 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 23624 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 23625
44f230aa
SM
23626 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23627 Rename or move locals to avoid shadowing.
6b463e58 23628 (tty_defined_color, merge_face_heights): Now static.
5967d051 23629 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
23630 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23631 does not deduce is never used uninitialized.
73719eba
PE
23632 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23633 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 23634
426994c3 23635 * terminal.c (store_terminal_param): Now static.
5489860b 23636
032f1620 23637 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 23638 (set_frame_menubar): Remove unused local.
d4323972 23639 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
23640 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23641 since they might point to immutable storage.
281585b0
PE
23642 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23643 since it's unused otherwise.
032f1620 23644
367c19e5 23645 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 23646 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
23647 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23648 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 23649 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
23650 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23651 does not deduce are never used uninitialized.
70739cbe 23652
07b48fa9
PE
23653 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23654
8868a238 23655 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
23656 * window.c (window_loop, size_window):
23657 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 23658
7e5cf297 23659 * window.c (display_buffer): Now static.
d6550a9f
PE
23660 (size_window): Mark variables that gcc -Wuninitialized
23661 does not deduce are never used uninitialized.
a586633d
PE
23662 * window.h (check_all_windows): New decl, to forestall
23663 gcc -Wmissing-prototypes diagnostic.
5b555da1 23664 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 23665
f6095868
PE
23666 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23667 shadowing.
23668 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
23669 Include <limits.h>.
23670 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23671 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
23672 (load_charset_map): Mark variables that gcc -Wuninitialized
23673 does not deduce are never used uninitialized.
53df7c11 23674 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 23675
f38b440c
PE
23676 * coding.c (coding_set_source, coding_set_destination):
23677 Use "else { /* comment */ }" rather than "else /* comment */;"
23678 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
23679 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23680 a block, when the outer 'i' will do.
23681 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23682 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23683 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23684 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23685 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23686 Rename locals to avoid shadowing.
23687 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
23688 * coding.c (emacs_mule_char, encode_invocation_designation):
23689 Now static, since they're not used elsewhere.
413bb2db 23690 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 23691 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
23692 (decode_coding_emacs_mule): Mark variables that gcc
23693 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
23694 (detect_coding_iso_2022): Initialize a local variable that might
23695 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 23696 this initialization is needed. (Bug#8211)
5f58e762
PE
23697 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23698 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23699 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23700 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23701 Remove unused macros.
f38b440c 23702
232b38b9 23703 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 23704 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 23705 * character.c (string_count_byte8): Likewise.
232b38b9 23706
fb90da1b
PE
23707 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23708 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23709
fb93dbc2
PE
23710 * chartab.c (copy_sub_char_table): Now static, since it's not used
23711 elsewhere.
5c156ace
PE
23712 (sub_char_table_ref_and_range, char_table_ref_and_range):
23713 Rename locals to avoid shadowing.
bbcd0949 23714 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 23715
7d3b3862 23716 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 23717 (BIDI_BOB): Remove unused macro.
7d3b3862 23718
6be7d3da
PE
23719 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23720 deduce are never used uninitialized.
c2ed9c8b 23721 * term.c (encode_terminal_code): Likewise.
6be7d3da 23722
75f8807f 23723 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 23724
50938595
PE
23725 * tparam.h: New file.
23726 * term.c, tparam.h: Include it.
23727 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23728 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23729 Move these decls to tparam.h, and make them agree with what
23730 is actually in tparam.c. The previous trick of using incompatible
23731 decls in different modules does not conform to the C standard.
23732 All callers of tparam changed to use tparam's actual API.
23733 * tparam.c (tparam1, tparam, tgoto):
23734 Use const pointers where appropriate.
23735
fbceeba2
PE
23736 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23737 * cm.h (struct cm): Likewise.
23738 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23739 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23740 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23741 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23742 (turn_on_face, init_tty): Likewise.
23743 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 23744
7f3f1250
PE
23745 * term.c (term_mouse_position): Rename local to avoid shadowing.
23746
e6ca6543
PE
23747 * alloc.c (mark_ttys): Move decl from here ...
23748 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23749
c40f8d15
AS
237502011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23751
23752 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23753
cfe0661d
JB
237542011-03-09 Juanma Barranquero <lekktu@gmail.com>
23755
23756 * search.c (compile_pattern_1): Remove argument regp, unused since
23757 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23758 (compile_pattern): Don't pass it.
23759
0afb4571
J
237602011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23761
23762 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23763 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23764 for ! HAVE_GTK3.
23765 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23766
23767 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23768
23769 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23770 gdk_window_get_screen, gdk_window_get_geometry,
23771 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23772 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23773 (xg_get_pixbuf_from_pixmap): New function.
23774 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23775 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23776 Call xg_get_pixbuf_from_pixmap instead of
23777 gdk_pixbuf_get_from_drawable.
23778 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23779 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23780 (xg_check_special_colors): Use GtkStyleContext and its functions
23781 for HAVE_GTK3.
23782 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23783 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23784 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
23785 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23786 Call gtk_widget_get_preferred_size.
0afb4571
J
23787 (xg_frame_resized): gdk_window_get_geometry only takes 5
23788 parameters.
44f230aa
SM
23789 (xg_win_to_widget, xg_event_is_for_menubar):
23790 Call gdk_x11_window_lookup_for_display.
0afb4571
J
23791 (xg_set_widget_bg): New function.
23792 (delete_cb): New function.
895009e1 23793 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 23794 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
23795 (xg_set_background_color): Call xg_set_widget_bg.
23796 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23797 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23798 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23799 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23800 if ! HAVE_GTK3.
23801 (update_frame_tool_bar): Call gtk_widget_hide.
23802 (xg_initialize): Use GDK_KEY_g.
23803
23804 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23805 if ! HAVE_GTK3
23806 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23807
23808 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23809 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23810 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23811
1c2cc4ef
JB
238122011-03-08 Juanma Barranquero <lekktu@gmail.com>
23813
23814 * w32xfns.c (select_palette): Check success of RealizePalette against
23815 GDI_ERROR, not zero.
23816
33383987 23817See ChangeLog.11 for earlier changes.
aac0c6e3
MR
23818
23819;; Local Variables:
23820;; coding: utf-8
aac0c6e3
MR
23821;; End:
23822
ab422c4d 23823 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
23824
23825 This file is part of GNU Emacs.
23826
23827 GNU Emacs is free software: you can redistribute it and/or modify
23828 it under the terms of the GNU General Public License as published by
23829 the Free Software Foundation, either version 3 of the License, or
23830 (at your option) any later version.
23831
23832 GNU Emacs is distributed in the hope that it will be useful,
23833 but WITHOUT ANY WARRANTY; without even the implied warranty of
23834 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23835 GNU General Public License for more details.
23836
23837 You should have received a copy of the GNU General Public License
23838 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.