* progmodes/octave.el (octave-font-lock-keywords)
[bpt/emacs.git] / src / ChangeLog
CommitLineData
e6076b1b
JD
12013-05-05 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
4 to where it is used, to avoid autorelease issues (Bug#14050).
5
cbee2131
PE
62013-05-05 Paul Eggert <eggert@cs.ucla.edu>
7
8 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
9 * fileio.c (syms_of_fileio): Implement this.
10 * filelock.c (create_lock_file): If symbolic links don't work, so
11 we use a regular file as a lock file, do not fsync the lock file;
12 it's not needed.
13
30c7e542
SM
142013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
17 (syms_of_minibuf): Adjust accodingly.
18 * lread.c (Fread):
19 * callint.c (Fcall_interactively): Adjust calls accordingly.
20
5bebd186
EZ
212013-05-04 Eli Zaretskii <eliz@gnu.org>
22
23 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
30c7e542
SM
24 w->contents is a buffer before computing everything else.
25 Use parentheses to disambiguate last part of the condition.
5bebd186
EZ
26
27 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
28 assertion violations. (Bug#14062)
29
0fb0a4f3
DR
302013-05-01 David Reitter <david.reitter@gmail.com>
31
32 * nsfns.m (ns_tooltip): Initialize.
33
9e63b4a5
EZ
342013-04-28 Eli Zaretskii <eliz@gnu.org>
35
36 * coding.c (decode_coding_gap): Don't remove the character before
37 a newline unless it's a CR character. (Bug#14287)
38
ad60824e
DN
392013-04-28 Dan Nicolaescu <dann@gnu.org>
40
41 * dispextern.h (struct face): Move enum face_underline_type
42 earlier so that bitfields can be in the same word.
43
edbdcec0
JD
442013-04-28 Jan Djärv <jan.h.d@swipnet.se>
45
46 * nsfns.m (handlePanelKeys): New function.
47 (EmacsOpenPanel:performKeyEquivalent:)
48 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
49 arrows/function/control and copy/paste keys (Bug#14296).
50
0208ede7
JL
512013-04-27 Juri Linkov <juri@jurta.org>
52
53 * callint.c (Fcall_interactively): Call `Qread_number' for
54 interactive code letter `n' instead of using duplicate code.
55 (Bug#14254)
56
b8dd59f7
PE
572013-04-27 Paul Eggert <eggert@cs.ucla.edu>
58
59 * systime.h (make_timeval): Declare as 'const'.
60
8bd722db
KH
612013-04-27 Kenichi Handa <handa@gnu.org>
62
63 * font.c (font_open_entity): Always open a font of manageable
64 size.
65
13d0e56f 662013-04-26 Paul Eggert <eggert@cs.ucla.edu>
cbee2131 67
f780d632
PE
68 Port better to AIX (Bug#14258).
69 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
70 to pacify AIX xlc.
71
ec509856
KH
722013-04-24 Kenichi Handa <handa@gnu.org>
73
74 * coding.c (decode_coding_iso_2022): When an invalid escape
75 sequence is encountered, reset the invocation and designation
76 status to the safest one.
77
84fc48e5
PE
782013-04-22 Paul Eggert <eggert@cs.ucla.edu>
79
80 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
81 Without this fix, "make distclean" leaves stamp-h1 behind.
82
806bda47
EC
832013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
84
85 * w32fns.c (w32_fullscreen_rect): New function to compute the
86 window rectangle for the given fullscreen mode.
87 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
88 longer tunes the window size. This keeps the window's edges flush
89 with the screen and allows the taskbar to hide itself in fullboth.
90
91 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
92 window decorations and uses the entire screen.
93
94 * w32term.h (w32_fullscreen_rect) Add prototype.
95 (struct w32_output): Replace normal_width, normal_height,
96 normal_top, and normal_left members with a single normal_placement
97 struct.
98 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
99 Remove macros.
100 (FRAME_NORMAL_PLACEMENT): New macro.
101
9cc2810b
JB
1022013-04-16 Juanma Barranquero <lekktu@gmail.com>
103
104 * minibuf.c (Ftest_completion): Silence compiler warning.
105
fd16b54c
EZ
1062013-04-15 Eli Zaretskii <eliz@gnu.org>
107
108 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
5fbcd237 109 bug#14062.
fd16b54c
EZ
110
111 * frame.h (WINDOW_FRAME): Protect macro and its argument with
112 parentheses.
113
114 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
115 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
116 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
117 parentheses where appropriate.
118
9e3379a0
PE
1192013-04-14 Paul Eggert <eggert@cs.ucla.edu>
120
121 * keyboard.c (timer_start_idle): Remove no-longer-used local.
122
ddd6b685
EZ
1232013-04-14 Eli Zaretskii <eliz@gnu.org>
124
125 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
126 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
127 Mention in the doc string that setting these variables takes
128 effect only after a call to set-window-buffer. (Bug#14200)
129
29b79ba1
EZ
1302013-04-13 Eli Zaretskii <eliz@gnu.org>
131
132 * indent.c (Fvertical_motion): Don't consider display strings on
133 overlay strings as display strings on the buffer position we
134 started from. This prevents vertical cursor motion from jumping
135 more than one line when there's an overlay string with a display
136 property at end of line.
137 Reported by Karl Chen <Karl.Chen@quarl.org> in
138 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
139
562c6ee9
SM
1402013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
141
142 * window.c (select_window): `record_buffer' even if window is
143 already selected (bug#14191).
144
fcc1fe85
EZ
1452013-04-11 Eli Zaretskii <eliz@gnu.org>
146
147 * window.c (Fwindow_end): Test more flags, including the buffer's
148 last_overlay_modified flag, to determine whether the window's
149 display is really up-to-date. Prevents the function from
150 returning a stale value. (Bug#14170)
151 (Fwindow_line_height): Fix the test for up-to-date-ness of the
152 current matrix.
153
f009190a
EZ
1542013-04-10 Eli Zaretskii <eliz@gnu.org>
155
156 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
562c6ee9
SM
157 garbaged only if it is not already the top frame on its TTY.
158 This prevents flickering due to constant redrawing of TTY frames when
f009190a
EZ
159 there are GUI frames open in the same session. (Bug#13864)
160
78ce603d
SM
1612013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
162
163 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
164 of marking the idle timers directly.
165
a8036e40
SM
1662013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
167
168 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
169 tables (bug#14054).
170
7ffe7ef6
SM
1712013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
172
173 * window.c (select_window): Don't record_buffer while the invariant is
174 temporarily broken (bug#14161).
175
176 * fns.c (Fdelq): Don't assume !NILP => CONSP.
177
7d9f6883
EZ
1782013-04-07 Eli Zaretskii <eliz@gnu.org>
179
180 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
181
5406cfd9
RF
1822013-04-07 Romain Francoise <romain@orebokech.com>
183
184 Ignore additional platform-specific ACL errors (Bug#13702).
185 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
186 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
187
95c0e83b
JD
1882013-03-31 Jan Djärv <jan.h.d@swipnet.se>
189
190 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
191 f->output_data.ns.
192
876da980
PE
1932013-04-07 Paul Eggert <eggert@cs.ucla.edu>
194
195 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
196 This bug was introduced by my 2013-02-25 change that simplified
197 data_start configuration. Without this change, on GNU/Linux
198 an Emacs configured with --enable-profiling fails immediately
199 due to a profiler signal.
200 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
201 with these flags. On platforms where special flags are needed
202 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
203 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
204 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
205
7452b7bd
DA
2062013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
207
208 Get rid of some platform-specific functions examining window
209 system and its capabilities. This is a partial rework of the
210 2013-04-05 change.
211 * lisp.h (have_menus_p): Remove prototype. This function is
212 replaced with platform-independent window_system_available.
213 (check_window_system): Move to...
214 * frame.h (decode_window_system_frame, window_system_available):
215 ...here, add new prototypes.
216 * frame.c (window_system_available, decode_window_system_frame):
217 New functions.
218 (check_window_system): Platform-independent now.
219 * xterm.h (x_in_use): Remove declaration.
220 (check_x_frame):
221 * w32term.h (check_x_frame):
222 * nsterm.h (check_x_frame): Remove prototypes. This function
223 is replaced with platform-independent decode_window_system_frame.
224 * msdos.c (have_menus_p): Remove.
225 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
226 Remove platform-specific functions. Use check_window_system,
227 decode_window_system_frame and check_ns_display_info where
228 appropriate. Minor style and comment tweaks.
229 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
230 (check_x_frame): Likewise.
231 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
232 Likewise.
233 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
234 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
235 * xmenu.c, xselect.c: All related users changed.
236
251e9147
KH
2372013-04-03 Kenichi Handa <handa@gnu.org>
238
239 The following changes is to optimize the code for reading UTF-8
240 files.
241
562c6ee9 242 * coding.c (check_ascii): Rename from detect_ascii. Return value
251e9147
KH
243 changed. Check EOL format. Do not call adjust_coding_eol_type
244 here.
245 (check_utf_8): New function.
246 (adjust_coding_eol_type): Do nothing if already adjusted.
247 (detect_coding): Compare the return value of check_ascii with
248 coding->src_bytes. Call adjust_coding_eol_type if necessary.
249 (decode_coding_gap): Optimize for valid UTF-8.
250
8bc369d4
KH
2512013-03-21 Kenichi Handa <handa@gnu.org>
252
253 * coding.c (syms_of_coding): Cancel previous change.
254
255 * insdel.c (insert_from_gap): Fix previous change.
256
73931ad1
DA
2572013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
258
259 Consistently use platform-specific function to detect window system.
260 * lisp.h (check_window_system): New prototype. This function is
261 going to replace check_x, check_w32 and check_ns.
262 (have_menus_p): Mention msdos.c in comment.
263 * fontset.c (check_window_system_func): Remove. Adjust all users.
264 * fontset.h (check_window_system_func): Remove prototype.
265 * nsterm.h (check_ns):
266 * xterm.h (check_x):
267 * w32term.h (check_w32): Likewise.
268 * menu.c (Fx_popup_menu): Use check_window_system.
269 * msdos.c (check_window_system): Define for MS-DOS.
270 * nsfns.m (check_window_system): Define for NS. Adjust all users.
271 * w32fns.c (check_window_system): Likewise for MS-Windows.
272 * xfns.c (check_window_system): Likewise for X.
273 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
274 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
275
7216e43b
PE
2762013-04-02 Paul Eggert <eggert@cs.ucla.edu>
277
278 Prefer < to > in range checks such as 0 <= i && i < N.
279 This makes it easier to visualize quantities on a number line.
280 This patch doesn't apply to all such range checks,
281 only to the range checks affected by the 2013-03-24 change.
282 This patch reverts most of the 2013-03-24 change.
283 * alloc.c (xpalloc, Fgarbage_collect):
284 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
285 * character.c (string_escape_byte8):
286 * charset.c (read_hex):
287 * data.c (cons_to_unsigned):
288 * dispnew.c (update_frame_1):
289 * doc.c (Fsubstitute_command_keys):
290 * doprnt.c (doprnt):
291 * editfns.c (hi_time, decode_time_components):
292 * fileio.c (file_offset):
293 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
294 * font.c (font_intern_prop):
295 * frame.c (x_set_alpha):
296 * gtkutil.c (get_utf8_string):
297 * indent.c (check_display_width):
298 * keymap.c (Fkey_description):
299 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
300 * lread.c (read1):
301 * minibuf.c (read_minibuf_noninteractive):
302 * process.c (wait_reading_process_output):
303 * search.c (Freplace_match):
304 * window.c (get_phys_cursor_glyph):
305 * xdisp.c (redisplay_internal):
306 * xsmfns.c (smc_save_yourself_CB):
307 Prefer < to > for range checks.
308 * dispnew.c (sit_for): Don't mishandle NaNs.
309 This fixes a bug introduced in the 2013-03-24 change.
310 * editfns.c (decode_time_components): Don't hoist comparison.
311 This fixes another bug introduced in the 2013-03-24 change.
312
92759988
DA
3132013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
314
315 * frame.h (struct frame): Drop scroll_bottom_vpos
316 member becaue all real users are dead long ago.
317 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
318 * xdisp.c (redisplay_internal): Adjust user.
319
9a1971bb
GM
3202013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
321
f38ab167
JD
322 * nsmenu.m (showAtX:Y:for:): setLevel to
323 NSPopUpMenuWindowLevel (Bug#13998).
324
6d01f1fe
JD
3252013-03-30 Jan Djärv <jan.h.d@swipnet.se>
326
327 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
328 (ns_check_pending_open_menu): Declare.
329
330 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
331 (x_activate_menubar): Update the menu with title that matches
332 ns_get_pending_menu_title, and call
333 ns_check_pending_openmenu (Bug#12698).
334 (menuWillOpen:): New method.
335 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
336
337 * nsterm.m (menu_will_open_state, menu_mouse_point)
338 (menu_pending_title): New varaibles.
339 (ns_get_pending_menu_title, ns_check_menu_open)
340 (ns_check_pending_open_menu): New functions.
341
781f4782
DA
3422013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
343
344 * indent.c (current_column_bol_cache): Remove leftover which is not
345 used in Fmove_to_column any more.
346 (current_column, scan_for_column): Adjust users.
347 * keyboard.c (last_point_position_buffer, last_point_position_window):
348 Remove leftovers which are not used for recording undo any more.
349 (command_loop_1, syms_of_keyboard): Adjust users.
350 * xdisp.c (last_max_ascent): Remove leftover which is not used in
351 redisplay_window any more.
352 (move_it_to): Adjust user.
353
1921c31b
JB
3542013-03-29 Juanma Barranquero <lekktu@gmail.com>
355
356 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
357 Update dependencies.
358
717b8bcd
SM
3592013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
360
361 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
362 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
363 forward references.
364
e74aeda8
DA
3652013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
366
367 * window.h (struct window): Replace hchild, vchild and buffer slots
368 with the only contents slot. This is possible because each valid
369 window may have either the child window (in vertical or horizontal
370 combination) or buffer to display (for the leaf window). Using that,
371 a lof of operations to traverse and/or change window hierarchies may
372 be simplified. New member horizontal is used to distinguish between
373 horizontal and vertical combinations of internal windows.
374 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
375 (WINDOW_VERTICAL_COMBINATION_P): New macros.
376 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
377 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
378 Use contents slot, not buffer, where appropriate.
379 (wset_combination): New function.
380 (wset_buffer): Add eassert.
381 (Fframe_first_window): Simplify the loop reaching first window.
382 (Fwindow_buffer): Use WINDOW_LEAF_P.
383 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
384 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
385 (unshow_buffer): Convert initial debugging check to eassert.
386 (replace_window, recombine_windows, Fdelete_other_windows_internal)
387 (make_parent_window, window_resize_check, window_resize_apply)
388 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
389 (Fset_window_configuration, delete_all_child_windows, save_window_save):
390 Adjust to match struct window changes.
391 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
392 (mark_window_cursors_off, count_windows, get_leaf_windows)
393 (foreach_window_1): Simplify the loop.
394 * alloc.c (mark_object): Do not check for the leaf window because
395 internal windows has no glyph matrices anyway.
396 * dispnew.c (clear_window_matrices, showing_window_margins_p)
397 (allocate_matrices_for_window_redisplay, fake_current_matrices)
398 (allocate_matrices_for_frame_redisplay, free_window_matrices)
399 (build_frame_matrix_from_window_tree, mirror_make_current)
400 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
401 (update_window_tree, set_window_update_flags): Simplify the loop.
402 (sync_window_with_frame_matrix_rows): Enforce live window.
403 Use contents slot, not buffer, where appropriate.
404 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
405 and WINDOW_HORIZONTAL_COMBINATION_P.
406 (make_frame_visible_1): Simplify the loop.
407 Use contents slot, not buffer, where appropriate.
408 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
409 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
410 (expose_window_tree): Likewise.
411 Use contents slot, not buffer, where appropriate.
412 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
413 to avoid deleted windows. Use contents slot instead of buffer.
414 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
415 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
416 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
417 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
418
121ab1cd
EZ
4192013-03-28 Eli Zaretskii <eliz@gnu.org>
420
ef454cf7
EZ
421 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
422 identify the reasons for assertion violations in bug#14062 and
423 similar ones.
21e930f8
EZ
424 (Fx_show_tip): Fix compilation error under
425 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 426
121ab1cd
EZ
427 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
428 Reported by <rzl24ozi@gmail.com>.
429
5c89ca24
DA
4302013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
431
432 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
433 start marker...
562c6ee9
SM
434 (unwind_with_echo_area_buffer): ...to restore it here.
435 This is needed to ensure that...
5c89ca24
DA
436 (redisplay_window): ...both window markers are valid here,
437 which is verified by eassert.
438 * editfns.c (save_excursion_save): Do not assume that
439 selected_window always displays the buffer.
c7f53895
DA
440 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
441 Fix comment.
5c89ca24 442
f557c1b1
SM
4432013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
444
445 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
446 the upcase table.
447
40693bba 4482013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
449
450 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
451
c86f791f
EZ
4522013-03-27 Eli Zaretskii <eliz@gnu.org>
453
454 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
455 since MinGW's w32api headers do. This avoids compiler warnings.
456
457 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
458 if already defined.
459
c6e72e17
EZ
4602013-03-26 Eli Zaretskii <eliz@gnu.org>
461
462 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
463
54e95010
JD
4642013-03-26 Jan Djärv <jan.h.d@swipnet.se>
465
466 * gtkutil.c (style_changed_cb): Check if frame is live and an
467 X frame (Bug#14038).
468
b88b62de
EZ
4692013-03-26 Eli Zaretskii <eliz@gnu.org>
470
a18d7de6
EZ
471 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
472 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
473 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
474 MinGW64.
8f5e14c8
EZ
475 Move inclusion of time.h before sys/time.h, so that MinGW64 could
476 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 477
b88b62de
EZ
478 Fix incompatibilities between MinGW.org and MinGW64 headers.
479 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
480
481 * w32.c (REPARSE_DATA_BUFFER): Guard with
482 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
483
c074e458
JD
4842013-03-25 Jan Djärv <jan.h.d@swipnet.se>
485
486 * xterm.c: Include X11/XKBlib.h
487 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
488
908589fd
AS
4892013-03-24 Andreas Schwab <schwab@linux-m68k.org>
490
491 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
492 written backwards.
493 * blockinput.h (input_blocked_p): Likewise.
494 * bytecode.c (exec_byte_code): Likewise.
495 * callproc.c (call_process_kill, call_process_cleanup)
496 (Fcall_process): Likewise.
497 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
498 (Fccl_execute_on_string): Likewise.
499 * character.c (string_escape_byte8): Likewise.
500 * charset.c (read_hex): Likewise.
501 * cm.c (calccost): Likewise.
502 * data.c (cons_to_unsigned): Likewise.
503 * dired.c (directory_files_internal, file_name_completion):
504 Likewise.
505 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
506 (sit_for): Likewise.
507 * doc.c (Fsubstitute_command_keys): Likewise.
508 * doprnt.c (doprnt): Likewise.
509 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
510 * emacsgtkfixed.c: Likewise.
511 * fileio.c (file_offset, Fwrite_region): Likewise.
512 * floatfns.c (Fexpt, fmod_float): Likewise.
513 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
514 Likewise.
515 * font.c (font_intern_prop): Likewise.
516 * frame.c (x_set_alpha): Likewise.
517 * gtkutil.c (get_utf8_string): Likewise.
518 * indent.c (check_display_width): Likewise.
519 * intervals.c (create_root_interval, rotate_right, rotate_left)
520 (split_interval_right, split_interval_left)
521 (adjust_intervals_for_insertion, delete_node)
522 (interval_deletion_adjustment, adjust_intervals_for_deletion)
523 (merge_interval_right, merge_interval_left, copy_intervals)
524 (set_intervals_multibyte_1): Likewise.
525 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
526 * keymap.c (Fkey_description): Likewise.
527 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
528 * lread.c (openp, read_integer, read1, string_to_number):
529 Likewise.
530 * menu.c (ensure_menu_items): Likewise.
531 * minibuf.c (read_minibuf_noninteractive): Likewise.
532 * print.c (printchar, strout): Likewise.
533 * process.c (create_process, Faccept_process_output)
534 (wait_reading_process_output, read_process_output, send_process)
535 (wait_reading_process_output): Likewise.
536 * profiler.c (make_log, handle_profiler_signal): Likewise.
537 * regex.c (re_exec): Likewise.
538 * regex.h: Likewise.
539 * search.c (looking_at_1, Freplace_match): Likewise.
540 * sysdep.c (get_child_status, procfs_ttyname)
541 (procfs_get_total_memory): Likewise.
542 * systime.h (EMACS_TIME_VALID_P): Likewise.
543 * term.c (dissociate_if_controlling_tty): Likewise.
544 * window.c (get_phys_cursor_glyph): Likewise.
545 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
546 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
547 Likewise.
548 * xfns.c (Fx_window_property): Likewise.
549 * xmenu.c (set_frame_menubar): Likewise.
550 * xselect.c (x_get_window_property, x_handle_dnd_message):
551 Likewise.
552 * xsmfns.c (smc_save_yourself_CB): Likewise.
553 * xterm.c (x_scroll_bar_set_handle): Likewise.
554
2bf7d27a
DA
5552013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
556
557 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
558 to be optional or nil. Adjust comment and convert it to docstring.
559 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
560 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
561
a9ebfa0b
PE
5622013-03-24 Paul Eggert <eggert@cs.ucla.edu>
563
564 Static checking by GCC 4.8-20130319.
565 * image.c (gif_load): Assume pass < 3 to pacify GCC.
566 * process.c (Fset_process_datagram_address)
567 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
568 * xdisp.c (get_char_face_and_encoding):
569 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
570 (get_glyph_face_and_encoding): Prepare face before possibly using it.
571 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
572
4f3576ee
KB
5732013-03-24 Ken Brown <kbrown@cornell.edu>
574
789b5e9a
KB
575 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
576 fix compilation on 64-bit Cygwin, where underscores are not
577 automatically prepended.
578
4f3576ee
KB
579 * w32term.c (w32_initialize): Silence compiler warning.
580
b5b7745f
EZ
5812013-03-23 Eli Zaretskii <eliz@gnu.org>
582
cdc0d0bd
EZ
583 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
584 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
562c6ee9
SM
585 variables, to save and restore frame dimensions.
586 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
587 after returning from a 'fullscreen' configuration.
588 use SendMessage instead of PostMessage to send the SC_RESTORE message,
cdc0d0bd
EZ
589 to avoid races between the main thread and the input thread.
590
591 * w32term.h (struct w32_output): New members normal_width,
592 normal_height, normal_top, normal_left, and prev_fsmode.
593 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
594 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
595 members of a frame.
596
b5b7745f
EZ
597 * w32term.c (w32fullscreen_hook): Record last value of the frame's
598 'fullscreen' parameter. Always record previous width and height
599 of the frame, except when switching out of maximized modes, so
600 that they could be restored correctly, instead of resetting to the
601 default frame dimensions. Send SC_RESTORE command to the frame,
602 unless we are going to send SC_MAXIMIZE, to restore the frame
603 resize hints in the mouse pointer shown by the window manager.
604 (Bug#14032)
605
606 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
607
608 * lisp.h (get_frame_param): Adjust conditions for prototype
609 declaration.
610
a3454eed
KB
6112013-03-22 Ken Brown <kbrown@cornell.edu>
612
613 * unexcw.c: Drop unneeded inclusion of w32common.h.
614 (report_sheap_usage): Declare.
615 (read_exe_header): Add magic numbers for x86_64.
616 (fixup_executable): Fix printf format specifier for unsigned long
617 argument.
618
5a49b79c
DA
6192013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
620
621 * frame.h (struct frame): Put menu_bar_window under #ifdef
622 because this member is not needed when X toolkit is in use.
623 (fset_menu_bar_window):
624 * dispnew.c (clear_current_matrices, clear_desired_matrices)
625 (free_glyphs, update_frame):
626 * xdisp.c (expose_frame): Likewise.
627 (display_menu_bar): Likewise. Remove redundant eassert.
628 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
629 toolkit is in use.
630
d6723bf7
PE
6312013-03-21 Paul Eggert <eggert@cs.ucla.edu>
632
7b1123d8
PE
633 Use functions and constants to manipulate Lisp_Save_Value objects.
634 This replaces code that used macros and strings and token-pasting.
635 The change makes the C source a bit easier to follow,
636 and shrinks the Emacs executable a bit.
637 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
638 (make_save_value): Change 1st arg from string to enum. All callers
639 changed.
640 (INTX): Remove.
641 (mark_object): Use if, not #if, for GC_MARK_STACK.
642 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
643 (XSAVE_OBJECT): Now functions, not macros.
644 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
645 the constant was never used.
646 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
647 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
648 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
649 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
650 New constants.
651 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
652 type3 with a single member save_type. All uses changed.
653 (save_type, set_save_pointer, set_save_integer): New functions.
654 * print.c (PRINTX): Remove.
655
d6723bf7
PE
656 * alloc.c: Remove redundant static declarations.
657
5f24fa51
DA
6582013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
659
660 * window.h (struct window): Convert left_col, top_line, total_lines
661 and total_cols from Lisp_Objects to integers. Adjust comments.
662 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
663 Remove.
664 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
665 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
666 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
667 Adjust users where appropriate.
668
42143acd
DA
6692013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
670
671 * frame.h (struct frame): Drop resx and resy because the same data is
672 available from window system-specific output context. Adjust users.
562c6ee9
SM
673 (default_pixels_per_inch_x, default_pixels_per_inch_y):
674 New functions to provide defaults when no window system available.
42143acd 675 (FRAME_RES_X, FRAME_RES_Y): New macros.
562c6ee9 676 (NUMVAL): Move from xdisp.c.
42143acd
DA
677 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
678 (Ffont_face_attributes, Fopen_font):
679 * image.c (gs_load):
680 * w32font.c (fill_in_logfont):
681 * xdisp.c (calc_pixel_width_or_height):
682 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
683 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
684
c0a17406
KH
6852013-03-20 Kenichi Handa <handa@gnu.org>
686
687 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
688 to 1 (temporary workaround until a bug related to ASCII
689 optimization is fixed).
690
095d384d
DA
6912013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
692
693 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
694 Signal error if window is not internal. Adjust docstring.
695 (delete_all_child_windows): Use combination_limit to save the buffer.
696 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
697 * print.c (syms_of_print): Initialize debugging output not here...
698 (init_print_once): ...but in a new function here.
699 * lisp.h (init_print_once): Add prototype.
700 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 701
748fa866
DA
7022013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
703
704 * window.c (window_resize_check, window_resize_apply)
705 (window_from_coordinates, recombine_windows, set_window_buffer)
706 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
707 (Fsplit_window_internal, Fdelete_window_internal)
708 (freeze_window_starts): Use bool for booleans.
709 * window.h (window_frame_coordinates, resize_frame_windows)
710 (freeze_window_starts, set_window_buffer): Adjust prototypes.
711
81519fd2
SM
7122013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
713
714 * dispnew.c (bitch_at_user): Use `user-error'.
715
6db423a9
KB
7162013-03-17 Ken Brown <kbrown@cornell.edu>
717
718 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
719 as return type of image_background. (Bug#13981)
720 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
721
8f2906f5
JD
7222013-03-16 Jan Djärv <jan.h.d@swipnet.se>
723
960ce480 724 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 725 (ns_select): Don't return with result uninitialized.
960ce480 726
8f2906f5
JD
727 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
728 and getDirectory.
729
81519fd2
SM
730 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
731 New functions.
8f2906f5
JD
732 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
733 directories. If filename is nil, get directory name (Bug#13932).
734 Use getFilename and getDirectory.
735 (getFilename, getDirectory): New methods for EmacsSavePanel and
736 EmacsOpenPanel.
737 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
738
cded56c1
PE
7392013-03-15 Paul Eggert <eggert@cs.ucla.edu>
740
741 * coding.c (decode_coding_gap): Fix typo caught by static checking.
742
251e9147 7432013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
744
745 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
746 (adjust_after_replace): Make it back to static. Delete the third
747 arg text_at_gap_tail. Cancel the code for handling it.
748
749 * coding.h (struct coding_system): New member eol_seen.
750
751 * coding.c (detect_ascii): New function.
752 (detect_coding): Set coding->head_ascii and coding->eol_seen only
753 when the source bytes are actually scanned. On detecting for
754 coding_category_utf_8_auto, call detect_ascii instead of scanning
755 source bytes directly.
756 (produce_chars): Call insert_from_gap with the new arg 0.
757 (encode_coding): Likewise.
758 (decode_coding_gap): Control ASCII optimization by the variable
759 disable_ascii_optimization instead of #ifndef .. #endif.
760 Deccode EOL format according to coding->eol_seen.
761 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
762 variable.
763
8a44e6d1
KH
764 * lisp.h (adjust_after_replace): Cancel externing it.
765 (insert_from_gap): Adjust prototype.
766
5f795e34
EZ
7672013-03-15 Eli Zaretskii <eliz@gnu.org>
768
769 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
770 FULLSCREEN_MAXIMIZED. (Bug#13935)
771
f258b4be
DA
7722013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
773
774 * region-cache.c (find_cache_boundary, move_cache_gap)
775 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
776 Simplify debugging check and convert to eassert. Adjust comment.
777 (pp_cache): Put under ENABLE_CHECKING.
778
a5cc4dde
EZ
7792013-03-14 Eli Zaretskii <eliz@gnu.org>
780
781 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
782 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
783 and WM_ACTIVATEAPP.
784 (w32fullscreen_hook): If the frame is visible, reset
785 f->want_fullscreen flag after changing the frame size. If the
786 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
787 (Bug#13953)
788
3fc5e44a
DC
7892013-03-13 Daniel Colascione <dancol@dancol.org>
790
791 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
792 too so that these builds can use Cygwin's file conversion
793 functions. (We've been building and linking cygw32.o all along
794 and just not using it.)
795
47d7532e
PE
7962013-03-13 Paul Eggert <eggert@cs.ucla.edu>
797
798 File synchronization fixes (Bug#13944).
799 * Makefile.in (LIB_FDATASYNC): New macro.
800 (LIBES): Use it.
801 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
802 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
803 Don't worry about HAVE_FSYNC, since a substitute fsync is
804 available if the system lacks one.
805 (Fwrite_regin): Retry fsync if interrupted.
806
c7ffccaf
EZ
8072013-03-13 Eli Zaretskii <eliz@gnu.org>
808
4e2df81d 809 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
810 activated, call w32fullscreen_hook, to make sure the new frame
811 dimensions are in effect. (Bug#13937)
812
8a7debc1
DA
8132013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
814
815 * xdisp.c (init_iterator): Simplify because both character and byte
816 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
817 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
818 character and byte positions can be obtained from marker.
8a7debc1 819
7fd8c501
PE
8202013-03-13 Paul Eggert <eggert@cs.ucla.edu>
821
d9df6f40
PE
822 Static checking by Sun C 5.12.
823 * alloc.c (buffer_memory_full) [REL_ALLOC]:
824 * bytecode.c (exec_byte_code):
825 * dispnew.c (init_display):
826 * eval.c (error):
827 * fileio.c (Fsubstitute_in_file_name):
828 * keyboard.c (Fevent_convert_list):
829 * keymap.c (Fsingle_key_description):
830 * term.c (maybe_fatal, fatal):
831 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
832 * xsmfns.c (Fhandle_save_session):
833 Omit unreachable code.
834 * keymap.c (map_keymap_char_table_item): Cast void * to
835 a function pointer type; the C Standard requires this.
836
7fd8c501
PE
837 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
838 Include <sys/param.h> unconditionally, as that works elsewhere and
839 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
840 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
841 and FreeBSD now.
842
cb0290df
PE
8432013-03-11 Paul Eggert <eggert@cs.ucla.edu>
844
845 * insdel.c (adjust_after_replace): Use bool for boolean.
846
cbae07d5
SM
8472013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
848
849 * keyboard.c: Move keyboard decoding to read_key_sequence.
850 (decode_keyboard_code): Remove.
851 (tty_read_avail_input): Don't try to decode input.
852 (read_decoded_char): New function.
853 (read_key_sequence): Use it.
854
819e2da9
DC
8552013-03-10 Daniel Colascione <dancol@dancol.org>
856
857 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
858 (GUI_SDATA, guichar_t): Macros to abstract out differences between
859 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
860 w32fns.c.
861
862 * w32term.c (construct_drag_n_drop): Use the above macros to make
863 drag-and-drop work for non-ASCII filenames in cygw32 builds.
864
865 * w32fns.c (x_set_name, x_set_title): Use the above macros to
866 properly display non-ASCII frame titles in cygw32 builds.
867
868 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
869 call ShellExecute in cygw32 builds.
870
871 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
872 common file dialog code.
873
874 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
875 can just use du like other systems.
876
877 * coding.c (from_unicode_buffer): Declare.
878 * coding.c (from_unicode_buffer): Implement.
879
99ec1647
SM
8802013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
881
d2e24f92
SM
882 * lread.c: Minor cleanup.
883 (FROM_FILE_P): New macro.
884 (skip_dyn_bytes, unreadchar, read1): Use it.
885 (read_list): Consolidate duplicated code.
886
99ec1647
SM
887 * bytecode.c (struct byte_stack): Remove `constants' when unused.
888
138c0ae8
EZ
8892013-03-10 Eli Zaretskii <eliz@gnu.org>
890
891 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
892 (redisplay_internal, set_cursor_from_row, try_window)
893 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
894 (display_line, notice_overwritten_cursor)
99ec1647
SM
895 (mouse_face_from_buffer_pos, note_mouse_highlight):
896 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 897 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
898 (mouse_face_from_string_pos, fast_find_string_pos):
899 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
900
901 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
902
903 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
904
905 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
906 MATRIX_MODE_LINE_ROW.
907
908 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
909
c230dd7d
KH
9102013-03-10 handa <handa@gnu.org>
911
912 * lisp.h (adjust_after_replace): Extern it.
913
914 * coding.c (detect_coding): Cound the heading ASCII bytes in the
915 case of detection for coding_category_utf_8_auto.
99ec1647
SM
916 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
917 Skip decoding if all bytes are ASCII.
c230dd7d
KH
918
919 * insdel.c (adjust_after_replace): Make it public. New arg
920 text_at_gap_tail.
921 (adjust_after_insert): Call adjust_after_replace with the new arg
922 value 0.
923
27a98a62
SM
9242013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
925
926 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
927 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
928 from Elisp via unread-command-events.
929
930 * keyboard.c (access_keymap_keyremap): Accept nil return value from
931 functions to mean "no change".
932
457882c2
PE
9332013-03-08 Paul Eggert <eggert@cs.ucla.edu>
934
935 region-cache.c, scroll.c, search.c: Use bool for booleans.
936 * lisp.h (compile_pattern):
937 * scroll.c (do_scrolling, do_direct_scrolling):
938 * search.c (struct regexp_cache, compile_pattern_1)
939 (compile_pattern, string_match_1, search_command)
940 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
941 (search_regs_saved, Fregexp_quote):
942 Use bool for boolean.
943 * region-cache.c (region_cache_forward, region_cache_backward):
944 Fix comments to match code: these functions return int, not boolean.
945
b5426561
DA
9462013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
947
948 * search.c (find_newline): Accept start and end byte positions
949 as arguments and allow -1 if not known.
950 (find_newline_no_quit): Likewise for start position.
951 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
952 * bidi.c (bidi_find_paragraph_start): Pass byte position to
953 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
954 * editfns.c (Fconstrain_to_field): Break long line.
955 Adjust call to find_newline.
b5426561
DA
956 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
957 Use DEC_BOTH to start next search from the previous buffer
958 position, where appropriate.
959 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
960 (get_visually_first_element, move_it_vertically_backward): Likewise.
961 Obtain byte position from the display iterator, where appropriate.
962
0bce5d9e
PE
9632013-03-08 Paul Eggert <eggert@cs.ucla.edu>
964
965 print.c, process.c: Use bool for booleans.
966 * lisp.h (wait_reading_process_output):
967 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
968 (strout, debug_output_compilation_hack, float_to_string, print)
969 (print_object):
970 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
971 (decode_status, status_message, create_process, create_pty)
972 (Fmake_network_process, Fnetwork_interface_info)
973 (wait_reading_process_output, read_process_output)
974 (write_queue_push, write_queue_pop, process_send_signal)
975 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
976 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
977 Use bool for booleans.
978 * process.c (Fnetwork_interface_list): Remove unused local.
979 (connect_counter): Now EMACS_INT, not int.
980
36075a19
DA
9812013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
982
983 * bidi.c (bidi_fetch_char): Swap first and second arguments
984 to match other functions accepting character and byte positions.
985 Adjust comment.
986 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
987 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
988 when you need just to move to the previous buffer position.
989 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
990
4aae1914
EZ
9912013-03-07 Eli Zaretskii <eliz@gnu.org>
992
993 * .gdbinit (prowlims): Display the enabled_p flag of the row.
994
c54aa166
DA
9952013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
996
997 Avoid character to byte conversions in motion subroutines.
998 * indent.h (compute_motion, vmotion): Add byte position argument.
999 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1000 Add eassert.
1001 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1002 Use list5 for return value.
1003 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1004 Adjust comments, style and calls to compute_motion.
1005 (Fvertical_motion): Adjust call to vmotion.
1006 * window.c (Fdelete_other_windows_internal): Record window start
1007 byte position and adjust call to vmotion.
1008 (window_scroll_line_based): Likewise with call to compute_motion.
1009 Use SET_PT_BOTH.
1010 (Frecenter): Adjust calls to vmotion.
1011
3de717bd
DA
10122013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1013
1014 * lisp.h (list2i, list3i): New functions.
1015 (list4i): Move from window.c and make LISP_INLINE.
1016 * editfns.c (make_lisp_time):
1017 * fns.c (Flocale_info):
1018 * keyboard.c (parse_modifiers):
1019 * xterm.c (x_ewmh_activate_frame): Use list2i.
1020 * instel.c (signal_after_change):
1021 * nsfns.m (Fx_server_version, Fxw_color_values):
1022 * w32fns.c (Fxw_color_values, Fx_server_version):
1023 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1024 * fileio.c (Fvisited_file_modtime):
1025 * nsfns.m (Fns_display_usable_bounds):
1026 * w32.c (ltime): Use list4i.
1027
d26e478e
EZ
10282013-03-06 Eli Zaretskii <eliz@gnu.org>
1029
a611149e
EZ
1030 * search.c (find_newline_no_quit): Rename from find_next_newline.
1031 Add commentary.
1032
1033 * lisp.h (find_newline_no_quit): Rename prototype.
1034
1035 * xdisp.c (back_to_previous_line_start)
1036 (forward_to_next_line_start, get_visually_first_element)
1037 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1038 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1039 * bidi.c (bidi_find_paragraph_start): Callers of
1040 find_newline_no_quit changed.
1041
d26e478e
EZ
1042 * msdos.c: Change encoding to cp850. (Bug#13879)
1043 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1044
1af1a51a
DA
10452013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1046
1047 Coding system support cleanup and minor refactoring.
1048 * coding.h (enum coding_result_code): Remove
1049 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1050 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1051 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1052 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1053 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1054 (decode_coding_region, encode_coding_region, decode_coding_string):
1055 Remove unused compatibility macros.
1056 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1057 (record_conversion_result): Adjust user.
1058 (syms_of_coding): Likewise.
1059 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1060 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1061 (decode_coding_object): Simplify since xrealloc never returns NULL.
1062 Add eassert.
1063
0bafabe7 10642013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 1065
9b1c3271 1066 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
1067 * sysdep.c (list_system_processes)
1068 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 1069 Make it a stub in this case; otherwise the build might fail,
0845a75c 1070 and this code hasn't been tested on such hosts anyway.
725eb027 1071 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
1072 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1073 and analyzed by Jérémie Courrèges-Anglas in
1074 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 1075
ffc65bee
DA
10762013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1077
1078 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1079 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1080 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1081 * bidi.c (bidi_find_paragraph_start): Likewise.
1082 * indent.c (vmotion): Likewise.
1083
70743157
PE
10842013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1085
1086 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1087 * filelock.c: Include <c-ctype.h>.
1088 (MAX_LFINFO): New top-level constant.
1089 (lock_info_type): Remove members pid, boot_time. Add members at,
1090 dot, colon. Change user member to be the entire buffer, not a
1091 pointer. This allows us to handle the case where a foreign
1092 pid or boot time exceeds the local range. All uses changed.
1093 (LINKS_MIGHT_NOT_WORK): New constant.
1094 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1095 (defined_WINDOWSNT): Remove.
1096 (MAKE_LOCK_NAME, file_in_lock_file_name):
1097 Always use .#FILE (not .#-FILE) for the file lock,
1098 even if it is a regular file.
1099 (rename_lock_file): New function.
1100 (create_lock_file): Use it.
1101 (create_lock_file, read_lock_data):
1102 Prefer a symbolic link for the lock file, falling back on a
1103 regular file if symlinks don't work. Do not try to create
1104 symlinks on MS-Windows, due to security hassles. Stick with
1105 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1106 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1107 host may be using a Windowsish file system, and cannot use
1108 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1109 doesn't work. Don't fail merely because of a symlink-contents
1110 length limit in the current file system; fall back on regular
1111 files. Increase the symlink contents length limit to 8 KiB, this
1112 should be big enough for any real use and doesn't crunch the
1113 stack.
1114 (create_lock_file, lock_file_1, read_lock_data):
1115 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1116 (lock_file_1): Return error number, not bool. All callers changed.
1117 (ELOOP): New macro, if not already defined.
1118 (read_lock_data): Return size of lock file contents, not Lisp object.
1119 All callers changed. Handle a race condition if some other process
1120 replaces a regular-file lock with a symlink lock or vice versa,
1121 while we're trying to read the lock.
1122 (current_lock_owner): Parse contents more carefully, to help avoid
1123 confusing a regular-file lock with some other application's use
1124 of the file. Check for lock file contents being too long, or
1125 not parsing correctly.
1126 (current_lock_owner, lock_file):
1127 Allow foreign pid and boot times that exceed the local range.
1128 (current_lock_owner, lock_if_free, lock_file):
1129 Simplify allocation of lock file contents.
1130 * w32.c (sys_rename_replace): New function, containing most of
1131 the contents of the old sys_rename.
1132 (sys_rename): Use it.
1133 (fchmod): New dummy function.
1134 * w32.h (sys_rename_replace, fchmod): New decls.
1135
05e193f1
EZ
11362013-03-05 Eli Zaretskii <eliz@gnu.org>
1137
1138 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1139 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1140 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1141 <dmantipov@yandex.ru>.
1142
3bfc46eb
DA
11432013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1144
1145 * composite.c (get_composition_id, fill_gstring_header):
1146 Use make_uninit_vector where appropriate.
1147 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1148 * xselect.c (clean_local_selection_data): Likewise.
1149
84ac6f9d
PE
11502013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1151
1152 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1153 * image.c (imagemagick_load_image): Calculate height and width
1154 after flattening the image, not before.
1155
42926ec8
DA
11562013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1157
1158 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1159 * ftfont.c (ftfont_shape_by_flt): Likewise.
1160 * w32uniscribe.c (uniscribe_shape): Likewise.
1161
b5029e23
PE
11622013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1163
1164 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1165 The old approach, which fell back on DIR/.#FILE.0 through
1166 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1167 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1168 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1169 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1170 because the locking mechanism was never reliable in that case).
1171 This patch fixes this and other bugs discovered by a code
1172 inspection that was prompted by
1173 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1174 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1175 to avoid interoperability problems between the MS-Windows and
1176 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1177 instances of Emacs now ignore each others' locks.
1178 * filelock.c (defined_WINDOWSNT): New constant.
1179 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1180 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1181 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1182 regular files on MS-Windows hosts.
1183 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1184 Use SAFE_ALLOCA to avoid problems with long file names.
1185 (MAX_LFINFO): Now a local constant, not a global macro.
1186 (IS_LOCK_FILE): Remove.
1187 (lock_file_1): Don't inspect errno if symlink call succeeds;
1188 that's not portable.
1189 (lock_file): Document that this function can return if lock
1190 creation fails.
2db41375 1191 (lock_file): Don't access freed storage.
b5029e23 1192
b270d116
AS
11932013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1194
1195 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1196
81c23309
PE
11972013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1198
1199 * textprop.c: Use bool for booleans.
1200 (validate_interval_range, Fadd_text_properties)
1201 (Fremove_text_properties): Prefer bool to int when either works.
1202
18f2ac09
EZ
12032013-03-02 Eli Zaretskii <eliz@gnu.org>
1204
27a98a62
SM
1205 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1206 If the interval tree changes as a side effect of calling
18f2ac09
EZ
1207 modify_region, re-do processing starting from the call to
1208 validate_interval_range. (Bug#13743)
1209
929aeac6 12102013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
1211
1212 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1213 (Bug#13546).
1214
531e70ec
EZ
12152013-02-27 Eli Zaretskii <eliz@gnu.org>
1216
1217 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1218 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1219 access to the lock file until it is written and closed.
1220 (Bug#13807)
1221
6e65b9cc
PE
12222013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1223
1224 * callint.c (Qcall_interactively):
1225 * macros.c (Qexecute_kbd_macro):
1226 Now static.
1227
3b166f09
BG
12282013-02-26 Bastien Guerry <bzg@gnu.org>
1229
1230 * window.c (Frecenter): Tiny docstring enhancement.
1231
ecc0fdd4
PE
12322013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1233
1234 Minor textprop integer cleanup.
1235 * intervals.h, textprop.c (add_text_properties_from_list):
1236 Return void, not int, since nobody uses the return value.
1237 * textprop.c (validate_plist, add_properties, remove_properties)
1238 (Fadd_text_properties):
1239 Don't assume list length fits in int.
1240 (interval_has_all_properties, interval_has_some_properties)
1241 (interval_has_some_properties_list, add_properties, remove_properties)
1242 (Fadd_text_properties, Fremove_text_properties)
1243 (Fremove_list_of_text_properties, text_property_stickiness):
1244 Use bool for booleans.
1245 (Fadd_text_properties, Fremove_text_properties):
1246 (Fremove_list_of_text_properties):
1247 Reindent do-while as per GNU style.
1248
0248b0d7
EZ
12492013-02-25 Eli Zaretskii <eliz@gnu.org>
1250
343a2aef
EZ
1251 Implement CLASH_DETECTION for MS-Windows.
1252
1253 * filelock.c [WINDOWSNT]: Include w32.h.
1254 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1255 function of that name. Up-case the macro arguments.
1256 (IS_LOCK_FILE): New macro.
1257 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1258 (create_lock_file): New function, with body extracted from
1259 lock_file_1.
1260 [WINDOWSNT]: Implement lock files by writing a regular file with
1261 the lock information as its contents.
1262 (read_lock_data): New function, on Posix platforms just calls
1263 emacs_readlinkat.
1264 [WINDOWSNT]: Read the lock info from the file.
1265 (current_lock_owner): Call read_lock_data instead of calling
1266 emacs_readlinkat directly.
1267 (lock_file) [WINDOWSNT]: Run the file name through
1268 dostounix_filename.
1269
1270 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1271 just check if the process by that PID exists.
1272
1273 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1274 also present, as doing so will fail to error out if the file
1275 already exists.
1276
1277 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1278
0248b0d7
EZ
1279 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1280 (Fremove_list_of_text_properties): Skip all of the intervals in
1281 the region between START and END that already have resp. don't
27a98a62
SM
1282 have the requested properties, not just the first one.
1283 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
1284 properties. (Bug#13743)
1285
b5071fc7
SM
12862013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1287
1288 * callint.c (Fcall_interactively): Use the right lexical environment
1289 for `interactive' specs (bug#13811).
1290 * eval.c (Feval): Accept a lexical environment.
1291
1ddc2bd6
PE
12922013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1293
1294 Simplify data_start configuration (Bug#13783).
1295 This is a followon simplification to the fix for Bug#13650.
1296 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1297 (START_FILES): Remove. All uses removed.
1298 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1299 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1300 (buildobj.h): Use it.
1301 ($(ALLOBJS)): Depend on globals.h.
1302 (temacs$(EXEEXT)): Use $(ALLOBJS).
1303 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1304 * deps.mk (vm-limit.o):
1305 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1306 Do not depend on mem-limits.h.
1307 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1308 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1309 [__GNUC__ && !ORDINARY_LINK]: Remove.
1310 * mem-limits.h, pre-crt0.c: Remove.
1311 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1312 * unexcoff.c (etext): New decl.
1313 (make_hdr): Use DATA_START instead of start_of_data.
1314 * vm-limit.c: Move most of mem-limits.h's contents here.
1315 (data_start): New decl. It's OK if this is approximate,
1316 so simplify-away some unnecessary exactness.
1317 (POINTER): Remove; all uses removed.
1318 (data_space_start): Now char *, to avoid casts.
1319 (exceeds_lisp_ptr): New function, replacing the old
1320 EXCEEDS_LISP_PTR macro. All uses changed.
1321 (check_memory_limits): Simplify and remove casts.
1322 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1323 (memory_warnings): Use data_start instead of start_of_data.
1324
51aa2a8b
AS
13252013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1326
1327 * xdisp.c (set_message): Only check for debug-on-message if STRING
1328 is a string. (Bug#13797)
1329
1938d88c
PE
13302013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1331
1332 Fix regression introduced by July 10 filelock.c patch.
1333 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1334 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1335 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1336 and diagnosed by Andreas Schwab in
1337 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1338
fcee5028
PE
13392013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1340
1341 Assume C89 or better.
1342 * ralloc.c (SIZE, POINTER, NIL):
1343 * vm-limit.c (POINTER):
1344 Remove, replacing all uses with C89 equivalents. These old
1345 symbols were present only for porting to pre-C89 platforms.
1346
d78cf5ed
CB
13472013-02-22 Claudio Bley <claudio.bley@gmail.com>
1348
1349 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1350 This avoids warning messages reported as part of Bug#13546.
1351
6bcd97a4
KB
13522013-02-21 Ken Brown <kbrown@cornell.edu>
1353
1354 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1355
b6c2bfff
SM
13562013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1357
e11dacb5
SM
1358 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1359
b6c2bfff
SM
1360 * keyboard.c (Qcommand_execute): New var.
1361 (command_loop_1, read_char): Use it.
1362 (Fcommand_execute): Remove, replace by an Elisp implementation.
1363 (syms_of_keyboard): Adjust accordingly.
1364
f4ad7ea1 13652013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 1366
d69f1120
DC
1367 * sheap.c (report_sheap_usage): Use message, not message1, so
1368 that we don't try to create a buffer while we're in the middle
1369 of dumping Emacs. Explain why.
b6c2bfff 1370
2a14a4f1 13712013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 1372
2a14a4f1
DA
1373 * search.c (find_newline): Return byte position in bytepos.
1374 Adjust comment.
b6c2bfff
SM
1375 (find_next_newline_no_quit, find_before_next_newline):
1376 Add bytepos argument.
2a14a4f1
DA
1377 * lisp.h (find_newline, find_next_newline_no_quit)
1378 (find_before_next_newline): Adjust prototypes.
1379 * bidi.c (bidi_find_paragraph_start):
1380 * editfns.c (Fconstrain_to_field, Fline_end_position):
1381 * indent.c (compute_motion, vmotion):
1382 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1383 (get_visually_first_element, move_it_vertically_backward):
1384 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1385
872faefb 13862013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
1387
1388 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1389 resources were not orderly released.
1390
fd80c659
EZ
13912013-02-17 Eli Zaretskii <eliz@gnu.org>
1392
1393 * xdisp.c (x_draw_vertical_border): For a window that is neither
1394 the leftmost nor the rightmost, redraw both the left and the right
1395 vertical borders. (Bug#13723)
1396
2f73da9c
SM
13972013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1398
1399 * xml.c (init_libxml2_functions):
1400 * sound.c (sound_warning):
1401 * sheap.c (report_sheap_usage):
1402 * process.c (wait_reading_process_output):
1403 * msdos.c (XMenuActivate):
1404 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1405 * keyboard.c (top_level_1):
1406 * editfns.c (Fmessage, Fmessage_box):
1407 * callint.c (Fcall_interactively):
1408 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1409
fd9547e8
JD
14102013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1411
1412 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
1413 * frame.c (syms_of_frame): ... to here.
1414
f277993b
EZ
14152013-02-16 Eli Zaretskii <eliz@gnu.org>
1416
c7939585
EZ
1417 * w32.c (sys_chown): Remove unused function.
1418
cd91fb4b
EZ
1419 * w32term.c <input_signal_count>: Declare 'volatile'
1420 unconditionally. (Bug#9066)
1421
f277993b
EZ
1422 * w32.c (set_errno): Reset h_errno and don't set it to any other
1423 value. Set errno instead.
1424 (check_errno): Reset h_errno.
1425 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1426 (sys_gethostname, sys_getservbyname, sys_getpeername)
1427 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1428 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1429 h_errno.
1430 (sys_gethostbyname): Set h_errno only errors detected.
1431
e454145b
PE
14322013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1433
1434 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1435
bcf7fe2a
EZ
14362013-02-15 Eli Zaretskii <eliz@gnu.org>
1437
ef9c57e2
EZ
1438 * keyboard.c (read_char): Fix calculation of auto-save time out
1439 when auto-save-timeout is less than 4. (Bug#13720)
1440
ef862e20 1441 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 1442 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 1443
bcf7fe2a
EZ
1444 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1445 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1446 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1447 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1448 make sure errno is set to an appropriate value. (Bug#13546)
1449 (socket_to_fd): Add assertion against indexing fd_info[] with a
1450 value that is out of bounds.
1451 (sys_accept): If fd is negative, do not set up the child_process
1452 structure for reading.
1453
0063fdb1
DA
14542013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1455
1456 * composite.c (fill_gstring_header): Remove useless prototype.
1457 Break long line.
1458 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1459 * print.c (PRINTDECLARE, print_object):
1460 * search.c (compile_pattern, fast_looking_at, search_buffer):
1461 (simple_search, boyer_moore, Freplace_match):
1462 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1463 (get_overlay_arrow_glyph_row, display_mode_element):
1464 (decode_mode_spec_coding, message3):
1465 * xfaces.c (face_at_string_position): Use bool for booleans.
1466 Adjust comments.
1467
648e5523 14682013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 1469
35b3a27e
PE
1470 Fix AIX port (Bug#13650).
1471 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1472 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1473 was #undeffed earlier, so it cannot be used as a macro here.
1474 Use the constant and not the macro.
35b3a27e 1475
648e5523 14762013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 1477
0e4e7b74
EZ
1478 * w32proc.c (new_child): If no vacant slots are found in
1479 child_procs[], make another pass looking for slots whose process
1480 has exited or died. (Bug#13546)
1481
6e432f0c
EZ
1482 * w32.c (sys_pipe): When failing due to file descriptors above
1483 MAXDESC, set errno to EMFILE.
1484 (_sys_read_ahead): Update cp->status when failing to read serial
1485 communications input, so that the status doesn't stay at
1486 STATUS_READ_IN_PROGRESS. (Bug#13546)
1487
51b3a99c
JD
14882013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1489
1490 * gtkutil.c (tb_size_cb): New function.
1491 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1492
e31560a7
SM
14932013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1494
1495 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1496 an event.
1497
fe336261
SM
14982013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1499
1500 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1501
5a655b9f
DA
15022013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1503
1504 * font.c (font_range): Add pos_byte argument. Adjust comment
1505 and break long line.
1506 * font.h (font_range): Adjust prototype.
1507 * composite.c (autocmp_chars): Pass byte position to font_range.
1508 Break long line. Remove useless prototype and format comment.
1509
1a359750
GM
15102013-02-13 Glenn Morris <rgm@gnu.org>
1511
1512 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1513
01fcc3a5 15142013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 1515
f53f992a
PE
1516 Improve AIX port some more (Bug#13650).
1517 With this, it should be as good as it was in 23.3, though it's
1518 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1519 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1520 * unexaix.c (start_of_text): Remove.
1521 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1522 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1523 (orig_load_scnptr, orig_data_scnptr):
1524 Now off_t, not long, since they are file offsets.
1525 (make_hdr): Use _data, not start_of_data ().
1526 This is the key part of the fix.
1527 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1528 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1529
4458c255
PE
1530 * pre-crt0.c (data_start): Initialize to 1.
1531 This ports to compilers that optimize the external declaration
1532 'int x = 0;' as if it were 'int x;' to shrink the executable.
1533
227be86d
PE
1534 Improve AIX port (Bug#13650).
1535 This doesn't fix the bug, but it makes progress: Emacs builds now.
1536 * unexaix.c: Include inttypes.h, stdarg.h.
1537 (report_error, report_error_1): Mark as _Noreturn.
1538 (report_error): Don't report the wrong errno.
1539 (report_error_1): Now varargs. All callers changed.
1540 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1541 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1542 (write_ptr): Use %p to print address rather than %lx and a cast
1543 to unsigned long. Grow buffer a bit, to be safer.
1544
01fcc3a5 15452013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
1546
1547 * bidi.c (bidi_resolve_neutral): After finding the next
1548 non-neutral character, accept NEUTRAL_ON type as well, because
1549 directional control characters, such as LRE and RLE, have their
1550 type converted to that by bidi_resolve_weak. This avoids aborts
1551 when LRE/RLE follows a run of neutrals.
1552 (bidi_move_to_visually_next): Assert that return value of
1553 bidi_peek_at_next_level is non-negative. Negative values will
1554 cause an infloop.
1555
83be8524
PE
15562013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1557
1558 Minor getenv-related fixes.
1559 * callproc.c (Fcall_process_region) [!DOS_NT]:
1560 Avoid unnecessary duplicate call to getenv.
1561 * callproc.c (init_callproc):
1562 * dispnew.c (init_display):
1563 * sysdep.c (sys_subshell):
1564 Omit unnecessary cast of getenv or egetenv.
1565
45b2b768
JB
15662013-02-13 Juanma Barranquero <lekktu@gmail.com>
1567
1568 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1569 Update dependencies.
1570
33b49d71
EZ
15712013-02-12 Eli Zaretskii <eliz@gnu.org>
1572
1573 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1574 marker's position.
1575 (display_line): Set w->region_showing to the value of
1576 it->region_beg_charpos, not to -1. This fixes redisplay
1577 optimization when cursor is moved up after M->. (Bug#13623)
1578 (Bug#13626)
c4131562
EZ
1579 (try_scrolling): Scroll text up more if point is too close to ZV
1580 and inside the scroll margin. This makes sure point is moved
1581 outside the scroll margin in these cases.
33b49d71
EZ
1582
1583 * window.h (struct window): region_showing can no longer be
1584 negative.
1585
b09a4810
PE
15862013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1587
a84b7c53
PE
1588 Tune by using memchr and memrchr.
1589 * doc.c (Fsnarf_documentation):
1590 * fileio.c (Fsubstitute_in_file_name):
1591 * search.c (find_newline, scan_newline):
1592 * xdisp.c (pos_visible_p, display_count_lines):
1593 Use memchr and memrchr rather than scanning byte-by-byte.
1594 * search.c (find_newline): Rename from scan_buffer.
1595 Omit first arg TARGET, as it's always '\n'. All callers changed.
1596
b09a4810
PE
1597 Clean up read_key_sequence a tiny bit more.
1598 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1599 (read_key_sequence): Remove unused locals.
1600
99d0d6dc
SM
16012013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1602
1603 Clean up read_key_sequence a bit; reread active keymaps after first event.
1604 * keyboard.c (read_char, read_char_x_menu_prompt)
1605 (read_char_minibuf_menu_prompt):
1606 Replace nmaps+maps with a single `map' arg.
1607 (follow_key): Operate on a single map.
1608 (active_maps): New function.
1609 (test_undefined): Also return true for nil bindings.
1610 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1611 a single (composed) keymap. Remember `first_event' to choose the right
1612 set of active keymaps. Recompute the set of keymaps after receiving
1613 the first event. Remove GOBBLE_FIRST_EVENT.
1614 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1615 * keyboard.h (read_char): Update declaration.
1616 * lread.c (read_filtered_event): Adjust call to read_char.
1617
f5e1b680
EZ
16182013-02-11 Eli Zaretskii <eliz@gnu.org>
1619
99d0d6dc
SM
1620 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1621 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
1622 in the window. (Bug#13675)
1623
f74de345
DA
16242013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1625
1626 * marker.c (set_marker_internal): If desired position is passed
1627 as a marker, avoid call to buf_charpos_to_bytepos.
1628 * window.c (Fset_window_point): Omit redundant type checking.
1629 (Fset_window_start): Likewise. Format comment.
1630 (window_scroll_pixel_based): Use set_marker_restricted_both
1631 with character and byte positions obtained from an iterator.
1632 (Fset_window_configuration): Use set_marker_restricted_both.
1633 * xdisp.c (message_dolog): Likewise.
1634
a4ba3963
EZ
16352013-02-10 Eli Zaretskii <eliz@gnu.org>
1636
99d0d6dc
SM
1637 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1638 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
1639 too far. This speeds up some redisplay operations. (Bug#13675)
1640
68643cde
DA
16412013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1642
1643 * syntax.c (scan_sexps_forward): Fix byte position calculation
1644 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1645
7ba11bee
PE
16462013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1647
1648 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1649 that was not needed.
1650
eff1c190
PE
16512013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1652
1653 Minor hashing refactoring.
1654 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1655 (sxhash_float): Return EMACS_UINT, for consistency with the other
1656 hash functions.
1657 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1658 non-static inline function and therefore can't use static vars.
1659 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1660 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1661 with the other hash functions.
1662
6b48c831
EZ
16632013-02-09 Eli Zaretskii <eliz@gnu.org>
1664
4dde2087
EZ
1665 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1666 XXXXXX part of the temporary file pattern is not downcased even
1667 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 1668
8549f9e8
EZ
1669 * xdisp.c (decode_mode_spec): Remove handling of %t.
1670
6b48c831
EZ
1671 * msdos.c (careadlinkatcwd): Remove.
1672
75a65c7e
SM
16732013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1674
1675 * lread.c (skip_dyn_bytes): New function (bug#12598).
1676 (read1): Use it. Use getc instead of READCHAR to read bytes.
1677 (load_each_byte): Remove. Update users.
1678
8ca30920
DA
16792013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1680
1681 * search.c (scan_buffer): Calculate end byte position just once.
1682 (scan_newline): Do not recalculate start_byte.
1683 (search_command): Use eassert.
1684 * syntax.c (struct lisp_parse_state): New member location_byte.
1685 (scan_sexps_forward): Record from_byte and avoid redundant
1686 character to byte position calculation ...
1687 (Fparse_partial_sexp): ... here. Break too long line.
1688
25721f5b
DA
16892013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1690
1691 * lisp.h (make_uninit_vector): New function.
1692 * alloc.c (Fvector, Fmake_byte_code):
1693 * ccl.c (Fregister_ccl_program):
1694 * charset.c (Fdefine_charset_internal, define_charset_internal):
1695 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1696 * composite.c (syms_of_composite):
1697 * font.c (Fquery_font, Ffont_info, syms_of_font):
1698 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1699 * ftfont.c (ftfont_shape_by_flt):
1700 * indent.c (recompute_width_table):
1701 * nsselect.m (clean_local_selection_data):
1702 * syntax.c (init_syntax_once):
1703 * w32unsubscribe.c (uniscribe_shape):
1704 * window.c (Fcurrent_window_configuration):
1705 * xfaces.c (Fx_family_fonts):
1706 * xselect.c (selection_data_to_lisp_data): Use it.
1707
9a9d91d9
DA
17082013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1709
1710 * coding.c (Fdefine_coding_system_internal): Use AREF where
1711 argument is known to be a vector.
1712 * fns.c (Flocale_info): Likewise for ASET.
1713 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1714 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1715
6871e574
JD
17162013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1717
1718 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1719 height.
1720
1721 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1722 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1723 updateCollectionBehaviour.
1724
1725 * nsterm.m (NEW_STYLE_FS): Remove.
1726 (ns_last_use_native_fullscreen): New variable.
1727 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1728 (x_set_window_size): Do not take title bar and tool bar into account
1729 if isFullscreen returns YES.
1730 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1731 (check_native_fs): New function.
1732 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1733 (ns_term_init): Remove NEW_STYLE_FS.
1734 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1735 and tool bar if isFullscreen returns NO.
1736 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1737 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1738 with HAVE_NATIVE_FS.
1739 (window:willUseFullScreenPresentationOptions:): New method.
1740 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1741 Hide toolbar if not enabled (Bug#13444).
1742 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1743 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1744 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1745 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1746 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1747 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1748 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1749 (syms_of_nsterm): Add ns-use-native-fullscreen.
1750
3f011c7f
PE
17512013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1752
1753 * fileio.c (Qchoose_write_coding_system): Now static.
1754
86f7c0fe
EZ
17552013-02-04 Eli Zaretskii <eliz@gnu.org>
1756
1757 * xdisp.c (window_buffer_changed): region_showing can be negative,
1758 which still means region is being displayed.
1759 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
1760 whole window when showing region and the mark has changed.
1761 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
1762 (display_line): If it->region_beg_charpos is non-zero, set the
1763 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1764
1765 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1766 not bitfield of 1 bit.
1767
5257b701
DC
17682013-02-03 Daniel Colascione <dancol@dancol.org>
1769
1770 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1771 daemon mode works on cygw32 when Emacs is installed and not just
1772 during development.
1773
8ea41ea9
PE
17742013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1775
1776 Avoid file time stamp bug on MS-Windows (Bug#13149).
1777 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1778 as FAT32 doesn't update time stamps when truncating them.
1779 Also, check that a file time stamp is not a multiple of 100 ns;
1780 this should catch all instances of the problem on MS-Windows,
1781 as its native file system resolution is 100 ns or worse, and
1782 checking for a non-multiple of 100 ns should impose only a small
1783 overhead on systems with ns resolution.
1784
94fbc901 17852013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 1786
e7ac588e
EZ
1787 Avoid encoding file names on MS-Windows when they need to be run
1788 through dostounix_filename.
1789 * w32.c (normalize_filename): Accept an additional argument
1790 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1791 downcase it even if w32-downcase-file-names is non-nil.
1792 (dostounix_filename): Accept an additional argument MULTIBYTE and
1793 pass it to normalize_filename.
1794 (emacs_root_dir): Adjust.
1795
1796 * msdos.h (dostounix_filename): Adjust prototype.
1797
1798 * w32.h (dostounix_filename): Adjust prototype.
1799
1800 * msdos.c (dostounix_filename): Accept an additional argument and
1801 ignore it.
1802 (init_environment): Adjust callers of dostounix_filename.
1803
1804 * fileio.c (Ffile_name_directory, file_name_as_directory)
1805 (directory_file_name, Fexpand_file_name)
1806 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1807 dostounix_filename.
1808 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1809 non-nil.
1810 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1811 variables, as egetenv is case-insensitive for DOS_NT.
1812
1813 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1814 with an encoded file name.
1815
99d0d6dc
SM
1816 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1817 Adjust calls to dostounix_filename.
e7ac588e
EZ
1818
1819 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1820
1821 * unexw32.c (unexec): Adjust call to dostounix_filename.
1822
1823 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1824
1825 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1826 dostounix_filename.
1827
1828 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1829 dostounix_filename.
1830
e7c3fb06
EZ
1831 * callproc.c (Fcall_process): Make sure program name in PATH and
1832 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1833 is passed to exec/spawnve, which fails unless the file-name
1834 encoding is UTF-8.
1835
18a80473
EZ
1836 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1837 even if w32-quote-process-args is nil.
1838
35e85499
PE
18392013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1840
1841 Fix timestamp bug when write-region appends nothing (Bug#13149).
1842 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1843 the file's time stamp doesn't change if Emacs happens to write nothing
1844 to the file, and on a buggy file system this could cause Emacs to
1845 incorrectly infer that the file system doesn't have the bug.
1846 Avoid this problem by inhibiting the inference in this case.
1847
422ff52b
DA
18482013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1849
1850 * window.h (struct window): Convert base_line_number, base_line_pos
1851 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1852 Convert region_showing member from Lisp_Object to bitfield.
1853 Remove sequence_number member. Adjust comments.
1854 * window.c (sequence_number): Remove.
1855 (make_window): Initialize column_number_displayed.
1856 * print.c (print_object): Follow the printed representation of
1857 frames and print window pointer to distinguish between windows.
1858 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1859 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1860 (wset_column_number_displayed, wset_region_showing): Remove.
1861 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1862 (try_scrolling, try_cursor_movement, redisplay_window)
1863 (try_window_reusing_current_matrix, try_window_id, display_line)
1864 (display_mode_lines, decode_mode_spec): Adjust users.
1865 * .gdbinit (pwinx): Do not print sequence_number.
1866
8654f9d7
PE
18672013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1868
1869 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1870 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1871 * dired.c: Include <fcntl.h>.
1872 (open_directory): New function, which uses open and fdopendir
1873 rather than opendir. DOS_NT platforms still use opendir, though.
1874 (directory_files_internal, file_name_completion): Use it.
1875 (file_attributes): New function, with most of the old Ffile_attributes.
1876 (directory_files_internal, Ffile_attributes): Use it.
1877 (file_attributes, file_name_completion_stat): First arg is now fd,
1878 not dir name. All uses changed. Use fstatat rather than lstat +
1879 stat.
1880 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1881 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1882 (emacs_readlinkat): New function, with much of the old
1883 Ffile_symlink_p, but with an fd argument for speed.
1884 It uses readlinkat rather than careadlinkatcwd, so that it
1885 need not assume the working directory.
1886 (Ffile_symlink_p): Use it.
1887 * filelock.c (current_lock_owner): Use emacs_readlinkat
1888 rather than emacs_readlink.
1889 * lisp.h (emacs_readlinkat): New decl.
1890 (READLINK_BUFSIZE, emacs_readlink): Remove.
1891 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1892 (emacs_norealloc_allocator, emacs_readlink): Remove.
1893 This stuff is moved to fileio.c.
1894 * w32.c (fstatat, readlinkat): New functions.
1895 (careadlinkat): Don't check that fd == AT_FDCWD.
1896 (careadlinkatcwd): Remove; no longer needed.
1897
9dbda100
GM
18982013-01-31 Glenn Morris <rgm@gnu.org>
1899
1900 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
1901 (Fwrite_region): Update for new choose_write_coding_system args.
1902 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
1903 (syms_of_fileio): Add choose-write-coding-system.
1904
3f82a88a 19052013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
1906
1907 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1908 (sys_close): Zero out the flags for the file descriptor before
1909 closing it. (Bug#13546)
1910
806fed21 1911 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
1912 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1913 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
1914 DBCS. (Bug#13553)
1915
6ee4509a
EZ
1916 * w32.c (w32_get_long_filename, init_environment, readlink):
1917 Support file names encoded in DBCS codepages.
26854e9c
EZ
1918 (readlink): Use the current file-name-coding-system, not the ANSI
1919 codepage, to decode and handle targets of symlinks.
6ee4509a 1920
cf01a359
EZ
19212013-01-28 Eli Zaretskii <eliz@gnu.org>
1922
1923 * w32.c (opendir): Now accepts a 'const char *'.
1924
6fd326b7
DA
19252013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1926
1927 Remove obsolete redisplay code. See the discussion at
1928 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1929 * dispnew.c (preemption_period, preemption_next_check): Remove.
1930 (Vredisplay_preemption_period): Likewise.
1931 (update_frame, update_single_window, update_window, update_frame_1):
1932 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1933 used, following the 2012-06-22 change.
1934
d8cd7742
EZ
19352013-01-25 Eli Zaretskii <eliz@gnu.org>
1936
1937 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1938
266fee4f
DA
19392013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1940
1941 * font.c (num_fonts): Remove the leftover from old
1942 debugging code. Adjust comment style here and there.
59e624b3
DA
1943 * insdel.c (insert_1): Remove.
1944 * lisp.h (insert_1): Remove prototype.
1945 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 1946
830e46e6 19472013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
1948
1949 * w32.c (max_filename_mbslen): New function.
1950 (normalize_filename, readdir): Use it to detect locales where ANSI
1951 encoding of file names uses a double-byte character set (DBCS).
1952 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
1953 CharNextExA, instead of incrementing a 'char *' pointer.
1954 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 1955
81abbb95
EZ
1956 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1957 request of memory reservation to 1.7GB. (Bug#13065)
1958
830e46e6 19592013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
1960
1961 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1962 at check_extra_latin label. (Bug#13505)
1963
fd3ceb09
DA
19642013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1965
1966 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1967 Avoid redundant calls to strlen.
1968
edfa7fa0
DA
19692013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1970
1971 Drop async_visible and async_iconified fields of struct frame.
1972 This is possible because async input is gone; for details, see
1973 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1974 * frame.h (struct frame): Remove async_visible and async_iconified
1975 members, convert garbaged to unsigned bitfield. Adjust comments.
1976 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1977 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1978 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1979 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1980 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1981 * w32term.c: Ditto.
1982 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1983 properly. Likewise for obscured.
1984 * xterm.c: Ditto.
266fee4f 1985 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
1986 properly.
1987 * nsterm.m: Ditto.
1988 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1989
5ad86e34
DA
19902013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1991
1992 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1993 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1994
b09cca6a
SM
19952013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1996
1997 * xdisp.c (message2, message2_nolog): Remove functions.
1998 (message3, message3_nolog): Extract nbytes and multibyteness directly
1999 from the string. Change all callers.
2000 (message3_nolog): Don't set message_enable_multibyte since set_message
2001 will reset it anyway.
2002 (message1, message1_nolog): Use message3.
2003 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2004 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2005 (set_message): Drop all but the second arg, which has to be a string.
2006 (set_message_1): Simplify now that we know that a1 is NULL and the
2007 second arg is a string.
2008 * frame.h (struct frame): Remove `message_buf' field.
2009 Use glyphs_initialized_p instead.
2010 (FRAME_MESSAGE_BUF): Remove macro.
2011 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2012 * lisp.h (message2, message2_nolog): Remove declarations.
2013 (message3, message3_nolog): Update declarations.
2014 * keyboard.c (read_char_minibuf_menu_text)
2015 (read_char_minibuf_menu_width): Remove vars.
2016 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2017 to correctly handle multibyte strings.
2018 * frame.c (delete_frame): Don't free message_buf any more.
2019 * editfns.c (message_text, message_length): Remove vars.
2020 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2021 * fileio.c (auto_save_error): Use message3 instead of message2.
2022 * dispnew.c (adjust_frame_message_buffer): Remove function.
2023
54ab1c5a
EZ
20242013-01-23 Eli Zaretskii <eliz@gnu.org>
2025
2026 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2027 real estate used for the tool bar and the menu bar.
2028
6c27465b
DA
20292013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2030
2031 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2032 hidden buffer is prepared to modification (Bug#13164).
2033
9d93ce29
DA
20342013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2035
2036 * window.h (struct window): Change window_end_valid member from
2037 Lisp_Object to a bitfield. Adjust comments.
2038 (wset_window_end_valid): Remove.
2039 * window.c (adjust_window_count): Clear window_end_valid.
2040 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2041 (Fwindow_line_height, set_window_buffer, Frecenter)
2042 (Fsplit_window_internal, Fdelete_other_windows_internal)
2043 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2044 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2045 * xdisp.c (check_window_end, reconsider_clip_changes)
2046 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2047 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2048 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2049
1dcb8ea2
DA
20502013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2051
2052 * xdisp.c (mark_window_display_accurate): Simplify the loop
2053 assuming that the only one of vchild, hchild or buffer window
2054 slots is non-nil. Call mark_window_display_accurate_1 for
2055 the leaf windows only.
2056 (mark_window_display_accurate_1): Always assume leaf window.
2057 Adjust comment.
2058
b41b8a7e
PE
20592013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2060
593a5f2e
PE
2061 * emacs.c (Qkill_emacs_hook): Now static.
2062
b41b8a7e
PE
2063 * fileio.c (Finsert_file_contents): Simplify.
2064 Remove unnecessary assignments and tests.
2065
84e5ed96
EZ
20662013-01-21 Eli Zaretskii <eliz@gnu.org>
2067
2068 * w32.c (acl_set_file): Don't test for errors unless
2069 set_file_security returns FALSE. Avoids spurious errors when
2070 saving files.
2071
2ef88fd4
DA
20722013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2073
2074 * fileio.c (Finsert_file_contents): Revert code introduced at
2075 2013-01-18 in favor of the simpler and generally better fix.
2076 Save stack space by removing 'buffer' and reusing 'read_buf'
2077 where appropriate.
2078
d7a0a7c9
PE
20792013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2080
2081 * lisp.h (eabs): Define unconditionally (Bug#13419).
2082 The old "#if !defined (eabs)" was an unnecessary revenant of back
2083 when this macro was called "abs". Document 'eabs' better.
2084
795e7a5b 20852013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
2086
2087 * fns.c (Frandom): Doc fix.
2088
59ac2d13
EZ
20892013-01-19 Eli Zaretskii <eliz@gnu.org>
2090
2091 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2092 segfault when there are lots of overlays.
2093
2094 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
2095 when there are lots of overlays.
2096 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
2097 for the details and a way to reproduce.
2098
b3fbb395
PE
20992013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2100
3a955a1f
PE
2101 * fileio.c: Use O_APPEND to append.
2102 This corresponds better to the natural interpretation of "append",
2103 and avoids the need to open the output file twice, or to invoke
2104 lseek when APPEND is neither nil nor a number.
2105 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2106 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2107 file possibly twice, and lseeking to its end; this avoids the
2108 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2109 at the same time: the combination is never needed and apparently
2110 it doesn't work with DOS_NT.
2111
21cd50b8
PE
2112 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2113 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2114
b3fbb395
PE
2115 Allow floating-point file offsets.
2116 Problem reported by Vitalie Spinu in
2117 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2118 * fileio.c (emacs_lseek): Remove.
2119 (file_offset): New function.
2120 (Finsert_file_contents, Fwrite_region): Use it.
2121
73c14218
CY
21222013-01-19 Chong Yidong <cyd@gnu.org>
2123
2124 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2125 aborting on Fsignal (Bug#13289).
2126
6a9465f3
EZ
21272013-01-19 Eli Zaretskii <eliz@gnu.org>
2128
2129 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2130 set_file_security as failure due to insufficient privileges.
2131 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 2132 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 2133
fa705c99
PE
21342013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2135
9fe43ff6
PE
2136 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2137 The bug was observed on Ubuntu operating inside a virtual machine,
2138 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2139 The workaround introduces a race condition on non-buggy hosts,
2140 but it's an unlikely race and anyway there's a nearly identical
2141 nearby race that can't be fixed.
2142 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2143 New static vars.
2144 (Fwrite_region): Test for file system time stamp bug.
2145 (init_fileio): New function.
2146 * lisp.h (init_fileio): Declare it.
2147 * emacs.c (main): Call it.
2148
fa705c99
PE
2149 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2150 and make it more consistent with other stat-failure diagnostics.
2151
e07469fa
DA
21522013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2153
99d0d6dc
SM
2154 Fix crash when inserting data from non-regular files.
2155 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
2156 for the error description produced by valgrind.
2157 * fileio.c (read_non_regular): Rename to read_contents.
2158 Free Lisp_Save_Value object used to pass parameters.
2159 (read_non_regular_quit): Rename to read_contents_quit.
2160 (Finsert_file_contents): Redesign internal file reading loop to adjust
2161 gap and end positions after each read and so help make_gap to work
2162 properly. Do not signal an I/O error too early and so do not leave
2163 not yet decoded characters in a buffer, which was the reason of
2164 redisplay crash. Use list2 to build return value. Adjust comments.
2165
67722112
PE
21662013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2167
2168 Close a race when statting and reading files (Bug#13149).
2169 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2170 This avoids a race if the file is renamed between stat and open.
2171 This race is not the problem originally noted in Bug#13149;
2172 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2173
468afbac
DA
21742013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2175
2176 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2177 objects, related functions and macros.
2178 (make_save_value): Adjust prototype.
2179 (make_save_pointer): New prototype.
2180 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2181 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2182 * alloc.c (format_save_value): Rename to make_save_value.
2183 (make_save_pointer): New function.
2184 (record_xmalloc): Use make_save_pointer.
2185 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2186 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2187 Change users of make_save_value to make_save_pointer.
2188 Likewise for format_save_value and make_save_value.
2189
0e70695a
DA
21902013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2191
2192 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2193 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2194 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2195 debugging stubs.
2196
963ea40f
PE
21972013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2198
2199 * alloc.c (free_save_value): Now static.
2200
3346c1d0
DA
22012013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2202
2203 * keymap.c (map_keymap_internal): Use format_save_value.
2204 (map_keymap_char_table_item): Adjust accordingly.
2205 * fileio.c (non_regular_fd, non_regular_inserted)
2206 (non_regular_nbytes): Remove.
99d0d6dc
SM
2207 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2208 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
2209 (read_non_regular): Use XSAVE_ macros to extract parameters.
2210 Adjust comment.
2211 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2212 format_save_value.
2213 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2214
2b30549c
DA
22152013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2216
2217 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2218 extraction from any Lisp_Save_Value slot. Add type checking.
2219 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2220 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2221 * xselect.c: All users changed.
2222
1b971ac1
DA
22232013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2224
2225 Some convenient bits to deal with Lisp_Save_Values.
2226 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2227 (allocate_misc): Remove prototype.
2228 (format_save_value): New prototype.
2229 * alloc.c (allocate_misc): Revert back to static.
2230 (format_save_value): New function to build Lisp_Save_Value
2231 object with the specified internal structure.
2232 (make_save_value): Reimplement using format_save_value.
2233 * editfns.c (save_excursion_save): Use format_save_value.
2234 (save_excursion_restore): Use XSAVE_OBJECT.
2235
c50cf2ea
PE
22362013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2237
2238 Avoid needless casts with XSAVE_POINTER.
2239 * alloc.c (mark_object) [GC_MARK_STACK]:
2240 * dired.c (directory_files_internal_unwind):
2241 * fileio.c (do_auto_save_unwind):
2242 * gtkutil.c (pop_down_dialog):
2243 * keymap.c (map_keymap_char_table_item):
2244 * lread.c (load_unwind):
2245 * nsmenu.m (pop_down_menu):
2246 * print.c (print_object) [GC_MARK_STACK]:
2247 * xfns.c (clean_up_file_dialog):
2248 * xmenu.c (cleanup_widget_value_tree):
2249 Omit casts between XSAVE_POINTER and a pointer type.
2250
9d5a1260
DA
22512013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2252
2253 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2254 * eval.c (eval_sub): Protect `form' from being GCed before its
2255 car and cdr becomes protected with the backtrace entry.
2256
73ebd38f
DA
22572013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2258
2259 Make Lisp_Save_Value more versatile storage for up to four objects.
2260 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2261 (struct Lisp_Save_Value): New layout. Adjust comments.
2262 (XSAVE_POINTER): New macro.
2263 (XSAVE_INTEGER): Likewise.
2264 (allocate_misc): Add prototype.
2265 (free_misc): Likewise.
2266 * alloc.c (allocate_misc): Now global.
2267 (free_misc): Likewise. Adjust comment.
2268 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2269 (free_save_value): Likewise.
2270 (mark_object): Likewise.
2271 * editfns.c (save_excursion_save): Pack everything within
2272 Lisp_Save_Value and so avoid xmalloc.
2273 (save_excursion_restore): Adjust to match new layout. Use free_misc
2274 because we do not allocate extra memory any more. Add eassert.
2275 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2276 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2277 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2278 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2279 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2280
b826986f
JD
22812013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2282
2283 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2284 (nsfont_draw): Remove disabling of LCD smoothing.
2285 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 2286 Bug#11484 with LCD smoothing on.
b826986f 2287
c0511b57 22882013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 2289
b6f960a0
PE
2290 Fix SIGDANGER handlers, for AIX (Bug#13408).
2291 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2292 Move handlers here from emacs.c; they were out of place.
2293
616763d5
JD
22942013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2295
2296 * xterm.c (syms_of_xterm): Adjust documentation for
2297 scroll-bar-adjust-thumb-portion.
2298
0b59090b 22992012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
2300
2301 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2302 determine whether scroll bar thumb size should be adjusted or
2303 not. Use variable for MOTIF.
2304
2305 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2306 GTK.
2307
7bc916b4
JD
23082013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2309
eac4d08f
JD
2310 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2311 event is generated.
2312 (doCommandBySelector:): Set processingCompose to NO.
2313
7bc916b4
JD
2314 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2315 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2316 (nsfont_list_family): Add block/unblock_input calls.
2317 (nsfont_open): Move block_input earlier. Add unblock_input before early
2318 return.
2319 (nsfont_draw): Add block/unblock_input calls.
2320
bdc9b756
PE
23212013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2322
2323 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2324 for old_charpos and old_bytepos.
2325
ee56a6dc
PE
23262013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2327
2328 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2329 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2330 Clear tzvalbuf_in_environ if this workaround is in effect.
2331 Problem and fix reported by Kazuhiro Ito.
2332
9fc9a531
AH
23332013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2334
99d0d6dc
SM
2335 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2336 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
2337
2338 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2339 doc string cross-reference(s).
2340
2341 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2342 string cross-reference(s).
2343
6020559a
DA
23442013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2345
2346 Avoid unnecessary byte position calculation for the gap movement.
2347 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2348 anyway, all of them should use move_gap_both instead.
2349 * lisp.h (move_gap): Remove prototype.
2350 * insdel.c (move_gap): Remove.
2351 (move_gap_both): Add eassert.
2352 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2353 * xml.c (parse_region): Likewise.
2354
b8956427
PE
23552013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2356
2357 emacsclient -t should not suspend Emacs server (Bug#13387)
2358 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2359 New functions.
2360 * term.c (init_tty): Use them instead of rolling our own code.
2361 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2362 switches from 'signal' to 'pthread_sigmask', which is safer in
2363 multithreaded applications.
2364 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2365 which has already arranged for that.
2366 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2367 This is the main part of the bug fix.
2368
0b59090b 23692013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
2370
2371 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2372 x_last_font_name (Bug#13403).
2373
58cc0a01
DA
23742013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2375
2376 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2377 the type of per-buffer values where appropriate.
2378 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2379 predicate, which is how it's really used now. Adjust comment.
2380 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2381 * buffer.c (buffer_slot_type_mismatch): Remove.
2382 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2383 predicate. Adjust comment.
2384 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2385 fill-column, left-margin, tab-width, buffer-saved-size,
2386 left-margin-width, right-margin-width, left-fringe-width,
2387 right-fringe-width, scroll-bar-width and buffer-display-count.
2388 Use Qstringp for default-directory, buffer-file-name,
2389 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2390 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2391 line-spacing.
2392 * data.c (store_symval_forwarding): Adjust to call the predicate.
2393
5104861e
JB
23942013-01-09 Juanma Barranquero <lekktu@gmail.com>
2395
2396 * w32.c (get_name_and_id, acl_set_file):
2397 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2398
eefd7278
DA
23992013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2400
2401 * lisp.h (make_gap_1): New prototype.
2402 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2403 gap size values.
2404 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2405 naming convention.
2406 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 2407 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
2408 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2409 (make_gap_1): New function to adjust the gap of any buffer.
2410 * coding.c (coding_alloc_by_making_gap): Use it.
2411 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2412 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2413
073ca75b
JL
24142013-01-08 Juri Linkov <juri@jurta.org>
2415
2416 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2417 of (supports :underline (:style wave)). (Bug#13000)
2418
3bace969
AH
24192013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2420
2421 * undo.c (Fprimitive_undo): Move to simple.el.
2422 (syms_of_undo): Remove declarations for Sprimitive_undo.
2423
63a63bd4
SM
24242013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2425
2426 * keyboard.c (echo_add_key): Rename from echo_add_char.
2427
56ed110a
CY
24282013-01-06 Chong Yidong <cyd@gnu.org>
2429
2430 * keyboard.c (echo_add_char): New function, factored out from
2431 echo_char. Don't add a space if the previous echo string was
2432 empty (Bug#13255).
2433 (echo_char): Use it.
2434 (read_key_sequence): When echoing mock input, ensure that the
2435 trailing dash is properly added.
2436
b630991b
EZ
24372013-01-05 Eli Zaretskii <eliz@gnu.org>
2438
2439 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2440 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
2441 digits for buffer positions, before misalignment starts.
2442 Display "0" for integer "object" field.
b630991b
EZ
2443 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2444 Display the newline glyph more unambiguously.
2445
f032a318
YM
24462013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2447
2448 * nsterm.m (ns_draw_underwave):
2449 * w32term.c (w32_draw_underwave):
2450 * xterm.c (x_draw_underwave): Make underwave look more triangular
2451 and also degrade gracefully for small fonts. (Bug#13000)
2452
4240dd3c
YM
2453 * nsterm.m (ns_draw_text_decoration):
2454 * w32term.c (x_draw_glyph_string):
2455 * xterm.c (x_draw_glyph_string): Don't use previous underline
2456 thickness and position if previous underline type is underwave.
2457
553081a5
SM
24582013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2459
2460 * fileio.c (Ffile_acl): Undocument return format.
2461
9539d465 24622013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
2463
2464 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2465
71376d4b
PE
24662013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2467
2468 Simplify via eabs.
2469 * dired.c (file_name_completion):
2470 * doc.c (get_doc_string):
2471 * floatfns.c (round2):
2472 * font.c (font_score, font_delete_unmatched):
2473 * fringe.c (compute_fringe_widths):
2474 * lread.c (read_list):
2475 * minibuf.c (Ftry_completion):
2476 * term.c (tty_ins_del_lines):
2477 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2478 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2479
a7f11948
EZ
24802012-12-31 Eli Zaretskii <eliz@gnu.org>
2481
2482 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
2483 correctly.
2484 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
2485 for the bug this caused.
2486
84cc1ab6
PE
24872012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2488
2489 * coding.c (Qmac): Now static.
2490
5a1d858b
JD
24912012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2492
2493 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2494 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2495 handlebox_widget. Set toolbar_in_hbox to false/true, set
2496 toolbar_is_packed to true.
2497 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2498 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2499 Show all on TOOLBAR_TOP_WIDGET.
2500 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2501 by TOOLBAR_TOP_WIDGET.
2502 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2503 Check toolbar_is_packed.
8b745d92
JD
2504 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2505 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2506 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2507 false.
2508 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2509 (xg_update_menubar): Update title only if
2510 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2511 (xg_update_submenu): Skip tearoff only if
2512 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2513 (xg_initialize): Initialize xg_detached_menus only if
2514 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
2515
2516 * xterm.h (struct x_output): Surround handlebox_widget with
2517 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2518 toolbar_in_hbox is bool.
2519
d5e5e7b4 25202012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
2521
2522 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2523 (LIBS_GNUSTEP): Define.
2524 (LIBES): Add $(LIBS_GNUSTEP).
2525 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2526
d5e5e7b4 25272012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
2528
2529 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2530 continuation glyph on a TTY with an indication of an empty line.
2531 (Bug#13277)
2532
e7ae8039
EZ
25332012-12-29 Eli Zaretskii <eliz@gnu.org>
2534
ccad023b
EZ
2535 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2536 file's SELinux context or ACLs successfully set, nil otherwise.
2537 (Bug#13298)
8d23a331 2538 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 2539
e7ae8039
EZ
2540 * w32proc.c (reader_thread): Avoid passing NULL handles to
2541 SetEvent and WaitForSingleObject.
2542
7456e13f
PE
25432012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2544
2545 Port EXTERNALLY_VISIBLE to Clang 3.2.
2546 * conf_post.h (__has_attribute): New macro.
2547 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2548
1ab0c851
GM
25492012-12-27 Glenn Morris <rgm@gnu.org>
2550
2551 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2552 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2553
82e2a1f0 25542012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 2555
63a63bd4
SM
2556 * fileio.c (file_name_as_directory, directory_file_name):
2557 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
2558 came from a multibyte or a unibyte Lisp string; all callers
2559 adjusted. Don't assume the input string is always multibyte.
2560 (Bug#13262)
2561 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2562 don't ENCODE_FILE them, and return a unibyte string if the input
2563 was unibyte.
2564 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2565 don't assume the input strings will always be multibyte. If the
2566 input strings are multibyte, decode strings obtained from C
2567 library functions.
2568
8847a0de
DA
25692012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2570
2571 * lisp.h (toplevel): Add two notices to the comment about
2572 defining a new Lisp data type.
6cda572a
DA
2573 * print.c (print_object): If Lisp_Save_Value object's pointer
2574 is the address of a memory area containing Lisp_Objects, try
2575 to print them.
2576 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 2577
4b298d5a
DA
25782012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2579
2580 * keyboard.c (record_asynch_buffer_change): Initialize an event
2581 only if it's really needed.
2582 * frame.h (enum output_method): Remove output_mac member since
2583 it's a leftover from the deleted code.
2584 * frame.c (Fframep): Adjust user here ...
2585 * terminal.c (Fterminal_live_p): ... and here.
2586 * coding.c (Qmac): Now here because it's only used to denote
2587 end-of-line encoding type.
2588 (syms_of_coding): DEFSYM it.
2589 * frame.h (Qmac): Remove duplicated declaration.
2590
12384b01
PE
25912012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2592
2593 * window.c (select_window_1): Now static, since it's used only here.
2594
f1665bdc
EZ
25952012-12-25 Eli Zaretskii <eliz@gnu.org>
2596
2597 * window.c (window_body_cols): Subtract display margins from the
2598 window body width on TTYs as well. See
2599 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2600 for the original report.
2601
9a0d4f34
DA
26022012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2603
2604 * xdisp.c (redisplay_window): Remove inner local variable
2605 because the outer shadowed one has the same meaning.
cd78d9b1
DA
2606 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2607 set but never used.
2608 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2609 (xg_create_tool_bar): Adjust users.
9a0d4f34 2610
f9e7c67e
DA
26112012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2612
2613 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2614 * buffer.c (Fget_buffer_create): Use it to set compact field of
2615 struct buffer_text to avoid accessing an uninitialized value
2616 when compact_buffer is called for the first time.
2617 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
2618 (Fset_buffer_modified_p): Use buffer_window_count to check
2619 whether the buffer is displayed in some window.
2620 * xdisp.c (message_dolog): Likewise.
f9e7c67e 2621
299614f3
EZ
26222012-12-23 Eli Zaretskii <eliz@gnu.org>
2623
40ff07a5
EZ
2624 * w32.c (acl_set_file): If setting the file security descriptor
2625 fails, and the new DACL is identical to the existing one, silently
2626 return success. This fixes problems for users backing up their
2627 own files without having the necessary privileges for setting
2628 security descriptors.
2629
299614f3
EZ
2630 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2631 values.
2632 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2633 after WaitForSingleObject returns normally. This expedites reader
2634 thread shutdown when delete_child triggers it.
2635 (reap_subprocess): More accurate commentary for why we call
2636 delete_child only when cp->fd is negative.
2637
2638 * w32.c (sys_close): Do not call delete_child on a subprocess
2639 whose handle is not yet closed. Instead, set its file descriptor
2640 to a negative value, so that reap_subprocess will call
63a63bd4
SM
2641 delete_child on that subprocess when its SIGCHLD arrives.
2642 This avoids closing handles used for communications between sys_select
299614f3
EZ
2643 and reader_thread, which doesn't give sys_select a chance to
2644 notice that the process exited and invoke the SIGCHLD handler for
2645 it.
2646
cf162aee
JD
26472012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2648
2649 * nsfns.m (Fns_do_applescript): Run event loop until script has
2650 been executed (Bug#12969).
2651 (ns_run_ascript): Chech as_script for nil, set to nil after
2652 executing script.
2653
94900bfe
MR
26542012-12-22 Martin Rudalics <rudalics@gmx.at>
2655
2656 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2657
b2faf49c
EZ
26582012-12-22 Eli Zaretskii <eliz@gnu.org>
2659
2660 * w32term.c (w32fullscreen_hook): New function.
2661 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2662
7efa3fb3
EZ
26632012-12-21 Eli Zaretskii <eliz@gnu.org>
2664
bb085aed
EZ
2665 * fileio.c (Finsert_file_contents): Doc fix.
2666
7efa3fb3
EZ
2667 * w32proc.c (new_child, delete_child, find_child_pid): For a
2668 subprocess, consider its slot being in use as long as its process
2669 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2670 slot when a new process is started immediately after killing
2671 another one, without waiting enough time for the first process to
2672 be reaped and resources allocated for it be orderly freed.
2673 (Bug#13086)
2674 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2675
c1f02afa
CY
26762012-12-21 Chong Yidong <cyd@gnu.org>
2677
2678 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2679
5bec25eb
CY
2680 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2681
a4b0cca1 26822012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
2683
2684 * w32.c (get_name_and_id): Always pass NULL as the first argument
2685 of lookup_account_sid. Avoids crashes with UNC file names that
2686 refer to DFS domains, not to specific machine names. (Bug#12621)
2687 Remove now unused argument FNAME; all callers changed.
2688 (get_file_owner_and_group): Remove now unused argument FNAME; all
2689 callers changed.
2690
34b4b7eb
CY
26912012-12-21 Chong Yidong <cyd@gnu.org>
2692
2693 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2694 error for invalid chars, don't check for a nil return value.
2695
13002885
DA
26962012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2697
2698 Avoid calls to CHAR_TO_BYTE if byte position is known.
2699 * editfns.c (make_buffer_string_both): Use move_gap_both.
2700 (Fbuffer_string): Use make_buffer_string_both.
2701 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2702 Adjust comment.
2703 (buf_bytepos_to_charpos): Likewise.
2704 (charpos_to_bytepos): Remove.
2705 * fileio.c (Finsert_file_contents): Use move_gap_both.
2706 * search.c (Freplace_match): Likewise.
9a0d4f34 2707 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
2708 names for byte positions.
2709 * lisp.h (charpos_to_bytepos): Remove prototype.
2710 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2711 * insdel.c (move_gap): Likewise.
2712
99e9311c
PE
27132012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2714
2715 * xdisp.c (redisplay_internal): Remove now-unused local.
2716
e02230bf
SM
27172012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2718
2719 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2720 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 2721 proper value of frame-local variables (bug#13225).
e02230bf 2722
1687fb14
DA
27232012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2724
2725 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2726 Rename 4th argument since it may be buffer or string. Adjust comment.
2727 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2728
a2f07cd2
DA
27292012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2730
2731 * coding.c (Fdetect_coding_region): Do not check start and end with
2732 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2733 (code_convert_region): Likewise.
2734
474d441e
EZ
27352012-12-18 Eli Zaretskii <eliz@gnu.org>
2736
2737 * w32.c (acl_get_file, acl_set_file): Run the file name through
2738 map_w32_filename, and resolve any symlinks in the file name, like
2739 Posix platforms do.
2740 (acl_set_file): Call revert_to_self, if any privileges were
2741 enabled.
2742
8725c076
JB
27432012-12-17 Juanma Barranquero <lekktu@gmail.com>
2744
2745 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2746 ($(BLD)/w32.$(O)): Update dependencies.
2747
1e101a4b
SM
27482012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2749
2750 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2751 propagate redisplay's scrolling (if any) to the right window.
2752 (redisplay_internal): Use ensure_selected_frame.
2753 (display_mode_lines): Complete last fix.
2754 * window.c (select_window_1): New func, extracted from select_window.
2755 (select_window): Use it.
2756 * window.h (select_window_1): Declare.
2757
66447e07
EZ
27582012-12-17 Eli Zaretskii <eliz@gnu.org>
2759
2760 Emulate Posix ACL APIs on MS-Windows.
2761 * w32.c: Include sddl.h and sys/acl.h.
2762 (SDDL_REVISION_1): Define if not already defined.
2763 (g_b_init_get_security_descriptor_dacl)
2764 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2765 (g_b_init_is_valid_security_descriptor)
2766 (g_b_init_set_file_security): New static flags.
2767 (globals_of_w32): Initialize them to zero.
2768 (SetFileSecurity_Name): New string constant.
2769 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2770 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2771 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2772 (IsValidSecurityDescriptor_Proc): New typedefs.
2773 (get_file_security, get_security_descriptor_owner)
2774 (get_security_descriptor_group): Set errno to ENOTSUP.
2775 (set_file_security, get_security_descriptor_dacl)
2776 (is_valid_security_descriptor, convert_sd_to_sddl)
2777 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2778 (acl_free, acl_get_file, acl_set_file): New functions.
2779
2780 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2781
207a7ef0
PE
27822012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2783
2784 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2785 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2786 for some of that bug's symptoms can now cause Emacs to abort.
2787 Remove the workaround.
2788 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2789 The bug that caused SIGCHLD to get lost has been fixed, and the
2790 workaround for it can now cause Emacs to abort.
2791
17fdfc15
PE
27922012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2793
2794 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2795 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2796 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2797
7c3d167f
RF
27982012-12-16 Romain Francoise <romain@orebokech.com>
2799
2800 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2801 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 2802 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
2803 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2804
2805 * Makefile.in (LIBACL_LIBS): New macro.
2806 (LIBES): Use it.
2807
7d80ea23
PE
28082012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2809
2810 * fileio.c (internal_delete_file): Use bool for boolean.
2811
b0728617
EZ
28122012-12-15 Eli Zaretskii <eliz@gnu.org>
2813
2814 Fix bug #13079 on MS-Windows with temp files not being deleted.
2815 * w32.h (_child_process): New members input_file and
2816 pending_deletion.
2817 (register_child): First argument is now pid_t.
2818 (record_infile, record_pending_deletion): New prototypes.
2819
2820 * w32proc.c (new_child): Initialize input_file and
2821 pending_deletion members of the child.
2822 (delete_child): Delete the child's temporary input file, if any,
2823 that is pending deletion.
2824 (register_child): First argument is now pid_t.
2825 (record_infile, record_pending_deletion): New functions.
2826 (reap_subprocess): Fix a typo in DebPrint string.
2827 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2828
2829 * fileio.c (internal_delete_file): Return an int again: non-zero
2830 if delete-file succeeds, zero otherwise.
2831
2832 * lisp.h (internal_delete_file): Adjust prototype.
2833
2834 * callproc.c (Fcall_process): Don't overwrite infile with result
2835 of DECODE_FILE.
2836 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2837 asynchronous subprocess, record the name of the input file name,
2838 if any.
2839 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2840 delete the file, record it as pending deletion when the subprocess
2841 exits.
2842
7e90af26
EZ
28432012-12-14 Eli Zaretskii <eliz@gnu.org>
2844
2845 * editfns.c [HAVE_PWD_H]: Include grp.h.
2846
2847 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2848
97976f9f
PE
28492012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2850
2851 Fix permissions bugs with setgid directories etc. (Bug#13125)
2852 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2853 to mark it as a placeholder. The old value was often wrong.
2854 The only user of this attribute has been changed to use
2855 file-ownership-preserved-p instead, with its new group arg.
2856 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2857
26ec1f49
SM
28582012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2859
ad966fe7
SM
2860 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2861 Keep selected_window and selected_frame in sync.
26ec1f49 2862
5c207910
EZ
28632012-12-14 Eli Zaretskii <eliz@gnu.org>
2864
2865 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2866 try to get accurate owner and group information from NT file
2867 security APIs. This is to make most callers of 'stat' and
2868 'lstat', which don't need that information, much faster.
2869
26ec1f49
SM
2870 * dired.c (Ffile_attributes) [WINDOWSNT]:
2871 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
2872 owner and group information from 'lstat'.
2873
893f52d8
PE
28742012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2875
4c95c9a5
PE
2876 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2877 as that confuses set-auto-coding, so insist on the head-read
2878 returning the full 1024 bytes. Let lseek compute the tail offset;
2879 less work for us. Do not ignore I/O errors when reading the tail.
2880
893f52d8
PE
2881 * xdisp.c: Minor style fixes.
2882 (init_iterator): Hoist assignment out of if-expression.
2883 (markpos_of_region): Callers now test for sign, not for -1.
2884
40d1e434
DA
28852012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2886
2887 Minor redisplay optimization when the region length is zero.
2888 * xdisp.c (markpos_of_region): New function.
2889 (init_iterator): Do not highlight the region of zero length.
2890 (redisplay_window): Check whether the region is of non-zero length.
2891 (try_cursor_movement): Allow if the region length is zero.
2892 (try_window_reusing_current_matrix, try_window_id): Likewise.
2893
727f9739 28942012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
2895
2896 * search.c (search_buffer): Check the inverse translations of each
2897 character in pattern when the buffer being searched is unibyte.
2898 (Bug#13084)
2899
727f9739 29002012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
2901
2902 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2903 files, fixing a regression from 24.2.
645c6a30 2904 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 2905
d20704ef
PE
29062012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2909 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2910 Remove unnecessary S_ISLNK test, as (contra the comments) this
2911 function can't copy symlinks. Improve quality of error message
2912 when attempting to copy files that are neither regular files nor
2913 directories.
2914
2dd61a9b
DA
29152012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2916
2917 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2918 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2919 * window.c (Frecenter):
2920 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2921 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2922
cc98b684
DC
29232012-12-12 Daniel Colascione <dancol@dancol.org>
2924
1e101a4b 2925 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
2926 the dumped Emacs is not a sparse file, greatly improving Cygwin
2927 "make bootstrap" performance.
2928
38e791fd
MA
29292012-12-11 Michael Albinus <michael.albinus@gmx.de>
2930
2931 * inotify.c (inotify_callback): Generate an Emacs event for every
2932 incoming inotify event.
2933
f9d1448f
EZ
29342012-12-11 Eli Zaretskii <eliz@gnu.org>
2935
2936 * xdisp.c (handle_face_prop): Fix logic of computing
2937 it->start_of_box_run_p.
2938 (append_space_for_newline): If the glyph row is R2L, reset the
2939 iterator's end_of_box_run_p flag before prepending the space glyph.
2940 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2941 iterator's start_of_box_run_p flag before prepending the stretch.
2942 (append_glyph, produce_image_glyph, append_composite_glyph)
2943 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2944 left_box_line_p and right_box_line_p flags of the glyph for R2L
2945 glyph rows. (Bug#13011)
2946
c6afe371
DA
29472012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2948
2949 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2950 if changed buffer is not shown in a window.
2951 * insdel.c (prepare_to_modify_buffer): Likewise.
2952 * window.c (replace_buffer_in_windows_safely): Do nothing
2953 if buffer is not shown in a window.
2954 (Fforce_window_update): Likewise if string or buffer argument
2955 is passed.
2956
1b47babd
EZ
29572012-12-11 Eli Zaretskii <eliz@gnu.org>
2958
2959 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2960 encoded_file_name, which is what it is.
2961
4c1acb95
DA
29622012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2963
2964 Consistently use marker_position and marker_byte_position.
2965 * fringe.c (Ffringe_bitmaps_at_pos):
2966 * indent.c (Fvertical_motion):
2967 * insdel.c (prepare_to_modify_buffer):
2968 * keyboard.c (make_lispy_position):
2969 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2970 (window_scroll_pixel_based, displayed_window_lines)
2971 (Fset_window_configuration):
2972 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2973 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2974 Replace direct access to marker fields with calls
2975 to marker_position and/or marker_byte_position.
2976
0eeb69fe
JB
29772012-12-11 Juanma Barranquero <lekktu@gmail.com>
2978
2979 * makefile.w32-in (SIG2STR_H): New macro.
2980 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2981 ($(BLD)/w32notify.$(O)): Update dependencies.
2982
1cf1bbd5
DC
29832012-12-10 Daniel Colascione <dancol@dancol.org>
2984
8db4b52f
DC
2985 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2986 Windows file notification functionality unless WINDOWSNT.
2987
1cf1bbd5
DC
2988 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2989 declarations.
2990
2991 * w32fns.c (cache_system_info): Initialize the global hinst
2992 variable here so various initialization calls DTRT.
2993
1e101a4b 2994 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
2995 (hinst): Remove unneeded extern declaration.
2996 (_start): Remove initialization of above variables; remove
2997 initialization of hinst, as cache_system_info now does that.
2998
2999 * emacs.c (main): Call cache_system_info early in startup; we
3000 previously weren't calling it in Cygwin builds.
3001
26ec1f49
SM
3002 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3003 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
3004 and link it to Emacs.
3005
98a07056
DA
30062012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3007
3008 Per-buffer window counters.
3009 * buffer.h (struct buffer): New member window_count.
3010 (buffer_window_count): New function.
3011 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3012 Initialize window_count.
3013 (Fkill_buffer): Verify window_count for the buffer being killed.
3014 (modify_overlay): Do not force redisplay if buffer is not shown
3015 in any window.
3016 (init_buffer_once): Initialize window_count for buffer_defaults
3017 and buffer_local_symbols.
3018 * window.h (buffer_shared): Remove declaration.
3019 (wset_buffer): Convert from inline ...
3020 * window.c (wset_buffer): ... to an ordinary function.
3021 (adjust_window_count): New function.
3022 (make_parent_window): Use it.
3023 * xdisp.c (buffer_shared): Remove.
3024 (redisplay_internal, redisplay_window): Adjust users.
3025 (buffer_shared_and_changed): Use per-buffer window counter.
3026
2b8c9064
EZ
30272012-12-10 Eli Zaretskii <eliz@gnu.org>
3028
3029 Support for filesystem notifications on MS-Windows.
3030 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3031 and this is a TTY frame, signal the caller that keyboard input is
3032 available.
3033
3034 * w32xfns.c (drain_message_queue): Now returns an int: an
3035 indication whether any WM_EMACS_FILENOTIFY messages were found in
3036 the queue.
3037
3038 * w32inevt.c (handle_file_notifications): New function.
3039 (w32_console_read_socket): Call it to process file notifications.
3040
3041 * w32console.c (initialize_w32_display): Record the main thread ID
3042 in dwMainThreadId.
3043
3044 * deps.mk (inotify.o): New dependency list.
3045
3046 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3047
3048 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3049 (WM_EMACS_END): Bump value by 1.
3050 (notification_buffer_in_use, file_notifications)
3051 (notifications_size, notifications_desc): Declare.
3052 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3053 Add prototypes.
3054
3055 * w32term.c (lispy_file_action, queue_notifications): New functions.
3056 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3057 <Qrenamed_to>: New symbols.
3058 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3059
3060 * w32notify.c: New file, implements file event notifications for
3061 MS-Windows.
3062
3063 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3064 by posting it to the w32_read_socket queue.
3065
1e101a4b 3066 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
3067
3068 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3069 (GLOBAL_SOURCES): Add w32notify.c
3070 ($(BLD)/w32notify.$(O)): New set of dependencies.
3071
3072 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3073
1e101a4b
SM
3074 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3075 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
3076 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3077 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3078 w32notify-handle-event by default.
3079
3080 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3081 syms_of_w32notify.
3082
81606b10
RS
30832012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3084
2b8c9064 3085 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 3086 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
3087
3088 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3089
3090 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3091 (syms_of_keyboard): DEFSYM it.
3092 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3093 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3094 Qfile_inotify events.
3095 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3096 special-event-map to inotify-handle-event.
3097
3098 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3099
3100 * Makefile.in (base_obj): Add inotify.o.
3101
3102 * inotify.c: New file.
3103
265c2fbf 31042012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
3105
3106 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3107
265c2fbf 31082012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
3109
3110 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3111 DWORD_PTR, for compatibility with 64-bit builds.
3112
a06ae17d 3113 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
3114 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3115 (system_process_attributes): Use SIZE_T rather than DWORD, for
3116 compatibility with 64-bit builds.
3117
265c2fbf 31182012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
3119
3120 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3121
265c2fbf 31222012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
3123
3124 * indent.c (Fvertical_motion): If a display string will be
3125 displayed on the left or the right margin, don't consider it as a
3126 factor in cursor positioning. (Bug#13108)
3127
265c2fbf 31282012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
3129
3130 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3131
5f460827
PE
31322012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3133
3134 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3135 for string length.
3136
a16e75cd
EZ
31372012-12-08 Eli Zaretskii <eliz@gnu.org>
3138
3139 * w32.c (unsetenv): Return 0 if the input string is too long.
3140
5745a7df
PE
31412012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3142
3143 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3144 * alloc.c (xputenv): New function.
3145 * dbusbind.c (Fdbus_init_bus):
3146 * emacs.c (main):
3147 * xterm.c (x_term_init):
3148 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3149 * editfns.c (initial_tz): Move static var decl up.
3150 (tzvalbuf_in_environ): New static var.
3151 (init_editfns): Initialize these two static vars.
3152 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3153 Save old TZ value on stack, if it's small.
3154 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3155 instead, use xputenv+unsetenv to set and restore TZ.
3156 (environbuf): Remove static var. All uses removed.
3157 (Fset_time_zone_rule): Do not save TZ and environ;
3158 no longer needed here.
3159 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3160 Move to inside set_time_zone_rule; they don't need file scope any more.
3161 (set_time_zone_rule): Maintain the TZ=value string separately.
3162 (syms_of_editfns): Don't initialize initial_tz;
3163 init_editfns now does it.
3164 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3165 * lisp.h (xputenv): New decl.
3166
c56efa40
FP
31672012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3168
3169 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3170
75ceee05
EZ
31712012-12-08 Eli Zaretskii <eliz@gnu.org>
3172
3173 * w32.c (unsetenv, sys_putenv): New functions.
3174
1b6dbfeb
CY
31752012-12-08 Chong Yidong <cyd@gnu.org>
3176
3177 * editfns.c (Finsert_char): Make the error message more
3178 informative (Bug#12992).
3179
d983a10b
PE
31802012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3181
7be78020
PE
3182 Simplify get_lim_data.
3183 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3184 Remove USG and vlimit methods; no longer used these days.
3185 Add #error catchall just in case.
3186
d983a10b
PE
3187 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3188 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3189 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3190 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3191 (deleted_pid_list, Fdelete_process, create_process)
3192 (record_child_status_change, handle_child_signal, deliver_child_signal)
3193 (init_process_emacs, syms_of_process):
3194 Assume SIGCHLD is defined.
3195 (parse_signal): Remove. All uses removed.
3196 (abbr_to_signal): New static function.
3197 (Fsignal_process): Use it to convert signal names to ints.
3198 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3199 kill (getpgrp (), ...).
3200 (emacs_sigaction_init): Assume SIGCHLD is defined.
3201 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3202 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3203 * syssignal.h (EMACS_KILLPG): Remove.
3204 All uses replaced by 'kill' with a negative pid.
3205 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3206 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3207
9cdde1e2
PE
32082012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3209
3210 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3211 This will cause a production Emacs to dump core instead of
3212 infinite-looping.
3213
822995f8
DA
32142012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3215
3216 * frame.c (make_frame): Do not set window's buffer to t.
3217 * window.c (Fsplit_window_internal): Likewise. Previously it was
3218 used to indicate that the window is being set up. Now we use
3219 set_window_buffer for all new windows, so the condition in ...
3220 (Fset_window_buffer): ... is always true and can be removed.
3221
ed08365b
DA
32222012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3223
3224 Convenient macro to check whether the buffer is hidden.
3225 * buffer.h (BUFFER_HIDDEN_P): New macro.
3226 * frame.c (make_frame): Use it. Adjust comment.
3227 * buffer.c (candidate_buffer): New function.
3228 (Fother_buffer, other_buffer_safely): Use it.
3229
e86f5134
EZ
32302012-12-06 Eli Zaretskii <eliz@gnu.org>
3231
3232 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3233 if the child process is still running. Instead, exit the wait
3234 loop and return zero. (Bug#13086)
3235
1700db3c
DA
32362012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3237
3238 * frame.h (x_char_width, x_char_height): Remove prototypes.
3239 * w32term.h (x_char_width, x_char_height): Likewise.
3240 * xfns.c (x_char_width, x_char_height): Remove.
3241 * w32fns.c (x_char_width, x_char_height): Likewise.
3242 * nsfns.c (x_char_width, x_char_height): Likewise.
3243 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3244 all window frames.
3245 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3246 * keyboard.c (command_loop_1): Remove prototype.
3247 (command_loop_2, top_level_1): Add static to match prototype.
3248
35fb8050
PE
32492012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3250
3251 Fix a recently-introduced delete-process race condition.
3252 * callproc.c, process.h (record_kill_process):
3253 New function, containing part of the old call_process_kill.
3254 (call_process_kill): Use it.
3255 This does not change call_process_kill's behavior.
3256 * process.c (Fdelete_process): Use record_kill_process to fix a
3257 race condition that could cause Emacs to lose track of a child.
3258
565212e5
DA
32592012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3260
3261 Avoid code duplication between prev_frame and next_frame.
3262 * frame.c (candidate_frame): New function. Add comment.
3263 (prev_frame, next_frame): Use it. Adjust comment.
3264
d8ad4d3f 32652012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
3266
3267 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3268 fails, signal an error instead of continuing with an empty
3269 string. (Bug#13079)
7c2fcf9b
EZ
3270 Encode expanded temp file pattern before passing it to mkstemp or
3271 mktemp.
d3cefd13 3272
2e7cddd3
EZ
3273 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3274 Encode the file name before passing it to dostounix_filename, in
3275 case it will downcase it (under w32-downcase-file-names).
3276 (Bug#12933)
3277
644d3f0d
PE
32782012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3279
3280 Minor call-process cleanups.
3281 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3282 at the same time as other platforms, to simplify analysis.
3283 No need for fd0_volatile since we have synch_process_fd.
3284 Avoid needless emacs_close; arg is always negative.
3285
396376f1
AS
32862012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3287
3288 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3289 processes.
3290
350f51ad
DA
32912012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3292
3293 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3294 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3295 and mouse_face_hidden members to a bitfields.
3296 * frame.h (struct frame): Remove set-but-not-used space_width member.
3297 (FRAME_SPACE_WIDTH): Remove.
3298 * nsterm.m, w32term.c, xterm.c: Adjust users.
3299 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3300 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3301 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3302 members to a bitfields.
3303
bc9dbce6
PE
33042012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3305
bb5f74ee
PE
3306 Don't let call-process be a zombie factory (Bug#12980).
3307 Fixing this bug required some cleanup of the signal-handling code.
3308 As a side effect, this change also fixes a longstanding rare race
3309 condition whereby Emacs could mistakenly kill unrelated processes,
3310 and it fixes a bug where a second C-g does not kill a recalcitrant
3311 synchronous process in GNU/Linux and similar platforms.
3312 The patch should also fix the last vestiges of Bug#9488,
3313 a bug which has mostly been fixed on the trunk by other changes.
3314 * callproc.c, process.h (synch_process_alive, synch_process_death)
3315 (synch_process_termsig, sync_process_retcode):
3316 Remove. All uses removed, to simplify analysis and so that
3317 less consing is done inside critical sections.
3318 * callproc.c (call_process_exited): Remove. All uses replaced
3319 with !synch_process_pid.
3320 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3321 These take the role of what used to be in unwind-protect arg.
3322 All uses changed.
3323 (block_child_signal, unblock_child_signal):
3324 New functions, to avoid races that could kill innocent-victim processes.
3325 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3326 (call_process_kill): Record killed processes as deleted, so that
3327 zombies do not clutter up the system. Do this inside a critical
3328 section, to avoid a race that would allow the clutter.
3329 (call_process_cleanup): Fix code so that the second C-g works again
3330 on common platforms such as GNU/Linux.
3331 (Fcall_process): Create the child process in a critical section,
3332 to fix a race condition. If creating an asynchronous process,
3333 record it as deleted so that zombies do not clutter up the system.
3334 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3335 light of these changes. Omit unnecessary call to emacs_close
3336 before failure, as the unwind-protect code does that.
3337 * callproc.c (call_process_cleanup):
3338 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3339 * process.c (record_deleted_pid): New function, containing
3340 code refactored out of Fdelete_process.
3341 (Fdelete_process): Use it.
3342 (process_status_retrieved): Remove. All callers changed to use
3343 child_status_change.
3344 (record_child_status_change): Remove, folding its contents into ...
3345 (handle_child_signal): ... this signal handler. Now, this
3346 function is purely a handler for SIGCHLD, and is not called after
3347 a synchronous waitpid returns; the synchronous code is moved to
3348 wait_for_termination. There is no need to worry about reaping
3349 more than one child now.
3350 * sysdep.c (get_child_status, child_status_changed): New functions.
3351 (wait_for_termination): Now takes int * status and bool
3352 interruptible arguments, too. Do not record child status change;
3353 that's now the caller's responsibility. All callers changed.
3354 Reimplement in terms of get_child_status.
3355 (wait_for_termination_1, interruptible_wait_for_termination):
3356 Remove. All callers changed to use wait_for_termination.
3357 * syswait.h: Include <stdbool.h>, for bool.
3358 (record_child_status_change, interruptible_wait_for_termination):
3359 Remove decls.
3360 (record_deleted_pid, child_status_changed): New decls.
3361 (wait_for_termination): Adjust to API changes noted above.
3362
bc9dbce6
PE
3363 * bytecode.c, lisp.h (Qbytecode): Remove.
3364 No longer needed after 2012-11-20 interactive-p changes.
3365
3cf3c607
EZ
33662012-12-03 Eli Zaretskii <eliz@gnu.org>
3367
3368 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3369 the scroll margin, move point outside the margin. (Bug#13055)
3370
005c8d13
JD
33712012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3372
3373 * gtkutil.c (my_log_handler): New function.
3374 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3375
20edc1c9
DA
33762012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3377
3378 * lisp.h (modify_region): Rename to...
3379 (modify_region_1): ...new prototype.
3380 * textprop.c (modify_region): Now static. Adjust users.
3381 * insdel.c (modify_region): Rename to...
3382 (modify_region_1): ...new function to work with current buffer.
3383 Adjust comment and users. Use true and false for booleans.
3384
62c2e5ed
DA
33852012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3386
3387 * alloc.c (free_save_value): New function.
3388 (safe_alloca_unwind): Use it.
3389 * lisp.h (free_save_value): New prototype.
3390 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3391 Add comment.
3392 (save_excursion_restore): Adjust to match saved data structure.
3393 Use free_save_value to offload some work from GC. Drop obsolete
3394 #if 0 code.
3395
c5bc2d1d 33962012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
3397
3398 * fileio.c (Vauto_save_list_file_name): Doc fix.
3399
c5bc2d1d 34002012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
3401
3402 * w32fns.c: Remove prototype of atof.
1e101a4b 3403 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 3404 builds.
1e101a4b 3405 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
3406
3407 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3408 with 64-bit builds.
3409
3410 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3411 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3412 defined.
3413
c5bc2d1d 34142012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 3415
a9de9f0c 3416 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 3417
21e54a94
PE
34182012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3419
2dd2e622
PE
3420 Fix xpalloc confusion after memory is exhausted.
3421 * alloc.c (xpalloc): Comment fix.
3422 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3423 and signals an error, do not clear charset_table_size, as
3424 charset_table is still valid.
3425 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3426
21e54a94
PE
3427 Use execve to avoid need to munge environ (Bug#13054).
3428 * callproc.c (Fcall_process):
3429 * process.c (create_process):
3430 Don't save and restore environ; no longer needed.
3431 * callproc.c (child_setup):
3432 Use execve, not execvp, to preserve environ.
3433
3e5490f7
PE
34342012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3435
3436 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3437
75b4f59c
YM
34382012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3439
3440 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3441 display for sliced images (Bug#10500).
3442
3443 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3444
f8aff4c6
JB
34452012-11-30 Juanma Barranquero <lekktu@gmail.com>
3446
3447 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3448 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3449
3940b924
DA
34502012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3451
3452 * xdisp.c (window_outdated): Remove eassert since it hits
3453 some suspicious corner cases (see Bug#13007 and Bug#13012).
3454 (mode_line_update_needed): New function.
3455 (redisplay_internal, redisplay_window): Use it.
3456 (ensure_selected_frame): New function.
3457 (redisplay_internal, unwind_redisplay): Use it.
3458 (redisplay_internal): Move comment about buffer_shared...
3459 (buffer_shared_and_changed): ...near to its real use.
3460
4a9204fe
PE
34612012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3462
3463 * callproc.c (Fcall_process): Don't misreport vfork failure.
3464
60aeceb8
PE
34652012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3466
3467 * callproc.c (Fcall_process): Fix vfork portability problems.
3468 Do not assume that fd[0], count, filefd, and save_environ survive
3469 vfork. Fix bug whereby wrong errno value could be reported for
3470 pipe failure. Some minor cleanups, too, as follows. Move buf and
3471 bufsize to the context where they're needed. Change new_argv to
3472 be of type char **, as this is more convenient and avoids casts.
3473 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3474 Now local constants, not macros.
3475
00dc3ead
KH
34762012-11-18 Kenichi Handa <handa@gnu.org>
3477
3478 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3479 for the variable "f".
3480
e1bf05c1
KH
34812012-11-13 Kenichi Handa <handa@gnu.org>
3482
3483 * font.c (font_unparse_xlfd): Exclude special characters from the
3484 generating XLFD name.
3485
22626a85
PE
34862012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3487
350e0088
PE
3488 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3489 * dired.c (stat_uname, stat_gname):
3490 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3491
22626a85
PE
3492 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3493 * dired.c (directory_files_internal, file_name_completion):
3494 Assume EAGAIN and EINTR are defined.
350e0088 3495
22626a85
PE
3496 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3497 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3498 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3499 * lread.c (readbyte_from_file): Assume EINTR is defined.
3500 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3501 Assume EIO and EAGAIN are defined.
3502 * unexcoff.c (write_segment): Assume EFAULT is defined.
3503
5c9cf0a3 35042012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
3505
3506 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3507 (Bug#11964)
3508
22294a56
EZ
3509 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3510 highlighting on the frame was cleared. Prevents assertion
3511 violations when repeatedly clicking on the "Top" link of the
3512 "bread-crumbs" in Info buffers.
3513
5fbab051
PE
35142012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3515
3516 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3517
bcd77a2b
KB
35182012-11-24 Ken Brown <kbrown@cornell.edu>
3519
3520 * keyboard.c (HAVE_MOUSE):
3521 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3522 were always defined.
3523
d125ca15 35242012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 3525
24becea4
EZ
3526 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3527 between bpos_covered and bpos_max. This fixes cursor display when
3528 several display strings follow each other.
3529
8654a41b
EZ
3530 * .gdbinit (pgx): If the glyph's object is a string, display the
3531 pointer to string data, rather than the value of the string object
3532 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3533
cb5867b1
EZ
3534 * indent.c (Fvertical_motion): If the starting position is covered
3535 by a display string, return to one position before that, to avoid
3536 overshooting it inside move_it_to. (Bug#12930)
3537
f418b22e
DA
35382012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3539
3540 * frame.h (struct frame): Remove display_preempted member
3541 since all users are dead long ago.
3542 * nsterm.h (struct x_output): Use the only dummy member.
3543 * w32menu.c (pending_menu_activation): Remove since not
3544 really used.
3545 (set_frame_menubar): Adjust user.
3546 * w32term.h (struct x_output): Drop outdated #if 0 code.
3547 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
3548 asked_for_visible and menubar_active members.
3549 Drop unused pending_menu_activation member.
f418b22e
DA
3550 * xterm.h (struct x_output): Drop outdated #if 0 code.
3551 Use bitfields for explicit_parent, asked_for_visible,
3552 has_been_visible and net_wm_state_hidden_seen members.
3553
a879f0ea
EZ
35542012-11-23 Eli Zaretskii <eliz@gnu.org>
3555
3556 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3557 of a literal "/". (Bug#12955)
3558 (gl-stamp): Invoke fc.exe directly, not through cmd.
3559
95ef7787
PE
35602012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3561
3562 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3563 * dired.c: Assume HAVE_DIRENT_H.
3564 (NAMLEN): Remove, replacing with ...
3565 (dirent_namelen): New function. All uses changed. Use the GNU macro
3566 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3567 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3568 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3569 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3570 $(NT_INC)/dirent.h.
3571 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3572 * ndir.h: Rename to ../nt/inc/dirent.h.
3573 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3574 Do not include <dirent.h>; no longer needed.
3575 * w32.c: Include <dirent.h> rather than "ndir.h".
3576
12645ae6
CY
35772012-11-23 Chong Yidong <cyd@gnu.org>
3578
3579 * xftfont.c (xftfont_open): Remove duplicate assignment.
3580
5c747675
DA
35812012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3582
3583 * alloc.c (Fgarbage_collect): Unblock input after clearing
3584 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3585 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3586 * msdos.c (IT_frame_up_to_date): Use it here...
3587 * w32term.c (w32_frame_up_to_date): ...here...
3588 * xterm.c (XTframe_up_to_date): ...and here...
3589 * nsterm.m (ns_frame_up_to_date): ...but not here.
3590 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3591 Adjust users.
3592 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3593 Do not check whether GC is in progress.
3594
6ceeb5f1
DA
35952012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3596
3597 * xdisp.c (window_buffer_changed): New function.
3598 (update_menu_bar, update_tool_bar): Use it to
3599 simplify large 'if' statements.
3600 (redisplay_internal): Generalize commonly used
3601 'tail' and 'frame' local variables.
3602
ec84768f
EZ
36032012-11-22 Eli Zaretskii <eliz@gnu.org>
3604
3605 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3606 with Windows system header.
3607
9239d970
PE
36082012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3609
3610 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3611 * alloc.c: Assume unistd.h exists.
3612 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3613 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3614 (getwd) [USG]: Remove; no longer needed.
3615 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3616 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3617 * w32.h (getcwd): Remove decl.
3618
954bba56
SM
36192012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3620
3621 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3622 Make it set selected_window as well.
3623 (update_tool_bar): Use it.
3624
6ef2e5ef 36252012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
3626
3627 * emacs.c (main): Set the G_SLICE environment variable for all
3628 Cygwin builds, not just GTK builds. See
3629 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3630
6ef2e5ef 36312012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
3632
3633 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3634 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3635 Define for the MSVC compiler.
3636
6ef2e5ef 3637 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
3638
3639 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3640 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3641 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
3642 dostounix_filename assumes it gets a unibyte string.
3643 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
3644 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3645
eadf1faa
SM
36462012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3647
3648 Conflate Qnil and Qunbound for `symbol-function'.
3649 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3650 * lread.c (init_obarray): Set `function' fields to Qnil.
3651 * eval.c (Fcommandp): Ignore Qunbound.
3652 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3653 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3654 Test NILP rather than Qunbound.
3655 (Ffmakunbound): Set to Qnil.
3656 (Fsymbol_function): Never signal an error.
3657 (Finteractive_form): Ignore Qunbound.
3658
b83fdfa9
PE
36592012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3660
3661 * eval.c (interactive_p): Remove no-longer-used decl.
3662
952580c5
DA
36632012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3664
3665 * xdisp.c (buffer_shared): Adjust comment.
3666 (buffer_shared_and_changed): New function.
3667 (prepare_menu_bars, redisplay_internal): Use it to
3668 decide whether all windows or frames should be updated.
ea6de9b1
DA
3669 (window_outdated): New function.
3670 (text_outside_line_unchanged_p, redisplay_window): Use it.
3671 (redisplay_internal): Likewise. Fix indentation.
952580c5 3672
23ba2705
SM
36732012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3674
3675 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3676 (syms_of_eval): Remove corresponding defsubr.
3677 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3678
6e9f7997
DC
36792012-11-19 Daniel Colascione <dancol@dancol.org>
3680
3681 * w32fns.c (Fx_file_dialog):
3682 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3683 cygwin_convert_file_name*.
3684
3685 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3686 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3687
552a1590
PE
36882012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3689
3690 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3691
2ac9538d 36922012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
3693
3694 * w32select.c: Include w32common.h before w32term.h, so that
3695 windows.h gets included before w32term.h uses some of its
3696 features, see below.
3697
23ba2705
SM
3698 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3699 New typedefs.
3700 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3701 New prototypes.
d8715cdf
EZ
3702 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3703
2ac9538d 37042012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
3705
3706 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3707 (ns_select): Return at once if events are held (Bug#12834).
3708
2ac9538d 37092012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 3710
3711 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3712 Needed following 2012-10-20 change. (Bug#12902)
3713
c1f7ba3a
JB
37142012-11-18 Juanma Barranquero <lekktu@gmail.com>
3715
3716 * w32proc.c (waitpid): Remove unused label get_result.
3717
a75ce9d3
JB
37182012-11-17 Juanma Barranquero <lekktu@gmail.com>
3719
3720 * makefile.w32-in (SYSWAIT_H): New macro.
3721 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3722 ($(BLD)/sysdep.$(O)): Update dependencies.
3723
49cdacda
PE
37242012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3725
3726 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3727 * callproc.c (relocate_fd): Assume F_DUPFD.
3728 * emacs.c, term.c (O_RDWR): Remove.
3729 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3730 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3731 * nsterm.m: Assume <fcntl.h> exists.
3732 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3733 (create_pty, Fmake_network_process, server_accept_connection)
3734 (wait_reading_process_output, init_process_emacs):
3735 Assume O_NONBLOCK.
3736 (wait_reading_process_output): Put in a special case for WINDOWSNT
3737 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3738 It's not clear this is needed, but it's a more-conservative change.
3739 (create_process): Assume FD_CLOEXEC.
3740 (create_process, create_pty): Assume O_NOCTTY.
3741 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3742 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3743 Omit if not DOS_NT, since F_GETFL is not defined there.
3744 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3745 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3746 (O_NOCTTY): Remove.
3747 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3748 lack it, since gnulib guarantees this.
3749 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3750
22bae83f
EZ
37512012-11-17 Eli Zaretskii <eliz@gnu.org>
3752
6ad30855
EZ
3753 * w32.c (faccessat): Pretend that directories have the execute bit
3754 set. Emacs expects that, e.g., in files.el:cd-absolute.
3755
22bae83f
EZ
3756 * w32proc.c (create_child): Don't clip the PID of the child
3757 process to fit into an Emacs integer, as this is no longer a
3758 restriction.
3759 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3760 reaping only the process specified by PID argument, if that is
3761 positive. Use PID instead of dead_child to know which process to
3762 reap. Wait for the child to die only if WNOHANG is not in
3763 OPTIONS.
3764 (sys_select): Don't set dead_child.
3765
3766 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3767 as it is no longer needed.
3768
3769 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3770 no longer needed.
3771 (record_child_status_change): Remove the setting of
3772 record_at_most_one_child for the !WNOHANG case.
3773
a631d0e0
PE
37742012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3775
3776 Fix problems in ns port found by static checking.
3777 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3778 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3779 not to process group.
3780 (ns_select): Use emacs_write, not write, as that's more robust
3781 in the presence of signals.
3782 (fd_handler:): Check for read errors.
3783
d56f2e49
GM
37842012-11-16 Glenn Morris <rgm@gnu.org>
3785
3786 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3787
96e05507 37882012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
3789
3790 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3791
96e05507 37922012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
3793
3794 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3795 use the same value of thread handle.
3796 (start_timer_thread): If the timer thread exited (due to error),
3797 clean up by closing the two handles it used. Duplicate the caller
3798 thread's handle here, so it gets duplicated only once, when
3799 launching the timer thread. Set priority of the timer thread, not
3800 the caller thread.
3801 (getitimer): Don't duplicate the caller thread's handle here.
3802 (Bug#12832)
3803
96e05507 38042012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
3805
3806 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3807 called (Bug#12834).
3808
3d082a26
PE
38092012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3810
3811 Remove no-longer-used pty_max_bytes variable.
3812 * process.c (pty_max_bytes): Remove; unused.
3813 (send_process): Do not set it.
3814
b72c161c
JB
38152012-11-15 Juanma Barranquero <lekktu@gmail.com>
3816
3817 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3818 Update dependencies.
3819
bf20ea80
PE
38202012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3821
3822 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3823 This follows up on the 2012-09-29 patch that removed indirection
3824 for the 'function' field. Reported by Sergey Vinokurov in
3825 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3826
14f20728
EZ
38272012-11-14 Eli Zaretskii <eliz@gnu.org>
3828
3829 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3830 different name, as the MS runtime does not have such a function,
3831 and probably never will.) All callers changed. Ignore DIRFD
3832 value if PATH is an absolute file name, to match Posix spec
3833 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3834 symlinks.
3835
77731919
DA
38362012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3837
3838 * xdisp.c (echo_area_display, redisplay_internal):
3839 Omit redundant check whether frame_garbaged is set.
3840
73dcdb9f
PE
38412012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3842
3843 Use faccessat, not access, when checking file permissions (Bug#12632).
3844 This fixes a bug that has been present in Emacs since its creation.
3845 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3846 which must set some sort of record. (Torek's bug report was against
3847 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3848 same common flaw.) See Torek's Usenet posting
3849 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3850 Posted: Fri Apr 8 14:18:56 1983.
3851 * Makefile.in (LIB_EACCESS): New macro.
3852 (LIBES): Use it.
3853 * callproc.c (init_callproc):
3854 * charset.c (init_charset):
3855 * fileio.c (check_existing, check_executable, check_writable)
3856 (Ffile_readable_p):
3857 * lread.c (openp, load_path_check):
3858 * process.c (allocate_pty):
3859 * xrdb.c (file_p):
3860 Use effective UID when checking permissions, not real UID.
3861 * callproc.c (init_callproc):
3862 * charset.c (init_charset):
3863 * lread.c (load_path_check, init_lread):
3864 Test whether directories are accessible, not merely whether they exist.
3865 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3866 * fileio.c (check_existing, check_executable, check_writable)
3867 (Ffile_readable_p):
3868 Use symbolic names instead of integers for the flags, as they're
3869 portable now.
3870 (check_writable): New arg AMODE. All uses changed.
3871 Set errno on failure.
3872 (Ffile_readable_p): Use faccessat, not stat + open + close.
3873 (Ffile_writable_p): No need to call check_existing + check_writable.
3874 Just call check_writable and then look at errno. This saves a syscall.
3875 dir should never be nil; replace an unnecessary runtime check
3876 with an eassert. When checking the parent directory of a nonexistent
3877 file, check that the directory is searchable as well as writable, as
3878 we can't create files in unsearchable directories.
3879 (file_directory_p): New function, which uses 'stat' on most platforms
3880 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3881 (Ffile_directory_p, Fset_file_times): Use it.
3882 (file_accessible_directory_p): New function, which uses a single
3883 syscall for efficiency.
3884 (Ffile_accessible_directory_p): Use it.
3885 * xrdb.c (file_p): Use file_directory_p.
3886 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3887 * lread.c (openp): When opening a file, use fstat rather than
3888 stat, as that avoids a permissions race. When not opening a file,
3889 use file_directory_p rather than stat.
3890 (dir_warning): First arg is now a usage string, not a format.
3891 Use errno. All uses changed.
3892 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3893 that merely introduced a race.
3894 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3895 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3896 and similarly for the other O_* flags.
3897 * w32.c (sys_faccessat): Rename from sys_access and switch to
3898 faccessat's API. All uses changed.
3899 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3900 (magic_db): Rename from magic_file_p.
3901 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3902 char *, so that we don't have to test for file existence
3903 separately from opening the file for reading. This removes a race
3904 fixes a permission-checking problem, and simplifies the code.
3905 All uses changed.
3906 (file_p): Remove; no longer needed.
3907
2a14f83b
DA
39082012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3909
3910 Omit glyphs initialization at startup.
3911 * dispnew.c (glyphs_initialized_initially_p): Remove.
3912 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3913 (Fredraw_frame): Move actual code from here...
c7085245 3914 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
3915 (Fredraw_display): Use redraw_frame.
3916 * xdisp.c (clear_garbaged_frames): Likewise.
3917
f78ee6af 39182012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
3919
3920 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3921 passed to pint2str and pint2hrstr to be at most the size of the
3922 frame's decode_mode_spec_buffer. This avoids crashes with very
3923 large values of FIELD_WIDTH argument to decode_mode_spec.
3924 (Bug#12867)
3925
b95a9c0c
PE
39262012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3927
3928 Fix a race with verify-visited-file-modtime (Bug#12863).
3929 Since at least 1991 Emacs has ignored an mtime difference of no
3930 more than one second, but my guess is that this was to work around
3931 file system bugs that were fixed long ago. Since the race is
3932 causing problems now, let's remove that code.
3933 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3934 whose time stamp is off by no more than a second. Insist that the
3935 file time stamps match exactly.
3936
be49ba74
DA
39372012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3938
3939 * frame.h (struct frame): Convert external_tool_bar member to
3940 1-bit unsigned bitfield.
3941 * termhooks.h (struct terminal): Remove mouse_moved member since
3942 all users are long dead. Adjust comment on mouse_position_hook.
3943
5b04e9f9
DA
39442012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3945
3946 Simplify by using FOR_EACH_FRAME here and there.
3947 * frame.c (next_frame, prev_frame, other_visible_frames)
3948 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3949 * w32term.c (x_window_to_scroll_bar): Likewise.
3950 * window.c (window_list): Likewise.
3951 * xdisp.c (x_consider_frame_title): Likewise.
3952 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3953 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3954 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3955 * xmenu.c (menubar_id_to_frame): Likewise.
3956 * xselect.c (frame_for_x_selection): Likewise.
3957 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3958 (x_window_to_menu_bar): Likewise.
3959 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3960
76ae24d7
PE
39612012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3962
12cc4337
PE
3963 * data.c (Qdefalias_fset_function): Now static.
3964
76ae24d7
PE
3965 Another tweak to vectorlike_header change.
3966 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3967 Remove, and replace all uses with ...
3968 (next_in_free_list, set_next_in_free_list):
3969 New functions, which respect C's aliasing rules better.
3970
1479c557
PE
39712012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3972
3973 * window.c (list4i): Rename from 'quad'. All uses changed.
3974 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3975
11235c03
JB
39762012-11-11 Juanma Barranquero <lekktu@gmail.com>
3977
3978 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3979 warning about mixing declarations and code in ISO C90.
3980
6baf66d5 39812012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
3982
3983 * window.c (Fsplit_window_internal): Set combination limit of
3984 new parent window to t iff Vwindow_combination_limit is t;
3985 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 3986 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 3987
6baf66d5 39882012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
3989
3990 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3991 amount when the scroll margins are too large. When scrolling
3992 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
3993 scroll margin within a reasonable number of screen lines.
3994 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
3995 point is positioned many lines beyond the window top/bottom.
3996 (Bug#12811)
3997
508f51f5
EZ
3998 * ralloc.c (relinquish): If real_morecore fails to return memory
3999 to the system, don't crash; instead, leave the last heap
4000 unchanged and return. (Bug#12774)
4001
32e5c58c
SM
40022012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4003
4004 * lisp.h (AUTOLOADP): New macro.
4005 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4006 * data.c (Ffset): Remove special ad-advice-info handling.
4007 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4008 (Fsubr_arity): CSE.
4009 (Finteractive_form): Simplify.
4010 (Fquo): Don't insist on having at least 2 arguments.
4011 (Qdefalias_fset_function): New var.
4012
719b0aa5
JD
40132012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4014
4ab15c3e
JD
4015 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4016
719b0aa5
JD
4017 * nsfont.m (Qcondensed, Qexpanded): New variables.
4018 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4019 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4020
535cc8e9
DA
40212012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4022
4023 Fix recently introduced crash on MS-Windows (Bug#12839).
4024 * w32term.h (struct scroll_bar): Use convenient header.
4025 (SCROLL_BAR_VEC_SIZE): Remove.
4026 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4027
7d377c48
DA
40282012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4029
4030 Tweak last vectorlike_header change.
4031 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4032 vectorlike object on the free list. This is introduced to avoid
4033 some (but not all) pointer casting and aliasing problems, see
4034 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4035 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4036 objects.
4037 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4038
7ad27466
JD
40392012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4040
32e5c58c 4041 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
4042 been removed, so remove them here also.
4043
57618ecf
SM
40442012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4045
4046 * doc.c (Fdocumentation): Handle new property
4047 dynamic-docstring-function to replace the old ad-advice-info.
4048
53371430
PE
40492012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4050
4051 * fns.c (Qeql, hashtest_eq): Now static.
4052
61ddb1b9
SM
40532012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4054
4055 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4056 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4057 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4058 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4059
04a2d0d3
PE
40602012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4061
4062 Use same hash function for hashfn_profiler as for hash_string etc.
4063 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4064 * lisp.h (sxhash_combine): New inline function, with the contents
4065 of the old SXHASH_COMBINE.
4066 * profiler.c (hashfn_profiler): Use it, instead of having a
4067 special hash function containing a comparison that always yields 1.
4068
de5ef41a
SM
40692012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4070
4071 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4072 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4073 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4074 Remove unused vars.
4075
a23c4171
JD
40762012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4077
4078 * image.c (xpm_make_color_table_h): Fix compiler error because
4079 make_hash_table changed.
4080
0b59090b 40812012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
4082
4083 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4084
b7432bb2
SM
40852012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4086
4087 Use ad-hoc comparison function for the profiler's hash-tables.
4088 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4089 (make_log): Use them.
4090 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4091 call Fequal any more.
4092 (Ffunction_equal): New function.
4093 (cmpfn_profiler, hashfn_profiler): New functions.
4094 (syms_of_profiler): Initialize them.
4095 * lisp.h (struct hash_table_test): New struct.
4096 (struct Lisp_Hash_Table): Use it.
4097 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4098 * fns.c (make_hash_table): Take a struct to describe the test.
4099 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4100 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4101 (hash_lookup, hash_remove_from_table): Move assertion checking of
4102 hashfn result here. Check hash-equality before calling cmpfn.
4103 (Fmake_hash_table): Adjust call to make_hash_table.
4104 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4105 (syms_of_fns): Initialize them.
4106 * emacs.c (main): Move syms_of_fns earlier.
4107 * xterm.c (syms_of_xterm):
4108 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4109 * print.c (print_object): Adjust to new hash-table struct.
4110 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4111
88002743
EZ
41122012-11-08 Eli Zaretskii <eliz@gnu.org>
4113
4114 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4115 value of w32-scroll-lock-modifier is neither nil nor one of the
4116 known key modifiers. (Bug#12806)
4117
914adc42
DA
41182012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4119
4120 Shrink struct vectorlike_header to the only size field.
4121 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4122 Adjust comment.
4123 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4124 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4125 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4126 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4127 information from the vector header. Adjust comment.
4128 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4129 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4130 layout.
4131 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4132 (struct vectorlike_header): Remove next member. Adjust comment.
4133 (struct Lisp_Subr): Add convenient header. Adjust comment.
4134 (allocate_pseudovector): Adjust prototype.
4135 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4136 (sweep_string, lisp_malloc): Remove useless prototypes.
4137 (enum mem_type): Adjust comment.
4138 (NEXT_IN_FREE_LIST): New macro.
4139 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4140 (Fmake_bool_vector): Likewise.
4141 (struct large_vector): New type to represent allocation unit for
4142 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4143 (large_vectors): Change type to struct large_vector.
4144 (allocate_vector_from_block): Simplify.
4145 (PSEUDOVECTOR_NBYTES): Replace with...
4146 (vector_nbytes): ...new function. Adjust users.
4147 (sweep_vectors): Adjust processing of large vectors.
4148 (allocate_vectorlike): Likewise.
4149 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4150 Add easserts. Adjust XSETPVECTYPESIZE usage.
4151 (allocate_buffer): Use BUFFER_PVEC_INIT.
4152 (live_vector_p): Adjust to match large vector.
4153 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4154 * buffer.h (struct buffer): Add next member.
4155 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4156 New macros.
4157 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4158 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4159 (copy_hash_table): Adjust to match vector header change.
4160 * lread.c (defsubr): Use XSETPVECTYPE.
4161 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4162 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4163 (xvecsize): New command.
4164
c66f21ea
DA
41652012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4166
4167 * keyboard.c (event_to_kboard): Do not dereference
4168 frame_or_window field of SELECTION_REQUEST_EVENT
4169 and SELECTION_CLEAR_EVENT events (Bug#12814).
4170 * xterm.h (struct selection_input_event): Adjust comment.
4171
eb147960
EZ
41722012-11-07 Eli Zaretskii <eliz@gnu.org>
4173
dab72075
EZ
4174 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4175 such as Scroll Lock, if the respective keys are treated as
4176 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 4177 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 4178
5890e400
DA
41792012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4180
4181 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4182
b6b3b294
PE
41832012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4184
4185 Restore some duplicate definitions (Bug#12814).
4186 This undoes part of the 2012-11-03 changes. Some people build
4187 with plain -g rather than with -g3, and they need the duplicate
4188 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4189 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4190 Define as macros, as well as as enums or as constants.
4191
e770aad5
JD
41922012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4193
4194 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4195 to keypad keys (Bug#12816).
4196
68f8f1c0
PE
41972012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4198
4199 Minor adjustments of recently-changed frame functions.
4200 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4201 known to be a frame (we're in the FRAMEP branch).
4202 * lisp.h (Qframep): Remove decl. frame.h declares this.
4203 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4204 since they're meant for Lisp fixnum values.
4205
72f94d4b
DA
42062012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4207
4208 * window.c (Fwindow_combination_limit): Revert to the only
4209 required argument and adjust docstring as suggested in
4210 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4211 by Martin Rudalics <rudalics@gmx.at>.
4212
d9f07150
DA
42132012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4214
4215 Widely used frame validity and checking functions.
4216 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4217 * frame.c (decode_live_frame, decode_any_frame): New functions.
4218 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4219 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4220 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4221 (Fframe_pointer_visible_p): Use decode_any_frame.
4222 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4223 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4224 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4225 (Fframe_focus): Likewise. Allow zero number of arguments.
4226 Adjust docstring.
4227 (frame_buffer_list, frame_buffer_predicate): Remove.
4228 * lisp.h (frame_buffer_predicate): Remove prototype.
4229 * buffer.c (Fother_buffer): Use decode_any_frame.
4230 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4231 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4232 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4233 (Fclose_font, Ffont_info): Use decode_live_frame.
4234 * fontset.c (check_fontset_name): Likewise.
4235 * terminal.c (Fframe_terminal): Likewise.
4236 * w32fns.c (check_x_frame): Likewise.
4237 * window.c (Fminibuffer_window, Fwindow_at)
4238 (Fcurrent_window_configuration): Likewise.
4239 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4240 Likewise. Allow zero number of arguments. Adjust docstring.
4241 * dispnew.c (Fredraw_frame): Likewise.
4242 * xfaces.c (frame_or_selected_frame): Remove.
4243 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4244 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4245 (Fframe_face_alist): Use decode_live_frame.
4246 * xfns.c (check_x_frame): Likewise.
4247
89bc0592
DA
42482012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4249
4250 * window.c (quad): New function.
4251 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4252 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4253 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4254 (Fwindow_line_height): Use it.
4255 (Fwindow_fringes): Use list3.
4256 (Fwindow_scroll_bars): Use list4.
4257 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4258 (Fwindow_combination_limit): Allow zero number of arguments.
4259
c8e3a9c3
EZ
42602012-11-05 Eli Zaretskii <eliz@gnu.org>
4261
4262 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4263
8e2417bf 4264 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 4265 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 4266 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 4267
209c6a58
CY
42682012-11-05 Chong Yidong <cyd@gnu.org>
4269
4270 * process.c (wait_reading_process_output): Revert previous change.
4271
8148369c
PE
42722012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4273
dd0333b6
PE
4274 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4275 This removes code that has been obsolete since around 1990.
4276 * callproc.c (Fcall_process):
4277 * emacs.c (main):
4278 * process.c (create_process):
4279 * term.c (dissociate_if_controlling_tty):
4280 Assume setsid exists.
4281 * callproc.c (child_setup): Assume setpgid exists and behaves as
4282 per POSIX.1-1988 or later.
4283 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4284 * emacs.c (shut_down_emacs):
4285 * sysdep.c (sys_suspend, init_foreground_group):
4286 Assume getpgrp behaves as per POSIX.1-1998 or later.
4287 * msdos.c (setpgrp): Remove.
4288 (tcgetpgrp, setpgid, setsid): New functions.
4289 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4290 * term.c (no_controlling_tty): Remove; unused.
4291 * w32proc.c (setpgrp): Remove.
4292 (setsid, tcgetpgrp): New functions.
4293
8148369c
PE
4294 Simplify by assuming __fpending.
4295 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4296 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4297 Do not assume that __fpending's result fits in int.
4298
76abf5e5
PE
42992012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4300
06b63c9b
PE
4301 Remove EMACS_OUTQSIZE+sleep hack.
4302 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
4303 than 2400 bps, which throttled Emacs by having it sleep.
4304 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
4305 was added, and anyway those old terminals are long dead.
4306 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4307 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4308
76abf5e5
PE
4309 Fix data-loss with --version (Bug#9574).
4310 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4311 as we can't assume that emacs_strerror is initialized, and strerror
4312 is good enough here.
4313 (main): Invoke atexit earlier, to catch earlier instances of
4314 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4315
8f31e74b
MM
43162012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4317
4318 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4319 (keyDown): Remap keypad keys to X11 virtual key codes.
4320
0d879dca
PE
43212012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4322
7ccfb720
PE
4323 Fix data-loss with --batch (Bug#9574).
4324 * emacs.c: Include <close-stream.h>.
4325 (close_output_streams): New function.
4326 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4327 and handles errors appropriately.
4328 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4329 does that now.
4330
0b3d4a47
PE
4331 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4332 The symptom is a diagnostic "GLib-WARNING **: In call to
4333 g_spawn_sync(), exit status of a child process was requested but
4334 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4335 waitpid(), so exit status can't be returned." The diagnostic
4336 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4337 The real bug is a race condition between Emacs and glib: Emacs
4338 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4339 so that glib can't find it. Work around the bug by invoking
4340 waitpid only on subprocesses that Emacs itself creates.
4341 * process.c (create_process, record_child_status_change):
4342 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
4343 know the pid rather than having the callee infer it.
4344 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
4345 (create_process): Set new 'alive' member if child is created.
4346 (process_status_retrieved): New function.
4347 (record_child_status_change): Use it.
4348 Accept negative 1st argument, which means to wait for the
4349 processes that Emacs already knows about. Move special-case code
4350 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4351 processes that have already been waited for, by testing and
4352 clearing new 'alive' member.
4353 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4354 now does this internally.
4355 (handle_child_signal): Let record_child_status_change do all
4356 the work, since we do not want to reap all exited child processes,
4357 only the child processes that Emacs itself created.
4358 * process.h (Lisp_Process): New boolean member 'alive'.
4359
0d879dca
PE
4360 Omit duplicate definitions no longer needed with gcc -g3.
4361 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4362 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4363 Define only as macros. There's no longer any need to also define
4364 these symbols as enums or as constants, since we now assume
4365 gcc -g3 when debugging.
4366
3478f4b5
EZ
43672012-11-03 Eli Zaretskii <eliz@gnu.org>
4368
4369 * lisp.mk: Adjust comments to the fact that term/internal is now
4370 loaded from loadup.el.
4371
4372 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4373 (msdos_fatal_signal): New function.
4374 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4375 its argument list.
4376
4377 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4378 for GCC versions before 4.
4379 (emacs_raise): Define to call msdos_fatal_signal.
4380
4381 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4382 iterator when starting in the middle of a display or overlay
4383 string. (Bug#12745)
4384
85fabcb7
CY
43852012-11-03 Chong Yidong <cyd@gnu.org>
4386
4387 * process.c (wait_reading_process_output): Clean up the last
4388 change.
4389
893cc455
CY
43902012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4391
4392 * process.c (wait_reading_process_output): Avoid a race condition
4393 with SIGIO delivery (Bug#11536).
4394
0f7b074f
CY
43952012-11-03 Chong Yidong <cyd@gnu.org>
4396
4397 * buffer.c (cursor_type): Untabify docstring.
4398
3737fee7
DA
43992012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4400
4401 * frame.h (struct frame): Drop can_have_scroll_bars member
4402 which is meaningless for a long time. Adjust comments.
4403 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4404 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4405
b6a9e8b1
DA
44062012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4407
4408 * window.c (decode_next_window_args): Update window arg after
4409 calling decode_live_window and so fix crash reported at
4410 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4411 by Juanma Barranquero <lekktu@gmail.com>.
4412 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4413 * font.c (Ffont_at): Likewise.
4414
600d4768
JD
44152012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4416
4417 * widget.c (resize_cb): New function.
4418 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4419 (EmacsFrameResize): Check if all is up to date before changing frame
4420 size.
4421
1005b4b9
EZ
44222012-11-02 Eli Zaretskii <eliz@gnu.org>
4423
4424 Implement backtrace output for fatal errors on MS-Windows.
4425 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4426 (BACKTRACE_LIMIT_MAX): New macro.
4427 (w32_backtrace): New function.
4428 (emacs_abort): Use w32_backtrace when the user chooses not to
4429 attach a debugger. Update the text of the abort dialog.
4430
b9e9df47
DA
44312012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Window-related stuff cleanup here and there.
4434 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4435 Use decode_any_window.
4436 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4437 * xdisp.c (Fformat_mode_line): Likewise.
4438 * font.c (Ffont_at): Use decode_live_window.
4439 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4440 * window.c (decode_next_window_args): Likewise.
4441 (decode_any_window): Remove static.
4442 * window.h (decode_any_window): Add prototype.
4443 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4444 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4445 respectively.
4446
2b371ff7
DA
44472012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4448
4449 Remove pad from struct input_event.
4450 * termhooks.h (struct input_event): Remove padding field.
4451 Adjust comment.
4452 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4453 member is never cons for a long time. Adjust comment.
4454 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4455 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4456 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4457 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4458
7e8b50d9
EZ
44592012-11-01 Eli Zaretskii <eliz@gnu.org>
4460
4461 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4462
322aea6d
PE
44632012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4464
4465 Fix crash when using Emacs as commit editor for git (Bug#12697).
4466 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4467 and it is configured in conf_post.h.
4468 (Fcall_process): Don't invoke both setsid and setpgid; the former
4469 is enough, if it exists.
4470 * callproc.c (Fcall_process, child_setup):
4471 * process.c (create_process): Use setpgid.
4472 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4473 for the real thing.
4474 * dispnew.c (init_display): Initialize the foreground group
4475 if we are running a tty display.
4476 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4477 * lisp.h (init_foreground_group): New decl.
4478 * sysdep.c (inherited_pgroup): New static var.
4479 (init_foreground_group, tcsetpgrp_without_stopping)
4480 (narrow_foreground_group, widen_foreground_group): New functions.
4481 (init_sys_modes): Narrow foreground group.
4482 (reset_sys_modes): Widen foreground group.
4483
220cb2bd
MA
44842012-10-31 Michael Albinus <michael.albinus@gmx.de>
4485
4486 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4487
218e997a
MR
44882012-10-31 Martin Rudalics <rudalics@gmx.at>
4489
4490 * minibuf.c (read_minibuf): Restore current buffer since
4491 choose_minibuf_frame calling Fset_frame_selected_window may
4492 change it (Bug#12766).
4493
02615da0
JD
44942012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4495
4496 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4497
aee5b18e
KH
44982012-10-30 Kenichi Handa <handa@gnu.org>
4499
4500 * font.c (Ffont_at): If WINDOW is specified and it is not
4501 displaying the current buffer, signal an error.
4502
ba116008
DC
45032012-10-29 Daniel Colascione <dancol@dancol.org>
4504
de5ef41a
SM
4505 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4506 In preparation for fixing bug#12739, move these functions from
ba116008
DC
4507 here...
4508
4509 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
4510 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4511 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 4512
640bf8ad
EZ
45132012-10-28 Eli Zaretskii <eliz@gnu.org>
4514
4515 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4516 (timer_loop, getitimer, setitimer): Use it instead of
4517 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4518 'clock'.
4519 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4520 literal 10000.
4521
64ccff5f
JD
45222012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4523
4524 * nsterm.m (NO_APPDEFINED_DATA): New define.
4525 (last_appdefined_event_data): New variable
4526 (last_appdefined_event): Remove.
4527 (ns_select): Initialize t from last_appdefined_event_data instead
4528 of [last_appdefined_event data1].
4529 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4530 remove last_appdefined_event (Bug#12698).
4531
e483264c
SM
45322012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4533
4534 * frame.c (x_set_font): Catch internal error.
4535
6c16c13e
EZ
45362012-10-27 Eli Zaretskii <eliz@gnu.org>
4537
e483264c
SM
4538 Avoid overflow in w32 implementation of interval timers.
4539 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
4540 actually executes.
4541 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
4542 'volatile ULONGLONG' types. All the other data which was
4543 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
4544 (GetThreadTimes_Proc): New typedef.
4545 (w32_get_timer_time): New function, returns a suitable time value
4546 for the timer.
4547 (timer_loop): Enter critical section when accessing ULONGLONG
4548 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
4549 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4550 Remove unused variable.
6c16c13e
EZ
4551 (init_timers): Initialize s_pfn_Get_Thread_Times.
4552 (start_timer_thread): Don't assign itimer->caller_thread here.
4553 (getitimer): Assign itimer->caller_thread here.
4554 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 4555 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 4556
ccc83f50
EZ
45572012-10-26 Eli Zaretskii <eliz@gnu.org>
4558
4559 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4560 mouse movement events if the menu bar is active. This avoids
4561 producing a busy "hour-glass" cursor by Windows if the mouse
4562 pointer is positioned over a tooltip shown for some menu item.
4563
69deda53
PE
45642012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4565
4566 Don't assume process IDs fit in int.
4567 * emacs.c (shut_down_emacs) [!DOS_NT]:
4568 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4569 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4570 Use pid_t, not int, to store process IDs, as 'int'
4571 is not wide enough on a few platforms (e.g., AIX and IRIX).
4572
7e70a152
KH
45732012-10-23 Kenichi Handa <handa@gnu.org>
4574
4575 The following change is to make face-font-rescale-alist work
4576 correctly for non-ASCII fonts.
4577
4578 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4579 (font_open_for_lface): Handle Vface_font_rescale_alist.
4580
49238e7f
CY
45812012-10-23 Chong Yidong <cyd@gnu.org>
4582
4583 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4584
5ec86886
JD
45852012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4586
ef446959
JD
4587 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4588 for screen font.
4589 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4590
5ec86886
JD
4591 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4592 event (Bug#12681).
4593
ee7a418d
GM
45942012-10-21 Glenn Morris <rgm@gnu.org>
4595
4596 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4597
4973679b
PE
45982012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4599
4600 Port to OpenBSD 5.1.
4601 * frame.c (Fmouse_position, Fmouse_pixel_position):
4602 * xdisp.c (produce_stretch_glyph):
4603 Declare local vars only when they're needed.
4604 This is clearer and avoids a warning on OpenBSD about unused vars.
4605 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4606 This is safer, and avoids OpenBSD warnings about unused vars.
4607 * keyboard.c (record_menu_key): Remove unnecessary decl.
4608 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4609 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4610 as our definition clashes with OpenBSD's.
4611 * xfaces.c (load_face_colors, check_lface_attrs)
4612 (get_lface_attributes_no_remap, get_lface_attributes)
4613 (lface_fully_specified_p, x_supports_face_attributes_p)
4614 (tty_supports_face_attributes_p, face_fontset, realize_face)
4615 (realize_x_face, realize_tty_face):
4616 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4617 merely Lisp_Object *. This is more informative and avoids
4618 a warning on OpenBSD about accessing beyond an object's size.
4619
c664f463
CY
46202012-10-20 Chong Yidong <cyd@gnu.org>
4621
4622 * lread.c (Fload): Doc fix (Bug#12592).
4623
6ec83f92 46242012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
4625
4626 * font.c (Ffont_at): Fix previous change.
4627
d2824928
EZ
46282012-10-19 Eli Zaretskii <eliz@gnu.org>
4629
e483264c
SM
4630 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4631 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
4632 for the reasons.
4633
d2824928
EZ
4634 * alloc.c (NSTATICS): Decrease to 0x800.
4635
f60d391f
SM
46362012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4637
4a0e1924 4638 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
4639 error (bug#12677).
4640
1a9327d5
JD
46412012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4642
4643 * nsterm.m (ns_select): Check writefds before call to
4644 FD_ISSET (Bug#12668).
4645
14145a1e
DC
46462012-10-18 Daniel Colascione <dancol@dancol.org>
4647
4648 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4649 (staticpro): If we run out of staticpro slots, die with an
4650 informative error instead of just calling emacs_abort.
4651
1f76f6f5
MR
46522012-10-18 Martin Rudalics <rudalics@gmx.at>
4653
4654 Fix two flaws reported by Dmitry Antipov.
4655 * window.c (Ftemp_output_buffer_show): Remove.
4656 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4657 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4658
fcf14875
EZ
46592012-10-17 Eli Zaretskii <eliz@gnu.org>
4660
1f76f6f5
MR
4661 * makefile.w32-in ($(BLD)/w32.$(O)):
4662 ($(BLD)/vm-limit.$(O)):
4663 ($(BLD)/term.$(O)):
4664 ($(BLD)/unexw32.$(O)):
4665 ($(BLD)/fileio.$(O)):
a68089e4
EZ
4666 ($(BLD)/dispnew.$(O)): Update dependencies.
4667
4668 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4669 Add prototypes.
4670
4671 * w32proc.c: Include ctype.h.
4672
4673 * w32.h (init_environment, check_windows_init_file)
4674 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4675 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4676 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4677 (sys_link): Add prototypes.
4678
4679 * w32.c: Include w32select.h.
4680 (sys_access, e_malloc, sys_select): Add prototypes.
4681 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4682
4683 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4684
4685 * unexw32.c: Include lisp.h and w32.h.
4686
4687 * term.c [WINDOWSNT]: Include w32term.h.
4688
4689 * process.c [WINDOWSNT]: Add prototype of sys_select.
4690
4691 * fileio.c [WINDOWSNT]: Include w32.h.
4692
4693 * dispnew.c [WINDOWSNT]: Include w32.h.
4694
fcf14875
EZ
4695 * cygw32.c (Fcygwin_convert_path_to_windows)
4696 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4697 Lisp_Object values. (Bug#12661)
4698
4699 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4700 to Lisp_Object. (Bug#12661)
4701
fe0b1ec4
KH
47022012-10-17 Kenichi Handa <handa@gnu.org>
4703
4704 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4705 invalidate.
4706
d556ebf9
DA
47072012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4708
4709 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 4710 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 4711
f0863a54
DA
47122012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4713
4714 Do not verify indirection counters of killed buffers (Bug#12579).
4715 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4716 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4717
12fbe755
DA
47182012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4719
4720 * alloc.c (Fmake_byte_code): Fix typo in comment.
4721 * print.c (print_interval): Define as static to match prototype.
4722 * indent.c (disptab_matches_widthtab, recompute_width_table):
4723 Convert to eassert.
4724
61655b89
DA
47252012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4726
4727 * editfns.c (get_system_name): Remove.
4728 * lisp.h (get_system_name): Remove prototype.
4729 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4730 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4731
9520f2f2
DC
47322012-10-15 Daniel Colascione <dancol@dancol.org>
4733
4734 * dbusbind.c: Add comment explaining reason for previous change.
4735
dca778d5
MR
47362012-10-15 Martin Rudalics <rudalics@gmx.at>
4737
4738 * window.c (Fwindow_end): Rewrite check whether cached position
4739 can be used (Bug#12600).
4740 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4741 Set windows_or_buffers_changed.
4742
3e0341b0
DC
47432012-10-15 Daniel Colascione <dancol@dancol.org>
4744
4745 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4746 enabled by undefining the symbol "interface", which the platform
4747 headers define to something incompatible.
4748
33d4113c
DC
47492012-10-14 Daniel Colascione <dancol@dancol.org>
4750
4751 * image.c (init_tiff_functions, init_imagemagick_functions)
4752 (init_svg_functions): Fix cygw32 build break by using these
4753 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4754
a36fb15e
JD
47552012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4756
4757 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4758
537f336d
JD
47592012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4760
4761 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4762
0ba06a77
KH
47632012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4764
4765 * coding.c (detect_coding): Set coding->id before calling
4766 this->detector.
4767
ce2fe65a
AS
47682012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4769
4770 * fileio.c: Formatting fixes.
4771
d6453ce4
PE
47722012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4773
4774 Fix some stat-related races.
4775 * fileio.c (Fwrite_region): Avoid race condition if a file is
4776 removed or renamed by some other process immediately after Emacs
4777 writes it but before Emacs stats it. Do not assume that stat (or
4778 fstat) succeeds.
4779 * image.c (slurp_file): Resolve the file name with fopen + fstat
4780 rather than stat + fopen.
4781 (pbm_read_file) [0]: Remove unused code with stat race.
4782 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4783 Remove ineffective code with stat race.
4784
06485aa8
SM
47852012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4786
4787 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4788
167e3640
JD
47892012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4790
4791 * nsterm.m (hold_event_q): New static variable.
4792 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4793 ! q_event_ptr.
4794 (hold_event): New function.
4795 (ns_read_socket): If hold_event_q have events, store them and
4796 return (Bug#12384).
4797 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4798 is zero (Bug#12384).
4799
c40239df
JB
48002012-10-12 Juanma Barranquero <lekktu@gmail.com>
4801
4802 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4803
bb385a92
EZ
48042012-10-12 Eli Zaretskii <eliz@gnu.org>
4805
2a9f1099
EZ
4806 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4807
bb385a92
EZ
4808 * fileio.c (check_existing): New function.
4809 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4810 instead of calling 'stat', when what's needed is to check whether
4811 a file exists. This avoids expensive system calls on MS-Windows.
4812 (Bug#12587)
4813
8599b23a 4814 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
4815
4816 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4817 determine whether a file exists and is not a directory.
4818
4819 * lisp.h (check_existing): Add prototype.
4820
2b9c2e68
JD
48212012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4822
4823 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4824
81749a23
GM
48252012-10-12 Glenn Morris <rgm@gnu.org>
4826
4827 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4828
5253a5fd
SM
48292012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4830
389a94a5
SM
4831 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4832
5253a5fd
SM
4833 * eval.c (Fautoload): Remember previous autoload status in load-history.
4834
7cded46f
PE
48352012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4838 * lread.c (load_each_byte, new_backquote_flag, readchar)
4839 (read_filtered_event, lisp_file_lexically_bound_p)
4840 (safe_to_load_version, Fload, complete_filename_p, openp)
4841 (build_load_history, readevalloop, read_escape, read1)
4842 (string_to_number, read_vector, read_list):
4843 * macros.c (Fstart_kbd_macro):
4844 * marker.c (CONSIDER):
4845 * menu.c (parse_single_submenu, digest_single_submenu)
4846 (find_and_return_menu_selection, Fx_popup_menu):
4847 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4848 (Ftry_completion):
4849 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4850 (ns_menu_show):
4851 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4852 (xmenu_show, xdialog_show):
4853 Use bool for booleans.
4854 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4855 as it's not a predicate. All uses changed. Omit unnecessary
4856 buffer termination.
4857
549c3414
DA
48582012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4859
4860 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4861 (save_excursion_restore): Do not restore mark if it was not saved.
4862
e85aafe7
PE
48632012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4864
fd2f90cf
PE
4865 * marker.c (cached_modiff): EMACS_INT, not int.
4866
c1af190b
PE
4867 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4868 instead of having a wrong decl.
e85aafe7
PE
4869 * nsmenu.m (waiting_for_input): Remove wrong decl.
4870
e738ca56
PE
48712012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4872
9fa1de30
PE
4873 keyboard.c, keymap.c: Use bool for booleans.
4874 * dispnew.c (sit_for): Distinguish between 3-way display_option
4875 and boolean do_display.
4876 * keyboard.c (single_kboard, this_command_key_count_reset)
4877 (waiting_for_input, echoing, immediate_quit, input_pending)
4878 (interrupt_input, interrupts_deferred, pop_kboard)
4879 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4880 (command_loop_1, adjust_point_for_property)
4881 (safe_run_hooks_error, input_polling_used, read_char):
4882 (help_char_p, readable_events, kbd_buffer_events_waiting)
4883 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4884 (lucid_event_type_list_p, get_input_pending):
4885 (gobble_input, menu_separator_name_p, menu_bar_item)
4886 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4887 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4888 (keyremap_step, test_undefined, read_key_sequence)
4889 (detect_input_pending, detect_input_pending_ignore_squeezables)
4890 (detect_input_pending_run_timers, requeued_events_pending_p)
4891 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4892 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4893 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4894 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4895 (accessible_keymaps_1, Fkey_description, push_key_description):
4896 (shadow_lookup, struct where_is_internal_data)
4897 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4898 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4899 (describe_map, describe_vector):
4900 * menu.c (single_menu_item):
4901 * nsmenu.m (ns_update_menubar):
4902 * process.c (wait_reading_process_output):
4903 * search.c (scan_buffer, scan_newline):
4904 Use bool for boolean.
4905 * keyboard.c (timers_run, swallow_events)
4906 (detect_input_pending_run_timers):
4907 * process.c (wait_reading_process_output):
4908 Use unsigned for counter where wraparound-on-overflow is desired,
4909 since unsigned is guaranteed to have that behavior and signed is not.
4910 (read_char): Use ptrdiff_t for string length.
4911 (get_input_pending): Remove first argument, since it was always
4912 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4913 and behave as if it had that value. Return new value of
4914 input_pending. All callers changed.
4915 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4916 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4917 a string length.
4918 * keymap.c (push_key_description): Omit last arg, which was always 1.
4919 All callers changed.
4920
e738ca56
PE
4921 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4922
29f21cdf
JB
49232012-10-10 Juanma Barranquero <lekktu@gmail.com>
4924
4925 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4926 ($(BLD)/term.$(O)): Update dependencies.
4927
6aea7528
DA
49282012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4929
4930 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4931 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4932 initializer for PVEC_NORMAL_VECTOR.
4933
5f3f57be
PE
49342012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4935
4936 Clean out old termopts cruft.
4937 * termopts.h (flow_control, meta_key): Remove unused decls.
4938 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4939 Don't include termopts.h.
4940
3e98c68e
DA
49412012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4942
4943 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4944
77e344e5
PE
49452012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4946
4947 * commands.h (immediate_quit): Remove duplicate decl.
4948
5683d7cd
JD
49492012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4950
4951 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4952 caching.
4953 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 4954 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 4955
cf5fc6db
EZ
49562012-10-09 Eli Zaretskii <eliz@gnu.org>
4957
b15736e6
EZ
4958 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4959 match what GetLastError returns. Explain why the function is
4960 needed.
4961
cf5fc6db
EZ
4962 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4963 'is_tooltip_frame', to avoid confusion with its global namesake.
4964
f99714ce
DC
49652012-10-08 Daniel Colascione <dancol@dancol.org>
4966
4967 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
4968 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4969 build that caused Emacs to display the hourglass cursor forever.
f99714ce 4970
fd59cb29
GM
4971 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4972 which is broken under remote desktop, calculate the number of
4973 colors available for a display based on the display's number of
4974 planes and number of bits per pixel per plane. (bug#10397).
4975
62c480c9 49762012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 4977
62c480c9
JD
4978 * nsfont.m (Vfonts_in_cache): New variable.
4979 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4980 are used. Add cached fonts to Vfonts_in_cache.
4981 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4982
607446ba
JB
49832012-10-08 Juanma Barranquero <lekktu@gmail.com>
4984
fd5125ad
JB
4985 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4986 in nt/config.nt.
46979e0b
JB
4987 (FONT_H): Define after FRAME_H.
4988 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4989 Update dependencies.
fd5125ad 4990
607446ba
JB
4991 * w32term.c: Remove leftover declaration of keyboard_codepage.
4992
b6f4e300
EZ
49932012-10-08 Eli Zaretskii <eliz@gnu.org>
4994
c54ebba4
EZ
4995 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4996 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4997 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4998 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
4999 ($(BLD)/unexw32.$(O)):
5000 ($(BLD)/w32.$(O)):
5001 ($(BLD)/w32console.$(O)):
5002 ($(BLD)/w32fns.$(O)):
5003 ($(BLD)/w32heap.$(O)):
5004 ($(BLD)/w32menu.$(O)):
15c720a3 5005 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 5006
b6f4e300
EZ
5007 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5008 'const char *'.
5009 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5010
501199a3
DC
50112012-10-08 Daniel Colascione <dancol@dancol.org>
5012
5013 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5014 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5015 accidental message numbering hole. Change other messages to
5016 match.
5017
5018 * w32select.h (HAVE_W32SELECT): Remove.
5019
5020 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 5021 w32common.h instead of w32heap.h.
501199a3
DC
5022
5023 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5024 (get_allocation_unit, get_processor_type, get_w32_major_version)
5025 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5026 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5027 (OS_NT, os_subtype, cache_system_info): Move declarations to
5028 w32common.
5029
5030 * w32heap.c: Include w32common.h.
5031 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
5032 (w32_minor_version, w32_build_number, w32_subtype):
5033 Remove duplicate definitions.
501199a3
DC
5034
5035 * w32fns.c: Include w32common.h; include w32heap.h only in
5036 WINDOWSNT.
5037
5038 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5039 Use `report_file_error' instead of `error' in order to better
5040 inform users of what went wrong. Increase NTGUI_UNICODE file
5041 dialog box file name length to 32k, the maximum allowed by the NT
5042 kernel.
5043
5044 * w32common.h: New file.
5045 (ROUND_UP, ROUND_DOWN, get_page_size)
5046 (get_allocation_unit, get_processor_type, get_w32_major_version)
5047 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5048 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5049 (OS_NT, os_subtype, cache_system_info): Move here.
5050
5051 * unexw32.c, unexcw.c: Include w32common.h.
5052
5053 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5054 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5055 to call syms_of_w32select.
5056
5057 * cygw32.h: Remove obsolete EXFUN declarations.
5058
5059 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5060
5061 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5062 of w32inevt.o from SOME_MACHINE_OBJECTS.
5063
93aa5c81
DC
50642012-10-08 Daniel Colascione <dancol@dancol.org>
5065
5066 * image.c: Permanent fix for JPEG compilation issue --- limit
5067 jpeglib `boolean' redefinition to Cygwin builds.
5068
d424f3d8
EZ
50692012-10-08 Eli Zaretskii <eliz@gnu.org>
5070
8ee4c6ce
EZ
5071 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5072
d424f3d8
EZ
5073 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5074 Cygwin.
5075
e08348a0
DC
50762012-10-08 Daniel Colascione <dancol@dancol.org>
5077
5078 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5079 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5080 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5081 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5082 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5083 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5084 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5085 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5086 now a supported configuration.
5087
5088 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 5089 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
5090
5091 * conf_post.h:
5092 (_DebPrint) declare tracing facility for W32 debugging. We need
5093 to unify tracing later.
5094
5095 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5096 unconditional use of W32 Unicode functions. Cygwin runs only on
5097 100% Unicode operating systems.
5098
5099 * cygw32.c: New file. Define Cygwin-specific facilities.
5100 (Fcygwin_convert_path_to_windows)
5101 (Fcygwin_convert_path_from_windows): New user functions for
5102 accessing Cygwin path-munging routines.
5103
5104 * cygw32.h: New file.
5105 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5106 UTF-16LE strings temporarily inside non-Lisp-visible string
5107 objects.
5108
5109 (w32_strerror): Just what it says on the tin.
5110
5111 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5112 also run for Cygwin; both systems have the same problem with using
5113 GUI facilities in a forked child. Also call syms_of_cygw32,
5114 syms_of_w32select in correct places.
5115
5116 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5117 needs fork-then-exec for daemon launching.
5118
5119 * font.h: Include frame.h.
5120
5121 * image.c: Use the image library cache machinery only when we're
5122 compiling for native WINDOWSNT; Cygwin can use shared libraries
5123 like any other Unixlike system.
5124
5125 * keyboard.c: Clarify a comment regarding the input loop.
5126
5127 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5128 functions directly instead of trying to detect at runtime that our
5129 host operating system supports them. We make this change for two
5130 reasons: Cygwin lacks support for the multibyte character
5131 conversion functions used by the legacy menu code, and Cygwin
5132 never needs to rely on non-Unicode APIs.
5133
5134 * unexw32.c (hinst): Declare extern.
5135
5136 * w32.c: Change header order;
5137 (w32_strerror): Move to w32fns.c because we need it for
5138 non-WINDOWSNT builds.
5139
5140 * w32.h: Add #error macro to make sure we don't include w32.h for
5141 Cygwin builds. Remove w32select declarations.
5142
5143 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 5144 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
5145
5146 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5147 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5148 POSIXy alternative.
5149 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5150 (w32_major_version, w32_minor_version, w32_build_number)
5151 (os_subtype, sound_type): Define here
5152 (w32_defined_color): Make color parameter const for consistency
5153 with other _defined_color functions.
5154 (w32_createwindow): Unconditionally call w32_init_class instead of
5155 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5156 through the code is complex and unnecessary because class
5157 registration is practically free.
5158 (w32_name_of_message): New EMACSDEBUG-only function.
5159 (Fset_message_beep): Move here
5160 (Fx_open_connection): Require that the display name for Windows be
5161 "w32" for consistency, emacsclient disambiguation, and maybe, one
5162 day, multi-window-system support.
5163 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5164 Cygwin files for W32 GUI facilities, since these clearly don't
5165 expect Cygwin names.
5166 (_DebPrint): Define.
5167 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5168 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5169 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5170 (w32_last_error): Remove.
5171
5172 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5173
5174 * w32heap.c (syspage_mask): Declare here.
5175 (cache_system_info): Remove.
5176
5177 * w32inevt.c (faked_key): Define globally, not statically.
5178 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5179 (w32_console_toggle_lock_key): Move to w32fns.c.
5180
5181 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5182
5183 * w32proc.c (_DebPrint): Move to w32fns.c.
5184 * w32select.c: Include string.h, stdio.h for Cygwin.
5185 * w32select.h: New File.
5186
5187 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5188 get_osfhandle.
5189 (w32_message_fd): New variable. Under Cygwin, holds the file
5190 descriptor the system used to tell us about pending thread
5191 messages.
5192
5193 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5194 that prevented compilation under non-WINDOWSNT systems.
5195
5196 (w32_initialize): Open /dev/windows and assign it to
5197 w32_message_fd. Provide w32 feature.
5198
5199 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5200 (WM_EMACS_INPUT_READY): add.
5201 (prepend_msg, w32_message_fd): Declare globally.
5202
5203 * w32xfns.c:
5204 (keyboard_handle): Use only when WINDOWSNT.
5205 (notify_msg_ready): New function. Posts a message to the main
5206 thread's message queue under CYGWIN, which wakes up the main
5207 thread from select(2) by making the /dev/windows file descriptor
5208 ready. Under WINDOWSNT, it sets an event the same way the old
5209 code did.
5210
5211 (post, prepend_msg): Actually call notify_msg_ready instead of
5212 setting the input event directly.
5213
98daa893
EZ
52142012-10-07 Eli Zaretskii <eliz@gnu.org>
5215
5216 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5217 but it still has blocs in it, don't return it to the system,
5218 instead of aborting. (Bug#12402)
5219
3bc0a2f7
JD
52202012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5221
8ad5b73b 5222 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 5223
335f5ae4
JD
5224 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5225 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
5226 (syms_of_nsterm): Remove comment about Panther and above for
5227 ns-antialias-text.
335f5ae4
JD
5228 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5229 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5230 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5231
5232 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5233 MAC_OS_X_VERSION_10_4.
5234
8ad5b73b
JD
5235 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5236 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
5237
5238 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5239
5240 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5241 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5242
3bc0a2f7
JD
5243 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5244 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
5245 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5246 Remove ns_in_resize check.
3bc0a2f7
JD
5247 (ns_clear_frame_area): Remove resize handle code.
5248
5249 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
5250 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5251 Remove ns_in_resize check.
3bc0a2f7 5252
c622b48f
PE
52532012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5254
5255 Improve sys_siglist detection.
5256 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5257 defined as a macro, as is done in Solaris.
5258 (sys_siglist_entries): New macro.
5259 (save_strsignal): Use it.
5260 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5261 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5262
04fafa46
JD
52632012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5264
5265 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5266 fullscreen/Fullscreen.
5267
5268 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5269 tobar_height is new.
5270
5271 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5272 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5273 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5274 (windowDidResize:): Check for correct window if old style fullscreen.
5275 Capitalize word in comment. Remove incorrect comment.
5276 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5277 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5278 error in drawing background.
1f9f395d 5279 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
5280 Set toolbar values to zero, save old height in tobar_height.
5281 Restore tool bar height when leaving fullscreen.
5282 (canBecomeMainWindow): New function.
5283
c6e21c03
PE
52842012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5285
5286 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5287
0d9f584b
EZ
52882012-10-05 Eli Zaretskii <eliz@gnu.org>
5289
a65fbb5f
EZ
5290 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5291
0d9f584b 5292 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
5293 that time stamps of directories could also be changed.
5294 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
5295 FILE_WRITE_ATTRIBUTES access rights.
5296
5297 * fileio.c (Fset_file_times): Special-case ignoring errors for
5298 directories only on MSDOS, not on MS-Windows.
5299
e8757f09 53002012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
5301
5302 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5303
7604f298
EZ
53042012-10-04 Eli Zaretskii <eliz@gnu.org>
5305
5306 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5307 see whether CreateFile failed.
5308
88d69b7d
PE
53092012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5310
5311 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5312 to avoid similar races.
5313 * keyboard.c (pending_signals): Now bool, not int.
5314
7509f454
PE
5315 Port timers to OpenBSD, plus check for timer failures.
5316 OpenBSD problem reported by Han Boetes.
5317 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5318 and/or setitimer.
5319 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5320 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5321 like OpenBSD, which has timer_settime but does not declare it.
5322 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5323 whether to use itimerspec-related primitives. All uses of
5324 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5325
a3c5c0c5
PE
53262012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5327
5328 * profiler.c (handle_profiler_signal): Fix a malloc race
5329 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5330
914e743b
JD
53312012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5332
5333 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5334
d8ab37a8
EZ
53352012-10-02 Eli Zaretskii <eliz@gnu.org>
5336
5337 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5338 consistent with the change in return value of 'safe_strsignal'.
5339
b3ecad33
PE
53402012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5341
0a99eee1
PE
5342 Prefer plain 'static' to 'static inline' (Bug#12541).
5343 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5344 (bidi_set_sor_type, bidi_push_embedding_level)
5345 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5346 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5347 (bidi_cache_search, bidi_cache_ensure_space)
5348 (bidi_cache_iterator_state, bidi_cache_find)
5349 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5350 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5351 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5352 Now 'static', not 'static inline'.
5353
b3ecad33
PE
5354 Count overruns when profiling; change units to ns.
5355 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5356 Give extra weight to samples after overruns, to attempt to count
5357 the time more accurately.
5358 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5359 the underlying primitives nominally do ns.
5360 (Fprofiler_cpu_start): Document the change. Mention that
5361 the sampling intervals are only approximate.
5362
090cf9db
SM
53632012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5364
5365 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5366
5367 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5368 case for the special 0 coding-system.
5369
5370 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5371 (Fmake_overlay): Remove redundant tests.
64edc777 5372 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 5373
81550bf4
JB
53742012-10-02 Juanma Barranquero <lekktu@gmail.com>
5375
5376 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5377 Update dependencies.
5378
aa1ba90e
PE
53792012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5380
5381 Fix a malloc race condition involving strsignal.
5382 A signal can arrive in the middle of a malloc, and Emacs's signal
5383 handler can invoke strsignal, which can invoke malloc, which is
5384 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5385 Fix it by altering the signal handler so that it does not invoke
5386 strsignal.
5387 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5388 * process.c (status_message): Use const pointer, in case strsignal
5389 is #defined to safe_strsignal.
5390 * sysdep.c (sys_siglist, init_signals): Always define and
5391 initialize a substitute sys_siglist if the system does not define
5392 one, even if HAVE_STRSIGNAL.
5393 (safe_strsignal): Rename from strsignal. Always define,
5394 using sys_siglist. Return a const pointer.
5395 * syssignal.h (safe_strsignal): New decl.
5396 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5397
ace917bd
EZ
53982012-10-01 Eli Zaretskii <eliz@gnu.org>
5399
5400 * w32proc.c (timer_loop): Fix code that waits for timer
5401 expiration, to avoid high CPU usage.
5402
9eb71b9c
SM
54032012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5404
5405 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5406 (sweep_weak_table): Remove redundant prototypes.
5407
b3317662
FP
54082012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5409
5410 * emacs.c: Move the inclusion of TERM_HEADER after including
5411 windows.h on WINDOWSNT. This avoids compilation problems with
5412 MSVC.
5413
f0e5f225
EZ
54142012-10-01 Eli Zaretskii <eliz@gnu.org>
5415
2d7d1608
EZ
5416 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5417 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5418 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5419 as the previous version used 'void *'.
5420
5421 * ralloc.c (ROUNDUP): Fix last change.
5422 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5423 'size_t'.
5424
f0e5f225
EZ
5425 * w32proc.c <disable_itimers>: New static flag.
5426 (init_timers): Initialize it to zero, after creating the critical
5427 sections used by the timer threads.
5428 (term_timers): Set to 1 before deleting the critical sections.
5429 (getitimer, setitimer): If disable_itimers is non-zero, return an
5430 error indication without doing anything. Reported by Fabrice
5431 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
5432 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5433 return results.
5434 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5435 support timers.
f0e5f225
EZ
5436
5437 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5438 term_ntproc after all the other bookkeeping, to get timers working
5439 as long as possible.
5440
82ef37c1
PE
54412012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5442
b3a4c387
PE
5443 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5444 Suggested by Juri Linkov in
5445 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5446
b0ab8123
PE
5447 Prefer plain 'static' to 'static inline' (Bug#12541).
5448 With static functions, modern compilers inline pretty well by
5449 themselves; advice from programmers often hurts as much as it helps.
5450 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5451 this change shrinks the text size of the Emacs executable by 1.1%
5452 without affecting CPU significantly in my benchmark.
5453 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5454 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5455 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5456 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5457 (bset_auto_fill_function, bset_auto_save_file_format)
5458 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5459 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5460 (bset_cache_long_line_scans, bset_case_fold_search)
5461 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5462 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5463 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5464 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5465 (bset_header_line_format, bset_indicate_buffer_boundaries)
5466 (bset_indicate_empty_lines, bset_invisibility_spec)
5467 (bset_left_fringe_width, bset_major_mode, bset_mark)
5468 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5469 (bset_name, bset_overwrite_mode, bset_pt_marker)
5470 (bset_right_fringe_width, bset_save_length)
5471 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5472 (bset_scroll_up_aggressively, bset_selective_display)
5473 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5474 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5475 (set_buffer_overlays_after):
5476 * category.c (bset_category_table):
5477 * charset.c (read_hex):
5478 * coding.c (produce_composition, produce_charset)
5479 (handle_composition_annotation, handle_charset_annotation)
5480 (char_encodable_p):
5481 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5482 (assign_row, set_frame_matrix_frame, make_current)
5483 (add_row_entry):
5484 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5485 * fns.c (maybe_resize_hash_table):
5486 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5487 * gmalloc.c (register_heapinfo):
5488 * image.c (lookup_image_type):
5489 * intervals.c (set_interval_object, set_interval_left)
5490 (set_interval_right, copy_interval_parent, rotate_right)
5491 (rotate_left, balance_possible_root_interval):
5492 * keyboard.c (kset_echo_string, kset_kbd_queue)
5493 (kset_keyboard_translate_table, kset_last_prefix_arg)
5494 (kset_last_repeatable_command, kset_local_function_key_map)
5495 (kset_overriding_terminal_local_map, kset_real_last_command)
5496 (kset_system_key_syms, clear_event, set_prop):
5497 * lread.c (digit_to_number):
5498 * marker.c (attach_marker, live_buffer, set_marker_internal):
5499 * nsterm.m (ns_compute_glyph_string_overhangs):
5500 * process.c (pset_buffer, pset_command)
5501 (pset_decode_coding_system, pset_decoding_buf)
5502 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5503 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5504 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5505 * syntax.c (bset_syntax_table, dec_bytepos):
5506 * terminal.c (tset_param_alist):
5507 * textprop.c (interval_has_some_properties)
5508 (interval_has_some_properties_list):
5509 * window.c (wset_combination_limit, wset_dedicated)
5510 (wset_display_table, wset_hchild, wset_left_fringe_width)
5511 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5512 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5513 (wset_right_fringe_width, wset_right_margin_cols)
5514 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5515 (wset_vertical_scroll_bar_type, wset_window_parameters):
5516 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5517 (wset_column_number_displayed, wset_region_showing)
5518 (window_box_edges, run_window_scroll_functions)
5519 (append_glyph_string_lists, prepend_glyph_string_lists)
5520 (append_glyph_string, set_glyph_string_background_width)
5521 (append_glyph, append_composite_glyph)
5522 (take_vertical_position_into_account):
5523 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5524 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5525 (lface_hash, lface_same_font_attributes_p, lookup_face):
5526 * xml.c (libxml2_loaded_p):
5527 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5528 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5529 Now 'static', not 'static inline'.
5530
05584c31
PE
5531 * bidi.c: Tune.
5532 (bidi_copy_it): Do the whole copy with a single memcpy.
5533 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5534
86ec63ba
PE
5535 Revert the FOLLOW-SYMLINKS change for file-attributes.
5536 Doing it right would require several changes to Tramp, and there's
5537 not enough time to get that tested before the freeze today.
5538 * dired.c (directory_files_internal, Ffile_attributes):
5539 Undo last change.
5540
82ef37c1
PE
5541 * frame.c (x_report_frame_params): Port better to wider ints.
5542 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5543 or that pointers can be printed in 15 decimal digits.
5544 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5545
62aba0d4
FP
55462012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5547
5548 Support x64 build on MS-Windows.
5549 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5550 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5551 compatibility with x64.
5e4daaf3 5552 (x_get_focus_frame): Add prototype.
62aba0d4
FP
5553
5554 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5555 defining an XRectangle structure.
5556
5557 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5558 arithmetics for compatibility with x64.
5559
5560 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5561 compatibility with x64.
5562
5563 * w32heap.h: Adjust prototypes and declarations.
5564
5565 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5566 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5567 DWORD, long, and unsigned long, for compatibility with x64.
5568 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5569 (sbrk): Argument is now of type ptrdiff_t.
5570
5571 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5572 less than 0x0500.
5573 (w32_msg_pump): Use WPARAM type for 'result'.
5574
5575 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5576 architecture.
5577 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5578 compatibility with x64.
5579
5580 * vm-limit.c (lim_data): Now size_t.
5581 (check_memory_limits): Adjust prototypes of real_morecore and
5582 __morecore to receive argument of type ptrdiff_t. Use size_t for
5583 five_percent and data_size.
5584
5585 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5586 variables, for compatibility with x64.
5587 (rva_to_section, offset_to_section, relocate_offset)
5588 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5589 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5590 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5591 for compatibility with x64.
5592
5593 * sysdep.c (STDERR_FILENO): Define if not already defined.
5594
5595 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5596 (__morecore): Argument type is now ptrdiff_t.
5597 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5598 (relinquish): Use ptrdiff_t type for 'excess'.
5599 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5600
5601 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5602 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5603 instead of a literal number.
5604
5605 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5606 (min): Define only if not already defined.
5607
5608 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5609 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5610 hosts.
5611
5612 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5613 'bitmaps' is a pointer.
5614
5615 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5616
5617 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5618
e7a2937b
PE
56192012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5620
5621 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5622 * dired.c (directory_files_internal, Ffile_attributes):
5623 New arg follow_symlinks. All uses changed.
5624
b43d62ae
SM
56252012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5626
5627 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5628
c06c382a
EZ
56292012-09-30 Eli Zaretskii <eliz@gnu.org>
5630
5631 Support atimers and CPU profiler via profile.c on MS-Windows.
5632 * w32proc.c (sig_mask, crit_sig): New static variables.
5633 (sys_signal): Support SIGALRM and SIGPROF.
5634 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 5635 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
5636 sigfillset, and sigprocmask are no longer no-ops.
5637 (sigismember): New function.
5638 (struct itimer_data): New definition.
5639 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5640 (crit_prof): New static variables.
5641 (MAX_SINGLE_SLEEP): New definition.
5642 (timer_loop, stop_timer_thread, term_timers, init_timers)
5643 (start_timer_thread, getitimer, setitimer): New functions.
5644 (alarm): No longer a no-op, calls setitimer.
5645
5646 * w32.c (term_ntproc): Call term_timers.
5647 (init_ntproc): Make sure all signals are unblocked at startup, to
5648 erase any traces of dumping. Call init_timers.
5649
5650 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5651 Windows-specific code to display the hourglass mouse pointer is no
5652 longer used.
5653 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5654 to hourglass timer expiration.
5655 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5656 Remove, no longer used.
b43d62ae
SM
5657 (w32_note_current_window, show_hourglass, hide_hourglass):
5658 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
5659 window systems.
5660 (syms_of_w32fns): Don't initialize hourglass_timer.
5661
5662 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5663 WINDOWSNT as well.
5664 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5665
5666 * w32.h (init_timers, term_timers): Add prototypes.
5667
95402d5f
KH
56682012-09-30 Kenichi Handa <handa@gnu.org>
5669
5670 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5671 to the buffer relocation which may be caused by ccl_driver.
5672
dd946752
JD
56732012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5674
d7e642cc
JD
5675 * xfns.c (Fx_file_dialog): Update comment.
5676
5677 * w32fns.c (Fx_file_dialog): Update comment.
5678
5679 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5680 Initialize panel name field if OSX >= 10.6.
5681
5682 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5683
dd946752
JD
5684 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5685
5686 * nsterm.m (NEW_STYLE_FS): New define.
5687 (ns_fullscreen_hook, windowWillEnterFullScreen)
5688 (windowDidEnterFullScreen, windowWillExitFullScreen)
5689 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5690 (setFSValue): New functions.
5691 (EmacsFSWindow): New implementation.
5692 (canBecomeKeyWindow): New function for EmacsFSWindow.
5693 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5694 (dealloc): Release nonfs_window if in fullscreen.
5695 (updateFrameSize:): Call windowDidMove to update top/left.
5696 (windowWillResize:toSize:): Check if frame is still maximized.
5697 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5698 next_maximized, maximized_width, maximized_height and nonfs_window.
5699 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5700 tbar_height.
5701 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 5702 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
5703
5704 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5705 (EmacsView): Add variables for fullscreen.
5706 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5707 (EmacsFSWindow): New interface for fullscreen.
5708
427730eb
JB
57092012-09-30 Juanma Barranquero <lekktu@gmail.com>
5710
5711 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5712
48de8b12
CY
57132012-09-30 Chong Yidong <cyd@gnu.org>
5714
5715 * fns.c (Frandom): Doc fix.
5716
5938d519
MR
57172012-09-30 Martin Rudalics <rudalics@gmx.at>
5718
5719 * window.c (Vwindow_combination_limit): New default value.
5720 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5721
cb5b0266
PE
57222012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5723
5724 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5725 Suggested by Eli Zaretskii in
5726 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5727
84f72efd
EZ
57282012-09-30 Eli Zaretskii <eliz@gnu.org>
5729
5730 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5731 HAVE_TIMER_SETTIME is defined.
5732
9d4dcdc9
PE
57332012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5734
d89460ed
PE
5735 Profiler improvements: more-accurate timers, overflow checks.
5736 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5737 signal.h, setjmp.h. Include systime.h instead.
5738 (saturated_add): New function.
5739 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5740 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5741 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5742 New static vars.
84f72efd 5743 (enum profiler_cpu_running): New enum.
d89460ed
PE
5744 (profiler_cpu_running): Now of that enum type, not bool.
5745 All uses changed to store the new value.
5746 (handle_profiler_signal): Rename from sigprof_handler_1,
5747 for consistency with other handlers. Do not check whether
5748 cpu_log is a hash-table if garbage collecting, since it
5749 doesn't matter in that case.
5750 (deliver_profiler_signal): Rename from sigprof_handler,
5751 for consistency with other handlers.
5752 (setup_cpu_timer): New function, with much of what used to be in
5753 Fprofiler_cpu_start. Check for out-of-range argument.
5754 Prefer timer_settime if available, and prefer
5755 thread cputime clocks, then process cputime clocks, then
5756 monotonic clocks, to the old realtime clock. Use make_timeval
5757 to round more-correctly when falling back to setitimer.
5758 (Fprofiler_cpu_start): Use it.
5759 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5760 Don't assume that passing NULL as the 2nd argument of setitimer
5761 is the same as passing a pointer to all-zero storage.
5762 Ignore SIGPROF afterwards.
5763 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5764 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5765 non-fatal signal handlers. Ignore SIGPROF on startup.
5766 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5767 in profiler.c, since sysdep.c now uses it.
5768
9d4dcdc9
PE
5769 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5770 Suggested by Eli Zaretskii in
5771 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5772
8e5691a0
JB
57732012-09-29 Juanma Barranquero <lekktu@gmail.com>
5774
5775 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5776
e7c1b6ef
SM
57772012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5778
5779 * lisp.h (struct backtrace): Remove indirection for `function' field.
5780 * xdisp.c (redisplay_internal):
5781 * profiler.c (record_backtrace, sigprof_handler_1):
5782 * alloc.c (Fgarbage_collect):
5783 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5784 (Fbacktrace_frame): Adjust accordingly.
5785
e61d39cd 57862012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
5787
5788 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5789 (Frun_hook_with_args_until_failure): Doc fixes.
5790
404043ea
EZ
57912012-09-28 Eli Zaretskii <eliz@gnu.org>
5792
5793 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5794 Qautomatic_redisplay and change the symbol name. All users changed.
5795
704d3f45
TM
57962012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5797
5798 * profiler.c (sigprof_handler): Fix race condition.
5799
757140ff
GM
58002012-09-28 Glenn Morris <rgm@gnu.org>
5801
5802 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5803
a615a3ae
PE
58042012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5805
5806 Check more robustly for timer_settime.
89d17fd0
PE
5807 * Makefile.in (LIB_TIMER_TIME): New macro.
5808 (LIBES): Add it.
a615a3ae
PE
5809 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5810 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5811 call timer_settime.
5812
3670daf7
TM
58132012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5814
5815 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5816
6a586b7f
JB
58172012-09-26 Juanma Barranquero <lekktu@gmail.com>
5818
5819 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5820
41c8bfcf
PE
58212012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5822
5823 * character.h (MAYBE_UNIFY_CHAR): Remove.
5824 * charset.c, charset.h (maybe_unify_char): Now static.
5825 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5826 Since this stuff is now private to charset.c, there's no need for
5827 a public macro and no need to inline by hand.
5828
3a880af4 58292012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
908589fd
AS
5830 Stefan Monnier <monnier@iro.umontreal.ca>
5831 Juanma Barranquero <lekktu@gmail.com>
611b7507 5832
3a880af4
SM
5833 * profiler.c: New file.
5834 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
5835 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5836 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
5837 * emacs.c (main): Call syms_of_profiler.
5838 * alloc.c (Qautomatic_gc): New constant.
5839 (MALLOC_PROBE): New macro.
5840 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5841 (total_bytes_of_live_objects): New function.
5842 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5843 Call malloc_probe for the memory profiler.
5844 (syms_of_alloc): Define Qautomatic_gc.
5845 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5846 race condition.
5847 (struct backtrace): Move definition...
5848 * lisp.h (struct backtrace): ..here.
5849 (Qautomatic_gc, profiler_memory_running): Declare vars.
5850 (malloc_probe, syms_of_profiler): Declare functions.
5851 * xdisp.c (Qautomatic_redisplay): New constant.
5852 (redisplay_internal): Record itself in backtrace_list.
5853 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 5854
5938d519 58552012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
58562012-09-25 Juanma Barranquero <lekktu@gmail.com>
5857
5858 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5859
e26fd2e4
PE
58602012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5861
5862 Prefer POSIX timers if available.
5863 They avoid a race if the timer is too close to the current time.
5864 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5865 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 5866 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 5867
eedec3ee
EZ
58682012-09-25 Eli Zaretskii <eliz@gnu.org>
5869
5870 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5871 CHAR_STRING_ADVANCE.
5872 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5873 STRING_CHAR_ADVANCE.
5874
aa15c6bb
JB
58752012-09-25 Juanma Barranquero <lekktu@gmail.com>
5876
5877 Move Vlibrary_cache to emacs.c and reset before dumping.
5878
5879 * lisp.h (reset_image_types): Declare.
5880 [WINDOWSNT] (Vlibrary_cache): Declare.
5881
5882 * image.c (reset_image_types): New function.
5883
5884 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5885 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5886 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5887
5888 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5889 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5890
5891 * w32.h (Vlibrary_cache): Do not declare.
5892
54d629be
EZ
58932012-09-25 Eli Zaretskii <eliz@gnu.org>
5894
16b22fef
EZ
5895 * w32proc.c (sys_signal): Handle all signals defined by the
5896 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5897 handlers for signals supported by Windows. Don't override
5898 term_ntproc as the handler for SIGABRT.
5899 (sigaction): Rewrite to call sys_signal instead of duplicating its
5900 code.
5901 (sys_kill): Improve commentary.
5902
5903 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5904 consistency with a signature of a signal handler. All callers
5905 changed.
5906 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5907 install term_ntproc as a signal handler for SIGABRT, as that
5908 should be done by the dumped Emacs.
5909
5910 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5911
5912 * w32select.c (term_w32select): Protect against repeated
5913 invocation by setting clipboard_owner to NULL after calling
5914 DestroyWindow.
5915
5916 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5917 and term_ntproc to their modified signatures.
5918
54d629be
EZ
5919 * character.c (char_string, string_char): Remove calls to
5920 MAYBE_UNIFY_CHAR. See the discussion starting at
5921 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5922 for the details.
5923
59f7af81
CY
59242012-09-25 Chong Yidong <cyd@gnu.org>
5925
5926 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5927
22e8cf4a
SM
59282012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5929
5930 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5931 when encountering an unknown bytecode.
5932
578098f3
PE
59332012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5934
5935 image.c, indent.c: Use bool for booleans.
5936 * dispextern.h (struct image_type): Members valid_p, load, init
5937 now return bool, not int. All uses changed.
5938 * image.c: Omit unnecessary static decls.
5939 (x_create_bitmap_mask, x_build_heuristic_mask):
5940 Return void, not int, since callers don't care about the return value.
5941 (x_create_bitmap_mask, define_image_type, valid_image_p)
5942 (struct image_keyword, parse_image_spec, image_spec_value)
5943 (check_image_size, image_background)
5944 (image_background_transparent, x_clear_image_1)
5945 (postprocess_image, lookup_image, x_check_image_size)
5946 (x_create_x_image_and_pixmap, xbm_image_p)
5947 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5948 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5949 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5950 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5951 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5952 (png_image_p, init_png_functions, png_load_body, png_load)
5953 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5954 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5955 (init_gif_functions, gif_load, imagemagick_image_p)
5956 (imagemagick_load_image, imagemagick_load, svg_image_p)
5957 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5958 (gs_load):
5959 * nsimage.m (ns_load_image):
5960 * nsterm.m (ns_defined_color):
5961 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5962 * xfns.c (x_defined_color):
5963 * xterm.c (x_alloc_lighter_color_for_widget)
5964 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5965 (x_alloc_lighter_color):
5966 * indent.c (disptab_matches_widthtab, current_column)
5967 (scan_for_column, string_display_width, indented_beyond_p)
5968 (compute_motion, vmotion, Fvertical_motion):
5969 Use bool for booleans.
5970
a5f2b6ec
CY
59712012-09-24 Chong Yidong <cyd@gnu.org>
5972
5973 * chartab.c (Fset_char_table_default): Obsolete function removed.
5974
18e27ea8
PE
59752012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5976
afea8a8a
PE
5977 Move pid_t related decls out of lisp.h.
5978 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5979 (interruptible_wait_for_termination):
5980 Move these decls from lisp.h to syswait.h, since they use pid_t.
5981 Needed on FreeBSD; see Herbert J. Skuhra in
5982 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5983 * callproc.c: Include syswait.h.
5984
18e27ea8
PE
5985 gnutls.c, gtkutil.c: Use bool for boolean.
5986 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5987 (emacs_gnutls_handle_error):
5988 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5989 (xg_hide_tooltip, xg_create_frame_widgets)
5990 (create_dialog, xg_uses_old_file_dialog)
5991 (xg_get_file_with_chooser, xg_get_file_with_selection)
5992 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5993 (xg_item_label_same_p, xg_update_menubar)
5994 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5995 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5996 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5997 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5998 (update_frame_tool_bar, free_frame_tool_bar):
5999 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6000 * nsmenu.m (ns_update_menubar):
6001 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6002 * xfns.c (Fx_show_tip) [USE_GTK]:
6003 Use bool for boolean.
6004 * gtkutil.c (xg_update_frame_menubar):
6005 * xmenu.c (update_frame_menubar):
6006 Return void, not int, since caller ignores return value.
6007 * gtkutil.c (xg_change_toolbar_position):
6008 Return void, not 1.
6009
af0e9f75
JB
60102012-09-23 Juanma Barranquero <lekktu@gmail.com>
6011
6012 * makefile.w32-in (BLOCKINPUT_H): Remove.
6013 (SYSSIGNAL_H): New macro.
6014 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6015 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6016 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6017 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6018 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6019 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6020 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6021 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6022 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6023 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6024 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6025 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6026 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6027 ($(BLD)/w32xfns.$(O)): Update dependencies.
6028
5101529e
EZ
60292012-09-23 Eli Zaretskii <eliz@gnu.org>
6030
6031 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6032 fatal_error_backtrace.
6033
6034 * w32proc.c (sys_kill): Undo last change: don't do anything when
6035 invoked to deliver SIGABRT to our own process. This is now
6036 handled by emacs_raise.
6037
2c3ee0ad
JB
60382012-09-23 Juanma Barranquero <lekktu@gmail.com>
6039
6040 * w32term.c (w32_read_socket): Remove leftover reference to
6041 interrupt_input_pending.
6042
62a1d661
PE
60432012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6044
6045 Do not use SA_NODEFER.
6046 Problem reported by Dani Moncayo in
6047 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6048 * alloc.c (die):
6049 * sysdep.c (emacs_abort): Do not reset signal handler.
6050 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6051 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6052 wanted even on POSIXish hosts, and it doesn't work on Windows.
6053
a0942b9a
JD
60542012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6055
6056 * xterm.c (x_term_init): Call fixup_locale before and after calling
6057 gtk_init (Bug#12392).
6058
d07ff9db
CY
60592012-09-23 Chong Yidong <cyd@gnu.org>
6060
6061 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6062 Vdynamic_library_alist.
6063
6064 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6065 (Fgnutls_available_p): Caller changed.
6066
6067 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6068 (Flibxml_parse_xml_region): Likewise.
6069
6070 * dispextern.h (struct image_type): Remove arg from init function.
6071
6072 * image.c (Finit_image_library, lookup_image_type)
6073 (define_image_type): Remove now-unneeded second arg.
6074 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6075 (init_tiff_functions, init_gif_functions, init_svg_functions):
6076 Arglist and w32_delayed_load calling convention changed.
6077 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 6078 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 6079
4d7e6e51
PE
60802012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6081
6082 Simplify and avoid signal-handling races (Bug#12471).
6083 * alloc.c (die):
6084 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6085 Avoid recursive loop if there's a fatal error in the function itself.
6086 * atimer.c (pending_atimers):
6087 * blockinput.h: Don't include "atimer.h"; no longer needed.
6088 (interrupt_input_pending): Remove. All uses removed.
6089 pending_signals now counts both atimers and ordinary interrupts.
6090 This is less racy than having three separate pending-signal flags.
6091 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6092 (input_blocked_p):
6093 Rename from their upper-case counterparts BLOCK_INPUT,
6094 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6095 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6096 This makes it easier to access volatile variables more accurately.
6097 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6098 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6099 that's more reliable if the code is buggy and sets
6100 interrupt_input_blocked to a negative value. All uses changed.
6101 * atimer.c (deliver_alarm_signal):
6102 Remove. No need to deliver this to the parent; any thread can
6103 handle this signal now. All uses replaced by underlying handler.
6104 * atimer.c (turn_on_atimers):
6105 * dispnew.c (handle_window_change_signal):
6106 * emacs.c (handle_danger_signal):
6107 * keyboard.c (kbd_buffer_get_event):
6108 Don't reestablish signal handler; not needed with sigaction.
6109 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6110 (UNBLOCK_INPUT_TO):
6111 Rework to avoid unnecessary accesses to volatile variables.
6112 (UNBLOCK_INPUT_TO): Now a function.
6113 (totally_unblock_input, unblock_input): New decls.
6114 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6115 (init_data): Remove. Necessary stuff now done in init_signal.
6116 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6117 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6118 (fatal_error_code): Remove; no longer needed.
6119 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6120 it doesn't always backtrace. All uses changed. No need to reset
6121 signal to default, since sigaction and/or die does that for us now.
6122 Use emacs_raise (FOO), not kill (getpid (), FOO).
6123 (main): Check more-accurately whether we're dumping.
6124 Move fatal-error setup to sysdep.c
6125 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6126 * gtkutil.c (xg_get_file_name, xg_get_font):
6127 Remove no-longer-needed signal-mask manipulation.
6128 * keyboard.c, process.c (POLL_FOR_INPUT):
6129 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6130 * keyboard.c (read_avail_input): Remove.
6131 All uses replaced by gobble_input.
6132 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6133 (kbd_buffer_store_event_hold, gobble_input):
6134 (record_asynch_buffer_change) [USABLE_SIGIO]:
6135 (store_user_signal_events):
6136 No need to mess with signal mask.
6137 (gobble_input): If blocking input and there are terminals, simply
6138 set pending_signals to 1 and return. All hooks changed to not
6139 worry about whether input is blocked.
6140 (process_pending_signals): Clear pending_signals before processing
6141 them, in case a signal comes in while we're processing.
6142 By convention callers now test pending_signals before calling us.
6143 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6144 New functions, to support changes to blockinput.h.
6145 (handle_input_available_signal): Now extern.
6146 (reinvoke_input_signal): Remove. All uses replaced by
6147 handle_async_input.
6148 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
6149 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6150 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
6151 Clear sigmask reliably, even if Fsignal returns, which it can.
6152 Omit unnecessary accesses to volatile var.
6153 (quit_throw_to_read_char): No need to restore sigmask.
6154 * keyboard.c (gobble_input, handle_user_signal):
6155 * process.c (wait_reading_process_output):
6156 Call signal-handling code rather than killing ourselves.
6157 * lisp.h: Include <float.h>, for...
6158 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6159 (pending_signals): Now volatile.
6160 (syms_of_data): Now const if IEEE floating point.
6161 (handle_input_available_signal) [USABLE_SIGIO]:
6162 (terminate_due_to_signal, record_child_status_change): New decls.
6163 * process.c (create_process): Avoid disaster if memory is exhausted
6164 while we're processing a vfork, by tightening the critical section
6165 around the vfork.
6166 (send_process_frame, process_sent_to, handle_pipe_signal)
6167 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6168 ignores SIGPIPE.
6169 (send_process): No need for setjmp/longjmp any more, since the
6170 SIGPIPE stuff is now gone. Instead, report an error if errno
6171 is EPIPE.
6172 (record_child_status_change): Now extern. PID and W are now args.
6173 Return void, not bool. All callers changed.
6174 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6175 Remove. All uses removed. This bug should be fixed now in a
6176 different way.
6177 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6178 and record the child status change directly. This avoids the
6179 need to futz with the signal mask.
6180 (process_fatal_action): Move here from emacs.c.
6181 (emacs_sigaction_flags): New function, containing
6182 much of what used to be in emacs_sigaction_init.
6183 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6184 caught by emacs, to make races less likely.
6185 (deliver_process_signal): Rename from handle_on_main_thread.
6186 All uses changed.
6187 (BACKTRACE_LIMIT_MAX): Now at top level.
6188 (thread_backtrace_buffer, threadback_backtrace_pointers):
6189 New static vars.
6190 (deliver_thread_signal, deliver_fatal_thread_signal):
6191 New functions, for more-accurate delivery of thread-specific signals.
6192 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6193 (deliver_arith_signal): Handle in this thread, not
6194 in the main thread, since it's triggered by this thread.
6195 (maybe_fatal_sig): New function.
6196 (init_signals): New arg DUMPING so that we can be more accurate
6197 about whether we're dumping. Caller changed.
6198 Treat thread-specific signals differently from process-general signals.
6199 Block all signals while handling fatal error; that's safer.
6200 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6201 on IEEE hosts.
6202 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6203 Ignore SIGPIPE unless batch.
6204 (emacs_backtrace): Output backtrace for the appropriate thread,
6205 which is not necessarily the main thread.
6206 * syssignal.h: Include <stdbool.h>.
6207 (emacs_raise): New macro.
6208 * xterm.c (x_connection_signal): Remove; no longer needed
6209 now that we use sigaction.
6210 (x_connection_closed): No need to mess with sigmask now.
6211 (x_initialize): No need to reset SIGPIPE handler here, since
6212 init_signals does this for us now.
6213
8f4635e9
JD
62142012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6215
6216 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 6217 background rect may be larger (Bug#12245).
8f4635e9 6218
3296976d
CY
62192012-09-23 Chong Yidong <cyd@gnu.org>
6220
6221 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6222
d41e491e
PE
62232012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6224
6225 * .gdbinit: Just stop at fatal_error_backtrace.
6226 See Stefan Monnier's request in
6227 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6228 Remove no-longer-used query of system type.
6229
c88b867f
CY
62302012-09-22 Chong Yidong <cyd@gnu.org>
6231
6232 * search.c (Freplace_match): Doc fix (Bug#12325).
6233
6234 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6235
6236 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6237 (Fline_end_position): Doc fix.
6238
6239 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6240
bb4d86b4
CY
62412012-09-22 Chong Yidong <cyd@gnu.org>
6242
6243 * dispextern.h (struct image_type): Add new slot, storing a type
6244 initialization function.
6245
6246 * image.c (define_image_type): Call the image initializer function
6247 if it is defined. Arguments and return value changed.
6248 (valid_image_p, make_image): Callers changed.
6249 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
6250 (gif_type, imagemagick_type, svg_type, gs_type):
6251 Add initialization functions.
bb4d86b4
CY
6252 (Finit_image_library): Call lookup_image_type.
6253 (CHECK_LIB_AVAILABLE): Macro deleted.
6254 (lookup_image_type): Call define_image_type here, rather than via
6255 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6256 (syms_of_image): Move define_image_type calls for xbm_type and
6257 pbm_type to lookup_image_type.
6258
df9685f3
EZ
62592012-09-22 Eli Zaretskii <eliz@gnu.org>
6260
6261 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6262 'idle_timers' from here ...
6263 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6264 lists, to avoid infloops when the timer does something stupid,
6265 like reinvoke itself with the same or smaller time-out.
6266 (Bug#12447)
6267
8e17c9ba
MR
62682012-09-22 Martin Rudalics <rudalics@gmx.at>
6269
6270 * window.c (Fsplit_window_internal): Handle only Qt value of
6271 Vwindow_combination_limit separately.
6272 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
6273 (Vwindow_combination_limit): New default value.
6274 Rewrite doc-string.
8e17c9ba 6275
589bd69b
EZ
62762012-09-22 Eli Zaretskii <eliz@gnu.org>
6277
6278 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6279 the new overlay string. (Bug#10159)
6280
01108e3f
PE
62812012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6282
6283 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6284 or that fprintf is async-signal-safe. POSIX doesn't require
6285 either assumption.
6286
82f8cd94
CY
62872012-09-22 Chong Yidong <cyd@gnu.org>
6288
6289 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6290 (Bug#8207).
6291
3cccbd87
KH
62922012-09-22 Kenichi Handa <handa@gnu.org>
6293
6294 * composite.c (composition_reseat_it): Handle the case that a
6295 grapheme cluster is not covered by a single font (Bug#12352).
6296
09c01941
CY
62972012-09-21 Chong Yidong <cyd@gnu.org>
6298
6299 * image.c (define_image_type): Avoid adding duplicate types to
6300 image_types (Bug#12463). Suggested by Jörg Walter.
6301
acfa068f 63022012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
6303
6304 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6305 (print_load_command_name): Add case LC_DATA_IN_CODE.
6306 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6307
acfa068f 63082012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
6309
6310 * eval.c (Frun_hook_with_args_until_success)
6311 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6312
acfa068f 63132012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
6314
6315 * fileio.c (Ffile_selinux_context): Only call freecon when
6316 lgetfilecon succeeded.
6317 (Fset_file_selinux_context): Likewise. (Bug#12444)
6318
acfa068f 63192012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
6320
6321 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6322 reordering, locate the cursor by calling set_cursor_from_row; if
6323 that fails, clear the desired glyph matrix before returning a
6324 failure indication to the caller. Fixes leaving garbled display
6325 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
6326 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6327 scrolling through multibyte text.
aa36e4d2 6328
e99f70c8
SM
63292012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6330
6331 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6332 calling mark_vectorlike since that's the one that marks the window.
6333 (mark_discard_killed_buffers): Mark the final cdr.
6334 * window.h (struct window): Move prev/next_buffers to the
6335 non-standard fields.
6336 * window.c (make_window): Initialize prev/next_buffers manually.
6337
f75beb47
PE
63382012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6339
6340 Omit unused arg EXPECTED from socket hooks.
6341 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6342 * nsterm.m (ns_term_init):
6343 * termhooks.h (struct terminal.read_socket_hook):
6344 * w32inevt.c (w32_console_read_socket):
6345 * w32term.c (w32_read_socket):
6346 * xterm.c (XTread_socket):
6347 Omit unused arg EXPECTED. All callers changed.
6348 (store_user_signal_events): Return void, not int, since callers no
6349 longer care about the return value. All uses changed.
6350
b019b76a
JB
63512012-09-20 Juanma Barranquero <lekktu@gmail.com>
6352
6353 * w32gui.h (XParseGeometry): Do not declare.
6354
05642592
PE
63552012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6356
e4bce92a 6357 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 6358 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
6359 <http://bugs.gnu.org/12471#8> (last line).
6360
05642592
PE
6361 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6362 (XParseGeometry): Now static. Substitute extremal values for
6363 values that are out of range.
6364
e543ae91
JD
63652012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6366
6367 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6368
6369 * nsfns.m (XParseGeometry): Remove.
6370 (Fx_create_frame): Call x_set_offset to correctly interpret
6371 top_pos in geometry.
6372
3a880af4 6373 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
6374 (Fx_parse_geometry): If there is a space in string, call
6375 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6376
45ba16c7
EZ
63772012-09-17 Eli Zaretskii <eliz@gnu.org>
6378
c8b9f1bc
EZ
6379 * search.c (scan_buffer): Use character positions in calls to
6380 region_cache_forward and region_cache_backward, not byte
6381 positions. (Bug#12196)
6382
b4c932a2
EZ
6383 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6384 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6385
45ba16c7
EZ
6386 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6387 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6388 emacs_blocked_malloc, now deleted.
6389
eeceac93
PE
63902012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6391
6392 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6393 The workaround was for improving performance on Solaris 2.4, but
6394 is getting in the way now. Emacs will still work if someone is
6395 still running Solaris 2.4 in a museum somewhere; Sun dropped
6396 support for Solaris 2.4 in 2003.
6397 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6398 * process.c (create_process) [HAVE_WORKING_VFORK]:
6399 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6400 since Emacs no longer uses vfork on that platform.
6401
78f83752
GM
64022012-09-17 Glenn Morris <rgm@gnu.org>
6403
6404 * emacs.c: Use COPYRIGHT.
6405
634b8cac
PE
64062012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6407
0caaedb1
PE
6408 Remove configure's --without-sync-input option (Bug#12450).
6409 When auditing signal-handling in preparation for cleaning it up,
6410 I found that SYNC_INPUT has race conditions and would be a real
6411 pain to fix. Since it's an undocumented and deprecated
6412 configure-time option, now seems like a good time to remove it.
6413 Also see <http://bugs.gnu.org/11080#16>.
6414 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6415 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6416 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6417 (malloc_hysteresis):
6418 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6419 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6420 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6421 (dont_register_blocks, bytes_used_when_reconsidered)
6422 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6423 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6424 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 6425 Remove. All uses removed.
0caaedb1
PE
6426 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6427 implementation, one that depends on whether the new macro
6428 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6429 is defined.
6430 * atimer.c (run_timers, handle_alarm_signal):
6431 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6432 (handle_async_input, process_pending_signals)
6433 (handle_input_available_signal, init_keyboard):
6434 * nsterm.m (ns_read_socket):
6435 * process.c (wait_reading_process_output):
6436 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6437 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6438 (emacs_write):
6439 * xterm.c (XTread_socket):
6440 Assume SYNC_INPUT.
6441 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6442 * eval.c (handling_signal): Remove. All uses removed.
6443 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6444 All uses replaced with the SYNC_INPUT version.
6445 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6446 Remove decls.
6447 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6448 Now static.
6449
634b8cac
PE
6450 * font.c (Ffont_shape_gstring): Remove unused local.
6451
83da1b55
GM
64522012-09-16 Glenn Morris <rgm@gnu.org>
6453
518650a5
GM
6454 * Makefile.in (clean): No longer run nextstep's clean.
6455
83da1b55
GM
6456 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6457 (ns_frag): Remove.
6458 (ns-app): Move here from ns.mk, and simplify.
6459 (clean): Simplify nextstep entry.
6460 * ns.mk: Remove file.
6461
85a43e2e
KH
64622012-09-17 Kenichi Handa <handa@gnu.org>
6463
6464 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6465 not covert the last few charactes.
6466
ba13e616 64672012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
6468
6469 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6470 here, but just check the validity of glyphs in the glyph-string.
6471
a8c729af
MR
64722012-09-16 Martin Rudalics <rudalics@gmx.at>
6473
3a880af4
SM
6474 * window.c (Fwindow_parameter, Fset_window_parameter):
6475 Accept any window as argument (Bug#12452).
a8c729af 6476
c077c059
JD
64772012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6478
6479 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6480 to ns_term_init to avoid memory leak.
6481
6482 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6483 explicit retain/release.
6484 (ns_term_init): Only allow one display. Initialize outerpool and
6485 ns_*_types.
6486
39a57ad0
PE
64872012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6488
6489 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6490 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6491 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6492 the Microsoft problem in a different way, by altering ../nt/config.nt.
6493
7105c8cb
EZ
64942012-09-15 Eli Zaretskii <eliz@gnu.org>
6495
6496 * w32xfns.c:
6497 * w32uniscribe.c:
6498 * w32term.c:
6499 * w32select.c:
6500 * w32reg.c:
6501 * w32proc.c:
6502 * w32menu.c:
6503 * w32inevt.c:
6504 * w32heap.c:
6505 * w32font.c:
6506 * w32fns.c:
6507 * w32console.c:
6508 * w32.c:
6509 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6510 by lisp.h. This completes removal of setjmp.h inclusion
6511 erroneously announced in the previous commit. (Bug#12446)
6512
6513 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6514 more accurate.
6515
6516 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6517 not defined as a macro. The latter happens on MS-Windows.
6518 (Bug#12446)
6519
0328b6de
PE
65202012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6521
6522 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6523 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 6524 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
6525 only reason for the instance was because "lisp.h" was included.
6526 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6527 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6528 and _longjmp with the new symbols. Emacs already uses _setjmp if
6529 available, so this change affects only POSIXish hosts that have
6530 sigsetjmp but not _setjmp, such as some versions of Solaris and
6531 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6532 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6533 (png_load_body) [HAVE_PNG]:
6534 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6535 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6536 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6537 since PNG requires jmp_buf. This is the only exception to the
6538 general rule that we now use sys_setjmp and sys_longjmp.
6539 This exception is OK since this code does not change the signal
6540 mask or longjmp out of a signal handler.
6541
2af03429
PE
65422012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6543
6544 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6545 Include "syssignal.h", for 'main_thread'.
6546
2f294edf
DA
65472012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6548
6549 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
6550 * insdel.c (replace_range, replace_range_2):
6551 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
6552 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6553 Remove redundant check before calling offset_intervals.
6554
6b533e9c
MR
65552012-09-14 Martin Rudalics <rudalics@gmx.at>
6556
6557 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6558 current buffer (Bug#12387).
6559
2a7931e3
JB
65602012-09-14 Juanma Barranquero <lekktu@gmail.com>
6561
6562 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6563
c18e885b
PE
65642012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 Use a more backwards-compatible timer format (Bug#12430).
6567 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6568 vector element, not from the 4th, since PSECS is now at the end.
6569 (Fcurrent_idle_time): Doc fix.
6570
d59a1afb
DA
65712012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6572
6573 Function to mark objects and remove killed buffers at once.
6574 * alloc.c (discard_killed_buffers): Rename to ...
6575 (mark_discard_killed buffers) ... new name. Add marking
6576 of remaining objects. Fix comment. Adjust users.
6577 (mark_object): Do not touch frame buffer lists here.
6578 * frame.c (delete_frame): Reset frame buffer lists here.
6579
5f0cb45a
PE
65802012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6581
8ea47e3a
PE
6582 Better workaround for GNOME bug when --enable-gcc-warnings.
6583 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6584 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6585 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6586
4a4bbad2
PE
6587 Simplify SIGIO usage (Bug#12408).
6588 The code that dealt with SIGIO was crufty and confusing, e.g., it
6589 played tricks like "#undef SIGIO" but these tricks were not used
6590 consistently. Simplify mostly by not #undeffing standard symbols,
6591 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6592 or not as we please) rather than "defined SIGIO" (standard symbol
6593 that we probably shouldn't #undef).
6594 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6595 Modules that need it can include it.
6596 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6597 * dispextern.h (ignore_sigio): New decl.
6598 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6599 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6600 * emacs.c (shut_down_emacs):
6601 * keyboard.c (kbd_buffer_store_event_hold):
6602 Use ignore_sigio rather than invoking 'signal' directly.
6603 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6604 for FIONREAD.
6605 (FIONREAD, SIGIO): Do not #undef.
6606 (tty_read_avail_input): Use #error rather than a syntax error.
6607 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6608 for I_PIPE, used by SETUP_SLAVE_PTY.
6609 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6610 * sysdep.c (croak): Remove; no longer needed. This bit of
6611 temporary code, with Fred N. Fish's comment that it's temporary,
6612 has been in Emacs since at least 1992!
6613 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6614 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6615 * syssignal.h (croak): Remove decl.
6616 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6617 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6618 now that we're termios-only.
6619 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6620 * term.c (dissociate_if_controlling_tty): Use #error rather than
6621 a run-time error.
6622
5f0cb45a
PE
6623 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6624 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6625 to work around GNOME bug 683906.
6626 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6627 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6628 This works around GCC bug 54561.
6629
40bce90b
PE
66302012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6631
6632 More fixes for 'volatile' and setjmp/longjmp.
6633 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6634 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6635 (png_load_body) [HAVE_PNG]:
6636 (jpeg_load_body) [HAVE_JPEG]:
6637 New function, with most of the old parent function's body.
6638 (png_load) [HAVE_PNG]:
6639 (jpeg_load) [HAVE_JPEG]:
6640 Invoke the new function, to avoid longjmp munging our locals.
6641 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6642 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6643 longjmp is passed 2, as the C standard doesn't guarantee this.
6644 Instead, store the failure code into mgr->failure_code.
6645
bfeae2cf
SM
66462012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6647
6648 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6649 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6650 (syms_of_keyboard): Remove support for unread-command-char.
6651
8099e36b
EZ
66522012-09-12 Eli Zaretskii <eliz@gnu.org>
6653
6654 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6655 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6656 violation. (Bug#12426)
6657
92547ff9
PE
66582012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6659
6660 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6661
45b82ad0
SM
66622012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6663
6664 * eval.c: Add `inhibit-debugger'.
6665 (Qinhibit_debugger): New symbol.
6666 (call_debugger): Bind it instead of Qdebug_on_error.
6667 (maybe_call_debugger): Test Vinhibit_debugger.
6668 (syms_of_eval): Define inhibit-debugger.
6669 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6670 (syms_of_xdisp): Remove inhibit-debug-on-message.
6671
5779a1dc
PE
66722012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6673
50f2e553
PE
6674 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6675 If a nonvolatile local variable is written before a _longjmp to
6676 the frame containing the variable, and is read after the _longjmp,
6677 the value read is indeterminate. Some local variables of type
6678 'struct handler' and 'struct catchtag' are used in this way, so
6679 mark each of their slots as volatile if the slot can be set before
6680 _longjmp and read afterwards.
6681 * lisp.h (struct handler): var and chosen_clause are now volatile.
6682 (struct catchtag): val, next, and pdlcount are now volatile.
6683
ae1d87e2
PE
6684 * bidi.c (bidi_push_it, bidi_pop_it):
6685 * fns.c (copy_hash_table):
6686 * image.c (define_image_type):
6687 * keyboard.c (kbd_buffer_store_event_hold):
6688 * process.c (Fprocess_send_eof):
6689 * xfaces.c (x_create_gc) [HAVE_NS]:
6690 * xgselect.c (xg_select):
6691 Prefer assignment to memcpy when either will do.
6692
5779a1dc
PE
6693 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6694 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6695 time an item is removed. No need to mark this function 'inline';
6696 the compiler knows better than we do.
6697
c4c9756b
JD
66982012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6699
6700 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6701 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6702 to change_frame_size (Bug#12388).
6703 (windowDidResize:): Pass YES to updateFrameSize.
6704
6705 * nsterm.h: Add delay parameter to updateFrameSize.
6706
d73e321c
DA
67072012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6708
6709 Discard killed buffers from deleted window and frame objects.
6710 This reduces an amount of references to killed buffers and
6711 helps GC to reclaim them faster.
6712 * alloc.c (discard_killed_buffers): New function.
6713 (mark_object): Use it for deleted windows and frames.
6714 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 6715 or deleted frame, restore its global binding.
d73e321c
DA
6716 * data.c (swap_in_global_binding): Add GC notice.
6717 (swap_in_symval_forwarding): Use convenient set_blv_where.
6718 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6719 * window.h: ... to here.
6720
e578f381
DA
67212012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6722
6723 Convenient macro to check whether the buffer is live.
6724 * buffer.h (BUFFER_LIVE_P): New macro.
6725 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6726 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6727
3057e615
YM
67282012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6729
6730 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6731 composition cases (Bug#12364).
6732
6733 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6734 overhang of succeeding glyphs overlapping box cursor.
6735
6736 * w32term.c (x_draw_glyph_string): Likewise.
6737
6fda35f2
PE
67382012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6739
c990426a
PE
6740 Simplify, document, and port floating-point (Bug#12381).
6741 The porting part of this patch fixes bugs on non-IEEE platforms
6742 with frexp, ldexp, logb.
6743 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6744 Now static.
6745 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6746 support, by removing commented-out code and briefly listing the
6747 C89 functions excluded. The commented-out stuff was confusing
6748 maintenance, e.g., we thought we needed cbrt but it was commented out.
6749 (logb): Remove decl; no longer needed.
6750 (isfinite): New macro, if not already supplied.
6751 (isnan): Don't replace any existing macro.
6752 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6753 are present on all C89 platforms.
6754 (Ffrexp): Do not special-case zero, as frexp does the right thing
6755 for that case.
6756 (Flogb): Do not use logb, as it doesn't have the desired meaning
6757 on hosts that use non-base-2 floating point. Instead, stick with
6758 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6759 frexp, to avoid getting an unspecified result.
6760
6fda35f2
PE
6761 * xdisp.c (Qinhibit_debug_on_message): Now static.
6762
16130a58
JD
67632012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6764
6765 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6766 NSBezierPath (Bug#12131).
6767
d105a573
CY
67682012-09-10 Chong Yidong <cyd@gnu.org>
6769
6770 * fns.c (Fdelq, Fdelete): Doc fix.
6771
ff55dfe8
PE
67722012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6773
6774 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6775 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6776
e7032e7c
SM
67772012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6778
6779 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6780 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6781 Use it.
6782
e9957956
EZ
67832012-09-09 Eli Zaretskii <eliz@gnu.org>
6784
aba05ce9
EZ
6785 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6786 left fringe if the window has a left margin. This avoids leaving
6787 traces of the cursor because its leftmost pixel is not drawn over.
6788
e9957956
EZ
6789 * dispnew.c (update_window_line): When the left margin area of a
6790 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6791 that screen line. (Bug#12277)
6792
f6196b87
PE
67932012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6794
6795 Assume C89 or later for math functions (Bug#12381).
6796 This simplifies the code, and makes it a bit smaller and faster,
6797 and (most important) makes it easier to clean up signal handling
6798 since we can stop worring about floating-point exceptions in
6799 library code. That was a problem before C89, but the problem
6800 went away many years ago on all practical Emacs targets.
6801 * data.c, image.c, lread.c, print.c:
6802 Don't include <math.h>; no longer needed.
6803 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6804 might be autoconfigured, as that never happens.
6805 * data.c (fmod):
6806 * doprnt.c (DBL_MAX_10_EXP):
6807 * print.c (DBL_DIG):
6808 Remove. C89 or later always defines these.
6809 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6810 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6811 (arith_error, domain_error, domain_error2):
6812 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6813 no longer needed -- we simply return what C returns. All uses removed.
6814 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6815 the wrapped code.
6816 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6817 Remove. All uses expanded, as these macros are no longer used
6818 more than once and are now more trouble than they're worth.
6819 (Ftan): Use tan, not sin / cos.
6820 (Flogb): Assume C89 frexp.
6821 (fmod_float): Assume C89 fmod.
6822 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6823 (init_floatfns): Remove. All uses removed.
6824
9d7f1863
JD
68252012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6826
6827 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6828 compositeToPoint for OSX < 10.6 (Bug#12390).
6829
eabf0404
PE
68302012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6831
6832 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6833 This produces more-accurate results.
6834
0b3b1d23
JD
68352012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6836
6837 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6838 changes (Bug#12088).
6839
6dcef6ec
CY
68402012-09-08 Chong Yidong <cyd@gnu.org>
6841
6842 * syntax.c (Fstring_to_syntax): Doc fix.
6843
aa7d57c5
JD
68442012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6845
6846 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6847 in the internal border.
6848 (x_set_window_size): Remove static variables and their usage.
6849 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
6850 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6851 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
6852 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6853 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6854 (ns_fix_rect_ibw): Remove.
6855 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6856 (ns_dumpglyphs_box_or_relief): Ditto.
6857 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6858 adjustment.
6859 (ns_dumpglyphs_image): Ditto.
fc0c31f8 6860 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
6861 border adjustment.
6862 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6863 their usage. Add fringe_extended_p and its use as in other terms.
6864 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6865 scroll bar was removed.
6866 (updateFrameSize): New function.
6867 (windowDidResize): Move code to updateFrameSize and call it.
6868
6869 * nsterm.h (EmacsView): Add updateFrameSize.
6870
1a5432bc
CY
68712012-09-07 Chong Yidong <cyd@gnu.org>
6872
b4f5313e
CY
6873 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6874
1a5432bc
CY
6875 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6876
1a4f1e9b
PE
68772012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6878
6879 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
6880 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6881 Problem introduced when merging patches. Noted by Eli Zaretskii in
6882 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
6883 * floatfns.c: Comment fix.
6884 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6885 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6886 and anyway the declaration is harmless even if SIGDANGER is not defined.
6887 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6888 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6889 source files not surprisingly expected syssignal.h to define, or
6890 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6891 Include <sys/ioctl.h>, for FIONREAD.
6892 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6893 This eliminates a problem whereby other files mysteriously had
6894 to include "syssignal.h" before including "systty.h" if they
6895 wanted to use "#ifdef SIGIO".
6896
bc8000ff
EZ
68972012-09-07 Eli Zaretskii <eliz@gnu.org>
6898
3e6d6928
EZ
6899 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6900
6901 * w32.c (sigemptyset): Empty the set.
6902 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6903
bc8000ff
EZ
6904 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6905
b4fa72f2
DA
69062012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6907
6908 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6909 (mark_object): Likewise for frame objects.
6910
30730c93
PE
69112012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 * syssignal.h (handle_on_main_thread): Always declare,
6914 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6915 This ports to platforms without HAVE_PTHREAD.
6916
2fe28299
PE
69172012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6918
6919 Signal-handler cleanup (Bug#12327).
6920 Emacs's signal handlers were written in the old 4.2BSD style with
6921 sigblock and sigmask and so forth, and this led to some
6922 inefficiencies and confusion. Rewrite these to use
6923 pthread_sigmask etc. without copying signal sets around. Also,
6924 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6925 'signal', and instead use functions that do not attempt to take
6926 over the system name space. This patch causes Emacs's text
6927 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6928 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6929 Do not include <signal.h> or "syssignal.h", as these
6930 modules do not use signals.
6931 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6932 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6933 Do not include <signal.h>, as "syssignal.h" does that for us now.
6934 * atimer.c (sigmask_atimers): New function.
6935 (block_atimers, unblock_atimers): New functions,
6936 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6937 All uses replaced.
6938 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6939 no longer needed here.
6940 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 6941 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
6942 * sysdep.c (struct save_signal): New member 'action', replacing
6943 old member 'handler'.
6944 (save_signal_handlers, restore_signal_handlers):
6945 Use sigaction instead of 'signal' to save and restore.
6946 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6947 New function. All users of 'signal' modified to use set_sighandler
6948 if they're writeonly, and to use sys_signal if they're read+write.
6949 (emacs_sigaction_init, forwarded_signal): New functions.
6950 (sys_signal): Remove. All uses replaced by calls to sigaction
6951 and emacs_sigaction_init, or by direct calls to 'signal'.
6952 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6953 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6954 all uses replaced by pthread_sigmask etc. calls.
6955 * syssignal.h: Include <signal.h>.
6956 (emacs_sigaction_init, forwarded_signal): New decls.
6957 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6958 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6959 (sigmask, sys_sigmask): Remove; no longer needed.
6960 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6961 (sigblock, sigunblock, sigfree):
6962 (sigsetmask) [!defined sigsetmask]:
6963 Remove. All uses replaced by pthread_sigmask.
6964 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6965 no longer need to be replaced, and its typical old uses
6966 are now done via emacs_sigaction_init and sigaction.
6967 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6968 (sys_sigdel): Remove; unused.
6969 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6970
0216c128
EZ
69712012-09-06 Eli Zaretskii <eliz@gnu.org>
6972
6973 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6974 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6975
c752cfa9
DA
69762012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6977
6978 Explicitly mark buffer_defaults and buffer_local_symbols.
6979 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6980 mark_local_symbols here.
6981 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6982 since special buffers aren't marked here any more.
6983 (allocate_buffer): Chain new buffer with all_buffers here...
6984 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6985 not here.
6986 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6987 (syms_of_buffer): Remove staticpro of the above.
6988 (init_buffer_once): Set names for buffer_defaults and
6989 buffer_local_symbols.
6990
a864ef14
PE
69912012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6992
6993 Use bool for booleans in font-related modules.
6994 * font.c (font_intern_prop, font_style_to_value)
6995 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6996 (generate_otf_features, font_check_otf_features, font_check_otf)
6997 (font_match_p, font_list_entities, font_at):
6998 * fontset.c (fontset_id_valid_p, reorder_font_vector
6999 (fontset_find_font, Fset_fontset_font)
7000 (face_suitable_for_char_p) [0]:
7001 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7002 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7003 (m17n_flt_initialized, ftfont_shape_by_flt):
7004 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7005 * nsfont.m (nsfont_draw):
7006 * w32font.c (w32font_draw):
7007 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7008 Use bool for booleans.
7009 * font.h: Adjust to above API changes.
7010 (struct font, struct font_driver, struct font_driver_list):
7011 Use bool for booleans.
7012 (struct font): Remove useless member encoding_type.
7013 All users removed.
7014 * fontset.c, xftfont.c: Omit unnecessary static decls.
7015
0699fc18
DA
70162012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7017
7018 * alloc.c (mark_object): Revert window marking code
7019 since it's unsafe for the Fset_window_configuration.
7020
20ef56db
PE
70212012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7022
2fe28299 7023 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
7024 Be more systematic about preserving errno whenever a signal
7025 handler returns, even if it's not in the main thread. Do this by
7026 renaming signal handlers to distinguish between signal delivery
7027 and signal handling. All uses changed.
7028 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7029 * data.c (deliver_arith_signal): Rename from arith_error.
7030 * dispnew.c (deliver_window_change_signal): Rename from
7031 window_change_signal.
7032 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7033 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7034 * keyboard.c (deliver_input_available_signal): Rename from
7035 input_available_signal.
7036 (deliver_user_signal): Rename from handle_user_signal.
7037 (deliver_interrupt_signal): Rename from interrupt_signal.
7038 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7039 (deliver_child_signal): Rename from sigchld_handler.
7040 * atimer.c (handle_alarm_signal):
7041 * data.c (handle_arith_signal):
7042 * dispnew.c (handle_window_change_signal):
7043 * emacs.c (handle_fatal_signal, handle_danger_signal):
7044 * keyboard.c (handle_input_available_signal):
7045 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7046 * process.c (handle_pipe_signal, handle_child_signal):
7047 New functions, with the actual signal-handling code taken from the
7048 original respective signal handlers, sans the sporadic attempts to
7049 preserve errno, since that's now done by handle_on_main_thread.
7050 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7051 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7052 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7053 Move to sysdep.c.
7054 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7055 Move initialization of main_thread to sysdep.c's init_signals.
7056 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7057 our usage, and simplifies the mainline code.
7058 (record_child_status_change): New static function, as a helper
7059 for handle_child_signal, and with most of the old child handler's
7060 contents.
7061 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7062 (handle_child_signal): Use the above.
7063 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7064 Moved here from emacs.c.
7065 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7066 code moved here from emacs.c's main function.
7067 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
7068 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7069 This lets callers save and restore errno properly.
20ef56db 7070
e3ccf108
DA
70712012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7072
7073 Remove redundant or unused things here and there.
7074 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7075 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7076 * editfns.c (Fcompare_buffer_substrings): Likewise.
7077 * frame.h (struct terminal, struct font_driver_list):
7078 Remove redundant declarations.
7079 * window.h (Qleft, Qright): Likewise.
7080
697e1e39
DA
70812012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7082
7083 Do not mark objects from deleted buffers, windows and frames.
7084 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7085 (mark_object): Likewise for windows and frames.
7086
c1ca42ca
DA
70872012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7088
7089 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7090 buffer_defaults and buffer_local_symbols as valid objects.
7091 Return special value to denote them.
7092
014d93be
PE
70932012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7094
f75d7a91
PE
7095 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7096 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7097 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7098 (file_name_absolute_p, Fsubstitute_in_file_name):
7099 (check_executable, check_writable, Ffile_accessible_directory_p)
7100 (Fset_file_selinux_context, Fdefault_file_modes)
7101 (Finsert_file_contents, choose_write_coding_system)
7102 (Fwrite_region, build_annotations, a_write, e_write)
7103 (Fdo_auto_save):
7104 * filelock.c (boot_time_initialized, get_boot_time)
7105 (get_boot_time_1, lock_file_1, within_one_second):
7106 * floatfns.c (in_float):
7107 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7108 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7109 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7110 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7111 * window.c (compare_window_configurations):
7112 Use bool for booleans.
7113 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7114 (Fdefault_file_modes): Now mode_t, not int, for modes.
7115 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7116 (internal_delete_file): Now returns void, not a (boolean) int,
7117 since nobody was looking at the return value.
7118 * lisp.h, window.h: Adjust to above API changes.
7119
014d93be
PE
7120 * xdisp.c (set_message): Simplify and reindent last change.
7121
776f29e1
JB
71222012-09-05 Juanma Barranquero <lekktu@gmail.com>
7123
7124 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7125
7f7e0167
LI
71262012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7127
7128 * eval.c (call_debugger): Make the function non-static so that we
7129 can call it from set_message.
7130
7131 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7132 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7133
cf29dd84
PE
71342012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7135
7136 Give more-useful info on a fatal error (Bug#12328).
7137 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7138 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7139 of doing the work ourselves.
7140 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7141 do most of the work.
7142 (fatal_error_backtrace): New function, taken from the guts
7143 of the old fatal_error_signal, but with a new option to output
7144 a backtrace.
7145 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7146 info about the signal than just its number.
7147 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7148 * sysdep.c: Include <execinfo.h>
7149 (emacs_backtrace): New function, taken partly from the previous
7150 code of the 'die' function.
7151 (emacs_abort): Call fatal_error_backtrace rather than abort.
7152
972debf2
SM
71532012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7154
7155 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7156 eager (load-time) macro-expansion.
7157 * lisp.mk (lisp): Add macroexp.
7158
1088b922
PE
71592012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7160
7161 Simplify redefinition of 'abort' (Bug#12316).
7162 Do not try to redefine the 'abort' function. Instead, redo
7163 the code so that it calls 'emacs_abort' rather than 'abort'.
7164 This removes the need for the NO_ABORT configure-time macro
7165 and makes it easier to change the abort code to do a backtrace.
7166 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7167 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7168 Remove; sysdep.c's emacs_abort now takes its place.
7169 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7170 'abort' changed to use 'emacs_abort'.
7171 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7172 (abort) [!defined abort]: Rename to ...
7173 (emacs_abort): ... new name.
7174 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7175 the place of the old 'abort' in emacs.c.
7176 * w32.c, w32fns.c (abort): Do not #undef.
7177 * w32.c (emacs_abort): Rename from w32_abort.
7178
30934d33
EZ
71792012-09-04 Eli Zaretskii <eliz@gnu.org>
7180
7181 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7182 offsets[j].dv, since the y axis of the screen coordinates points
7183 down, while the y axis of the font definition coordinates points
7184 up. This fixes display of Arabic diacritics such as KASRA and
7185 KASRATAN. (Bug#11860)
7186
af26b72c
PE
71872012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7188
7189 Be more systematic about _setjmp vs setjmp.
7190 * alloc.c (test_setjmp, mark_stack):
7191 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7192 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7193 (png_load, my_error_exit, jpeg_load):
7194 * process.c (send_process_trap, send_process):
7195 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7196 The underscored versions are up to 30x faster on some hosts.
7197 Formerly, the code used setjmp+longjmp sometimes and
7198 _setjmp+_longjmp at other times, with no particular reason to
7199 prefer setjmp+longjmp.
7200
26d4541d
PE
72012012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7202
d42f4f0f 7203 Fix minor problem found by static checking.
26d4541d 7204 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 7205
c5e28e39
MR
72062012-09-03 Martin Rudalics <rudalics@gmx.at>
7207
7208 * buffer.c (Fdelete_all_overlays): New function.
7209
3eab3ca9
CY
72102012-09-03 Chong Yidong <cyd@gnu.org>
7211
7212 * gtkutil.c: Add extern decl for Qxft.
7213
c04889f8
PE
72142012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7215
1882aa38
PE
7216 * emacs.c, eval.c: Use bool for boolean.
7217 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7218 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7219 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7220 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7221 (main, decode_env_path, Fdaemon_initialized):
7222 * eval.c (call_debugger, Finteractive_p, interactive_p):
7223 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7224 (maybe_call_debugger, Fbacktrace):
7225 * process.c (read_process_output, exec_sentinel):
7226 Use bool for booleans.
7227 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7228 All callers changed.
7229 * eval.c (interactive_p): Omit always-true boolean argument
7230 EXCLUDE_SUBRS_P. All callers changed.
7231 * dispextern.h, lisp.h: Reflect above API changes.
7232 * firstfile.c (dummy): Use the address of 'main', whose signature
7233 won't change, instead of the address of 'initialize', whose
7234 signature just changed from int to bool.
7235 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7236 * msdos.c (fatal_error_in_progress): ... from here.
7237 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7238 of incrementing it.
7239 (redisplay_internal, unwind_redisplay): Simply clear
7240 REDISPLAYING_P when unwinding, instead of saving its previous,
7241 always-false value and then restoring it.
7242
a411ac43
PE
7243 Clean up some extern decls.
7244 Mostly, this hoists extern decls out of .c files and into .h files.
7245 That way, we're more likely to catch errors if the interfaces change.
7246 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7247 declare xg_mark_data.
7248 * dispextern.h (x_frame_parm_handlers):
7249 * font.h (Qxft):
7250 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7251 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7252 (Qultra_bold, Qoblique, Qitalic):
7253 Move extern decl here from .c file.
7254 * alloc.c (xg_mark_data) [USE_GTK]:
7255 * doc.c (Qclosure):
7256 * eval.c (Qlexical_binding):
7257 * fns.c (time) [!HAVE_UNISTD_H]:
7258 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7259 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7260 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7261 * lread.c (Qinternal_interpreter_environment):
7262 * minibuf.c (Qbuffer):
7263 * process.c (QCfamily, QCfilter):
7264 * widget.c (free_frame_faces):
7265 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7266 * xfont.c (x_clear_errors):
7267 * xterm.c (x_frame_parm_handlers):
7268 Remove now-redundant extern decls.
7269 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7270 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7271 Now static.
7272 * xfaces.c: Remove unnecessary static decls.
7273 * xterm.c (updating_frame): Remove decl of nonexistent object.
7274
c04889f8
PE
7275 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7276 when building globals.h, as the objects that are not built on
7277 this host are not needed to compile C files on this host.
7278
8b339673
JD
72792012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7280
7281 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7282
7283 * frame.h: Add missing prototype for x_wm_set_size_hint.
7284
a08d4ba7
PE
72852012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7286
7287 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7288 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7289 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7290 (Fsubstitute_command_keys):
7291 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7292 (save_excursion_save, save_excursion_restore)
7293 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7294 (format_time_string, general_insert_function)
7295 (make_buffer_string, make_buffer_string_both)
7296 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7297 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7298 (copy_text, insert_1, insert_1_both, insert_from_string)
7299 (insert_from_string_before_markers, insert_from_string_1)
7300 (insert_from_buffer, insert_from_buffer_1, replace_range)
7301 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7302 (del_range_2, modify_region):
7303 * intervals.c (intervals_equal, balance_possible_root_interval)
7304 (adjust_intervals_for_insertion, merge_properties_sticky)
7305 (graft_intervals_into_buffer, lookup_char_property)
7306 (adjust_for_invis_intang, set_point_both)
7307 (get_property_and_range, compare_string_intervals)
7308 (set_intervals_multibyte_1, set_intervals_multibyte):
7309 * keyboard.c (decode_timer):
7310 Use bool for boolean.
7311 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7312 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7313
48c948de
CY
73142012-09-02 Chong Yidong <cyd@gnu.org>
7315
7316 * keymap.c (push_key_description): Print M-TAB as C-M-i
7317 (Bug#11758).
7318
6c49a40b
JB
73192012-09-02 Juanma Barranquero <lekktu@gmail.com>
7320
7321 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7322 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7323 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7324 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7325 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7326 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7327 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7328
4dfbd238
EZ
73292012-09-01 Eli Zaretskii <eliz@gnu.org>
7330
7e510e28
EZ
7331 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7332 more than one grapheme cluster passed to the shaper: compute the
7333 offset adjustment values separately for each cluster. (Bug#11860)
7334
4dfbd238
EZ
7335 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7336 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7337 about implicit conversions from integer to pointer.
7338
86571ae0
DC
73392012-09-01 Daniel Colascione <dancol@dancol.org>
7340
7341 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7342 system used too early.
7343
0e23ef9d
PE
73442012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7345
7346 Better seed support for (random).
7347 * emacs.c (main): Call init_random.
7348 * fns.c (Frandom): Set the seed from a string argument, if given.
7349 Remove long-obsolete Gentzel cruft.
7350 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7351 (init_random): New function.
7352
17a2cbbd
DC
73532012-09-01 Daniel Colascione <dancol@dancol.org>
7354
7355 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7356 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7357 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7358 x_wm_set_size_hint, x_query_colors, x_real_positions,
7359 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7360 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7361 all of which have been moved to common code.
7362
7363 * xfaces.c: Include TERM_HEADER instead of listing all possible
7364 window-system headers.
7365
7366 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7367 to match header.
7368
7369 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7370 directly accessing frame internals.
7371
f18cbb28 7372 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
7373 globals_of_w32font.
7374
7375 * process.c: Include TERM_HEADER instead of listing all possible
7376 window-system headers.
7377
3a880af4
SM
7378 * nsterm.h: Remove declarations now in frame.h.
7379 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
7380
7381 * menu.c: Include TERM_HEADER instead of listing all possible
7382 window-system headers.
7383
7384 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7385 window system.
7386
7387 * keyboard.c: Include TERM_HEADER instead of listing all possible
7388 window-system headers.
7389
7390 * image.c: Include TERM_HEADER instead of listing all possible
7391 window-system headers. Declare Vlibrary_cache when compiling for
7392 Windows.
7393
7394 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7395 window system declarations.
7396
7397 * frame.h: Move common functions here: set_frame_menubar,
7398 x_set_window_size, x_sync, x_get_focus_frame,
7399 x_set_mouse_position, x_set_mouse_pixel_position,
7400 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7401 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7402 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7403 x_activate_menubar, x_real_positions, x_bitmap_icon,
7404 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7405 and x_query_colors.
7406
7407 * frame.c: Include TERM_HEADER instead of listing all possible
7408 window-system headers.
7409
7410 * font.c: Include TERM_HEADER instead of listing all possible
7411 window-system headers.
7412
7413 * emacs.c: Include TERM_HEADER.
7414
f18cbb28
EZ
7415 * dispnew.c: Include TERM_HEADER instead of listing all possible
7416 window-system headers.
17a2cbbd 7417
f18cbb28 7418 * ccl.h: Include character.h.
17a2cbbd
DC
7419
7420 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7421 the current window system; include in list of objects to link into
7422 Emacs.
7423
c650a5de
DA
74242012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7425
7426 Remove mark_ttys function and fix tty_display_info initialization.
7427 * lisp.h (mark_ttys): Remove prototype.
7428 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7429 to mark_ttys because all possible values of 'top_frame' slot are
7430 the frames which are reachable from Vframe_list.
7431 * term.c (mark_ttys): Remove.
7432 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7433
4e0f6479
DA
74342012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7435
7436 Change struct frame bitfields from unsigned char to unsigned.
7437 * frame.h (struct frame): Change type of 'display_preempted',
7438 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7439 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7440 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7441 bitfields from unsigned char to unsigned.
7442
8b96a52c
DA
74432012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7444
7445 Remove unused member of struct x_output and struct w32_output.
7446 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7447 * w32term.h (struct w32_output): Likewise.
7448
b4444c8a
JD
74492012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7450
7451 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7452 does not become zero (Bug#12234).
7453
b98521db
PE
74542012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7455
7456 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7457 for GCC 4.7.1 x86-64.
7458
31d02438
GM
74592012-08-30 Glenn Morris <rgm@gnu.org>
7460
7461 * lread.c (init_lread): For out-of-tree builds, only add the
7462 source directory's site-lisp dir to the load-path if it exists,
7463 consistent with in-tree builds. (Bug#12302)
7464
7f8941d8
JD
74652012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7466
7467 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 7468 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
7469 (windowShouldClose:): Set window_closed.
7470 (dealloc): New member, free button_values.
fc0c31f8
JB
7471 (process_dialog:): Make member function. Remove window argument,
7472 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
7473 in button_values.
7474 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 7475 with tag. Remove return self, declare return value as void.
7f8941d8
JD
7476 (addString:row:): Remove return self, declare return value as void.
7477 (addSplit): Remove return self, declare return value as void.
7478 (clicked:): Remove return self, declare return value as void.
fc0c31f8 7479 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
7480 (initFromContents:isQuestion:): Adjust call to process_dialog.
7481 Code formatting change.
7482 (timeout_handler:): Set timer_fired to YES.
7483 (runDialogAt:): Set timer_fired to NO.
7484 Handle click on close button as quit.
7485
7486 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7487 Add window_closed and button_values. Add void as return value for
7488 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7489 Add process_dialog as new member.
7490
eada0861 74912012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 7492
eada0861
GM
7493 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7494 is not one of the heaps we manage. (Bug#12242)
7495
74962012-08-28 Glenn Morris <rgm@gnu.org>
7497
7498 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7499
457294dd
MR
75002012-08-28 Martin Rudalics <rudalics@gmx.at>
7501
7502 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
7503 auto-buffer-name window parameter. Install revision of reverted
7504 fix.
457294dd 7505
4f2daf31
DA
75062012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7507
7508 Do not allow to set major mode for a dead buffer.
7509 * buffer.c (Fset_buffer_major_mode): Signal an error
7510 if the buffer is dead.
7511 (Fother_buffer, other_buffer_safely): Remove redundant
7512 nested declaration.
7513
66322887
DA
75142012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7515
7516 Always use set_buffer_if_live to restore original buffer at unwind.
7517 * buffer.h (record_unwind_current_buffer): New function.
7518 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7519 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7520 * undo.c, window.c: Adjust users.
7521 * buffer.c (set_buffer_if_live): Fix comment.
7522
a3d794a1
DA
75232012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7524
7525 Fix usage of set_buffer_internal.
7526 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7527 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7528 * coding.c (decode_coding): Omit redundant test.
7529 * fileio.c (decide_coding_unwind): Likewise.
7530 * fns.c (secure_hash): Likewise.
7531 * insdel.c (modify_region): Likewise.
7532 * keyboard.c (command_loop_1): Likewise.
7533 * print.c (PRINTFINISH): Likewise.
7534 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7535
59ea14cd
PE
75362012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7537
7538 * dispnew.c: Use bool for boolean.
7539 (frame_garbaged, display_completed, delayed_size_change)
7540 (fonts_changed_p, add_window_display_history)
7541 (add_frame_display_history, verify_row_hash)
7542 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7543 (row_equal_p, realloc_glyph_pool)
7544 (allocate_matrices_for_frame_redisplay)
7545 (showing_window_margins_p)
7546 (adjust_frame_glyphs_for_frame_redisplay)
7547 (build_frame_matrix_from_leaf_window, make_current)
7548 (mirrored_line_dance, mirror_line_dance, update_frame)
7549 (update_window_tree, update_single_window)
7550 (check_current_matrix_flags, update_window, update_text_area)
7551 (update_window_line, set_window_update_flags, scrolling_window)
7552 (update_frame_1, scrolling, buffer_posn_from_coords)
7553 (do_pending_window_change, change_frame_size)
7554 (change_frame_size_1, sit_for):
7555 Use bool for boolean.
7556 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7557 and remove last int (actually boolean) argument, which was always 0.
7558 All callers changed.
7559 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7560 * dispextern.h (struct composition_it): Use bool for boolean.
7561 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7562 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7563 * dired.c (file_name_completion):
7564 Use bool for boolean. (This was missed in an earlier change.)
7565
95072a94
MR
75662012-08-27 Martin Rudalics <rudalics@gmx.at>
7567
7568 * window.c (Fset_window_configuration): Revert first part of
7569 last change.
7570
0f19feff
JD
75712012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7572
7573 * nsterm.h (NSPanel): New class variable dialog_return.
7574
3a880af4
SM
7575 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7576 Initialize dialog_return.
0f19feff
JD
7577 (windowShouldClose:): Use stop instead of stopModalWithCode.
7578 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7579 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7580 event.
7581 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7582 modal loop returns.
7583
f10fe38f
PE
75842012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7585
de1339b0
PE
7586 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7587 * composite.c (find_composition, composition_gstring_p)
7588 (composition_reseat_it, find_automatic_composition):
7589 * data.c (let_shadows_buffer_binding_p)
7590 (let_shadows_global_binding_p, set_internal, make_blv)
7591 (Fmake_variable_buffer_local, Fmake_local_variable)
7592 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7593 (cons_to_signed, arith_driver):
7594 * dbusbind.c (xd_in_read_queued_messages):
7595 * dired.c (directory_files_internal, file_name_completion):
7596 Use bool for booleans.
7597 * dired.c (file_name_completion):
7598 * process.h (fd_callback):
7599 Omit int (actually boolean) argument. It wasn't being used.
7600 All uses changed.
7601 * composite.h, lisp.h: Reflect above API changes.
7602
f10fe38f
PE
7603 * cmds.c, coding.c: Use bool for booleans.
7604 * cmds.c (move_point, Fself_insert_command):
7605 * coding.h (struct composition status, struct coding_system):
7606 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7607 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7608 (emacs_mule_char, decode_coding_emacs_mule)
7609 (encode_coding_emacs_mule, detect_coding_iso_2022)
7610 (decode_coding_iso_2022, encode_invocation_designation)
7611 (encode_designation_at_bol, encode_coding_iso_2022)
7612 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7613 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7614 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7615 (encode_coding_raw_text, detect_coding_charset)
7616 (decode_coding_charset, encode_coding_charset, detect_eol)
7617 (detect_coding, get_translation_table, produce_chars)
7618 (consume_chars, reused_workbuf_in_use)
7619 (make_conversion_work_buffer, code_conversion_save)
7620 (decode_coding_object, encode_coding_object)
7621 (detect_coding_system, char_encodable_p)
7622 (Funencodable_char_position, code_convert_region)
7623 (code_convert_string, code_convert_string_norecord)
7624 (Fset_coding_system_priority):
7625 * fileio.c (Finsert_file_contents):
7626 Use bool for booleans.
7627 * coding.h, lisp.h: Reflect above API changes.
7628 * coding.c: Remove unnecessary static function decls.
7629 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7630 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7631 not a boolean 'int', since callers never look at the return value.
7632 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7633 * coding.h (decoding_buffer_size, encoding_buffer_size)
7634 (emacs_mule_string_char): Remove unused extern decls.
7635 (struct iso_2022_spec, struct coding_system):
7636 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7637 (struct emacs_mule_spec): Remove unused field 'full_support'.
7638 All initializations removed.
7639 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7640
5474c384
DA
76412012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7642
f10fe38f 7643 Fix spare memory change (Bug#12286).
5474c384
DA
7644 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7645 (valid_lisp_object_p): Likewise.
7646
c4b6914d
MR
76472012-08-27 Martin Rudalics <rudalics@gmx.at>
7648
7649 * window.c (Fset_window_configuration): Record any window's old
7650 buffer if it's replaced (see Bug#8789). If the new current
7651 buffer doesn't appear in the selected window, go to its old
7652 point (Bug#12208).
7653
35aaa1ea
DA
76542012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7655
7656 Special MEM_TYPE_SPARE to denote reserved memory.
7657 * alloc.c (enum mem_type): New memory type.
7658 (refill_memory_reserve): Use new type for spare memory.
7659 This prevents live_cons_p and live_string_p from incorrect
7660 detection of uninitialized objects from spare memory as live.
7661
6af64513
PE
76622012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7663
8b2e00a3
PE
7664 Spelling fixes.
7665 * Makefile.in (.PHONY): versioclean -> versionclean.
7666
b52d6985
PE
7667 Remove unused external symbols.
7668 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7669 * window.c (Qwindow_valid_p, decode_valid_window):
7670 Now static, not extern.
7671 * data.c (Qinterval): Remove; unused.
7672 (syms_of_data): Do not define 'interval'.
7673 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7674 * window.h (decode_valid_window):
7675 Remove decls.
7676
d5172d4f
PE
7677 * character.c, charset.c, chartab.c: Use bool for booleans.
7678 * character.c (lisp_string_width, string_count_byte8)
7679 (string_escape_byte8):
7680 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7681 (load_charset_map_from_file, map_charset_chars)
7682 (Fdefine_charset_internal, define_charset_internal)
7683 (Fdeclare_equiv_charset, find_charsets_in_text)
7684 (Ffind_charset_region, char_charset, Fiso_charset):
7685 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7686 (sub_char_table_set, sub_char_table_set_range)
7687 (char_table_set_range, optimize_sub_char_table)
7688 (map_sub_char_table):
7689 Use bool for boolean.
7690 * character.c (str_to_unibyte): Omit last boolean argument; it was
7691 always 0. All callers changed.
7692 * character.h, charset.h: Adjust to match previous changes.
7693 * character.h (char_printable_p): Remove decl of nonexistent function.
7694 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7695 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7696 are all boolean, so make them single-bit bitfields.
7697
6af64513
PE
7698 * lisp.h (ASET): Remove attempt to detect side effects.
7699 It was meant to be temporary and it often doesn't work,
7700 because when IDX has side effects the behavior of IDX==IDX
7701 is undefined. See Stefan Monnier in
7702 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7703
e1f29348
BR
77042012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7705
7706 * lisp.h (functionp): New function (extracted from Ffunctionp).
7707 (FUNCTIONP): Use it.
7708 * eval.c (Ffunctionp): Use it.
7709
17c05d74
PE
77102012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7711
0f46bc75
PE
7712 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7713 as that's faster and simpler than static storage. Don't bother
7714 with the g_main_context_query overhead if g_main_context_pending
7715 says no events are pending.
7716 (gfds, gfds_size): Remove these static vars.
7717 (xgselect_initialize): Remove; no longer needed.
7718 All uses and decls removed.
7719
ee4c0f69
PE
7720 * emacs.c (fatal_error_signal_hook): Remove.
7721 All uses removed. This leftover from old code was always 0.
7722
17c05d74
PE
7723 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7724 * casefiddle.c (casify_object, casify_region):
7725 * casetab.c (set_case_table):
7726 * category.c, category.h (word_boundary_p):
7727 * category.h (CHAR_HAS_CATEGORY):
7728 Use bool for booleans, instead of int.
7729
391ceac5
EZ
77302012-08-25 Eli Zaretskii <eliz@gnu.org>
7731
7732 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7733
2f221583
PE
77342012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7735
f4a681b0
PE
7736 On assertion failure, print backtrace if available.
7737 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7738 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7739 * Makefile.in (LIB_EXECINFO): New macro.
7740 (LIBES): Use it.
7741
2f221583
PE
7742 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7743 * bytecode.c (exec_byte_code):
7744 * callint.c (check_mark, Fcall_interactively):
7745 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7746 (getenv_internal, sync_process_alive, call_process_exited):
7747 * lisp.h (USE_SAFE_ALLOCA):
7748 Use bool for booleans, instead of int.
7749 * lisp.h, process.h: Adjust prototypes to match above changes.
7750 * callint.c (Fcall_interactively): Don't assume the mark's
7751 offset fits in 'int'.
7752
37ef52bb
PE
77532012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7754
7755 * buffer.c, buffer.h: Use bool for boolean.
7756 * buffer.c (reset_buffer_local_variables)
7757 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7758 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7759 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7760 (overlay_touches_p, overlay_strings, Foverlay_put)
7761 (report_overlay_modification, call_overlay_mod_hooks):
7762 (mmap_enlarge, mmap_set_vars):
7763 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7764 Use bool for booleans, instead of int.
7765 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7766 since the 1-or-0 return value is always ignored anyway.
7767 (mmap_initialized_p):
7768 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7769 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7770
2cc21167
PE
77712012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7772
7773 * bidi.c: Use bool for boolean.
7774 This is a bit more readable, and makes the text segment of bidi.o
7775 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7776 Presumably it's faster too.
7777 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7778 Now bool.
7779 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7780 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7781 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7782 (bidi_explicit_dir_char, bidi_level_of_next_char)
7783 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7784 Use bool for booleans, instead of int.
7785 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7786 (bidi_unshelve_cache): Adjust decls to match code.
7787
7db4ddf4
MR
77882012-08-23 Martin Rudalics <rudalics@gmx.at>
7789
7790 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7791 argument.
7792
b1bb8011
PE
77932012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7794
7795 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7796 * atimer.h: Include <stdbool.h>.
7797
ff687885
DN
77982012-08-22 Dan Nicolaescu <dann@gnu.org>
7799
7800 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7801 compile time tests instead of run time tests on systems that do
7802 not use them.
7803 (FRAME_MAC_P): Remove leftover from deleted code.
7804 * frame.c (syms_of_frame): Remove leftover from deleted code.
7805
4ce7a138
JD
78062012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7807
7808 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7809
d733ec6d
PE
78102012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7811
7812 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7813 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 7814 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
7815 (fontset_add): Return void, for FONTSET_ADD.
7816
d0d2d26f
PE
78172012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7818
fce31d69
PE
7819 * alloc.c: Use bool for booleans.
7820 (gc_in_progress, abort_on_gc)
7821 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7822 (dont_register_blocks) [GC_MALLOC_CHECK]:
7823 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7824 (check_string_bytes, make_specified_string, memory_full)
7825 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7826 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7827 (mark_stack, valid_pointer_p, make_pure_string)
7828 (Fgarbage_collect, survives_gc_p, gc_sweep):
7829 Use bool for booleans, instead of int.
7830 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7831 Remove unused local.
7832 * alloc.c (PURE_POINTER_P):
7833 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7834 * editfns.c (Fformat):
7835 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7836 (Fdo_auto_save):
7837 * fns.c (sweep_weak_table):
7838 * lisp.h (suppress_checking, push_message, survives_gc_p)
7839 (make_pure_string, gc_in_progress, abort_on_gc):
7840 * lread.c (readchar, read1):
7841 * print.c (Fprin1_to_string):
7842 * xdisp.c (push_message):
7843 Use bool for booleans affected directly or indirectly by
7844 alloc.c's changes.
7845
d0d2d26f
PE
7846 Make recently-introduced setters macros.
7847 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7848 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7849 (set_fontset_default, set_fontset_fallback): Rename from their
7850 upper-case counterparts, and make them functions rather than macros.
7851 This is more consistent with the other recently-introduced setters.
7852 These don't need to be inline, since they're local.
7853
d18e2bb6
JD
78542012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7855
7856 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7857 the loop (Bug#12247).
7858
1b9d9d16
PE
78592012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 * lisp.h (vcopy): Use memcpy rather than our own loop.
7862 This fixes a performance regression introduced by the recent
7863 addition of vcopy. This means 'vcopy' will need to be modified
7864 for a copying collector, but that's OK. Also, tighten the
7865 checking in the assertion.
7866
b2f09701
EZ
78672012-08-21 Eli Zaretskii <eliz@gnu.org>
7868
7869 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7870 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7871 non-base glyph for the width of the base character, according to
e1f29348
BR
7872 what x_draw_composite_glyph_string_foreground expects.
7873 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
7874 expectations, to produce correct width of the composed character.
7875 Reverse the sign of the DU offset produced by ScriptPlace.
7876
9b994fed
PE
78772012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7878
7879 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7880
086ca913
DA
78812012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7882
7883 Avoid direct writes to contents member of struct Lisp_Vector.
7884 * lisp.h (vcopy): New function to copy data into vector.
7885 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7886 * fns.c (Ffillarray): Use ASET.
7887 * keyboard.c (timer_check_2): Use AREF and ASET.
7888 (append_tool_bar_item, Frecent_keys): Use vcopy.
7889 * lread.c (read_vector): Use ASET.
7890 * msdos.c (Frecent_doskeys): Use vcopy.
7891 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7892 (Finternal_merge_in_global_face): Use ASET and vcopy.
7893 * xfont.c (xfont_list_pattern): Likewise.
7894
5481664a
MR
78952012-08-21 Martin Rudalics <rudalics@gmx.at>
7896
7897 * window.c (Fwindow_point): For the selected window always return
7898 the position of its buffer's point.
7899 (Fset_window_point): For the selected window always go in its
7900 buffer to the specified position.
7901
6d470bdd
DA
79022012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7903
7904 Setter macros for fontsets.
7905 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7906 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7907 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7908 Adjust users.
7909
24564fe1
GM
79102012-08-20 Glenn Morris <rgm@gnu.org>
7911
7912 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7913 Don't assume that `ln -f' works.
7914
0a05a035
EZ
79152012-08-20 Eli Zaretskii <eliz@gnu.org>
7916
7917 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7918 and later about non-assignments with no effect. See discussion at
7919 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7920 details.
7921
e46f2325
DA
79222012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7923
7924 Inline setter functions for Lisp_Objects slots of struct specbinding.
7925 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7926 Adjust users.
7927
734fbd86
MR
79282012-08-20 Martin Rudalics <rudalics@gmx.at>
7929
7930 * window.c (select_window): Always make selected window's buffer
7931 current.
7932
f1a95992
DA
79332012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7934
7935 Use AREF and ASET for docstrings of category tables.
7936 * category.h (CATEGORY_DOCSTRING): Use AREF.
7937 (SET_CATEGORY_DOCSTRING): Use ASET.
7938 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7939
e83064be
DA
79402012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7941
7942 Inline setter functions for hash table members.
7943 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7944 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7945 (set_hash_key_and_value, set_hash_index, set_hash_next)
7946 (set_hash_hash): New functions.
7947 * charset.c, fns.c: Adjust users.
7948
4ce60d2e
DA
79492012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7950
7951 Inline getter and setter functions for per-buffer values.
7952 * buffer.h (per_buffer_default, set_per_buffer_default)
7953 (per_buffer_value, set_per_buffer_value): New functions.
7954 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7955 * buffer.c, data.c: Adjust users.
7956
c06c9690
JB
79572012-08-20 Juanma Barranquero <lekktu@gmail.com>
7958
7959 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7960
32bd4250
PE
79612012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7962
bad03192 7963 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
7964 as gnulib does this if the system doesn't.
7965 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
7966 Remove declaration. MS-Windows declares it on stdlib.h which is
7967 included by conf_post.h.
b69a6d22
PE
7968 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7969 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7970 * vm-limit.c: Include <unistd.h>, for 'environ'.
7971
22d7feb2
PE
7972 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7973 (start_of_data): Remove decl; mem-limits.h provides it.
7974
32bd4250
PE
7975 * xdisp.c (handle_invisible_prop): Make it a bit faster
7976 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7977
450809af
CY
79782012-08-19 Chong Yidong <cyd@gnu.org>
7979
7980 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7981 ends (Bug#3874).
7982
9e677988
AS
79832012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7984
6b1319ce
AS
7985 * .gdbinit: Use call instead of set when calling a function in the
7986 inferior.
7987
9e677988
AS
7988 * data.c (set_internal): Don't use set_blv_found.
7989 (Fkill_local_variable): Likewise.
7990
d7191076
AA
79912012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7992
7993 * nsfont.m (ns_ascii_average_width): Ensure the string
7994 ascii_printable is initialized with a null-terminated character
7995 array. Otherwise, it can contain undesired extra characters.
7996
e757f1c6
PE
79972012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7998
7999 port new setting code to Sun C 5.8 2005/10/13
8000 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8001 Return void, not Lisp_Object. Otherwise, the compiler
8002 complains about (A?B:C) where B is void and C is Lisp_Object
8003 when compiling CHAR_TABLE_SET, due to the recent change to
8004 the API of sub_char_table_set_contents.
8005
a999ce26
CY
80062012-08-18 Chong Yidong <cyd@gnu.org>
8007
8008 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8009 for the string case (Bug#3874).
8010
3f22b86f
PE
80112012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8012
39eb03f1
PE
8013 * buffer.h (BSET): Remove (Bug#12215).
8014 Replace all uses with calls to new setter functions.
8015 (bset_bidi_paragraph_direction, bset_case_canon_table)
8016 (bset_case_eqv_table, bset_directory, bset_display_count)
8017 (bset_display_time, bset_downcase_table)
8018 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8019 (bset_last_selected_window, bset_local_var_alist)
8020 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8021 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8022 (bset_width_table):
8023 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8024 (bset_auto_fill_function, bset_auto_save_file_format)
8025 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8026 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8027 (bset_cache_long_line_scans, bset_case_fold_search)
8028 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8029 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8030 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8031 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8032 (bset_header_line_format, bset_indicate_buffer_boundaries)
8033 (bset_indicate_empty_lines, bset_invisibility_spec)
8034 (bset_left_fringe_width, bset_major_mode, bset_mark)
8035 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8036 (bset_name, bset_overwrite_mode, bset_pt_marker)
8037 (bset_right_fringe_width, bset_save_length)
8038 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8039 (bset_scroll_up_aggressively, bset_selective_display)
8040 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8041 (bset_word_wrap, bset_zv_marker):
8042 * category.c (bset_category_table):
8043 * syntax.c (bset_syntax_table):
8044 New setter functions.
8045
6a09a33b
PE
8046 * process.h (PSET): Remove (Bug#12215).
8047 Replace all uses with calls to new setter functions.
8048 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8049 (PROCESS_INLINE): New macro.
8050 (pset_childp): New setter function.
8051 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8052 * process.c (PROCESS_INLINE):
8053 Define to EXTERN_INLINE, so that the corresponding functions
8054 are compiled into code.
8055 (pset_buffer, pset_command, pset_decode_coding_system)
8056 (pset_decoding_buf, pset_encode_coding_system)
8057 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8058 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8059 (pset_type, pset_write_queue): New setter functions.
8060
e8c17b81
PE
8061 * window.h (WSET): Remove (Bug#12215).
8062 Replace all uses with calls to new setter functions.
8063 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8064 (WINDOW_INLINE): New macro.
8065 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8066 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8067 (wset_total_lines, wset_vertical_scroll_bar)
8068 (wset_window_end_pos, wset_window_end_valid)
8069 (wset_window_end_vpos): New setter functions.
8070 * window.c (WINDOW_INLINE):
8071 Define to EXTERN_INLINE, so that the corresponding functions
8072 are compiled into code.
8073 (wset_combination_limit, wset_dedicated, wset_display_table)
8074 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8075 (wset_new_normal, wset_new_total, wset_next_buffers)
8076 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8077 (wset_prev_buffers, wset_right_fringe_width)
8078 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8079 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8080 (wset_window_parameters):
8081 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8082 (wset_column_number_displayed, wset_region_showing):
8083 New setter functions.
8084
3f22b86f
PE
8085 * termhooks.h (TSET): Remove (Bug#12215).
8086 Replace all uses with calls to new setter functions.
8087 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8088 (TERMHOOKS_INLINE): New macro.
8089 (tset_charset_list, tset_selection_alist): New setter functions.
8090 * terminal.c (TERMHOOKS_INLINE):
8091 Define to EXTERN_INLINE, so that the corresponding functions
8092 are compiled into code.
8093 (tset_param_alist): New setter function.
8094
742af32f
PE
80952012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8096
15dbb4d6
PE
8097 * keyboard.h (KSET): Remove (Bug#12215).
8098 Replace all uses with calls to new setter functions.
8099 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8100 (KEYBOARD_INLINE): New macro.
8101 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8102 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8103 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8104 New setter functions.
8105 * keyboard.c (KEYBOARD_INLINE):
8106 Define to EXTERN_INLINE, so that the corresponding functions
8107 are compiled into code.
8108 (kset_echo_string, kset_kbd_queue)
8109 (kset_keyboard_translate_table, kset_last_prefix_arg)
8110 (kset_last_repeatable_command, kset_local_function_key_map)
8111 (kset_overriding_terminal_local_map, kset_real_last_command)
8112 (kset_system_key_syms): New setter functions.
8113
f00af5b1
PE
8114 * frame.h (FSET): Remove (Bug#12215).
8115 Replace all uses with calls to new setter functions.
8116 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8117 (FRAME_INLINE): New macro.
8118 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8119 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8120 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8121 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8122 (fset_param_alist, fset_root_window, fset_scroll_bars)
8123 (fset_selected_window, fset_title, fset_tool_bar_items)
8124 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8125 * frame.c (FRAME_INLINE):
8126 Define to EXTERN_INLINE, so that the corresponding functions
8127 are compiled into code.
8128 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8129
0c94c8d6
PE
8130 A few more naming-convention fixes for getters and setters.
8131 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8132 and rename from buffer_overlays_set_before.
8133 (set_buffer_overlays_after): Move here from buffer.h, and rename
8134 from buffer_overlays_set_after.
8135 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8136 All uses changed.
8137 (set_buffer_intervals): Rename from buffer_set_intervals.
8138 * intervals.c (set_interval_object): Move here from intervals.h,
8139 and rename from interval_set_object.
8140 (set_interval_left): Move here from intervals.h, and rename from
8141 interval_set_left.
8142 (set_interval_right): Move here from intervals.h, and rename from
8143 interval_set_right.
8144 (copy_interval_parent): Move here from intervals.h, and rename from
8145 interval_copy_parent.
8146 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8147 (set_interval_plist): Rename from interval_set_plist.
8148 Return void, not Lisp_Object, since no caller uses the result.
8149 * lisp.h (string_intervals): Rename from string_get_intervals.
8150 (set_string_intervals): Rename from string_set_intervals.
8151
34dabdb7
PE
8152 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8153 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 8154 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
8155 All uses changed. See the end of
8156 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8157
742af32f
PE
8158 * lisp.h (CSET): Remove (Bug#12215).
8159 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8160 (set_char_table_purpose): New functions,
8161 replacing CSET. All uses changed. For example, replace
8162 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 8163 "set_char_table_parent (char_table, parent);".
742af32f
PE
8164 The old version was confusing because it used the same name
8165 'parent' for two different things.
8166
a04e2c62
DA
81672012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8168
8169 Functions to get and set Lisp_Object fields of buffer-local variables.
8170 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8171 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8172 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8173 * data.c, eval.c, frame.c: Adjust users.
8174
383dcbf9
CY
81752012-08-17 Chong Yidong <cyd@gnu.org>
8176
8177 * xfaces.c (merge_face_vectors): If the target font specfies a
8178 font spec, make the font's attributes take precedence over
8179 directly-specified attributes.
8180 (merge_face_ref): Recognize :font.
8181
44386687
DA
81822012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8183
8184 Do not use memcpy for copying intervals.
8185 * intervals.c (reproduce_interval): New function.
8186 (reproduce_tree, reproduce_tree_obj): Use it.
8187 (reproduce_tree_obj): Remove prototype.
8188
927c7216
PE
81892012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8190
8191 * lisp.h (duration_to_sec_usec): Remove unused decl.
8192
93044f7b
AA
81932012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8194
8195 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8196 to an allocated instance of NSString, not to the class itself.
8197
9851e4a5
JB
81982012-08-17 Juanma Barranquero <lekktu@gmail.com>
8199
8200 * makefile.w32-in (C_CTYPE_H): New macro.
8201 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8202 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8203 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8204
620f13b0
PE
82052012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8206
8207 Use ASCII tests for character types.
8208 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8209 * xfns.c, xterm.c:
8210 Don't include <ctype.h>; was not needed.
8211 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8212 * sysdep.c, xfaces.c:
8213 Include <c-ctype.h> instead of <ctype.h>.
8214 * nsterm.m: Include <c-ctype.h>.
8215 * charset.c (read_hex):
8216 * doc.c (Fsnarf_documentation):
8217 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8218 (DRIVE_LETTER) [DOS_NT]:
8219 (Ffile_name_directory, Fexpand_file_name)
8220 (Fsubstitute_in_file_name):
8221 * font.c (font_parse_xlfd, font_parse_fcname):
8222 * frame.c (x_set_font_backend):
8223 * gtkutil.c (xg_get_font):
8224 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8225 * nsimage.m (hexchar):
8226 * nsterm.m (ns_xlfd_to_fontname):
8227 * sysdep.c (system_process_attributes):
8228 * xfaces.c (hash_string_case_insensitive):
8229 Use C-locale tests instead of locale-specific tests for character
8230 types, since we want the ASCII interpretation here, not the
8231 interpretation suitable for whatever happens to be the current locale.
8232
52162052
MR
82332012-08-16 Martin Rudalics <rudalics@gmx.at>
8234
8235 Consistently check windows for validity/liveness
8236 (Bug#11984, Bug#12025, Bug#12026).
8237 * lisp.h (CHECK_VALID_WINDOW): New macro.
8238 * window.c (decode_window): Rename to decode_live_window.
8239 (decode_valid_window, Fwindow_valid_p): New functions.
8240 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8241 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8242 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8243 (Fwindow_prev_sibling, Fwindow_combination_limit)
8244 (Fset_window_combination_limit, Fwindow_use_time)
8245 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8246 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8247 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8248 (Fwindow_hscroll, Fset_window_hscroll)
8249 (Fwindow_redisplay_end_trigger)
8250 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8251 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8252 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8253 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8254 (Fwindow_end, Fset_window_point, Fset_window_start)
8255 (Fpos_visible_in_window_p, Fwindow_line_height)
8256 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8257 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8258 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8259 (Fset_window_parameter, Fwindow_display_table)
8260 (Fset_window_display_table, Fdelete_other_windows_internal)
8261 (Fset_window_buffer, Fset_window_new_total)
8262 (Fset_window_new_normal, Fdelete_window_internal)
8263 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8264 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8265 (Fwindow_scroll_bars): Check whether argument window is a valid or
8266 live window. Update doc-strings.
8267 (syms_of_window): New symbol Qwindow_valid_p.
8268 * keyboard.c (Fposn_at_x_y): Check whether argument
8269 frame_or_window denotes a valid window.
8270
2751c80f
DA
82712012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8272
8273 Fix previous char table change.
8274 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8275 * chartab.c (optimize_sub_char_table): Likewise.
8276
032a42c8
CY
82772012-08-16 Chong Yidong <cyd@gnu.org>
8278
a2d19368
CY
8279 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8280
032a42c8
CY
8281 * xfont.c (xfont_open):
8282 * xftfont.c (xftfont_open): Set the font's max_width field.
8283
8284 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8285 min_width to space_width and average_width to the average over
8286 printable ASCII characters.
8287 (ns_char_width): Code cleanup.
8288 (ns_ascii_average_width): New utility function.
8289
8290 * font.h (struct font): Update comments.
8291
a098c930
DA
82922012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8293
032a42c8 8294 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
8295 * lisp.h (CSET): New macro.
8296 (char_table_set_extras, char_table_set_contents)
8297 (sub_char_table_set_contents): New function.
8298 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8299 * syntax.c: Adjust users.
8300
8be3a09c
SM
83012012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8302
8303 * eval.c (eval_sub): Bind lexical-binding.
8304 * lread.c (Qlexical_binding): Make non-static.
8305
ac4845a6
JD
83062012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8307
ddee6515
JD
8308 * nsmenu.m (popupSession): Remove.
8309 (pop_down_menu): Remove endModalSession.
8310 (timeout_handler:): New method.
8311 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8312 Call runModalForWindow. Check timer_fired when it returns.
8313 If not set, cancel timer and break out of loop.
8314 Otherwise loop again, with a new timeout.
8315
8316 * nsterm.m: Include fcntl.h if present.
8317 (fd_entry, t_readfds, inNsSelect): Remove.
8318 (select_writefds, select_valid, select_timeout, selfds)
8319 (select_mutex, apploopnr): Add.
8320 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8321 Otherwise call kbd_buffer_store_event.
8322 (ns_send_appdefined): Remove release of fd_entry.
8323 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8324 Increment and decrement apploopnr.
8325 (ns_select): If no file descriptors, just do a NSTimer.
8326 Otherwise copy read/write masks and start select thread (fd_handler).
8327 Start main loop and wait for application defined event.
8328 Inform select thread to stop selecting after main loop is exited.
8329 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 8330 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
8331 (fd_handler:): Loop forever, wait for info from the main thread
8332 to either start or stop selecting. When select returns, send
8333 and appdefined event.
8334 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8335 If not call kbd_buffer_store_event.
8336
8337 * nsterm.h (EmacsApp): fd_handler takes id argument.
8338 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8339
ac4845a6
JD
8340 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8341
eb424fe3
EZ
83422012-08-15 Eli Zaretskii <eliz@gnu.org>
8343
8344 * region-cache.c (move_cache_gap): Update gap_len using the actual
8345 growth of the boundaries array. Do not change cache_len.
8346 (Bug#12196)
8347
4e6a86c6
DA
83482012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8349
8350 Generalize and cleanup font subsystem checks.
8351 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
8352 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8353 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 8354
5bf192ca
DA
83552012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8356
8357 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8358
f2045622
CY
83592012-08-15 Chong Yidong <cyd@gnu.org>
8360
8be3a09c
SM
8361 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8362 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8363 extract the font descriptor instead of just the font name.
8364 In that case, return a font spec instead of a string.
f2045622
CY
8365 (x_last_font_name): Move to this file from xfns.c.
8366
8367 * xfns.c (Fx_select_font): The return value can also be a font
8368 spec. Move x_last_font_name management to gtkutil.c.
8369
8370 * xfaces.c: Make font weight and style symbols non-static.
8371
7f6feb56
SM
83722012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8373
8374 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8375 (bug#12117).
8376
fecbd8ff
SM
83772012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8378
8379 * alloc.c (Fgarbage_collect): Use plural form consistently.
8380
9b8d5165
EZ
83812012-08-14 Eli Zaretskii <eliz@gnu.org>
8382
8383 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8384 iteration through the command loop. Fixes a problem whereby mouse
8385 movements are ignored until the first mouse click.
8386
f5d9e83a
PE
83872012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8388
8389 Use bool, not int, for Lisp booleans.
8390 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8391 makes Emacs a bit smaller and presumably a bit faster.
8392 * lisp.h: Include <stdbool.h>.
8393 (struct Lisp_Boolfwd, defvar_bool):
8394 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8395 * regex.c [!emacs]: Include <stdbool.h>.
8396 (false, true): Remove; <stdbool.h> does this for us now.
8397
55802e4a
CY
83982012-08-14 Chong Yidong <cyd@gnu.org>
8399
4abcdac8
CY
8400 * character.c (Fcharacterp): Doc fix (Bug#12076).
8401
8402 * data.c (Findirect_variable): Doc fix (Bug#11040).
8403
55802e4a
CY
8404 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8405
8406 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 8407 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 8408
8e99d072
BR
84092012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8410
8411 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8412 (bug#12022).
8413
08908aca
MR
84142012-08-14 Martin Rudalics <rudalics@gmx.at>
8415
8416 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8417 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8418 * minibuf.c (choose_minibuf_frame, read_minibuf):
8419 * w32fns.c (x_create_tip_frame):
8420 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8421 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8422
56120d6f
PE
84232012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8424
8425 * intervals.c (offset_intervals): Remove obsolete comment.
8426
67b77c0b
AS
84272012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8428
8429 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8430
f48b82fd
GR
84312012-08-14 Gergely Risko <gergely@risko.hu>
8432
8433 * coding.c (decode_coding): Record buffer modification before
8434 disabling undo_list (Bug#11773).
8435
fd318b54
DA
84362012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8437
8438 Revert and cleanup some recent overlay changes.
8439 * buffer.h (enum overlay_type): Remove.
8440 (buffer_get_overlays, buffer_set_overlays): Likewise.
8441 (buffer_set_overlays_before, buffer_set_overlays_after):
8442 New function. Adjust users.
8443 (unchain_both): Add eassert.
8444
41a62dd9
DA
84452012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8446
8447 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8448
5884c324
PE
84492012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8450
8451 * gtkutil.c (xg_mark_data): Don't assume C99.
8452
ca06f160
JD
84532012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8454
8455 * gtkutil.c (xg_frame_tb_info): New struct.
8456 (TB_INFO_KEY): New define.
8457 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8458 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8459 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8460 if not present.
8461 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 8462 is up to date. Otherwise store new data.
ca06f160
JD
8463 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8464
7864a3f7
DA
84652012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8466
8467 Use KSET for write access to Lisp_Object members of struct kboard.
8468 * keyboard.h (KSET): New macro.
8469 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8470 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8471 * xterm.c: Adjust users.
8472
4c31be61
DA
84732012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8474
8475 Use BSET for write access to Lisp_Object members of struct buffer.
8476 * buffer.h (BSET): New macro.
8477 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8478 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8479 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8480 * window.c, xdisp.c, xfns.c: Adjust users.
8481
14ae4239
BT
84822012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8483
8484 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8485
32bcadb4
JD
84862012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8487
3d29b2ce 8488 * nsterm.m (not_in_argv): New function.
fc0c31f8 8489 (application:openFile, application:openTempFile:):
3d29b2ce
JD
8490 (application:openFileWithoutUI:, application:openFiles:): Open file
8491 if not_in_argv returns non-zero (bug#12171).
8492
32bcadb4 8493 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
8494 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8495 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
8496 (xg_get_font_name): Use those functions/macros here.
8497 Reported by Frans Oilinki <moilinki@gmail.com>.
8498
9ff9402d 84992012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
8500
8501 * unexmacosx.c (copy_data_segment): Copy initialized data in
8502 statically linked libraries from input file rather than memory.
8503
db74a5fc
YM
8504 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8505 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8506 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8507
25e65510
GM
85082012-08-10 Glenn Morris <rgm@gnu.org>
8509
8510 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8511 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8512
7961135c
DA
85132012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8514
8515 Fix last change to allow compilation with low optimization levels.
8516 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8517 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8518
42b3a444
DA
85192012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8520
8521 Use common inline syntax in intervals.h.
8522 * intervals.h (INTERVALS_INLINE): New macro.
8523 Change all users from LISP_INLINE.
8524
9fb0c957
DA
85252012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8526
8527 Define Qnone once for all platforms.
8528 * frame.c (Qnone): Define here.
8529 (syms_of_frame): DEFSYM it.
8530 * lisp.h (Qnone): New declaration.
8531 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8532 * xfns.c: Remove duplication. Adjust users.
8533
65e8ee52
DA
85342012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8535
8536 Remove unused macros from intervals.h.
8537 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8538 * intervals.c: Adjust comment.
8539
9b855fd6
EZ
85402012-08-10 Eli Zaretskii <eliz@gnu.org>
8541
8542 * w32fns.c <w32_unicode_gui>: New static variable.
8543 (globals_of_w32fns): Initialize it according to os_subtype.
8544 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8545 testing os_subtype.
8546
39cb9e56 85472012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
8548 Eli Zaretskii <eliz@gnu.org>
8549
8550 Fix bug #10299 with Unicode characters sent by customized
8551 keyboards created by MSKLC.
8552 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8553 (w32_init_class): Use it to initialize the Emacs class with either
8554 ANSI or Unicode API calls.
8555 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8556 later.
8557 (w32_wnd_proc): If the character code sent by WM_CHAR or
8558 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8559 original message. Call DefWindowProcW on NT and later.
8560
9374581a
GM
85612012-08-10 Glenn Morris <rgm@gnu.org>
8562
4b94e8cf
GM
8563 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8564
9374581a
GM
8565 * lisp.h (DIRECTORY_SEP): Let configure set it.
8566
a2752828
DA
85672012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8568
8569 Use TSET for write access to Lisp_Object slots of struct terminal.
8570 * termhooks.h (TSET): New macro.
8571 * coding.c, terminal.c, xselect.c: Adjust users.
8572
cc92c454
SM
85732012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8574
8575 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8576 the failing expression, include them in the error message.
8577 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8578 * lisp.h (internal_condition_case_n): Update declaration.
8579
4cb3e6b3
DA
85802012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8581
8582 Inline functions to examine and change buffer overlays.
8583 * buffer.c (unchain_both): New function.
8584 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8585 (buffer_has_overlays): New function.
8586 (enum overlay_type): New enum.
8587 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8588 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8589
8707c1e5
DA
85902012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8591
8592 Inline functions to examine and change buffer intervals.
8593 * alloc.c (mark_interval_tree): Remove.
8594 (MARK_INTERVAL_TREE): Simplify.
8595 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8596 * intervals.c (buffer_balance_intervals): New function.
8597 (graft_intervals_into_buffer): Adjust indentation.
8598 (set_intervals_multibyte): Simplify.
8599 * buffer.h (BUF_INTERVALS): Remove.
8600 (buffer_get_intervals, buffer_set_intervals): New function.
8601 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8602 * intervals.c, textprop.c: Adjust users.
8603
ad8c997f
DA
86042012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8605
8606 Inline functions to examine and change string intervals.
8607 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8608 (string_get_intervals, string_set_intervals): New function.
8609 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8610 * lread.c, print.c, textprop.c: Adjust users.
8611
32ac3a6b
GM
86122012-08-08 Glenn Morris <rgm@gnu.org>
8613
8614 * lisp.mk (lisp): Remove language/persian.elc.
8615
77c7bcb1
DA
86162012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8617
8618 Cleanup intervals.
8619 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8620 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
8621 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8622 Adjust comment. Move under #if 0.
77c7bcb1
DA
8623 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8624 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8625
9c08a8d4
DA
86262012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8627
8628 Check total length of intervals with eassert.
8629 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8630 * intervals.c: Change all users to eassert.
8631
26d16b35
EZ
86322012-08-07 Eli Zaretskii <eliz@gnu.org>
8633
14ae4239
BT
8634 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8635 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
8636 INTERNAL_FIELD in Lisp_Cons.
8637
c644523b
DA
86382012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8639
8640 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8641 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8642 name since all xname users are fixed long time ago. Do not
8643 use INTERNAL_FIELD.
8644 (set_symbol_name, set_symbol_function, set_symbol_plist):
8645 (set_symbol_next, set_overlay_plist): New function.
8646 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8647 (struct Lisp_Overlay): Likewise.
8648 (CVAR, MVAR, SVAR): Remove.
8649 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8650 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8651 * xterm.c: Adjust users.
8652 * .gdbinit: Change to use name field of struct Lisp_Symbol
8653 where appropriate.
8654
6a3d20cc
DA
86552012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8656
8657 Basic functions to set Lisp_Object and pointer slots of intervals.
8658 * intervals.h (interval_set_parent, interval_set_object):
8659 (interval_set_left, interval_set_right, interval_set_plist):
8660 (interval_copy_parent): New function.
8661 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
8662 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8663 Adjust indentation.
6a3d20cc
DA
8664 (INTERVAL_SIZE): Remove. Adjust users.
8665 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8666
4d2b044c
DA
86672012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8668
8669 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8670 * process.h (PGET): Remove.
8671 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8672 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8673
d3d50620
DA
86742012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8675
8676 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8677 * window.h (WGET): Remove.
8678 (struct window): Do not use INTERNAL_FIELD.
8679 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8680 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8681 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8682 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8683 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8684 Adjust users.
8685
d10a51dc
CY
86862012-08-07 Chong Yidong <cyd@gnu.org>
8687
8688 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8689 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8690 (Fdelete_window_internal): Signal an error if the window is not on
8691 a live frame (Bug#12025).
8692
e69b0960
DA
86932012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8694
8695 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8696 * frame.h (FGET): Remove.
8697 (struct frame): Do not use INTERNAL_FIELD.
8698 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8699 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8700 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8701 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8702
25a20a3a
JB
87032012-08-06 Juanma Barranquero <lekktu@gmail.com>
8704
8705 * w32.c: Silence compiler warnings.
8706 (map_w32_filename): Remove unused variable `is_fat'.
8707 (chase_symlinks): Add parentheses around expression.
8708
1c6f11f4
GM
87092012-08-06 Glenn Morris <rgm@gnu.org>
8710
1db4583a
GM
8711 * sysdep.c: Respect BROKEN_GETWD.
8712
1c6f11f4
GM
8713 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8714 Let configure handle it.
8715 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8716
2b90362b
DA
87172012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8718
8719 Use GCALIGNMENT where appropriate.
8720 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8721 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8722 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8723
5f50daf2
EZ
87242012-08-06 Eli Zaretskii <eliz@gnu.org>
8725
14ae4239
BT
8726 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8727 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 8728
cbcc7007
SM
87292012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8730
8731 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8732 that should be sufficient for everyone.
8733
4d365fa4
JD
87342012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8735
8736 * keyboard.c (timer_check_2): Add break so timer_check returns next
8737 timeout.
8738
dd86bd82
DA
87392012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8740
8741 Fix Windows build errors introduced after converting to WGET and WSET.
8742 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8743 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8744
054e1668
JD
87452012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8746
8747 * nsterm.m (ns_frame_rehighlight): Use FSET.
8748
8749 * nsmenu.m (ns_update_menubar): Use FSET.
8750
21238f11
DA
87512012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8752
8753 Separate read and write access to Lisp_Object slots of Lisp_Process.
8754 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8755 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8756
077288cf
DA
87572012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8758
8759 Separate read and write access to Lisp_Object slots of struct window.
8760 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8761 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8762 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8763 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8764 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8765 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8766 Adjust users.
8767
71688bd7
DA
87682012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8769
8770 Fix Windows build errors introduced after converting to FGET and FSET.
8771 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8772 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8773 (w32_judge_scroll_bars): Change to use FSET.
8774 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8775
f99bac93
DA
87762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8777
8778 Fix replacement typo.
8779 * window.c (replace_window): Set root_window instead of
8780 selected_window. This fixes a total window subsystem
8781 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8782
8c2a0f2d
GM
87832012-08-06 Glenn Morris <rgm@gnu.org>
8784
8785 * lisp.mk (lisp): Add language/persian.elc.
8786
edd74c35
DA
87872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8788
8789 Separate read and write access to Lisp_Object slots of struct frame.
8790 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8791 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8792 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8793 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8794 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8795
8671676c
AS
87962012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8797
8798 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8799
663e2b3f
DA
88002012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8801
8802 Generalize common compile-time constants.
8803 * lisp.h (header_size, bool_header_size, word_size): Now here.
8804 (struct Lisp_Vector): Add comment.
8805 (struct Lisp_Bool_Vector): Move up to define handy constants.
8806 (VECSIZE, PSEUDOVECSIZE): Simplify.
8807 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8808 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8809 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8810 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8811 * xfont.c, xmenu.c: Use word_size where appropriate.
8812
d32e47af
LM
88132012-08-05 Lawrence Mitchell <wence@gmx.li>
8814
8815 * search.c (Freplace_match): Treat \? in the replacement text
8816 literally (Bug#8161).
8817
e5d9c0d1
CY
88182012-08-05 Chong Yidong <cyd@gnu.org>
8819
8820 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8821 * frame.c (Vdelete_frame_functions):
8822 * emacs.c (Vkill_emacs_hook): Doc fix.
8823
8da0576b
EZ
88242012-08-04 Eli Zaretskii <eliz@gnu.org>
8825
8826 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8827 --with-x-toolkit=no builds.
8828 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8829
02676e5d
CY
88302012-08-04 Chong Yidong <cyd@gnu.org>
8831
8832 * syntax.c (Fmodify_syntax_entry): Doc fix.
8833
97147da9
EZ
88342012-08-04 Eli Zaretskii <eliz@gnu.org>
8835
76151e2c
EZ
8836 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8837 * w32.c (init_environment): Change the default values of many
8838 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
8839 them into environment when they were not already defined.
8840 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 8841 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
8842 (check_windows_init_file): Now external, not static.
8843 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
8844 called when Vload_path is already set up.
8845
8846 * w32.h (check_windows_init_file): Add prototype.
8847
8848 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8849 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8850 compatibility with Posix platforms.
8851 (main): Move the call to check_windows_init_file to here from
8852 w32.c.
8853 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8854 any, in the DEFALT argument into the root of the Emacs build or
8855 installation tree, as appropriate.
8856
8857 * callproc.c (init_callproc_1): Call decode_env_path instead of
8858 doing its equivalent by hand.
8859 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8860 the code that sets Vexec_path run on MS-Windows.
8861
8862 * lread.c (init_lread): Add comments to #ifdef's.
8863
97147da9
EZ
8864 * msdos.c (dos_set_window_size, IT_update_begin)
8865 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8866 instead of direct references.
8867
185ee146
PE
88682012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8869
8870 Export DEFAULT_REHASH_* to GDB.
8871 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8872 Now constants, not macros.
8873
8834c57a
PE
88742012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8875
98c6f1e3
PE
8876 Remove unnecessary casts involving pointers.
8877 These casts are no longer needed now that we assume C89 or later,
8878 since they involve casting to or from void *.
8879 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8880 (make_pure_float, make_pure_vector):
8881 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8882 * macros.c (Fstart_kbd_macro):
8883 * menu.c (find_and_return_menu_selection):
8884 * minibuf.c (read_minibuf_noninteractive):
8885 * sysdep.c (closedir):
8886 * xdisp.c (x_produce_glyphs):
8887 * xfaces.c (compare_fonts_by_sort_order):
8888 * xfns.c (x_real_positions, select_visual):
8889 * xselect.c (x_stop_queuing_selection_requests)
8890 (x_get_window_property, x_get_window_property_as_lisp_data):
8891 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8892 Remove unnecessary pointer casts.
8893 * alloc.c (record_xmalloc): New function.
8894 * lisp.h (record_xmalloc): New decl.
8895 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8896 more like a function. This is because the pointer cast is not
8897 needed. All uses changed.
8898 * print.c (print_string, print_error_message): Avoid length recalc.
8899
8834c57a
PE
8900 Improve fix for macroexp crash with debugging (Bug#12118).
8901 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8902 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8903 not supposed to be invoked from the garbage collector.
8904 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8905 (gc_aset): New function, which is like ASET but can be
8906 used in the garbage collector.
8907 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8908 (set_hash_index): Use it instead of ASET.
8909
6dad7178
EZ
89102012-08-03 Eli Zaretskii <eliz@gnu.org>
8911
8912 Support symlinks on latest versions of MS-Windows.
8913 * w32.c: Include winioctl.h and aclapi.h.
8914 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8915 (revert_to_self): Forward declarations of static functions.
8916 <static BOOL g_b_init_get_security_info>:
8917 <g_b_init_create_symbolic_link>: New static flags.
8918 (globals_of_w32): Initialize them to zero.
8919 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8920 (map_w32_filename): Improve commentary. Simplify switch.
8921 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8922 headers (most versions of MinGW w32api don't).
8923 (get_security_info, create_symbolic_link)
8924 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8925 New functions.
8926 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8927 in the argument file name.
8928 (sys_access): Call unc_volume_file_attributes only if
8929 GetFileAttributes fails with network-related error codes.
8930 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8931 have the required privileges.
14ae4239 8932 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
8933 get_file_security_desc.
8934 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
8935 with addition of handling of symlinks and support for 'lstat'.
8936 If possible, get file's attributes and security information by
6dad7178
EZ
8937 handle, not by name. Produce S_IFLNK bit for symlinks, when
8938 called from 'lstat'.
8939 (stat, lstat): New functions, call 'stat_worker'.
8940 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8941 symlinks when the underlying filesystem supports them.
8942
f162bcc3
PE
89432012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8944
79ea6c20
PE
8945 Fix macroexp crash on Windows with debugging (Bug#12118).
8946 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8947 checking subscripts; problem introduced with the recent
8948 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8949 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8950 since it's used in non-static inline functions now.
8951
c0ce93fd
PE
8952 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8953 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 8954
f162bcc3
PE
8955 Use C99-style 'extern inline' if available.
8956 * buffer.h (BUFFER_INLINE):
8957 * category.h (CATEGORY_INLINE):
8958 * character.h (CHARACTER_INLINE):
8959 * charset.h (CHARSET_INLINE):
8960 * composite.h (COMPOSITE_INLINE):
8961 * dispextern.h (DISPEXTERN_INLINE):
8962 * lisp.h (LISP_INLINE):
8963 * systime.h (SYSTIME_INLINE):
8964 New macro, replacing 'static inline' in this header.
8965 * buffer.h, category.h, character.h, charset.h, composite.h:
8966 * dispextern.h, lisp.h, systime.h:
8967 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8968 * alloc.c (LISP_INLINE):
8969 * buffer.c (BUFFER_INLINE):
8970 * category.c (CATEGORY_INLINE):
8971 * character.c (CHARACTER_INLINE):
8972 * charset.c (CHARSET_INLINE):
8973 * composite.c (COMPOSITE_INLINE):
8974 * dispnew.c (DISPEXTERN_INLINE):
8975 * sysdep.c (SYSTIME_INLINE):
8976 Define to EXTERN_INLINE, so that the corresponding functions
8977 are compiled into code.
8978 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8979 (INLINE_HEADER_END): New macros.
8980 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8981 since it's used in non-static inline functions now.
a8333d03 8982 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 8983
837b365b
GM
89842012-08-02 Glenn Morris <rgm@gnu.org>
8985
d66b744d
GM
8986 * s/: Remove empty directory.
8987
837b365b
GM
8988 * s/ms-w32.h: Move to ../nt/inc.
8989 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8990 Update for new ms-w32.h location.
8991
13294f95
PE
89922012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8993
8994 Port to Solaris 8.
8995 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8996
90df0db3
GM
89972012-08-02 Glenn Morris <rgm@gnu.org>
8998
8999 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9000 hard-coding the path separator.
9001
4939150c
PE
90022012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9003
9004 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9005 This how ASET and AREF are supposed to work, and makes
9006 it easier to think about future improvements. See
9007 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9008 * charset.h (set_charset_attr): New function.
9009 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9010 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9011 (aref_addr): New function. All uses of &AREF(...) changed.
9012 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9013 (set_hash_index): New functions. All lvalue-style uses of
9014 HASH_KEY etc. changed.
9015 * keyboard.c (set_prop): New function. All lvalue-style uses
9016 of PROP changed.
9017
947b2afd
AA
90182012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9019
9020 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9021 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 9022 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
9023 * nsfns.m (ns_set_name_as_filename): Likewise.
9024 * nsmenu.m (ns_update_menubar): Likewise.
9025 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9026
4f5d0325
EZ
90272012-08-01 Eli Zaretskii <eliz@gnu.org>
9028
2008beae
EZ
9029 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9030 Adapt to latest changes in field names of the corresponding Lisp
288479f6 9031 objects.
2008beae 9032
4f5d0325
EZ
9033 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9034
fe3cc771
GM
90352012-08-01 Glenn Morris <rgm@gnu.org>
9036
9037 * s/msdos.h: Remove file.
9038 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9039 * Makefile.in (S_FILE): Remove.
9040 (config_h): Remove S_FILE.
9041
c90acc54
JB
90422012-08-01 Juanma Barranquero <lekktu@gmail.com>
9043
9044 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9045 Remove; moved to nt/config.nt.
9046
d8a05828
DA
90472012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9048
9049 Use INTERNAL_FIELD for conses and overlays.
9050 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9051 Remove obsolete comment.
9052 (MVAR): New macro.
9053 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9054 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9055
8271d590
DA
90562012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9057
9058 Use INTERNAL_FIELD for symbols.
9059 * lisp.h (SVAR): New macro. Adjust users.
9060 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9061 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9062
3193acd2
DA
90632012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9064
9065 Use INTERNAL_FIELD for processes.
9066 * process.h (PVAR): New macro. Adjust style.
9067 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9068 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9069
3a45383a
DA
90702012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9071
9072 Use INTERNAL_FIELD for windows.
9073 * window.h (WVAR): New macro.
9074 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9075 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9076 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9077 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9078 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9079 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9080
c1dbc63c
PE
90812012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9082
9083 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9084
5c0c0e8a
GM
90852012-08-01 Glenn Morris <rgm@gnu.org>
9086
9087 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9088 Move to configure.ac.
9089
552a99b4
JB
90902012-08-01 Juanma Barranquero <lekktu@gmail.com>
9091
9092 * makefile.w32-in (CONFIG_H): Update dependencies.
9093 (CONF_POST_H): New macro.
9094
9095 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9096
8d8e2dfe
GM
90972012-07-31 Glenn Morris <rgm@gnu.org>
9098
bc96620a
GM
9099 * Makefile.in (S_FILE): No longer set by configure.
9100
476b1b2d
GM
9101 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9102 is available.
9103 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9104
b2c7a106
GM
9105 * process.h (NULL_DEVICE):
9106 * emacs.c (SEPCHAR):
9107 * editfns.c (USER_FULL_NAME): Let configure set them.
9108
d53d062a
GM
9109 * s/README, s/template.h: Remove files.
9110
4515017f
GM
9111 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9112
8d8e2dfe
GM
9113 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9114 Move to configure.ac.
9115
5b20b3cc
EZ
91162012-07-31 Eli Zaretskii <eliz@gnu.org>
9117
1e0afd9a
EZ
9118 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9119 resulting renaming of 'struct frame' members.
9120
5b20b3cc
EZ
9121 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9122
9123 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9124 after introduction of FVAR.
9125
f1310128
JD
91262012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9127
79e721e0
JD
9128 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9129
9130 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9131 instead of compositeToPoint.
9132 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9133
8d7c7eed 9134 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 9135
e34f7f79
DA
91362012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9137
9138 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9139 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 9140 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
9141 (BVAR): Change to use INTERNAL_FIELD.
9142 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9143 (KVAR): Change to use INTERNAL_FIELD.
9144 * frame.h (FVAR): New macro.
9145 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
9146 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9147 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9148 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
9149 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9150
c09bfb2f
DA
91512012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9152
9153 Miscellaneous fixes for non-default X toolkits.
9154 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9155 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9156 Move under #ifdef USE_LUCID.
9157 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9158 definition and usage to avoid warnings.
9159
14c114ae
JD
91602012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9161
9162 * nsterm.m (openFiles): Fix previous checkin.
9163
3bd21e82
PE
91642012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9165
9166 * indent.c (compute_motion): Remove unused local.
9167
c1529ded
GM
91682012-07-31 Glenn Morris <rgm@gnu.org>
9169
400d5621
GM
9170 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9171
268e2432
GM
9172 * conf_post.h [USG5_4]:
9173 Move remaining contents of s/usg5-4-common.h here.
9174 * s/usg5-4-common.h: Remove file.
9175
7552f3ee
GM
9176 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9177 * s/irix6-5.h: Remove file.
9178
6a381852
GM
9179 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9180 * s/darwin.h: Remove file.
9181
c1529ded
GM
9182 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9183 * s/hpux10-20.h: Remove file, which is now empty.
9184
b429a4ee
GM
91852012-07-30 Glenn Morris <rgm@gnu.org>
9186
9187 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9188 * Makefile.in (config_h): Add conf_post.h.
9189 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9190
adff3182
JD
91912012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9192
9193 * nsterm.m (ns_do_open_file): New variable.
b9031d69 9194 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
9195 (openFile, openTempFile, openFileWithoutUI, openFiles):
9196 Open files only if ns_do_open_file.
adff3182 9197
c32af1e4
PE
91982012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9199
7393bcbb
PE
9200 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9201 This no-op macro hasn't been needed for many years.
9202 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9203
c32af1e4
PE
9204 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9205 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9206 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9207 gdb_make_enums_visible.
9208 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9209 (DIRECTORY_SEP): Now a constant, not a macro.
9210
302fc036
EZ
92112012-07-30 Eli Zaretskii <eliz@gnu.org>
9212
9213 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9214 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9215
9216 * w32term.c <w32_keyboard_codepage>: Renamed from
9217 keyboard_codepage and now external. All users changed.
9218
9219 * w32term.h: Add declaration of w32_keyboard_codepage.
9220
9221 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9222 the codepage to translate keys to Unicode. If this argument is
9223 -1, use the value returned by GetConsoleCP. All callers changed.
9224
88fb40b4
PE
92252012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9226
0aee6912
PE
9227 Update .PHONY listings in makefiles.
9228 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9229 bootstrap-clean, distclean, maintainer-clean, versioclean,
9230 extraclean, frc.
9231
88fb40b4
PE
9232 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9233 This is a bit clearer. Fix some commentary typos.
9234
0a763bd1
GM
92352012-07-30 Glenn Morris <rgm@gnu.org>
9236
32bac6d6
GM
9237 * s/netbsd.h: Let configure include signal.h if needed.
9238 Remove file, which is now empty.
9239
b65e7c46
GM
9240 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9241 Let configure set them.
9242 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9243 No more need to undefine.
0a763bd1 9244
169304bd
AS
92452012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9246
9247 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9248 non-single-byte char when adding meta modifier. (Bug#12090)
9249
6cd7a139
DA
92502012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9251
9252 Convert safe_call to use variable number of arguments.
9253 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9254 (safe_call2): Fix comment.
9255 * lisp.h (safe_call): Adjust prototype.
9256 * coding.c (encode_coding_object): Change to use safe_call2.
9257 * xfaces.c (merge_face_heights): Change to use safe_call1.
9258
d34d6ffc
GM
92592012-07-30 Glenn Morris <rgm@gnu.org>
9260
7b8a48e4 9261 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 9262 does that unconditionally. Remove file, which is now empty.
7b8a48e4 9263
d34d6ffc
GM
9264 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9265 Remove empty files.
9266
03a660a6
PE
92672012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9268
9269 Export to GDB most of lisp.h's remaining object-like macros.
9270 * lisp.h (min, max): Move earlier, because they're used earlier now.
9271 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9272 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9273 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9274 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9275 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9276 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9277 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9278 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9279 Now constants, for GDB. They need not be macros.
9280 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9281 Now constants, for GDB, as well as macros, for static initializers.
9282 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9283 Move to after the definition of struct Lisp_Char_Table,
9284 since the former now needs that type defined.
9285 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9286 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9287 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9288 New enums, for gdb_make_enums_visible.
9289 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 9290 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
9291 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9292 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9293 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9294 enum maxargs, enum MAX_ALLOCA.
9295 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9296 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9297 no longer needed, now that they are done in lisp.h.
9298
e499d0ee
DA
92992012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9300
9301 Cleanup string bytes checking.
9302 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9303 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9304 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9305 (check_sblock, compact_small_strings): Simplify.
9306
d5040d2d
PE
93072012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9308
9309 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9310 These macros are confusing and no longer need to be defined, as
9311 the enum values now suffice. All uses replaced with definiens.
9312 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9313
7f259ae6
JB
93142012-07-29 Juanma Barranquero <lekktu@gmail.com>
9315
9316 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9317 ($(BLD)/w32console.$(O)): Update dependencies.
9318
7e63e0c3
DA
93192012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9320
9321 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9322 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9323 time. Adjust users.
9324 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9325
ffd817eb
JD
93262012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9327
9328 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9329 setting sitelisp (Bug#12010).
9330
417a7a0e
EZ
93312012-07-29 Eli Zaretskii <eliz@gnu.org>
9332
14ae4239 9333 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
9334
9335 * w32heap.c (cache_system_info):
9336 * w32.c (sys_rename):
9337 * w32proc.c (find_child_console, sys_kill): All users changed.
9338
387d4d92
PE
93392012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9340
9341 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9342
55a6cca6
EZ
93432012-07-29 Eli Zaretskii <eliz@gnu.org>
9344
9345 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9346
dbcf001c
DA
93472012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9348
9349 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
9350 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9351 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 9352
e2688e4a
DA
93532012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9354
9355 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9356 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9357 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9358 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9359 (replace_range, replace_range_2, del_range_2): Change to eassert.
9360 * marker.c (byte_char_debug_check): Adjust style.
9361
b46a6a83
PE
93622012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9363
9364 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9365 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9366 long-ago-commented-out code that talks about "WIN32".
9367 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9368 All uses changed.
9369
e32a5799
PE
93702012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9371
9372 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9373 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9374 Simplify by using alignof.
9375 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9376 * lisp.h: Include <stdalign.h>.
9377 (GCALIGNMENT): New macro and constant.
9378 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9379 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9380 (stdalign): New macro, if not already defined.
9381
df81cd29
EZ
93822012-07-28 Eli Zaretskii <eliz@gnu.org>
9383
01bd1b0d
EZ
9384 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9385 * w32inevt.c: Include w32inevt.h.
9386 (w32_read_console_input): New inline function, calls either
9387 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9388 w32_console_unicode_input.
9389 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9390 (w32_kbd_patch_key, key_event): Use the codepage returned by
9391 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9392 (key_event): use uChar.UnicodeChar only if
9393 w32_console_unicode_input is non-zero.
9394
9395 * w32console.c: Include w32heap.h.
9396 <w32_console_unicode_input>: New global variable.
9397 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9398 family of Windows, zero otherwise.
9399
9400 * w32inevt.h: Declare w32_console_unicode_input.
9401
df81cd29
EZ
9402 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9403 --without-x. (Bug#11742)
9404
c20fdd9e
PE
94052012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9406
9407 Adjust GDB to reflect pvec_type changes (Bug#12036).
9408 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
9409 2012-07-04 changes to pseudovector representation.
9410 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 9411
32770973 94122012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
9413
9414 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9415 bus address.
9416 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9417
3438fe21
EZ
94182012-07-27 Eli Zaretskii <eliz@gnu.org>
9419
bcfbc9de
EZ
9420 * alloc.c (listn): Fix the order the arguments are consed onto the
9421 list.
9422
3438fe21
EZ
9423 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9424 enumeration constants, as PURE and HEAP are too general, and clash
9425 with other headers and sources, such as gmalloc.c and the
9426 MS-Windows system headers. All users changed.
9427
eeaea515
DA
94282012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9429
9430 Revert last save_excursion_save and save_excursion_restore changes.
9431 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9432 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9433
073c88c2
DA
94342012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9435
9436 Fix recently-introduced typos in Windows port.
9437 Reported by Martin Rudalics <rudalics@gmx.at>.
9438 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 9439 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 9440
4706125e
PE
94412012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9442
9443 Improve GDB symbol export (Bug#12036).
9444 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9445 arms of an 'if', not using conditional expressions; otherwise GDB
9446 complains about the types in the unevaluated arm when the argument
9447 is an integer literal.
9448 (xgetint): Simplify expression.
9449 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9450 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9451 Zaretskii in <http://bugs.gnu.org/12036#13>.
9452 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9453 needed now that we have gdb_make_enums_visible.
9454 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9455 (enum enum_USE_LSB_TAG):
9456 New enum types, packaging up enums that need to be exported to GDB.
9457
694b6c97
DA
94582012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9459
9460 Utility function to make a list from specified amount of objects.
9461 * lisp.h (enum constype): New datatype.
9462 (listn): New prototype.
9463 * alloc.c (listn): New function.
9464 (Fmemory_use_count, syms_of_alloc): Use it.
9465 * buffer.c (syms_of_buffer): Likewise.
9466 * callint.c (syms_of_callint): Likewise.
9467 * charset.c (define_charset_internal): Likewise.
9468 * coding.c (syms_of_coding): Likewise.
9469 * keymap.c (syms_of_keymap): Likewise.
9470 * search.c (syms_of_search): Likewise.
9471 * syntax.c (syms_of_syntax): Likewise.
9472 * w32.c (init_environment): Likewise.
9473 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9474 * xdisp.c (syms_of_xdisp): Likewise.
9475 * xfns.c (syms_of_xfns): Likewise.
9476
6195f384
DA
94772012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9478
9479 Fast save_excursion_save and save_excursion_restore.
9480 * lisp.h (struct Lisp_Excursion): New data type.
9481 (PVEC_EXCURSION): New pseudovector type.
9482 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9483 to deal with it. Adjust comments.
9484 (init_marker, attach_marker): New prototype.
9485 (unchain_marker): Adjust prototype.
9486 * marker.c (attach_marker): Change to global.
9487 (init_marker): New function.
9488 * alloc.c (Fmake_marker, build_marker): Use it.
9489 (build_marker): More easserts.
9490 (mark_object): Handle struct Lisp_Excursion.
9491 * editfns.c (save_excursion_save, save_excursion_restore):
9492 Reimplement to use struct Lisp_Excursion. Add comments.
9493
5eceb8fb
PE
94942012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9495
9496 Fix export of symbols to GDB (Bug#12036).
9497 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9498 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9499 emacs.c, as this is a more-suitable home. Had this been done earlier
9500 the fix for 12036 would have avoided some of the problems noted in
9501 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9502 would have been more obvious.
562157c8
PE
9503 * emacs.c: Do not include <verify.h>; no longer needed.
9504 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
9505 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9506 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9507 Remove; now done in lisp.h.
9508 * lisp.h (PUBLISH_TO_GDB): New macro.
9509 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9510 (DATA_SEG_BITS): Use it.
9511 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9512 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9513 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9514 not be usable in #if. This simplifies things.
9515
d6749401
JB
95162012-07-26 Juanma Barranquero <lekktu@gmail.com>
9517
9518 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9519
1781b9e9
PE
95202012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9521
d89518db 9522 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
9523 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9524 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9525 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9526 Adjust to changes in lisp.h and emacs.c, by using
9527 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9528 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9529 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9530 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9531 instead of gdb_valbits.
9532 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9533 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9534 instead of gdb_array_mark_flag.
9535 (xboolvector): Get size from $->size, not $->header.size.
9536 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9537 (xreload, hook-run, hookpost-run): Remove.
9538 * emacs.c: Include <verify.h>.
9539 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9540 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9541 Remove.
9542 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9543 (gdb_USE_LSB_TAG): New enum constants.
9544 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9545 Also define these as enum constants, so they're visible to GDB.
9546 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9547 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9548 as constants, so they're visible to GDB.
9549 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9550 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9551 Now enum constants, not macros, so they're visible to GDB.
9552 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9553 more convenient now. All uses changed.
9554 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9555 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9556
3628596a
DA
95572012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9558
9559 Explicitly free restriction data that are not needed anymore.
9560 * editfns.c (save_restriction_restore): Free restriction data.
9561
7abaf5cc
SM
95622012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9563
9564 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9565 add argument, tune behavior, and adjust all callers.
9566
71f88e00
PE
95672012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9568
9569 Use typedef for EMACS_INT, EMACS_UINT.
9570 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9571 than macros. This simplifies debugging in the usual case, since
9572 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9573 and it allows expressions involving EMACS_INT casts.
9574 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9575
57ec3034
JD
95762012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9577
9578 * nsterm.m (ns_read_socket): Return early if there is a modal
9579 window (Bug#12043).
9580
8137e7b3
MR
95812012-07-25 Martin Rudalics <rudalics@gmx.at>
9582
9583 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9584 that FOCUS-FRAME can be omitted.
9585
04e9897c
DA
95862012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9587
9588 Adjust buffer text indirection counters at the end of Fkill_buffer.
9589 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9590 buffer is definitely dead. This should really fix an issue reported
9591 by Christoph Scholtes again. (Bug#12007).
9592 (init_buffer_once): Initialize indirection counters of
9593 buffer_defaults and buffer_local_symbols (for sanity and safety).
9594
8a0484e1
EZ
95952012-07-24 Eli Zaretskii <eliz@gnu.org>
9596
9597 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9598 and continuation glyphs on tooltip frames, leave them at zero.
9599 Avoids continued lines in tooltips. (Bug#11832)
9600
fa691a83
DA
96012012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9602
9603 Simplify copy_overlay.
04e9897c 9604 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
9605 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9606
436bc8e0
EZ
96072012-07-23 Eli Zaretskii <eliz@gnu.org>
9608
9609 * print.c (print_object): Don't crash when a frame's name is nil
9610 or invalid. (Bug#12025)
9611
9612 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9613 it signals an error when a tooltip frame is being created.
9614
d7a7fda3
DA
96152012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9616
9617 Cleanup miscellaneous objects allocation and initialization.
9618 * alloc.c (allocate_misc): Change to static. Add argument to
9619 specify the subtype. Adjust comment and users.
9620 (build_overlay): New function.
9621 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9622 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9623 (allocate_misc): Remove prototype.
9624 (build_overlay): Add prototype.
9625
96262012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
9627
9628 Swap buffer text indirection counters in Fbuffer_swap_text.
9629 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9630 This avoids crash reported by Christoph Scholtes at
9631 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9632
9d7fa573
JD
96332012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9634
9635 * nsmenu.m (Popdown_data): New struct.
9636 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9637 free Popdown_data.
9638 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9639 (initWithContentRect): Make imgView and contentView non-static
9640 and autorelease them. Also autorelease img and matrix (Bug#12005).
9641 (dealloc): Remove (Bug#12005).
9642
0dd6d66d
DA
96432012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9644
9645 Adjust consing_since_gc when objects are explicitly freed.
9646 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9647 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9648 (free_cons, free_misc): Subtract object size from consing_since_gc.
9649
d36d71df
DA
96502012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9651
9652 Simplify and cleanup markers positioning code.
9653 * marker.c (attach_marker): More useful eassert.
9654 (live_buffer, set_marker_internal): New function.
9655 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9656 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9657
fb9ea40f
PE
96582012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9659
9660 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9661 as it's limited by the amount of memory, not by INT_MAX.
9662
2d5c5f7d
EZ
96632012-07-21 Eli Zaretskii <eliz@gnu.org>
9664
07fb592e
EZ
9665 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9666 in special-event-map. See the discussion at
9667 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9668 for the reasons.
9669
37a9eac8 9670 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
9671 info.dwItemData. Fixes crashes on 64-bit Windows.
9672 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 9673
c4328746
JD
96742012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9675
fc0c31f8 9676 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 9677 (conversationIdentifier): Return value is NSInteger.
784051c4 9678 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 9679
6e5d1c12
CY
96802012-07-21 Chong Yidong <cyd@gnu.org>
9681
9682 * window.c (decode_any_window): Signal an error if the window is
9683 on a dead frame (Bug#11984).
9684
9928463d
DA
96852012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9686
9687 Add indirection counting to speed up Fkill_buffer.
9688 * buffer.h (struct buffer): New member.
9689 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9690 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9691 base buffer indirection counter.
9692 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9693 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9694 through buffer list if indirection counter is 0.
9695
f8643a6b
DA
96962012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9697
9698 Extend the value returned by Fgarbage_collect with heap statistics.
9699 * alloc.c (Qheap): New symbol.
9700 (syms_of_alloc): DEFSYM it.
9701 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9702 (Fmemory_free): Remove.
9703 (syms_of_alloc): Don't defsubr it.
9704 * buffer.c (Fcompact_buffer): Remove.
9705 (syms_of_buffer): Don't defsubr it.
9706
dac616ff
DA
97072012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9708
9709 Make maybe_gc inline.
9710 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9711 * lisp.h (consing_since_gc, gc_relative_threshold)
9712 (memory_full_cons_threshold): Revert declaration.
9713 (maybe_gc): Remove prototype, define as inline.
9714 * alloc.c: Remove old commented-out code.
9715 (consing_since_gc, gc_relative_threshold)
9716 (memory_full_cons_threshold): Revert to global.
9717 (maybe_gc): Remove.
9718
d7ea76b4
DA
97192012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9720
9721 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9722 * lisp.h (build_unibyte_string): New function.
9723 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9724 * sysdep.c, w32fns.c, xfns.c: Use it.
9725 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9726 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9727 Adjust users accordingly.
9728 * font.h (font_open_by_name): Adjust prototype.
9729
765e61e3
DA
97302012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9731
9732 Cleanup calls to Fgarbage_collect.
9733 * lisp.h (maybe_gc): New prototype.
9734 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9735 Remove declarations.
9736 * alloc.c (maybe_gc): New function.
9737 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9738 Make them static.
9739 * bytecode.c (MAYBE_GC): Use maybe_gc.
9740 * eval.c (eval_sub, Ffuncall): Likewise.
9741 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9742 to avoid dependency from auto-save feature.
9743
52b852c7
PE
97442012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9745
9746 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9747 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9748 'for_each_per_buffer_object_at'.
9749 All uses changed. It's better to use upper-case for macros that
9750 cannot be implemented as functions, to give the reader a clue
9751 that they're special.
9752
5db81e33
SM
97532012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9754
9755 * alloc.c (Fgarbage_collect): Tweak docstring.
9756
5b835e1d
DA
97572012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9758
9759 Tweak the value returned from Fgarbage_collect again.
9760 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9761 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9762 Adjust documentation.
9763 (total_vector_bytes): Rename to total_vector_slots, adjust
9764 accounting.
9765 (total_free_vector_bytes): Rename to total_free_vector_slots,
9766 adjust accounting.
9767 (Qstring_bytes, Qvector_slots): New symbols.
9768 (syms_of_alloc): DEFSYM them.
9769
9cd47b72
DA
97702012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9771
9772 Buffer compaction primitive which may be used from Lisp.
9773 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9774 (syms_of_buffer): Register Fcompact_buffer.
9775 * alloc.c (Fgarbage_collect): Use compact_buffer.
9776 * buffer.h (compact_buffer): New prototype.
9777 (struct buffer_text): New member.
9778
d17337e5
DA
97792012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9780
9781 New macro to iterate over all buffers, miscellaneous cleanups.
9782 * lisp.h (all_buffers): Remove declaration.
9783 * buffer.h (all_buffers): Add declaration, with comment.
9784 (for_each_buffer): New macro.
9785 * alloc.c (Fgarbage_collect, mark_object): Use it.
9786 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9787 (init_buffer): Likewise.
9788 * data.c (Fset_default): Likewise.
9789 * coding.c (code_conversion_restore): Remove redundant check
9790 for dead buffer.
9791 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9792
60cfd278
AS
97932012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9794
9795 Fix bug that created negative-length intervals.
9796 * intervals.c (merge_interval_right, merge_interval_left):
9797 Do not zero out this interval if it is absorbed by its children,
9798 as this interval's total length doesn't change in that case. See
9799 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9800
d06714cb
PE
98012012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9802
83713154
PE
9803 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9804 when invoking (make-bool-vector N t) and N is a positive
9805 multiple of 8 -- the last 8 bits were mistakenly cleared.
9806
d06714cb
PE
9807 Remove some struct layout assumptions in bool vectors.
9808 * alloc.c (bool_header_size): New constant.
9809 (header_size, word_size): Move earlier, as they're now used earlier.
9810 Use 'word_size' in a few more places, where it's appropriate.
9811 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9812 padding before the data member of a bool vector.
9813 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9814 than doing the check by hand with an abort ().
9815
464d5a5e
SM
98162012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9817
5fbc0409
SM
9818 * eval.c (Fdefvar): Don't check constants since we only set the var if
9819 it's not yet defined anyway (bug#11904).
9820
464d5a5e
SM
9821 * lisp.h (last_undo_boundary): Declare new var.
9822 * keyboard.c (command_loop_1): Set it.
9823 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9824 were auto-added by the command loop (bug#11774).
9825
8dc2e44a
AS
98262012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9827
9828 * w32font.c (Qsymbol): Remove local definition.
9829 (syms_of_w32font): Don't DEFSYM it.
9830
169925ec
DA
98312012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9832
9833 Fix sweep_vectors to handle large bool vectors correctly.
9834 * alloc.c (sweep_vectors): Account total_vector_bytes for
9835 bool vectors larger than VBLOCK_BYTES_MAX.
9836
5fbfb018
CY
98372012-07-18 Chong Yidong <cyd@gnu.org>
9838
9839 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9840 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9841
3ab6e069
DA
98422012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9843
9844 Return more descriptive data from Fgarbage_collect.
9845 Suggested by Stefan Monnier in
9846 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9847 * alloc.c (bounded_number): New function.
9848 (total_buffers, total_vectors): New variable.
9849 (total_string_size): Rename to total_string_bytes, adjust users.
9850 (total_vector_size): Rename to total_vector_bytes, adjust users.
9851 (sweep_vectors): Account total_vectors and total_vector_bytes.
9852 (Fgarbage_collect): New return value. Adjust documentation.
9853 (gc_sweep): Account total_buffers.
9854 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9855 (VECTOR_SIZE): Remove.
9856 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9857 (Qinterval, Qmisc): New symbols.
9858 (syms_of_data): Initialize them.
9859 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9860 (Qcons, Qbuffer): New declarations.
9861
6d02fe5b
PE
98622012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9863
9864 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9865 Round up, not down. Improve doc.
9866
b7ffe040
DA
98672012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9868
9869 Restore old code in allocate_string_data to avoid Faset breakage.
9870 Reported by Julien Danjou <julien@danjou.info> in
9871 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9872 * alloc.c (allocate_string_data): Restore old code with minor
9873 adjustments, fix comment to explain this subtle issue.
9874
4dc7c8d5
SM
98752012-07-17 Eli Zaretskii <eliz@gnu.org>
9876
9877 Remove FILE_SYSTEM_CASE.
9878 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9879
9880 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9881 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9882 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9883 call-process-region passes it through expand-file-name.
9884
9885 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9886
98872012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9888
9889 Fix crash when creating indirect buffer (Bug#11917)
9890 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9891 Don't handle unbound variables specially if non-zero.
9892 (Fbuffer_local_variables): Pass zero.
9893 (clone_per_buffer_values): Pass non-zero.
9894
98952012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9896
9897 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9898 to make the loop interruptible.
9899
99002012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9901
9902 * gnutls.c (emacs_gnutls_handshake): Only retry if
9903 GNUTLS_E_INTERRUPTED.
9904
cce7fefc
DA
99052012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9906
9907 Cleanup and convert miscellaneous checks to eassert.
9908 * alloc.c (mark_interval): Fix comment, partially rephrase
9909 old comment from intervals.h (see below).
9910 * intervals.c (find_interval, adjust_intervals_for_insertion)
9911 (delete_interval, adjust_intervals_for_deletion)
9912 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9913 Convert to eassert.
9914 (adjust_intervals_for_insertion, make_new_interval):
9915 Remove obsolete and unused code.
9916 * intervals.h (struct interval): Remove obsolete comment.
9917 * textprotp.c (erase_properties): Remove unused code.
9918 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9919 (Fremove_list_of_text_properties): Convert to eassert.
9920
9ea10cc3
CY
99212012-07-17 Chong Yidong <cyd@gnu.org>
9922
9923 * editfns.c (Finsert_char): Doc fix.
9924
3900d5de
DA
99252012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9926
9927 Fix previous change to make Fmemory_free always accurate.
9928 * alloc.c (make_interval): Update total_free_intervals.
9929 (make_float): Likewise for total_free_floats.
9930 (free_cons, Fcons): Likewise for total_free_conses.
9931 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9932 Likewise for total_free_vector_bytes.
9933 (Fmake_symbol): Likewise for total_free_symbols.
9934 (bytes_free): Remove.
9935
7098646f
DA
99362012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9937
9938 Simple free memory accounting feature.
9939 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9940 (sweep_vectors): Accumulate size of free vectors.
9941 (Fgarbage_collect): Setup bytes_free.
9942 (Fmemory_free): New function.
9943 (syms_of_alloc): Register it.
9944
22657b40
DA
99452012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9946
9947 Cleanup overlays checking.
9948 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9949 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9950 eassert and OVERLAYP.
9951 (sort_overlays): Change to use OVERLAYP.
9952
ddfc8813
RK
99532012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9954
9955 * editfns.c (Finsert_char): Make it interactive, and make the
9956 second arg optional. Copy interactive spec and docstring from
9957 ucs-insert.
9958
7c26cf3c
PE
99592012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9960
9961 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9962 Unlike the other wrapped functions, fabs has an unspecified
9963 effect on errno.
9964
5d127af9
JD
99652012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9966
9967 * nsterm.m (keyDown): Interpret flags without left/right bits
9968 as the left key (Bug#11670).
9969
6a0dd1d7
DA
99702012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9971
9972 Remove empty and useless init functions.
9973 * lisp.h (init_character_once, init_fns, init_image)
9974 (init_filelock, init_sound): Remove prototype.
9975 * character.c (init_character_once): Remove.
9976 * filelock.c (init_filelock): Likewise.
9977 * fns.c (init_fns): Likewise.
9978 * image.c (init_image): Likewise.
9979 * sound.c (init_sound): Likewise.
9980 * emacs.c (main): Adjust accordingly.
9981
7a6136fd
DA
99822012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9983
9984 * gtkutil.h: Tiny cleanups.
9985 (use_old_gtk_file_dialog): Remove useless declaration.
9986 (xg_uses_old_file_dialog): Add suggested const attribute.
9987
ce811ad9
EZ
99882012-07-15 Eli Zaretskii <eliz@gnu.org>
9989
9990 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9991 (bidi_paragraph_init): Use it to limit search forward for a strong
9992 directional character in abnormally large paragraphs full of
9993 neutral or weak characters. (Bug#11943)
9994
c9adfeaa
SF
99952012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9996
9997 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9998 the toolbar (Bug#9451).
9999 (xg_make_tool_item): Give the widget event box a transparent
10000 background.
10001
fff62aa9
DA
100022012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10003
10004 Cleanup basic allocation variables and functions.
10005 * alloc.c (ignore_warnings, init_intervals, init_float)
10006 (init_cons, init_symbol, init_marker): Remove.
10007 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10008 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10009 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10010 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10011 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10012 (staticidx, init_alloc_once, init_strings, free_ablock):
10013 Remove redundant initialization.
10014 * fns.c (init_weak_hash_tables): Remove.
10015 * lisp.h (init_weak_hash_tables): Remove prototype.
10016
9730daca
DA
100172012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10018
10019 Use zero_vector where appropriate.
10020 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10021 accordingly.
10022 * lisp.h (zero_vector): New declaration.
10023 * font.c (null_vector): Remove.
10024 (syms_of_font): Remove initialization and staticpro.
10025 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10026 * keymap.c (Faccessible_keymaps): Likewise.
10027
2e2d2a13
LL
100282012-07-15 Leo Liu <sdl.web@gmail.com>
10029
10030 * fringe.c: Fix typo in comments.
10031
cd276f6e
LL
100322012-07-14 Leo Liu <sdl.web@gmail.com>
10033
10034 * fringe.c: Add a new bitmap exclamation-mark.
10035
5a1131d9
EZ
100362012-07-14 Eli Zaretskii <eliz@gnu.org>
10037
10038 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10039
10040 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10041 (HAVE_MENUS): Don't define, defined by editing config.in with
10042 msdos/sed2v2.inp.
10043 (GMALLOC_INHIBIT_VALLOC): Don't define.
10044 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10045
22e983b7
JB
100462012-07-14 Juanma Barranquero <lekktu@gmail.com>
10047
10048 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10049
5b3f250f
GM
100502012-07-14 Glenn Morris <rgm@gnu.org>
10051
10052 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10053 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10054 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10055
33d63ff4
GM
100562012-07-13 Glenn Morris <rgm@gnu.org>
10057
5b633342
GM
10058 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10059
33d63ff4
GM
10060 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10061 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10062
b55b9f85
JD
100632012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10064
0dc8cf50
JD
10065 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10066 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10067 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10068 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10069 where appropriate.
10070 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10071 as boolean expression.
10072 (x_set_window_size): Remove unused variable toolbar.
10073 (ns_get_color_default, ns_mod_to_lisp): Remove.
10074 (ns_mouse_position): Remove unused variables xchar and ychar.
10075 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10076 (ns_set_vertical_scroll_bar): Remove unused variable count.
10077 (ns_delete_terminal): Remove unused variable i.
10078 (ns_term_init): Remove unused variables r, g and b.
10079 (mouseDown): Remove unused variable window.
10080 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10081 (initFrameFromEmacs): Remove unused variable vbextra.
10082 (mouseEntered): Remove unused variables p and dpyinfo.
10083 (mouseExited): Remove unused variables p and r.
10084 (ns_define_frame_cursor, ns_clear_frame_area)
10085 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10086 (menuDown): Assign [sender tag] to variable and cast the variable.
10087
10088 * nsterm.h (menuDown): Add id as type to argument sender.
10089 (ns_display_info_for_name): Add Lisp_Object argument.
10090 (ns_term_init): Add Lisp_Object argument.
10091 (ns_map_event_to_object): Add void argument.
10092 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10093 prototype with arguments and only declare if __OBJC__.
10094 (nxatoms_of_nsselect): Add void argument.
10095 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10096 (ns_alloc_autorelease_pool): Add void argument.
10097 (ns_release_autorelease_pool): Add void* argument.
10098 (ns_get_defaults_value): Add const char* argument.
10099
10100 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10101 (initFromContents): Use SSDATA where appropriate.
10102 (ns_update_menubar): Add braces to ambigous if-else.
10103 (initWithTitle): Put () around assignment in if statement.
10104 (ns_menu_show): Remove unused variables window and keymap.
10105 (update_frame_tool_bar): Remove unused variable selected_p.
10106 (initWithContentRect): Remove unused variable this_cmd_name.
10107
10108 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10109 appropriate.
10110 (setXBMColor): Remove unused variable len.
10111 (setPixmapData): Put () around assignment in loop statement.
10112
10113 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10114 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10115 where appropriate.
10116 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10117 around assignment in loop statement.
10118 (nsfont_open): Remove unused variable i.
10119 (nsfont_open): Remove unused variable len.
10120 (nsfont_draw): Remove unused variable cs.
10121
10122 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10123 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10124 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10125 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10126 (Fns_font_name, Fns_perform_service)
10127 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10128 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10129 (ns_set_name): Remove unused variable view.
10130 (x_set_menu_bar_lines): Remove unused variable olines.
10131 (x_set_tool_bar_lines): Remove unused variable root_window.
10132 (Fns_list_colors): Put () around assignment in while statement.
10133 (Fns_perform_service): Remove unused variable len.
10134 (Fns_display_usable_bounds): Remove unused variable top.
10135 (syms_of_nsfns): Remove unused variable i.
10136
b55b9f85
JD
10137 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10138 memcpy (Bug#11907).
10139
ed9265fc 101402012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
10141
10142 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10143 and free it with DestroyExceptionInfo (Bug#11558).
10144
ef099b57
JB
101452012-07-13 Juanma Barranquero <lekktu@gmail.com>
10146
10147 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10148 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10149 Set here, not in nt/config.nt.
10150
ea814a5d
EZ
101512012-07-13 Eli Zaretskii <eliz@gnu.org>
10152
10153 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10154 cursor overflow into the last glyph on display line when the right
10155 fringe is off. (Bug#11832)
10156
1a952767
PE
101572012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10158
10159 * xdisp.c (produce_special_glyphs): Now static.
10160 * dispextern.h (produce_special_glyphs): Remove decl.
10161
983188fd
GM
101622012-07-13 Glenn Morris <rgm@gnu.org>
10163
8d7c7eed 10164 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
10165 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10166
983188fd
GM
10167 * s/usg5-4-common.h (USG, USG5):
10168 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10169 * s/sol2-6.h (SOLARIS2):
10170 * s/irix6-5.h (IRIX6_5):
10171 * s/hpux10-20.h (USG, USG5, HPUX):
10172 * s/gnu-linux.h (USG, GNU_LINUX):
10173 * s/freebsd.h (BSD_SYSTEM):
10174 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10175 * s/cygwin.h (CYGWIN):
10176 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10177 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10178
d1e68667 101792012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
10180
10181 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 10182
6de0e799
GM
101832012-07-13 Glenn Morris <rgm@gnu.org>
10184
739ae010
GM
10185 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10186
dbee5793
GM
10187 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10188
6de0e799
GM
10189 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10190 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10191
b82da769
GM
101922012-07-12 Glenn Morris <rgm@gnu.org>
10193
4fae5a7a 10194 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
10195
10196 * process.c (init_process_emacs): Rename from init_process.
10197 The old name is also the name of a Mach system call.
10198 * lisp.h, emacs.c: Update for this name change.
10199 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10200 longer needed.
10201
5a979817
EZ
102022012-07-12 Eli Zaretskii <eliz@gnu.org>
10203
10204 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10205 memmove call that removes glyphs covered by the left truncation
10206 glyph. Improve commentary.
10207 (display_line): Fix display of continuation glyphs on GUI frames
10208 when the right fringe is turned off and variable-size fonts are
10209 used in the window. Move the code that appends a stretch glyph to
10210 produce_special_glyphs, so that it could be used for truncation
10211 and continuation glyphs alike.
10212 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10213 glyph of a suitably computed width, to align the special glyphs at
10214 the window margin. Code moved from display_line. (Bug#11832)
10215
3e91a053
GM
102162012-07-12 Glenn Morris <rgm@gnu.org>
10217
ba9e4b84
GM
10218 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10219
10220 * s/gnu-linux.h, s/hpux10-20.h:
10221 Do not unconditionally define HAVE_XRMSETDATABASE.
10222
3e91a053
GM
10223 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10224
b300b1f4
PE
102252012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10226
10227 Fix typos that broke OS X build.
10228 Reported by Randal L. Schwartz in
10229 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10230 * nsterm.m (ns_timeout): Add missing local decl.
10231 (ns_get_color): snprintf -> sprintf, to fix typo.
10232
6e777848
GM
102332012-07-12 Glenn Morris <rgm@gnu.org>
10234
3f922c37
GM
10235 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10236 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10237 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10238 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10239
0ab7b23a
GM
10240 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10241 Move PTY_OPEN to configure.
10242
6e777848
GM
10243 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10244 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10245 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10246
4a7edc24
DA
102472012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10248
10249 Use empty_unibyte_string where applicable.
10250 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10251 * lread.c (read1): Likewise.
10252 * xsettings.c (syms_of_xsettings): Likewise.
10253
308aab79
GM
102542012-07-12 Glenn Morris <rgm@gnu.org>
10255
42bd1719
GM
10256 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10257 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
10258 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10259 * s/hpux10-20.h (RUN_TIME_REMAP):
10260 * s/bsd-common.h (TABDLY): Move to configure.
10261
10262 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10263
10264 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10265
ea0bbd17 10266 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 10267 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
10268
10269 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 10270
308aab79
GM
10271 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10272 * s/template.h: Move NARROWPROTO to configure.
10273
ee1cf5cf
GM
102742012-07-11 Glenn Morris <rgm@gnu.org>
10275
30fe9bf4
GM
10276 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10277 unused since 2011-01-17 change to systty.h.
10278
ee1cf5cf
GM
10279 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10280 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10281 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10282
63e47e07
PE
102832012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10284
10285 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10286
c43fb4c3
GM
102872012-07-11 Glenn Morris <rgm@gnu.org>
10288
10289 * s/darwin.h, s/gnu-linux.h, s/template.h:
10290 Move INTERRUPT_INPUT to configure.
10291
e8df9267
DA
102922012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10293
10294 Minor adjustments to interning code.
10295 * lisp.h (intern, intern_c_string): Redefine as static inline
10296 wrappers for intern_1 and intern_c_string_1, respectively.
10297 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
10298 * lread.c (intern_1, intern_c_string_1, oblookup):
10299 Simplify Vobarray checking.
e8df9267
DA
10300 * font.c (font_intern_prop): Likewise. Adjust comment.
10301 * w32font.c (intern_font_name): Likewise.
10302
34348bd4
AS
103032012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10304
d96a1e0c
AS
10305 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10306
34348bd4
AS
10307 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10308 of Fcar/Fcdr if possible.
10309 * font.c (check_otf_features): Likewise.
10310 * fontset.c (Fnew_fontset): Likewise.
10311 * gnutls.c (Fgnutls_boot): Likewise.
10312 * minibuf.c (read_minibuf): Likewise.
10313 * msdos.c (IT_set_frame_parameters): Likewise.
10314 * xmenu.c (Fx_popup_dialog): Likewise.
10315 * w32menu.c (Fx_popup_dialog): Likewise.
10316
c8add24e
GM
103172012-07-11 Glenn Morris <rgm@gnu.org>
10318
4b575b3c
GM
10319 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10320 since nothing has defined it on these platforms.
10321
09f4e3b0
GM
10322 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10323 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10324
172bedef
GM
10325 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10326 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10327 Move CLASH_DETECTION to configure.
10328
249685df
GM
10329 * s/gnu.h: Remove file, which is now empty.
10330
c8add24e
GM
10331 * s/gnu.h, s/gnu-linux.h:
10332 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10333
b41253a3
JW
103342012-07-11 John Wiegley <johnw@newartisans.com>
10335
10336 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10337 function attribute, so we only use it if it exists in the
10338 compiler.
10339
d923b542
DA
103402012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10341
10342 Avoid call to strlen in fast_c_string_match_ignore_case.
10343 * search.c (fast_c_string_match_ignore_case): Change to use
10344 length argument. Adjust users accordingly.
10345 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10346
5ebbef1d
PE
103472012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10348
bb352260
PE
10349 Assume mkdir, rmdir.
10350 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10351 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10352
57054ddd
PE
10353 Assume rename.
10354 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10355
b747d3f7
PE
10356 Assume perror.
10357 * s/hpux10-20.h (HAVE_PERROR): Remove.
10358 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10359 Remove dummy definition, as this problem was obsolete long ago.
10360
5ebbef1d
PE
10361 Assume strerror.
10362 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10363
984e7f30
DA
103642012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10365
10366 Avoid calls to strlen in font processing functions.
10367 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
10368 (font_open_by_name): Change to use length argument.
10369 Adjust users accordingly.
d923b542
DA
10370 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10371 Adjust prototypes.
10372 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10373 Change to return ptrdiff_t.
984e7f30
DA
10374 (xfont_list_pattern, xfont_match): Use length returned by
10375 xfont_decode_coding_xlfd.
10376 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10377
20e94fdd
GM
103782012-07-11 Glenn Morris <rgm@gnu.org>
10379
9d596af3
GM
10380 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10381 Move DONT_REOPEN_PTY to configure.
10382
20e94fdd
GM
10383 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10384 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10385
e99a530f
PE
103862012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10387
22ffb973
PE
10388 Remove "#define unix" that is no longer needed (Bug#11905).
10389 * s/aix4-2.h (unix): Remove; no longer needed.
10390
e9a9ae03
PE
10391 EMACS_TIME simplification (Bug#11875).
10392 This replaces macros (which typically do not work in GDB)
10393 with functions, typedefs and enums, making the code easier to debug.
10394 The functional style also makes code easier to read and maintain.
10395 * systime.h: Include <sys/time.h> on all hosts, not just if
10396 WINDOWSNT, since 'struct timeval' is needed in general.
10397 (EMACS_TIME): Now a typedef, not a macro.
10398 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10399 not macros.
10400 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10401 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10402 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10403 (EMACS_TIME_LE): Now functions, not macros.
10404 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10405 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10406 which are not functions. All uses rewritten to use:
10407 (make_emacs_time): New function.
10408 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10409 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10410 not functions. All uses rewritten to use the following, respectively:
10411 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10412 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 10413 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
10414 * fileio.c (Fcopy_file):
10415 * xterm.c (XTflash): Get the current time closer to when it's used.
10416 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10417
ffacb126
PE
10418 * bytecode.c (targets): Suppress -Woverride-init warnings.
10419
e99a530f
PE
10420 Simplify by avoiding confusing use of strncpy etc.
10421 * doc.c (Fsnarf_documentation):
10422 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10423 * frame.c (Fmake_terminal_frame):
10424 * gtkutil.c (get_utf8_string):
10425 * lread.c (openp):
10426 * nsmenu.m (ns_update_menubar):
10427 * regex.c (regerror):
10428 Prefer memcpy to strncpy and strncat when either will do.
10429 * fileio.c (Fsubstitute_in_file_name):
10430 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10431 (menu_separator_name_p):
10432 * nsmenu.m (ns_update_menubar):
10433 Prefer memcmp to strncmp when either will do.
10434 * nsterm.m: Include <ftoastr.h>.
10435 (ns_get_color):
10436 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10437 Prefer snprintf to strncpy.
10438 * nsterm.m (ns_term_init):
10439 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10440 * nsterm.m (ns_term_init):
10441 Avoid the need for strncpy, by using build_string or
10442 make_unibyte_string directly. Use dtoastr, not snprintf.
10443 * process.c (Fmake_network_process): Diagnose service names that
10444 are too long, rather than silently truncating them or creating
10445 non-null-terminated names.
10446 (Fnetwork_interface_info): Likewise, for interface names.
10447 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10448 Prefer sprintf to strncat.
10449 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10450 Prefer vsnprintf to vsprintf + strncpy.
10451
c59592b3
GM
104522012-07-10 Glenn Morris <rgm@gnu.org>
10453
10454 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10455 Clarify fallback case.
10456
7d7bbefd
DA
104572012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10458
10459 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10460 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10461 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 10462 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
10463 where argument type is known to be a Lisp_Cons.
10464
3a4c8000
TT
104652012-07-10 Tom Tromey <tromey@redhat.com>
10466
10467 * bytecode.c (BYTE_CODE_THREADED): New macro.
10468 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10469 (enum byte_code_op): New type.
10470 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10471 (exec_byte_code): Use them. Use token threading when applicable.
10472
2a0213a6
DA
104732012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10474
10475 Optimize pure C strings initialization.
10476 * lisp.h (make_pure_string): Fix prototype.
10477 (build_pure_c_string): New function, defined as static inline. This
10478 provides a better opportunity to optimize away calls to strlen when
10479 the function is called with compile-time constant argument.
10480 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10481 argument, adjust users accordingly. Use build_pure_c_string where
10482 appropriate.
10483 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10484 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10485 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10486
cb1caeaf
DA
104872012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10488
10489 Avoid calls to strlen in miscellaneous functions.
10490 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10491 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10492 * lread.c (openp): Likewise.
10493
c293e30c
DA
104942012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10495
10496 Avoid calls to strlen in path processing functions.
10497 * fileio.c (file_name_as_directory): Add comment. Change to add
10498 srclen argument and return the length of result. Adjust users
10499 accordingly.
10500 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
10501 swap 1st and 2nd arguments to obey the common convention.
10502 Adjust users accordingly.
c293e30c
DA
10503 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10504
9e059e3f
GM
105052012-07-10 Glenn Morris <rgm@gnu.org>
10506
d02eb359
GM
10507 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10508 Move PENDING_OUTPUT_COUNT definition to configure.
10509
882cf227
GM
10510 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10511 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10512 * s/gnu.h (DATA_START): Move definitions to configure.
10513
af6e839f
GM
10514 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10515 We include usg5-4-common.h, which defines them both.
10516
40289a12
GM
10517 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10518 O_RDONLY already includes it).
10519
9e059e3f
GM
10520 Stop ns builds setting the EMACSLOADPATH environment variable.
10521 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10522 Now it does not set EMACSLOADPATH, just returns the load-path string.
10523 * nsterm.h: Update accordingly.
10524 * lread.c [HAVE_NS]: Include nsterm.h.
10525 (init_lread) [HAVE_NS]: Use ns_load_path.
10526 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10527
7c4e8ec0
GM
105282012-07-09 Glenn Morris <rgm@gnu.org>
10529
d4f600ff
GM
10530 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10531 since the included bsd-common.h does so.
10532
cbb31951
GM
10533 Stop ns builds setting the EMACSPATH environment variable.
10534 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10535 (ns_init_paths): Do not set EMACSPATH.
10536 * nsterm.h (ns_exec_path): Add it.
10537 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10538 Use ns_exec_path.
10539
7c4e8ec0
GM
10540 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10541
26bccfae
PE
105422012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10543
a0bee46f
PE
10544 * process.c (wait_reading_process_output): 'waitchannels' was unset
10545 when read_kbd || !NILP (wait_for_cell); fix this.
10546
5994c183
PE
10547 Add GCC-style 'const' attribute to functions that can use it.
10548 * character.h (char_resolve_modifier_mask):
10549 * keyboard.h (make_ctrl_char):
10550 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10551 (init_character_once, next_almost_prime, init_fns, init_image)
10552 (flush_pending_output, init_sound):
10553 * mem-limits.h (start_of_data):
10554 * menu.h (finish_menu_items):
10555 Add ATTRIBUTE_CONST.
10556 * emacs.c (DEFINE_DUMMY_FUNCTION):
10557 Declare the dummy function with ATTRIBUTE_CONST.
10558 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10559 Add decls with ATTRIBUTE_CONST.
10560
26bccfae
PE
10561 Minor improvements to make_formatted_string.
10562 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10563 where int is good enough, as vsprintf returns an int.
10564 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10565
a8290ec3
DA
105662012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10567
10568 Use make_formatted_string to avoid double length calculation.
10569 * lisp.h (make_formatted_string): New prototype.
10570 * alloc.c (make_formatted_string): New function.
10571 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 10572 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
10573 * editfns.c (Fcurrent_time_zone): Likewise.
10574 * filelock.c (get_boot_time): Likewise.
10575 * frame.c (make_terminal_frame, set_term_frame_name)
10576 (x_report_frame_params): Likewise.
10577 * image.c (gs_load): Likewise.
10578 * minibuf.c (get_minibuffer): Likewise.
10579 * msdos.c (dos_set_window_size): Likewise.
10580 * process.c (make_process): Likewise.
10581 * xdisp.c (ensure_echo_area_buffers): Likewise.
10582 * xsettings.c (apply_xft_settings): Likewise.
10583
d01ba2f1
GM
105842012-07-09 Glenn Morris <rgm@gnu.org>
10585
10586 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10587 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10588 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10589 * nsterm.h (ns_etc_directory): Add it.
10590 * callproc.c [HAVE_NS]: Include nsterm.h.
10591 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10592
f1f924b6
DA
105932012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10594
10595 Move marker debugging code under MARKER_DEBUG.
10596 * marker.c (MARKER_DEBUG): Move marker debugging code under
10597 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10598 for bootstrap with --enable-checking (~3x slowdown reported
10599 by Juanma Barranquero <lekktu@gmail.com>).
10600 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10601
ab531b66
PE
106022012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10603
10604 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10605 See <http://bugs.gnu.org/11825#29>.
10606
c4b3bc8a
EZ
106072012-07-08 Eli Zaretskii <eliz@gnu.org>
10608
10609 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10610 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
10611 (display_line): Add commentary about displaying truncation glyphs
10612 on GUI frames.
10613 (produce_special_glyphs): Move here from term.c.
10614
10615 * term.c (produce_special_glyphs): Move to xdisp.c.
10616
10617 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10618 section.
c4b3bc8a 10619
b676b881
AS
106202012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10621
f17c5273
AS
10622 * xdisp.c (display_line): Avoid warning about implicit declaration
10623 of FRAME_FONT.
10624
298819b9
AS
10625 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10626
b676b881
AS
10627 * lisp.h: Remove empty conditional.
10628
6045c4fd
PE
106292012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10630
b3350bf9
PE
10631 * lread.c (load_path_check): Now static.
10632
6045c4fd
PE
10633 Fix some minor --with-ns problems found by static checking.
10634 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10635 (x_set_font) [!HAVE_X_WINDOWS]:
10636 * image.c (xpm_load_image) [HAVE_NS]:
10637 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10638 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10639 Remove unused local.
10640 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10641 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10642 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10643 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10644 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10645 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10646 Fix pointer signedness problem.
10647 * xfaces.c (FRAME_X_FONT_TABLE):
10648 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10649
929e7845
GM
106502012-07-07 Glenn Morris <rgm@gnu.org>
10651
10652 * lread.c (load_path_check): New function, split from init_lread.
10653 (init_lread): Reorganize. Motivation:
10654 If EMACSLOADPATH is set, check/warn about that rather than the
10655 defaults, which we are not going to use. Hence we can remove
10656 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10657 Don't warn if site-lisp directories are missing.
10658 If not installed, start from a blank load-path, since
10659 PATH_LOADSEARCH refers to the eventual installation directories.
10660
58dd0aa4
EZ
106612012-07-07 Eli Zaretskii <eliz@gnu.org>
10662
10663 Support truncation and continuation glyphs on GUI frames, when
10664 fringes are disabled. (Bug#11832)
10665 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
10666 continuation glyphs even if on GUI frames.
10667 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
10668 or both, are absent.
10669 (start_display, move_it_in_display_line_to): Handle the case of a
10670 GUI frame without a fringe to display continuation or truncation
10671 glyphs.
10672 (insert_left_trunc_glyphs): Support GUI frames: make sure
10673 truncation glyphs overwrite enough glyphs from the current line to
10674 have sufficient space in pixels.
10675 (display_line): Support truncation and continuation glyphs on GUI
10676 frames. If some spare pixels are left on the line after inserting
10677 the truncation glyphs, fill that space with a stretch glyph of a
10678 suitably computed width.
10679
10680 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10681 produce_glyphs, to support GUI sessions.
10682
31571fd7
PE
106832012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10684
5a16b9bc
PE
10685 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10686
f3047c75
PE
10687 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10688
31571fd7
PE
10689 Do not require float-time's arg to fit in time_t (Bug#11825).
10690 This works better on hosts where time_t is unsigned, and where
10691 float-time is applied to the (negative) difference between two times.
10692 * editfns.c (decode_time_components): Last arg is now double *,
10693 not int *, and means to store all the result as a double, without
10694 worrying about whether the seconds part fits in time_t.
10695 All callers changed.
10696 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10697 All callers changed.
10698 (Ffloat_time): Do not fail merely because the specified time falls
10699 outside of time_t range.
10700
4516fbef
GM
107012012-07-07 Glenn Morris <rgm@gnu.org>
10702
10703 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10704 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10705 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10706
07adc2c6
JB
107072012-07-07 Juanma Barranquero <lekktu@gmail.com>
10708
10709 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10710 Update dependencies.
10711
10712 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10713
fd573f31
PE
107142012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10715
fee5959d
PE
10716 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10717 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10718 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10719 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10720 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10721 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10722
fd573f31
PE
10723 * xfont.c (compare_font_names): Redo to omit the need for casts.
10724
ddadbc0e
AS
107252012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10726
fca8d6b6
AS
10727 * xfns.c (Fx_change_window_property): Doc fix.
10728 * w32fns.c (Fx_change_window_property): Doc fix.
10729
ddadbc0e
AS
10730 * w32fns.c (Fx_window_property): Accept the same arguments as the
10731 X Windows version. Doc fix.
10732 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10733
ed9265fc 107342012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
10735 Eli Zaretskii <eliz@gnu.org>
10736
10737 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10738 Windows-specific code from nt/config.nt moved here.
10739 Obsolete settings removed.
10740
216ee680
PE
107412012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10742
10743 * process.c: Avoid unnecessary calls to gettime.
10744 (wait_reading_process_output): Don't get the time of day
10745 when gobbling data immediately and not waiting, as there's no need
10746 for it in that case. This removes a FIXME.
10747
bdd091e4
JD
107482012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10749
10750 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10751 is defined (Bug#11768).
10752
9d44f8ce
DA
107532012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10754
10755 Fix marker debugging code.
10756 * marker.c (byte_char_debug_check): Do not perform the check
10757 if buffer is not multibyte.
090bd7cb
JB
10758 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10759 Call byte_char_debug_check with correct arguments.
9d44f8ce 10760
90fc4786
DA
107612012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10762
10763 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
10764 * marker.c (byte_char_debug_check, count_markers):
10765 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
10766 (byte_debug_flag): Remove.
10767 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10768 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10769
7b7ae965
DA
107702012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10771
4e57b342
DA
10772 Avoid code repetition in marker-related functions.
10773 * marker.c (attach_marker): New function.
10774 (Fset_marker, set_marker_restricted, set_marker_both)
10775 (set_marker_restricted_both): Use it.
10776 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10777 Consistently rename charno to charpos.
10778 (marker_position): Add eassert.
10779 (marker_byte_position): Convert to eassert.
10780
107812012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10782
10783 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 10784 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 10785 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 10786
657924ff
DA
107872012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10788
10789 Introduce fast path for the widely used marker operation.
10790 * alloc.c (build_marker): New function.
10791 * lisp.h (build_marker): New prototype.
10792 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10793 * composite.c (autocmp_chars): Likewise.
10794 * editfns.c (buildmark): Remove.
10795 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10796 (save_restriction_save): Use build_marker.
10797 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10798 * window.c (save_window_save): Likewise.
10799
041a49a6
DA
108002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10801
10802 Do not use Fdelete_overlay in delete_all_overlays
10803 to avoid redundant calls to unchain_overlay.
10804 * buffer.c (drop_overlay): New function.
10805 (delete_all_overlays, Fdelete_overlay): Use it.
10806 * minibuf.c (get_minibuffer): Fix comment.
10807
7dca65a4
PE
108082012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10809
10810 Port to OpenBSD 5.1 amd64.
10811 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10812 This is needed for OpenBSD, and should be harmless on all BSD systems.
10813 Also, include <sys/sysctl.h>, as it should be available on all
10814 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10815 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10816 use p_pid member, not kp_proc.pid.
10817
8eb876e2
GM
108182012-07-06 Glenn Morris <rgm@gnu.org>
10819
10820 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10821
38182d90
PE
108222012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10823
10824 More xmalloc and related cleanup.
10825 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10826 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10827 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10828 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10829 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10830 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10831 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10832 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10833 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10834 * xterm.c:
10835 Omit needless casts involving void * pointers and allocation.
10836 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10837 as the former is more robust if P's type is changed.
10838 Prefer xzalloc to xmalloc + memset 0.
10839 Simplify malloc-or-realloc to realloc.
10840 Don't worry about xmalloc returning a null pointer.
10841 Prefer xstrdup to xmalloc + strcpy.
10842 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10843 growing it.
10844 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10845 alloca of a constant.
10846
6dd5a677
EZ
108472012-07-05 Eli Zaretskii <eliz@gnu.org>
10848
10849 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10850 hscroll is larger than the line width. Fixes long and futile
10851 looping inside extend_face_to_end_of_line (on a TTY) producing
10852 glyphs that are not needed and thrown away.
10853
6b312f0f
DA
108542012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10855
10856 * marker.c (set_marker_restricted_both): Simplify by using
10857 clip_to_bounds.
10858
f520ef9b
PE
108592012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10860
10861 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10862
383b7c95
JD
108632012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10864
10865 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10866 not defined (Bug#11768).
10867 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10868 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10869 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10870 followed by gtk_box_set_homogeneous (Bug#11768).
10871 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
10872 (update_theme_scrollbar_width, xg_create_scroll_bar):
10873 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
10874 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10875 (is_box_type): New function (Bug#11768).
10876 (xg_tool_item_stale_p): Call is_box_type.
5293d758 10877 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
10878 with default display (Bug#11768).
10879
d6e7bf45
EZ
108802012-07-05 Eli Zaretskii <eliz@gnu.org>
10881
10882 * xdisp.c (window_hscroll_limited): New function.
10883 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10884 coordinates when window's hscroll is set to insanely large
10885 values. (Bug#11857)
10886
431391ec
JB
108872012-07-05 Juanma Barranquero <lekktu@gmail.com>
10888
10889 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10890 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10891
23f86fce
DA
108922012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10893
10894 Cleanup xmalloc.
10895 * lisp.h (xzalloc): New prototype. Omit needless casts.
10896 * alloc.c (xzalloc): New function. Omit needless casts.
10897 * charset.c: Omit needless casts. Convert all calls to
10898 xmalloc with following memset to xzalloc.
10899 * dispnew.c: Likewise.
10900 * fringe.c: Likewise.
10901 * image.c: Likewise.
10902 * sound.c: Likewise.
10903 * term.c: Likewise.
10904 * w32fns.c: Likewise.
10905 * w32font.c: Likewise.
10906 * w32term.c: Likewise.
10907 * xfaces.c: Likewise.
10908 * xfns.c: Likewise.
10909 * xterm.c: Likewise.
10910 * atimer.c: Omit needless casts.
10911 * buffer.c: Likewise.
10912 * callproc.c: Likewise.
10913 * ccl.c: Likewise.
10914 * coding.c: Likewise.
10915 * composite.c: Likewise.
10916 * doc.c: Likewise.
10917 * doprnt.c: Likewise.
10918 * editfns.c: Likewise.
10919 * emacs.c: Likewise.
10920 * eval.c: Likewise.
10921 * filelock.c: Likewise.
10922 * fns.c: Likewise.
10923 * gtkutil.c: Likewise.
10924 * keyboard.c: Likewise.
10925 * lisp.h: Likewise.
10926 * lread.c: Likewise.
10927 * minibuf.c: Likewise.
10928 * msdos.c: Likewise.
10929 * print.c: Likewise.
10930 * process.c: Likewise.
10931 * region-cache.c: Likewise.
10932 * search.c: Likewise.
10933 * sysdep.c: Likewise.
10934 * termcap.c: Likewise.
10935 * terminal.c: Likewise.
10936 * tparam.c: Likewise.
10937 * w16select.c: Likewise.
10938 * w32.c: Likewise.
10939 * w32reg.c: Likewise.
10940 * w32select.c: Likewise.
10941 * w32uniscribe.c: Likewise.
10942 * widget.c: Likewise.
10943 * xdisp.c: Likewise.
10944 * xmenu.c: Likewise.
10945 * xrdb.c: Likewise.
10946 * xselect.c: Likewise.
10947
0497dc44
PE
109482012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10949
10950 * fileio.c (time_error_value): Check the right error number.
10951 Problem reported by Troels Nielsen in
10952 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10953
356e7178
PE
109542012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10955
4e71fd89
PE
10956 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10957 This should be fixed in a better way; see Eli Zaretskii in
10958 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10959 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10960
f0941253
PE
10961 * fileio.c (time_error_value): Rename from special_mtime.
10962 The old name's problems were noted by Eli Zaretskii in
10963 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10964
065c9eb4
PE
10965 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10966 This variable's comment says Emacs needs at least one GDB-visible
10967 symbol of type enum pvec_type, to work around GDB problems.
10968 The symbol's value doesn't matter.
10969
356e7178
PE
10970 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10971 that causes compilation to fail on pre-C99 compilers.
10972
ed9265fc 109732012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
10974
10975 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10976 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10977
3884d954
DA
109782012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10979
d209e2fb 10980 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
10981 headers for buffer_defaults and buffer_local_symbols.
10982 Reported by Juanma Barranquero <lekktu@gmail.com>.
10983
ee28be33
SM
109842012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10985
10986 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10987 * lisp.h (enum pvec_type): Use fewer bits.
10988 (PSEUDOVECTOR_SIZE_BITS): New constant.
10989 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10990 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10991 change in pvec_type.
10992 (PSEUDOVECTOR_TYPEP): New macro.
10993 (TYPED_PSEUDOVECTORP): Use it.
10994 * fns.c (internal_equal): Adapt code to extract pvectype.
10995 * emacs.c (gdb_pvec_type): Update type.
10996 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10997 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10998 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10999 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11000 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11001 abusing vector->header.next.nbytes.
11002 (live_vector_p): Use PVEC_TYPE.
11003 (mark_object): Adapt code to extract pvectype. Use switch.
11004
c7f2cd7f
PE
110052012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11006
11007 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11008 Tighten new eassert a bit.
11009
8ce70ed2
DA
110102012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11011
11012 Fix compilation with --enable-gcc-warnings and -O1
11013 optimization level.
11014 * doprnt.c (doprnt): Change type of tem to int, initialize
11015 to avoid compiler warning. Add eassert.
11016 * search.c (simple_search): Initialize match_byte to avoid
11017 compiler warning. Add eassert.
11018
dea7f1e5
PE
110192012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11020
24a212eb
PE
11021 Avoid weird behavior with large horizontal scrolls.
11022 Without this change, for example, large hscroll values would
11023 mess up Emacs's display on Fedora 15 x86, presumably due to
11024 overflows in int calculations in the display code.
11025 Also, if buffers had long lines, Emacs would freeze.
11026 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11027 (set_window_hscroll): New function, containing the old guts of
11028 Fset_window_hscroll. Return the clipped value.
11029 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11030 This avoids the need to check against PTRDIFF_MAX.
11031
dea7f1e5
PE
11032 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11033
76046526
DA
110342012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11035
11036 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11037
39adff0d
PE
110382012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11039
63807d47
PE
11040 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11041 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11042 since GCC 4.4.6 issues a bogus warning for them.
11043
39adff0d
PE
11044 Fix bugs in file timestamp newness comparisons.
11045 * fileio.c (Ffile_newer_than_file_p):
11046 * lread.c (Fload): Use full timestamp resolution of files,
11047 not just the 1-second resolution, so that files that are only
11048 slightly newer still count as newer.
11049 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11050 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11051
dbeed9a6
PE
110522012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11053
11054 * fileio.c: Improve handling of file time marker. (Bug#11852)
11055 (special_mtime): New function.
11056 (Finsert_file_contents, Fverify_visited_file_modtime):
11057 Use it to set special mtime values consistently.
11058
636334d6
AS
110592012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11060
11061 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11062 marker for non-existing file. (Bug#11852)
11063
e2017fe2
GM
110642012-07-03 Glenn Morris <rgm@gnu.org>
11065
11066 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11067 and did not make it into globals.h).
11068
404dbd37
TT
110692012-07-03 Tom Tromey <tromey@redhat.com>
11070
11071 * window.c (Fset_window_margins, Fset_window_fringes)
11072 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11073 * textprop.c (Fprevious_property_change): No longer static.
11074 * syntax.c (Fsyntax_table_p): No longer static.
11075 * process.c (Fget_process, Fprocess_datagram_address): No longer
11076 static.
11077 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11078 * keyboard.c (Fcommand_execute): No longer static.
11079 Remove EXFUN.
11080 * insdel.c (Fcombine_after_change_execute): No longer static.
11081 * image.c (Finit_image_library): No longer static.
11082 * fileio.c (Fmake_symbolic_link): No longer static.
11083 * eval.c (Ffetch_bytecode): No longer static.
11084 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
11085 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11086 No longer static.
404dbd37
TT
11087 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11088 static.
11089 * dired.c (Ffile_attributes): No longer static.
11090 * composite.c (Fcomposition_get_gstring): No longer static.
11091 * callproc.c (Fgetenv_internal): No longer static.
11092
11093 * ccl.h: Remove EXFUNs.
11094 * buffer.h: Remove EXFUNs.
11095 * dispextern.h: Remove EXFUNs.
11096 * intervals.h: Remove EXFUNs.
11097 * fontset.h: Remove EXFUN.
11098 * font.h: Remove EXFUNs.
11099 * dosfns.c (system_process_attributes): Remove EXFUN.
11100 * keymap.h: Remove EXFUNs.
11101 * lisp.h: Remove EXFUNs.
11102 * w32term.h: Remove EXFUNs.
11103 * window.h: Remove EXFUNs.
11104 * xsettings.h: Remove EXFUN.
11105 * xterm.h: Remove EXFUN.
11106
8e4fd1e1
GM
111072012-07-03 Glenn Morris <rgm@gnu.org>
11108
11109 * lisp.h (Frandom): Make it visible to C.
11110 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11111 buffer for invisible buffers. (Bug#1229)
11112
ca95b3eb
DA
111132012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11114
11115 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11116 values which aren't power of 2.
14ae4239 11117 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 11118 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
11119 accordingly.
11120
7555c33f
SM
111212012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11122
11123 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11124
11125 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11126
d12e8f5a
DA
111272012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11128
11129 * alloc.c (allocate_vector_block): Remove redundant
11130 calls to mallopt if DOUG_LEA_MALLOC is defined.
11131 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11132 avoid calls to mallopt if zero_vector is returned.
11133
296094c3
DA
111342012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11135
11136 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11137 is enabled, avoid dereferencing NULL current_sblock if
11138 running undumped.
11139
36429c89
DA
111402012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11141
11142 Cleanup basic buffer management.
11143 * buffer.h (struct buffer): Change layout to use generic vector
11144 marking code. Fix some comments. Change type of 'clip_changed'
11145 to bitfield. Remove unused #ifndef old.
11146 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11147 (GET_OVERLAYS_AT): Fix indentation.
11148 (for_each_per_buffer_object_at): New macro.
11149 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11150 (Fbuffer_local_variables): Use it.
11151 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11152 * alloc.c (allocate_buffer): Adjust to match new layout of
11153 struct buffer. Fix comment.
11154 (mark_overlay): New function.
11155 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11156 Lisp area of struct buffer.
11157 (mark_object): Use it. Adjust marking of misc objects
11158 and related comments.
11159
3b3e4cac
PE
111602012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11161
11162 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11163 wrapper that is not needed because the wrapped code is a no-op (zero
11164 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11165 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11166
cf5c0175
DA
111672012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11168
11169 * alloc.c (mark_buffer): Simplify. Remove prototype.
11170 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 11171 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
11172 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11173 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 11174
ca26824c
GM
111752012-06-30 Glenn Morris <rgm@gnu.org>
11176
2e4c5312
GM
11177 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11178
ca26824c
GM
11179 * epaths.in (PATH_SITELOADSEARCH): New.
11180 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11181 This is rather than relying on --enable-locallisppath elements
11182 having "site-lisp" in their names. (Bug#10208#25, 11658)
11183
0d23c240
EZ
111842012-06-30 Eli Zaretskii <eliz@gnu.org>
11185
c9240d7a
EZ
11186 * w32proc.c (sys_select): Accept and ignore one more argument.
11187
11188 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11189
0d23c240 11190 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 11191 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
11192
11193 * sysdep.c: Don't include dos.h and dosfns.h.
11194
11195 * process.c (sys_select):
11196 * msdos.c (sys_select): Accept one more argument and ignore it.
11197
11198 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11199 adapt data types and code to that.
11200
11201 * dosfns.c:
11202 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11203 which clashes with the gnulib function of the same name.
11204
af5a5a98
AS
112052012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11206
c5e4379c
AS
11207 * font.c (font_style_to_value, font_style_symbolic)
11208 (font_prop_validate_style): Add type checks for values in
11209 font_style_table.
11210
af5a5a98
AS
11211 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11212 argument.
11213 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11214 uses.
11215
8d38f461
EZ
112162012-06-29 Eli Zaretskii <eliz@gnu.org>
11217
2e5a6631
EZ
11218 * xdisp.c (try_window_id): Undo last change.
11219
8d38f461
EZ
11220 * w32.c (getwd): Adjust commentary about startup_dir.
11221 (init_environment): Always call sys_access, even in non-MSVC
11222 builds. Don't chdir to the directory of the Emacs executable.
11223 This undoes code from 1997 which was justified by the need to
11224 "avoid conflicts when removing and renaming directories". But its
11225 downside was that every relative file name was being interpreted
11226 relative to the directory of the Emacs executable, which can never
11227 be TRT. In particular, it broke sys_access when called with
11228 relative file names.
11229 (sys_access): Map GetLastError to errno.
11230
2af3565e
DA
112312012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11232
11233 * window.h (struct window): Change type of 'fringes_outside_margins'
11234 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 11235 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
11236 Adjust comment.
11237 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11238 to ptrdiff_t.
11239
c8d3a25c 112402012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 11241
c8d3a25c
GM
11242 * gnutls.c (emacs_gnutls_handshake):
11243 Add QUIT to make the loop interruptible.
57570cd3 11244
c8d3a25c 112452012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 11246
c8d3a25c
GM
11247 * charset.c (init_charset): Make lack of etc/charsets fatal.
11248
3e984ee8
DA
112492012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11250
11251 * editfns.c (region_limit): Fix type mismatch.
11252
ef884f23
DA
112532012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11254
11255 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11256 undefined. Convert from xassert to eassert.
11257 * nsmenu.m: Convert from xassert to eassert.
11258 * nsterm.m: Likewise.
11259
7d7e0027
SM
112602012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11261
11262 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11263
aa754e6a
PE
112642012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 Avoid integer overflow on scroll-left and scroll-right.
11267 * window.c (HSCROLL_MAX): New macro.
11268 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11269 overflow when requested scroll falls outside ptrdiff_t range.
11270
80b00b08
DA
112712012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11272
11273 * window.h (struct window): Change type of 'hscroll',
11274 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11275 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11276 Adjust users accordingly.
11277 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11278 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11279 from EMACS_INT to ptrdiff_t.
11280 (make_window): Omit redundant initialization.
11281
62b2bcf6
JB
112822012-06-28 Juanma Barranquero <lekktu@gmail.com>
11283
11284 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11285
45942c7d
DA
112862012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11287
11288 * window.h (struct window): Change type of 'use_time' and
11289 'sequence_number' from Lisp_Object to int.
11290 * frame.c (make_frame): Adjust users accordingly.
11291 * print.c (print_object): Likewise.
11292 * window.c (select_window, Fwindow_use_time, make_parent_window)
11293 (make_window): Likewise.
11294
e509cfa6
DA
112952012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11296
11297 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11298 enabled with --enable-checking=[all,glyphs] configure option.
11299 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11300 adjust comments accordingly.
11301 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11302 undefined, adjust comments accordingly.
11303 * image.c: Likewise.
11304 * scroll.c: Likewise.
11305 * w32fns.c: Likewise.
11306 * w32term.c: Likewise.
11307 * xdisp.c: Likewise.
11308 * xfaces.c: Likewise.
11309 * xfns.c: Likewise.
11310 * xterm.c: Likewise.
11311
a54e2c05
DA
113122012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11313
11314 Generalize run-time debugging checks.
11315 * dispextern.h (XASSERTS): Remove.
11316 * fontset.c (xassert): Remove.
11317 Convert from xassert to eassert.
11318 * alloc.c: Convert from xassert to eassert.
11319 * bidi.c: Likewise.
11320 * dispnew.c: Likewise.
11321 * fns.c: Likewise.
11322 * fringe.c: Likewise.
11323 * ftfont.c: Likewise.
11324 * gtkutil.c: Likewise.
11325 * image.c: Likewise.
11326 * keyboard.c: Likewise.
11327 * menu.c: Likewise.
11328 * process.c: Likewise.
11329 * scroll.c: Likewise.
11330 * sound.c: Likewise.
11331 * term.c: Likewise.
11332 * w32console.c: Likewise.
11333 * w32fns.c: Likewise.
11334 * w32term.c: Likewise.
11335 * window.c: Likewise.
11336 * xdisp.c: Likewise.
11337 * xfaces.c: Likewise.
11338 * xfns.c: Likewise.
11339 * xselect.c: Likewise.
11340 * xterm.c: Likewise.
11341
1ec4b7b2
SM
113422012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11343
11344 * fns.c (maybe_resize_hash_table): Output message when growing the
11345 purify-hashtable.
11346
2014308a
DA
113472012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11348
11349 * alloc.c (allocate_string_data): Remove dead code.
11350 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11351 avoid GCC warning about unused macro.
11352
246155eb
DA
113532012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11354
11355 * alloc.c (allocate_string): Omit intervals initialization.
11356 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11357 as in make_pure_string and make_pure_c_string.
11358
43184b7b
DA
113592012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11360
d209e2fb 11361 * alloc.c (allocate_string): Fix last change.
43184b7b 11362
3fe6dd74
DA
113632012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11364
d209e2fb 11365 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
11366 to memset, add explicit initialization where appropriate.
11367
1ba6038a
GM
113682012-06-27 Glenn Morris <rgm@gnu.org>
11369
11370 * lisp.mk (lisp): Remove paths.elc.
11371
c89926a5
CY
113722012-06-27 Chong Yidong <cyd@gnu.org>
11373
11374 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11375
ed6b3510
JW
113762012-06-26 John Wiegley <johnw@newartisans.com>
11377
1ec4b7b2 11378 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
11379 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11380
ed6b3510
JW
11381 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11382 when building with Clang.
11383
8edd4a2b
SM
113842012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11385
11386 * eval.c (Fapply): Allow calling it with a single argument.
11387
f6f62d1b
EZ
113882012-06-26 Eli Zaretskii <eliz@gnu.org>
11389
11390 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11391 _stricmp and _strnicmp.
11392 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11393
62efea5e
DA
113942012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11395
11396 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11397 allocated window.
11398 (allocate_process): Likewise for new process.
8edd4a2b 11399 (allocate_terminal): Change to use offsetof.
62efea5e
DA
11400 (allocate_frame): Likewise.
11401 * frame.c (make_frame): Omit redundant initialization.
11402 * window.c (make_parent_window): Use memset.
11403 (make_window): Omit redundant initialization.
11404 * process.c (make_process): Omit redundant initialization.
11405 * terminal.c (create_terminal): Likewise.
11406
42997f4d
DA
114072012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11408
11409 * term.c (delete_tty): Remove redundant call to memset.
11410
1130ecfc
DA
114112012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11412
11413 * alloc.c: Remove build_string.
11414 * lisp.h: Define build_string as static inline. This provides
11415 a better opportunity to optimize away calls to strlen when the
11416 function is called with compile-time constant argument.
11417 * image.c (imagemagick_error): Convert to build_string.
11418 * w32proc.c (sys_spawnve): Likewise.
11419 * xterm.c (x_term_init): Likewise.
11420
cf38a720
PE
114212012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11422
99027bdd
PE
11423 Use sprintf return value instead of invoking strlen on result.
11424 In the old days this wasn't portable, since some sprintf
11425 implementations returned char *. But they died out years ago and
11426 Emacs already assumes sprintf returns int.
11427 Similarly for float_to_string.
11428 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11429 * ccl.c (ccl_driver):
11430 * character.c (string_escape_byte8):
11431 * data.c (Fnumber_to_string):
11432 * doprnt.c (doprnt):
11433 * print.c (print_object):
11434 * xdisp.c (message_dolog):
11435 * xfns.c (syms_of_xfns):
11436 Use sprintf or float_to_string result to avoid need to call strlen.
11437 * data.c (Fnumber_to_string):
11438 Use make_unibyte_string, since the string must be ASCII.
11439 * lisp.h, print.c (float_to_string): Now returns int length.
11440 * term.c (produce_glyphless_glyph):
11441 Use sprintf result rather than recomputing it.
11442
cf38a720
PE
11443 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11444 * Makefile.in (ALL_CFLAGS):
11445 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11446 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11447
3511c784
DA
114482012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11449
0a08eb21 11450 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
11451 strcasecmp if available.
11452 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11453
fb7da12e
AS
114542012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11455
11456 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11457 Avoid comma operator.
11458 * menu.c (push_submenu_start, push_submenu_end)
11459 (push_left_right_boundary, push_menu_pane): Likewise.
11460 * msdos.c (dos_rawgetc): Likewise.
11461
afa2ffd8
DA
114622012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11463
11464 * xfns.c (xic_create_fontsetname): Remove redundant calls
11465 to memset.
11466
b3b4476b
PE
114672012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11468
4495ff38
PE
11469 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11470 sprintf already null-terminates its output.
11471
b3b4476b
PE
11472 * xfns.c (x_window): Remove redundant cast.
11473
b00876c9
DA
114742012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11475
11476 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11477 `const char *' to `char *' to avoid compiler warning.
11478
d188e26b
PE
114792012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11480
885d1d74
PE
11481 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11482 instead of truncating it to 63 (admittedly a generous limit).
11483
d188e26b
PE
11484 * process.c: Fix spelling and caps in comments.
11485
e2f560b1
DN
114862012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11487
e86db54b 11488 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
11489 * sysdep.c (setpgrp): Remove definition, not used in this file.
11490
7583a3a1
JB
114912012-06-24 Juanma Barranquero <lekktu@gmail.com>
11492
11493 * makefile.w32-in: Update dependencies.
11494
696056c2
EZ
114952012-06-24 Eli Zaretskii <eliz@gnu.org>
11496
11497 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11498 (SYSTIME_H): Add nt/inc/sys/time.h.
11499
11500 * systime.h [WINDOWSNT]: Include sys/time.h.
11501
11502 * s/ms-w32.h (struct timespec): Definition moved from
11503 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11504
845ca893
PE
115052012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11506
11507 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11508 * buffer.h (buffer_slot_type_mismatch):
11509 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11510 * eval.c (unwind_to_catch):
11511 * image.c (my_png_error, my_error_exit):
11512 * keyboard.c (quit_throw_to_read_char, user_error)
11513 (Fexit_recursive_edit, Fabort_recursive_edit):
11514 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11515 (wrong_type_argument, buffer_overflow, __executable_start)
11516 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11517 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11518 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11519 (fatal):
11520 (child_setup) [!DOS_NT]:
11521 * lread.c (end_of_file_error, invalid_syntax):
11522 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11523 * puresize.h (pure_write_error):
11524 * search.c (matcher_overflow):
11525 * sound.c (sound_perror, alsa_sound_perror):
11526 * sysdep.c, syssignal.h (croak):
11527 * term.c (maybe_fatal, vfatal):
11528 * textprop.c (text_read_only):
11529 * undo.c (user_error):
11530 * unexmacosx.c (unexec_error):
11531 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11532 Use _Noreturn rather than NO_RETURN.
11533 No need for separate decl merely because of _Noreturn.
11534 * sound.c (sound_warning, parse_sound):
11535 Remove unnecessary forward decls.
11536
f1dd8073
PE
115372012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11538
11539 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11540 * lisp.h (WAIT_READING_MAX): New macro.
11541 * dispnew.c (Fsleep_for, sit_for):
11542 * keyboard.c (kbd_buffer_get_event):
11543 * process.c (Faccept_process_output):
11544 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11545 This improves on the previous patch, which introduced a bug
11546 when time_t is unsigned and as wide as intmax_t.
11547 See <http://bugs.gnu.org/9000#51>.
11548
b82c1755
EZ
115492012-06-23 Eli Zaretskii <eliz@gnu.org>
11550
11551 * dispnew.c (sit_for, Fsleep_for):
11552 * keyboard.c (kbd_buffer_get_event):
11553 * process.c (Faccept_process_output): Avoid compiler warnings when
11554 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11555
ca300656
JB
115562012-06-23 Juanma Barranquero <lekktu@gmail.com>
11557
049ec95b
JB
11558 * makefile.w32-in: Update dependencies.
11559
ca300656
JB
11560 * w32.c (ltime): Add return type and declare static.
11561 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11562
db7b8d06
PE
115632012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11564
11565 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11566 Privately reported by Herbert J. Skuhra.
11567 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11568 All uses changed.
11569 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11570 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11571
0bd8297f
EZ
115722012-06-23 Eli Zaretskii <eliz@gnu.org>
11573
96512555
EZ
11574 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11575 last argument of make_unibyte_string.
11576
0bd8297f
EZ
11577 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11578 language ID in the event parameters.
11579
11580 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11581 event.code, not the obscure "character set ID".
11582
63def6b6
CY
115832012-06-23 Chong Yidong <cyd@gnu.org>
11584
11585 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11586
e8a02204
EZ
115872012-06-23 Eli Zaretskii <eliz@gnu.org>
11588
388cdec0
EZ
11589 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11590 * w32.c (fdutimens): New function.
11591
11592 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11593
11594 * s/ms-w32.h (pselect): Redirect to sys_select.
11595
11596 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11597
e8a02204
EZ
11598 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11599 in the logic of incrementing and decrementing the value of
11600 use_relocatable_buffers.
11601
d054f3fb
PE
116022012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11603
11604 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11605 Privately reported by Herbert J. Skuhra.
11606 [__FreeBSD__]: Remove "*/" typo after "#include".
11607 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11608 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11609 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11610 Don't assume EMACS_TIME and struct timeval are the same type.
11611
d35af63c
PE
116122012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11613
11614 Support higher-resolution time stamps (Bug#9000).
11615 The time stamps are only nanosecond-resolution at the C level,
11616 since that's the best that any real-world system supports now.
11617 But they are picosecond-resolution at the Lisp level, as that's
11618 easy, and leaves room for future OS improvements.
11619
11620 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11621 (LIBES): Use it.
11622
11623 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11624 Don't get current time unless it's needed.
11625
11626 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11627 now provides it if it's absent.
11628 (start_atimer): Port to higher-res time stamps.
11629 Check for time stamp overflow. Don't get current time more
11630 often than is needed.
11631
11632 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11633 Include systime.h, not time.h.
11634 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11635
11636 * dired.c: Include stat-time.h.
11637 (Ffile-attributes): File times now have higher resolution.
11638
11639 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11640 (struct image): Timestamp now has higher resolution.
11641
11642 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11643 has at least microseconds now. All uses removed.
11644 (update_frame, update_single_window, update_window, update_frame_1)
11645 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 11646 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
11647
11648 * editfns.c (time_overflow): Now extern.
11649 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11650 (float-time, Fformat_time_string, Fcurrent_time_string)
11651 (Fcurrent_time_zone): Accept and generate higher-resolution
11652 time stamps.
11653 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11654 (decode_time_components, lisp_seconds_argument): New functions.
11655 (make_time): Now static.
11656 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11657 Report an error if the time is invalid, rather than having the caller
11658 do that.
11659
11660 * fileio.c: Include <stat-time.h>
11661 (Fcopy_file): Copy higher-resolution time stamps.
11662 Prefer to set the time stamp via a file descriptor if that works.
11663 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11664 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11665 (Fvisited_file_modtime, Fset_visited_file_modtime):
11666 Support higher-resolution time stamps.
11667
11668 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11669
11670 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11671
11672 * image.c (prepare_image_for_display, clear_image_cache)
11673 (lookup_image): Port to higer-resolution time stamps.
11674
11675 * keyboard.c (start_polling, bind_polling_period):
11676 Check for time stamp overflow.
11677 (read_char, kbd_buffer_get_event, timer_start_idle)
11678 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11679 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11680 Port to higher-resolution time stamps. Do not assume time_t is signed.
11681 (decode_timer): New function. Timers are now vectors of length 9,
11682 not 8, to accommodate the picosecond component.
11683 (timer_check_2): Use it.
11684
11685 * nsterm.m (select_timeout, timeval_subtract): Remove.
11686 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11687 as they're a bit more accurate and handle overflow better.
11688 (ns_select): Change prototype to be compatible with pselect.
11689 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11690 * nsterm.h (ns_select): Adjust prototype.
11691
11692 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11693 us-resolution time stamps.
11694 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11695
11696 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11697
11698 * lisp.h (time_overflow): New decl.
11699 (wait_reading_process_output): First arg is now intmax_t, not int,
11700 to accommodate larger waits.
11701
11702 * process.h (struct Lisp_Process.read_output_delay):
11703 Now counts nanoseconds, not microseconds.
11704 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11705 EMACS_HAS_USECS.
11706 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11707 (wait_reading_process_output):
11708 Port to ns-resolution time stamps.
11709 (Faccept_process_output, wait_reading_process_output):
11710 Check for time stamp overflow. Do not assume time_t is signed.
11711 (select_wrapper): Remove; we now use pselect.
11712 (Fprocess_attributes): Now generates ns-resolution time stamps.
11713
11714 * sysdep.c: Include utimens.h. Don't include utime.h
11715 or worry about struct utimbuf; gnulib does that for us now.
11716 (gettimeofday): Remove; gnulib provides a substitute.
11717 (make_timeval): New function.
11718 (set_file_times): Now sets ns-resolution time stamps.
11719 New arg FD; all uses changed.
11720 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11721 (system_process_attributes):
11722 Now returns ns-resolution time stamp. All uses changed.
11723 Check for time stamp overflow.
11724
11725 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11726 provides a substitute now.
11727
11728 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11729 since it guarantees struct timespec.
11730 (EMACS_TIME): Now struct timespec, so that we can support
11731 ns-resolution time stamps.
11732 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11733 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11734 (EMACS_USECS): Remove.
11735 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11736 so multiply the arg by 1000 before storing it.
11737 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11738 New macros.
11739 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11740 Port to ns-resolution time stamps.
11741 (EMACS_TIME_NEG_P): Remove; replaced by....
11742 (EMACS_TIME_SIGN): New macro.
11743 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11744 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11745 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11746 (make_timeval, make_lisp_time, decode_time_components): New decls.
11747 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11748 that it mishandled time_t overflow. You can't compare by subtracting!
11749 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11750 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11751
11752 * term.c: Include <sys/time.h>.
11753 (timeval_to_Time): New function, for proper overflow wraparound.
11754 (term_mouse_position, term_mouse_click): Use it.
11755
11756 * undo.c (record_first_change): Support higher-resolution time stamps
11757 in the undo buffer.
11758 (Fprimitive_undo): Use them when restoring time stamps.
11759
11760 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11761 (w32_get_internal_run_time):
11762 Port to higher-resolution Emacs time stamps.
11763 (ltime): Now accepts single 64-bit integer, as that's more convenient
11764 for callers.
11765
11766 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11767
11768 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11769 for compatibility with pselect. Support ns-resolution time stamps.
11770
11771 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11772
11773 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11774 Check for time stamp overflow, and support ns-resolution time stamps.
11775
11776 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11777 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11778 (timeval_subtract): Remove; no longer needed.
11779 (XTflash, XTring_bell, x_wait_for_event):
11780 Port to ns-resolution time stamps. Don't assume time_t is signed.
11781
b6a92dfe
CY
117822012-06-22 Chong Yidong <cyd@gnu.org>
11783
11784 * xdisp.c (x_consider_frame_title): Revert last change.
11785
d251c37c
EZ
117862012-06-22 Eli Zaretskii <eliz@gnu.org>
11787
11788 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11789 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11790 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11791 staticidx goes up to 1597 out of 1600 = 0x640.)
11792
f10deafb
PE
117932012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11794
11795 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11796 Otherwise, the umask might be mistakenly 0 while handling input signals.
11797
ec6de1e2
SM
117982012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11799
11800 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11801
28be1ada
DA
118022012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11803
11804 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11805 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11806 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11807 access to `contents' member of Lisp_Vector objects with AREF and ASET
11808 where appropriate.
11809
c6bf3022
CY
118102012-06-19 Chong Yidong <cyd@gnu.org>
11811
11812 * frame.c (delete_frame): When selecting a frame on a different
11813 text terminal, do not alter the terminal's top-frame.
11814
11815 * xdisp.c (format_mode_line_unwind_data): Record the target
11816 frame's selected window and its terminal's top-frame.
11817 (unwind_format_mode_line): Restore them.
11818 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11819 Callers changed.
11820 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11821 since tty frames can be explicitly named.
11822 (prepare_menu_bars): Likewise.
11823
11824 * term.c (Ftty_top_frame): New function.
11825
defd4196
PE
118262012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11827
11828 Port byte-code-meter to modern targets.
11829 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11830 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 11831 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
11832 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11833 (METER_1, METER_2): Simplify.
11834
1053a871
SM
118352012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11836
11837 * data.c (Fdefalias): Return `symbol' (bug#11686).
11838
b7e8d081
MR
118392012-06-18 Martin Rudalics <rudalics@gmx.at>
11840
11841 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
11842 gets killed during executing of this function (Bug#11665).
11843 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
11844 (Vkill_buffer_query_functions): In doc-string say that functions
11845 run by this hook should not change the current buffer.
11846
7ea2b339
PE
118472012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11848
11849 Fix recently-introduced process.c problems found by static checking.
11850 * process.c (write_queue_push, write_queue_pop, send_process):
11851 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11852 (write_queue_pop): Fix pointer signedness problem.
11853 (send_process): Remove unused local.
11854
96a313a1
CY
118552012-06-17 Chong Yidong <cyd@gnu.org>
11856
11857 * xdisp.c (redisplay_internal): No need to redisplay terminal
11858 frames that are not on top.
11859
20ca2e94
TN
118602012-06-17 Troels Nielsen <bn.troels@gmail.com>
11861
11862 * process.c (make_process): Initialize write_queue.
11863 (write_queue_push, write_queue_pop): New functions.
11864 (send_process): Use them to maintain correct ordering of process
11865 writes (Bug#10815).
11866
9a900ca9
PE
118672012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11868
310fbfa8
PE
11869 * lisp.h (eassert): Assume C89 or later.
11870 This removes the need for CHECK.
11871 (CHECK): Remove. Its comments about always evaluating its
11872 argument were confusing, as 'eassert' typically does not evaluate
11873 its argument.
11874
27bb1ca4
PE
11875 * coding.c (produce_chars): Use ptrdiff_t, not int.
11876
9a900ca9
PE
11877 * xterm.c (x_draw_underwave): Check for integer overflow.
11878 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11879
41b7f8bc 118802012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
11881
11882 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11883 referenced (Bug#11583).
11884
9b0e3eba
AA
118852012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11886
11887 Implement wave-style variant of underlining.
11888 * dispextern.h (face_underline_type): New enum.
11889 (face): Add field for underline type.
11890 * nsterm.m (ns_draw_underwave): New function.
11891 (ns_draw_text_decoration): Use it.
11892 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11893 New functions.
11894 (x_draw_glyph_string): Use them.
11895 * xfaces.c (Qline, Qwave): New Lisp objects.
11896 (check_lface_attrs, merge_face_ref)
1053a871
SM
11897 (Finternal_set_lisp_face_attribute, realize_x_face):
11898 Handle wave-style underline face attributes.
9b0e3eba
AA
11899 * xterm.c (x_draw_underwave): New function.
11900 (x_draw_glyph_string): Use it.
11901
0fb52f11
JB
119022012-06-16 Juanma Barranquero <lekktu@gmail.com>
11903
11904 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11905 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11906 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11907 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11908 ($(BLD)/w32select.$(O)): Update dependencies.
11909
e5560ff7
AS
119102012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11911
11912 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11913 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11914 * character.c (_fetch_multibyte_char_p): Remove.
11915 * alloc.c: Include "character.h" before "buffer.h".
11916 * bidi.c: Likewise.
11917 * buffer.c: Likewise.
11918 * bytecode.c: Likewise.
11919 * callint.c: Likewise.
11920 * callproc.c: Likewise.
11921 * casefiddle.c: Likewise.
11922 * casetab.c: Likewise.
11923 * category.c: Likewise.
11924 * cmds.c: Likewise.
11925 * coding.c: Likewise.
11926 * composite.c: Likewise.
11927 * dired.c: Likewise.
11928 * dispnew.c: Likewise.
11929 * doc.c: Likewise.
11930 * dosfns.c: Likewise.
11931 * editfns.c: Likewise.
11932 * emacs.c: Likewise.
11933 * fileio.c: Likewise.
11934 * filelock.c: Likewise.
11935 * font.c: Likewise.
11936 * fontset.c: Likewise.
11937 * fringe.c: Likewise.
11938 * indent.c: Likewise.
11939 * insdel.c: Likewise.
11940 * intervals.c: Likewise.
11941 * keyboard.c: Likewise.
11942 * keymap.c: Likewise.
11943 * lread.c: Likewise.
11944 * macros.c: Likewise.
11945 * marker.c: Likewise.
11946 * minibuf.c: Likewise.
11947 * nsfns.m: Likewise.
11948 * nsmenu.m: Likewise.
11949 * print.c: Likewise.
11950 * process.c: Likewise.
11951 * regex.c: Likewise.
11952 * region-cache.c: Likewise.
11953 * search.c: Likewise.
11954 * syntax.c: Likewise.
11955 * term.c: Likewise.
11956 * textprop.c: Likewise.
11957 * undo.c: Likewise.
11958 * unexsol.c: Likewise.
11959 * w16select.c: Likewise.
11960 * w32fns.c: Likewise.
11961 * w32menu.c: Likewise.
11962 * window.c: Likewise.
11963 * xdisp.c: Likewise.
11964 * xfns.c: Likewise.
11965 * xmenu.c: Likewise.
11966 * xml.c: Likewise.
11967 * xselect.c: Likewise.
11968
2f07e6af
EZ
119692012-06-16 Eli Zaretskii <eliz@gnu.org>
11970
1053a871
SM
11971 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11972 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 11973 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
11974 row.
11975 (handle_face_prop): Use chunk-relative overlay string index when
11976 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
11977 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11978 the rightmost. (Bug#11720)
2f07e6af 11979
29b83cec
AS
119802012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11981
11982 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11983 (CATEGORY_MEMBER): Enforce 1/0 value.
11984 * category.c (_temp_category_set): Remove.
11985
4c5501e9
EZ
119862012-06-16 Eli Zaretskii <eliz@gnu.org>
11987
11988 * window.c (Fdelete_other_windows_internal)
11989 (Fdelete_window_internal): Don't access frame's mouse highlight
11990 info of the initial frame. (Bug#11677)
11991
2b570124
PE
119922012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11993
e93864f9
PE
11994 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11995 Assume USE_2_TAGS_FOR_INTS.
11996 (xreload): Adjust $tagmask width to match recent lisp.h change.
11997
2b570124
PE
11998 Simplify lisp.h in minor ways that should not affect code.
11999 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12000 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12001 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12002 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12003 (INTTYPEBITS): New macro, for clarity.
12004 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
12005 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12006 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
12007 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12008 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12009
81755f69
JB
120102012-06-13 Juanma Barranquero <lekktu@gmail.com>
12011
12012 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12013
16192a57
GM
120142012-06-13 Glenn Morris <rgm@gnu.org>
12015
12016 * s/bsd-common.h (BSD4_3):
12017 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12018
646b5f55
AS
120192012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12020
12021 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12022 instead of union.
12023 (XLI, XIL): Define.
1053a871
SM
12024 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12025 Use them.
12026 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 12027 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 12028 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
12029 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12030 * frame.c (delete_frame): Remove outdated comment.
12031 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12032 USE_LISP_UNION_TYPE.
12033 (Fw32_unregister_hot_key): Likewise.
12034 (Fw32_toggle_lock_key): Likewise.
12035 * w32menu.c (add_menu_item): Likewise.
12036 (w32_menu_display_help): Use XIL instead of checking
12037 USE_LISP_UNION_TYPE.
12038 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12039 (init_heap): Likewise.
12040 * w32term.c (w32_read_socket): Update comment.
12041
1d3823c9
GM
120422012-06-13 Glenn Morris <rgm@gnu.org>
12043
c62ff706
GM
12044 * s/usg5-4-common.h, src/s/unixware.h:
12045 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12046
1d3823c9
GM
12047 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12048
bfe3e0a2
PE
120492012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12050
12051 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12052 * alloc.c (make_number) [!defined make_number]:
12053 Remove, as lisp.h always defines this now.
12054 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12055 (roundup_size): Verify that it is a power of 2.
12056 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12057 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12058 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12059 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12060 USE_LSB_TAG now is always defined to be either 0 or 1.
12061 All uses changed.
12062 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12063 code works fine either way, and efficiency is not a concern here,
12064 as the union type is for debugging, not for production.
12065 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12066 Use an inline function on all platforms when using the union type,
12067 since this is simpler and 'static inline' can be used portably
12068 within Emacs now.
12069 (LISP_INITIALLY_ZERO): New macro.
12070 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12071 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12072
45fa9c0f
GM
120732012-06-12 Glenn Morris <rgm@gnu.org>
12074
b4492cba
GM
12075 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12076
12077 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 12078
45fa9c0f
GM
12079 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12080 Move BROKEN_SIGIO to configure.
12081
12082 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12083 Move NO_TERMIO to configure.
12084
0e25d334
CY
120852012-06-12 Chong Yidong <cyd@gnu.org>
12086
12087 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12088 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12089 MagickExportImagePixels is undefined.
12090
43682bb6
PE
120912012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12092
12093 * image.c (imagemagick_load_image): Remove unused label.
12094
a9be7d2b
GM
120952012-06-11 Glenn Morris <rgm@gnu.org>
12096
12097 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12098 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12099 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12100 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12101
3017f87f
SM
121022012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12103
12104 * alloc.c (make_byte_code): New function.
12105 (Fmake_byte_code): Use it. Don't purify here.
12106 * lread.c (read1): Use it as well to avoid extra allocation.
12107
1b9b4cf4
CY
121082012-06-11 Chong Yidong <cyd@gnu.org>
12109
12110 * image.c (imagemagick_load_image): Implement transparency.
12111
95988fcf
AS
121122012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12113
12114 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12115 account for preceding backslashes. (Bug#11663)
12116
cd4eb164
CY
121172012-06-09 Chong Yidong <cyd@gnu.org>
12118
12119 * term.c: Support italics in capable terminals (Bug#9652).
12120 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12121 (turn_on_face): Output using TS_enter_italic_mode if available.
12122 Don't handle unused blinking and alt-charset cases.
12123 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12124 and tty_alt_charset_p cases.
12125 (tty_capable_p, init_tty): Support italics.
12126
12127 * termchar.h (struct tty_display_info): Add field for italics.
12128 Remove unused blink field.
12129
12130 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12131 Handle slant.
12132
12133 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12134 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12135 tty_alt_charset_p. Add tty_italic_p.
12136
ff88beb8
MA
121372012-06-09 Michael Albinus <michael.albinus@gmx.de>
12138
12139 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12140 dbus_type_is_basic if available.
12141 (xd_extract_signed, xd_extract_unsigned): Rename from
12142 extract_signed and extract_unsigned, respectively. Adapt callers.
12143
44286096
CY
121442012-06-09 Chong Yidong <cyd@gnu.org>
12145
1682701f
CY
12146 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12147
44286096
CY
12148 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12149 case (Bug#9752).
12150
d86feb17
PE
121512012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12152
12153 * xdisp.c (vmessage): Treat frame message as multibyte.
12154 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12155 would generate the diagnostic "Making \302\247 buffer-local while
12156 let-bound!".
12157
d5c20fe8
EZ
121582012-06-08 Eli Zaretskii <eliz@gnu.org>
12159
12160 * dispnew.c (showing_window_margins_p): Undo last change, which
12161 was done due to an inadvertent commit.
12162 (adjust_frame_glyphs_for_frame_redisplay): Do call
12163 showing_window_margins_p.
12164
513749ee
SM
121652012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12166
12167 * eval.c (Fmake_var_non_special): New primitive.
12168 (syms_of_eval): Defsubr it.
12169 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12170
d4a8f5c1
JB
121712012-06-08 Juanma Barranquero <lekktu@gmail.com>
12172
12173 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12174 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12175
8bbbc977
EZ
121762012-06-08 Eli Zaretskii <eliz@gnu.org>
12177
12178 * alloc.c (allocate_vectorlike): Fix last change.
12179
f3372c87
DA
121802012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12181
12182 Block-based vector allocation of small vectors.
12183 * lisp.h (struct vectorlike_header): New field `nbytes',
12184 adjust comment accordingly.
12185 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 12186 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
12187 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12188 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
f4ad7ea1
JB
12189 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12190 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12191 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
f3372c87
DA
12192 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12193 (roundup_size): New constant.
12194 (struct vector_block): New data type.
12195 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 12196 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
12197 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12198 (sweep_vectors): New functions.
12199 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 12200 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
12201 or equal to VBLOCK_BYTES_MAX.
12202 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12203 (init_alloc_once): Add call to init_vectors.
12204
4f18a4ed
SM
122052012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12206
12207 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12208
86f158bc
PE
122092012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12210
12211 * doprnt.c (doprnt): Truncate multibyte char correctly.
12212 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12213 would mishandle a string argument "Xc" if X was a multibyte
12214 character of length 2: it would truncate after X's first byte
12215 rather than including all of X.
12216
c5cfcbe0
CY
122172012-06-06 Chong Yidong <cyd@gnu.org>
12218
12219 * buffer.c (word_wrap): Doc fix.
12220
c05cf390
PE
122212012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12222
12223 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12224
0c3461de
GM
122252012-06-03 Glenn Morris <rgm@gnu.org>
12226
12227 * xdisp.c (tool-bar-style): Doc fix.
12228
c71232db
UM
122292012-06-03 Ulrich Müller <ulm@gentoo.org>
12230
12231 * Makefile.in (PAXCTL): Define.
12232 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12233 binary via PaX flags if the paxctl utility is available.
12234 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12235 Restore PaX flags to their default. (Bug#11398)
12236
383f7350
CY
122372012-06-03 Chong Yidong <cyd@gnu.org>
12238
12239 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12240 buffer (Bug#11226).
12241
5f2c76c6
CY
122422012-06-03 Chong Yidong <cyd@gnu.org>
12243
12244 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12245 (note_mode_line_or_margin_highlight): If there is no help echo,
12246 use mode-line-default-help-echo. Handle the case where the mouse
12247 position is past the end of the mode line string.
12248
12249 * buffer.c (buffer_local_value_1): New function, split from
12250 Fbuffer_local_value; can return Qunbound.
12251 (Fbuffer_local_value): Use it.
12252 (Vmode_line_format): Docstring tweaks.
12253
773d47f6
PE
122542012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12255
12256 * sysdep.c (system_process_attributes): Improve comment.
12257
f2d6a3df
SM
122582012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12259
12260 * keyboard.c: Export real-this-command to Elisp.
12261 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12262 and DEFVAR it. Update all users.
12263
63810350
PE
122642012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12265
7bd5c1f4
PE
12266 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12267
63810350
PE
12268 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12269 Convert pctcpu and pctmem to Lisp float properly.
12270 Let the compiler fold better, as 100.0/0x8000 is exact.
12271
a2821611
AS
122722012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12273
12274 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12275 cons_block.
12276
5fceba1d
PE
122772012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12278
12279 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12280
c98ff5dd
DA
122812012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12282
12283 For a 'struct window', replace some Lisp_Object fields to
12284 bitfields where appropriate, remove unused fields.
12285 * window.h (struct window): Remove unused 'last_mark_x' and
12286 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 12287 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
12288 Change type of 'force_start', 'optional_new_start',
12289 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 12290 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 12291
ca34e0be
PE
122922012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12293
12294 Pacify gcc -Wdouble-precision when using Xaw.
12295 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12296 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12297 Use 'float' consistently, rather than 'float' in most places
12298 and 'double' in a couple of places.
12299
efc00ab1 123002012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
12301
12302 * xdisp.c (handle_stop): Detect whether we have overlay strings
12303 loaded by testing it->current.overlay_string_index to be
12304 non-negative, instead of checking whether n_overlay_strings is
12305 positive. (Bug#11587)
12306
efc00ab1 123072012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
12308
12309 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12310
12311 * doc.c (Fsubstitute_command_keys): Doc fix.
12312
efc00ab1 123132012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
12314
12315 * search.c (search_buffer): Remove calls to
12316 r_alloc_inhibit_buffer_relocation, as it is now called by
12317 maybe_unify_char, which was the cause of relocation of buffer text
12318 in bug#11519.
12319
efc00ab1 123202012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
12321
12322 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12323 for the duration of call to load_charset, to avoid problems with
12324 callers of maybe_unify_char that access buffer text through C
12325 pointers.
12326
12327 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12328 decrement the inhibition flag, instead of just setting or
12329 resetting it.
12330
ba93a187
PE
123312012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12332
12333 Remove obsolete '#define static' cruft.
12334 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12335 This #undef was "temporary" in 2000; it is no longer needed
12336 now that '#define static' has gone away.
12337 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12338 (gray_bitmap_bits): Remove; no longer needed.
12339 All uses replaced with definiens.
12340 * xterm.c: Include "bitmaps/gray.xbm".
12341
9e4bf381
PE
123422012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12343
12344 Clean up __executable_start, monstartup when --enable-profiling.
12345 The following changes affect the code only when profiling.
12346 * dispnew.c (__executable_start): Rename from safe_bcopy.
12347 Define only on platforms that need it.
12348 * emacs.c: Include <sys/gmon.h> when profiling.
12349 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12350 (__executable_start): Remove decl, since lisp.h does it now.
12351 (safe_bcopy): Remove decl; no longer has that name.
12352 (main): Coalesce #if into single bit of code, for simplicity.
12353 Cast pointers to uintptr_t, since standard libraries want integers
12354 and not pointers.
12355 * lisp.h (__executable_start): New decl.
12356
32d72c2f
GM
123572012-05-31 Glenn Morris <rgm@gnu.org>
12358
12359 * image.c (Fimagemagick_types): Doc fix.
12360
baac5bc7
JM
123612012-05-30 Jim Meyering <meyering@redhat.com>
12362
12363 * callproc.c (Fcall_process_region): Include directory component
12364 in mkstemp error message (Bug#11586).
12365
72cb32cf
PE
123662012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12367
12368 * alloc.c, lisp.h (make_pure_vector): Now static.
12369
61b108cc
SM
123702012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12371
12372 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12373 Move to byte-run.el.
12374 (Fautoload): Do the hash-doc more carefully.
12375 * data.c (Fdefalias): Purify definition, except for keymaps.
12376 (Qdefun): Move from eval.c.
12377 * lisp.h (Qdefun): Remove.
12378 * lread.c (read1): Tiny simplification.
12379
471fe23d
TN
123802012-05-29 Troels Nielsen <bn.troels@gmail.com>
12381
934f3f58 12382 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
12383 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12384 Bug#9642, but explicitly check that the buffer the overlay would
12385 be moved to is live and rearrange lines to make sure that errors
12386 will not put the overlay in an inconsistent state.
12387 (Fdelete_overlay): Cosmetics.
12388
85d0efd1
EZ
123892012-05-28 Eli Zaretskii <eliz@gnu.org>
12390
12391 * w32term.c (my_bring_window_to_top): New function.
12392 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
12393 could be different from the original one.
12394 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
12395 (Bug#11513)
12396
12397 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12398 by calling BringWindowToTop.
12399
12400 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12401 (WM_EMACS_END): Increase by one.
12402
da92a98c
PE
124032012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12404
12405 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12406 This avoids undefined behavior that might cause the eassert
12407 to not catch an out-of-range value.
12408
74d1f848
JB
124092012-05-28 Juanma Barranquero <lekktu@gmail.com>
12410
12411 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12412 Update dependencies.
12413
9e1a06fc
EZ
124142012-05-27 Eli Zaretskii <eliz@gnu.org>
12415
12416 * bidi.c (bidi_mirror_char): Fix last change.
12417
f3dd7312
AS
124182012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12419
12420 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12421 when referring to sectname field in printf format.
12422
81899c91
PE
124232012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12424
57b81a9f
PE
12425 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12426 Only r_alloc_inhibit_buffer_relocation needed to be added;
12427 the others were already declared.
12428
81899c91
PE
12429 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12430 before checking whether it's out of range. Put the check inside
12431 eassert. See
12432 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12433
33017faf 124342012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
12435
12436 * callproc.c (Fcall_process): Restore a line that was accidentally
12437 commented out in the 2011-02-13 change (bug#11547).
12438
33017faf 124392012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
12440
12441 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12442 defined on ralloc.c.
12443
12444 * buffer.c [REL_ALLOC]: Remove prototypes of
12445 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12446 they are now on lisp.h.
12447
12448 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12449
12450 * search.c (search_buffer): Use it to inhibit relocation of buffer
12451 text while re_search_2 is doing its job, because re_search_2 is
12452 passed C pointers to buffer text. (Bug#11519)
12453
23415acf
EZ
12454 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12455 Update value to 24.
12456
44e27368
EZ
12457 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12458 state after an additional call to move_it_in_display_line_to, keep
12459 the values of it->max_ascent and it->max_descent found for the
12460 entire line.
12461 (pos_visible_p): Revert the comparison against bottom_y to what it
12462 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12463 (Bug#11464)
12464
c1892f11
PE
124652012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12466
12467 Fix coding-related core dumps with gcc -ftrapv.
12468 The code was computing A - B, where A and B are pointers, and B is
12469 random garbage. This can lead to core dumps on platforms that
12470 have special pointer registers, and it also leads to core dumps on
12471 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12472 A - B only when B is initialized properly.
12473 * coding.c (coding_set_source, coding_set_destination): Return void.
12474 (coding_change_source, coding_change_destinations): New functions,
12475 with the old behaviors of coding_set_source and coding_set_destination.
12476 All callers that need an offset changed to use these new functions.
12477
eb7afdad
GM
124782012-05-26 Glenn Morris <rgm@gnu.org>
12479
12480 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12481
f12fdf02
EZ
124822012-05-26 Eli Zaretskii <eliz@gnu.org>
12483
53a63be6 12484 Extend mouse support on W32 text-mode console.
61b108cc
SM
12485 * xdisp.c (draw_row_with_mouse_face):
12486 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 12487
eb3f6f01 12488 * w32console.c: Include window.h.
61b108cc
SM
12489 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12490 New functions.
eb3f6f01
EZ
12491 (initialize_w32_display): Initialize mouse-highlight data.
12492
53a63be6
EZ
12493 * w32inevt.c: Include termchar.h and window.h.
12494 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12495 moves, call note_mouse_highlight. If help_echo changed, call
12496 gen_help_event to produce help-echo message in the echo area.
12497 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12498 highlight info.
12499
4cfd81f6
PE
125002012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12501
12502 * lread.c (read1): Simplify slightly to avoid an overflow warning
12503 with GCC 4.7.0 on x86-64.
12504
4446092a
EZ
125052012-05-26 Eli Zaretskii <eliz@gnu.org>
12506
12507 * bidi.c (bidi_mirror_char): Revert last change: an int is
12508 definitely wide enough here.
12509
42b2a986 125102012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 12511
42b2a986 12512 Fix integer width and related bugs (Bug#9874).
eb106a49 12513 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
12514 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12515 (string_bytes, check_sblock, allocate_string_data):
12516 (compact_small_strings, Fmake_bool_vector, make_string)
12517 (make_unibyte_string, make_multibyte_string)
12518 (make_string_from_bytes, make_specified_string)
12519 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12520 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12521 (mark_vectorlike):
12522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12523 (allocate_pseudovector):
12524 Use int, not EMACS_INT, where int is wide enough.
12525 (inhibit_garbage_collection, Fgarbage_collect):
12526 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12527 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12528 int might not be wide enough.
12529 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12530 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12531 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12532 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12533 (bidi_level_of_next_char, bidi_move_to_visually_next):
12534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12535 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12536 (Fkill_buffer, Fset_buffer_major_mode)
12537 (advance_to_char_boundary, Fbuffer_swap_text)
12538 (Fset_buffer_multibyte, overlays_at, overlays_in)
12539 (overlay_touches_p, struct sortvec, record_overlay_string)
12540 (overlay_strings, recenter_overlay_lists)
12541 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12542 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12543 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12544 (Foverlay_recenter, last_overlay_modification_hooks_used)
12545 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12546 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
12547 (validate_region): Omit unnecessary test for b <= e,
12548 since that's guaranteed by the previous test.
d311d28c
PE
12549 (adjust_overlays_for_delete): Avoid pos + length overflow.
12550 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12551 (report_overlay_modification):
12552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12553 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12554 Omit pointer cast, which isn't needed anyway, and doesn't work
12555 after the EMACS_INT -> ptrdiff_t change.
02481186 12556 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
12557 * buffer.h: Adjust decls to match defn changes elsewhere.
12558 (struct buffer_text, struct buffer):
12559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12560 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
12561 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12562 not int, to avoid needless 32-bit limit on 64-bit hosts.
12563 (exec_byte_code): Use tighter memory-full test, one that checks
12564 for alloca overflow. Don't compute the address of the object just
12565 before an array, as that's not portable. Use EMACS_INT, not
12566 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
12567 * callint.c (Fcall_interactively):
12568 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12569 * callproc.c (call_process_kill, Fcall_process):
12570 Don't assume pid_t fits into an Emacs fixnum.
12571 (call_process_cleanup, Fcall_process, child_setup):
12572 Don't assume pid_t fits into int.
12573 (call_process_cleanup, Fcall_process, delete_temp_file)
12574 (Fcall_process_region):
12575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12576 (Fcall_process): Simplify handling of volatile integers.
12577 Use int, not EMACS_INT, where int will do.
12578 * casefiddle.c (casify_object, casify_region, operate_on_word)
12579 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12581 (casify_object): Avoid integer overflow when overallocating buffer.
12582 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 12583 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
12584 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12585 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12586 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12587 integers are now checked earlier. All uses replaced with XINT.
12588 (ccl_driver):
12589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12590 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
12591 (ccl_driver, Fregister_code_conversion_map):
12592 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
12593 (resolve_symbol_ccl_program): Check that vector header is in range.
12594 Always copy the vector, so that we can check its contents reliably
12595 now rather than having to recheck each instruction as it's being
12596 executed. Check that vector words fit in 'int'.
12597 (ccl_get_compiled_code, Fregister_ccl_program)
12598 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12599 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12600 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12601 contents are in range.
12602 (Fccl_execute_on_string): Check that status is in range.
12603 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12604 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12605 Accept and return EMACS_INT, not int, because callers can pass values
12606 out of 'int' range.
12607 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12608 (multibyte_chars_in_text, parse_str_as_multibyte)
12609 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12610 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12611 (string_escape_byte8, Fget_byte):
12612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 12613 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
12614 avoid mishandling large integers.
12615 * character.h: Adjust decls to match defn changes elsewhere.
12616 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12617 (Ffind_charset_region):
12618 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12619 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12620 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 12621 Don't assume fixnum fits in int.
d311d28c
PE
12622 (load_charset_map_from_vector, Fmap_charset_chars):
12623 Remove now-unnecessary CHECK_NATNUMs.
12624 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
12625 Don't rely on undefined behavior with signed left shift overflow.
12626 Don't assume unsigned int fits into fixnum, or that fixnum fits
12627 into unsigned int. Don't require max_code to be a valid fixnum;
12628 that's not true for gb10830 4-byte on a 32-bit host. Allow
12629 invalid_code to be a cons, for the same reason. Require code_offset
12630 to be a character. Avoid int overflow if max_char is close
12631 to INT_MAX.
12632 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12633 this is intended anyway and avoids some undefined behavior.
12634 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12635 INDEX_TO_CODE_POINT, as that's what it expects.
12636 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
12637 * charset.h (DECODE_CHAR): Return int, not unsigned;
12638 this is what was intended anyway, and it avoids undefined behavior.
12639 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12640 integer-overflow issues.
12641 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12642 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12643 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
12644 * chartab.c (Fmake_char_table, Fset_char_table_range)
12645 (uniprop_get_decoder, uniprop_get_encoder):
12646 Don't assume fixnum fits in int.
12647 * cmds.c (move_point): New function, that does the gist of
12648 Fforward_char and Fbackward_char, but does so while checking
12649 for integer overflow more accurately.
c96e5d6a 12650 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
12651 (Fforward_line, Fend_of_line, internal_self_insert)
12652 (internal_self_insert):
12653 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12654 Fix a FIXME, by checking for integer overflow when calculating
12655 target_clm and actual_clm.
12656 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 12657 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
12658 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12659 (coding_alloc_by_making_gap, alloc_destination)
12660 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12661 (encode_coding_utf_16, detect_coding_emacs_mule)
12662 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12663 (detect_coding_iso_2022, decode_coding_iso_2022)
12664 (encode_invocation_designation, encode_designation_at_bol)
12665 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12666 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12667 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12668 (encode_coding_ccl, encode_coding_raw_text)
12669 (detect_coding_charset, decode_coding_charset)
12670 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12671 (produce_composition, produce_charset, produce_annotation)
12672 (decode_coding, handle_composition_annotation)
12673 (handle_charset_annotation, consume_chars, decode_coding_gap)
12674 (decode_coding_object, encode_coding_object, detect_coding_system)
12675 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12676 (code_convert_region, code_convert_string)
8f50130c
PE
12677 (Fdefine_coding_system_internal)
12678 (coding_set_source, coding_set_destination):
d311d28c
PE
12679 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12680 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12681 (Fdefine_coding_system_internal):
12682 Don't assume fixnums fit in int.
12683 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 12684 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
12685 (Funencodable_char_position, Fcheck_coding_systems_region)
12686 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 12687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 12688 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 12689 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 12690 Don't access memory outside of the args array.
d311d28c 12691 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
12692 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12693 result of ENCODE_CHAR.
d311d28c
PE
12694 * coding.h: Adjust decls to match defn changes elsewhere.
12695 (struct coding_system):
12696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12697 * composite.c (get_composition_id, find_composition)
12698 (run_composition_function, update_compositions)
12699 (compose_text, composition_gstring_put_cache)
12700 (composition_gstring_p, composition_gstring_width)
12701 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12702 (composition_compute_stop_pos, composition_reseat_it)
12703 (composition_update_it, struct position_record)
12704 (find_automatic_composition, composition_adjust_point)
12705 (Fcomposition_get_gstring, Ffind_composition_internal):
12706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12707 (update_compositions):
12708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12709 * composite.h: Adjust decls to match defn changes elsewhere.
12710 (struct composition):
12711 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12712 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12713 Do not attempt to compute the address of the object just before a
12714 buffer; this is not portable.
12715 (Faref, Faset):
12716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12717 (Faset): Use int, not EMACS_INT, where int is wide enough.
12718 (Fstring_to_number): Don't assume fixnums fit in int.
12719 (Frem): Don't assume arg is nonnegative.
12720 * dbusbind.c (xd_append_arg): Check for integers out of range.
12721 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 12722 (extract_signed, extract_unsigned): New functions.
243e0530
PE
12723 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12724 (xd_get_connection_references): Return ptrdiff_t, not int.
12725 All uses changed.
12726 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12727 (xd_read_message_1):
12728 Use int, not unsigned, where the dbus API uses int.
12729 (Fdbus_message_internal): Don't overflow mtype.
12730 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
12731 * dired.c (directory_files_internal, file_name_completion, scmp)
12732 (file_name_completion_stat):
12733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12734 (file_name_completion): Don't overflow matchcount.
12735 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12736 * dispextern.h: Adjust decls to match defn changes elsewhere.
12737 (struct text_pos, struct glyph, struct bidi_saved_info)
12738 (struct bidi_string_data, struct bidi_it, struct composition_it)
12739 (struct it):
12740 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12741 (struct display_pos, struct composition_it, struct it):
12742 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12743 * dispnew.c (increment_matrix_positions)
12744 (increment_row_positions, mode_line_string)
12745 (marginal_area_string):
12746 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 12747 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
12748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12749 (duration_to_sec_usec): New function, to check for overflow better.
12750 (Fsleep_for, sit_for): Use it.
12751 * doc.c (get_doc_string, store_function_docstring):
12752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12753 (get_doc_string, Fsnarf_documentation):
12754 Use int, not EMACS_INT, where int is wide enough.
12755 (get_doc_string):
12756 Use SAFE_ALLOCA, not alloca.
12757 Check for overflow when converting EMACS_INT to off_t.
12758 * doprnt.c (doprnt):
12759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12760 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12761 Don't assume uid_t fits into fixnum.
12762 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12763 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12764 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12765 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12766 (general_insert_function)
12767 (Finsert_char, make_buffer_string, make_buffer_string_both)
12768 (update_buffer_properties, Fbuffer_substring)
12769 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12770 (Fsubst_char_in_region, check_translation)
12771 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12772 (transpose_markers, Ftranspose_regions):
12773 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12774 (clip_to_bounds): Move to lisp.h as an inline function).
12775 (Fconstrain_to_field): Don't assume integers are nonnegative.
12776 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12777 (Fsubst_char_in_region, Fsave_restriction):
12778 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12779 (Femacs_pid): Don't assume pid_t fits into fixnum.
12780 (lo_time): Use int, not EMACS_INT, when int suffices.
12781 (lisp_time_argument): Check for usec out of range.
12782 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
12783 (Fuser_login_name, Fuser_full_name): Signal an error
12784 if a uid argument is out of range, rather than relying on
12785 undefined behavior.
c8d5c857
PE
12786 (Fformat_time_string): Remove now-unnecessary check.
12787 lisp_time_argument checks for out-of-range usec now.
243e0530 12788 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
12789 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12790 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12791 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12792 (init_cmdargs, Fdump_emacs):
12793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12794 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12795 the bottom (typically) 32 bits of the fixnum.
12796 * eval.c (specpdl_size, call_debugger):
12797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12798 (when_entered_debugger, Fbacktrace_debug):
12799 Don't assume fixnum can fit in int.
12800 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12801 the object just before a buffer; this is not portable.
12802 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12803 (grow_specpdl, unbind_to):
12804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12805 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12806 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 12807 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
12808 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12809 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12810 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12811 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12812 (a_write, e_write):
12813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12814 (Fcopy_file, non_regular_nbytes, read_non_regular)
12815 (Finsert_file_contents):
12816 Use int, not EMACS_INT, where int is wide enough.
12817 (READ_BUF_SIZE): Verify that it fits in int.
12818 (Finsert_file_contents): Check that counts are in proper range,
12819 rather than assuming fixnums fit into ptrdiff_t etc.
12820 Don't assume fixnums fit into int.
125b3835 12821 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
12822 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12823 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
12824 (string_char_to_byte, string_byte_to_char)
12825 (string_make_multibyte, string_to_multibyte)
12826 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12827 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12828 (substring_both, Fdelete, internal_equal, Ffillarray)
12829 (Fclear_string, mapcar1)
12830 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12831 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12832 (larger_vector, make_hash_table, maybe_resize_hash_table)
12833 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12834 (Fmaphash, secure_hash):
12835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12836 (concat): Check for string index and length overflow.
12837 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12838 (Frequire):
12839 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12840 (larger_vector): New API (vec, incr_min, size_max) replaces old
12841 one (vec, new_size, init). This catches size overflow.
12842 INIT was removed because it was always Qnil.
12843 All callers changed.
12844 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12845 the upper bound on a hash table index size.
12846 (make_hash_table, maybe_resize_hash_table): Use it.
12847 (secure_hash): Computer start_byte and end_byte only after
12848 they're known to be in ptrdiff_t range.
12849 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12850 (Ffont_get_glyphs, Ffont_at):
12851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12852 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12853 (Flist_fonts, Fopen_font):
12854 Don't assume fixnum can fit in int.
12855 (check_gstring): Don't assume index can fit in int.
12856 (font_match_p): Check that fixnum is a character, not a nonnegative
12857 fixnum, since the later code needs to stuff it into an int.
12858 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12859 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12860 conversion overflow issues.
12861 (Fopen_font): Check for integer out of range.
12862 (Ffont_get_glyphs): Don't assume index can fit in int.
12863 * font.h: Adjust decls to match defn changes elsewhere.
12864 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12865 integer overflow.
12866 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12867 printmax_t, where ptrdiff_t is wide enough.
12868 (Finternal_char_font):
12869 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12870 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12871 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12872 (Fset_frame_position, x_set_frame_parameters)
12873 (x_set_line_spacing, x_set_border_width)
12874 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12875 Check that fixnums are in proper range for system types.
12876 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12877 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12878 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12879 Use SAFE_ALLOCA_LISP, not alloca.
12880 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12881 intptr_t is wide enough.
12882 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12883 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12884 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12885 Check for fixnum out of range.
12886 * ftfont.c (ftfont_list): Don't assume index fits in int.
12887 Check that fixnums are in proper range for system types.
12888 (ftfont_shape_by_flt):
12889 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
12890 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12891 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12892 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12893 Check that fixnums are in proper range for system types.
12894 * gnutls.h: Adjust decls to match defn changes elsewhere.
12895 * gtkutil.c (xg_dialog_run):
12896 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12897 (update_frame_tool_bar):
12898 Check that fixnums are in proper range for system types.
12899 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 12900 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
12901 * indent.c (last_known_column, last_known_column_point):
12902 (current_column_bol_cache):
12903 (skip_invisible, current_column, check_display_width):
12904 (check_display_width, scan_for_column, current_column_1)
12905 (Findent_to, Fcurrent_indentation, position_indentation)
12906 (indented_beyond_p, Fmove_to_column, compute_motion):
12907 (Fcompute_motion, Fvertical_motion):
12908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12909 (last_known_column_modified): Use EMACS_INT, not int.
12910 (check_display_width):
12911 (Fcompute_motion):
12912 Check that fixnums and floats are in proper range for system types.
12913 (compute_motion): Don't assume index or fixnum fits in int.
12914 (compute_motion, Fcompute_motion):
12915 Use int, not EMACS_INT, when it is wide enough.
12916 (vmotion): Omit local var start_hpos that is always 0; that way
12917 we don't need to worry about overflow in expressions involving it.
12918 * indent.h: Adjust decls to match defn changes elsewhere.
12919 (struct position):
12920 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12921 Use int, not EMACS_INT, where int is wide enough.
12922 Remove unused members ovstring_chars_done and tab_offset;
12923 all uses removed.
12924 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12925 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12926 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12927 (make_gap, copy_text, insert, insert_and_inherit)
12928 (insert_before_markers, insert_before_markers_and_inherit)
12929 (insert_1, count_combining_before, count_combining_after)
12930 (insert_1_both, insert_from_string)
12931 (insert_from_string_before_markers, insert_from_string_1)
12932 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12933 (adjust_after_replace, adjust_after_insert, replace_range)
12934 (replace_range_2, del_range, del_range_1, del_range_byte)
12935 (del_range_both, del_range_2, modify_region)
12936 (prepare_to_modify_buffer, signal_before_change)
12937 (signal_after_change, Fcombine_after_change_execute):
12938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12939 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12940 (balance_an_interval, split_interval_right, split_interval_left)
12941 (find_interval, next_interval, update_interval)
12942 (adjust_intervals_for_insertion, delete_node, delete_interval)
12943 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12944 (static_offset_intervals, offset_intervals)
12945 (merge_interval_right, merge_interval_left, make_new_interval)
12946 (graft_intervals_into_buffer, temp_set_point_both)
12947 (temp_set_point, set_point, adjust_for_invis_intang)
12948 (set_point_both, move_if_not_intangible, get_property_and_range)
12949 (get_local_map, copy_intervals, copy_intervals_to_string)
12950 (compare_string_intervals, set_intervals_multibyte_1):
12951 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12952 * intervals.h: Adjust decls to match defn changes elsewhere.
12953 (struct interval):
12954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12955 * keyboard.c (this_command_key_count, this_single_command_key_start)
12956 (before_command_key_count, before_command_echo_length, echo_now)
12957 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12958 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12959 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12960 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12961 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12962 (last_non_minibuf_size, last_point_position, echo_truncate)
12963 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12964 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12965 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12966 (stuff_buffered_input):
12967 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12968 (last_auto_save, command_loop_1, read_char):
12969 Use EMACS_INT, not int, to avoid integer overflow.
12970 (record_char): Avoid overflow in total_keys computation.
12971 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12972 * keyboard.h: Adjust decls to match defn changes elsewhere.
12973 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12974 (Fkey_description, Fdescribe_vector, Flookup_key):
12975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12976 (click_position): New function, to check that positions are in range.
12977 (Fcurrent_active_maps):
12978 (describe_command):
12979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12980 (Faccessible_keymaps, Fkey_description):
12981 (preferred_sequence_p):
12982 Don't assume fixnum can fit into int.
12983 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12984 Check for integer overflow in size calculations.
12985 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12986 avoid mishandling large integers.
12987 * lisp.h: Adjust decls to match defn changes elsewhere.
12988 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12989 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12990 (struct Lisp_Marker):
12991 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12992 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
12993 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12994 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12995 All callers changed.
12996 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12997 Assume the arg has valid form, since it always does.
12998 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12999 unsigned integer system type.
13000 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13001 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13002 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13003 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13004 (duration_to_sec_usec): New decl.
13005 * lread.c (read_from_string_index, read_from_string_index_byte)
13006 (read_from_string_limit, readchar, unreadchar, openp)
13007 (read_internal_start, read1, oblookup):
13008 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13009 (Fload, readevalloop, Feval_buffer, Feval_region):
13010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13011 (openp): Check for out-of-range argument to 'access'.
13012 (read1): Use int, not EMACS_INT, where int is wide enough.
13013 Don't assume fixnum fits into int.
6efdadfd 13014 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
13015 (read_filtered_event): Use duration_to_sec_usec
13016 to do proper overflow checking on durations.
d311d28c
PE
13017 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13018 in size calculation.
13019 (Fexecute_kbd_macro):
13020 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13021 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13022 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13023 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13024 (set_marker_both, set_marker_restricted_both, marker_position)
13025 (marker_byte_position, Fbuffer_has_markers_at):
13026 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13027 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 13028 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
13029 It now merely ensures that the menu is large enough, without
13030 necessarily growing it, as this avoids some integer overflow issues.
13031 All callers changed.
13032 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13033 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13034 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13035 Use SAFE_ALLOCA_LISP, not alloca.
13036 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13037 to EMACS_INT. Check that fixnums are in proper range for system types.
13038 * minibuf.c (minibuf_prompt_width, string_to_object)
13039 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13040 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13041 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13042 (get_minibuffer, read_minibuf_unwind):
13043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13044 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13045 this simplifies overflow checking. All callers changed.
13046 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13047 (Ftest_completion):
13048 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13049 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13050 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13051 Check that fixnums are in proper range for system types.
13052 (Fx_create_frame, Fx_show_tip):
13053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13054 * nsfont.m (ns_findfonts, nsfont_list_family):
13055 Don't assume fixnum fits in long.
13056 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13057 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13058 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13059 wide enough.
17fdb222 13060 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
13061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13062 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13063 (PRINTDECLARE, PRINTPREPARE):
13064 (strout, print_string):
13065 (print, print_preprocess, print_check_string_charset_prop)
13066 (print_object):
13067 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13068 (PRINTDECLARE):
13069 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13070 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13071 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 13072 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 13073 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
13074 (print_error_message): Use SAFE_ALLOCA, not alloca.
13075 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
13076 (print_depth, new_backquote_output, print_number_index):
13077 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
13078 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13079 (Fset_process_window_size, Fformat_network_address)
13080 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 13081 (sigchld_handler):
d311d28c 13082 Check that fixnums are in proper range for system types.
d44287d4 13083 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
13084 Check for process-ids out of pid_t range rather than relying on
13085 undefined behavior.
e4d81efc 13086 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
13087 (Fformat_network_address, read_process_output, send_process)
13088 (Fprocess_send_region, status_notify):
13089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13090 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13091 (wait_reading_process_output, read_process_output, exec_sentinel):
13092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13093 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13094 (Faccept_process_output): Use duration_to_sec_usec to do proper
13095 overflow checking on durations.
dde14581
PE
13096 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13097 Don't assume pid_t fits in int.
02481186
PE
13098 * process.h (struct Lisp_Process): Members tick and update_tick
13099 are now of type EMACS_INT, not int.
b62b53e8
PE
13100 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13101 configured --with-wide-int.
d311d28c
PE
13102 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13103 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13104 * search.c (looking_at_1, string_match_1):
13105 (fast_string_match, fast_c_string_match_ignore_case)
13106 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13107 (scan_newline, find_before_next_newline, search_command)
13108 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13109 (set_search_regs, wordify):
13110 (Freplace_match):
13111 (Fmatch_data):
13112 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13113 (string_match_1, search_buffer, set_search_regs):
13114 (Fmatch_data):
13115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13116 (wordify): Check for overflow in size calculation.
13117 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13118 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13119 Check that fixnums are in proper range for system types.
13120 * sound.c (struct sound_device)
13121 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13122 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13123 (Fplay_sound_internal):
13124 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 13125 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
13126 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13127 (Fparse_partial_sexp):
13128 Don't assume fixnums can fit in int.
13129 (struct lisp_parse_state, find_start_pos, find_start_value)
13130 (find_start_value_byte, find_start_begv)
13131 (update_syntax_table, char_quoted, dec_bytepos)
13132 (find_defun_start, prev_char_comend_first, back_comment):
13133 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13134 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13135 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13136 (Finternal_describe_syntax_value): Check that match_lisp is a
13137 character, not an integer, since the code stuffs it into int.
13138 (scan_words, scan_sexps_forward):
13139 Check that fixnums are in proper range for system types.
13140 (Fforward_word):
13141 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13142 (scan_sexps_forward):
13143 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13144 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13145 * syntax.h: Adjust decls to match defn changes elsewhere.
13146 (struct gl_state_s):
13147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
13148 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13149 MOST_POSITIVE_FIXNUM.
d311d28c
PE
13150 * sysdep.c (wait_for_termination_1, wait_for_termination)
13151 (interruptible_wait_for_termination, mkdir):
13152 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13153 (emacs_read, emacs_write):
13154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
13155 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13156 and double all fit in int.
d311d28c
PE
13157 * term.c (set_tty_color_mode):
13158 Check that fixnums are in proper range for system types.
13159 * termhooks.h (struct input_event):
13160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13161 * textprop.c (validate_interval_range, interval_of)
13162 (Fadd_text_properties, set_text_properties_1)
13163 (Fremove_text_properties, Fremove_list_of_text_properties)
13164 (Ftext_property_any, Ftext_property_not_all)
13165 (copy_text_properties, text_property_list, extend_property_ranges)
13166 (verify_interval_modification):
13167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13168 (Fnext_single_char_property_change)
13169 (Fprevious_single_char_property_change):
13170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
13171 (copy_text_properties):
13172 Check for integer overflow in index calculation.
d311d28c
PE
13173 * undo.c (last_boundary_position, record_point, record_insert)
13174 (record_delete, record_marker_adjustment, record_change)
13175 (record_property_change):
13176 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13177 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13178 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13179 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13180 (Fx_hide_tip, Fx_file_dialog):
13181 * w32menu.c (set_frame_menubar):
13182 Use ptrdiff_t, not int, for consistency with rest of code.
13183 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13184 (select_window, Fdelete_other_windows_internal)
13185 (window_scroll_pixel_based, window_scroll_line_based)
13186 (Frecenter, Fset_window_configuration):
13187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13188 (Fset_window_hscroll, run_window_configuration_change_hook)
13189 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 13190 (Fscroll_other_window, Frecenter):
d311d28c
PE
13191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13192 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13193 Don't assume fixnum fits in int.
13194 (Fset_window_scroll_bars):
13195 Check that fixnums are in proper range for system types.
13196 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13197 (string_pos, c_string_pos, number_of_chars, init_iterator)
13198 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13199 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13200 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
13201 (face_before_or_after_it_pos, handle_invisible_prop)
13202 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
13203 (display_prop_intangible_p, string_buffer_position_lim)
13204 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13205 (get_overlay_strings_1, get_overlay_strings)
13206 (iterate_out_of_display_property, forward_to_next_line_start)
13207 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13208 (get_next_display_element, set_iterator_to_next)
13209 (get_visually_first_element, compute_stop_pos_backwards)
13210 (handle_stop_backwards, next_element_from_buffer)
13211 (move_it_in_display_line_to, move_it_in_display_line)
13212 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13213 (add_to_log, message_dolog, message_log_check_duplicate)
13214 (message2, message2_nolog, message3, message3_nolog
13215 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13216 (current_message_1, truncate_echo_area, truncate_message_1)
13217 (set_message, set_message_1, store_mode_line_noprop)
13218 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13219 (text_outside_line_unchanged_p, check_point_in_composition)
13220 (reconsider_clip_changes)
13221 (redisplay_internal, set_cursor_from_row, try_scrolling)
13222 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13223 (redisplay_window, find_last_unchanged_at_beg_row)
13224 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13225 (trailing_whitespace_p, find_row_edges, display_line)
13226 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13227 (display_mode_element, store_mode_line_string)
13228 (pint2str, pint2hrstr, decode_mode_spec)
13229 (display_count_lines, display_string, draw_glyphs)
13230 (x_produce_glyphs, x_insert_glyphs)
13231 (rows_from_pos_range, mouse_face_from_buffer_pos)
13232 (fast_find_string_pos, mouse_face_from_string_pos)
13233 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13235 (safe_call, init_from_display_pos, handle_fontified_prop)
13236 (handle_single_display_spec, load_overlay_strings)
13237 (with_echo_area_buffer, setup_echo_area_for_printing)
13238 (display_echo_area, echo_area_display)
13239 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13240 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
13241 (redisplay_window, dump_glyph_row, display_mode_line)
13242 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 13243 (handle_display_spec, display_prop_string_p):
d311d28c
PE
13244 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13245 (handle_single_display_spec, build_desired_tool_bar_string)
13246 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13247 (get_specified_cursor_type):
13248 Check that fixnums are in proper range for system types.
13249 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13250 (Flookup_image_map):
13251 Don't assume fixnums fit in int.
13252 (compare_overlay_entries):
13253 Avoid mishandling comparisons due to subtraction overflow.
13254 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13255 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13256 (handle_tool_bar_click):
13257 Use int, not unsigned, since we prefer signed and the signedness
13258 doesn't matter here.
13259 (get_next_display_element, next_element_from_display_vector):
13260 Use int, not EMACS_INT, when int is wide enough.
13261 (start_hourglass): Use duration_to_sec_usec to do proper
13262 overflow checking on durations.
13263 * xfaces.c (Fbitmap_spec_p):
13264 Check that fixnums are in proper range for system types.
13265 (compare_fonts_by_sort_order):
13266 Avoid mishandling comparisons due to subtraction overflow.
13267 (Fx_family_fonts, realize_basic_faces):
13268 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13269 (Fx_family_fonts):
13270 Don't assume fixnum fits in int.
13271 Use SAFE_ALLOCA_LISP, not alloca.
13272 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13273 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13274 (face_at_buffer_position, face_for_overlay_string)
13275 (face_at_string_position):
13276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13277 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13278 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13279 (Fx_show_tip):
13280 Check that fixnums are in proper range for system types.
13281 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13282 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13283 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13284 (Fx_change_window_property): Don't assume fixnums fit in int.
13285 * xfont.c (xfont_chars_supported):
13286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13287 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13288 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13289 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13290 * xml.c (parse_region):
13291 * xrdb.c (magic_file_p):
13292 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13293 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13294 (x_get_local_selection, x_reply_selection_request)
13295 (x_handle_selection_request, wait_for_property_change):
13296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13297 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13298 short is wide enough.
13299 (x_send_client_event): Don't assume fixnum fits in int.
13300 * xterm.c (x_x_to_emacs_modifiers):
13301 Don't assume EMACS_INT overflows nicely into int.
13302 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13303 may come from Lisp.
13304 (handle_one_xevent): NATNUMP can eval its arg twice.
13305 (x_connection_closed):
13306 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13307 * xterm.h: Adjust decls to match defn changes elsewhere.
13308 (struct scroll_bar): Use struct vectorlike_header
13309 rather than rolling our own approximation.
13310 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13311
c6574eb5
GM
133122012-05-25 Glenn Morris <rgm@gnu.org>
13313
13314 * lisp.mk (lisp): Update for more files being compiled now.
13315
e8d32c7e
SM
133162012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13317
48def666
SM
13318 * lread.c: Remove `read_pure' which makes no difference.
13319 (read_pure): Remove var.
13320 (unreadpure): Remove function.
13321 (readevalloop): Don't call read_list with -1 flag.
13322 (read1, read_vector): Don't test read_pure any more.
13323 (read_list): Simplify.
13324
e8d32c7e
SM
13325 * fileio.c, character.h: Minor style tweaks.
13326
4b2addb7
DA
133272012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13328
13329 * window.h (clip_changed): Remove useless declaration.
13330
584461b2
JB
133312012-05-22 Juanma Barranquero <lekktu@gmail.com>
13332
13333 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13334 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13335
34374650
PE
133362012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13337
13338 Remove src/m/*.
13339 This directory predates autoconf and is no longer needed nowadays.
13340 Move its few remaining bits of functionality to where they're needed.
13341 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13342 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13343 * m/template.h: Remove.
13344 * Makefile.in (M_FILE): Remove. All uses removed.
13345 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13346 * lisp.h (USE_LSB_TAG):
13347 * mem-limits.h (EXCEEDS_LISP_PTR):
13348 Use VAL_MAX, not VALBITS, in #if.
13349 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13350 (EMACS_UINT): Define unconditionally now.
13351 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13352 (BITS_PER_EMACS_INT): New constants, replacing
13353 what used to be in config.h, but not useful in #if.
13354 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13355 define them any more.
13356 (VAL_MAX): New macro.
13357 (VALMASK): Use it.
13358 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13359 BITS_PER_EMACS_INT, in #if.
13360 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13361 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13362 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13363 * s/ms-w32.h (DATA_START):
13364 Move here from removed file m/intel386.h.
13365 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13366 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13367
261cb4bb
PE
133682012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13369
13370 Assume C89 or later.
13371 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13372 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13373 (xrealloc):
13374 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13375 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13376 * textprop.c, tparam.c (NULL): Remove.
13377 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13378 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13379 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13380 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13381 * xterm.c (input_signal_count): Assume volatile works.
13382
ff23cd9f
KB
133832012-05-21 Ken Brown <kbrown@cornell.edu>
13384
13385 * xgselect.c (xg_select): Fix first argument in call to 'select'
13386 (bug#11508).
13387
1b170bc6
KB
133882012-05-20 Ken Brown <kbrown@cornell.edu>
13389
13390 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 13391 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 13392
b2f4d39f
KB
133932012-05-19 Ken Brown <kbrown@cornell.edu>
13394
13395 * xfns.c (x_in_use): Remove `static' qualifier.
13396 * xterm.h (x_in_use): Declare.
13397 * xgselect.c: Include xterm.h.
13398 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13399 and `display_arg' (bug#9754).
13400
003fdae2
PE
134012012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13402
9232a6d9
PE
13403 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13404
003fdae2
PE
13405 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13406 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13407
784b56e2
EZ
134082012-05-18 Eli Zaretskii <eliz@gnu.org>
13409
13410 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13411
13412 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 13413 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
13414
13415 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13416 reference to image_cache->refcount.
13417 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13418
a0a79cde
JL
134192012-05-17 Juri Linkov <juri@jurta.org>
13420
13421 * search.c (Fword_search_regexp, Fword_search_backward)
13422 (Fword_search_forward, Fword_search_backward_lax)
13423 (Fword_search_forward_lax): Move functions to isearch.el
13424 (bug#10145, bug#11381).
13425
b0572523
PE
134262012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13427
13428 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13429
9660f5fc
SM
134302012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13431
13432 * lread.c (init_obarray): Declare Qt and Qnil as special.
13433
4374de83
GM
134342012-05-14 Glenn Morris <rgm@gnu.org>
13435
13436 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 13437 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 13438
dc44c39a
PE
134392012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13440
078c97cb
PE
13441 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13442
dc44c39a
PE
13443 * unexaix.c: Port to more-recent AIX compilers.
13444 (report_error, report_error_1, make_hdr, copy_sym)
13445 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13446 Make arguments const char *, not char *, to avoid violations of C
13447 standard and to fix some AIX warnings reported by Gilles Pion.
13448
e18afed7 134492012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
13450
13451 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13452 already have overlays loaded.
13453 (handle_single_display_spec): Before returning without displaying
13454 fringe bitmap, synchronize the bidi iterator with the main display
13455 iterator, by calling iterate_out_of_display_property.
13456 (iterate_out_of_display_property): Detect buffer iteration by
13457 testing that it->string is a Lisp string.
13458 (get_next_display_element): When the current object is exhausted,
13459 and there's something on it->stack, call set_iterator_to_next to
13460 proceed with what's on the stack, instead of returning zero.
13461 (set_iterator_to_next): If called at the end of a Lisp string,
13462 proceed to consider_string_end without incrementing string
13463 position. Don't increment display vector index past the end of
13464 the display vector. (Bug#11417)
c8fb9dc6
EZ
13465 (pos_visible_p): Don't report a position visible when move_it_to
13466 stopped at the last line of window, which happens to be scanned
13467 backwards by the bidi iteration. (Bug#11464)
ac268e67 13468
e18afed7 134692012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
13470
13471 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13472 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
13473 are on a TTY, and thus unable to display on the fringes.
13474 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
13475 so we need to signal to the caller that this is a "replacing"
13476 display spec. This fixes display when the spec is invalid or we
13477 are on a TTY.
13478
e18afed7 134792012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
13480
13481 * unexaix.c (make_hdr): Fix typo in prototype.
13482 This bug broke the build on AIX. Problem reported by Gilles Pion.
13483
9d0a235a
MA
134842012-05-14 Michael Albinus <michael.albinus@gmx.de>
13485
13486 * keyboard.c (kbd_buffer_get_event): Read special events also in
13487 batch mode. (Bug#11415)
13488
9e6b06ed
GM
134892012-05-12 Glenn Morris <rgm@gnu.org>
13490
13491 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13492
c1a1d7a3
EZ
134932012-05-12 Eli Zaretskii <eliz@gnu.org>
13494
13495 * lisp.mk (lisp): Add newcomment.elc.
13496
3fe7cdc8
GM
134972012-05-12 Glenn Morris <rgm@gnu.org>
13498
13499 * Makefile.in (MKDIR_P): New, set by configure.
13500 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13501
53f7d2c0
PE
135022012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13503
13504 Remove unused function hourglass_started.
13505 * dispextern.h (hourglass_started):
13506 * w32fns.c (hourglass_started):
13507 * xdisp.c (hourglass_started): Remove.
13508
75aafb17
JB
135092012-05-10 Juanma Barranquero <lekktu@gmail.com>
13510
13511 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13512 Update dependencies.
13513
12959e8e
PE
135142012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13515
97107e2e
PE
13516 * xgselect.c (xg_select): Put maxfds+1 into a var.
13517 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13518
12959e8e
PE
13519 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13520
836d29b3
DA
135212012-05-10 Dave Abrahams <dave@boostpro.com>
13522
13523 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13524 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13525
5cb67954
MA
135262012-05-09 Michael Albinus <michael.albinus@gmx.de>
13527
13528 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 13529 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
13530 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13531 Initialize xd_registered_buses.
13532
3478ec45
PE
135332012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13534
b263a6b0
PE
13535 Untag more efficiently if USE_LSB_TAG.
13536 This is based on a proposal by YAMAMOTO Mitsuharu in
13537 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13538 For an admittedly artificial (nth 8000 longlist) benchmark on
13539 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13540 Emacs's overall text size by 1%.
13541 * lisp.h (XUNTAG): New macro.
13542 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13543 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13544 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13545 * eval.c (Fautoload):
13546 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13547 * frame.h (XFRAME): Use XUNTAG.
13548
3478ec45
PE
13549 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13550 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13551 Remove unportable assumptions about print widths of types like
13552 dbus_uint32_t.
13553 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13554 intptr_t when converting between pointer and integer, to avoid GCC
13555 warnings about wrong width.
13556
666b903b 135572012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
13558
13559 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13560 stack for each reader_thread, instead of defaulting to 8MB
13561 determined by the linker. This avoids failures in creating
13562 subprocesses on Windows 7, see the discussion in this thread:
13563 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13564
b120cc17
JC
135652012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13566
13567 Fix up display of the *Minibuf-0* buffer in the mini window.
13568 * keyboard.c (read_char): Don't clear the echo area if there's no
13569 message to clear.
13570 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 13571 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 13572
9a4b36f8
MA
135732012-05-07 Michael Albinus <michael.albinus@gmx.de>
13574
13575 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13576 batch mode.
13577
e5f9458f
CY
135782012-05-06 Chong Yidong <cyd@gnu.org>
13579
13580 * lisp.mk (lisp): Update.
13581
eceeb5fc 135822012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
13583
13584 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13585
71873e2b
SM
135862012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13587
13588 * data.c (PUT_ERROR): New macro.
13589 (syms_of_data): Use it. Add new error type `user-error'.
13590 * undo.c (user_error): New function.
13591 (Fprimitive_undo): Use it.
13592 * print.c (print_error_message): Adjust print style for `user-error'.
13593 * keyboard.c (user_error): New function.
13594 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13595
ab0fa4e4
PE
135962012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13597
13598 Do not limit current-time-string to years 1000..9999.
13599 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13600 (Fcurrent_time_string): Support any year that is supported by the
13601 underlying localtime representation. Don't use asctime, as it
13602 has undefined behavior for years outside the range -999..9999.
13603
7ed806a7
PE
136042012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13605
13606 Fix race conditions involving setenv, gmtime, localtime, asctime.
13607 Without this fix, interrupts could mess up code that uses these
13608 nonreentrant functions, since setting TZ invalidates existing
13609 tm_zone or tzname values, and since most of these functions return
13610 pointers to static storage.
13611 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13612 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13613 Grow the critical sections to include not just invoking
13614 localtime/gmtime, but also accessing these functions' results
13615 including their tm_zone values if any, and any related TZ setting.
13616 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
13617 so that the struct tm is saved in the critical section.
13618 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
13619 motivated by the fact that memory allocation needs to be outside
13620 the critical section.
13621
0c16dfed
DA
136222012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13623
13624 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13625 with RESET_INTERVAL.
13626
13627 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13628 Remove duplicated buffer name initialization.
13629
3f83ace8
JM
136302012-05-02 Jim Meyering <jim@meyering.net>
13631
13632 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13633
c7b8541e
JM
13634 * xfns.c (x_window): Use xstrdup (Bug#11375).
13635
90207a15 136362012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
13637
13638 * xdisp.c (pos_visible_p): If already at a newline from the
13639 display string before the 'while' loop, don't walk back the glyphs
13640 from it3.glyph_row. Solves assertion violation when the display
13641 string begins with a newline (egg.el). (Bug#11367)
13642
b593d6a9
AH
136432012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13644
13645 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13646 Move to simple.el.
13647
4737362e
GM
136482012-05-01 Glenn Morris <rgm@gnu.org>
13649
99cf43f9
GM
13650 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13651 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13652 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13653 All were removed before 23.1.
13654
9311dcff
GM
13655 * dispnew.c: Remove HAVE_LIBNCURSES test;
13656 it is always true on relevant platforms.
13657
4d5c6349
GM
13658 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13659 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13660
4737362e
GM
13661 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13662
74dd3a6b
AS
136632012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13664
13665 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13666 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13667 Remove.
13668
13c379ee
PE
136692012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13670
13671 Do not avoid creating empty evaporating overlays (Bug#9642).
13672 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13673 That is, do not delete an evaporating overlay if it becomes
13674 empty after its bounds are adjusted to fit within its buffer.
13675 This fix caused other problems, and I'm reverting it until we get
13676 to the bottom of them.
13677
a8e7d6d7 136782012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
13679
13680 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13681
a8e7d6d7 136822012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
13683
13684 * xdisp.c (pos_visible_p): If the window start position is beyond
13685 ZV, start the display from buffer beginning. Prevents assertion
13686 violation in init_iterator when the minibuffer window is scrolled
13687 via the scroll bar.
13688
13689 * window.c (window_scroll_pixel_based): Likewise.
13690
a8e7d6d7 136912012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
13692
13693 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13694
a8e7d6d7 136952012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
13696
13697 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13698 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13699
a8e7d6d7 137002012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 13701
b593d6a9
AH
13702 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13703 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 13704
1c6900d9
EZ
137052012-04-26 Eli Zaretskii <eliz@gnu.org>
13706
4c3fa1d9
EZ
13707 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13708 display element, check also the underlying string or buffer
13709 character. (Bug#11341)
13710
1c6900d9
EZ
13711 * w32menu.c: Include w32heap.h.
13712 (add_menu_item): If the call to AppendMenuW (via
13713 unicode_append_menu) fails, disable Unicode menus only if we are
13714 running on Windows 9X/Me.
13715
42bf8205
AS
137162012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13717
13718 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13719 (xgetint): Add missing shift for LSB tags.
13720
b1bac16e
MR
137212012-04-24 Martin Rudalics <rudalics@gmx.at>
13722
13723 * keyboard.c (read_char): Don't wipe echo area for select window
13724 events: These might get delayed via `mouse-autoselect-window'
13725 (Bug#11304).
13726
d69621cc
JB
137272012-04-24 Juanma Barranquero <lekktu@gmail.com>
13728
13729 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13730 manipulation of :loaded-from data.
13731
02fd101b
JB
137322012-04-23 Juanma Barranquero <lekktu@gmail.com>
13733
13734 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13735 now a cons (bug#11311).
13736
888bec30
PE
137372012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13738
89a438bd
PE
13739 Do not create empty overlays with the evaporate property (Bug#9642).
13740 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13741 if it becomes empty after its bounds are adjusted to fit within
13742 its buffer. Without this fix, in a nonempty buffer (let ((o
13743 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13744 yields an empty overlay that has the evaporate property, which is
13745 not supposed to happen.
13746
1068fe4d
PE
13747 Fix minor GTK3 problems found by static checking.
13748 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13749 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13750 (struct _EmacsFixedClass, emacs_fixed_get_type):
13751 Move decls here from emacsgtkfixed.h, since they needn't be public.
13752 (emacs_fixed_get_type): Now static.
13753 (emacs_fixed_class_init): Omit unused local.
13754 (emacs_fixed_child_type): Remove; unused.
13755 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13756 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13757 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13758 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13759 (EMACS_FIXED_GET_CLASS): Remove; unused.
13760 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13761
888bec30
PE
13762 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13763 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13764
de85e130
PE
137652012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13766
d0baac98 13767 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 13768 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
13769 (__malloc_size_t, __malloc_ptrdiff_t):
13770 Remove. All uses removed, replaced by the definiens if needed,
13771 since we can assume C89 or better now.
13772 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13773 (protect_malloc_state, align, get_contiguous_space)
13774 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13775 (malloc_atfork_handler_child, malloc_enable_thread)
13776 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13777 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13778 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13779 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13780 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13781 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13782 Define using prototypes, not old style.
13783 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13784 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13785 (align): Don't assume that signed integer overflow wraps around.
13786 Omit unused local var.
13787 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13788 (_free_internal_nolock, memalign, mallochook, reallochook):
13789 Omit no-longer-needed casts.
13790 (valloc): Use getpagesize, not __getpagesize.
13791 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13792 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13793
de85e130
PE
13794 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13795
dcbf5805
MA
137962012-04-22 Michael Albinus <michael.albinus@gmx.de>
13797
13798 Move functions from C to Lisp. Make non-blocking method calls
13799 the default. Implement further D-Bus standard interfaces.
13800
13801 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13802 (QCdbus_request_name_allow_replacement)
13803 (QCdbus_request_name_replace_existing)
13804 (QCdbus_request_name_do_not_queue)
13805 (QCdbus_request_name_reply_primary_owner)
13806 (QCdbus_request_name_reply_in_queue)
13807 (QCdbus_request_name_reply_exists)
13808 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13809 (QCdbus_registered_serial, QCdbus_registered_method)
13810 (QCdbus_registered_signal): New Lisp objects.
13811 (XD_DEBUG_MESSAGE): Use sizeof.
13812 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13813 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13814 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13815 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13816 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13817 (xd_signature, xd_append_arg): Allow float for integer types.
13818 (xd_get_connection_references): New function.
b593d6a9
AH
13819 (xd_get_connection_address): Rename from xd_initialize.
13820 Return cached address.
dcbf5805
MA
13821 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13822 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13823 level.
13824 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 13825 Return number of refcounts.
dcbf5805
MA
13826 (Fdbus_get_unique_name): Make stronger parameter check.
13827 (Fdbus_message_internal): New defun.
13828 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13829 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13830 (Fdbus_send_signal, Fdbus_register_service)
13831 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13832 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13833 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13834 (Vdbus_compiled_version, Vdbus_runtime_version)
13835 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13836 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13837 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
13838 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13839 Adapt docstring.
dcbf5805 13840
52828e02
PE
138412012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13842
da05bc4c
PE
13843 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13844 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13845 Do not assume ptrdiff_t is the same width as 'int'.
13846
52828e02
PE
13847 * alloc.c: Handle unusual debugging option combinations.
13848 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13849 since the two debugging options are incompatible.
13850 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13851 is defined.
13852 (mem_init, mem_insert, mem_insert_fixup):
13853 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13854 (NEED_MEM_INSERT): Remove; no longer needed.
13855
f01769f9
LL
138562012-04-22 Leo Liu <sdl.web@gmail.com>
13857
13858 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13859
5790543d
PE
138602012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13861
13862 * sysdep.c [__FreeBSD__]: Minor cleanups.
13863 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13864 Use Emacs indenting style more consistently. Avoid some casts.
13865 Use 'double' consistently rather than mixing 'float' and 'double'.
13866
b91b7e4d
EW
138672012-04-21 Eduard Wiebe <usenet@pusto.de>
13868
b593d6a9
AH
13869 * sysdep.c (list_system_processes, system_process_attributes):
13870 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 13871
6114eb15
AS
138722012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13873
13874 * lisp.mk (lisp): Update.
13875
2f38dff7
PE
138762012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13877
13878 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13879 It is never used otherwise.
13880
4ae29f89
SM
138812012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13882
13883 * print.c (print_preprocess): Only check print_depth if print-circle
13884 is nil.
13885 (print_object): Check for cycles even when print-circle is nil and
13886 print-gensym is t, but only check print_depth if print-circle is nil.
13887
f30d612a
CY
138882012-04-20 Chong Yidong <cyd@gnu.org>
13889
13890 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13891 set the status to "failed" and ensure that sentinel is run.
13892
c07a4c0b 138932012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
13894
13895 * process.c (Fset_process_inherit_coding_system_flag)
13896 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 13897 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 13898
c07a4c0b 138992012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
13900
13901 * xdisp.c (string_buffer_position_lim): Limit starting position to
13902 BEGV.
13903 (set_cursor_from_row): If called for a mode-line or header-line
13904 row, return zero immediately.
13905 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
13906 farther than the first row after the header line, if any.
13907 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
13908 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13909
c07a4c0b 139102012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13911
4ae29f89
SM
13912 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13913 (bug#11238).
ad3a2b41 13914
c07a4c0b 139152012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 139162012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
13917
13918 configure: new option --enable-gcc-warnings (Bug#11207)
13919 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13920 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13921 (ALL_CFLAGS): Use new macros rather than old.
13922 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13923 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13924 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13925 -Wunused-result, -Wunused-variable. This should go away once
13926 the Emacs and Gnulib regex code is merged.
13927 (xmalloc, xrealloc): Now static.
13928
aba027e8
PE
139292012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13930
13931 * dired.c (Fsystem_groups): Remove unused local.
13932
e5a36063
GM
139332012-04-17 Glenn Morris <rgm@gnu.org>
13934
13935 * dired.c (Fsystem_users): Doc fix.
13936
316411f0
DA
139372012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13938
13939 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13940 (syms_of_dired): Add them.
13941
9426aba4
PE
139422012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13943
b62a57be
PE
13944 Fix minor alloc.c problems found by static checking.
13945 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13946 New extern decls, to avoid calling undeclared functions.
13947 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13948 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13949 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13950 (NEED_MEM_INSERT): New macro.
13951 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 13952 Remove one incorrect comment and fix another.
b62a57be 13953
3539f31f
PE
13954 Fix minor ralloc.c problems found by static checking.
13955 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13956 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13957 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13958 (r_alloc_sbrk): Now static.
13959
a041960a
PE
13960 Improve ralloc.c interface checking.
13961 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13962 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13963 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13964 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13965 [REL_ALLOC]: ... to here, to check interface.
13966 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13967 Remove decls. This fixes an "It stinks!".
13968
9426aba4
PE
13969 * alloc.c (which_symbols): Fix alignment issue / type clash.
13970
d55c12ed
AS
139712012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13972
13973 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13974 (struct Lisp_Misc_Any): Likewise.
13975 (struct Lisp_Free): Likewise.
13976 * alloc.c (union aligned_Lisp_Symbol): Define.
13977 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13978 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13979 (union aligned_Lisp_Misc): Define.
13980 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13981 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 13982 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 13983
b948ce8b
PE
139842012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13985
13986 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13987 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13988 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13989 * s/netbsd.h, s/sol2-6.h:
13990 Remove definition of GC_MARK_STACK, since the default now works.
13991 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13992 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13993 no longer the default.
13994 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13995
35dc09a1 139962012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13997
35dc09a1
GM
13998 * lread.c (lisp_file_lexically_bound_p):
13999 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 14000
35dc09a1
GM
140012012-04-14 Eli Zaretskii <eliz@gnu.org>
14002
14003 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14004 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14005
140062012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14007
14008 * nsterm.m (constrainFrameRect): Always constrain when there is only
14009 one screen (Bug#10962).
14010
bcd86815
KB
140112012-04-13 Ken Brown <kbrown@cornell.edu>
14012
14013 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14014
c25df26e
RT
140152012-04-13 Reuben Thomas <rrt@sc3d.org>
14016
14017 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14018
0fc59f1e
DC
140192012-04-11 Daniel Colascione <dancol@dancol.org>
14020
14021 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14022 against is gone. It's better to use vfork now so that when Cygwin
14023 gains a new, working vfork, we use it automatically (bug#10398).
14024
de8c03dc
SM
140252012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14026
14027 * window.c (save_window_save): Obey window-point-insertion-type.
14028
2f097256
GM
140292012-04-11 Glenn Morris <rgm@gnu.org>
14030
14031 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14032
453b951e
SM
140332012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14034
14035 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14036
75f1671a 140372012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
14038
14039 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14040 (force_quit_count): New var.
14041 (handle_interrupt): Use it.
14042
2a8ce227
JB
140432012-04-10 Juanma Barranquero <lekktu@gmail.com>
14044
14045 * w32.c (w32_delayed_load): Record the full path of the library
14046 being loaded (bug#10424).
14047
935396c0
GM
140482012-04-09 Glenn Morris <rgm@gnu.org>
14049
05920a43
GM
14050 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14051 not just in the obarray, before snarfing them. (Bug#11036)
14052
935396c0
GM
14053 * Makefile.in ($(leimdir)/leim-list.el):
14054 Pass EMACS rather than BUILT_EMACS.
14055
a18ecafa
TZ
140562012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14057
14058 * process.c (make_process):
14059 * process.h: Add integer `gnutls_handshakes_tried' member to
14060 process struct.
14061
6bbef4e5
JC
14062 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14063 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
14064
14065 * gnutls.c (gnutls_log_function2i): Convenience log function.
14066 (emacs_gnutls_read): Use new log functions,
14067 `gnutls_handshakes_tried' process member, and
14068 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14069 attempts per process (connection).
14070
b4d3bc10
CY
140712012-04-09 Chong Yidong <cyd@gnu.org>
14072
14073 * eval.c (Fuser_variable_p, user_variable_p_eh)
14074 (lisp_indirect_variable): Functions deleted.
14075 (Fdefvar): Caller changed.
14076
14077 * callint.c (Finteractive, Fcall_interactively):
14078 * minibuf.c (Fread_variable): Callers changed.
14079
70f4d973
EZ
140802012-04-09 Eli Zaretskii <eliz@gnu.org>
14081
14082 * xdisp.c (set_cursor_from_row): If the display string appears in
14083 the buffer at position that is closer to point than the position
14084 after the display string, display the cursor on the first glyph of
14085 the display string. Fixes cursor display when a 'display' text
14086 property immediately follows invisible text. (Bug#11094)
14087
cb3c2e3e
PE
140882012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14089
14090 composite.c: use 'double' consistently
14091 * composite.c (get_composition_id): Use 'double' consistently
14092 instead of converting 'float' to 'double' and vice versa; this is
14093 easier to understand and avoids a GCC warning.
14094
fd06db5d
GM
140952012-04-09 Glenn Morris <rgm@gnu.org>
14096
50fe702a
GM
14097 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14098 preparation for dumping it with emacs. (Bug#4789)
14099 (leimdir): New variable.
14100 ($(leimdir)/leim-list.el): New rule.
14101 (emacs$(EXEEXT)): Depend on leim-list.el.
14102
fd06db5d
GM
14103 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14104 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14105 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14106
55c131ee
AS
141072012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14108
14109 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14110 proper alignment.
14111
9209588f
JB
141122012-04-07 Juanma Barranquero <lekktu@gmail.com>
14113
14114 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14115 Remove unused local variable.
14116
e3fb2efb
PE
141172012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14118
14119 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14120 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14121 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14122 objects, as mark_maybe_pointer will catch them otherwise.
14123 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14124 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14125
b5385551
PE
141262012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14127
14128 Fix typo that broke non-Windows builds.
14129 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14130
9078ead6
EZ
141312012-04-07 Eli Zaretskii <eliz@gnu.org>
14132
14133 Support building on MS-Windows with libxml2.
14134
14135 * makefile.w32-in (OBJ2): Add xml.$(O).
14136 (GLOBAL_SOURCES): Add xml.c.
14137 ($(BLD)/xml.$(O)): New dependency list.
14138
14139 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14140 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14141 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14142 [!WINDOWSNT]: New macros.
14143 (init_libxml2_functions, libxml2_loaded_p): New functions.
14144 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14145 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14146 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14147 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14148 linked in).
6bbef4e5
JC
14149 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14150 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
14151 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14152
14153 * emacs.c: Don't include libxml/parser.h.
14154 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14155 xmlCleanupParser directly.
14156
14157 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14158
3811fdf3
EZ
141592012-04-07 Eli Zaretskii <eliz@gnu.org>
14160
14161 * indent.c (Fvertical_motion): If there is a display string at
14162 point, use it.vpos to compute how many lines to backtrack after
14163 move_it_to point. (Bug#11133)
14164
2f8e16b2
EZ
141652012-04-06 Eli Zaretskii <eliz@gnu.org>
14166
14167 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14168 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14169 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14170 macros related to unification of CJK characters. For the details,
14171 see the discussion following the message here:
14172 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14173
3d439cd1
CY
141742012-04-04 Chong Yidong <cyd@gnu.org>
14175
14176 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14177
8bc53d00
EZ
141782012-04-01 Eli Zaretskii <eliz@gnu.org>
14179
14180 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14181 instead of alloca. (Bug#11138)
14182
3b0512a3
AS
141832012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14184
14185 * w32menu.c (is_simple_dialog): Properly check lisp types.
14186 (Bug#11141)
14187
8427ddd2
EZ
141882012-03-31 Eli Zaretskii <eliz@gnu.org>
14189
979022ef
EZ
14190 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14191 position we get to after a call to move_it_to fails the
14192 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14193 only if we wind up in a string from display property. (Bug#11063)
14194
a6b1c7cc
EZ
14195 * window.c (Fdelete_other_windows_internal): Invalidate the row
14196 and column information about mouse highlight, so that redisplay
14197 restores it after reallocating the glyph matrices. (Bug#7464)
14198
8427ddd2
EZ
14199 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14200 string comes from a `display' text property, use the buffer
14201 position of that property as if we actually saw that position in
14202 the row's glyphs.
697ba24b
EZ
14203 (move_it_by_lines): Remove the assertion that
14204 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14205 violated when there's a before-string at the beginning of a line.
14206 (Bug#11063)
8427ddd2 14207
65a0a738
EZ
142082012-03-30 Eli Zaretskii <eliz@gnu.org>
14209
14210 * xdisp.c (append_space_for_newline): If the default face was
14211 remapped, use the remapped face for the appended newline.
14212 (extend_face_to_end_of_line): Use the remapped default face for
14213 extending the face to the end of the line.
14214 (display_line): Call extend_face_to_end_of_line when the default
14215 face was remapped. (Bug#11068)
14216
581355cc
EZ
142172012-03-29 Eli Zaretskii <eliz@gnu.org>
14218
14219 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14220
e8fc049f
SM
142212012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14222
14223 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14224
4fb9a543
GM
142252012-03-27 Glenn Morris <rgm@gnu.org>
14226
14227 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14228 Doc fixes.
14229
679910f1
KH
142302012-03-26 Kenichi Handa <handa@m17n.org>
14231
14232 * dispextern.h (struct glyph): Fix previous change. Change the
14233 bit length of glyphless.ch to 25 (Bug#11082).
14234
90d49b7f
CY
142352012-03-26 Chong Yidong <cyd@gnu.org>
14236
14237 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14238 (command_loop_1): Use it; inhibit selection update for
14239 handle-select-window too (Bug#8996).
14240
f514f6f0
FP
142412012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14242
e8fc049f 14243 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 14244
bf43fa51
KH
142452012-03-25 Kenichi Handa <handa@m17n.org>
14246
14247 * dispextern.h (struct glyph): Change the bit length of
14248 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14249
8a0c01dd
EZ
142502012-03-24 Eli Zaretskii <eliz@gnu.org>
14251
14252 * s/ms-w32.h (tzname): Include time.h before redirecting to
14253 _tzname. Fixes the MSVC build. (Bug#9960)
14254
7d1c3a76
AS
142552012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14256
8ed79523
AS
14257 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14258 characters.
14259
7d1c3a76
AS
14260 * xterm.c (XTread_socket): Only modify handling_signal if
14261 !SYNC_INPUT. (Bug#11080)
14262
e99a9b8b
EZ
142632012-03-23 Eli Zaretskii <eliz@gnu.org>
14264
14265 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14266 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14267 when fetching a multibyte character consumes more bytes than
14268 CHAR_BYTES returns, due to unification of CJK characters in
14269 string_char. (Bug#11073)
14270
5063c0e1
TN
142712012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14272
14273 * process.c (wait_reading_process_output): Handle pty disconnect
14274 by refraining from sending oneself a SIGCHLD (bug#10933).
14275
9f851fbd
CY
142762012-03-22 Chong Yidong <cyd@gnu.org>
14277
14278 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14279
5063c0e1 14280 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
14281 Mark string as coming from a prefix property.
14282 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14283 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14284
fb5b8aca
CY
142852012-03-21 Chong Yidong <cyd@gnu.org>
14286
14287 * xfaces.c (Vface_remapping_alist): Doc fix.
14288
62356a1b
EZ
142892012-03-20 Eli Zaretskii <eliz@gnu.org>
14290
14291 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
14292 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14293 Doc fixes.
62356a1b 14294
025de85b
CY
142952012-03-20 Chong Yidong <cyd@gnu.org>
14296
14297 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14298 to reflect default non-nil value of redisplay-dont-pause.
14299
4827f94e
KH
143002012-03-19 Kenichi Handa <handa@m17n.org>
14301
14302 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14303 it fit in a valid range (Bug#11003).
14304
e50a24a2
EZ
143052012-03-18 Eli Zaretskii <eliz@gnu.org>
14306
14307 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14308 that is not from display property, accept the row as a "cursor
14309 row" if one of the string's character has a non-nil `cursor'
14310 property. Fixes cursor positioning when there are newlines in
14311 overlay strings, e.g. in icomplete.el. (Bug#11035)
14312
9af5ed87
PE
143132012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14314
14315 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14316
d1f55f16
CY
143172012-03-12 Chong Yidong <cyd@gnu.org>
14318
14319 * eval.c (inhibit_lisp_code): Rename from
14320 inhibit_window_configuration_change_hook; move from window.c.
14321
14322 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14323 * window.c (run_window_configuration_change_hook)
14324 (syms_of_window): Callers changed.
14325
66c5eebd
CY
143262012-03-11 Chong Yidong <cyd@gnu.org>
14327
413df973
CY
14328 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14329
66c5eebd
CY
14330 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14331
1de11f56
CY
143322012-03-10 Chong Yidong <cyd@gnu.org>
14333
14334 * frame.c (other_visible_frames): Don't assume the selected frame
14335 is visible (Bug#10955).
14336
cae07000
SM
143372012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14338
14339 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14340
89c94350
JD
143412012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14342
14343 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14344 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14345 zero (Bug#10954).
14346
999dd333
GM
143472012-03-03 Glenn Morris <rgm@gnu.org>
14348
01a6dcc8 14349 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 14350
de0100f2
EZ
143512012-03-02 Eli Zaretskii <eliz@gnu.org>
14352
14353 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14354 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
14355 (redisplay_window, next_element_from_string): Fix typos in
14356 comments.
3e441275
EZ
14357 (redisplay_window): Pass to move_it_vertically the margin in
14358 pixels, not in screen lines.
de0100f2 14359
96a72ee9
GM
143602012-03-02 Glenn Morris <rgm@gnu.org>
14361
14362 * buffer.c (buffer-list-update-hook): Doc fix.
14363
312508d7
EZ
143642012-02-29 Eli Zaretskii <eliz@gnu.org>
14365
14366 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14367 push_it before setting up the iterator for the first overlay
14368 string, even if we have an empty string loaded.
14369 (next_overlay_string): If there's an empty string on the iterator
14370 stack, pop the stack. (Bug#10903)
14371
27f3c637
PE
143722012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14373
14374 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14375 Suggested by Stefan Monnier in
14376 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14377 * alloc.c (widen_to_Lisp_Object): New static function.
14378 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14379 and widening them to Lisp_Objects. This would work even if
14380 USE_LSB_TAG is defined and wide integers are used, which might
14381 happen in a future version of Emacs.
14382
3c9dfce6
CY
143832012-02-25 Chong Yidong <cyd@gnu.org>
14384
fa74b241
CY
14385 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14386 Doc fix.
14387
3c9dfce6
CY
14388 * xselect.c (Fx_selection_exists_p): Doc fix.
14389 (x_clipboard_manager_save_all): Print an informative message
14390 before saving to clipboard manager.
14391
9486df08
CY
143922012-02-24 Chong Yidong <cyd@gnu.org>
14393
14394 * keyboard.c (process_special_events): Handle all X selection
14395 requests in kbd_buffer, not just the next one (Bug#8869).
14396
f01d3321
CY
143972012-02-23 Chong Yidong <cyd@gnu.org>
14398
14399 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14400 call when setting menu-bar-lines and tool-bar-lines parameters.
14401 (unwind_create_frame_1): New helper function.
14402
14403 * window.c (inhibit_window_configuration_change_hook): New var.
14404 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 14405 (syms_of_window): Initialize it.
f01d3321 14406
86b847b6
CY
144072012-02-22 Chong Yidong <cyd@gnu.org>
14408
14409 * xterm.c (x_draw_image_relief): Add missing type check for
14410 Vtool_bar_button_margin (Bug#10743).
14411
a59225b1
CY
144122012-02-21 Chong Yidong <cyd@gnu.org>
14413
14414 * fileio.c (Vfile_name_handler_alist): Doc fix.
14415
14416 * buffer.c (Fget_file_buffer): Protect against invalid file
14417 handler return value.
14418
310f5bd4
PE
144192012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14420
cb3a28cc
PE
14421 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14422 when computing $valmask.
14423
310f5bd4
PE
14424 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14425 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14426 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14427 It's useless in that case, and it can cause problems on hosts
14428 that allocate halves of EMACS_INT values separately.
14429 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14430 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14431 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14432 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14433 it avoids undefined behavior on hosts where shifting right by more
14434 than the word width has undefined behavior.
14435
2375c96a
CY
144362012-02-19 Chong Yidong <cyd@gnu.org>
14437
14438 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14439 (Funhandled_file_name_directory, Ffile_name_as_directory)
14440 (Fdirectory_file_name, Fexpand_file_name)
14441 (Fsubstitute_in_file_name): Protect against invalid file handler
14442 return values (Bug#10845).
14443
3eb49e71
EZ
144442012-02-18 Eli Zaretskii <eliz@gnu.org>
14445
14446 * .gdbinit (pitx): Fix incorrect references to fields of the
14447 iterator stack.
14448
7b926f3f
CY
144492012-02-17 Chong Yidong <cyd@gnu.org>
14450
14451 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14452
11273115
PE
144532012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14454
14455 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14456 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14457
c3a70e2b
CY
144582012-02-15 Chong Yidong <cyd@gnu.org>
14459
14460 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14461 marked as special. Also, starting docstrings with * is obsolete.
14462
0ca43699
AS
144632012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14464
14465 * gnutls.c (emacs_gnutls_write): Fix last change.
14466
2e8f3c56
LI
144672012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14468
14469 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14470 send_process.
14471
af70074f
SM
144722012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14473
14474 * keymap.c (Fsingle_key_description): Handle char ranges.
14475
95986d52
CY
144762012-02-12 Chong Yidong <cyd@gnu.org>
14477
afd83bd1
CY
14478 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14479 as that creates a dangerous corner case.
14480
95986d52
CY
14481 * window.c (Fdelete_window_internal): Invalidate the mouse
14482 highlight (Bug#9904).
14483
bd7da63e
GM
144842012-02-12 Glenn Morris <rgm@gnu.org>
14485
14486 * xselect.c (Fx_own_selection_internal)
14487 (Fx_get_selection_internal, Fx_disown_selection_internal)
14488 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14489 * nsselect.m (Fx_own_selection_internal)
14490 (Fx_disown_selection_internal, Fx_selection_exists_p)
14491 (Fx_selection_owner_p, Fx_get_selection_internal):
14492 Sync docs and argument specs with the xselect.c versions.
14493
77abcbc2
LI
144942012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14495
14496 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14497
90b671e2
EZ
144982012-02-11 Eli Zaretskii <eliz@gnu.org>
14499
1c0ca0b7
EZ
14500 * w32select.c (Fx_selection_exists_p): Sync doc string and
14501 argument list with xselect.c. (Bug#10783)
14502
14503 * w16select.c (Fx_selection_exists_p): Sync doc string and
14504 argument list with xselect.c. (Bug#10783)
90b671e2 14505
49241268
GM
145062012-02-10 Glenn Morris <rgm@gnu.org>
14507
14508 * fns.c (Fsecure_hash): Doc fix.
14509
f998bbe7 145102012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
14511
14512 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14513
0992bd9c
CY
145142012-02-07 Chong Yidong <cyd@gnu.org>
14515
14516 * buffer.c (Fbuffer_local_variables)
14517 (buffer_lisp_local_variables): Handle unbound vars correctly;
14518 don't let Qunbound leak into Lisp.
14519
af008560
GM
145202012-02-07 Glenn Morris <rgm@gnu.org>
14521
dd605cc4
GM
14522 * image.c (Fimagemagick_types): Doc fix.
14523
af008560
GM
14524 * image.c (imagemagick-render-type): Change it from a lisp object
14525 to an integer. Move the doc here from the lisp manual.
14526 Treat all values not equal to 0 the same.
14527
1449fa1d
CY
145282012-02-06 Chong Yidong <cyd@gnu.org>
14529
14530 * doc.c (store_function_docstring): Avoid applying docstring of
14531 alias to base function (Bug#2603).
14532
3723ec07
AS
145332012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14534
14535 * .gdbinit (pp1, pv1): Remove redundant defines.
14536 (pr): Use pp.
14537
79c1cc1e
CY
145382012-02-04 Chong Yidong <cyd@gnu.org>
14539
14540 * nsterm.m: Declare a global (Bug#10694).
14541
d7f29f8e
EZ
145422012-02-04 Eli Zaretskii <eliz@gnu.org>
14543
cae07000
SM
14544 * w32.c (get_emacs_configuration_options):
14545 Include --enable-checking, if specified, in the return value.
d7f29f8e 14546
3b95a6f9
MR
145472012-02-04 Martin Rudalics <rudalics@gmx.at>
14548
14549 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14550 after rounding frame sizes. (Bug#9723)
14551
d6fa96a6
EZ
145522012-02-04 Eli Zaretskii <eliz@gnu.org>
14553
14554 * keyboard.c (adjust_point_for_property): Don't position point
14555 before BEGV. (Bug#10696)
14556
df0b2940
PE
145572012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14558
14559 Handle overflow when computing char display width (Bug#9496).
14560 * character.c (char_width): Return EMACS_INT, not int.
14561 (char_width, c_string_width): Check for overflow when
14562 computing the width; this is possible now that individual
14563 characters can have unbounded width. Problem introduced
14564 by merge from Emacs 23 on 2012-01-19.
14565
6bee44d6
MA
145662012-02-02 Michael Albinus <michael.albinus@gmx.de>
14567
14568 * dbusbind.c (Fdbus_register_method): Mention the return value
14569 :ignore in the docstring.
14570
44f92739
GM
145712012-02-02 Glenn Morris <rgm@gnu.org>
14572
1b9f60cc
GM
14573 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14574
44f92739
GM
14575 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14576 Unconditionally set to t. (Bug#10673)
14577 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14578 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14579 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14580
c5d3843c
KH
145812012-02-02 Kenichi Handa <handa@m17n.org>
14582
14583 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14584 0, do not call append_composite_glyph.
14585
159462d4 145862012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
14587
14588 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14589 NULL (Bug#6988).
14590 (x_produce_glyphs): If the component of a composition is a null
14591 string, set it->pixel_width to 1 to avoid zero-width glyph.
14592
78cef877
EZ
145932012-02-01 Eli Zaretskii <eliz@gnu.org>
14594
14595 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14596 first 2 arguments are identical. This makes inserting large
14597 output from a subprocess an order of magnitude faster on
14598 MS-Windows, where all sbrk'ed memory is always contiguous.
14599
97897668
GM
146002012-01-31 Glenn Morris <rgm@gnu.org>
14601
14602 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 14603 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
14604 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14605
31fd3586
GM
146062012-01-29 Glenn Morris <rgm@gnu.org>
14607
14608 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14609
0e24a8b2
CY
146102012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14611
14612 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14613
cc0adcb0
CY
146142012-01-28 Chong Yidong <cyd@gnu.org>
14615
14616 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14617
acc28cb9
CY
146182012-01-26 Chong Yidong <cyd@gnu.org>
14619
9c69cfb7
CY
14620 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14621
acc28cb9
CY
14622 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14623 repeat counts (Bug#10507).
14624
48da7392
GM
146252012-01-26 Glenn Morris <rgm@gnu.org>
14626
14627 * lread.c (syms_of_lread): Doc fix.
14628
14af5f7f
CY
146292012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14630
14631 * coding.c (encode_designation_at_bol): Change return value to
14632 EMACS_INT.
14633
0b21c100
CY
146342012-01-25 Chong Yidong <cyd@gnu.org>
14635
14636 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14637
3c2907f7
CY
146382012-01-21 Chong Yidong <cyd@gnu.org>
14639
14640 * floatfns.c (Fcopysign): Make the second argument non-optional,
14641 since nil is not allowed anyway.
14642
959ad23f
AS
146432012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14644
14645 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14646 (send_process): Likewise.
14647
34a02f46
MR
146482012-01-19 Martin Rudalics <rudalics@gmx.at>
14649
14650 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
14651 (Vwindow_persistent_parameters): Do not use Qstate.
14652 Rewrite doc-strings.
34a02f46 14653
1259009a 146542012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
14655
14656 * character.c (char_width): New function.
70d4fdf6
GM
14657 (Fchar_width, c_string_width, lisp_string_width):
14658 Use char_width (Bug#9496).
25ed9e61 14659
6a6ee00d
MR
146602012-01-16 Martin Rudalics <rudalics@gmx.at>
14661
14662 * window.c (Vwindow_persistent_parameters): New variable.
14663 (Fset_window_configuration, save_window_save): Handle persistent
14664 window parameters.
14665
c85efaf7
EZ
146662012-01-14 Eli Zaretskii <eliz@gnu.org>
14667
14668 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14669 thrashing the stack of the thread. (Bug#9087)
14670
5944709e
PE
146712012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14672
14673 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14674
e71f5d99
EZ
146752012-01-11 Eli Zaretskii <eliz@gnu.org>
14676
14677 * xdisp.c (rows_from_pos_range): Handle the case where the
14678 highlight ends on a newline. (Bug#10464)
14679 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14680 he end column for display of highlight that ends on a newline
14681 before a R2L line.
14682
ce316182
GM
146832012-01-11 Glenn Morris <rgm@gnu.org>
14684
14685 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14686 from load-path also when installation-directory is nil. (Bug#10208)
14687
5b43da69
GM
146882012-01-10 Glenn Morris <rgm@gnu.org>
14689
74cc8ff9
GM
14690 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14691
7d8d6e4e
GM
14692 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14693 Update template values to be closer to their typical values these days.
5b43da69 14694
a0db8d43
EZ
146952012-01-09 Eli Zaretskii <eliz@gnu.org>
14696
14697 * xdisp.c (rows_from_pos_range): Accept additional argument
14698 DISP_STRING, and accept any glyph in a row whose object is that
14699 string as eligible for mouse highlight. Fixes mouse highlight of
14700 display strings from overlays. (Bug#10464)
14701
9a0115ab 147022012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 14703
b9110d6a 14704 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
14705 * fileio.c (auto_saving_dir_umask): New static var.
14706 (Fmake_directory_internal): Use it.
14707 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14708 creating the directory. The old code temporarily assigns
14709 too-generous permissions to the directory.
14710 (do_auto_save_eh): Clear it.
b9110d6a 14711 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
14712 that the var is always cleared.
14713
6c1bd3f3
EZ
147142012-01-07 Eli Zaretskii <eliz@gnu.org>
14715
14716 * search.c (scan_buffer): Pass character positions to
14717 know_region_cache, not byte positions. (Bug#6540)
14718
069d2b50
L
147192012-01-07 LynX <_LynX@bk.ru> (tiny change)
14720
14721 * w32.c (sys_rename): Report EXDEV when rename of a directory
14722 fails because the target is on another logical disk. (Bug#10284)
14723
75bf0d33
DB
147242012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14725
14726 * xterm.c (x_embed_request_focus): New function.
14727
14728 * xterm.h: Add prototype.
14729
14730 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14731
1c6e5a32
GM
147322012-01-05 Glenn Morris <rgm@gnu.org>
14733
14734 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14735
651e947e
EZ
147362012-01-01 Eli Zaretskii <eliz@gnu.org>
14737
14738 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14739 Load gnutls_transport_set_lowat only if GnuTLS version is below
14740 2.11.1.
14741 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14742 GnuTLS versions below 2.11.1.
14743
3778cdd8
AL
147442011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14745
14746 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14747 to the doc string advising against its use for altering the way
14748 windows are scrolled.
14749
0e5317f7
KH
147502011-12-28 Kenichi Handa <handa@m17n.org>
14751
14752 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14753 coding-system ASCII compatible only when it does not produce BOM
14754 on encoding (Bug#10383).
14755
93d5ca1f
JD
147562011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14757
14758 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14759 can scroll.
14760 (create_and_show_popup_menu): Always use menu_position_func for
14761 Gtk3 (Bug#10361).
14762
ca22b785
AS
147632011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14764
14765 * callint.c (Fcall_interactively): Don't truncate prompt string.
14766
d048e1e6
EZ
147672011-12-23 Eli Zaretskii <eliz@gnu.org>
14768
14769 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14770 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 14771 resumed from there (after widening). (Bug#10360)
d048e1e6 14772
5ccaba1f
JD
147732011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14774
14775 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14776
204ee57f
JD
147772011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14778
b81d40f0
JB
14779 * nsterm.m (x_free_frame_resources):
14780 Release f->output_data.ns->miniimage.
204ee57f
JD
14781 (ns_index_color): Fix indentation. Do not retain
14782 color_table->colors[i].
14783
14784 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14785 before returning.
14786
14787 * nsfns.m (x_set_background_color): Assign return value from
14788 ns_index_color to face-background instead of NSColor*.
14789 (ns_implicitly_set_icon_type): Fix indentation.
14790 Change assignment in for loop to comparison.
14791
14792 * emacs.c (ns_pool): New variable.
14793 (main): Assign ns_pool.
14794 (Fkill_emacs): Call ns_release_autorelease_pool.
14795
14796 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14797 autorelease fdesc, release fdAttrs and tdict.
14798 (ns_get_covering_families): Release charset.
14799 (ns_findfonts): Release NSFontDescriptor created with new.
14800 (ns_uni_to_glyphs): Fix indentation.
14801 (setString): Release attrStr before assigning new value.
14802
c803b2b7
JD
148032011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14804
678f4426
JD
14805 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14806 and NS_IMPL_COCOA.
14807 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14808 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14809
cd394be1 148102011-12-18 David Reitter <reitter@cmu.edu>
678f4426 14811
5fecd5fc
JD
14812 * nsterm.m (ns_term_init): Subscribe for notifications
14813 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14814 to method trackingNotification in EmacsMenu.
14815
14816 * nsmenu.m (trackingMenu): New variable.
3771cb17 14817 (trackingNotification): New method (from Aquamacs).
5fecd5fc 14818 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 14819 from Aquamacs (Bug#7030).
678f4426
JD
14820
148212011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 14822
c803b2b7
JD
14823 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14824 (symbol_to_nsstring): Fix indentation.
14825 (ns_symbol_to_pb): New function.
cae07000
SM
14826 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14827 (Fns_rotate_cut_buffers_internal): Remove.
14828 (Fns_store_selection_internal): Rename from
c803b2b7
JD
14829 Fns_store_cut_buffer_internal.
14830 (ns_get_foreign_selection, Fx_own_selection_internal)
14831 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
14832 (Fns_get_selection_internal, Fns_store_selection_internal):
14833 Use ns_symbol_to_pb and check if return value is nil.
14834 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14835 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
14836 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14837 renamed to Sns_store_selection_internal.
14838 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14839 and remove this function.
14840 (ns_handle_selection_clear): Remove, never used.
14841 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14842 here.
14843
e1b01a3a
KB
148442011-12-17 Ken Brown <kbrown@cornell.edu>
14845
14846 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14847 GID is unknown (Bug#10257).
14848
2adb6e85
PE
148492011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14850
14851 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14852 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14853 which caused a build failure on GNU/Linux IA-64. This problem was
14854 introduced by my 2011-10-07 patch.
14855
d1d7b339
JL
148562011-12-15 Juri Linkov <juri@jurta.org>
14857
14858 * image.c (imagemagick_error): New function. (Bug#10112)
14859 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14860 Use `imagemagick_error' where ImageMagick functions return
14861 `MagickFalse'.
14862 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14863 proper order.
14864
100d5755
KH
148652011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14866
14867 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14868 fill background (Bug#8992).
14869
454592a6
MR
148702011-12-13 Martin Rudalics <rudalics@gmx.at>
14871
14872 * window.c (Vwindow_combination_resize)
14873 (Vwindow_combination_limit): Use t instead of non-nil in
14874 doc-strings.
61d4b438
MR
14875 (Vrecenter_redisplay): Add first sentence of doc-string on
14876 separate line.
53524d93 14877 (Frecenter): Fix doc-string typo.
454592a6 14878
3633e3aa
KH
148792011-12-11 Kenichi Handa <handa@m17n.org>
14880
14881 * coding.c (Funencodable_char_position): Pay attention to the
14882 buffer text relocation (Bug#9389).
14883
7b9d523a 148842011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 14885
7b9d523a
JD
14886 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14887 gtk_init (Bug#10100).
14888
b73189c6
EZ
148892011-12-10 Eli Zaretskii <eliz@gnu.org>
14890
14891 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14892 IT->string is nil. (Bug#10263)
14893
f7dfe5d6
JD
148942011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14895
83faebb4
JD
14896 * nsterm.h (x_free_frame_resources): Declare.
14897
f7dfe5d6
JD
14898 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14899 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14900
14901 * nsterm.h (ns_get_defaults_value): Declare.
14902
14903 * nsterm.m (ns_default): Call ns_get_defaults_value.
14904
7cd4e72c
EZ
149052011-12-09 Eli Zaretskii <eliz@gnu.org>
14906
14907 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14908 (Bug#10170)
14909
b34d7317
YM
149102011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14911
14912 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14913 that where the value of an _OBJC_* symbol points to is in the .bss
14914 section (Bug#10240).
14915
76470ad1
KH
149162011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14917
14918 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 14919 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 14920
745fff94
KH
149212011-12-08 Kenichi Handa <handa@m17n.org>
14922
14923 * ftfont.c (get_adstyle_property): Fix previous change
14924 (Bug#10233).
14925
6e44397c
JB
149262011-12-07 Juanma Barranquero <lekktu@gmail.com>
14927
14928 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14929 dirs from the default value of EMACSLOADPATH (bug#10208).
14930
7efa6272
GM
149312011-12-07 Glenn Morris <rgm@gnu.org>
14932
14933 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14934 installation and source directories as well. (Bug#10208)
14935
f6fc4d87
CY
149362011-12-06 Chong Yidong <cyd@gnu.org>
14937
14938 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14939
2bf26180
GM
149402011-12-06 Glenn Morris <rgm@gnu.org>
14941
14942 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14943 as an error, not just -1. (Bug#10217)
14944
3a6ad4f0
CY
149452011-12-05 Chong Yidong <cyd@gnu.org>
14946
14947 * keyboard.c (process_special_events): New function.
14948 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14949
75a3b399
PE
149502011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14951
14952 * coding.c (encode_designation_at_bol): Don't use uninitialized
14953 local variable (Bug#9318).
14954
c3c9e25e
KH
149552011-12-05 Kenichi Handa <handa@m17n.org>
14956
14957 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14958 return Qnil (Bug#8046, Bug#10193).
14959
5eb05ea3
KH
149602011-12-05 Kenichi Handa <handa@m17n.org>
14961
14962 * coding.c (encode_designation_at_bol): New args charbuf_end and
14963 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
14964 (coding_set_source): Return how many bytes coding->source was
14965 relocated.
14966 (coding_set_destination): Return how many bytes
14967 coding->destination was relocated.
14968 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 14969 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
14970
149712011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14972
14973 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14974 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14975 macro (Bug#9318).
14976
149772011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14978
14979 The following changes are to fix Bug#9318.
14980
a79703f5 14981 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
14982 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14983 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 14984 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 14985
7dbda6df
JB
149862011-12-05 Juanma Barranquero <lekktu@gmail.com>
14987
14988 * lisp.h (process_quit_flag): Fix external declaration.
14989
6d5eb5b0
SM
149902011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14991
14992 Don't macro-inline non-performance-critical code.
14993 * eval.c (process_quit_flag): New function.
14994 * lisp.h (QUIT): Use it.
14995
a0c3fad0
JD
149962011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14997
14998 * nsfns.m (get_geometry_from_preferences): New function.
14999 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15000
6c07aac2
AS
150012011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15002
15003 * emacs.c (Qkill_emacs): Define.
15004 (syms_of_emacs): Initialize it.
15005 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15006 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
15007 (quit_throw_to_read_char): Add parameter `from_signal'.
15008 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
15009 * lisp.h (QUIT): Call Fkill_emacs if requested.
15010
c052ead4
JD
150112011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15012
15013 * widget.c (update_wm_hints): Return if wmshell is null.
15014 (widget_update_wm_size_hints): New function.
15015
15016 * widget.h (widget_update_wm_size_hints): Declare.
15017
15018 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15019 widget_update_wm_size_hints (Bug#10104).
15020
9e49252b
EZ
150212011-12-03 Eli Zaretskii <eliz@gnu.org>
15022
15023 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15024 before a newline, prepare the bidi iterator for consuming the
15025 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 15026 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 15027
02b16839
JL
150282011-12-02 Juri Linkov <juri@jurta.org>
15029
15030 * search.c (Fword_search_regexp): New Lisp function created from
15031 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15032 (Fword_search_backward, Fword_search_forward)
15033 (Fword_search_backward_lax, Fword_search_forward_lax):
15034 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15035 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15036
0068070e
SM
150372011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15038
15039 * fileio.c (Finsert_file_contents): Move after-change-function call
15040 to before the "handled:" label, since all "goto handled" appear in
15041 cases where the *-change-functions have already been properly called
15042 (bug#10117).
15043
3360a3fc
AS
150442011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15045
15046 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15047 waiting for input. (Bug#10169)
15048
73d6c093
EZ
150492011-11-30 Eli Zaretskii <eliz@gnu.org>
15050
15051 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15052 verifies glyph row's hash code--we have just reallocated the
15053 glyphs, so their contents can be complete garbage. (Bug#10164)
15054
febe6bea
JB
150552011-11-30 Juanma Barranquero <lekktu@gmail.com>
15056
15057 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15058
801a4313
EZ
150592011-11-30 Eli Zaretskii <eliz@gnu.org>
15060
15061 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15062 attributes are tested _before_ calling verify_row_hash, to protect
15063 against GCC re-ordering of the tests. (Bug#10164)
15064
2b56b87e
JD
150652011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15066
15067 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15068
15069 * xterm.c (handle_one_xevent): Only set async_visible and friends
15070 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 15071 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
15072 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15073
dbf31225
PE
150742011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15075
15076 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15077 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15078 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15079 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15080 All uses changed to use GCPRO1 etc.
15081 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15082 Revert to old implementation (i.e., before 2011-03-11).
15083
1305621b
YM
150842011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15085
15086 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15087 of scroll runs so as to avoid assigning disabled bogus rows and
15088 unnecessary graphics copy operations.
15089
8c9afb46
EZ
150902011-11-27 Eli Zaretskii <eliz@gnu.org>
15091
15092 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15093 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15094 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15095 (malloc, free, realloc, calloc): Redirect to e_* only when
15096 compiling Emacs.
15097
15098 * lisp.h (GCTYPEBITS): Move before first use.
15099 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15100 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15101 this macro definition.
15102
15103 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15104 _MSC_VER.
15105
54e9e3bf
JD
151062011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15107
6d5eb5b0
SM
15108 * gtkutil.c (xg_create_frame_widgets):
15109 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
15110 present with Gtk+ 2.0.
15111
83aca1cb
PE
151122011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15113
15114 * fileio.c (Finsert_file_contents): Undo previous change; see
15115 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15116
5b76caa4
PE
151172011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15118
15119 Rename locals to avoid shadowing.
15120 * fileio.c (Finsert_file_contents):
15121 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15122 * process.c (wait_reading_process_output):
15123 Rename inner 'proc' to 'p' to avoid shadowing.
15124 Indent for consistency with usual Emacs style.
15125
8c535114
EZ
151262011-11-25 Eli Zaretskii <eliz@gnu.org>
15127
15128 * xdisp.c (redisplay_window): If cursor row is not fully visible
15129 after recentering, and scroll-conservatively is set to a large
15130 number, scroll window by a few more lines to make the cursor fully
15131 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
15132 (start_display): Don't move to the next line if the display should
15133 start at a newline that is part of a display vector or an overlay
15134 string. (Bug#10119)
8c535114 15135
fa4fdb5c
JL
151362011-11-24 Juri Linkov <juri@jurta.org>
15137
15138 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15139 after the `MagickPingImage' call. (Bug#10112)
15140
90ec88df
CY
151412011-11-23 Chong Yidong <cyd@gnu.org>
15142
15143 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15144
56e2e794
MR
151452011-11-23 Martin Rudalics <rudalics@gmx.at>
15146
15147 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15148 making another buffer current. (Bug#10114)
15149
b6e64c41
GM
151502011-11-23 Glenn Morris <rgm@gnu.org>
15151
15152 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15153
6b21de18
CY
151542011-11-23 Chong Yidong <cyd@gnu.org>
15155
15156 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15157 using it (Bug#5984).
15158
b12cd789
EZ
151592011-11-22 Eli Zaretskii <eliz@gnu.org>
15160
15161 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15162 and header-lines, as they don't have one computed for them.
15163 (Bug#10098)
15164
15165 * .gdbinit (prow): Make displayed values more self-explaining.
15166 Add row's hash code.
15167
261b6fd4
LMI
151682011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15169
15170 * process.c (wait_reading_process_output): Fix asynchrounous
15171 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 15172 (wait_reading_process_output): Add comment and URL.
261b6fd4 15173
e7cfd277
JD
151742011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15175
15176 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15177
a9b9b7f5
CY
151782011-11-21 Chong Yidong <cyd@gnu.org>
15179
15180 * window.c (Fnext_window, Fprevious_window): Doc fix.
15181
b0d15b4f
SM
151822011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15183
15184 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15185
fe7a3057
JB
151862011-11-20 Juanma Barranquero <lekktu@gmail.com>
15187
15188 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15189
d2999b1a
MR
151902011-11-20 Martin Rudalics <rudalics@gmx.at>
15191
15192 * window.c (Fset_window_combination_limit): Rename argument
15193 STATUS to LIMIT.
15194 (Vwindow_combination_limit): Remove "status" from doc-string.
15195
d5ff9cd0
AS
151962011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15197
15198 * m/ibms390.h: Remove.
15199 * m/ibms390x.h: Don't include "ibms390.h".
15200
a5bb9bd3
SM
152012011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15202
15203 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15204 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15205
cd1181db
JB
152062011-11-20 Juanma Barranquero <lekktu@gmail.com>
15207
15208 * casetab.c (Fset_case_table):
15209 * charset.c (Fcharset_after): Fix typos.
15210
615a3b8d 152112011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 15212
17e845af
PE
15213 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15214 Otherwise, valgrind does not work on some platforms.
15215 Problem reported by Andreas Schwab in
6a0bf43d
PE
15216 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15217 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15218 is set, removing the need for VIRT_ADDRESS_VARIES.
15219 (PURE_P): Use a more-efficient implementation that needs just one
15220 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15221 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15222 to 4 (xorl, subq, cmpq, setbe).
15223 * alloc.c (pure): Always extern now, since that's the
15224 VIRT_ADDR_VARIES behavior.
15225 (PURE_POINTER_P): Use a single comparison, not two, for
15226 consistency with the new puresize.h.
15227 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15228 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15229 Remove VIRT_ADDR_VARIES no longer needed.
15230
f8fe6f96
EZ
152312011-11-19 Eli Zaretskii <eliz@gnu.org>
15232
15233 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15234 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15235 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15236 behave as if the cursor position were at the window margin.
15237
15238 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15239 and the cursor position is out of bounds, behave as if the cursor
15240 position were at the window margin. (Bug#10075)
15241
df05a53c
CY
152422011-11-18 Chong Yidong <cyd@gnu.org>
15243
15244 * window.c (Fwindow_combination_limit): Make first argument
15245 non-optional, since it is meaningless for live windows like the
15246 selected window.
61ccba97 15247
2071918e
DA
152482011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15249
15250 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15251
b50a28de
SM
152522011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15253
15254 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15255 (graft_intervals_into_buffer): Simplify.
15256
015137db
EZ
152572011-11-18 Eli Zaretskii <eliz@gnu.org>
15258
15259 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15260 hash values of the two rows.
15261 (copy_row_except_pointers): Preserve the used[] arrays and the
15262 hash values of the two rows. (Bug#10035)
68c95424 15263 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
15264
15265 * xdisp.c (row_hash): New function, body extracted from
15266 compute_line_metrics.
15267 (compute_line_metrics): Call row_hash, instead of computing the
15268 hash code inline.
15269
15270 * dispnew.c (verify_row_hash): Call row_hash for computing the
15271 hash code of a row, instead of duplicating code from xdisp.c.
15272
15273 * dispextern.h (row_hash): Add prototype.
15274
a2addb04
TH
152752011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15276
15277 * frame.c (delete_frame): Don't delete the terminal when the last
15278 X frame is closed if emacs is built with GTK toolkit.
15279
df85d315
JB
152802011-11-17 Juanma Barranquero <lekktu@gmail.com>
15281
15282 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15283
a0c2d0ae
MR
152842011-11-17 Martin Rudalics <rudalics@gmx.at>
15285
15286 * window.c (Vwindow_splits): Rename to
15287 Vwindow_combination_resize. Suggested by Juri Linkov.
15288 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15289 of Vwindow_splits.
15290
58179cce
JB
152912011-11-16 Juanma Barranquero <lekktu@gmail.com>
15292
7877f373
JB
15293 * nsfns.m (Fns_font_name):
15294 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 15295
b6f67890
MR
152962011-11-16 Martin Rudalics <rudalics@gmx.at>
15297
15298 * window.h (window): Rename slot "nest" to "combination_limit".
15299 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15300 (Fset_window_nest): Rename to Fset_window_combination_limit.
15301 (Vwindow_nest): Rename to Vwindow_combination_limit.
15302 (recombine_windows, make_parent_window, make_window)
15303 (Fsplit_window_internal, saved_window)
15304 (Fset_window_configuration, save_window_save): Rename all
15305 occurrences of window_nest to window_combination_limit.
15306
c7015153
JB
153072011-11-15 Juanma Barranquero <lekktu@gmail.com>
15308
15309 * image.c (imagemagick_load_image): Fix typo.
15310
322ad6ec
EZ
153112011-11-14 Eli Zaretskii <eliz@gnu.org>
15312
15313 * xdisp.c (display_line): Move the call to
15314 highlight_trailing_whitespace before the call to
15315 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
15316 faces of all the glyphs to compute ROW's hash value.
15317 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 15318
f067b8ec
JB
153192011-11-14 Juanma Barranquero <lekktu@gmail.com>
15320
15321 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15322 just return (bug#10044).
15323
1e5b2111
EZ
153242011-11-12 Eli Zaretskii <eliz@gnu.org>
15325
7ef3cbd5
EZ
15326 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15327 with user-defined heap size. Bump the default size of the temacs
15328 heap to 27MB, to avoid memory warning when running temacs.
15329 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15330
1e5b2111
EZ
15331 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15332 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
15333 (verify_row_hash) [XASSERTS]: New function.
15334 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15335 that the hash value of glyph rows is correct.
1e5b2111 15336
89d61221
MR
153372011-11-12 Martin Rudalics <rudalics@gmx.at>
15338
15339 * window.h (window): Remove splits slot.
15340 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15341 (Fdelete_other_windows_internal, make_parent_window)
15342 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15343 (Fset_window_configuration, save_window_save): Don't deal with
15344 split status of windows.
15345 (saved_window): Remove splits slot.
15346 (Vwindow_splits): Rewrite doc-string.
15347
97f18cc8
JD
153482011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15349
15350 * xfns.c (unwind_create_frame):
15351 * nsfns.m (unwind_create_frame):
15352 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15353 Vframe_list (Bug#9999).
15354
22a648b4
DA
153552011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15356
0b381c7e 15357 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 15358
659afede
KH
153592011-11-11 Kenichi Handa <handa@m17n.org>
15360
15361 * callproc.c (Fcall_process): Set the member dst_multibyte of
15362 process_coding.
15363
9ac0394b
KH
153642011-11-11 Johan Bockgård <bojohan@gnu.org>
15365
15366 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15367 avoid a crash (bug#9496).
15368
2fbdc249
CY
153692011-11-09 Chong Yidong <cyd@gnu.org>
15370
15371 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15372 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15373
ac6b1f81
PE
153742011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15375
15376 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15377
09db192c
PE
153782011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15379
15380 Avoid some portability problems by eschewing 'extern inline' functions.
15381 The trivial performance wins aren't worth the portability hassles; see
15382 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15383 et seq.
15384 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15385 (window_box_width, window_box_left, window_box_left_offset)
15386 (window_box_right, window_box_right_offset): Undo previous change,
15387 by removing the "extern"s.
15388 * intervals.c (adjust_intervals_for_insertion)
15389 (adjust_intervals_for_deletion): Undo previous change,
15390 making these static again.
15391 (offset_intervals, temp_set_point_both, temp_set_point)
15392 (copy_intervals_to_string): No longer inline.
15393 * xdisp.c (window_text_bottom_y, window_box_width)
15394 (window_box_height, window_box_left_offset)
15395 (window_box_right_offset, window_box_left, window_box_right)
15396 (window_box): No longer inline.
15397
105216ed
CY
153982011-11-08 Chong Yidong <cyd@gnu.org>
15399
15400 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
15401 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15402 Signal an error if not a live window.
105216ed
CY
15403 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15404 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15405
ae9e237f
JB
154062011-11-07 Juanma Barranquero <lekktu@gmail.com>
15407
15408 * lisp.h (syms_of_abbrev): Remove declaration.
15409 Reported by CHENG Gao <chenggao@royau.me>.
15410
c7aa8333
EZ
154112011-11-07 Eli Zaretskii <eliz@gnu.org>
15412
15413 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15414 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15415 of temacs in GUI mode.
15416
be7f5545
MR
154172011-11-07 Martin Rudalics <rudalics@gmx.at>
15418
15419 * window.h: Declare delete_all_child_windows instead of
15420 delete_all_subwindows.
15421 * window.c (Fwindow_nest, Fset_window_nest)
15422 (Fset_window_new_total, Fset_window_new_normal)
15423 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15424 (delete_all_subwindows): Rename to delete_all_child_windows.
15425 (Fdelete_other_windows_internal, Fset_window_configuration):
15426 Call delete_all_child_windows instead of delete_all_subwindows.
15427 * frame.c (delete_frame): Call delete_all_child_windows instead
15428 of delete_all_subwindows.
15429
ca78dc43
PE
154302011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15431
15432 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15433 This is also needed for porting to any host where GC_MARK_STACK is
15434 not GC_MAKE_GCPROS_NOOPS.
15435 (which_symbols): Use it.
15436
a0241d01
KH
154372011-11-07 Kenichi Handa <handa@m17n.org>
15438
15439 * coding.c (coding_set_destination): Check coding->src_pos only
15440 when coding->src_object is a buffer (bug#9910).
15441
15442 * process.c (send_process): Set the member src_multibyte of coding
15443 to 0 (bug#9911) when sending a unibyte text.
15444
15445 * callproc.c (Fcall_process): Set the member src_multibyte of
15446 process_coding to 0 (bug#9912).
15447
a64bfdfa 154482011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
15449
15450 * xmenu.c (cleanup_widget_value_tree): New function.
15451 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15452 calling free_menubar_widget_value_tree directly (Bug#9830).
15453
cb41b32a
PE
154542011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15455
15456 Fix some portability problems with 'inline'.
15457 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15458 (window_box_width, window_box_left, window_box_left_offset)
15459 (window_box_right, window_box_right_offset): Declare extern.
15460 Otherwise, these inline functions do not conform to C99 and
15461 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15462 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15463 * intervals.c (adjust_intervals_for_insertion)
15464 (adjust_intervals_for_deletion): Now extern, because otherwise the
15465 extern inline functions 'offset_intervals' couldn't refer to it.
15466 (static_offset_intervals): Remove.
15467 (offset_intervals): Rewrite using the old contents of
15468 static_offset_intervals. The old version didn't conform to C99
15469 because an extern inline function contained a reference to an
15470 identifier with static linkage.
15471
b7041366
AS
154722011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15473
15474 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15475 GC.
15476
88a37c4d
EZ
154772011-11-06 Eli Zaretskii <eliz@gnu.org>
15478
15479 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15480 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15481 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15482 return Qleft_to_right.
15483
49745b39
CY
154842011-11-06 Chong Yidong <cyd@gnu.org>
15485
15486 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15487 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15488 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15489 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15490 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15491 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15492 (Fwindow_vscroll): Doc fix.
15493 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15494 argument, since it makes no sense to pass a live window and for
15495 consistency with window-child.
15496
1f05cd82
CS
154972011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15498
15499 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15500 support MSVC.
15501
22610910
JR
155022011-11-05 Jason Rumney <jasonr@gnu.org>
15503
15504 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15505 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15506 fonts (Bug#6029).
15507 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15508 bitwise arithmetic preventing use of unicode-sip and non-truetype
15509 opentype fonts.
15510
a06776b2
EZ
155112011-11-05 Eli Zaretskii <eliz@gnu.org>
15512
3ad924ba
EZ
15513 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15514 "emacs"-only part.
15515
a06776b2
EZ
15516 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15517 initialization code to keep similarity to xfns.c after changes
15518 from 2011-11-05.
15519
c9e7db78
JD
155202011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15521
a97f8f3f
JD
15522 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15523 (unwind_create_frame): New function (Bug#9943).
15524 (Fx_create_frame): Restructure code to be more similar to the one in
15525 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15526 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15527 Move terminal->reference_count++ just before making the frame official
15528 (Bug#9943).
15529
15530 * nsterm.m (x_free_frame_resources): New function.
15531 (x_destroy_window): Move code to x_free_frame_resources.
15532
c9e7db78 15533 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
15534 (Fx_create_frame, x_create_tip_frame):
15535 Move terminal->reference_count++ just before making the frame
75f1671a 15536 official. Move initialization of image_cache_refcount and
c9e7db78
JD
15537 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15538
a6fc3b5c
EZ
155392011-11-05 Eli Zaretskii <eliz@gnu.org>
15540
15541 Support MSVC build with newer versions of Visual Studio.
15542 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15543 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15544 nt/gmake.defs.
15545
15546 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15547 which are not supported by MSVC.
15548 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15549 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15550 bitfields.
15551 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15552 types in bitfields.
15553 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15554
15555 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15556
58179cce 155572011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
15558
15559 Support MSVC build with newer versions of Visual Studio.
15560 * w32.c: Don't include w32api.h for MSVC.
15561 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15562
15563 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15564 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15565 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15566 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15567 e_* cousins.
15568 (alloca) [_MSC_VER]: Define to _alloca.
15569
15570 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15571
15572 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15573
a58c13ed
EZ
155742011-11-04 Eli Zaretskii <eliz@gnu.org>
15575
15576 * xdisp.c (note_mouse_highlight): If either of
15577 previous/next-single-property-change returns nil, treat that as
15578 the beginning or the end of the buffer. (Bug#9955)
15579
fe0b6370
JD
155802011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15581
a58c13ed 15582 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
15583 label is not null (Bug#9951).
15584 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15585 may be NULL.
15586
89bd5ee1
EZ
155872011-11-04 Eli Zaretskii <eliz@gnu.org>
15588
15589 * window.c (Fwindow_body_size): Mention in the doc string that the
15590 return value is in frame's canonical units. (Bug#9949)
15591
84c3edb9
EZ
155922011-11-03 Eli Zaretskii <eliz@gnu.org>
15593
4e2fb5c7
EZ
15594 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15595
84c3edb9 15596 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 15597 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 15598 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 15599
bc17a887
EZ
156002011-11-01 Eli Zaretskii <eliz@gnu.org>
15601
15602 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15603 Don't stop backward scan on the continuation glyph, even though
15604 its CHARPOS is positive.
6d5eb5b0
SM
15605 (mouse_face_from_buffer_pos, note_mouse_highlight):
15606 Rename cover_string to disp_string.
bc17a887 15607
4ee88440
MR
156082011-11-01 Martin Rudalics <rudalics@gmx.at>
15609
15610 * window.c (temp_output_buffer_show): Don't use
15611 Vtemp_buffer_show_specifiers.
15612 (Vtemp_buffer_show_specifiers): Remove unused variable.
15613
c2ff3c02
EZ
156142011-10-30 Eli Zaretskii <eliz@gnu.org>
15615
15616 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15617 past the beginning of the current glyph matrix.
15618
58179cce 156192011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
15620
15621 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15622 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15623 HAVE_GTK3 (Bug#9869).
b77a6a7f 15624
3b574623
JD
15625 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15626 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15627
b77a6a7f
JD
15628 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15629
15630 * xterm.c: Declare x_handle_net_wm_state to return int.
15631 (handle_one_xevent): Check if we are iconified but don't have
15632 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15633 (get_current_wm_state): Return non-zero if not hidden,
15634 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15635 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15636 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15637 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15638
196e41e4
PE
156392011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15640
15641 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15642 so that this new function doesn't get optimized away by a
15643 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15644
021f2e1a
AS
156452011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15646
15647 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15648
8b058d44
EZ
156492011-10-29 Eli Zaretskii <eliz@gnu.org>
15650
15651 Fix the `xbytecode' command.
15652 * .gdbinit (xprintbytestr): New command.
b50a28de 15653 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
15654 (xbytecode): Print the byte-code string as well.
15655
4452fb80
EZ
156562011-10-29 Kim Storm <storm@cua.dk>
15657
8b058d44
EZ
15658 * alloc.c (which_symbols): New function.
15659
21b72067
AS
156602011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15661
15662 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15663 line. (Bug#9903)
15664
83ed7b5c
GM
156652011-10-29 Glenn Morris <rgm@gnu.org>
15666
15667 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15668 Not clear what it was for, and it causes various bugs. (Bug#9839)
15669
5a7a728b
EZ
156702011-10-28 Eli Zaretskii <eliz@gnu.org>
15671
15672 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15673 possible random value that matches one of those tested as
15674 condition to clear the mouse face.
15675
d3d0842f
CY
156762011-10-28 Chong Yidong <cyd@gnu.org>
15677
15678 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15679
31b39d13
DN
156802011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15681
15682 * window.c (make_window): Initialize phys_cursor_on_p.
15683
9aba6043
SM
156842011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15685
15686 * lisp.h (struct Lisp_Symbol): Update comments.
15687
c20992f4
JB
156882011-10-28 Juanma Barranquero <lekktu@gmail.com>
15689
15690 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15691
db4f02f2
EZ
156922011-10-28 Eli Zaretskii <eliz@gnu.org>
15693
15694 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15695 <oslsachem@gmail.com> for helping to debug this.
15696
15697 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15698 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15699 (g_b_init_get_glyph_outline_w): New static variables.
15700 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15701 (GetGlyphOutlineW_Proc): New typedefs.
15702 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
15703 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15704 New functions.
15705 (w32font_open_internal, compute_metrics):
15706 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
15707 instead of calling the "wide" APIs directly.
15708
15709 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15710
15711 * w32.h (syms_of_w32font): Add prototype.
15712
87e68db4
JB
157132011-10-27 Juanma Barranquero <lekktu@gmail.com>
15714
15715 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15716 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15717 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15718 (Fmove_to_window_line): Doc fix.
15719
435c1d67
CY
157202011-10-27 Chong Yidong <cyd@gnu.org>
15721
15722 * process.c (make_process): Set gnutls_state to NULL.
15723
15724 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15725 non-NULL, regardless of GNUTLS_INITSTAGE.
15726 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15727 an error. Set process slots as soon as we allocate them.
15728
15729 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15730
9c6c6f49
CY
157312011-10-27 Chong Yidong <cyd@gnu.org>
15732
9aba6043
SM
15733 * gnutls.c (emacs_gnutls_deinit): New function.
15734 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
15735 (Fgnutls_deinit, Fgnutls_boot): Use it.
15736
15737 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15738 (deactivate_process): Call emacs_gnutls_deinit.
15739
657d08d3
JB
157402011-10-27 Juanma Barranquero <lekktu@gmail.com>
15741
15742 * image.c (x_create_x_image_and_pixmap):
15743 * w32.c (sys_rename, w32_delayed_load):
15744 * w32font.c (fill_in_logfont):
15745 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15746
5430d399
JB
157472011-10-26 Juanma Barranquero <lekktu@gmail.com>
15748
15749 * w32fns.c (w32_default_color_map): New function,
15750 extracted from Fw32_default_color_map.
a7ef684b 15751 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 15752
fe0055fa
PE
157532011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15754
15755 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15756
e6346438
SM
157572011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15758
15759 * keyboard.c (test_undefined): New function (bug#9751).
15760 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15761
e112cc37
ET
157622011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15763
15764 * sysdep.c (init_sys_modes): Fix the check for the controlling
15765 terminal (Bug#6649).
15766
7b5d6677
EZ
157672011-10-20 Eli Zaretskii <eliz@gnu.org>
15768
15769 * dispextern.h (struct bidi_it): New member next_en_type.
15770
15771 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15772 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15773 current character, check also for next_en_type being WEAK_EN.
15774 (bidi_resolve_weak): Don't enter the expensive loop if the current
15775 position is before next_en_pos. Record the bidi type of the first
15776 non-ET, non-BN character we find, in addition to its position.
15777 (bidi_level_of_next_char): Invalidate next_en_type when
15778 next_en_pos is over-stepped.
15779
7da0b018
PE
157802011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15781
15782 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15783 * editfns.c: Rewrite current-time-zone so that it invokes
15784 the equivalent of (format-time-string "%Z") to get the time zone name.
15785 This fixes a bug when the time zone name contains characters that
15786 need converting from the system time locale to Emacs internal format.
15787 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15788 that patch fixed format-time-string to do the conversion, but
15789 I forgot to fix current-time-zone.
15790 (format_time_string): New function, containing most of
15791 what Fformat_time_string used to contain.
15792 (Fformat_time_string): Rewrite in terms of format_time_string.
15793 This doesn't change this function's behavior.
15794 (current-time-zone): Rewrite to use format_time_string.
15795 This fixes the bug reported by Michael Schierl in
15796 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15797 Jason Rumney's 2007-06-07 change worked around this bug, but
15798 didn't fix it.
15799 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15800
8547b010
EZ
158012011-10-19 Eli Zaretskii <eliz@gnu.org>
15802
15803 * xdisp.c (start_display): If the character at POS is displayed
15804 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
15805 (try_window_reusing_current_matrix): If a line ends in a display
15806 vector or the next line starts in a display vector, continue
15807 redrawing the window even though the character position of
15808 start_row was reached.
8547b010
EZ
15809 (Bug#9771, part 2)
15810
4e948d15
CY
158112011-10-18 Chong Yidong <cyd@gnu.org>
15812
15813 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15814 with nobreak-char-display too.
15815
4787455f
EZ
158162011-10-18 Eli Zaretskii <eliz@gnu.org>
15817
15818 Fix part 3 of bug#9771.
15819 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15820 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15821 non-neutral characters if the current character is a paragraph
15822 separator (a.k.a. Newline). This avoids running the same
15823 expensive loop twice, once when we consume the preceding newline
15824 and the other time when the line actually needs to be displayed.
15825 Avoid the loop when we see neutrals on the base embedding level
15826 following a character whose directionality is the same as the
15827 paragraph's. This avoids running the expensive loop when a line
15828 ends in a long sequence of neutrals, like control characters.
15829 Add assertion against STRONG_AL type. Slightly rearrange code
15830 that determines the type of a neutral given the first non-neutral
15831 that follows it.
15832 (bidi_level_of_next_char): Set next_en_pos to zero when
15833 invalidating its info.
15834
2c91f553
EZ
158352011-10-17 Eli Zaretskii <eliz@gnu.org>
15836
15837 * xdisp.c (push_display_prop): Determine whether to record string
15838 or buffer position by IT->string, not by IT->method. Allow
15839 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
15840 (move_it_vertically_backward): Don't look for character position
15841 immediately after the newline when in a continuation line.
15842 (Bug#9771, part 1)
2c91f553 15843
c7b08b0d
MR
158442011-10-15 Martin Rudalics <rudalics@gmx.at>
15845
15846 * window.c (coordinates_in_window): Rewrite and delabelize
15847 vertical border check. (Bug#5357) (Bug#9618)
15848
6b02f655
SM
158492011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15850
15851 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15852 errors in XSetWindowBorder (bug#9310).
15853
81d40c92
DA
158542011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15855
15856 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15857 avoid crash when xmalloc overrun checking is enabled.
15858
d4172c3b
EZ
158592011-10-13 Eli Zaretskii <eliz@gnu.org>
15860
15861 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15862 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15863 cursor motion with <left> and <right> arrow keys.
15864
15865 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15866 some callers set that themselves.
15867
b00eea75
EZ
158682011-10-12 Eli Zaretskii <eliz@gnu.org>
15869
15870 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15871 display string and the previous row comes from the same string and
15872 is empty. (Bug#9739) (Bug#9738)
15873
8fe012c4
SM
158742011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15875
15876 * doc.c (get_doc_string): Encode file name (bug#9735).
15877
0074aef2
EZ
158782011-10-12 Eli Zaretskii <eliz@gnu.org>
15879
79beb178
EZ
15880 * bidi.c (bidi_level_of_next_char):
15881 * xdisp.c (get_visually_first_element): Remove old incorrect
15882 comments regarding the Unicode Line Separator character.
15883
0074aef2
EZ
15884 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15885
6e4b3fbe
DA
158862011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15887
15888 * alloc.c (Fgc_status): Do not access beyond zombies array
15889 boundary if nzombies > MAX_ZOMBIES.
15890 * alloc.c (dump_zombies): Add missing format specifier.
15891
0324f3af
PE
158922011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15893
b5525cac
PE
15894 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15895 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15896
0324f3af
PE
15897 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15898 Some packages use them to denote characters with modifiers.
15899
e9b5f888
AS
159002011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15901
15902 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15903 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15904 matching a pp-number. Rename parameter var to var1.
15905
127827c0
SM
159062011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15907
15908 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15909
c8fd3bd0
GM
159102011-10-08 Glenn Morris <rgm@gnu.org>
15911
15912 * callint.c (Fcall_interactively): Give a more explicit error for the
15913 'c' case with a non-character input. (Bug#8479)
15914
352ec8ff
EZ
159152011-10-08 Eli Zaretskii <eliz@gnu.org>
15916
03669ccb
EZ
15917 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15918 lines.
7061c986
EZ
15919 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15920 lines that are hscrolled on the left.
03669ccb 15921
352ec8ff
EZ
15922 * dispnew.c (buffer_posn_from_coords): Account for a possible
15923 presence of header-line. (Bug#4426)
15924
a66cfb1c
SM
159252011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15926
6b02f655
SM
15927 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15928 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 15929
7c5ee88e
PE
159302011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15931
15932 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15933 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15934 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15935 this makes Emacs dump core during garbage collection on rare
15936 occasions. sizeof is obviously inferior to offsetof here, so
15937 stick with offsetof.
15938 (GC_POINTER_ALIGNMENT): New macro.
15939 (mark_memory): Omit 3rd (offset) arg; caller changed.
15940 Don't assume EMACS_INT alignment is the same as pointer alignment.
15941
df1bbe5b
SM
159422011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15943
15944 * keyboard.c (read_key_sequence_remapped): New var.
15945 (read_key_sequence): Compute remapping in the right buffer.
15946 (command_loop_1): Use read_key_sequence's remapping directly.
15947
51553db6
SM
159482011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15949
32c1fffd
SM
15950 * dired.c (file_name_completion): Don't expand file name.
15951 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15952 before checking file name handler.
15953
51553db6
SM
15954 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15955 they've been requested explicitly (bug#9591).
15956
b6bd1599 159572011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
15958
15959 * keymap.c (Fsingle_key_description): Use make_specified_string
15960 instead of build_string to build string from push_key_description.
15961 (Bug#5193)
15962
f701dc2a
PE
159632011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15964
4222c55d
PE
15965 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15966 This fixes a Y2038 bug on 64-bit hosts.
15967 * buffer.c (reset_buffer):
15968 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15969 (Fclear_buffer_auto_save_failure):
15970 Use 0, not -1, to represent an unset failure time, since time_t
15971 might not be signed.
15972
f701dc2a
PE
15973 Remove dependency on glibc malloc internals.
15974 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15975 Move back here from lisp.h, but with their new implementations.
15976 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15977 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15978 * charset.c (charset_table_init): New static var.
15979 (syms_of_charset): Use it instead of xmalloc. This removes a
15980 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15981 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15982 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15983 Move back to alloc.c.
15984 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15985 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15986
9ceebf39
JD
159872011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15988
15989 * nsterm.m (windowDidResize): Call x_set_window_size only when
15990 ns_in_resize is true. Otherwise set pixelwidth/height and
15991 call change_frame_size (Bug#9628).
15992
cb993c58
PE
159932011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15994
3930c88b
PE
15995 Port --enable-checking=all to Fedora 14 x86-64.
15996 * charset.c (syms_of_charset): Also account for glibc malloc's
15997 internal overhead when calculating the initial malloc maximum.
15998
cb993c58
PE
15999 Port --enable-checking=all to Fedora 14 x86.
16000 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16001 Move to lisp.h.
16002 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16003 (overrun_check_realloc, overrun_check_free):
16004 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16005 That way, xmalloc returns a properly-aligned pointer even if
16006 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16007 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16008 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16009 into account when calculating the initial malloc maximum.
16010 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16011 Move here from alloc.c, so that charset.c can use it too.
16012 Properly align; the old code wasn't right for common 32-bit hosts
16013 when configured with --enable-checking=all.
16014 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16015 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16016
31bed486
EZ
160172011-09-29 Eli Zaretskii <eliz@gnu.org>
16018
04c70788 16019 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
16020 use EDOM.
16021
fbcaa2f3
EZ
160222011-09-28 Eli Zaretskii <eliz@gnu.org>
16023
16024 * xdisp.c (compute_display_string_end): If there's no display
16025 string at CHARPOS, return -1.
16026
16027 * bidi.c (bidi_fetch_char): When compute_display_string_end
16028 returns a negative value, treat the character as a normal
16029 character not covered by a display string. (Bug#9624)
16030
a239d4e9
JB
160312011-09-28 Juanma Barranquero <lekktu@gmail.com>
16032
16033 * lread.c (Fread_from_string): Fix typo in docstring.
16034
88652fd5
EZ
160352011-09-27 Eli Zaretskii <eliz@gnu.org>
16036
16037 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16038 newline, reseat the iterator instead of bidi-iterating there one
16039 character at a time. (Bug#9610)
32c1fffd
SM
16040 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16041 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 16042
ed497dd4
AS
160432011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16044
16045 * lread.c (readevalloop): Use correct code for NBSP.
16046 (read1): Likewise. (Bug#9608)
16047
b2bf61aa
MA
160482011-09-25 Michael Albinus <michael.albinus@gmx.de>
16049
16050 * dbusbind.c (Fdbus_register_signal): When service is not
16051 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16052
32bbb17c
GM
160532011-09-25 Glenn Morris <rgm@gnu.org>
16054
16055 * buffer.c (truncate-lines): Doc fix.
16056
94e0933e
CY
160572011-09-24 Chong Yidong <cyd@stupidchicken.com>
16058
16059 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16060 (Fset_window_next_buffers): Doc fix.
16061
cddde921
GM
160622011-09-24 Glenn Morris <rgm@gnu.org>
16063
16064 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16065
1260aef1
PE
160662011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16067
25b4bfa0
PE
16068 Fix minor problems found by static checking.
16069 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
16070 * indent.c (Fvertical_motion): Fix == vs = typo.
16071
e3cbd34b
EZ
160722011-09-24 Eli Zaretskii <eliz@gnu.org>
16073
a66cfb1c
SM
16074 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16075 Default value is now t. Doc fix.
6bf7006f 16076
e3cbd34b 16077 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 16078 logic when moving up, not only when moving down. Fix the
e3cbd34b 16079 confusing name and values of the it_overshoot_expected variable;
32c1fffd 16080 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
16081
16082 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16083 CHARPOS is covered by a display string which includes newlines.
16084 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16085 is covered by a display string with embedded newlines.
16086
a3de0cbd
MA
160872011-09-24 Michael Albinus <michael.albinus@gmx.de>
16088
16089 * dbusbind.c (Fdbus_register_signal): Add match rule to
16090 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
16091 (Fdbus_register_method, Vdbus_registered_objects_table):
16092 Fix docstring.
a3de0cbd 16093
b260039d
JM
160942011-09-24 Jim Meyering <meyering@redhat.com>
16095
32c1fffd 16096 do not ignore write error for any output size
b260039d
JM
16097 The previous change was incomplete.
16098 While it makes emacs --batch detect the vast majority of stdout
16099 write failures, errors were still ignored whenever the output size is
16100 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16101 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16102 && echo FAIL: ignored write error
16103 FAIL: ignored write error
16104 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16105 && echo FAIL: ignored write error
16106 FAIL: ignored write error
16107 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16108
8eca8a7c
AS
161092011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16110
16111 * emacs.c (Fkill_emacs): In noninteractive mode exit
16112 non-successfully if a write error occurred on stdout. (Bug#9574)
16113
3341db62
EZ
161142011-09-21 Eli Zaretskii <eliz@gnu.org>
16115
16116 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16117 the xassert test.
16118
16119 * dispextern.h (struct it): Update the comment documenting what
16120 can it->OBJECT be.
16121
8c203dbf
EZ
161222011-09-20 Eli Zaretskii <eliz@gnu.org>
16123
16124 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16125 a display string, extend search for cursor position to end of row.
16126 (find_row_edges): If the row ends in a newline from a display
16127 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16128 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
16129 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16130 non-empty line. Fixes confusing cursor motion with arrow keys at
16131 the beginning of a line that starts with whitespace.
8c203dbf 16132
a4824228
LMI
161332011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16134
16135 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16136 (bug#9493).
16137
33ed493b
CY
161382011-09-18 Chong Yidong <cyd@stupidchicken.com>
16139
16140 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16141 boolean (Bug#9154).
16142
56cd55c8
EZ
161432011-09-18 Eli Zaretskii <eliz@gnu.org>
16144
16145 * xdisp.c (display_line): Record maximum and minimum buffer
16146 positions even if no glyphs were produced (e.g., by a zero-width
16147 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16148 buffer positions that will be removed from the glyph row because
16149 they don't fit.
c02dcedf
EZ
16150 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16151 column is beyond frame width: don't subtract 1 "pixel" when
16152 computing width of the stretch.
3e62b7e0
EZ
16153 (reseat_at_next_visible_line_start): Undo the change made on
16154 2011-09-17 that saved paragraph information and restored it after
16155 the call to `reseat'. (Bug#9545)
56cd55c8 16156
5ed99d36 161572011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
16158
16159 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16160 and turn window cursor on if cleared (Bug#9415).
16161
5ed99d36 161622011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
16163
16164 * search.c (boyer_moore): Take unibyte characters from pattern
16165 literally. (Bug#9458)
16166
9bade7b2
EZ
161672011-09-18 Eli Zaretskii <eliz@gnu.org>
16168
16169 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16170
e5e9d610
PE
161712011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16172
87e4427a
PE
16173 Fix minor problem found by static checking.
16174 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16175 initialized, to pacify gcc -Wuninitialized.
16176
e5e9d610
PE
16177 * fileio.c: Report proper errno when syscall falls.
16178 (Finsert_file_contents): Save and restore errno,
16179 so that report_file_error outputs the correct diagnostic.
16180 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16181
a1674f0b
EZ
161822011-09-18 Eli Zaretskii <eliz@gnu.org>
16183
16184 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16185
fbfb6dd4
EZ
161862011-09-17 Eli Zaretskii <eliz@gnu.org>
16187
16188 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16189 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16190
bb187662
EZ
161912011-09-17 Eli Zaretskii <eliz@gnu.org>
16192
1137e8b8 16193 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 16194 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
16195
16196 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16197 (bidi_find_paragraph_start): Search back for paragraph beginning
16198 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16199 (bidi_move_to_visually_next): Only trigger paragraph-related
16200 computations when the last character is a newline or at EOB, not
16201 just any NEUTRAL_B. (Bug#9470)
16202
bb187662
EZ
16203 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16204 truncated lines if point is covered by a display string. (Bug#9524)
16205
2e621251
PE
162062011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16207
16208 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16209 (cons_to_x_long): New function.
16210 (lisp_data_to_selection_data): Use it. Correct the test for
16211 short-versus-long data; it was negated. Break out of vector
16212 loop, for efficiency, when a long datum is discovered.
16213
91a15bc6
SM
162142011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16215
16216 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16217
b41c3a35
EZ
162182011-09-16 Eli Zaretskii <eliz@gnu.org>
16219
16220 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16221 GCC PR/17406) by declaring this function with external scope.
16222
7812ba2d
PE
162232011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16224
16225 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16226 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16227
cf7edc2a
AS
162282011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16229
16230 * editfns.c (Fformat): Correctly handle text properties on "%%".
16231
bd01620e
EZ
162322011-09-15 Eli Zaretskii <eliz@gnu.org>
16233
16234 * xterm.c (x_draw_composite_glyph_string_foreground):
16235 * w32term.c (x_draw_composite_glyph_string_foreground):
16236 * term.c (encode_terminal_code):
16237 * composite.c (composition_update_it, get_composition_id):
16238 * xdisp.c (get_next_display_element)
16239 (fill_composite_glyph_string): Add comments about special meaning
16240 of TAB characters in a composition.
16241
a02719a3
PE
162422011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16243
16244 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
16245 This occurs when processing a multibyte format.
16246 Problem reported by Wolfgang Jenker.
a02719a3 16247
72589a3c
JB
162482011-09-15 Johan Bockgård <bojohan@gnu.org>
16249
16250 * xdisp.c (try_cursor_movement): Only check for exact match if
16251 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16252
1c14176c
PE
162532011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16254
16255 Remove unused external symbols.
16256 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16257 * xdisp.c (calc_pixel_width_or_height): Now static.
16258 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16259 * indent.c (check_display_width):
16260 * w32term.c: Fix comment to match code.
16261 * xterm.c, xterm.h (x_catching_errors): Remove.
16262
d2eea5b5
PE
162632011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16264
16265 * xselect.c: Use signed conversions more consistently (Bug#9498).
16266 (selection_data_to_lisp_data): Assume incoming selection data are
16267 signed integers, not unsigned. This is to be consistent with
16268 outgoing selection data, which was modified to use signed integers
16269 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16270 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16271 expects long, not unsigned long.
16272
46888499
EZ
162732011-09-14 Eli Zaretskii <eliz@gnu.org>
16274
16275 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16276 computation of loop end. Reported by Johan Bockgård
16277 <bojohan@gnu.org>.
16278
ef8ef9fb
CY
162792011-09-13 Chong Yidong <cyd@stupidchicken.com>
16280
16281 * frame.c (Fother_visible_frames_p): Function deleted.
16282
fa819fed
EZ
162832011-09-12 Eli Zaretskii <eliz@gnu.org>
16284
16285 * indent.c (compute_motion): Process display vector front to back
16286 rather than the other way around. (Bug#2496)
16287
2ba8e008
SM
162882011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16289
16290 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16291
20f53c69
CY
162922011-09-11 Chong Yidong <cyd@stupidchicken.com>
16293
16294 * minibuf.c (Fread_from_minibuffer): Doc fix.
16295
d562d7a4
EZ
162962011-09-11 Eli Zaretskii <eliz@gnu.org>
16297
16298 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16299 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16300
1c4d7f3d
LMI
163012011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16302
16303 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16304 value for non-existent files.
16305
b885bf36
EZ
163062011-09-11 Eli Zaretskii <eliz@gnu.org>
16307
16308 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16309 set its "size" to -1. This will set the modtime_size field of
16310 the corresponding buffer to -1, which is what
16311 verify-visited-file-modtime expects for files that do not exist.
16312 (Bug#9139)
16313
6612f0bf
PE
163142011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16315
16316 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16317 here ...
16318 * lisp.h: ... from here. push_key_description is no longer
16319 defined in keyboard.c, so its declaration should not be in
16320 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16321 logically belongs with push_key_description.
16322
dfb3f755
PE
163232011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16324
16325 * buffer.h: Include <sys/types.h> instead of <time.h>.
16326 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16327 Problem reported by Herbert J. Skuhra.
16328
3134906c
LMI
163292011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16330
16331 * xml.c (parse_region): Make the parsing work for
16332 non-comment-starting XML files again (bug#9144).
16333
8d903f4e
AS
163342011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16335
16336 * image.c (gif_load): Fix calculation of bottom and right corner.
16337 (Bug#9468)
16338
80ad64f4
EZ
163392011-09-10 Eli Zaretskii <eliz@gnu.org>
16340
16341 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16342 redisplay in small windows.
16343
208a048d
EZ
163442011-09-09 Eli Zaretskii <eliz@gnu.org>
16345
16346 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16347
9b1c252e
MR
163482011-09-08 Martin Rudalics <rudalics@gmx.at>
16349
16350 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16351 Operate on live windows only.
16352
2949f33b
JB
163532011-09-08 Juanma Barranquero <lekktu@gmail.com>
16354
16355 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16356
e08dcafd
EZ
163572011-09-07 Eli Zaretskii <eliz@gnu.org>
16358
16359 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16360 only under bidi iteration.
16361
115b96bd
JD
163622011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16363
16364 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16365
c8199d0f
PE
163662011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16367
16368 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16369 Without this fix, the command to link temacs failed due to an
16370 undefined symbol __builtin_isnan. This is because
16371 /usr/include/iso/math_c99.h #defines isnan(x) to
16372 __builtin_isnan(x), but the bundled gcc, which identifies itself
16373 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16374 a __builtin_isnan.
16375 * floatfns.c (isnan): #undef, and then #define to a clone of
16376 what's in data.c.
16377 (Fisnan): Always define, since it's always available now.
16378 (syms_of_floatfns): Always define isnan at the Lisp level.
16379
e39b275c 163802011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
16381
16382 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16383
b2db44d9 163842011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 16385
f4af5137 16386 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
16387 The previous code assumed that file offsets (off_t values) fit in
16388 EMACS_INT variables, which is not true on typical 32-bit hosts.
16389 The code messed up by falsely reporting buffer overflow in cases
16390 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16391 when "big" contains more than 2**29 bytes, even though this
16392 inserts just one byte and does not overflow the buffer.
16393 (Finsert_file_contents): Store file offsets as off_t
16394 values, not as EMACS_INT values. Check for overflow when
16395 converting between EMACS_INT and off_t. When checking for
16396 buffer overflow or for overlap, take the offsets into account.
16397 Don't use EMACS_INT for small values where int suffices.
16398 When checking for overlap, fix a typo: ZV was used where
16399 ZV_BYTE was intended.
16400 (Fwrite_region): Don't assume off_t fits into 'long'.
16401 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16402
ecfc0a49
MA
164032011-09-05 Michael Albinus <michael.albinus@gmx.de>
16404
16405 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16406
6511acf2 164072011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 16408
0999621a 16409 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
16410
16411 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 16412 (esprintf, exprintf, evxprintf): New functions.
62f19c19 16413 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 16414 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
16415 (modify_event_symbol): Do not assume that the length of
16416 name_alist_or_stem is safe to alloca and fits in int.
16417 (Fexecute_extended_command): Likewise for function name and binding.
16418 (Frecursion_depth): Wrap around reliably on integer overflow.
16419 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16420 since some callers pass EMACS_INT values.
16421 (Fsingle_key_description): Don't crash if symbol name contains more
16422 than MAX_ALLOCA bytes.
16423 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16424 (get_minibuffer): Arg is now EMACS_INT, not int.
16425 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 16426 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
16427 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16428
2be7d702
PE
16429 * dbusbind.c (signature_cat): New function.
16430 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
16431 Do not overrun buffer; instead, report string overflow.
16432
9d1df220
PE
16433 * dispnew.c (add_window_display_history): Don't overrun buffer.
16434 Truncate instead; this is OK since it's just a log.
16435
33ef5c64
PE
16436 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16437 even if the time zone offset is outlandishly large.
16438 Don't mishandle offset == INT_MIN.
16439
66c6fdd5
PE
16440 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16441 when creating daemon; the previous buffer-overflow check was incorrect.
16442
d749b01b
PE
16443 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16444 which has the guts of the old verror function.
16445
b5cd1905
PE
16446 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16447 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16448
6e1a67fb
PE
16449 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16450 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 16451 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 16452 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
16453 length of string rather than counting it via multiple sprintfs;
16454 that's simpler and more reliable.
c21721cc
PE
16455 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16456 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16457 sprintf, in case result does not fit in int.
16458
c57b67fc
PE
16459 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16460 (fontset_from_font): Print it.
16461
8a401434
PE
16462 * frame.c (tty_frame_count): Now printmax_t, not int.
16463 (make_terminal_frame, set_term_frame_name): Print it.
16464 (x_report_frame_params): In X, window IDs are unsigned long,
16465 not signed long, so print them as unsigned.
16466 (validate_x_resource_name): Check for implausibly long names,
16467 and don't assume name length fits in 'int'.
16468 (x_get_resource_string): Don't blindly alloca invocation name;
16469 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16470 not fit in int.
16471
6e1a67fb
PE
16472 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16473 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
16474 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16475
0df02bf3
PE
16476 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16477 Use esprintf, not sprintf, in case result does not fit in int.
16478
48e30793
PE
16479 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16480 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16481 it as a large positive number.
16482 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16483 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16484
a66ff6d8
PE
16485 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16486 in case result does not fit in int.
16487
aca216ff
PE
16488 * print.c (float_to_string): Detect width overflow more reliably.
16489 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16490 buffer overrun. Don't assume list length fits in 'int'. Treat
16491 print length of 0 as 0, not as infinity; to be consistent with other
16492 uses of print length in this function. Don't overflow print length
16493 index. Don't assume hash table size fits in 'long', or that
16494 vectorlike size fits in 'unsigned long'.
16495
31c286f7
PE
16496 * process.c (make_process): Use printmax_t, not int, to format
16497 process-name gensyms.
16498
55e5faa1
PE
16499 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16500
80f2e268
PE
16501 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16502 to avoid potential buffer overrun.
16503
670741ab
PE
16504 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16505 if X resource line is longer than 512 bytes.
16506
b7163a50
PE
16507 * xfns.c (x_window): Make sprintf buffer a bit bigger
16508 to avoid potential buffer overrun.
16509
ae58ff1f
PE
16510 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16511
c43c8a6a
PE
16512 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16513
3f8236f4
PE
165142011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16515
53e9fe90 16516 Integer overflow fixes for scrolling, etc.
6511acf2
PE
16517 Without these, Emacs silently mishandles large integers sometimes.
16518 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
16519 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16520
6511acf2
PE
16521 * xdisp.c (try_window_id): Check Emacs fixnum range before
16522 converting to 'int'.
806add1d 16523
6511acf2 16524 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
16525 Check that an Emacs fixnum is in range before assigning it to 'int'.
16526 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16527 values converted from Emacs fixnums.
16528 (Frecenter): Don't wrap around a line count if it is out of 'int'
16529 range; instead, treat it as an extreme value.
16530 (Fset_window_configuration, compare_window_configurations):
16531 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16532
6511acf2
PE
16533 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16534 that can exceed INT_MAX. Check that EMACS_INT value is in range
16535 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
16536 (match_limit): Don't assume that a fixnum can fit in 'int'.
16537
6511acf2 16538 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
16539 exceed INT_MAX.
16540
6511acf2 16541 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
16542 (Fvertical_motion): Don't wrap around LINES values that don't fit
16543 in 'int'. Instead, treat them as extreme values. This is good
16544 enough for windows, which can't have more than INT_MAX lines anyway.
16545
fcb901a7
LMI
165462011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16547
0f2f6b6d
LMI
16548 * Require libxml/parser.h to avoid compilation warning.
16549
fcb901a7
LMI
16550 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16551
16552 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16553 since this reportedly can destroy thread storage.
16554
6e20a0d4
CY
165552011-08-30 Chong Yidong <cyd@stupidchicken.com>
16556
16557 * syntax.c (find_defun_start): Update all cache variables if
16558 exiting early (Bug#9401).
16559
148ae00e
EZ
165602011-08-30 Eli Zaretskii <eliz@gnu.org>
16561
f6cfbd8f
EZ
16562 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16563
148ae00e
EZ
16564 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16565 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16566 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16567
16568 * term.c (tty_append_glyph): New function.
16569 (produce_stretch_glyph): Static function and its prototype deleted.
16570
a66cfb1c
SM
16571 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16572 Add prototypes.
148ae00e 16573
c4a07a4c
PE
165742011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16575
16576 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16577 when checking :margin (Bug#9390).
16578 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 16579 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
16580 so that the name doesn't mislead. All uses changed.
16581
6bc8cd65
JB
165822011-08-28 Johan Bockgård <bojohan@gnu.org>
16583
16584 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16585 set_tty_hooks.
16586
dca4927e
EZ
165872011-08-27 Eli Zaretskii <eliz@gnu.org>
16588
16589 * xdisp.c (move_it_to): Don't bail out early when reaching
16590 position beyond to_charpos, if we are scanning backwards.
16591 (move_it_vertically_backward): When DY == 0, make sure we get to
16592 the first character in the line after the newline.
16593
f2cad773
PE
165942011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16595
16596 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16597 (ccl_driver): Do not generate an out-of-range pointer.
16598 (Fccl_execute_on_string): Remove unnecessary check for
16599 integer overflow, noted by Stefan Monnier in
16600 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16601 Remove a FIXME that didn't need fixing.
16602 Simplify the newly-introduced buffer reallocation code.
16603
0cae2cdb
JB
166042011-08-27 Juanma Barranquero <lekktu@gmail.com>
16605
16606 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16607
5fc295a4 166082011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 16609
70c60eb2 16610 Integer and memory overflow issues (Bug#9196).
726e0ab1 16611
d31850da
PE
16612 * doc.c (get_doc_string): Rework so that
16613 get_doc_string_buffer_size is the actual buffer size, rather than
16614 being 1 less than the actual buffer size; this makes xpalloc more
16615 convenient.
16616
a69fbedb
PE
16617 * image.c (x_allocate_bitmap_record, cache_image):
16618 * xselect.c (Fx_register_dnd_atom):
16619 Simplify previous changes by using xpalloc.
16620
fe5c5d37
PE
16621 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16622 since either will do and ptrdiff_t is convenient with xpalloc.
16623
0065d054
PE
16624 * charset.c (charset_table_size)
16625 (struct charset_sort_data.priority): Now ptrdiff_t.
16626 (charset_compare): Don't overflow if priorities differ greatly.
16627 (Fsort_charsets): Don't assume list length fits in int.
16628 Check for size-calculation overflow when allocating sort data.
16629 (syms_of_charset): Allocate an initial charset table that is
16630 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16631
16632 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16633
16634 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16635 The actual value is always <= INT_MAX, and leaving it unsigned made
16636 overflow checking harder.
16637
16638 * dispextern.h (struct glyph_matrix.rows_allocated)
16639 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16640 with xpalloc. The values are still always <= INT_MAX.
16641
16642 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16643
16644 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16645 (SAFE_NALLOCA): New macro.
16646
16647 * region-cache.c (struct boundary.pos, find_cache_boundary)
16648 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16649 (set_cache_region, invalidate_region_cache)
16650 (revalidate_region_cache, know_region_cache, region_cache_forward)
16651 (region_cache_backward, pp_cache):
16652 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16653 so that ptrdiff_t * can be passed to xpalloc.
16654 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16655 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16656 (pp_cache): Don't assume cache_len fits in int.
16657 * region-cache.h: Adjust extern decls to match.
16658
16659 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16660 EMACS_INT, since either will do, for xpalloc.
16661
16662 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16663 (xnmalloc, xnrealloc, xpalloc): New functions.
16664
726e0ab1
PE
16665 * bidi.c (bidi_shelve_header_size): New constant.
16666 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16667 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16668
51f30bc5 16669 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
16670 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16671 (overlay_strings):
16672 Don't update size of array until after memory allocation succeeds,
16673 because xmalloc/xrealloc may not return.
0065d054
PE
16674 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16675 now that we have proper integer overflow checking.
16676 (record_overlay_string, overlay_strings): Catch overflows when
16677 calculating size of overlay_str_buf.
726e0ab1 16678
0065d054
PE
16679 * callproc.c (Fcall_process): Check for size overflow when
16680 calculating size of args2.
16681 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16682 Normally we prefer signed values, but sticking with ptrdiff_t would
16683 require adding more-complicated checks.
726e0ab1
PE
16684
16685 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16686 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16687 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 16688 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
16689
16690 * character.c (Fstring): Check for size-calculation overflow.
16691
16692 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16693 unnecessary integer overflow. Check for size overflow.
16694 (encode_coding_object): Don't update size until xmalloc succeeds.
16695
16696 * composite.c (get_composition_id): Check for overflow in glyph
16697 length calculations.
16698
16699 Integer and memory overflow fixes for display code.
16700 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16701 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16702 (scrolling_window): Check for overflow in size calculations.
16703 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16704 Don't assume glyph table len fits in int.
16705 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16706 (row_table_size): Now ptrdiff_t, not int.
16707 (scrolling_window): Avoid overflow in size calculations.
16708 Don't update size until allocation succeeds.
16709 * fns.c (concat): Check for overflow in size calculations.
16710 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16711 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16712 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16713
16714 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16715 (get_doc_string): Check for size calculation overflow.
16716 Don't update size until allocation succeeds.
16717 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16718 EMACS_INT, where ptrdiff_t will do.
16719 (Fsubstitute_command_keys): Check for string overflow.
16720
16721 * editfns.c (set_time_zone_rule): Don't assume environment length
16722 fits in int.
16723 (message_length): Now ptrdiff_t, not int.
16724 (Fmessage_box): Don't update size until allocation succeeds.
16725 Don't assume message length fits in int.
16726 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16727
0065d054
PE
16728 * emacs.c (main): Do not reallocate argv, since there is a null at
16729 the end that can be overwritten, and this way there's no need to
16730 worry about size-calculation overflow.
16731 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
16732
16733 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16734 alloc succeeds.
16735 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16736
16737 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16738 (x_set_scroll_bar_width, x_figure_window_size):
16739 Check for integer overflow.
16740 (x_set_alpha): Do not assume XINT fits in int.
16741
16742 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16743 This is for the members text_lines, text_cols, total_lines, total_cols,
16744 where the system imposes an 'int' limit.
16745
16746 * fringe.c (Fdefine_fringe_bitmap):
16747 Don't update size until alloc works.
16748
16749 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16750 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16751
16752 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16753 Check for size-calculation overflow.
16754 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16755 do, as we prefer signed integers.
16756 (id_to_widget.max_size, id_to_widget.used)
16757 (xg_store_widget_in_map, xg_remove_widget_from_map)
16758 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16759 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16760 Use and return ptrdiff_t, not int.
16761 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16762 * gtkutil.h: Change prototypes to match the above.
16763
16764 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16765 are duplicate now that they've been promoted to lisp.h.
16766 (x_allocate_bitmap_record, x_alloc_image_color)
16767 (make_image_cache, cache_image, xpm_load):
16768 Don't update size until alloc is done.
16769 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16770 (x_detect_edges):
3256efce 16771 Check for size calculation overflow.
726e0ab1
PE
16772 (ct_colors_allocated_max): New constant.
16773 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16774 overflow.
3256efce 16775
726e0ab1
PE
16776 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16777 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16778 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16779 Use ptrdiff_t, not int, to count maps.
16780 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
16781 calculations. Don't update size until allocation succeeds.
16782 Redo calculations to avoid overflow.
726e0ab1
PE
16783 * keyboard.h: Change prototypes to match the above.
16784
16785 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16786 to count maps.
16787 (current_minor_maps): Check for size calculation overflow.
16788 * keymap.h: Change prototypes to match the above.
16789
16790 * lread.c (read1, init_obarray): Don't update size until alloc done.
16791
16792 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16793 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16794
726e0ab1
PE
16795 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16796 Now ptrdiff_t, not int.
16797 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16798 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16799
16800 * process.c (Fnetwork_interface_list): Check for overflow
16801 in size calculation.
16802
16803 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16804
16805 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16806 overflow. Don't bother calling xmalloc when xrealloc will do.
16807
16808 * search.c (Freplace_match): Check for size calculation overflow.
16809 (Fset_match_data): Don't assume list lengths fit in 'int'.
16810
16811 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16812 for command line length. Do not attempt to address one before the
16813 beginning of an array, as that's not portable.
16814
16815 * term.c (max_frame_lines): Remove; unused.
16816 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16817 not int.
16818 (encode_terminal_code, calculate_costs): Check for size
16819 calculation overflow.
16820 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16821 table lengths and related sizes. Don't update size until alloc
16822 done. Redo calculations to avoid overflow.
16823 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16824
16825 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16826 subtracting pointers.
16827 (gobble_line): Check for overflow more carefully. Don't update size
16828 until alloc done.
16829
16830 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16831 Don't update size until alloc done.
16832 Redo size calculations to avoid overflow.
16833 Check for size calculation overflow.
0065d054 16834 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
16835
16836 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16837 Use ptrdiff_t, not int, for sizes.
16838 (store_mode_line_noprop_char): Don't update size until alloc done.
16839
0065d054
PE
16840 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16841 Use ptrdiff_t, not int, for sizes.
16842 (Finternal_make_lisp_face, cache_face):
16843 Check for size calculation overflow.
16844 (cache_face): Treat size calculation overflows as if they were
16845 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
16846
16847 * xfns.c (x_encode_text, x_set_name_internal)
16848 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16849 sizes, since they can exceed INT_MAX in size. Check for size
16850 calculation overflow.
16851
0065d054
PE
16852 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16853 (xg_select): Check for size calculation overflow.
726e0ab1
PE
16854 Don't update size until alloc done.
16855
0065d054 16856 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 16857 as sprintf is limited to int lengths.
1d526e2f 16858
252c5ee1
PE
16859 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16860 (X_LONG_MIN): New macros.
864d7ce7
PE
16861 Use them to make the following changes clearer.
16862 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16863 This change doesn't affect the value now, but it may help remind
16864 future maintainers not to raise the value too much later.
16865 (SELECTION_QUANTUM): Remove, replacing with ...
16866 (selection_quantum): ... new function, which avoids overflow.
16867 All uses changed.
16868 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16869 assumption that selection length fits in 'int'.
16870 (x_reply_selection_request, x_handle_selection_request)
16871 (x_get_window_property, receive_incremental_selection)
16872 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16873 (lisp_data_to_selection_data, clean_local_selection_data):
16874 Use ptrdiff_t, not int, to record length of selection.
16875 (x_reply_selection_request, x_get_window_property)
16876 (receive_incremental_selection, x_property_data_to_lisp):
16877 Redo calculations to avoid overflow.
16878 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 16879 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
16880 something.
16881 (x_get_window_property, receive_incremental_selection)
16882 (lisp_data_to_selection_data, x_property_data_to_lisp):
16883 Check for size-calculation overflow.
16884 (x_get_window_property, receive_incremental_selection)
16885 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16886 Don't store size until memory allocation succeeds.
16887 (x_get_window_property): Plug memory leak on memory exhaustion.
16888 Don't double-block input; malloc is safe here. Don't assume 2**34
16889 - 4 fits in unsigned long. Add an xassert to check
16890 XGetWindowProperty overflow. Be more careful about overflow
16891 calculations, and distinguish size from memory overflow better.
16892 (receive_incremental_selection): When tracing, don't assume
16893 unsigned int is less than INT_MAX.
16894 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16895 harmful) conversions of unsigned short to int.
16896 (lisp_data_to_selection_data): Don't assume that integers
16897 in the range -65535 through -1 fit in an X unsigned short.
16898 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16899 result parameters unless successful. Rely on cons_to_unsigned
16900 to report problems with elements; the old code wasn't right anyway.
16901 (x_check_property_data): Check for int overflow; we cannot use
16902 a wider type due to X limits.
16903 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16904
726e0ab1 16905 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 16906
0065d054
PE
16907 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16908 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
16909 (x_color_cells): Don't store size until memory allocation succeeds.
16910 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 16911 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
16912 (x_term_init): Don't assume length fits in int (sprintf is limited
16913 to int size).
bc18e09d 16914
ebfa62c0
PE
16915 Use ptrdiff_t for composition IDs.
16916 * character.c (lisp_string_width):
16917 * composite.c (composition_table_size, n_compositions)
16918 (get_composition_id, composition_gstring_from_id):
16919 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16920 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16921 * window.c (Frecenter):
16922 Use ptrdiff_t, not int, for composition IDs.
16923 * composite.c (get_composition_id): Check for integer overflow.
16924 * composite.h: Adjust prototypes to match the above changes.
16925
d3411f89
PE
16926 Use ptrdiff_t for hash table indexes.
16927 * category.c (hash_get_category_set):
16928 * ccl.c (ccl_driver):
16929 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16930 * coding.c (coding_system_charset_list, detect_coding_system):
16931 * coding.h (struct coding_system.id):
16932 * composite.c (get_composition_id, gstring_lookup_cache):
16933 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16934 * image.c (xpm_get_color_table_h):
16935 * lisp.h (hash_lookup, hash_put):
16936 * minibuf.c (Ftest_completion):
16937 Use ptrdiff_t for hash table indexes, not int (which is too
16938 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16939 32-bit --with-wide-int hosts).
16940
e097a6fa
PE
16941 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16942 Add a FIXME comment about memory leaks.
16943 (syms_of_charset): Don't assume xmalloc returns.
16944
5637687f
PE
16945 Don't assume that stated character widths fit in int.
16946 * character.c (Fchar_width, c_string_width, lisp_string_width):
16947 * character.h (CHAR_WIDTH):
16948 * indent.c (MULTIBYTE_BYTES_WIDTH):
16949 Use sanitize_char_width to avoid undefined and/or bad behavior
16950 with outlandish widths.
a66cfb1c 16951 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
16952 now that we have two such functions. All uses changed.
16953 (sanitize_char_width): New inline function.
16954
a2271ba2
PE
16955 Don't assume that tab-width fits in int.
16956 * character.h (sanitize_width): New inline function.
16957 (SANE_TAB_WIDTH): New macro.
16958 (ASCII_CHAR_WIDTH): Use it.
16959 * indent.c (sane_tab_width): Remove. All uses replaced by
16960 SANE_TAB_WIDTH (current_buffer).
16961 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16962
18c52557
PE
16963 * fileio.c: Integer overflow issues with file modes.
16964 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16965
caeeedc1
PE
16966 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16967 Remove unreachable code.
16968 (read_hex, load_charset_map_from_file): Check for integer overflow.
16969
6df6ae42 16970 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
16971 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16972 (x_send_scroll_bar_event): Likewise. Check that the size does not
16973 exceed limits imposed by XClientMessageEvent, as well as the usual
16974 ptrdiff_t and size_t limits.
16975
b13995db
PE
16976 * keyboard.c: Overflow, signedness and related fixes.
16977 (make_lispy_movement): Use same integer type in forward decl
16978 that is used in the definition.
16979 (read_key_sequence, keyremap_step):
16980 Change bufsize argument back to int, undoing my 2011-03-30 change.
16981 We prefer signed types, and int is wide enough here.
16982 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16983 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16984 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16985 length, not size_t. Use ptrdiff_t for index, not int.
16986 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16987 possibility of integer overflow.
16988
13464394
PE
16989 Overflow, signedness and related fixes for images.
16990
16991 * dispextern.h (struct it.stack[0].u.image.image_id)
16992 (struct_it.image_id, struct image.id, struct image_cache.size)
16993 (struct image_cache.used, struct image_cache.ref_count):
16994 * gtkutil.c (update_frame_tool_bar):
16995 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16996 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16997 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16998 * nsmenu.m (update_frame_tool_bar):
16999 * xdisp.c (calc_pixel_width_or_height):
17000 * xfns.c (image_cache_refcount):
17001 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17002 on typical 64-bit hosts.
17003
17004 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17005 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17006 Omit unnecessary casts to int.
17007 (parse_image_spec): Check that integers fall into 'int' range
17008 when the callers expect that.
17009 (image_ascent): Redo ascent calculation to avoid int overflow.
17010 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17011 (lookup_image): Remove unnecessary tests.
17012 (xbm_image_p): Locals are now of int, not EMACS_INT,
17013 since parse_image_check makes sure they fit into int.
17014 (png_load, gif_load, svg_load_image):
17015 Prefer int to unsigned where either will do.
17016 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
17017 old tiff_error_handler and tiff_warning_handler.
17018 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
17019 stack buffer overflows. It uses only the features of vsnprintf
17020 that are common to both POSIX and native Microsoft.
17021 (tiff_error_handler, tiff_warning_handler): Use it.
17022 (tiff_load, gif_load, imagemagick_load_image):
17023 Don't assume :index value fits in 'int'.
17024 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17025 (imagemagick_load_image): Check that crop parameters fit into
17026 the integer types that MagickCropImage accepts. Don't assume
17027 Vimagemagick_render_type has a nonnegative value. Don't assume
17028 size_t fits in 'long'.
17029 (gs_load): Use printmax_t to print the widest integers possible.
17030 Check for integer overflow when computing image height and width.
17031
c11821d4
EZ
170322011-08-26 Eli Zaretskii <eliz@gnu.org>
17033
17034 * xdisp.c (redisplay_window): Don't force window start if point
17035 will be invisible in the resulting window. (Bug#9324)
17036
0c95fcf7
EZ
170372011-08-25 Eli Zaretskii <eliz@gnu.org>
17038
17039 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17040 the display spec is of the form `(space ...)'.
17041 (handle_display_spec): Return the value returned by
17042 handle_single_display_spec, not just 1 or zero.
17043 (handle_single_display_spec): If the display spec is of the form
17044 `(space ...)', and specifies display in the text area, return 2
17045 rather than 1.
fee65a97 17046 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
17047 accurately, and prefer exact match for point under bidi.
17048 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
17049
17050 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17051 into disp_prop; all users changed.
17052
17053 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17054 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17055 for the text covered by the display property.
17056
e4ed06f1
CY
170572011-08-25 Chong Yidong <cyd@stupidchicken.com>
17058
17059 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17060 Change return value to nil.
17061 (Frecord_buffer): Delete unused function.
17062
f67cdd7f
EZ
170632011-08-24 Eli Zaretskii <eliz@gnu.org>
17064
5980d4c6
EZ
17065 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17066 buffers, return left-to-right.
8610fe8b
EZ
17067 (set_cursor_from_row): Consider candidate row a win if its glyph
17068 represents a newline and point is on that newline. Fixes cursor
17069 positioning on the newline at EOL of R2L text within L2R
17070 paragraph, and vice versa.
17071 (try_cursor_movement): Check continued rows, in addition to
17072 continuation rows. Fixes unwarranted scroll when point enters a
17073 continued line of R2L text within an L2R paragraph, or vice versa.
17074 (cursor_row_p): Consider the case of point being equal to
17075 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17076 from the end of a short line to the beginning of a continued line
17077 of R2L text within L2R paragraph.
17078 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17079 composed characters.
5980d4c6 17080
f67cdd7f
EZ
17081 * bidi.c (bidi_check_type): Use xassert.
17082 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17083 members.
17084
bca633fb
EZ
170852011-08-23 Eli Zaretskii <eliz@gnu.org>
17086
17087 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17088 a character.
17089
4a5885a7
CY
170902011-08-23 Chong Yidong <cyd@stupidchicken.com>
17091
17092 * nsfont.m (ns_otf_to_script): Fix typo.
17093
0902a04e
KH
170942011-08-22 Kenichi Handa <handa@m17n.org>
17095
17096 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17097 extra slot even if the purpose is char-code-property-table.
17098
1a2e6670
EZ
170992011-08-23 Eli Zaretskii <eliz@gnu.org>
17100
8ddde651
EZ
17101 * xdisp.c (redisplay_window): When computing centering_position,
17102 account for the height of the header line. (Bug#8874)
17103
425cc014
EZ
17104 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17105 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17106 candidate is selected by the mouse, and that candidate has a
17107 composed character under the mouse.
17108
1a2e6670
EZ
17109 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17110 coordinates reported by pos-visible-in-window-p for a composed
17111 character in column zero.
17112
8b76d6f8
SM
171132011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17114
17115 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17116
dac347dd
EZ
171172011-08-22 Eli Zaretskii <eliz@gnu.org>
17118
17119 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17120 consider it a hit if to_charpos is anywhere in the range of the
17121 composed buffer positions.
17122
e013fb34
CY
171232011-08-22 Chong Yidong <cyd@stupidchicken.com>
17124
17125 * image.c (gif_load): Don't assume that each subimage has the same
17126 dimensions as the base image. Handle disposal method that is
17127 "undefined" by the gif spec (Bug#9335).
17128
bd1ba3e8
CY
171292011-08-20 Chong Yidong <cyd@stupidchicken.com>
17130
17131 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 17132 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 17133
54a1215b
EZ
171342011-08-19 Eli Zaretskii <eliz@gnu.org>
17135
823564e5
EZ
17136 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17137 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17138 from an Org mode buffer to a Speedbar frame.
17139
54a1215b
EZ
17140 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17141 a composition, take its buffer position from IT->cmp_it.charpos.
17142 Fixes cursor positioning at the beginning of a line that begins
17143 with a composed character.
17144
9778ebcc
EZ
171452011-08-18 Eli Zaretskii <eliz@gnu.org>
17146
0be6ee06
EZ
17147 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17148 character bidirectional type, use STRONG_L instead. Fixes crashes
17149 in a buffer produced by `describe-categories'.
17150
9778ebcc
EZ
17151 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17152 members before the level stack, so they would be saved and
17153 restored when copying iterator state. Fixes incorrect reordering
17154 around TABs covered by display properties.
17155
156bffbe
AS
171562011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17157
6b02f655 17158 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 17159
72ad093b
CY
171602011-08-17 Chong Yidong <cyd@stupidchicken.com>
17161
17162 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
17163 (internal_condition_case_2, internal_condition_case_n):
17164 Remove unnecessary aborts (Bug#9081).
72ad093b 17165
35774242
EZ
171662011-08-17 Eli Zaretskii <eliz@gnu.org>
17167
17168 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17169 has no `load' handler, try opening the file locally. (Bug#9311)
17170
db76dd85
KB
171712011-08-16 Ken Brown <kbrown@cornell.edu>
17172
17173 * gmalloc.c: Expand comment.
17174
b215eee5
EZ
171752011-08-16 Eli Zaretskii <eliz@gnu.org>
17176
17177 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17178 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17179
a4579d33
KB
171802011-08-16 Ken Brown <kbrown@cornell.edu>
17181
17182 Fix memory allocation problems in Cygwin build (Bug#9273).
17183
17184 * unexcw.c ( __malloc_initialized): Declare external variable.
17185 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17186
8b76d6f8
SM
17187 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17188 New variables.
a4579d33
KB
17189 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17190 dumped emacs.
17191 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17192 in the static heap.
17193 [CYGWIN] (special_realloc): New function.
17194 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17195 requests to realloc storage in the static heap.
17196
3ebec551
PE
171972011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17198
17199 * bidi.c (bidi_initialize): Remove unused local.
17200
9fd8be00
EZ
172012011-08-15 Eli Zaretskii <eliz@gnu.org>
17202
6b02f655
SM
17203 * bidimirror.h:
17204 * biditype.h: Remove file.
17205 * makefile.w32-in ($(BLD)/bidi.$(O)):
17206 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
17207
17208 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17209
17210 * chartab.c: Improve commentary for the uniprop_table API.
17211
32413314
EZ
17212 * bidi.c (bidi_paragraph_init): Support zero value of
17213 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
17214 (bidi_initialize): Use uniprop_table instead of including
17215 biditype.h and bidimirror.h.
32413314 17216
9fd8be00
EZ
17217 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17218 coordinates of the iterator when restoring from ppos_it.
17219 (Bug#9296)
17220
5cf2b69b
KH
172212011-08-14 Kenichi Handa <handa@m17n.org>
17222
17223 * process.c (create_process): Call setup_process_coding_systems
72ad093b 17224 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 17225
daf17d00
EZ
172262011-08-14 Eli Zaretskii <eliz@gnu.org>
17227
17228 * xdisp.c (move_it_in_display_line_to): Don't invoke
17229 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17230 ppos_it. Fixes vertical cursor motion when line beginning is
17231 covered by an image. (Bug#9296)
17232
08e3161a
JD
172332011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17234
17235 * nsterm.h (ns_run_ascript): Declare.
17236 (NSAPP_DATA2_RUNASSCRIPT): Define.
17237
17238 * nsfns.m (as_script, as_result, as_status): New static variables.
17239 (ns_run_ascript): New function.
5e617bc2 17240 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
17241 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17242 the event loop. Get status from as_status (Bug#7276).
17243
17244 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17245 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17246 the event loop (Bug#7276).
17247
a3720aa2
AS
172482011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17249
17250 * gnutls.c (QCgnutls_bootprop_priority)
17251 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17252 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17253 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17254 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17255 (QCgnutls_bootprop_verify_hostname_error)
17256 (QCgnutls_bootprop_callbacks_verify): Rename from
17257 Qgnutls_bootprop_..., all uses changed.
17258
17259 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17260 uses changed.
17261
0a0d27fb
PE
172622011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17263
19d5c50c
PE
17264 * xfaces.c (Qframe_set_background_mode): Now static.
17265 * dispextern.h (Qframe_set_background_mode): Remove decl.
17266
0a0d27fb
PE
17267 * process.c (Fnetwork_interface_info): Declare local only if needed.
17268
377538cb
JD
172692011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17270
17271 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17272 (Fnetwork_interface_list): Allocate in increments of bytes instead
17273 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17274 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17275 sockaddr.
17276 (struct ifflag_def): notrailers is smart on OSX.
17277 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17278 Get hardware address with getifaddrs if available.
17279
08fff70c
EZ
172802011-08-12 Eli Zaretskii <eliz@gnu.org>
17281
17282 * xdisp.c (iterate_out_of_display_property): xassert that
17283 IT->position is set to within IT->object's boundaries. Break from
17284 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
17285 when IT->position is set up wrongly due to some bug.
17286 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
17287 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17288 entry. Force push_it to save on the stack the current
17289 buffer/string position, to be restored by pop_it. Fix flags in
17290 the iterator structure wrt the object coming from a display
17291 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17292 properties. (Bug#9284)
17293
7be1c708 172942011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 17295
7be1c708
CY
17296 * fontset.c (fontset_get_font_group): Add proper type checks.
17297 (Bug#9172)
aac0c6e3 17298
7be1c708 172992011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 17300
7be1c708
CY
17301 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17302 and LC_VERSION_MIN_MACOSX.
17303 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17304 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 17305
97bb72a6
EZ
173062011-08-08 Eli Zaretskii <eliz@gnu.org>
17307
17308 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
17309 no-display-properties-and-no-overlays under bidi display.
17310 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 17311 properties and overlays.
97bb72a6 17312
d5617611
CY
173132011-08-08 Chong Yidong <cyd@stupidchicken.com>
17314
37e11a63
CY
17315 * editfns.c (Fset_time_zone_rule): Document relationship with the
17316 setenv function.
17317
d5617611
CY
17318 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17319 the font entity extracted from the cache (Bug#8109).
17320
58872834
CY
173212011-08-07 Chong Yidong <cyd@stupidchicken.com>
17322
17323 * composite.c (autocmp_chars): Don't reset point. That is done by
17324 restore_point_unwind (Bug#5984).
17325
75bfc667
JL
173262011-08-07 Juri Linkov <juri@jurta.org>
17327
17328 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17329 to show the arg `TIME' instead of `TIMEVAL'.
17330
d1410150
EZ
173312011-08-06 Eli Zaretskii <eliz@gnu.org>
17332
17333 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17334 display property strides EOL and includes a newline, as in
17335 longlines-mode. (Bug#9254)
75b771e4
EZ
17336 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17337 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
17338
17339 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17340 is non-zero, even if the data buffer is NULL. Fixes a crash in
17341 vertical-motion with longlines-mode. (Bug#9254)
17342
35928349
EZ
173432011-08-05 Eli Zaretskii <eliz@gnu.org>
17344
ec7cc85b
EZ
17345 * bidi.c <bidi_cache_total_alloc>: Now static.
17346 (bidi_initialize): Initialize bidi_cache_total_alloc.
17347
8b76d6f8 17348 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
17349 cache. (Bug#9221)
17350
17351 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17352 amount allocated this far in `bidi_cache_total_alloc'.
17353 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17354 non-zero, only free the data buffer without restoring the cache
17355 contents. All callers changed.
17356
17357 * dispextern.h (bidi_unshelve_cache): Update prototype.
17358
17359 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17360 (move_it_in_display_line, move_it_to)
17361 (move_it_vertically_backward, move_it_by_lines): Replace the call
17362 to xfree to an equivalent call to bidi_unshelve_cache.
17363 (move_it_in_display_line_to): Fix logic of returning
412b6358 17364 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 17365
e2e2423b
EZ
173662011-08-05 Eli Zaretskii <eliz@gnu.org>
17367
17368 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17369 came from a string character with a `cursor' property. (Bug#9229)
17370
ae9e757a
JD
173712011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17372
17373 * Makefile.in (LIB_PTHREAD): New variable.
17374 (LIBES): Add LIB_PTHREAD (Bug#9216).
17375
17376 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17377 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17378
213bd7f2
AS
173792011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17380
6b02f655 17381 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 17382
99aaf75f
JD
173832011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17384
17385 * xterm.c (x_find_topmost_parent): New function.
17386 (x_set_frame_alpha): Find topmost parent window with
17387 x_find_topmost_parent and set the property there also (bug#9181).
17388 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17389
c74e9d86
PE
173902011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17391
17392 * callproc.c (Fcall_process): Avoid vfork clobbering
17393 the local vars buffer, coding_systems, current_dir.
17394
640c8776
SM
173952011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17396
17397 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17398
f26d0e4c
PE
173992011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17400
8a10d76c
PE
17401 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17402 so that it is not optimized away.
17403
f26d0e4c
PE
17404 * xdisp.c (compute_display_string_pos): Remove unused local.
17405
55439c61
EZ
174062011-08-02 Eli Zaretskii <eliz@gnu.org>
17407
17408 Fix slow cursor motion and scrolling in large buffers with
17409 selective display, like Org Mode buffers. (Bug#9218)
17410
17411 * dispextern.h (struct bidi_it): New member disp_prop_p.
17412
17413 * xdisp.c: Remove one-slot cache of display string positions.
17414 (compute_display_string_pos): Accept an additional argument
5e617bc2 17415 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
17416 for a display string or property. If found, set DISP_PROP_P
17417 non-zero.
17418
17419 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
17420 DISP_PROP_P, and pass it to compute_display_string_pos.
17421 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
17422 non-zero. All callers of bidi_fetch_char changed.
17423
fb33fa43
SM
174242011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17425
17426 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17427
b099e063
DM
174282010-12-03 Don March <don@ohspite.net>
17429
17430 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17431 last character M-[char] is translated to ESC [char] (bug#7541).
17432
5cc7f7af
KH
174332011-08-02 Kenichi Handa <handa@m17n.org>
17434
d0fffa3f 17435 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
17436
17437 * chartab.c (uniprop_table): Make it non-static.
17438
525d5e6e
EZ
174392011-08-01 Eli Zaretskii <eliz@gnu.org>
17440
17441 * xdisp.c (forward_to_next_line_start): Accept additional argument
17442 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17443 on the newline.
17444 (reseat_at_next_visible_line_start): Use the bidi iterator state
17445 returned by forward_to_next_line_start to restore the state of
17446 it->bidi_it after backing up to previous newline. (Bug#9212)
17447
31011111
AS
174482011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17449
17450 * regex.c (re_comp): Protoize.
17451 (re_exec): Fix return type.
17452 (regexec): Fix type of `ret'. (Bug#9203)
17453
476371c4
PE
174542011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17455
e5d76069
PE
17456 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17457 This is needed if max-image-size is a floating-point number.
17458
9a79b20c
AS
174592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17460
17461 * print.c (print_object): Print empty symbol as ##.
17462
17463 * lread.c (read1): Read ## as empty symbol.
17464
d8c2fa78
AA
174652011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17466
17467 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17468 setting frame foreground color (Bug#9175).
17469 (x_set_background_color): Likewise.
17470
ffe57a7a
AA
17471 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17472 contents (Bug#9176).
17473 (EmacsTooltip -init): Remove bezels and add shadows to
17474 tooltip windows.
17475
bf3492a5
AA
17476 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17477 or scroll bar (Bug#8470).
17478
d55e9c53
AA
17479 * nsfont.m (nsfont_open): Remove assignment to voffset and
17480 unnecessary vars hshink, expand, hd, full_height, min_height.
17481 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17482
17483 * nsterm.h (nsfont_info): Remove voffset field.
17484
d8c2fa78 174852011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
17486
17487 Implement strike-through and overline on NextStep (Bug#8863).
17488
17489 * nsfont.m (nsfont_open): Use underline position provided by font,
17490 instead of hard-coded value of 2.
17491 (nsfont_draw): Call ns_draw_text_decoration instead.
17492
17493 * nsterm.h: Add declaration for ns_draw_text_decoration.
17494
17495 * nsterm.m (ns_draw_text_decoration): New function for drawing
17496 underline, overline, and strike-through.
17497 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17498 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 17499 accommodate underlining, etc.
4843aac3 17500
4cc60b9b
EZ
175012011-07-28 Eli Zaretskii <eliz@gnu.org>
17502
bc7ece87
EZ
17503 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17504 default.
4cc60b9b 17505
476371c4
PE
175062011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17507
66606eea
PE
17508 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17509 Without this fix, if a signal arrives just after memory fills up,
17510 'malloc' might be invoked reentrantly.
17511
476371c4
PE
17512 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17513 In other words, assume that every image size is allowed, on non-X
17514 hosts. This assumption is probably wrong, but it lets Emacs compile.
17515
f3fcc40d
AS
175162011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17517
17518 * regex.c (re_iswctype): Convert return values to boolean.
17519
350c992f
EZ
175202011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17521
17522 * xdisp.c (compute_display_string_pos): Don't use cached display
17523 string position if the buffer had its restriction changed.
17524 (Bug#9184)
17525
5266b4bb
PE
175262011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17527
17528 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17529
2573a837 175302011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 17531
41f55ccd 17532 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 17533
39e378da
PE
17534 * bidi.c: Integer size and overflow fixes.
17535 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17536 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17537 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17538 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17539 (bidi_find_other_level_edge):
17540 Use ptrdiff_t instead of EMACS_INT where either will do.
17541 This works better on 32-bit hosts configured --with-wide-int.
17542 (bidi_cache_ensure_space): Check for size-calculation overflow.
17543 Use % rather than repeated addition, for better worst-case speed.
17544 Don't set bidi_cache_size until after xrealloc returns, because it
17545 might not return.
17546 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
17547 (bidi_cache_ensure_space): Also check that the bidi cache size
17548 does not exceed that of the largest Lisp string or buffer. See Eli
17549 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 17550
5e927815
PE
17551 * alloc.c (__malloc_size_t): Remove.
17552 All uses replaced by size_t. See Andreas Schwab's note
17553 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17554
ca4aa935
PE
17555 * image.c: Improve checking for integer overflow.
17556 (check_image_size): Assume that f is nonnull, since
17557 it is always nonnull in practice. This is one less thing to
17558 worry about when checking for integer overflow later.
17559 (x_check_image_size): New function, which checks for integer
17560 overflow issues inside X.
17561 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17562 This removes the need for a memory_full check.
17563 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17564 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17565 (xbm_read_bitmap_data): Change locals back to 'int', since
17566 their values must fit in 'int'.
17567 (xpm_load_image, png_load, tiff_load):
17568 Invoke x_create_x_image_and_pixmap earlier,
17569 to avoid much needless work if the image is too large.
17570 (tiff_load): Treat overly large images as if
17571 x_create_x_image_and_pixmap failed, not as malloc failures.
17572 (gs_load): Use x_check_image_size.
17573
5f8f9cc2
PE
17574 * gtkutil.c: Omit integer casts.
17575 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17576 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17577
5adf60bc
PE
17578 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17579
c8907a93
PE
17580 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17581 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17582 would wrongly return t on a 64-bit host.
17583
e3c25c68
PE
17584 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17585 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17586 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17587 and therefore cause GCC to emit a bogus diagnostic in some cases.
17588
3f791afe
PE
17589 * image.c: Integer signedness and overflow and related fixes.
17590 This is not an exhaustive set of fixes, but it's time to
17591 record what I've got.
17592 (lookup_pixel_color, check_image_size): Remove redundant decls.
17593 (check_image_size): Don't assume that arbitrary EMACS_INT values
17594 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17595 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17596 (tiff_load, imagemagick_load_image):
17597 Check for overflow in size calculations.
17598 (x_create_x_image_and_pixmap): Remove unnecessary test for
17599 xmalloc returning NULL; that can't happen.
17600 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17601 (xpm_color_bucket): Use better integer hashing function.
17602 (xpm_cache_color): Don't possibly over-allocate memory.
17603 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17604 (gif_memory_source):
17605 Use ptrdiff_t, not int or size_t, to record sizes.
17606 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17607 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17608 either works, as we prefer signed integers.
17609 (tiff_read_from_memory, tiff_write_from_memory):
17610 Return tsize_t, not size_t, since that's what the TIFF API wants.
17611 (tiff_read_from_memory): Don't fail simply because the read would
17612 go past EOF; instead, return a short read.
17613 (tiff_load): Omit no-longer-needed casts.
17614 (Fimagemagick_types): Don't assume size fits into 'int'.
17615
3cc5a532
PE
17616 Improve hashing quality when configured --with-wide-int.
17617 * fns.c (hash_string): New function, taken from sxhash_string.
17618 Do not discard information about ASCII character case; this
17619 discarding is no longer needed.
17620 (sxhash-string): Use it. Change sig to match it. Caller changed.
17621 * lisp.h: Declare it.
17622 * lread.c (hash_string): Remove, since we now use fns.c's version.
17623 The fns.c version returns a wider integer if --with-wide-int is
17624 specified, so this should help the quality of the hashing a bit.
17625
b312a492
PE
17626 * emacs.c: Integer overflow minor fix.
17627 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17628 Define only if GNU_LINUX.
17629 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17630
dfd153ae
PE
17631 * dispnew.c: Integer signedness and overflow fixes.
17632 Remove unnecessary forward decls, that were a maintenance hassle.
17633 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17634 All uses changed.
17635 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17636 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17637 (prepare_desired_row, line_draw_cost):
17638 Use int, not unsigned, where either works.
17639 (save_current_matrix, restore_current_matrix):
17640 Use ptrdiff_t, not size_t, where either works.
17641 (init_display): Check for overflow more accurately, and without
17642 relying on undefined behavior.
17643
a81d11a3
PE
17644 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17645 Remove, replacing with the new symbols in lisp.h. All uses changed.
17646 * fileio.c (make_temp_name):
17647 * filelock.c (lock_file_1, lock_file):
17648 * xdisp.c (message_dolog):
17649 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17650 Use pMd etc. instead.
17651 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17652 replacing the pWIDE etc. symbols removed from editfns.c.
17653
3300e6fd
PE
17654 * keyboard.h (num_input_events): Now uintmax_t.
17655 This is (very slightly) less likely to mess up due to wraparound.
17656 All uses changed.
17657
fd05c7e9
PE
17658 * buffer.c: Integer signedness fixes.
17659 (alloc_buffer_text, enlarge_buffer_text):
17660 Use ptrdiff_t rather than size_t when either will do, as we prefer
17661 signed integers.
17662
903fe15d
PE
17663 * alloc.c: Integer signedness and overflow fixes.
17664 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17665 (__malloc_size_t): Default to size_t, not to int.
17666 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17667 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17668 Prefer ptrdiff_t to size_t when either would do, as we prefer
17669 signed integers.
17670 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17671 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17672 Now const. Initialize with values that are in range even if char
17673 is signed.
17674 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17675 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17676 These functions do the right thing with sizes > 2**32.
17677 (check_depth): Now ptrdiff_t, not int.
17678 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17679 Adjust to new way of storing sizes. Check for size overflow bugs
17680 in rest of code.
17681 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17682 slightly wrong anyway, as it missed one instance of
17683 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17684 (refill_memory_reserve): Omit needless cast to size_t.
17685 (mark_object_loop_halt): Mark as externally visible.
17686
ac82cc6a
PE
17687 * xselect.c: Integer signedness and overflow fixes.
17688 (Fx_register_dnd_atom, x_handle_dnd_message):
17689 Use ptrdiff_t, not size_t, since we prefer signed.
17690 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17691 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17692 x_dnd_atoms_size and x_dnd_atoms_length.
17693
c2d1e36d
PE
17694 * doprnt.c: Prefer signed to unsigned when either works.
17695 * eval.c (verror):
17696 * doprnt.c (doprnt):
17697 * lisp.h (doprnt):
17698 * xdisp.c (vmessage):
17699 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17700 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17701 prefer signed arithmetic to avoid comparison confusion.
17702 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17703 but is a bit tricky.
17704
0e926e56
PE
17705 Assume freestanding C89 headers, string.h, stdlib.h.
17706 * data.c, doprnt.c, floatfns.c, print.c:
17707 Include float.h unconditionally.
17708 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17709 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17710 * regex.c: Likewise for stddef.h, string.h.
17711 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17712 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17713 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17714 (STDC_HEADERS): Remove obsolete defines.
17715 * sysdep.c: Include limits.h unconditionally.
17716
9cfdb3ec
PE
17717 Assume support for memcmp, memcpy, memmove, memset.
17718 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17719 * regex.c (memcmp, memcpy):
17720 Remove; we assume C89 now.
17721
17722 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17723 (__malloc_safe_bcopy): Remove; no longer needed.
17724
cf950e6b 17725 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
17726 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17727 well either way, and we prefer signed to unsigned.
17728
dbf38e02
LMI
177292011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17730
17731 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17732 closes the connection while we're reading (bug#9182).
17733
d6f0886c 177342011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 17735
d6f0886c
JD
17736 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17737 are specified (Bug#9168).
24e0f6b1 17738
2eb1f9e6
PE
177392011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17740
17741 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17742 Found by GCC static checking and --with-wide-int on a 32-bit host.
17743
22381272 177442011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
17745
17746 * xdisp.c (compute_display_string_pos): Fix logic of caching
17747 previous display string position. Initialize cached_prev_pos to
17748 -1. Fixes slow-down at the beginning of a buffer.
17749
f25e39b4
EZ
177502011-07-24 Eli Zaretskii <eliz@gnu.org>
17751
17752 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17753 for attrs[LFACE_FONTSET_INDEX].
17754
04c4b52e
PE
177552011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17756
17757 * xml.c (parse_region): Remove unused local
17758 that was recently introduced.
17759
c1734fbd
EZ
177602011-07-23 Eli Zaretskii <eliz@gnu.org>
17761
be18c5a5
EZ
17762 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17763 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17764
c1734fbd
EZ
17765 * xdisp.c (move_it_in_display_line_to): Record the best matching
17766 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
17767 exit if none of the characters scanned was an exact match.
17768 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
17769 when exact match is impossible due to invisible text, and the
17770 lines are truncated.
17771
a258d627
JD
177722011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17773
17774 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17775 for OSX >= 10.7.
17776
b6d5a689
EZ
177772011-07-22 Eli Zaretskii <eliz@gnu.org>
17778
0f74f785
EZ
17779 Fix a significant slow-down of cursor motion with C-n, C-p,
17780 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17781 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 17782 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
17783 (next_element_from_buffer): Call compute_stop_pos_backwards to
17784 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
17785 base_level_stop.
17786 (reseat): Don't look for prev_stop, as that could mean a very long
17787 run.
17788 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17789 <cached_disp_overlay_modiff>: Cache for last found display string
17790 position.
551918c1 17791 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
17792 about the same buffer in the same area of character positions, and
17793 the buffer wasn't changed since the time the display string
17794 position was cached.
551918c1 17795
b2d0c91a
EZ
177962011-07-22 Eli Zaretskii <eliz@gnu.org>
17797
17798 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17799 is an integer, which is important for empty lines. (Bug#9149)
17800
043604ee
CY
178012011-07-22 Chong Yidong <cyd@stupidchicken.com>
17802
17803 * frame.c (Fmodify_frame_parameters): In tty case, update the
17804 default face if necessary (Bug#4238).
17805
da4adb04
CY
178062011-07-21 Chong Yidong <cyd@stupidchicken.com>
17807
17808 * editfns.c (Fstring_to_char): No need to explain what a character
17809 is in the docstring (Bug#6576).
17810
9abd0532
LMI
178112011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17812
17813 * xml.c (parse_region): Make sure we always return a tree.
17814
36881d16
HK
178152011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17816
17817 * xml.c (parse_region): If a document contains only comments,
17818 return that, too.
17819
1e98674d
LMI
178202011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17821
17822 * xml.c (make_dom): Return comments, too.
17823
590bd467
PE
178242011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17825
17826 Port to OpenBSD.
17827 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17828 and the surrounding thread.
17829 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17830 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17831 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17832 timer goes off.
17833 * s/openbsd.h (BROKEN_SIGIO): Define.
17834 * unexelf.c (unexec) [__OpenBSD__]:
17835 Don't update the .mdebug section of the Alpha COFF symbol table.
17836
f41628b2
LMI
178372011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17838
17839 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17840 (bug#8460).
17841
b59b67c5
PE
178422011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17843
15e3a074
PE
17844 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17845 This fixes some race conditions on the permissions of any newly
17846 created file.
17847
41bed37d
PE
17848 * alloc.c (valid_pointer_p): Use pipe, not open.
17849 This fixes some permissions issues when debugging.
17850
b59b67c5
PE
17851 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17852 If fchown fails to set both uid and gid, try to set just gid,
17853 as that is sometimes allowed. Adjust the file's mode to eliminate
17854 setuid or setgid bits that are inappropriate if fchown fails.
17855
925a6be7
SM
178562011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17857
17858 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17859 to compare Lisp_Objects.
17860 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17861 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17862 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17863
52968808
AS
178642011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17865
0a6a104b
AS
17866 * lread.c (read_integer): Unread even EOF character.
17867 (read1): Likewise. Properly record start position of symbol.
17868
52968808
AS
17869 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17870 symbol character follows.
17871
9e381cdd
PE
178722011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17873
17874 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17875 This works around a problem with the previous change to Fcopy_file.
17876 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17877 and without this change, GCC might complain about discarding
17878 fchown's return value.
17879
b5641435
JB
178802011-07-16 Juanma Barranquero <lekktu@gmail.com>
17881
17882 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17883
a8031457
PE
178842011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17885
17886 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17887
dd889327
LMI
178882011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17889
750c33f7
LMI
17890 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17891 it's used from the C level.
17892
dd889327
LMI
17893 * process.c: Use the same condition for POLL_FOR_INPUT in both
17894 keyboard.c and process.c (bug#1858).
17895
87e86684
LM
178962011-07-09 Lawrence Mitchell <wence@gmx.li>
17897
17898 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17899 (Fgnutls_boot): Use it.
17900
64348f40
AS
179012011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17902
17903 * doc.c (Fsubstitute_command_keys): Revert last change.
17904
1d698799
LMI
179052011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17906
f863868c
LMI
17907 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17908 quotes the next character, and doesn't affect other longer
17909 sequences (bug#8935).
17910
1d698799
LMI
17911 * lread.c (syms_of_lread): Clarify that is isn't only
17912 `eval-buffer' and `eval-defun' that's affected by
17913 `lexical-binding' (bug#8460).
17914
aa4b6df6
EZ
179152011-07-15 Eli Zaretskii <eliz@gnu.org>
17916
17917 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 17918 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 17919
5d856da6
PE
179202011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17921
ad6042bb
PE
17922 Fix minor problems found by static checking.
17923 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17924 (elsz): Now a signed constant, not a size_t var. We prefer signed
17925 types to unsigned, to avoid integer comparison confusion. Without
17926 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17927 "cannot optimize loop, the loop counter may overflow", a symptom
17928 of the confusion.
f00bbb22 17929 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
17930 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17931
6468f31c
LMI
179322011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17933
49080b10
LMI
17934 * search.c (Fre_search_backward): Mention `case-fold-search' in
17935 all the re_search_* functions (bug#8138).
17936
6468f31c
LMI
17937 * keyboard.c (Fopen_dribble_file): Document when the file is
17938 closed (bug#8056).
17939
c965adc5
EZ
179402011-07-14 Eli Zaretskii <eliz@gnu.org>
17941
df9733bf
EZ
17942 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17943 bidi_cache_idx.
17944
0bb23927
EZ
17945 Support bidi reordering of display and overlay strings.
17946 * xdisp.c (compute_display_string_pos)
17947 (compute_display_string_end): Accept additional argument STRING.
17948 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17949 (reseat_to_string): Initialize bidi_it->string.s and
17950 bidi_it->string.schars.
17951 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
17952 NULL (avoids a crash in bidi_paragraph_init).
17953 Initialize itb.string.lstring.
0bb23927
EZ
17954 (init_iterator): Call bidi_init_it only of a valid
17955 buffer position was specified. Initialize paragraph_embedding to
17956 L2R.
17957 (reseat_to_string): Initialize the bidi iterator.
17958 (display_string): If we need to ignore text properties of
17959 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17960 original value of -1 will not work with bidi.)
17961 (compute_display_string_pos): First arg is now struct
17962 `text_pos *'; all callers changed. Support display properties on
17963 Lisp strings.
17964 (compute_display_string_end): Support display properties on Lisp
17965 strings.
17966 (init_iterator, reseat_1, reseat_to_string): Initialize the
17967 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17968 when iterating on a string not from display properties).
640c8776
SM
17969 (compute_display_string_pos, compute_display_string_end):
17970 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
17971 arrow keys.
17972 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
17973 base_level_stop; instead, set base_level_stop to BEGV.
17974 Fixes crashes in vertical-motion.
0bb23927
EZ
17975 (next_element_from_buffer): Improve commentary for when
17976 the iterator is before prev_stop.
17977 (init_iterator): Initialize bidi_p from the default value of
17978 bidi-display-reordering, not from buffer-local value. Use the
17979 buffer-local value only if initializing for buffer iteration.
17980 (handle_invisible_prop): Support invisible properties on strings
17981 that are being bidi-reordered.
17982 (set_iterator_to_next): Support bidi reordering of C strings and
17983 Lisp strings.
17984 (next_element_from_string): Support bidi reordering of Lisp
17985 strings.
17986 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
17987 (display_string): Support display of R2L glyph rows.
17988 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
17989 (init_iterator): Don't initialize it->bidi_p for strings
17990 here.
17991 (reseat_to_string): Initialize it->bidi_p for strings here.
17992 (next_element_from_string, next_element_from_c_string)
17993 (next_element_from_buffer): Add xassert's for correspondence
17994 between IT's object being iterated and it->bidi_it.string
17995 structure.
17996 (face_before_or_after_it_pos): Support bidi iteration.
17997 (next_element_from_c_string): Handle the case of the first string
17998 character that is not the first one in the visual order.
17999 (get_visually_first_element): New function, refactored from common
18000 parts of next_element_from_buffer, next_element_from_string, and
18001 next_element_from_c_string.
18002 (tool_bar_lines_needed, redisplay_tool_bar)
18003 (display_menu_bar): Force left-to-right direction. Add a FIXME
18004 comment for making that be controlled by a user option.
18005 (push_it, pop_it): Save and restore the state of the
18006 bidi iterator. Save and restore the bidi_p flag.
18007 (pop_it): Iterate out of display property for string iteration as
18008 well.
18009 (iterate_out_of_display_property): Support iteration over strings.
18010 (handle_single_display_spec): Set up it->bidi_it for iteration
18011 over a display string, and call bidi_init_it.
18012 (handle_single_display_spec, next_overlay_string)
18013 (get_overlay_strings_1, push_display_prop): Set up the bidi
18014 iterator for displaying display or overlay strings.
18015 (forward_to_next_line_start): Don't use the shortcut if
18016 bidi-iterating.
18017 (back_to_previous_visible_line_start): If handle_display_prop
18018 pushed the iterator stack, restore the internal state of the bidi
18019 iterator by calling bidi_pop_it same number of times.
18020 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18021 and we are bidi-iterating, don't decrement the iterator position;
18022 instead, set the first_elt flag in the bidi iterator, to produce
18023 the same effect.
18024 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18025 (push_display_prop): xassert that we are iterating a buffer.
18026 (push_it, pop_it): Save and restore paragraph_embedding member.
18027 (handle_single_display_spec, next_overlay_string)
18028 (get_overlay_strings_1, reseat_1, reseat_to_string)
18029 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18030 correctly. Don't assume unibyte strings are not bidi-reordered.
18031 (compute_display_string_pos)
18032 (compute_display_string_end): Fix handling the case of C string.
18033 (push_it, pop_it): Save and restore from_disp_prop_p.
18034 (handle_single_display_spec, push_display_prop): Set the
18035 from_disp_prop_p flag.
18036 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18037 (pop_it): Call iterate_out_of_display_property only if we are
18038 popping after iteration over a string that came from a display
18039 property. Fix a typo in popping stretch info. Add an assertion
18040 for verifying that the iterator position is in sync with the bidi
18041 iterator.
18042 (handle_single_display_spec, get_overlay_strings_1)
18043 (push_display_prop): Fix initialization of paragraph direction for
18044 string when that of the parent object is not yet determined.
18045 (reseat_1): Call bidi_init_it to resync the bidi
18046 iterator with IT's position. (Bug#7616)
18047 (find_row_edges): If ROW->start.pos gives position
18048 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18049 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18050 Reset the from_disp_prop_p flag.
18051 (SAVE_IT, RESTORE_IT): New macros.
18052 (pos_visible_p, face_before_or_after_it_pos)
18053 (back_to_previous_visible_line_start)
18054 (move_it_in_display_line_to, move_it_in_display_line)
18055 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18056 (try_scrolling, redisplay_window, display_line): Use them when
18057 saving a temporary copy of the iterator and restoring it back.
18058 (back_to_previous_visible_line_start, reseat_1)
18059 (init_iterator): Empty the bidi cache "stack".
18060 (move_it_in_display_line_to): If iterator ended up at
18061 EOL, but we never saw any buffer positions smaller than
18062 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18063 motion in bidi-reordered lines.
18064 (move_it_in_display_line_to): Record prev_method and prev_pos
18065 immediately before the call to set_iterator_to_next. Fixes cursor
18066 motion in bidi-reordered lines with stretch glyphs and strings
18067 displayed in margins. (Bug#8133) (Bug#8867)
18068 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18069 TO_CHARPOS.
640c8776
SM
18070 (pos_visible_p): Support positions in bidi-reordered lines.
18071 Save and restore bidi cache.
0bb23927
EZ
18072
18073 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18074 (bidi_paragraph_info): Delete unused struct.
18075 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18076 (bidi_cache_start): New variable.
18077 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18078 to zero.
18079 (bidi_cache_fetch_state, bidi_cache_search)
18080 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18081 (bidi_cache_find, bidi_peek_at_next_level)
18082 (bidi_level_of_next_char, bidi_find_other_level_edge)
18083 (bidi_move_to_visually_next): Compare cache index with
18084 bidi_cache_start rather than with zero.
18085 (bidi_fetch_char): Accept new argument STRING; all callers
18086 changed. Support iteration over a string. Support strings with
18087 display properties. Support unibyte strings. Fix the type of
18088 `len' according to what STRING_CHAR_AND_LENGTH expects.
18089 (bidi_paragraph_init, bidi_resolve_explicit_1)
18090 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
18091 (bidi_level_of_next_char, bidi_move_to_visually_next):
18092 Support iteration over a string.
0bb23927
EZ
18093 (bidi_set_sor_type, bidi_resolve_explicit_1)
18094 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18095 can now be zero (for strings); special values 0 and -1 were
18096 changed to -1 and -2, respectively.
18097 (bidi_char_at_pos): New function.
18098 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18099 Call it instead of FETCH_MULTIBYTE_CHAR.
18100 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18101 initialized to valid values.
18102 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18103 values.
18104 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18105 the test for valid cached positions. Fix the logic for looking up
18106 the sentinel state in the cache. GCPRO the Lisp string we are
18107 iterating.
18108 (bidi_push_it, bidi_pop_it): New functions.
18109 (bidi_initialize): Initialize the bidi cache start stack pointer.
18110 (bidi_cache_ensure_space): New function, refactored from part of
18111 bidi_cache_iterator_state. Don't assume the required size is just
18112 one BIDI_CACHE_CHUNK away.
18113 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18114 (bidi_count_bytes, bidi_char_at_pos): New functions.
18115 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18116 always valid if bidi_cache_idx is valid.
18117 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18118 is valid if it's going to be used.
18119 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18120 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
18121 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18122 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
18123 (bidi_find_other_level_edge, bidi_cache_start_stack):
18124 All variables related to cache indices are now EMACS_INT.
c965adc5 18125
0bb23927
EZ
18126 * dispextern.h (struct bidi_string_data): New structure.
18127 (struct bidi_it): New member `string'. Make flag members be 1-bit
18128 fields, and put them last in the struct.
640c8776
SM
18129 (compute_display_string_pos, compute_display_string_end):
18130 Update prototypes.
0bb23927
EZ
18131 (bidi_push_it, bidi_pop_it): Add prototypes.
18132 (struct iterator_stack_entry): New members bidi_p,
18133 paragraph_embedding, and from_disp_prop_p.
18134 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
18135 (bidi_shelve_cache, bidi_unshelve_cache):
18136 Declare prototypes.
0bb23927
EZ
18137
18138 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18139 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18140 and vector-like objects.
18141
18142 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18143 cache around display iteration.
18144
18145 * window.c (Fwindow_end, window_scroll_pixel_based)
18146 (displayed_window_lines, Frecenter): Save and restore the bidi
18147 cache around display iteration.
18148
3bbd2265
LMI
181492011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18150
18151 * editfns.c (Fdelete_region): Clarify the use of the named
18152 parameters (bug#6788).
18153
adc47434
MR
181542011-07-14 Martin Rudalics <rudalics@gmx.at>
18155
18156 * indent.c (Fvertical_motion): Set and restore w->pointm when
18157 saving and restoring the window's buffer (Bug#9006).
18158
837c31f8
LMI
181592011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18160
18161 * editfns.c (Fstring_to_char): Clarify just what is returned
18162 (bug#6576). Text by Eli Zaretskii.
18163
ac389d0c
JB
181642011-07-13 Juanma Barranquero <lekktu@gmail.com>
18165
18166 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18167
0be0ce47
EZ
181682011-07-13 Eli Zaretskii <eliz@gnu.org>
18169
18170 * buffer.c (mmap_find): Fix a typo.
18171
cd18e7e3
JB
181722011-07-13 Johan Bockgård <bojohan@gnu.org>
18173
18174 Fix execution of x selection hooks.
18175 * xselect.c (Qx_lost_selection_functions)
18176 (Qx_sent_selection_functions): New vars.
18177 (syms_of_xselect): DEFSYM them.
18178 (x_handle_selection_request): Pass Qx_sent_selection_functions
18179 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18180 (x_handle_selection_clear,x_clear_frame_selections):
18181 Pass Qx_lost_selection_functions rather than
18182 Vx_lost_selection_functions to Frun_hook_with_args.
18183
47ea7f44
PE
181842011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18185
ac389d0c 18186 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
18187 The old code sometimes used this field without initializing it.
18188
47ea7f44
PE
18189 * alloc.c (gc_sweep): Don't read past end of array.
18190 In theory, the old code could also have corrupted Emacs internals,
18191 though it'd be very unlikely.
18192
bc985c87
AS
181932011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18194
18195 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 18196 argument. (Bug#4026)
bc985c87 18197
0cf34688
LMI
181982011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18199
b3dadd76
LMI
18200 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18201 key" (bug#4257).
18202
0cf34688
LMI
18203 * window.c (Fset_window_start): Doc fix (bug#4199).
18204 (Fset_window_hscroll): Ditto.
18205
270768cd
PE
182062011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18207
077e3dda 18208 Fix minor new problems caught by GCC 4.6.1.
270768cd 18209 * term.c (init_tty): Remove unused local.
490011a6 18210 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 18211 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 18212 not used otherwise.
270768cd 18213
b1f58454
CY
182142011-07-12 Chong Yidong <cyd@stupidchicken.com>
18215
18216 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18217
22b9578d
LMI
182182011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18219
6e70ab07
LMI
18220 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18221 are the mini-buffer and the echo area (bug#3320).
18222
22b9578d
LMI
18223 * term.c (init_tty): Remove support for supdup, c10 and perq
18224 terminals, which are no longer supported (bug#1482).
18225
8974cc9f
JB
182262011-07-10 Johan Bockgård <bojohan@gnu.org>
18227
18228 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18229
a560d974
JD
182302011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18231
18232 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18233 for non-popups (Bug#3642).
18234
1dae0f0a
AS
182352011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18236
268c2c36 18237 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 18238 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
18239 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18240 * cm.c (losecursor): Likewise.
1dae0f0a
AS
18241 * data.c (fmod): Likewise.
18242 * dispnew.c (swap_glyphs_in_rows): Likewise.
18243 * emacs.c (memory_warning_signal): Likewise.
18244 * floatfns.c (float_error): Likewise.
18245 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18246 (otf_open, font_otf_capability, generate_otf_features)
18247 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18248 Likewise.
18249 * image.c (pbm_read_file): Likewise.
18250 * indent.c (string_display_width): Likewise.
18251 * intervals.c (check_for_interval, search_for_interval)
18252 (inc_interval_count, count_intervals, root_interval)
18253 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18254 * lread.c (defalias): Likewise.
268c2c36 18255 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
18256 * regex.c (set_image_of_range_1, set_image_of_range)
18257 (regex_grow_registers): Likewise.
18258 * sysdep.c (strerror): Likewise.
18259 * termcap.c (valid_filename_p, tprint, main): Likewise.
18260 * tparam.c (main): Likewise.
18261 * unexhp9k800.c (run_time_remap, save_data_space)
18262 (update_file_ptrs, read_header, write_header, calculate_checksum)
18263 (copy_file, copy_rest, display_header): Likewise.
18264 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18265 Likewise.
18266 * xdisp.c (check_it): Likewise.
18267 * xfaces.c (register_color, unregister_color, unregister_colors):
18268 Likewise.
18269 * xfns.c (print_fontset_result): Likewise.
18270 * xrdb.c (member, fatal, main): Likewise.
18271
99033785
PE
182722011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18273
18274 Fix minor problems found by static checking (Bug#9031).
18275 * chartab.c (char_table_set_range, map_sub_char_table):
18276 Remove unused locals.
18277 (uniprop_table): Now static.
18278 * composite.c (_work_char): Remove unused static var.
18279
9cb2ac56
JB
182802011-07-09 Juanma Barranquero <lekktu@gmail.com>
18281
18282 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18283
f25661f0
JD
182842011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18285
18286 * gtkutil.c (qttip_cb): Remove code without function.
18287
8278c4fe
EZ
182882011-07-09 Eli Zaretskii <eliz@gnu.org>
18289
18290 * w32.c (pthread_sigmask): New stub.
18291
1692ae2d 182922011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 18293
8a6ebd58 18294 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
18295 sigprocmask is portable only for single-threaded applications, and
18296 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
18297 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18298 (LIBES): Use it.
18299 * callproc.c (Fcall_process):
18300 * process.c (create_process):
18301 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18302 Use pthread_sigmask, not sigprocmask.
123403e4 18303
1b854618
JD
183042011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18305
18306 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18307 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18308 wrong (Bug#8591).
18309
3fe4b549
JD
183102011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18311
0ce7e563
JD
18312 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18313 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18314 (xg_hide_tooltip): Fix comment.
18315
3fe4b549
JD
18316 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18317 in registerServicesMenuSendTypes.
18318 (validRequestorForSendType): Don't check ns_return_types.
18319
18320 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18321 ns_return_type.
18322
5df75e47
JR
183232011-07-08 Jason Rumney <jasonr@gnu.org>
18324
22610910
JR
18325 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18326 SH_SHOW for hidden windows (Bug#5482).
18327
5df75e47
JR
18328 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18329 frame struct members of non-existent frames (Bug#6284).
18330
699c10bd
JD
183312011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18332
4393663b
JD
18333 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18334 variable firstTime not needed on OSX >= 10.6.
18335 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18336 >= 10.5. Use setKnobProportion, setDoubleValue.
18337
18338 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18339 (MAC_OS_X_VERSION_10_5): Define if not defined.
18340 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18341 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18342 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18343
18344 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 18345 cString and lossyCString on OSX >= 10.4.
4393663b 18346
58179cce 18347 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
18348 sizeToFit on OSX >= 10.2.
18349
18350 * nsimage.m (allocInitFromFile): Don't use deprecated method
18351 bestRepresentationForDevice on OSX >= 10.6.
18352
18353 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18354 to avoid warning.
18355
18356 * emacs.c: Declare unexec_init_emacs_zone.
18357
a63e0781
JD
18358 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18359
699c10bd
JD
18360 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18361
18362 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18363 on svcsMenu (Bug#8842).
18364
18365 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18366 ns_return_types.
18367 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18368
18369 * nsterm.m (QUTF8_STRING): Declare.
18370 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18371 (validRequestorForSendType): Return type is (id).
18372 Change indexOfObjectIdenticalTo to indexOfObject.
18373 Check if we have local selection before returning self (Bug#8842).
18374 (writeSelectionToPasteboard): Put local selection into paste board
18375 if we have a local selection (Bug#8842).
18376 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18377
18378 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18379 (ns_get_local_selection): Declare.
18380
54e10184
LMI
183812011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18382
9888ff71
LMI
18383 * keymap.c (describe_map_tree): Don't insert a double newline at
18384 the end of the buffer (bug#1169) and return whether we inserted
18385 something.
18386
54e10184
LMI
18387 * callint.c (Fcall_interactively): Change "reading args" to
18388 "providing args" to try to clarify what it does (bug#1010).
18389
15fa4783
KH
183902011-07-07 Kenichi Handa <handa@m17n.org>
18391
18392 * composite.c (composition_compute_stop_pos): Ignore a static
18393 composition starting before CHARPOS (Bug#8915).
18394
18395 * xdisp.c (handle_composition_prop): Likewise.
18396
a8815b00
EZ
183972011-07-07 Eli Zaretskii <eliz@gnu.org>
18398
18399 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18400 (Bug#9015)
18401
ef7b981d 184022011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
18403
18404 * character.h (unicode_category_t): New enum type.
18405
18406 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18407 (Qchar_code_property_table): New variable.
18408 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18409 (UNIPROP_COMPRESSED_FORM_P): New macros.
18410 (char_table_ascii): Uncompress the compressed values.
18411 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18412 Uncompress the compressed values.
ac389d0c 18413 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
18414 (char_table_ref_and_range): Uncompress the compressed values.
18415 (sub_char_table_set): New arg is_uniprop. Callers changed.
18416 Uncompress the compressed values.
18417 (sub_char_table_set_range): Args changed. Callers changed.
18418 (char_table_set_range): Adjuted for the above change.
18419 (map_sub_char_table): Delete args default_val and parent. Add arg
18420 top. Give decoded values to a Lisp function.
640c8776 18421 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
18422 values to a Lisp function. Gcpro more variables.
18423 (uniprop_table_uncompress)
18424 (uniprop_decode_value_run_length): New functions.
18425 (uniprop_decoder, uniprop_decoder_count): New variables.
18426 (uniprop_get_decoder, uniprop_encode_value_character)
18427 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18428 New functions.
18429 (uniprop_encoder, uniprop_encoder_count): New variables.
18430 (uniprop_get_encoder, uniprop_table)
18431 (Funicode_property_table_internal, Fget_unicode_property_internal)
18432 (Fput_unicode_property_internal): New functions.
18433 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18434 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 18435 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
18436 char-code-property-alist.
18437
640c8776 18438 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
18439 Vunicode_category_table.
18440
640c8776 18441 * font.c (font_range): Adjust for the change of
c805dec0
KH
18442 Vunicode_category_table.
18443
76b397fb
DN
184442011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18445
18446 * m/iris4d.h: Remove file, move contents ...
18447 * s/irix6-5.h: ... here.
18448
22b4128e
PE
184492011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18450
18451 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
18452 * alloc.c (mark_buffer):
18453 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18454 (clone_per_buffer_values): Don't assume that
22b4128e
PE
18455 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18456 This isn't true in general, and it's particularly not true
18457 if Emacs is configured with --with-wide-int.
18458 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18459 New macros, used in the buffer.c change.
18460
869795d6
JD
184612011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18462
18463 * xsettings.c: Use both GConf and GSettings if both are available.
18464 (store_config_changed_event): Add comment.
18465 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18466 (store_tool_bar_style_changed): New functions.
5e617bc2 18467 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
18468 (struct xsettings): Move font inside HAVE_XFT.
18469 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 18470 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 18471 Move inside HAVE_XFT.
640c8776 18472 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
18473 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18474 also.
18475 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 18476 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 18477 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
18478 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18479 (parse_settings): Move check for font inside HAVE_XFT.
18480 (read_settings, apply_xft_settings): Add comment.
18481 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18482 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18483 call store_font_name_changed.
18484 (xft_settings_event): Add comment.
18485 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18486 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18487 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18488 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18489 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
18490 (xsettings_get_system_font, xsettings_get_system_normal_font):
18491 Add comment.
869795d6 18492
d8ed26bd
PE
184932011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18494
18495 Random fixes. E.g., (random) never returned negative values.
18496 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18497 subseconds part to the entropy, as that's a bit more random.
18498 Prefer signed to unsigned, since the signedness doesn't matter and
18499 in general we prefer signed. When given a limit, use a
18500 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18501 latter isn't right if USE_2_TAGS_FOR_INTS.
18502 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18503 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18504
cabf1cac
SM
185052011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18506
18507 * textprop.c (text_property_stickiness):
18508 Obey Vtext_property_default_nonsticky.
18509 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18510 * w32fns.c (syms_of_w32fns):
18511 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18512
6e9b2be9
PE
185132011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18514
18515 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18516 This is more efficient than Ffile_directory_p and avoids a minor race.
18517
90186c68
LMI
185182011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18519
7c301272
LMI
18520 * buffer.c (Foverlay_put): Say what the return value is
18521 (bug#7835).
18522
c4f2d8d4
LMI
18523 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18524 is a directory before asking whether to use the file name
18525 (bug#7564).
ad637907
LMI
18526 (barf_or_query_if_file_exists): Make the "File is a directory"
18527 error be more correct.
c4f2d8d4 18528
90186c68
LMI
18529 * fns.c (Frequire): Remove the mention of the .gz files, since
18530 that's installation-specific, but keep the mention of
18531 `get-load-suffixes'.
18532
da64016e
PE
185332011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18534
18535 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18536 Report string overflow if the output is too long.
18537
7d47b580
JB
185382011-07-04 Juanma Barranquero <lekktu@gmail.com>
18539
a555cb87
JB
18540 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18541 (syms_of_gnutls): Remove duplicate DEFSYM for
18542 Qgnutls_bootprop_verify_hostname_error, an error for
18543 Qgnutls_bootprop_verify_error (which is no longer used).
18544
7d47b580
JB
18545 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18546 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18547 Also (re)move comments that are misplaced or no longer relevant.
18548
1e49bfab
LMI
185492011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18550
18551 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18552
1485f4c0
CY
185532011-07-03 Chong Yidong <cyd@stupidchicken.com>
18554
18555 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18556 and background color parameters if they have been changed.
18557
a9ab721e
LMI
185582011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18559
18560 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18561
cf7cff57
PE
185622011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18563
2e13213d
PE
18564 * xsettings.c (SYSTEM_FONT): Define only when used.
18565 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18566
cf7cff57
PE
18567 * keymap.c (access_keymap_1): Now static.
18568
7a8e04f7
CY
185692011-07-02 Chong Yidong <cyd@stupidchicken.com>
18570
18571 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18572 leave any prefix arg for the up event (Bug#1586).
18573
61352f62
LMI
185742011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18575
69bb1ef7
LMI
18576 * lread.c (syms_of_lread): Mention single symbols defined by
18577 `defvar' or `defconst' (bug#7154).
18578
61352f62 18579 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 18580 (Frequire): Mention get-load-suffixes.
61352f62 18581
28545e04
MR
185822011-07-02 Martin Rudalics <rudalics@gmx.at>
18583
18584 * window.h (window): Remove clone_number slot.
18585 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18586 Remove.
18587 (make_parent_window, make_window, saved_window)
18588 (Fset_window_configuration, save_window_save): Don't deal with
18589 clone numbers.
18590 * buffer.c (Qclone_number): Remove declaration.
18591 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18592
3349e122
SM
185932011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18594
18595 Add multiple inheritance to keymaps.
18596 * keymap.c (Fmake_composed_keymap): New function.
18597 (Fset_keymap_parent): Simplify.
18598 (fix_submap_inheritance): Remove.
18599 (access_keymap_1): New function extracted from access_keymap to handle
18600 embedded parents and handle lists of maps.
18601 (access_keymap): Use it.
18602 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18603 (Fcopy_keymap): Handle embedded parents.
18604 (Fcommand_remapping, define_as_prefix): Simplify.
18605 (Fkey_binding): Simplify.
18606 (syms_of_keymap): Move minibuffer-local-completion-map,
18607 minibuffer-local-filename-completion-map,
18608 minibuffer-local-must-match-map, and
18609 minibuffer-local-filename-must-match-map to Elisp.
18610 (syms_of_keymap): Defsubr make-composed-keymap.
18611 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18612 (parse_menu_item): Trivial simplification.
18613
3279eb87
GM
186142011-07-01 Glenn Morris <rgm@gnu.org>
18615
18616 * Makefile.in (SETTINGS_LIBS): Fix typo.
18617
39cb9e56 186182011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
18619
18620 * coding.c (Fencode_coding_string): Record the last coding system
18621 used, as the function doc string says (bug#8738).
18622
0949d2b6
JD
186232011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18624
18625 * xsettings.c (store_monospaced_changed): Take new font as arg and
18626 check for change against current_mono_font.
18627 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18628 (emacs_settings_constructor, emacs_settings_get_property)
18629 (emacs_settings_set_property, emacs_settings_class_init)
18630 (emacs_settings_init, gsettings_obj): Remove.
18631 (something_changedCB): New function for HAVE_GSETTINGS.
18632 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18633 with value as argument.
18634 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18635 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 18636 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
18637 "changed".
18638
18639 * xgselect.c: Add defined (HAVE_GSETTINGS).
18640 (xgselect_initialize): Ditto.
18641
18642 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18643 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18644 xg_select.
18645
bbc6b304
PE
186462011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18647
18648 * eval.c (struct backtrace): Simplify and port the data structure.
18649 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18650 signed bit field, as this assumption is not portable and it makes
18651 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18652 "char debug_on_exit : 1" as this is not portable either; instead,
18653 use the portable "unsigned int debug_on_exit : 1". Remove unused
18654 member evalargs. Remove obsolete comments about cc bombing out.
18655
9851bfc5
JD
186562011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18657
51bb811f 18658 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
18659 Let HAVE_GSETTINGS override HAVE_GCONF.
18660 (store_monospaced_changed): New function.
18661 (EMACS_SETTINGS): A new type derived from GObject to handle
18662 GSettings notifications.
18663 (emacs_settings_constructor, emacs_settings_get_property)
18664 (emacs_settings_set_property, emacs_settings_class_init):
18665 New functions.
18666 (gsettings_client, gsettings_obj): New variables.
18667 (GSETTINGS_SCHEMA): New define.
18668 (something_changedCB): Call store_monospaced_changed.
18669 (init_gsettings): New function.
18670 (xsettings_initialize): Call init_gsettings.
18671 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18672 to NULL.
18673
640c8776 18674 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
18675 GCONF_CFLAGS/LIBS.
18676
5386012d
MR
186772011-06-29 Martin Rudalics <rudalics@gmx.at>
18678
18679 * window.c (resize_root_window, grow_mini_window)
18680 (shrink_mini_window): Rename Qresize_root_window to
18681 Qwindow_resize_root_window and Qresize_root_window_vertically to
18682 Qwindow_resize_root_window_vertically.
18683
f13e0b08
PE
186842011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18685
18686 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18687
94515237
JB
186882011-06-27 Juanma Barranquero <lekktu@gmail.com>
18689
18690 * makefile.w32-in: Redesign dependencies so they reflect more
18691 clearly which files are directly included by each source file,
18692 and not through other includes.
18693
e43b6e43
MR
186942011-06-27 Martin Rudalics <rudalics@gmx.at>
18695
18696 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18697 (sort_overlays, overlay_strings): When an overlay's clone number
18698 matches the window's clone number process the overlay even if
18699 the overlay's window property doesn't match the current window.
18700
d68443dc
MR
18701 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18702 (Fwindow_hchild): Rename to Fwindow_left_child.
18703 (Fwindow_next): Rename to Fwindow_next_sibling.
18704 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
18705 (resize_window_check): Rename to window_resize_check.
18706 (resize_window_apply): Rename to window_resize_apply.
18707 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18708 (Fdelete_other_windows_internal, resize_frame_windows)
18709 (Fsplit_window_internal, Fdelete_window_internal)
18710 (grow_mini_window, shrink_mini_window)
18711 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 18712
c7e73be5
JD
187132011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18714
18715 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18716 (emacs_fixed_set_min_size): Remove.
18717 (emacs_fixed_new): Take frame as argument.
18718
18719 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18720 (_EmacsFixedPrivate): Remove minwidth/height.
18721 Add struct frame *f.
18722 (emacs_fixed_init): Initialize priv->f.
18723 (get_parent_class, emacs_fixed_set_min_size): Remove.
18724 (emacs_fixed_new): Set priv->f to argument.
18725 (emacs_fixed_get_preferred_width)
18726 (emacs_fixed_get_preferred_height): Use min_width/height from
18727 frames size_hint to set minimum and natural (Bug#8919).
18728 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18729 and use min_width/height from frames size_hint to set
18730 min_width/height (Bug#8919).
18731
18732 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
18733 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18734 Fix indentation.
c7e73be5 18735
cf99dcf8
EZ
187362011-06-26 Eli Zaretskii <eliz@gnu.org>
18737
18738 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18739 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18740 called at ZV.
18741
029529ac
CY
187422011-06-26 Chong Yidong <cyd@stupidchicken.com>
18743
18744 * process.c (wait_reading_process_output): Bypass select if
18745 waiting for a cell while ignoring keyboard input, and input is
18746 pending. Suggested by Jan Djärv (Bug#8869).
18747
7a7ef429
PE
187482011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18749
18750 Use gnulib's dup2 module instead of rolling our own.
18751 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18752
11fdef7d 187532011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
18754
18755 * dispnew.c (scrolling_window): Before scrolling, turn off a
18756 mouse-highlight in the window being scrolled.
18757
cd3520a4
JB
187582011-06-24 Juanma Barranquero <lekktu@gmail.com>
18759
18760 Move DEFSYM to lisp.h and use everywhere.
18761
18762 * character.h (DEFSYM): Move declaration...
18763 * lisp.h (DEFSYM): ...here.
18764
18765 * gnutls.c:
18766 * minibuf.c:
18767 * w32menu.c:
18768 * w32proc.c:
18769 * w32select.c: Don't include character.h.
18770
18771 * alloc.c (syms_of_alloc):
18772 * buffer.c (syms_of_buffer):
18773 * bytecode.c (syms_of_bytecode):
18774 * callint.c (syms_of_callint):
18775 * casefiddle.c (syms_of_casefiddle):
18776 * casetab.c (init_casetab_once):
18777 * category.c (init_category_once, syms_of_category):
18778 * ccl.c (syms_of_ccl):
18779 * cmds.c (syms_of_cmds):
18780 * composite.c (syms_of_composite):
18781 * dbusbind.c (syms_of_dbusbind):
18782 * dired.c (syms_of_dired):
18783 * dispnew.c (syms_of_display):
18784 * doc.c (syms_of_doc):
18785 * editfns.c (syms_of_editfns):
18786 * emacs.c (syms_of_emacs):
18787 * eval.c (syms_of_eval):
18788 * fileio.c (syms_of_fileio):
18789 * fns.c (syms_of_fns):
18790 * frame.c (syms_of_frame):
18791 * fringe.c (syms_of_fringe):
18792 * insdel.c (syms_of_insdel):
18793 * keymap.c (syms_of_keymap):
18794 * lread.c (init_obarray, syms_of_lread):
18795 * macros.c (syms_of_macros):
18796 * msdos.c (syms_of_msdos):
18797 * print.c (syms_of_print):
18798 * process.c (syms_of_process):
18799 * search.c (syms_of_search):
18800 * sound.c (syms_of_sound):
18801 * syntax.c (init_syntax_once, syms_of_syntax):
18802 * terminal.c (syms_of_terminal):
18803 * textprop.c (syms_of_textprop):
18804 * undo.c (syms_of_undo):
18805 * w32.c (globals_of_w32):
18806 * window.c (syms_of_window):
18807 * xdisp.c (syms_of_xdisp):
18808 * xfaces.c (syms_of_xfaces):
18809 * xfns.c (syms_of_xfns):
18810 * xmenu.c (syms_of_xmenu):
18811 * xsettings.c (syms_of_xsettings):
18812 * xterm.c (syms_of_xterm): Use DEFSYM.
18813
4228cf16
TZ
188142011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18815
cd3520a4 18816 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 18817
7fcccf1e
PE
188182011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18819
7efb4e0e
PE
18820 Integer and buffer overflow fixes (Bug#8873).
18821
ff5844ad
PE
18822 * print.c (printchar, strout): Check for string overflow.
18823 (PRINTPREPARE, printchar, strout):
18824 Don't set size unless allocation succeeds.
18825
90532f02
PE
18826 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18827 for sizes. Check for string overflow more accurately.
18828 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18829
6d84508d
PE
18830 * macros.c: Integer and buffer overflow fixes.
18831 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18832 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18833 Use ptrdiff_t, not int, for sizes.
18834 Don't increment bufsize until after realloc succeeds.
18835 Check for size-calculation overflow.
18836 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18837
437b2cb4
PE
18838 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18839
8b9ac8b4
PE
18840 * lread.c: Integer overflow fixes.
18841 (read_integer): Radix is now EMACS_INT, not int,
18842 to improve quality of diagnostics for out-of-range radices.
18843 Calculate buffer size correctly for out-of-range radices.
18844 (read1): Check for integer overflow in radices, and in
18845 read-circle numbers.
82cb60d3
PE
18846 (read_escape): Avoid int overflow.
18847 (Fload, openp, read_buffer_size, read1)
18848 (substitute_object_recurse, read_vector, read_list, map_obarray):
18849 Use ptrdiff_t, not int, for sizes.
18850 (read1): Use EMACS_INT, not int, for sizes.
20270765 18851 Check for size overflow.
8b9ac8b4 18852
7fcccf1e
PE
18853 * image.c (cache_image): Check for size arithmetic overflow.
18854
bfbbd7e7
PE
18855 * lread.c: Integer overflow issues.
18856 (saved_doc_string_size, saved_doc_string_length)
18857 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18858 Now ptrdiff_t, not int.
18859 (read1): Don't assume doc string length fits in int. Check for
18860 out-of-range doc string lengths.
18861 (read_list): Don't assume file position fits in int.
39019e54 18862 (read_escape): Check for hex character overflow.
bfbbd7e7 18863
4e323265
LL
188642011-06-22 Leo Liu <sdl.web@gmail.com>
18865
18866 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18867 Move to minibuffer.el.
18868
85fece3e
PE
188692011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18870
20b84ce9 18871 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
18872 The following patches are for when GLYPH_DEBUG && !XASSERT.
18873 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18874 * dispnew.c (flush_stdout):
18875 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18876 Mark as externally visible.
18877 * dispnew.c (check_window_matrix_pointers): Now static.
18878 * dispnew.c (window_to_frame_vpos):
18879 * xfns.c (unwind_create_frame):
18880 * xterm.c (x_check_font): Remove unused local.
18881 * scroll.c (CHECK_BOUNDS):
18882 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18883 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18884 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18885 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18886 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18887 Now static.
18888 (debug_method_add): Use va_list and vsprintf rather than relying
18889 on undefined behavior with wrong number of arguments.
18890 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18891 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18892 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18893 since we're not interested in debugging glyphs with old libraries.
18894 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18895 GCC 4.6.0's static checking.
18896
0766b489
PE
188972011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18898
31fd4b32
PE
18899 Integer overflow and signedness fixes (Bug#8873).
18900 A few related buffer overrun fixes, too.
18901
b79e8648
PE
18902 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18903
0766b489
PE
18904 * dispextern.h (struct face.stipple):
18905 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18906 (x_bitmap_mask, x_allocate_bitmap_record)
18907 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18908 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18909 (x_create_bitmap_from_xpm_data):
18910 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18911 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18912 (.bitmaps_last):
18913 * xfaces.c (load_pixmap):
18914 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18915 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18916 (.bitmaps_last, struct x_output.icon_bitmap):
18917 Use ptrdiff_t, not int, for bitmap indexes.
18918 (x_allocate_bitmap_record): Check for size overflow.
18919 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18920
b081724f
PE
18921 Use ptrdiff_t, not int, for overlay counts.
18922 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18923 * editfns.c (overlays_around, get_pos_property):
18924 * textprop.c (get_char_property_and_overlay):
18925 * xdisp.c (next_overlay_change, note_mouse_highlight):
18926 * xfaces.c (face_at_buffer_position):
21514da7
PE
18927 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18928 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18929 (Fnext_overlay_change, Fprevious_overlay_change)
18930 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 18931 Use ptrdiff_t, not int, for sizes.
21514da7 18932 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 18933
3de73e5e
PE
18934 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18935
2606c57b
PE
18936 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18937 (x_session_initialize): Do not assume string length fits in int.
18938
aaafe47a
PE
18939 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18940 This is unlikely, but can occur if DPI is outlandish.
18941
2674ddc8 18942 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
18943 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18944
28154962
PE
18945 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18946 * xrdb.c (magic_file_p, search_magic_path):
18947 Omit last arg SUFFIX; it was always 0. All callers changed.
18948 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18949
7de51af5
PE
18950 * xfont.c (xfont_match): Avoid need for strlen.
18951
25ed6cc3
PE
18952 * xfns.c: Don't assume strlen fits in int.
18953 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18954
4eab31dd
PE
18955 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18956 not unsigned long, as we prefer signed integers. All callers changed.
18957 Detect integer overflow in repeat count.
18958 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 18959 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 18960
171e2a58
PE
18961 * termcap.c: Don't assume sizes fit in int and never overflow.
18962 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18963 (gobble_line): Check for size-calculation overflow.
18964
ad39faca 18965 * minibuf.c (Fread_buffer):
6e5bb2dc 18966 * lread.c (intern, intern_c_string):
74ca2eb3
PE
18967 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18968 Don't assume string length fits in int.
18969
52c61c22 18970 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
18971 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18972
b5b8c9e5
PE
18973 * font.c: Don't assume string length fits in int.
18974 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18975 Use ptrdiff_t, not int.
ccd6111c
PE
18976 (font_intern_prop): Don't assume string length fits in int.
18977 Don't assume integer property fits in fixnum.
18978 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 18979
882f0d81 18980 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 18981 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
18982 Reformulate so as not to need the command string.
18983 Invoke gzip -cd rather than gunzip, as it's more portable.
18984 (lock_info_type, lock_file_1, lock_file):
18985 Don't assume pid_t and time_t fit in unsigned long.
18986 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18987 (current_lock_owner): Prefer signed type for sizes.
18988 Use memcpy, not strncpy, where memcpy is what is really wanted.
18989 Don't assume (via atoi) that time_t and pid_t fit in int.
18990 Check for time_t and/or pid_t out of range, e.g., via a network share.
18991 Don't alloca where an auto var works fine.
18992
93f4cf88
PE
18993 * fileio.c: Fix some integer overflow issues.
18994 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18995 Don't assume string length fits in int.
18996 (directory_file_name): Don't assume string length fits in long.
18997 (make_temp_name): Don't assume pid fits in int, or that its print
18998 length is less than 20.
18999
f3e92b69
PE
19000 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19001
1bfdaf10
PE
19002 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19003
35016e9a
PE
19004 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19005
3d1e65a1
PE
19006 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19007 We prefer signed integers, even for size calculations.
19008
0b963a93
PE
19009 * emacs.c: Don't assume string length fits in 'int'.
19010 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19011 (main): Don't invoke strlen when not needed.
19012
573f4b54
PE
19013 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19014 (XD_DEBUG_MESSAGE): Don't waste a byte.
19015
989f33ba
PE
19016 * callproc.c (getenv_internal_1, getenv_internal)
19017 (Fgetenv_internal):
965d34eb
PE
19018 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19019
e4d29b33
PE
19020 * lread.c (invalid_syntax): Omit length argument.
19021 All uses changed. This doesn't fix a bug, but it simplifies the
19022 code away from its former Hollerith-constant appearance, and it's
19023 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 19024 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 19025
eb49b136
PE
19026 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19027 This didn't break anything, but it didn't help either.
19028 It's confusing to put a bogus integer in a place where the actual
19029 value does not matter.
9f62aeb1 19030 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 19031 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 19032
15375a22
PE
19033 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19034 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19035 implementation.
b61cc01c
PE
19036 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19037 We prefer signed types, and the value cannot exceed the EMACS_INT
19038 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
19039 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19040 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19041 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 19042
53b2623d
PE
19043 * indent.c (sane_tab_width): New function.
19044 (current_column, scan_for_column, Findent_to, position_indentation)
19045 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 19046 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 19047
51cab52b 19048 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 19049
f2ed8a70
PE
19050 * lisp.h (lint_assume): New macro.
19051 * composite.c (composition_gstring_put_cache):
19052 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19053
abe80cc6
PE
19054 * editfns.c, insdel.c:
19055 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 19056
b02c740e
PE
19057 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19058
ebc96716
PE
19059 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19060
b4e50fa0 19061 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 19062 Use much-faster test for byte-length change.
311d5d7c 19063 Don't assume string byte-length fits in 'int'.
a4cf38e4 19064 Check that character arg fits in 'int'.
85461888 19065 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 19066
c0c1ee9f
PE
19067 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19068
a498d7f4
PE
19069 * fns.c (concat): Catch string overflow earlier.
19070 Do not rely on integer wraparound.
19071
51cab52b
PE
19072 * dispextern.h (struct it.overlay_strings_charpos)
19073 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
19074 * xdisp.c (forward_to_next_line_start)
19075 (back_to_previous_visible_line_start)
19076 (reseat_at_next_visible_line_start, next_element_from_buffer):
19077 Don't arbitrarily truncate the value of 'selective' to int.
19078
76031fad
PE
19079 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19080
5eb55db9
PE
19081 * composite.c: Don't truncate sizes to 'int'.
19082 (composition_gstring_p, composition_reseat_it)
19083 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
19084 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19085 not EMACS_UINT, for indexes.
5eb55db9 19086
0703a717
PE
19087 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19088
d6202519
PE
19089 * buffer.c: Include <verify.h>.
19090 (struct sortvec.priority, struct sortstr.priority):
8961a454 19091 Now EMACS_INT, not int.
c20998a7 19092 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
19093 (struct sortstr.size, record_overlay_string)
19094 (struct sortstrlist.size, struct sortlist.used):
19095 Don't truncate size to int.
19096 (record_overlay_string): Check for size-calculation overflow.
d6202519 19097 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 19098
d5a19415
JM
190992011-06-22 Jim Meyering <meyering@redhat.com>
19100
029529ac 19101 Don't leak an XBM-image-sized buffer
d5a19415
JM
19102 * image.c (xbm_load): Free the image buffer after using it.
19103
a9041e6c
PE
191042011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19105
19106 Port to Sun C.
19107 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19108 that Sun C diagnosed.
19109 * fns.c (secure_hash): Fix pointer signedness issue.
19110 * intervals.c (static_offset_intervals): New function.
19111 (offset_intervals): Use it.
19112
7f3f739f
LL
191132011-06-21 Leo Liu <sdl.web@gmail.com>
19114
19115 * deps.mk (fns.o):
19116 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19117 sha512.h.
19118
19119 * fns.c (secure_hash): Rename from crypto_hash_function and change
19120 the first arg to accept symbols.
5b66d427 19121 (Fsecure_hash): New primitive.
7f3f739f
LL
19122 (syms_of_fns): New symbols.
19123
76147d94
DD
191242011-06-20 Deniz Dogan <deniz@dogan.se>
19125
19126 * process.c (Fset_process_buffer): Clarify return value in
19127 docstring.
19128
7d7d0045
CY
191292011-06-18 Chong Yidong <cyd@stupidchicken.com>
19130
19131 * dispnew.c (add_window_display_history): Use BVAR.
19132
19133 * xdisp.c (debug_method_add): Use BVAR.
19134 (check_window_end, dump_glyph_matrix, dump_glyph)
19135 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19136
19137 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19138 Likewise.
19139
19140 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19141 check till after the cache is created in init_frame_faces.
19142
ff2bc410
SM
191432011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19144
19145 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19146
28177add
PE
191472011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19148
dd3482fe
PE
19149 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19150 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19151 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19152
393d71f3 19153 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
19154 * fileio.c (Finsert_file_contents):
19155 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19156 Remove the old (too-loose) buffer overflow checks.
19157 They weren't needed, since make_gap checks for buffer overflow.
19158 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19159 The old code merely checked for Emacs fixnum overflow, and relied
19160 on undefined (wraparound) behavior. The new code avoids undefined
19161 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19162
2e6813b0 19163 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
19164 Tune. Don't use wider integers than needed. Don't use alloca.
19165 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 19166
599a9e4f
PE
19167 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19168
99561444
PE
19169 * insdel.c, lisp.h (buffer_overflow): New function.
19170 (insert_from_buffer_1, replace_range, replace_range_2):
19171 * insdel.c (make_gap_larger):
19172 * editfns.c (Finsert_char):
19173 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19174
28177add
PE
19175 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19176
e69dafad
PE
191772011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19178
4baa020d 19179 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 19180
b1c46f02
PE
19181 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19182 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19183
e69dafad
PE
19184 * fileio.c: Don't assume EMACS_INT fits in off_t.
19185 (emacs_lseek): New static function.
19186 (Finsert_file_contents, Fwrite_region): Use it.
19187 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19188
566684ea
PE
19189 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19190
e6966cd6
PE
19191 * fns.c: Don't overflow int when computing a list length.
19192 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19193 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19194 truncation on 64-bit hosts. Check for QUIT every
19195 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19196 faster and is responsive enough.
19197 (Flength): Report an error instead of overflowing an integer.
19198 (Fsafe_length): Return a float if the value is not representable
19199 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 19200 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 19201 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 19202
dd0b0efb
PE
19203 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19204 (header_size, word_size): New constants.
19205 (allocate_vectorlike): Don't check size overflow here.
19206 (allocate_vector): Check it here instead, since this is the only
19207 caller of allocate_vectorlike that could cause overflow.
19208 Check that the new vector's length is representable as a fixnum.
19209
86fe5cfe
PE
19210 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19211 The previous code was bogus. For example, next_almost_prime (32)
19212 returned 39, which is undesirable as it is a multiple of 3; and
19213 next_almost_prime (24) returned 25, which is a multiple of 5 so
19214 why was the code bothering to check for multiples of 7?
19215
80e88859
PE
19216 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19217
4a2f0ad6
PE
19218 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19219
f66c7cf8
PE
19220 Variadic C functions now count arguments with ptrdiff_t.
19221 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19222 Back then I didn't know that the Emacs coding style prefers signed int.
19223 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
19224 were being counted with int, which may truncate counts on 64-bit
19225 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
19226 * lisp.h (struct Lisp_Subr.function.aMANY)
19227 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19228 Arg counts are now ptrdiff_t, not size_t.
19229 All variadic functions and their callers changed accordingly.
19230 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19231 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19232 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19233 * callint.c (Fcall_interactively): Check arg count for overflow,
19234 to avoid potential buffer overrun. Use signed char, not 'int',
19235 for 'varies' array, so that we needn't bother to check its size
19236 calculation for overflow.
19237 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19238 * eval.c (apply_lambda):
19239 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19240 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19241 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19242
a1759b76
PE
19243 * callint.c (Fcall_interactively): Don't use index var as event count.
19244
d96be9fc
PE
19245 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19246 * mem-limits.h (SIZE): Remove; no longer used.
19247
a690a978 19248 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 19249
578c21e6
PE
19250 Remove unnecessary casts.
19251 * xterm.c (x_term_init):
19252 * xfns.c (x_set_border_pixel):
19253 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19254 These aren't needed now that we assume ANSI C.
19255
96f53c6c
PE
19256 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19257 It's more likely to cause problems (due to unsigned overflow)
19258 than to cure them.
19259
83c77d31
PE
19260 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19261
ee2079f1
PE
19262 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19263
6da65536
PE
19264 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19265
7147c4a4
PE
19266 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19267
193e32d9
PE
19268 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19269
e5533da6
PE
19270 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19271
9910e595
PE
19272 GLYPH_CODE_FACE returns EMACS_INT, not int.
19273 * dispextern.h (merge_faces):
19274 * xfaces.c (merge_faces):
01103c44
PE
19275 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19276 Don't assume EMACS_INT fits in int.
9910e595 19277
2638320e
PE
19278 * character.h (CHAR_VALID_P): Remove unused parameter.
19279 * fontset.c, lisp.h, xdisp.c: All uses changed.
19280
045eb8d9
PE
19281 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19282
c1f134b5
PE
19283 * fns.c (concat): Minor tuning based on overflow analysis.
19284 This doesn't fix any bugs. Use int to hold character, instead
19285 of constantly refetching from Emacs object. Use XFASTINT, not
19286 XINT, for value known to be a character. Don't bother comparing
19287 a single byte to 0400, as it's always less.
19288
395fcb93 19289 * floatfns.c (Fexpt):
327eeec8
PE
19290 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19291
abbd3d23
PE
19292 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19293 for characters.
19294
684a03ef
PE
19295 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19296
0fed43f3
PE
19297 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19298 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19299 incorrectly succeed when S was a string, because 4294967386 was
19300 truncated before it was used.
19301
8fd02eb7
PE
19302 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19303 Otherwise, an out-of-range integer could cause undefined behavior
19304 on a 64-bit host.
19305
f8c86b69
PE
19306 * composite.c: Use int, not EMACS_INT, for characters.
19307 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19308 EMACS_INT, for values that are known to be in character range.
19309 This doesn't fix any bugs but is the usual style inside Emacs and
19310 may generate better code on 32-bit machines.
19311
34206dd2
PE
19312 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19313 This is for reasons similar to the recent CHAR_STRING fix.
19314 * charset.c (Fencode_char): Check that character arg is actually
19315 a character. Pass an int to ENCODE_CHAR.
19316 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19317 wider than 'int', as a compile-time check to prevent future regressions
19318 in this area.
19319
c5958d4c 19320 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
19321
19322 Make sure a 64-bit char is never passed to CHAR_STRING.
19323 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19324 by silently ignoring the top 32 bits, allowing some values
19325 that were far too large to be valid characters.
19326 * character.h: Include <verify.h>.
19327 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19328 arguments are no wider than unsigned, as a compile-time check
19329 to prevent future regressions in this area.
19330 * data.c (Faset):
01103c44 19331 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
19332 (Fsubst_char_in_region):
19333 * fns.c (concat):
19334 * xdisp.c (decode_mode_spec_coding):
19335 Adjust to CHAR_STRING's new requirement.
19336 * editfns.c (Finsert_char, Fsubst_char_in_region):
19337 * fns.c (concat): Check that character args are actually
19338 characters. Without this test, these functions did the wrong
19339 thing with wildly out-of-range values on 64-bit hosts.
19340
d37ca623
PE
19341 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19342 These casts should not be needed on 32-bit hosts, either.
19343 * keyboard.c (read_char):
19344 * lread.c (Fload): Remove casts to unsigned.
19345
ea204efb
PE
19346 * lisp.h (UNSIGNED_CMP): New macro.
19347 This fixes comparison bugs on 64-bit hosts.
19348 (ASCII_CHAR_P): Use it.
19349 * casefiddle.c (casify_object):
01103c44 19350 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
19351 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19352 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19353 * dispextern.h (FACE_FROM_ID):
19354 * keyboard.c (read_char): Use UNSIGNED_CMP.
19355
41cb286c
PE
19356 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19357 not to EMACS_INT, to avoid GCC warning.
19358
4a1b9832
PE
19359 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19360
55daad71
PE
19361 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19362 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19363 isn't needed on 32-bit machines.
8f95c75c 19364
01103c44
PE
19365 * buffer.c (Fgenerate_new_buffer_name):
19366 Use EMACS_INT for count, not int.
0ceccced 19367 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
19368
19369 * data.c (Qcompiled_function): Now static.
19370
c6f072e7
PE
19371 * window.c (window_body_lines): Now static.
19372
20ce5912
PE
19373 * image.c (gif_load): Rename local to avoid shadowing.
19374
9c4c5f81
PE
19375 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19376 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19377 * alloc.c (make_save_value): Integer argument is now of type
19378 ptrdiff_t, not int.
19379 (mark_object): Use ptrdiff_t, not int.
19380 * lisp.h (pD): New macro.
19381 * print.c (print_object): Use it.
19382
c0c5c8ae
PE
19383 * alloc.c: Use EMACS_INT, not int, to count objects.
19384 (total_conses, total_markers, total_symbols, total_vector_size)
19385 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
19386 (total_free_floats, total_floats, total_free_intervals)
19387 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
19388 Now EMACS_INT, not int. All uses changed.
19389 (Fgarbage_collect): Compute overall total using a double, so that
19390 integer overflow is less likely to be a problem. Check for overflow
19391 when converting back to an integer.
5a25e253
PE
19392 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19393 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19394 These were 'int' variables that could overflow on 64-bit hosts;
19395 they were never used, so remove them instead of repairing them.
211a0b2a 19396 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
19397 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19398 Previously, this ceilinged at INT_MAX, but that doesn't work on
19399 64-bit machines.
e46bb31a 19400 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 19401
c78baabf 19402 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 19403 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
19404 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19405 when a (possibly-narrower) signed value would do just as well.
19406 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 19407
c9d624c6
PE
19408 * alloc.c: Catch some string size overflows that we were missing.
19409 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19410 for convenience in STRING_BYTES_MAX.
19411 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19412 The definition here is exact; the one in lisp.h was approximate.
19413 (allocate_string_data): Check for string overflow. This catches
19414 some instances we weren't catching before. Also, it catches
19415 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19416 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19417 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 19418
c9d624c6
PE
19419 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19420 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 19421 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 19422
353032ce
PE
19423 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19424
2bccce07
PE
19425 * alloc.c (Fmake_string): Check for out-of-range init.
19426
0ac30604
SM
194272011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19428
19429 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19430
c195f2de
JD
194312011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19432
19433 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19434 xg_get_default_scrollbar_width.
19435
19436 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19437 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19438 (style_changed_cb): Call update_theme_scrollbar_width and call
19439 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19440 all frames (Bug#8505).
19441 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19442 Call gtk_window_set_resizable if HAVE_GTK3.
19443 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19444 and height if HAVE_GTK3 (Bug#8505).
19445 (scroll_bar_width_for_theme): New variable.
19446 (update_theme_scrollbar_width): New function.
19447 (xg_get_default_scrollbar_width): Move code to
19448 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19449 (xg_initialize): Call update_theme_scrollbar_width.
19450
19451 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19452
19453 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19454
e10ac9f1
MR
194552011-06-12 Martin Rudalics <rudalics@gmx.at>
19456
19457 * frame.c (make_frame): Call other_buffer_safely instead of
19458 other_buffer.
19459
19460 * window.c (temp_output_buffer_show): Call display_buffer with
19461 second argument Vtemp_buffer_show_specifiers and reset latter
19462 immediately after the call.
19463 (Vtemp_buffer_show_specifiers): New variable.
19464 (auto_window_vscroll_p, next_screen_context_lines)
19465 (Vscroll_preserve_screen_position): Remove leading asterisks from
19466 doc-strings.
19467
2d3c217e 194682011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 19469
7b7f97e8 19470 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
19471 * buffer.c (Qclone_number): Remove for now, as it's unused.
19472 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19473 (record_buffer): Remove unused local.
19474 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19475 (set_frame_buffer_list): Remove; unused.
19476 * frame.h (other_visible_frames): Remove decl.
19477 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19478 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19479 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19480 if HAVE_GPM.
19481 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19482 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19483 Define only if HAVE_GPM.
19484 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19485 (update_hints_inhibit): Remove; never set. All uses removed.
19486 * widgetprv.h (emacsFrameClassRec): Remove decl.
19487 * window.c (delete_deletable_window): Now returns void, since it
19488 wasn't returning anything.
19489 (compare_window_configurations): Remove unused locals.
19490 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19491 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
19492 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19493 the same widths as pointers. This follows up on the 2011-05-06 patch.
19494 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19495 * xterm.h: Likewise.
19496 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19497
1384b89e
JB
194982011-06-12 Juanma Barranquero <lekktu@gmail.com>
19499
19500 * makefile.w32-in: Update dependencies.
19501 (LISP_H): Add lib/intprops.h.
19502
1100a63c
CY
195032011-06-11 Chong Yidong <cyd@stupidchicken.com>
19504
19505 * image.c (gif_load): Add animation frame delay to the metadata.
19506 (syms_of_image): Use DEFSYM. New symbol `delay'.
19507
6198ccd0
MR
195082011-06-11 Martin Rudalics <rudalics@gmx.at>
19509
19510 * window.c (delete_deletable_window): Re-add.
19511 (Fset_window_configuration): Rewrite to handle dead buffers and
19512 consequently deletable windows.
19513 (window_tree, Fwindow_tree): Remove. Supply functionality in
19514 window.el.
19515 (compare_window_configurations): Simplify code.
19516
b6e3633c
AS
195172011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19518
1ab0dee5
AS
19519 * image.c (imagemagick_load_image): Fix type mismatch.
19520 (Fimagemagick_types): Likewise.
19521
b6e3633c
AS
19522 * window.h (replace_buffer_in_windows): Declare.
19523
9397e56f
MR
195242011-06-11 Martin Rudalics <rudalics@gmx.at>
19525
19526 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19527 Qclone_number. Remove external declaration of Qdelete_window.
19528 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19529 code.
640c8776
SM
19530 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19531 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
19532 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19533 buffer list implementation.
19534 (other_buffer_safely): New function.
19535 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19536 calls to replace_buffer_in_windows and
19537 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19538 if allowed.
19539 (record_buffer): Inhibit quitting and rewrite using quittable
19540 functions. Run Qbuffer_list_update_hook if allowed.
19541 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
19542 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19543 Move switch-to-buffer to window.el.
9397e56f
MR
19544 (bury-buffer): Move to window.el.
19545 (Vbuffer_list_update_hook): New variable.
19546
19547 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19548 section.
19549
19550 * window.h (resize_frame_windows): Move up in code.
19551 (Fwindow_frame): Remove EXFUN.
19552 (replace_buffer_in_all_windows): Remove prototype.
19553 (replace_buffer_in_windows_safely): Add prototype.
19554
19555 * window.c: Declare Qdelete_window static again. Move down
19556 declaration of select_count.
19557 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19558 (Fother_window): Move to window.el.
19559 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19560 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19561 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19562 window.el.
19563 (replace_buffer_in_windows): Implement by calling
19564 Qreplace_buffer_in_windows.
19565 (replace_buffer_in_all_windows): Remove with some functionality
19566 moved into replace_buffer_in_windows_safely.
19567 (replace_buffer_in_windows_safely): New function.
19568 (select_window_norecord, select_frame_norecord): Move in front
19569 of run_window_configuration_change_hook. Remove now obsolete
19570 declarations.
640c8776
SM
19571 (Fset_window_buffer): Rewrite doc-string.
19572 Call Qrecord_window_buffer.
9397e56f
MR
19573 (keys_of_window): Move binding for other-window to window.el.
19574
b50691aa
CY
195752011-06-11 Chong Yidong <cyd@stupidchicken.com>
19576
19577 * dispextern.h (struct image): Replace data member, whose int_val
19578 and ptr_val fields were not used by anything, with a single
19579 lisp_val object.
19580
19581 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19582 (gif_clear_image, gif_load, imagemagick_load_image)
19583 (gs_clear_image, gs_load): Callers changed.
19584
3f754b86
PE
195852011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19586
cca69397
PE
19587 * buffer.h: Include <time.h>, for time_t.
19588 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19589
109e28d0
PE
19590 Fix minor problems found by static checking.
19591
60737f02
PE
19592 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19593
4b66faf3
PE
19594 Make identifiers static if they are not used in other modules.
19595 * data.c (Qcompiled_function, Qframe, Qvector):
19596 * image.c (QimageMagick, Qsvg):
19597 * minibuf.c (Qmetadata):
19598 * window.c (resize_window_check, resize_root_window): Now static.
19599 * window.h (resize_window_check, resize_root_window): Remove decls.
19600
109e28d0
PE
19601 * window.c (window_deletion_count, delete_deletable_window):
19602 Remove; unused.
46a4ce9e
PE
19603 (window_body_lines): Now static.
19604 (Fdelete_other_windows_internal): Mark vars as initialized.
19605 Make sure 'resize_failed' is initialized.
19606 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19607 (resize_window_apply): Remove unused local.
19608 * window.h (delete_deletable_window): Remove decl.
19609
109e28d0 19610 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
19611 (imagemagick_load_image): Fix pointer signedness problem by changing
19612 last arg from unsigned char * to char *. All uses changed.
19613 Also, fix a local for similar reasons.
19614 Remove unused locals. Remove locals to avoid shadowing.
19615 (fn_rsvg_handle_free): Remove; unused.
19616 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 19617 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 19618
3f754b86
PE
19619 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19620
2547adb1
CY
196212011-06-10 Chong Yidong <cyd@stupidchicken.com>
19622
19623 * image.c (gif_load): Fix omitted cast error introduced by
19624 2011-06-06 change.
19625
2c8e37d4
MR
196262011-06-10 Martin Rudalics <rudalics@gmx.at>
19627
19628 * window.h (resize_proportionally, orig_total_lines)
19629 (orig_top_line): Remove from window structure.
19630 (set_window_height, set_window_width, change_window_heights)
19631 (Fdelete_window): Remove prototypes.
19632 (resize_frame_windows): Remove duplicate declaration.
19633
440a42e3
EZ
196342011-06-10 Eli Zaretskii <eliz@gnu.org>
19635
19636 * window.h (resize_frame_windows, resize_window_check)
19637 (delete_deletable_window, resize_root_window)
19638 (resize_frame_windows): Declare prototypes.
19639
19640 * window.c (resize_window_apply): Make definition be "static" to
19641 match the prototype.
19642
562dd5e9
MR
196432011-06-10 Martin Rudalics <rudalics@gmx.at>
19644
19645 * window.c: Remove declarations of Qwindow_size_fixed,
19646 window_min_size_1, window_min_size_2, window_min_size,
19647 size_window, window_fixed_size_p, enlarge_window, delete_window.
19648 Remove static from declaration of Qdelete_window, it's
19649 temporarily needed by Fbury_buffer.
19650 (replace_window): Don't assign orig_top_line and
19651 orig_total_lines.
19652 (Fdelete_window, delete_window): Remove. Window deletion is
19653 handled by window.el.
640c8776
SM
19654 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19655 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
19656 (Fdelete_other_windows): Remove. Deleting other windows is
19657 handled by window.el.
19658 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19659 handled in window.el.
19660 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19661 Window minimum sizes are handled in window.el.
19662 (shrink_windows, size_window, set_window_height)
19663 (set_window_width, change_window_heights, window_height)
19664 (window_width, CURBEG, CURSIZE, enlarge_window)
19665 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19666 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19667 handled in window.el.
19668 (make_dummy_parent): Rename to make_parent_window and give it a
19669 second argument horflag.
19670 (make_window): Don't set resize_proportionally any more.
19671 (Fsplit_window): Remove. Windows are split in window.el.
19672 (save_restore_action, save_restore_orig_size)
19673 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19674 Resize mini windows in window.el.
19675 (grow_mini_window, shrink_mini_window): Implement by calling
19676 Qresize_root_window_vertically, resize_window_check and
19677 resize_window_apply.
640c8776
SM
19678 (saved_window, Fset_window_configuration, save_window_save):
19679 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
19680 resize_proportionally.
19681 (window_min_height, window_min_width): Move to window.el.
19682 (keys_of_window): Move bindings for delete-other-windows,
19683 split-window, delete-window and enlarge-window to window.el.
19684
19685 * buffer.c: Temporarily extern Qdelete_window.
19686 (Fbury_buffer): Temporarily call Qdelete_window instead of
19687 Fdelete_window (Fbury_buffer will move to window.el soon).
19688
19689 * frame.c (set_menu_bar_lines_1): Remove code handling
19690 orig_top_line and orig_total_lines.
19691
19692 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19693 set_window_height but set heights directly.
19694 (change_frame_size_1): Use resize_frame_windows.
19695
19696 * xdisp.c (init_xdisp): Don't use set_window_height but set
19697 heights directly.
19698
640c8776
SM
19699 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19700 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
19701 run_window_configuration_change_hook.
19702
19703 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19704 instead of change_window_heights and run
19705 run_window_configuration_change_hook.
19706
1a13852e
MR
197072011-06-09 Martin Rudalics <rudalics@gmx.at>
19708
19709 * window.c (replace_window): Rename second argument REPLACEMENT to
19710 NEW. New third argument SETFLAG. Rewrite.
19711 (delete_window, make_dummy_parent): Call replace_window with
19712 third argument 1.
19713 (window_list_1): Move down in code.
19714 (run_window_configuration_change_hook): Move set_buffer part
19715 before select_frame_norecord part in order to unwind correctly.
19716 Rename count1 to count.
19717 (recombine_windows, delete_deletable_window, resize_root_window)
19718 (Fdelete_other_windows_internal)
19719 (Frun_window_configuration_change_hook, make_parent_window)
19720 (resize_window_check, resize_window_apply, Fresize_window_apply)
19721 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
19722 (Fdelete_window_internal, Fresize_mini_window_internal):
19723 New functions.
1a13852e
MR
19724 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19725
f3d1777e
MR
197262011-06-08 Martin Rudalics <rudalics@gmx.at>
19727
496e208e
MR
19728 * window.h (window): Add some new members to window structure -
19729 normal_lines, normal_cols, new_total, new_normal, clone_number,
19730 splits, nest, prev_buffers, next_buffers.
19731 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 19732 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 19733
f3d1777e
MR
19734 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19735 Remove.
496e208e
MR
19736 (make_dummy_parent): Set new members of windows structure.
19737 (make_window): Move down in code. Handle new members of window
19738 structure.
19739 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19740 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19741 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19742 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
19743 (Fset_window_next_buffers, Fset_window_clone_number):
19744 New functions.
496e208e
MR
19745 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19746 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19747 Doc-string fixes.
19748 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19749 Argument WINDOW can be now internal window too.
19750 (Fwindow_use_time): Move up in code.
19751 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19752 Rewrite doc-string.
19753 (Fset_window_configuration, saved_window)
19754 (Fcurrent_window_configuration, save_window_save): Handle new
19755 members of window structure.
b9e809c2
MR
19756 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19757 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19758 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19759 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19760 Qget_mru_window, Qresize_root_window,
19761 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19762 Qauto_buffer_name; staticpro them.
f3d1777e 19763
abde8f8c
MR
197642011-06-07 Martin Rudalics <rudalics@gmx.at>
19765
19766 * window.c (Fwindow_total_size, Fwindow_left_column)
19767 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19768 (Fwindow_list_1): New functions.
19769 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
19770 (Fwindow_width, Fscroll_left, Fscroll_right):
19771 Use window_body_cols instead of window_box_text_cols.
19772 (delete_window, Fset_window_configuration):
19773 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
19774 (delete_all_subwindows): Take a window as argument and not a
19775 structure. Rewrite.
190b47e6
MR
19776 (window_loop): Remove handling of GET_LRU_WINDOW and
19777 GET_LARGEST_WINDOW.
19778 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
19779
19780 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
19781 window_box_text_cols. delete_all_subwindows now takes a
19782 Lisp_Object as argument.
abde8f8c 19783
640c8776
SM
19784 * indent.c (compute_motion, Fcompute_motion):
19785 Use window_body_cols instead of window_box_text_cols.
abde8f8c 19786
fa8a67e6
MR
19787 * frame.c (delete_frame): Call delete_all_subwindows with root
19788 window as argument.
19789
a54e3482
DC
197902011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19791
19792 * fns.c (Fputhash): Document return value.
19793
60002bf5
CY
197942011-06-06 Chong Yidong <cyd@stupidchicken.com>
19795
19796 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19797
0c671da6 197982011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 19799
b862a52a 19800 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 19801
be44ca6c
PE
19802 Check for overflow when converting integer to cons and back.
19803 * charset.c (Fdefine_charset_internal, Fdecode_char):
19804 Use cons_to_unsigned to catch overflow.
19805 (Fencode_char): Use INTEGER_TO_CONS.
19806 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19807 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19808 * data.c (long_to_cons, cons_to_long): Remove.
19809 (cons_to_unsigned, cons_to_signed): New functions.
19810 These signal an error for invalid or out-of-range values.
19811 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19812 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19813 * font.c (Ffont_variation_glyphs):
19814 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19815 * lisp.h: Include <intprops.h>.
19816 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19817 (cons_to_signed, cons_to_unsigned): New decls.
19818 (long_to_cons, cons_to_long): Remove decls.
19819 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19820 (Fprimitive_undo): Use CONS_TO_INTEGER.
19821 * xfns.c (Fx_window_property): Likewise.
19822 * xselect.c: Include <limits.h>.
19823 (x_own_selection, selection_data_to_lisp_data):
19824 Use INTEGER_TO_CONS.
19825 (x_handle_selection_request, x_handle_selection_clear)
19826 (x_get_foreign_selection, Fx_disown_selection_internal)
19827 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19828 (lisp_data_to_selection_data): Use cons_to_unsigned.
19829 (x_fill_property_data): Use cons_to_signed.
19830 Report values out of range.
19831
d1f3d2af
PE
19832 Check for buffer and string overflow more precisely.
19833 * buffer.h (BUF_BYTES_MAX): New macro.
19834 * lisp.h (STRING_BYTES_MAX): New macro.
19835 * alloc.c (Fmake_string):
19836 * character.c (string_escape_byte8):
19837 * coding.c (coding_alloc_by_realloc):
19838 * doprnt.c (doprnt):
19839 * editfns.c (Fformat):
19840 * eval.c (verror):
19841 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19842 since they may not be the same number.
19843 * editfns.c (Finsert_char):
19844 * fileio.c (Finsert_file_contents):
19845 Likewise for BUF_BYTES_MAX.
19846
dd52fcea
PE
19847 * image.c: Use ptrdiff_t, not int, for sizes.
19848 (slurp_file): Switch from int to ptrdiff_t.
19849 All uses changed.
19850 (slurp_file): Check that file size fits in both size_t (for
19851 malloc) and ptrdiff_t (for sanity and safety).
19852
7f9bbdbb
PE
19853 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19854 if b->modtime has its maximal value.
19855
dfe18f82
PE
19856 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19857
84acfcf0
PE
19858 Don't assume time_t can fit into int.
19859 * buffer.h (struct buffer.modtime): Now time_t, not int.
19860 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19861 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19862
ccd9a01a
PE
19863 Minor fixes for signed vs unsigned integers.
19864 * character.h (MAYBE_UNIFY_CHAR):
19865 * charset.c (maybe_unify_char):
19866 * keyboard.c (read_char, reorder_modifiers):
19867 XINT -> XFASTINT, since the integer must be nonnegative.
19868 * ftfont.c (ftfont_spec_pattern):
19869 * keymap.c (access_keymap, silly_event_symbol_error):
19870 XUINT -> XFASTINT, since the integer must be nonnegative.
19871 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19872 since it makes no difference and we prefer signed.
19873 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19874 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19875 nonnegative.
19876
d6d100dd
SM
198772011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19878
19879 * window.h (Fwindow_frame): Declare.
19880
2b6148e4
PE
198812011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19882
19883 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19884 (SPARE_MEMORY): Always define.
19885 (LARGE_REQUEST): Remove.
19886 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19887
f230ecc9
MR
198882011-06-06 Martin Rudalics <rudalics@gmx.at>
19889
727e958e
MR
19890 * lisp.h: Move EXFUNS for Fframe_root_window,
19891 Fframe_first_window and Fset_frame_selected_window to window.h.
19892
19893 * window.h: Move EXFUNS for Fframe_root_window,
19894 Fframe_first_window and Fset_frame_selected_window here from
19895 lisp.h.
19896
19897 * frame.c (Fwindow_frame, Fframe_first_window)
19898 (Fframe_root_window, Fframe_selected_window)
19899 (Fset_frame_selected_window): Move to window.c.
19900 (Factive_minibuffer_window): Move to minibuf.c.
19901 (Fother_visible_frames_p): New function.
19902
19903 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19904
f230ecc9
MR
19905 * window.c (decode_window, decode_any_window): Move up in code.
19906 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19907 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
19908 (Fwindow_buffer): Move up and rewrite doc-string.
19909 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19910 (Fwindow_prev): New functions.
727e958e
MR
19911 (Fwindow_frame): Move here from frame.c. Accept any window as
19912 argument.
19913 (Fframe_root_window, Fframe_first_window)
19914 (Fframe_selected_window): Move here from frame.c. Accept frame
19915 or arbitrary window as argument. Update doc-strings.
19916 (Fminibuffer_window): Move up in code.
19917 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
19918 (Fset_frame_selected_window): Move here from frame.c.
19919 Marginal rewrite.
727e958e
MR
19920 (Fselected_window, select_window, Fselect_window): Move up in
19921 code. Minor doc-string fixes.
f230ecc9 19922
4d09bcf6
PE
199232011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19924
19925 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19926 Do not assume that spare memory exists; that assumption is valid
19927 only if SYSTEM_MALLOC.
19928 (LARGE_REQUEST): New macro, so that the issue of large requests
19929 is separated from the issue of spare memory.
19930
810928a2
AS
199312011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19932
172418ad
AS
19933 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19934 format. (Bug#8806)
19935
43f862f7
AS
19936 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19937
810928a2
AS
19938 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19939 before statements.
19940
a059fe24
JD
199412011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19942
19943 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19944
19945 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19946
19947 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19948 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19949
989bf368
JB
199502011-06-05 Juanma Barranquero <lekktu@gmail.com>
19951
19952 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19953
4b80f674
CY
199542011-06-04 Chong Yidong <cyd@stupidchicken.com>
19955
19956 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19957 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
19958 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19959 New error handlers.
4b80f674
CY
19960 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19961 Obey Vx_select_enable_clipboard_manager. Catch errors in
19962 x_clipboard_manager_save (Bug#8779).
19963 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 19964 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 19965
99a33b77 199662011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
19967
19968 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19969
99a33b77 199702011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
19971
19972 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19973 in the current matrix if keep_current_p is non-zero.
19974
8264569d
EZ
199752011-06-04 Eli Zaretskii <eliz@gnu.org>
19976
19977 * bidi.c (bidi_level_of_next_char): Fix last change.
19978
57f97249
EZ
199792011-06-03 Eli Zaretskii <eliz@gnu.org>
19980
fec2107c 19981 Support bidi reordering of text covered by display properties.
57f97249 19982
fec2107c
EZ
19983 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19984 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19985 (bidi_cache_search, bidi_cache_iterator_state)
19986 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
19987 (bidi_level_of_next_char, bidi_move_to_visually_next):
19988 Support character positions inside a run of characters covered by a
fec2107c
EZ
19989 display string.
19990 (bidi_paragraph_init, bidi_resolve_explicit_1)
19991 (bidi_level_of_next_char): Call bidi_fetch_char and
19992 bidi_fetch_char_advance instead of FETCH_CHAR and
19993 FETCH_CHAR_ADVANCE.
19994 (bidi_init_it): Initialize new members.
19995 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19996 definitions.
19997 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19998 instead of using explicit *_CHAR codes.
d6d100dd
SM
19999 (bidi_resolve_explicit, bidi_resolve_weak):
20000 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
20001 bidirectional text is supported only in multibyte buffers.
20002 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20003 it to initialize the frame_window_p member of struct bidi_it.
20004 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20005 (bidi_resolve_explicit, bidi_resolve_weak)
20006 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20007 bidi_it->nchars is non-positive.
20008 (bidi_level_of_next_char): Don't try to lookup the cache for the
20009 next/previous character if nothing is cached there yet, or if we
20010 were just reseat()'ed to a new position.
c40e2fb2 20011
0e14fe90
EZ
20012 * xdisp.c (set_cursor_from_row): Set start and stop points
20013 according to the row's direction when priming the loop that looks
20014 for the glyph on which to display cursor.
20015 (single_display_spec_intangible_p): Function deleted.
20016 (display_prop_intangible_p): Reimplement to call
20017 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
20018 Accept 3 additional arguments needed by handle_display_spec.
20019 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
20020 values: lists, `(when COND...)' forms, etc.
20021 (single_display_spec_string_p): Support property values that are
20022 lists with the argument STRING its top-level element.
20023 (display_prop_string_p): Fix the condition for processing a
20024 property that is a list to be consistent with handle_display_spec.
fec2107c 20025 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
20026 last portion of handle_display_prop.
20027 (compute_display_string_pos): Accept additional argument
20028 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20029 value of a `display' property is a "replacing spec".
20030 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20031 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20032 the display property, but just return a value indicating whether
20033 the display property will replace the characters it covers.
20034 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20035 frame_window_p members of struct bidi_it.
d6d100dd
SM
20036 (compute_display_string_pos, compute_display_string_end):
20037 New functions.
fec2107c
EZ
20038 (push_it): Accept second argument POSITION, where pop_it should
20039 jump to continue iteration.
20040 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 20041
fec2107c
EZ
20042 * keyboard.c (adjust_point_for_property): Adjust the call to
20043 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
20044
20045 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
20046 (bidi_init_it): Update prototypes.
20047 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
20048 (compute_display_string_pos, compute_display_string_end):
20049 Declare prototypes.
fec2107c
EZ
20050 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20051 EMACS_INT.
fc6f18ce 20052
40087514 200532011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 20054
57f53182
PE
20055 Malloc failure behavior now depends on size of allocation.
20056 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20057 * lisp.h: Change signatures accordingly.
20058 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20059 All callers changed. (Bug#8762)
20060
20061 * gnutls.c: Use Emacs's memory allocators.
20062 Without this change, the gnutls library would invoke malloc etc.
20063 directly, which causes problems on non-SYNC_INPUT hosts, and which
20064 runs afoul of improving memory_full behavior. (Bug#8761)
20065 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20066 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20067 xfree instead of the default malloc, realloc, free.
20068 (Fgnutls_boot): No need to check for memory allocation failure,
20069 since xmalloc does that for us.
20070
ac32cd99 20071 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
20072 * category.c (hash_get_category_set):
20073 * ccl.c (ccl_driver):
20074 * charset.c (Fdefine_charset_internal):
20075 * charset.h (struct charset.hash_index):
20076 * composite.c (get_composition_id, gstring_lookup_cache)
20077 (composition_gstring_put_cache):
20078 * composite.h (struct composition.hash_index):
20079 * dispextern.h (struct image.hash):
20080 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20081 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20082 (hashfn_equal, hashfn_user_defined, make_hash_table)
20083 (maybe_resize_hash_table, hash_lookup, hash_put)
20084 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20085 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20086 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20087 * image.c (make_image, search_image_cache, lookup_image)
20088 (xpm_put_color_table_h):
20089 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 20090 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 20091 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 20092 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
20093 * alloc.c (allocate_vectorlike):
20094 Check for overflow in vector size calculations.
20095 * ccl.c (ccl_driver):
20096 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
20097 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20098 need to be updated by these changes.
40087514
PE
20099 * fns.c (make_hash_table, maybe_resize_hash_table):
20100 Check for integer overflow with large hash tables.
0de4bb68
PE
20101 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20102 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20103 (SXHASH_REDUCE): New macro.
20104 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20105 Use it instead of discarding useful hash info with large hash values.
20106 (sxhash_float): New function.
20107 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20108 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
20109 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20110 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
20111 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20112 Adjust signatures to match updated version of code.
20113 (consing_since_gc): Now EMACS_INT, since a single hash table can
20114 use more than INT_MAX bytes.
20115
698d32e2
DN
201162011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20117
20118 Make it possible to build with GCC-4.6+ -O2 -flto.
20119
20120 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20121
fd6fa53f
SM
201222011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20123
20124 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20125 Call minibuffer-inactive-mode.
20126
864db017
JB
201272011-05-31 Juanma Barranquero <lekktu@gmail.com>
20128
20129 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20130 Update dependencies.
20131
2ad0baf4
DN
201322011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20133
20134 * data.c (init_data): Remove code for UTS, this system is not
20135 supported anymore.
20136
4fcc2638
DN
201372011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20138
20139 Don't force ./temacs to start in terminal mode.
20140
20141 * frame.c (make_initial_frame): Initialize faces in all cases, not
20142 only when CANNOT_DUMP is defined.
20143 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20144
c56e0fd5
DN
201452011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20146
20147 * dispnew.c (add_window_display_history): Use const for the string
20148 pointer. Remove declaration, not needed.
20149
333d54da 201502011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 20151
55d4c1b2 20152 Use 'inline', not 'INLINE'.
333d54da 20153 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
20154 * alloc.c, fontset.c (INLINE): Remove.
20155 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20156 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20157 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20158 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20159 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20160
738db178
DN
201612011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20162
20163 Make it possible to run ./temacs.
20164
20165 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20166 syms_of_callproc does the same thing. Remove test for
20167 "initialized", do it in the caller.
20168 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20169
620c53a6
SM
201702011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20171
20172 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20173 (read_minibuf): Use get_minibuffer.
20174 (syms_of_minibuf): Use DEFSYM.
20175 (Qmetadata): New var.
20176 * data.c (Qbuffer): Don't make it static.
20177 (syms_of_data): Use DEFSYM.
20178
e003a292
PE
201792011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20180
20181 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20182 (CCL_CODE_MIN): New macro.
20183
ed008a6d
PE
201842011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20185
3687c2ef
PE
20186 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20187
ed008a6d
PE
20188 * eval.c (Qdebug): Now static.
20189 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20190 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20191 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20192
d66c4c7c
CY
201932011-05-29 Chong Yidong <cyd@stupidchicken.com>
20194
20195 * image.c: Various fixes to ImageMagick code comments.
20196 (Fimagemagick_types): Doc fix.
20197
5fbc2025
PE
201982011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20199
0196f88a
PE
20200 Minor fixes prompted by GCC 4.6.0 warnings.
20201
20202 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20203
5fbc2025
PE
20204 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20205 (x_clipboard_manager_save_all): Move extern decl to ...
20206 * xterm.h: ... here, so that it can be checked for consistency.
20207
1dd3c2d9
CY
202082011-05-29 Chong Yidong <cyd@stupidchicken.com>
20209
20210 * xselect.c (x_clipboard_manager_save_frame)
20211 (x_clipboard_manager_save_all): New functions.
20212 (Fx_clipboard_manager_save): Lisp function deleted.
20213
20214 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20215 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20216
20217 * xterm.h: Update prototype.
20218
5ba6571d
WX
202192011-05-28 William Xu <william.xwl@gmail.com>
20220
20221 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20222 exiting (Bug#8239).
20223
3eaff834
JM
202242011-05-28 Jim Meyering <meyering@redhat.com>
20225
e1900994 20226 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
20227 * fns.c (to_uchar): Define.
20228 (crypto_hash_function): Use it to convert some newly-signed
20229 variables to unsigned, to avoid sign-extension bugs. For example,
20230 without this change, (md5 "truc") would evaluate to
20231 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20232 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 20233 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 20234
0f6990a7
PE
202352011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20236
20237 Integer overflow fixes.
c8a9ca5a 20238
08686060
PE
20239 * dbusbind.c: Serial number integer overflow fixes.
20240 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
20241 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20242 to hold a serial number that is too large for a fixnum.
20243 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20244 Check for serial numbers out of range. Decode any serial number
59568bf0 20245 that was so large that it became a float. (Bug#8722)
08686060 20246
2d1fc3c7
PE
20247 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20248 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20249 Use XFASTINT rather than XUINT when numbers are nonnegative.
20250 (xd_append_arg, Fdbus_method_return_internal):
20251 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20252 arguments, check that Lisp number is nonnegative, rather than
59568bf0 20253 silently wrapping negative numbers around. (Bug#8722)
30217ff0 20254 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 20255 (Bug#8722)
2d1fc3c7 20256
c8a9ca5a
PE
20257 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20258
519e1d69
PE
20259 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20260
6df6ae42 20261 ccl: Add integer overflow checks.
30569699
PE
20262 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20263 (IN_INT_RANGE): New macros.
20264 (ccl_driver): Use them to check for integer overflow when
20265 decoding a CCL program. Many of the new checks are whether XINT (x)
20266 fits in int; it doesn't always, on 64-bit hosts. The new version
20267 doesn't catch all possible integer overflows, but it's an
847044ea 20268 improvement. (Bug#8719)
30569699 20269
c11285dc
PE
20270 * alloc.c (make_event_array): Use XINT, not XUINT.
20271 There's no need for unsigned here.
20272
fdccd48e
PE
20273 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20274 This follows up to the 2011-05-06 change that substituted uintptr_t
20275 for EMACS_INT. This case wasn't caught back then.
20276
37910ab2
PE
20277 Rework Fformat to avoid integer overflow issues.
20278 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20279 now (part of C89). Include <verify.h>.
20280 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20281 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20282 (Fformat): Avoid the prepass trying to compute sizes; it was only
20283 approximate and thus did not catch overflow reliably. Instead, walk
20284 through the format just once, formatting and computing sizes as we go,
20285 checking for integer overflow at every step, and allocating a larger
20286 buffer as needed. Keep track separately whether the format is
20287 multibyte. Keep only the most-recently calculated precision, rather
20288 than them all. Record whether each argument has been converted to
20289 string. Use EMACS_INT, not int, for byte and char and arg counts.
20290 Support field widths and precisions larger than INT_MAX. Avoid
20291 sprintf's undefined behavior with conversion specifications such as %#d
20292 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20293 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20294 formatting out-of-range floating point numbers with int
9173deec 20295 formats. (Bug#8668)
37910ab2 20296
2e6578fb
PE
20297 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20298
0ae6bdee
PE
20299 * data.c: Avoid integer truncation in expressions involving floats.
20300 * data.c: Include <intprops.h>.
20301 (arith_driver): When there's an integer overflow in an expression
20302 involving floating point, convert the integers to floating point
20303 so that the resulting value does not suffer from catastrophic
20304 integer truncation. For example, on a 64-bit host (* 4
20305 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20306 Do not rely on undefined behavior after integer overflow.
20307
de883a70
PE
20308 merge count_size_as_multibyte, parse_str_to_multibyte
20309 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 20310 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
20311 Check for integer overflow.
20312 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20313 since it's now a duplicate of the other. This is more of
20314 a character than a buffer op, so better that it's in character.c.
20315 * fns.c, print.c: Adjust to above changes.
20316
2ff916cb
PE
203172011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20318
20319 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20320
f1b54466
PE
203212011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20322
fb1ac845
PE
20323 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20324 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20325 (x_clipboard_manager_save): Now static.
20326 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20327
f1b54466
PE
20328 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20329 (crypto_hash_function): Now static.
20330 Fix pointer signedness problems. Avoid unnecessary initializations.
20331
a9f737ee
CY
203322011-05-27 Chong Yidong <cyd@stupidchicken.com>
20333
20334 * termhooks.h (Vselection_alist): Make it terminal-local.
20335
20336 * terminal.c (create_terminal): Initialize it.
20337
20338 * xselect.c: Support for clipboard managers.
20339 (Vselection_alist): Move to termhooks.h as terminal-local var.
20340 (LOCAL_SELECTION): New macro.
20341 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20342 (symbol_to_x_atom): Remove gratuitous arg.
20343 (x_handle_selection_request, lisp_data_to_selection_data)
20344 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
20345 (x_own_selection, x_get_local_selection, x_convert_selection):
20346 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
20347 (some_frame_on_display): Delete unused function.
20348 (Fx_own_selection_internal, Fx_get_selection_internal)
20349 (Fx_disown_selection_internal, Fx_selection_owner_p)
20350 (Fx_selection_exists_p): New optional frame arg.
20351 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20352 (x_handle_selection_clear): Don't treat other terminals with the
20353 same keyboard specially. Use the terminal-local Vselection_alist.
20354 (x_clear_frame_selections): Use Frun_hook_with_args.
20355
20356 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20357
20358 * xterm.h: Add support for those atoms.
20359
e067f0c1
CY
203602011-05-26 Chong Yidong <cyd@stupidchicken.com>
20361
20362 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20363 (converted_selections, conversion_fail_tag): New global variables.
20364 (x_selection_request_lisp_error): Free the above.
20365 (x_get_local_selection): Remove unnecessary code.
20366 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
20367 of converted selections stored in converted_selections.
20368 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
20369 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20370 (x_convert_selection): New function.
20371 (x_handle_selection_event): Simplify.
20372 (x_get_foreign_selection): Don't ignore incoming requests while
20373 waiting for an answer; this will fail when we implement
20374 SAVE_TARGETS, and seems unnecessary anyway.
20375 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20376 (Vx_sent_selection_functions): Doc fix.
20377
0f4aebc0
LL
203782011-05-26 Leo Liu <sdl.web@gmail.com>
20379
20380 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20381
e61124cd
YM
203822011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20383
20384 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20385
20386 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20387 for fringe update if it has periodic bitmap.
ac389d0c 20388 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
20389 and fringe_bitmap_periodic_p.
20390
20391 * fringe.c (get_fringe_bitmap_data): New function.
20392 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20393 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20394 row. Mark glyph row for fringe update if periodicity changed.
20395
20396 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20397 for fringe update unless it has periodic bitmap.
20398
f16d9837
KH
203992011-05-25 Kenichi Handa <handa@m17n.org>
20400
20401 * xdisp.c (get_next_display_element): Set correct it->face_id for
20402 a static composition.
20403
e1b90ef6
LL
204042011-05-24 Leo Liu <sdl.web@gmail.com>
20405
20406 * deps.mk (fns.o):
20407 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20408
20409 * fns.c (crypto_hash_function, Fsha1): New function.
20410 (Fmd5): Use crypto_hash_function.
20411 (syms_of_fns): Add Ssha1.
20412
7400048f
PE
204132011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20414
20415 * gnutls.c: Remove unused macros.
20416 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20417 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20418 Remove macros that are defined and never used.
20419 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20420
abb71cf4
CY
204212011-05-22 Chong Yidong <cyd@stupidchicken.com>
20422
20423 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20424 (Fx_get_selection_internal): Minor cleanup.
20425 (Fx_own_selection_internal): Rename arguments for consistency with
20426 select.el.
20427
6307db39
PE
204282011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20429
20430 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20431
f3d4e0a4
CY
204322011-05-22 Chong Yidong <cyd@stupidchicken.com>
20433
20434 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20435
4d8ade89
YM
204362011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20437
20438 * dispnew.c (scrolling_window): Don't exclude the case that the
20439 last enabled row in the desired matrix touches the bottom boundary.
20440
32078c8d
GM
204412011-05-21 Glenn Morris <rgm@gnu.org>
20442
20443 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
20444 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20445 and add some more files.
32078c8d 20446
7285dc67
EZ
204472011-05-20 Eli Zaretskii <eliz@gnu.org>
20448
20449 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20450 report_file_error introduced by the change from 2011-05-07.
20451
89d1bd22
PE
204522011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20453
20454 * systime.h (Time): Define only if emacs is defined.
20455 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20456 where the include path doesn't have X11/X.h by default. See
20457 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20458
cd394be1 204592011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
20460
20461 * composite.c (find_automatic_composition): Fix previous change.
20462
b9704ad9
GM
204632011-05-20 Glenn Morris <rgm@gnu.org>
20464
20465 * lisp.mk: New file, split from Makefile.in.
20466 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20467 (shortlisp): Remove.
20468 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20469
4a720484
GM
204702011-05-19 Glenn Morris <rgm@gnu.org>
20471
20472 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20473 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20474 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20475 (lisp): Set the order to that of loadup.el.
20476 (shortlisp): Make it a copy of $lisp.
20477 (SOME_MACHINE_LISP): Remove.
20478 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20479 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20480
a28d4396
KH
204812011-05-18 Kenichi Handa <handa@m17n.org>
20482
20483 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20484 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20485 (find_automatic_composition): Mostly rewrite for efficiency.
20486
a2b1fa8e
JB
204872011-05-18 Juanma Barranquero <lekktu@gmail.com>
20488
20489 * makefile.w32-in: Update dependencies.
20490
8e1f5610
CS
204912011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20492
20493 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 20494 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 20495
7025ee00 204962011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 20497
cdfa6eab
PE
20498 Fix some integer overflow issues, such as string length overflow.
20499
06d6db33
PE
20500 * insdel.c (count_size_as_multibyte): Check for string overflow.
20501
2b4560a8
PE
20502 * character.c (lisp_string_width): Check for string overflow.
20503 Use EMACS_INT, not int, for string indexes and lengths; in
20504 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20505 the resulting string length overflows an EMACS_INT; instead,
20506 report a string overflow if no precision given. When checking for
20507 precision exhaustion, use a check that cannot possibly have
20508 integer overflow. (Bug#8675)
20509 * character.h (lisp_string_width): Adjust to new signature.
20510
cb93f9be
PE
20511 * alloc.c (string_overflow): New function.
20512 (Fmake_string): Use it. This doesn't change behavior, but saves
20513 a few bytes and will simplify future changes.
20514 * character.c (string_escape_byte8): Likewise.
20515 * lisp.h (string_overflow): New decl.
20516
1a1f3366
PE
20517 Fixups, following up to the user-interface timestamp change.
20518 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20519 for UI timestamps, instead of unsigned long.
9fbd6841
PE
20520 * msdos.c (mouse_get_pos): Likewise.
20521 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
20522 * w32gui.h (Time): Define by including "systime.h" rather than by
20523 declaring it ourselves. (Bug#8664)
20524
d4e3e4d3
PE
20525 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20526 * image.c (clear_image_cache): Likewise.
20527
f6a24d19
PE
20528 * term.c (term_mouse_position): Don't assume time_t wraparound.
20529
08dc5ae6
PE
20530 Be more systematic about user-interface timestamps.
20531 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
20532 and sometimes 'EMACS_UINT', to represent these timestamps.
20533 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
20534 This makes the code easier to follow, and makes it easier to catch
20535 integer overflow bugs such as Bug#8664.
20536 * frame.c (Fmouse_position, Fmouse_pixel_position):
20537 Use Time, not unsigned long, for user-interface timestamps.
20538 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20539 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20540 * keyboard.h (last_event_timestamp): Likewise.
20541 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20542 * menu.h (xmenu_show): Likewise.
20543 * term.c (term_mouse_position): Likewise.
20544 * termhooks.h (struct input_event.timestamp): Likewise.
20545 (struct terminal.mouse_position_hook): Likewise.
20546 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20547 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20548 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20549 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20550 what it was before.
20551 * menu.h, termhooks.h: Include "systime.h", for Time.
20552
8e55734a
PE
20553 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20554 Don't assume that the difference between two unsigned long values
20555 can fit into an integer. At this point, we know button_down_time
20556 <= event->timestamp, so the difference must be nonnegative, so
20557 there's no need to cast the result if double-click-time is
20558 nonnegative, as it should be; check that it's nonnegative, just in
20559 case. This bug is triggered when events are more than 2**31 ms
86db42d2 20560 apart (about 25 days). (Bug#8664)
8e55734a 20561
841f1b75 20562 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 20563 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 20564
3e26f69c
PE
20565 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20566 that always fit in int. Use a sentinel instead of a counter, to
20567 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
20568 * frame.h (struct frame): Use int for menu_bar_items_used
20569 instead of EMACS_INT, since it always fits in int.
3e26f69c 20570
5cc152c0
PE
20571 * menu.c (grow_menu_items): Check for int overflow.
20572
d89eb65e
PE
20573 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20574
5235bd3e
PE
20575 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20576 Before, the code was not consistent. These values cannot exceed
20577 2**31 - 1 so there's no need to make them unsigned.
20578 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20579 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20580 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20581 as modifiers.
20582 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20583
bc827e23
PE
20584 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20585 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20586 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20587 presumably because the widths might not match.
20588
78eb494e
PE
20589 * window.c (size_window): Avoid needless test at loop start.
20590
04f2d78b
CB
205912011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20592
20593 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20594
d2fc7e3d 205952011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
20596
20597 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20598
d2fc7e3d 205992011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
20600
20601 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20602 `width' to `bar_area_x' and `bar_area_width', respectively.
20603 (x_scroll_run): Take account of fringe background extension.
20604
04f2d78b
CB
20605 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20606 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
20607 `bar_area_width', respectively.
20608 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20609 background extension.
20610
79b70037
GM
206112011-05-10 Jim Meyering <meyering@redhat.com>
20612
20613 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20614
2f142cc5
JB
206152011-05-10 Juanma Barranquero <lekktu@gmail.com>
20616
20617 * image.c (Finit_image_library): Return t for built-in image types,
20618 like pbm and xbm. (Bug#8640)
20619
57679c86
AS
206202011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20621
20622 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20623
888c9e86
EZ
206242011-05-07 Eli Zaretskii <eliz@gnu.org>
20625
b0512a1d
EZ
20626 * w32console.c (Fset_screen_color): Doc fix.
20627 (Fget_screen_color): New function.
20628 (syms_of_ntterm): Defsubr it.
20629
7285dc67
EZ
20630 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20631 unlink the temporary file if Fcall_process didn't create it in the
20632 first place.
20633 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20634 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
20635 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20636 cue to call_process_cleanup not to close that handle.
20637
4d3fcc8e
BK
206382011-05-07 Ben Key <bkey76@gmail.com>
20639
20640 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20641 one of two shell specific rules, either bootstrap-temacs-CMD or
20642 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20643 to the previous implementation of the bootstrap-temacs rule.
20644 The bootstrap-temacs-CMD rule is similar to the previous
20645 implementation of the bootstrap-temacs rule except that it
20646 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20647 variable.
20648
20649 These changes, along with some changes to nt/configure.bat,
20650 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20651 earlier fix to add support for --cflags and --ldflags options
20652 that include quotes so that it works whether make uses cmd or
20653 sh as the shell.
20654
b4289b64
MA
206552011-05-06 Michael Albinus <michael.albinus@gmx.de>
20656
20657 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20658 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20659 is a constant.
20660 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20661 a string. Handle both cases.
20662 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20663 (Fdbus_register_method): Use Qinvalid_function.
20664
af4c0e28
JB
206652011-05-06 Juanma Barranquero <lekktu@gmail.com>
20666
20667 * makefile.w32-in: Update dependencies.
20668 (LISP_H): Add inttypes.h and stdin.h.
20669 (PROCESS_H): Add unistd.h.
20670
c51453d9
EZ
206712011-05-06 Eli Zaretskii <eliz@gnu.org>
20672
20673 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20674 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20675
8ff0ac3c 206762011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 20677
4c4b566b
PE
20678 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20679
aab2b9b5
PE
20680 * term.c (vfatal): Remove stray call to va_end.
20681 It's not needed and the C Standard doesn't allow it here anyway.
20682
c378da0b
PE
20683 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20684 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20685
288b08c7
PE
20686 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20687 bytes.
20688
e3601888
PE
20689 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20690
db6c0e74
PE
20691 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20692
dd5963ea
PE
20693 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20694
88c9450f
PE
20695 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20696
2f9442b8
PE
20697 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20698
c032b5f8
PE
20699 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20700 * charset.c (Fdefine_charset_internal): Don't initialize
20701 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 20702 32-bit int (Bug#8600).
a108c10b
PE
20703
20704 * lread.c (read_integer): Be more consistent with string-to-number.
20705 Use string_to_number to do the actual conversion; this avoids
20706 rounding errors and fixes some other screwups. Without this fix,
20707 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20708 (digit_to_number): Move earlier, for benefit of read_integer.
20709 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 20710 not a digit in any supported base. (Bug#8602)
a108c10b 20711
ad5f9eea
PE
20712 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20713
aec1708a
PE
20714 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20715 to match comment at start of function. This also removes a
20716 GCC warning about overflow in a 32+64-bit port.
20717
47be4ab5
PE
20718 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20719
371cac43
PE
20720 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20721 Reported by Stefan Monnier in
20722 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
20723 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20724 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 20725
d01a7826
PE
20726 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20727 (EMACS_UINTPTR): Likewise, with uintptr_t.
20728
7fd47d5c
PE
20729 * lisp.h: Prefer 64-bit EMACS_INT if available.
20730 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20731 on 32-bit hosts that have 64-bit int, so that they can access
20732 large files.
122b0c86
PE
20733 However, temporarily disable this change unless the temporary
20734 symbol WIDE_EMACS_INT is defined.
7fd47d5c 20735
8727937b
PE
20736 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20737
8ac068ac
PE
20738 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20739 This removes an assumption that EMACS_INT and long are the same
20740 width as pointers. The assumption is true for Emacs porting targets
20741 now, but we want to make other targets possible.
20742 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20743 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20744 In the rest of the code, change types of integers that hold casted
20745 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20746 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20747 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20748 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20749 No need to cast type when ORing.
20750 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20751 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20752 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20753 assume EMACS_INT is the same width as char *.
20754 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20755 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20756 Remove no-longer-needed casts.
20757 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20758 (xg_tool_bar_help_callback, xg_make_tool_item):
20759 Use EMACS_INTPTR to hold an integer
20760 that will be cast to void *; this can avoid a GCC warning
20761 if EMACS_INT is not the same width as void *.
20762 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20763 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20764 (current_message_1, set_message_1):
20765 Use a local to convert to proper width without a cast.
20766 * xmenu.c (dialog_selection_callback): Likewise.
20767
ede49d71
PE
20768 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20769 Also, don't assume VALBITS / RAND_BITS is less than 5,
20770 and don't rely on undefined behavior when shifting a 1 left into
20771 the sign bit.
20772 * lisp.h (get_random): Change signature to match.
20773
2f30ecd0
PE
20774 * lread.c (hash_string): Use size_t, not int, for hash computation.
20775 Normally we prefer signed values; but hashing is special, because
20776 it's better to use unsigned division on hash table sizes so that
20777 the remainder is nonnegative. Also, size_t is the natural width
20778 for hashing into memory. The previous code used 'int', which doesn't
20779 retain enough info to hash well into very large tables.
20780 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20781
2a866e7b
PE
20782 * dbusbind.c: Don't possibly lose pointer info when converting.
20783 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20784 Use XPNTR rather than XHASH, so that the high-order bits of
20785 the pointer aren't lost when converting through void *.
20786
51639eac
PE
20787 * eval.c (Fautoload): Don't double-shift a pointer.
20788
92394119
PE
20789 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20790
dbdb9a7c
JB
207912011-05-06 Juanma Barranquero <lekktu@gmail.com>
20792
20793 * gnutls.c (DEF_GNUTLS_FN):
20794 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20795
db7a0b4f
AS
207962011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20797
20798 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20799 marker. (Bug#8610)
20800
cd394be1 208012011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
20802
20803 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20804 New version that can reserve upto 2GB of heap space.
20805
f7ff1b0f 208062011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
20807
20808 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20809
639c109b
TZ
208102011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20811
20812 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20813 `gnutls_certificate_set_x509_key_file'.
20814
d2127135
JB
208152011-05-05 Juanma Barranquero <lekktu@gmail.com>
20816
20817 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20818 Update dependencies.
20819
e968f4f3
JB
208202011-05-04 Juanma Barranquero <lekktu@gmail.com>
20821
20822 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20823 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20824 Remove unused parameter `fildes'.
20825 * process.c (read_process_output, send_process): Don't pass it.
20826
84d358f0
JB
208272011-05-04 Juanma Barranquero <lekktu@gmail.com>
20828
20829 Fix previous change: the library cache is defined in w32.c.
20830 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20831 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20832
0898ca10
JB
208332011-05-04 Juanma Barranquero <lekktu@gmail.com>
20834
20835 Implement dynamic loading of GnuTLS on Windows.
20836
20837 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20838 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20839 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20840 Declare.
20841
20842 * gnutls.c (Qgnutls_dll): Define.
20843 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20844 (gnutls_*): Declare function pointers.
20845 (init_gnutls_functions): New function to initialize function pointers.
20846 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20847 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20848 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20849 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20850 (emacs_gnutls_write, emacs_gnutls_read)
20851 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20852 (Fgnutls_available_p): New function.
20853 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20854 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20855 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20856
20857 * image.c: Include w32.h.
20858 (Vimage_type_cache): Delete.
20859 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20860 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20861 (w32_delayed_load): Move to w32.c.
20862
20863 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20864
20865 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20866 (w32_delayed_load): Move from image.c. When loading a library, record
20867 its filename in the :loaded-from property of the library id.
20868 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20869 Initialize and staticpro them.
20870 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20871
20872 * process.c: Include lisp.h before w32.h, not after.
20873 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20874 instead of gnutls_record_check_pending.
20875
20876 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20877
ff4de4aa
TZ
208782011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20879
20880 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20881 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20882 as passed in.
20883
abe95abb
JD
208842011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20885
20886 * xterm.c (x_set_frame_alpha): Do not set property on anything
20887 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20888
e16e55d4
JB
208892011-05-02 Juanma Barranquero <lekktu@gmail.com>
20890
20891 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20892
bafcf6a5
JB
208932011-05-02 Juanma Barranquero <lekktu@gmail.com>
20894
20895 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20896 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20897 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20898 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20899 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20900 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20901 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20902 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20903 (Qgnutls_bootprop_callbacks_verify): Make static.
20904
e7a6747f
AS
209052011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20906
19ed11ba
AS
20907 * callproc.c: Indentation fixup.
20908
e7a6747f 20909 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
20910 (wait_for_termination, interruptible_wait_for_termination):
20911 Move after wait_for_termination_1.
e7a6747f 20912
1ef14cb4
LMI
209132011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20914
20915 * sysdep.c (interruptible_wait_for_termination): New function
20916 which is like wait_for_termination, but allows keyboard
20917 interruptions.
20918
20919 * callproc.c (Fcall_process): Add (:file "file") as an option for
20920 the STDOUT buffer.
20921 (Fcall_process_region): Ditto.
20922
330d880c
EZ
209232011-04-30 Eli Zaretskii <eliz@gnu.org>
20924
8db90b73
EZ
20925 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20926 rather than `XVECTOR (FOO)->size'.
20927
330d880c
EZ
20928 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20929 inttypes.h, as a gnulib replacement is used if it not available in
20930 system headers.
20931
15cbd324
EZ
209322011-04-21 Eli Zaretskii <eliz@gnu.org>
20933
20934 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20935 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20936 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20937
20938 * coding.c (coding_alloc_by_realloc): Error out if destination
20939 will grow beyond MOST_POSITIVE_FIXNUM.
20940 (decode_coding_emacs_mule): Abort if there isn't enough place in
20941 charbuf for the composition carryover bytes. Reserve an extra
20942 space for up to 2 characters produced in a loop.
20943 (decode_coding_iso_2022): Abort if there isn't enough place in
20944 charbuf for the composition carryover bytes.
20945
209462011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 20947
ae940cca
EZ
20948 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20949 aborting when %lld or %lll format is passed.
20950 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20951 %llo or %llx format is passed. (Bug#8545)
20952
03ab8921
EZ
20953 * window.c (window_scroll_line_based): Use a marker instead of
20954 simple variables to record original value of point. (Bug#7952)
20955
afda1437
EZ
20956 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20957 produced by %s or %c overflows available buffer space. (Bug#8545)
20958
f76dee0c
PE
209592011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20960
20961 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 20962 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 20963
fdc5744d
JB
209642011-04-28 Juanma Barranquero <lekktu@gmail.com>
20965
20966 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20967
638f053a
JB
209682011-04-28 Juanma Barranquero <lekktu@gmail.com>
20969
20970 * keyboard.c (Qdelayed_warnings_hook): Define.
20971 (command_loop_1): Run `delayed-warnings-hook'
20972 if Vdelayed_warnings_list is non-nil.
20973 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20974 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20975
d178f871
EZ
209762011-04-28 Eli Zaretskii <eliz@gnu.org>
20977
20978 * doprnt.c (doprnt): Don't return value smaller than the buffer
20979 size if the message was truncated. (Bug#8545).
20980
b124fd93
JB
209812011-04-28 Juanma Barranquero <lekktu@gmail.com>
20982
20983 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20984 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20985
e810457d
PE
209862011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20987
20988 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20989
ea51cceb
JB
209902011-04-27 Juanma Barranquero <lekktu@gmail.com>
20991
20992 * makefile.w32-in: Update dependencies.
20993
94dcfacf
EZ
209942011-04-27 Eli Zaretskii <eliz@gnu.org>
20995
20996 Improve `doprnt' and its usage. (Bug#8545)
20997 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20998 `format_end'. Remove support for %l as a conversion specifier.
20999 Don't use xrealloc. Improve diagnostics when the %l size modifier
21000 is used. Update the commentary.
21001
21002 * eval.c (verror): Simplify calculation of size_t.
21003
21004 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21005 messages.
21006
f61f41d7
PE
210072011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21008
21009 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21010 change.
21011
96fb4434
PE
210122011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21013
21014 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21015 This makes this file independent of the recent pseudovector change.
21016
671875da 210172011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 21018
69e9b5a3
PE
21019 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21020
b5f869a7 21021 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 21022 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 21023 Remove unused local.
c8926152 21024 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 21025
841a1577 21026 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
21027 GCC 4.6.0 optimizes based on type-based alias analysis.
21028 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
21029 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21030 != &v->size, and therefore "v->size = 1; b->size = 2; return
21031 v->size;" must therefore return 1. This assumption is incorrect
21032 for Emacs, since it type-puns struct Lisp_Vector * with many other
21033 types. To fix this problem, this patch adds a new type struct
f904488f 21034 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
21035 and pseudovectors, and helps optimizing compilers not get fooled
21036 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21037 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
21038 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21039 the size member.
eab3844f
PE
21040 (XSETPVECTYPE): Rewrite in terms of new macro.
21041 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21042 This is a bit clearer, and further avoids the possibility of
21043 undesirable aliasing.
21044 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 21045 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
21046 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21047 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
21048 (ASIZE): Now uses header.size rather than size.
21049 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
21050 to avoid the hassle of writing XVECTOR (foo)->header.size.
21051 (struct vectorlike_header): New type.
eab3844f
PE
21052 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21053 object, to help avoid aliasing.
21054 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21055 (SUBRP): Likewise, since Lisp_Subr is a special case.
21056 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21057 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21058 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 21059 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
21060 changed to be "header.size" and "header.next".
21061 * buffer.h (struct buffer): Likewise.
21062 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21063 * frame.h (struct frame): Likewise.
21064 * process.h (struct Lisp_Process): Likewise.
21065 * termhooks.h (struct terminal): Likewise.
21066 * window.c (struct save_window_data, struct saved_window): Likewise.
21067 * window.h (struct window): Likewise.
21068 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21069 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21070 * buffer.c (init_buffer_once): Likewise.
21071 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21072 special case.
21073 * process.c (Fformat_network_address): Use local var for size,
21074 for brevity.
21075
0df1eac5
PE
21076 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21077
847ab9d1 21078 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
21079 * data.c (atof): Remove decl; no longer used or needed.
21080 (digit_to_number): Move to lread.c.
21081 (Fstring_to_number): Use new string_to_number function, to be
21082 consistent with how the Lisp reader treats infinities and NaNs.
21083 Do not assume that floating-point numbers represent EMACS_INT
21084 without losing information; this is not true on most 64-bit hosts.
21085 Avoid double-rounding errors, by insisting on integers when
21086 parsing non-base-10 numbers, as the documentation specifies.
21087 * lisp.h (string_to_number): New decl, replacing ...
21088 (isfloat_string): Remove.
bc0a5c13 21089 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 21090 (read1): Do not accept +. and -. as integers; this
452f4150
PE
21091 appears to have been a coding error. Similarly, do not accept
21092 strings like +-1e0 as floating point numbers. Do not report
21093 overflow for integer overflows unless the base is not 10 which
21094 means we have no simple and reliable way to continue.
21095 Break out the floating-point parsing into a new
21096 function string_to_number, so that Fstring_to_number parses
21097 floating point numbers consistently with the Lisp reader.
04f2d78b 21098 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
21099 (E_CHAR, EXP_INT): Remove, replacing with ...
21100 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21101 (string_to_number): New function, replacing isfloat_string.
21102 This function checks for valid syntax and produces the resulting
21103 Lisp float number too. Rework it so that string-to-number
bc0a5c13 21104 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
21105 so that overflow for non-base-10 numbers is reported only when
21106 there's no portable and simple way to convert to floating point.
452f4150 21107
67769ffc
PE
21108 * textprop.c (set_text_properties_1): Rewrite for clarity,
21109 and to avoid GCC warning about integer overflow.
21110
c20db43f
PE
21111 * intervals.h (struct interval): Use EMACS_INT for members
21112 where EMACS_UINT might cause problems. See
21113 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21114 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21115 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21116 All uses changed.
37aa2f85
PE
21117 (offset_intervals): Tell GCC not to worry about length overflow
21118 when negating a negative length.
c20db43f 21119
2538aa2f
PE
21120 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21121 (overrun_check_free): Likewise.
21122
f2d3008d
PE
21123 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21124 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21125 word size.
21126
ec8df744
PE
21127 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21128 (gnutls_make_error): Rename local to avoid shadowing.
21129 (gnutls_emacs_global_deinit): ifdef out; not used.
21130 (Fgnutls_boot): Use const for pointer to readonly storage.
21131 Comment out unused local. Fix pointer signedness problems.
21132
640ee02d
PE
21133 * lread.c (openp): Don't stuff size_t into an 'int'.
21134 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21135 about possible signed overflow.
21136
6048fb2a
PE
21137 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21138 (GDK_KEY_g): Don't define if already defined.
21139 (xg_prepare_tooltip): Avoid pointer signedness problem.
21140 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21141
fa3c87e1
PE
21142 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21143 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21144
2172544b
PE
21145 * xfns.c (Fx_window_property): Simplify a bit,
21146 to make a bit faster and to avoid GCC 4.6.0 warning.
21147 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21148
9b821a21
PE
21149 * fns.c (internal_equal): Don't assume size_t fits in int.
21150
3c616cfa
PE
21151 * alloc.c (compact_small_strings): Tighten assertion a little.
21152
c2982e87
PE
21153 Replace pEd with more-general pI, and fix some printf arg casts.
21154 * lisp.h (pI): New macro, generalizing old pEd macro to other
21155 conversion specifiers. For example, use "...%"pI"d..." rather
21156 than "...%"pEd"...".
21157 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 21158 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
21159 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21160 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21161 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21162 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21163 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21164 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21165 64-bit hosts.
21166 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21167 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21168 * print.c (safe_debug_print, print_object): Likewise.
21169 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21170 to int.
6f04d126
PE
21171 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21172 avoiding the 0 flag, which is not portable.
c2982e87
PE
21173 * process.c (Fmake_network_process): Use pI to avoid cast.
21174 * region-cache.c (pp_cache): Likewise.
21175 * xdisp.c (decode_mode_spec): Likewise.
21176 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21177 behavior on 64-bit hosts with printf arg.
6f04d126 21178 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
21179 (x_stop_queuing_selection_requests): Likewise.
21180 (x_get_window_property): Don't truncate byte count to an 'int'
21181 when tracing.
0b432f21 21182
5e073ec7
PE
21183 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21184 here, since it parses constructs like leading '-' and spaces,
21185 which are not wanted; and it overflows with large numbers.
21186 Instead, simply match F[0-9]+, which is what is wanted anyway.
21187
36372bf9
PE
21188 * alloc.c: Remove unportable assumptions about struct layout.
21189 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21190 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21191 (allocate_vectorlike, make_pure_vector): Use the new macros,
21192 plus offsetof, to remove unportable assumptions about struct layout.
21193 These assumptions hold on all porting targets that I know of, but
21194 they are not guaranteed, they're easy to remove, and removing them
21195 makes further changes easier.
21196
0b432f21
PE
21197 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21198 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
21199 (string_overrun_cookie): Now const. Use initializers that
21200 don't formally overflow signed char, to avoid warnings.
000098c1
PE
21201 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21202 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
21203 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21204 multiple of sizeof (EMACS_INT); it need not be, if
21205 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 21206 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 21207
895009e1
JB
212082011-04-26 Juanma Barranquero <lekktu@gmail.com>
21209
21210 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21211
6a7a1b0b
TZ
212122011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21213
21214 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 21215 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
21216 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21217
841a1577 212182011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
21219
21220 * lisp.h (Qdebug): List symbol.
895009e1 21221 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
21222 * keyboard.c (debug-on-event): New variable.
21223 (handle_user_signal): Break into debugger when debug-on-event
21224 matches the current signal symbol.
21225
f2d3ba6f
DN
212262011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21227
21228 * alloc.c (check_sblock, check_string_bytes)
21229 (check_string_free_list): Convert to standard C.
21230
42ce4c63
TZ
212312011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21232
21233 * w32.c (emacs_gnutls_push): Fix typo.
21234
825cd63c
EZ
212352011-04-25 Eli Zaretskii <eliz@gnu.org>
21236
fb11d64d
EZ
21237 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21238 "cast to pointer from integer of different size".
21239
825cd63c
EZ
21240 Improve doprnt and its use in verror. (Bug#8545)
21241 * doprnt.c (doprnt): Document the set of format control sequences
21242 supported by the function. Use SAFE_ALLOCA instead of always
21243 using `alloca'.
21244
21245 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21246 is one byte too soon. Don't use xrealloc; instead xfree and
21247 xmalloc anew.
21248
e061a11b
TZ
212492011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21250
21251 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21252 callbacks stage.
21253
21254 * gnutls.c: Renamed global_initialized to
21255 gnutls_global_initialized. Added internals for the
21256 :verify-hostname-error, :verify-error, and :verify-flags
21257 parameters of `gnutls-boot' and documented those parameters in the
21258 docstring. Start callback support.
9173deec
JB
21259 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21260 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21261 on error. Return error code.
e061a11b
TZ
21262 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21263 (emacs_gnutls_read): Likewise.
21264 (Fgnutls_boot): Return handshake error code.
21265 (emacs_gnutls_handle_error): New function.
21266 (wsaerror_to_errno): Likewise.
21267
21268 * w32.h (emacs_gnutls_pull): Add prototype.
21269 (emacs_gnutls_push): Likewise.
21270
21271 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21272 (emacs_gnutls_push): Likewise.
21273
212742011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21275
21276 * process.c (wait_reading_process_output): Check if GnuTLS
21277 buffered some data internally if no FDs are set for TLS
21278 connections.
21279
21280 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21281 (LIBS): Link to USER_LIBS.
21282 ($(BLD)/gnutls.$(0)): New target.
21283
fa6996bc
EZ
212842011-04-24 Eli Zaretskii <eliz@gnu.org>
21285
eb35682e
EZ
21286 * xdisp.c (handle_single_display_spec): Rename the
21287 display_replaced_before_p argument into display_replaced_p, to
21288 make it consistent with the commentary. Fix typos in the
21289 commentary.
21290
e2ad650c
EZ
21291 * textprop.c (syms_of_textprop): Remove dead code.
21292 (copy_text_properties): Delete obsolete commentary about an
21293 interface that was deleted long ago. Fix typos in the description
21294 of arguments.
21295
1b2de274
EZ
21296 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21297 to changes in oldXMenu/XMenu.h from 2011-04-16.
21298 <menu_help_message, prev_menu_help_message>: Constify.
21299 (IT_menu_make_room): menu->help_text is now `const char **';
21300 adjust.
21301
21302 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21303 to changes in oldXMenu/XMenu.h from 2011-04-16.
21304 (struct XMenu): Declare `help_text' `const char **'.
21305
21306 * xfaces.c <Qunspecified>: Make extern again.
21307
21308 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 21309 required by POSIX.
1b2de274 21310
762b15be
EZ
21311 * doc.c (get_doc_string): Improve the format passed to `error'.
21312
21313 * doprnt.c (doprnt): Improve commentary.
21314
21315 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21316
21317 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21318 them with etags.
21319
f1052e5d
EZ
21320 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21321 changes in globals.h immediately force recompilation.
762b15be
EZ
21322 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21323 $(CURDIR)/s/ms-w32.h.
21324 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 21325
fa6996bc
EZ
21326 * character.c (Fchar_direction): Function deleted.
21327 (syms_of_character): Don't defsubr it.
21328 <char-direction-table>: Deleted.
21329
e6c3da20
EZ
213302011-04-23 Eli Zaretskii <eliz@gnu.org>
21331
21332 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21333 * doprnt.c: Include limits.h.
21334 (SIZE_MAX): New macro.
04f2d78b
CB
21335 (doprnt): Return a size_t value. 2nd arg is now size_t.
21336 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
21337 Improve overflow protection. Support `l' modifier for integer
21338 conversions. Support %l conversion. Don't assume an EMACS_INT
21339 argument for integer conversions and for %c.
21340
21341 * lisp.h (doprnt): Restore prototype.
21342
21343 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21344 $(SRC)/character.h.
21345
21346 * Makefile.in (base_obj): Add back doprnt.o.
21347
21348 * deps.mk (doprnt.o): Add back prerequisites.
21349 (callint.o): Depend on character.h.
21350
21351 * eval.c (internal_lisp_condition_case): Include the handler
21352 representation in the error message.
21353 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21354 when breaking from the loop.
21355
21356 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21357
21358 * callint.c (Fcall_interactively): When displaying error message
21359 about invalid control letter, pass the character's codepoint, not
21360 a pointer to its multibyte form. Improve display of the character
21361 in octal and display also its hex code.
21362
21363 * character.c (char_string): Use %x to display the (unsigned)
21364 codepoint of an invalid character, to avoid displaying a bogus
21365 negative value.
21366
21367 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21368 `error', not SYMBOL_NAME itself.
21369
21370 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21371 character arguments to `error'.
21372
21373 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21374 to `error' in error message about FINAL_CHAR argument. Make sure
21375 FINAL_CHAR is a character, and use %c when it is passed as
21376 argument to `error'.
21377
4ffd0d6b 213782011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
21379
21380 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21381
21382 * w32.c: Include <time.h>.
21383 (sys_localtime): New function.
21384
4ffd0d6b 213852011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
21386
21387 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21388
4ffd0d6b 21389 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 21390
4ffd0d6b 213912011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 21392
4ffd0d6b
GM
21393 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21394 zombies (Bug#8467).
aac0c6e3 21395
04c56954
EZ
213962011-04-19 Eli Zaretskii <eliz@gnu.org>
21397
21398 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21399 gl_state.e_property when gl_state.object is Qt.
21400
21401 * insdel.c (make_gap_larger): Remove limitation of buffer size
21402 to <= INT_MAX.
21403
16a43933
CY
214042011-04-18 Chong Yidong <cyd@stupidchicken.com>
21405
21406 * xdisp.c (lookup_glyphless_char_display)
21407 (produce_glyphless_glyph): Handle cons cell entry in
21408 glyphless-char-display.
21409 (Vglyphless_char_display): Document it.
21410
21411 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21412 glyphless-char-display.
21413
4581706e
CY
214142011-04-17 Chong Yidong <cyd@stupidchicken.com>
21415
21416 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21417
21418 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21419
21420 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21421 definition for no-X builds.
21422
4887c6e2 214232011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 21424
fd35b6f9
PE
21425 Static checks with GCC 4.6.0 and non-default toolkits.
21426
5c1ccb01
PE
21427 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21428
006c5daa
PE
21429 * process.c (keyboard_bit_set): Define only if SIGIO.
21430 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21431 (send_process): Repair possible setjmp clobbering.
21432
efc736d3
PE
21433 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21434
4e2fe2e6
PE
21435 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21436
f97334a2
PE
21437 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21438
4e75f29d
PE
21439 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21440 Define only if needed.
21441
90efadd1
PE
21442 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21443 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 21444 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 21445
3c647824
PE
21446 * dispextern.h (struct redisplay_interface): Rename param
21447 to avoid shadowing.
e264f262 21448 * termhooks.h (struct terminal): Likewise.
761383f4 21449 * xterm.c (xembed_send_message): Likewise.
3c647824 21450
b58c5c4a
PE
21451 * insdel.c (make_gap_smaller): Define only if
21452 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21453
cad59032
PE
21454 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21455 it.
21456
c339dc2e
PE
21457 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21458 so that we aren't warned about unused symbols.
21459
91a3e27b
PE
21460 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21461
399c71d3 21462 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 21463
8ffc96f5
PE
21464 * xfns.c (x_real_positions): Mark locals as initialized.
21465
eef9bc79
PE
21466 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21467
098db9dd
PE
21468 * xterm.c: Fix problems found by static analysis with other toolkits.
21469 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
21470 (x_dispatch_event): Declare static if USE_GTK, and
21471 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 21472 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 21473 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
21474 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21475 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 21476
eb18f6cc
PE
21477 * xmenu.c (menu_help_callback): Pointer type fixes.
21478 Use const pointers when pointing at readonly data. Avoid pointer
21479 signedness clashes.
21480 (FALSE): Remove unused macro.
21481 (update_frame_menubar): Remove unused decl.
21482
1fe72bf8
PE
21483 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21484
60d9e1db
PE
21485 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21486 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21487 (single_menu_item): Rename local to avoid shadowing.
21488
39261c26
PE
21489 * keyboard.c (make_lispy_event): Remove unused local var.
21490
018c5e19
PE
21491 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21492 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21493
63d2b86e
PE
21494 * bitmaps: Change bitmaps from unsigned char back to the X11
21495 compatible char. Avoid the old compiler warnings about
21496 out-of-range initializers by using, for example, '\xab' rather
21497 than 0xab.
21498
aefd87e1
PE
21499 * xgselect.c (xgselect_initialize): Check vs interface
21500 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21501
bf501fb9
PE
21502 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21503
e9829fdf
PE
21504 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21505 to read-only memory.
21506
1086c095
PE
21507 * fns.c (vector): Remove; this old hack is no longer needed.
21508
2baccd04 21509 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 21510 Remove unused var.
dde42981 21511 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 21512
72391843 21513 * xrdb.c (x_load_resources): Omit unused local.
3565b346 21514
436c16df 21515 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 21516 (x_window): Rename locals to avoid shadowing.
dc5ddd85 21517 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 21518
92bb796d 21519 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 21520 (x_term_init): Remove local to avoid shadowing.
92bb796d 21521
764430a3 21522 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
21523
21524 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21525 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21526
d1dfb56c
EZ
215272011-04-16 Eli Zaretskii <eliz@gnu.org>
21528
c4354cb4
EZ
21529 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21530
d1dfb56c
EZ
21531 Fix regex.c, syntax.c and friends for buffers > 2GB.
21532 * syntax.h (struct gl_state_s): Declare character position members
21533 EMACS_INT.
21534
21535 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21536
04f2d78b
CB
21537 * textprop.c (verify_interval_modification, interval_of):
21538 Declare arguments EMACS_INT.
d1dfb56c
EZ
21539
21540 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21541 EMACS_INT.
21542
21543 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21544
21545 * indent.c (Fvertical_motion): Local variable it_start is now
21546 EMACS_INT.
21547
21548 * regex.c (re_match, re_match_2, re_match_2_internal)
21549 (bcmp_translate, regcomp, regexec, print_double_string)
21550 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21551 (re_compile_pattern, re_exec): Declare arguments and local
21552 variables `size_t' and `ssize_t' and return values `regoff_t', as
21553 appropriate.
21554 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21555 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21556 <compile_stack_type>: `size' and `avail' are now `size_t'.
21557
21558 * regex.h <regoff_t>: Use ssize_t, not int.
21559 (re_search, re_search_2, re_match, re_match_2): Arguments that
21560 specify buffer/string position and length are now ssize_t and
21561 size_t. Return type is regoff_t.
21562
613052cd
BK
215632011-04-16 Ben Key <bkey76@gmail.com>
21564
21565 * nsfont.m: Fixed bugs in ns_get_family and
21566 ns_descriptor_to_entity that were caused by using free to
21567 deallocate memory blocks that were allocated by xmalloc (via
21568 xstrdup). This caused Emacs to crash when compiled with
21569 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21570 --enable-checking=xmallocoverrun). xfree is now used to
21571 deallocate these memory blocks.
21572
4170f62f 215732011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 21574
71b41406
PE
21575 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21576
9587a89d
PE
21577 emacs_write: Accept and return EMACS_INT for sizes.
21578 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21579 et seq.
21580 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21581 Accept and return EMACS_INT.
21582 (emacs_gnutls_write): Return the number of bytes written on
21583 partial writes.
21584 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
21585 (emacs_read, emacs_write): Remove check for negative size, as the
21586 Emacs source code has been audited now.
9587a89d
PE
21587 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21588 (emacs_read, emacs_write): Use it.
273a5f82
PE
21589 * process.c (send_process): Adjust to the new signatures of
21590 emacs_write and emacs_gnutls_write. Do not attempt to store
21591 a byte offset into an 'int'; it might overflow.
9587a89d 21592 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 21593
3e047f51
PE
21594 * sound.c: Don't assume sizes fit in 'int'.
21595 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 21596 Return EMACS_INT, not int.
3e047f51 21597 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
21598 Accept EMACS_INT, not int.
21599 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
21600 record read return values.
21601
cc39a9db
BK
216022011-04-15 Ben Key <bkey76@gmail.com>
21603
c9d0ec6d
JB
21604 * keyboard.c (Qundefined): Don't declare static since it is used
21605 in nsfns.m.
21606 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21607 static since they are used in nsfont.m.
cc39a9db 21608
6c60eb9f
SM
216092011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21610
21611 * process.c (Qprocessp): Don't declare static.
21612 * lisp.h (Qprocessp): Declare again.
21613
7990b61a
JB
216142011-04-15 Juanma Barranquero <lekktu@gmail.com>
21615
21616 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21617
5d4cb038
PE
216182011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21619
8bd7b830 21620 Improve C-level modularity by making more things 'static'.
cd64ea1d 21621
e3b27b31
PE
21622 Don't publish debugger-only interfaces to other modules.
21623 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21624 (verify_bytepos, count_markers): Move decls to the only modules
21625 that need them.
21626 * region-cache.h (pp_cache): Likewise.
21627 * window.h (check_all_windows): Likewise.
21628 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21629
5d4cb038
PE
21630 * sysdep.c (croak): Now static, if
21631 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21632 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
21633
21634 * alloc.c (refill_memory_reserve): Now static if
21635 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21636 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 21637
e87b6180
PE
21638 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21639 Define only if USE_LUCID.
21640
ac64929e
PE
21641 * xrdb.c (x_customization_string, x_rm_string): Now static.
21642
6f37259d
PE
21643 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21644 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21645
1683e3ab
PE
21646 * xdisp.c (draw_row_with_mouse_face): Now static.
21647 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21648
de9c2632
PE
21649 * window.h (check_all_windows): Mark externally visible.
21650
2b96acb7
PE
21651 * window.c (window_deletion_count): Now static.
21652
21653 * undo.c: Make symbols static if they're not exported.
21654 (last_undo_buffer, last_boundary_position, pending_boundary):
21655 Now static.
21656
50436f33
PE
21657 * textprop.c (interval_insert_behind_hooks): Now static.
21658 (interval_insert_in_front_hooks): Likewise.
21659
64520e5c
PE
21660 * term.c: Make symbols static if they're not exported.
21661 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21662 (max_frame_lines, tty_set_terminal_modes):
21663 (tty_reset_terminal_modes, tty_turn_off_highlight):
21664 (get_tty_terminal): Now static.
21665 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21666 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 21667 HAVE_WINDOW_SYSTEM.
64520e5c
PE
21668 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21669 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21670
1fa53021
PE
21671 * sysdep.c: Make symbols static if they're not exported.
21672 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21673 Now static.
21674 (sigprocmask_set, full_mask): Remove; unused.
21675 (wait_debugging): Mark as visible.
21676 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21677 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21678
d4b43b22
PE
21679 * syntax.c (syntax_temp): Define only if !__GNUC__.
21680
b7c513d0
PE
21681 * sound.c (current_sound_device, current_sound): Now static.
21682
989b29ad
PE
21683 * search.c (searchbufs, searchbuf_head): Now static.
21684
13a55a78
PE
21685 * scroll.c (scroll_cost): Remove; unused.
21686 * dispextern.h (scroll_cost): Remove decl.
21687
de68a1fc
PE
21688 * region-cache.h (pp_cache): Mark as externally visible.
21689
40ccffa6
PE
21690 * process.c: Make symbols static if they're not exported.
21691 (process_tick, update_tick, create_process, chan_process):
21692 (Vprocess_alist, proc_buffered_char, datagram_access):
21693 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21694 (deactivate_process): Mark defn as static, as well as decl.
21695 * lisp.h (create_process): Remove decl.
21696 * process.h (chan_process, Vprocess_alist): Remove decls.
21697
ad64fc97
PE
21698 * print.c: Make symbols static if they're not exported.
21699 (print_depth, new_backquote_output, being_printed, print_buffer):
21700 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21701 (print_interval, print_number_index, initial_stderr_stream):
21702 Now static.
21703 * lisp.h (Fprinc): Remove decl.
21704 (debug_output_compilation_hack): Mark as externally visible.
21705
adddb265
PE
21706 * sysdep.c (croak): Move decl from here to syssignal.h.
21707 * syssignal.h (croak): Put it here, so the API can be checked when
21708 'croak' is called from dissociate_if_controlling_tty.
21709
1717ede2
PE
21710 * minibuf.c: Make symbols static if they're not exported.
21711 (minibuf_save_list, choose_minibuf_frame): Now static.
21712 * lisp.h (choose_minibuf_frame): Remove decl.
21713
fa5fb2bc
PE
21714 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21715
1e3890d1
PE
21716 * lread.c: Make symbols static if they're not exported.
21717 (read_objects, initial_obarray, oblookup_last_bucket_number):
21718 Now static.
21719 (make_symbol): Remove; unused.
21720 * lisp.h (initial_obarray, make_symbol): Remove decls.
21721
8a1414fa
PE
21722 * keyboard.c: Make symbols static if they're not exported.
21723 (single_kboard, recent_keys_index, total_keys, recent_keys):
21724 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21725 (this_single_command_key_start, echoing, last_auto_save):
21726 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21727 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21728 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21729 (Vlispy_mouse_stem, double_click_count):
21730 Now static.
21731 (force_auto_save_soon): Define only if SIGDANGER.
21732 (ignore_mouse_drag_p): Now static if
21733 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21734 (print_help): Remove; unused.
21735 (stop_character, last_timer_event): Mark as externally visible.
21736 * keyboard.h (ignore_mouse_drag_p): Declare only if
21737 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21738 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21739 * lisp.h (echoing): Remove decl.
21740 (force_auto_save_soon): Declare only if SIGDANGER.
21741 * xdisp.c (redisplay_window): Simplify code, to make it more
21742 obvious that ignore_mouse_drag_p is not accessed if !defined
21743 USE_GTK && !defined HAVE_NS.
21744
93ea6e8f
PE
21745 * intervals.c: Make symbols static if they're not exported.
21746 (merge_properties_sticky, merge_interval_right, delete_interval):
21747 Now static.
21748 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21749
77382fcc
PE
21750 * insdel.c: Make symbols static if they're not exported.
21751 However, leave prepare_to_modify_buffer alone. It's never
21752 called from outside this function, but that appears to be a bug.
21753 (combine_after_change_list, combine_after_change_buffer):
4889fc82 21754 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
21755 (adjust_after_replace_noundo): Remove; unused.
21756 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 21757 (signal_before_change): Remove decls.
77382fcc 21758
9306c32e
PE
21759 * indent.c (val_compute_motion, val_vmotion): Now static.
21760
cd44d2eb
PE
21761 * image.c: Make symbols static if they're not exported.
21762 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21763 if USE_GTK.
21764 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21765 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21766
ad9a7a06
PE
21767 * fringe.c (standard_bitmaps): Now static.
21768 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21769
81626931
PE
21770 * frame.c: Make symbols static if they're not exported.
21771 (x_report_frame_params, make_terminal_frame): Now static.
21772 (get_frame_param): Now static, unless HAVE_NS.
21773 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21774 (x_get_resource_string): Remove; not used.
21775 * frame.h (make_terminal_frame, x_report_frame_params):
21776 (x_get_resource_string); Remove decls.
21777 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21778 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21779
239f9db9
PE
21780 * font.c, fontset.c: Make symbols static if they're not exported.
21781 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21782 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21783 * font.c (font_close_object): Now static.
21784 * font.h (font_close_object): Remove.
21785 * fontset.c (FONTSET_OBJLIST): Remove.
21786 (free_realized_fontset) #if-0 the body, which does nothing.
21787 (face_suitable_for_char_p): #if-0, as it's never called.
21788 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
21789 * xfaces.c (face_at_string_position):
21790 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
21791 since 0 is always ASCII.
21792
dfcf3579
PE
21793 * fns.c (weak_hash_tables): Now static.
21794
5045092b
PE
21795 * fileio.c: Make symbols static if they're not exported.
21796 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21797 (Vwrite_region_annotation_buffers): Now static.
21798
57a96f5c
PE
21799 * eval.c: Make symbols static if they're not exported.
21800 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21801 * lisp.h (backtrace_list): Remove decl.
21802
35f08c38
PE
21803 * emacs.c: Make symbols static if they're not exported.
21804 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21805 (fatal_error_code, fatal_error_signal_hook, standard_args):
21806 Now static.
21807 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21808 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21809 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21810 * lisp.h (fatal_error_signal_hook): Remove decl.
21811 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21812
f44bd759
PE
21813 * editfns.c: Move a (normally-unused) function to its only use.
21814 * editfns.c, lisp.h (get_operating_system_release): Remove.
21815 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21816 worth the hassle of breaking this out.
21817
b532497d
PE
21818 * xterm.c: Make symbols static if they're not exported.
21819 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21820 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21821 (x_destroy_window, x_delete_display):
21822 Now static.
21823 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21824 (x_mouse_leave): Remove; unused.
21825 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21826 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21827 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21828 Remove decls.
21829 (x_mouse_leave): Declare only if WINDOWSNT.
21830 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21831 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21832 USE_X_TOOLKIT.
21833
1675728f
PE
21834 * ftxfont.c: Make symbols static if they're not exported.
21835 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21836 HAVE_FREETYPE.
21837 * font.h (ftxfont_driver): Likewise.
21838
e4cebfca
PE
21839 * xfns.c: Make symbols static if they're not exported.
21840 (x_last_font_name, x_display_info_for_name):
21841 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21842 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21843 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21844 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21845 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21846 (last_show_tip_args): Now static.
21847 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21848 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21849 (x_screen_planes): Remove; unused.
21850 * dispextern.h (x_screen_planes): Remove decl.
21851
5bf46f05
PE
21852 * dispnew.c: Make symbols static if they're not exported.
21853 * dispextern.h (redraw_garbaged_frames, scrolling):
21854 (increment_row_positions): Remove.
21855 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21856 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21857 Now static.
21858 (redraw_garbaged_frames): Remove; unused.
21859
435f4c28
PE
21860 * xfaces.c: Make symbols static if they're not exported.
21861 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21862 Remove decls.
21863 * xterm.h (defined_color): Remove decls.
21864 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21865 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21866 (menu_face_changed_default, defined_color, free_realized_face):
21867 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21868 (ascii_face_of_lisp_face): Remove; unused.
21869
8524aef3
PE
21870 * xdisp.c: Make symbols static if they're not exported.
21871 * dispextern.h (scratch_glyph_row, window_box_edges):
21872 (glyph_to_pixel_coords, set_cursor_from_row):
21873 (get_next_display_element, set_iterator_to_next):
21874 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21875 (show_mouse_face): Remove decls
21876 * frame.h (message_buf_print): Likewise.
21877 * lisp.h (pop_message, set_message, check_point_in_composition):
21878 Likewise.
21879 * xterm.h (set_vertical_scroll_bar): Likewise.
21880 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21881 (message_buf_print, scratch_glyph_row, displayed_buffer):
21882 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21883 (get_next_display_element, show_mouse_face, window_box_edges):
21884 (frame_to_window_pixel_xy, check_point_in_composition):
21885 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21886 (glyph_to_pixel_coords): Remove; unused.
21887
16390cd2
PE
21888 * dired.c (file_name_completion): Now static.
21889
21890 * dbusbind.c (xd_in_read_queued_messages): Now static.
21891
a25f4dfa
PE
21892 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21893 * data.c (circular_list_error): Remove.
21894
14a9c8df
PE
21895 * commands.h (last_point_position, last_point_position_buffer):
21896 (last_point_position_window): Remove decls.
21897 * keyboard.c: Make these variables static.
21898
04f2d78b
CB
21899 * coding.h (coding, code_convert_region, encode_coding_gap):
21900 Remove decls.
74ab6df5
PE
21901 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21902 (iso_code_class, detect_coding, code_convert_region): Now static.
21903 (encode_coding_gap): Remove; unused.
21904
38dfbee1
PE
21905 * chartab.c (chartab_chars, chartab_bits): Now static.
21906
a2cb4e63
PE
21907 * charset.h (charset_iso_8859_1): Remove decl.
21908 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21909 Now static.
21910
127198fd
PE
21911 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21912 * ccl.c (Vccl_program_table): Now static.
21913 (check_ccl_update): Remove; unused.
21914
d85b608f
PE
21915 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21916 * category.h: ... from here.
21917 * category.c (check_category_table, set_category_set): Now static.
21918
31cd66f3
PE
21919 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21920 * lisp.h: Remove these decls.
21921
c358e587
PE
21922 * buffer.c (buffer_count): Remove unused var.
21923
e78aecca
PE
21924 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21925 so that it's not optimized away.
21926 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21927 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21928 exported only to the debugger.
21929
e192d7d3 21930 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 21931 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 21932
92470028
PE
21933 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21934 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21935 was inaccessible from Lisp.
21936 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21937 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21938
244ed907
PE
21939 alloc.c: Import and export fewer symbols, and remove unused items.
21940 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21941 is defined.
21942 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21943 it's not optimized away by whole-program optimization.
21944 (message_enable_multibyte, free_misc): Remove.
21945 (catchlist, handlerlist, mark_backtrace):
21946 Declare only if BYTE_MARK_STACK.
21947 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21948 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21949 (message_enable_multibyte): Remove decl.
21950 (free_misc, interval_free_list, float_block, float_block_index):
21951 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21952 (cons_free_list, last_marked_index):
21953 Now static.
21954 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21955 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21956 (mark_backtrace): Define only if BYTE_MARK_STACK.
21957 * xdisp.c (message_enable_multibyte): Now static.
21958
61c2b50e 21959 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
21960 This makes it easier for human readers (and static analyzers)
21961 to see whether these variables are used from other modules.
21962 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21963 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21964 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21965 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21966 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21967 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21968 * xmenu.c, xselect.c:
21969 Declare Q* vars static if they are not used in other modules.
21970 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21971 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21972 Remove decls of unexported vars.
21973 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21974
95c82688
PE
21975 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21976
16a97296
PE
21977 Make Emacs functions such as Fatom 'static' by default.
21978 This makes it easier for human readers (and static analyzers)
21979 to see whether these functions can be called from other modules.
21980 DEFUN now defines a static function. To make the function external
21981 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
21982 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21983 (Finit_image_library):
16a97296
PE
21984 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21985 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21986 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21987 Remove decls, since these functions are now static.
21988 (Funintern, Fget_internal_run_time): New decls, since these functions
21989 were already external.
95c82688 21990
16a97296
PE
21991 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21992 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21993 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21994 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21995 * keyboard.c, keymap.c, lread.c:
21996 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21997 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21998 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21999 Mark functions with DEFUE instead of DEFUN,
22000 if they are used in other modules.
22001 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22002 decls for now-static functions.
22003 * buffer.h (Fdelete_overlay): Remove decl.
22004 * callproc.c (Fgetenv_internal): Mark as internal.
22005 * composite.c (Fremove_list_of_text_properties): Remove decl.
22006 (Fcomposition_get_gstring): New forward static decl.
22007 * composite.h (Fcomposite_get_gstring): Remove decl.
22008 * dired.c (Ffile_attributes): New forward static decl.
22009 * doc.c (Fdocumntation_property): New forward static decl.
22010 * eval.c (Ffetch_bytecode): New forward static decl.
22011 (Funintern): Remove extern decl; now in .h file where it belongs.
22012 * fileio.c (Fmake_symbolic_link): New forward static decl.
22013 * image.c (Finit_image_library): New forward static decl.
22014 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22015 * intervals.h (Fprevious_property_change):
22016 (Fremove_list_of_text_properties): Remove decls.
22017 * keyboard.c (Fthis_command_keys): Remove decl.
22018 (Fcommand_execute): New forward static decl.
22019 * keymap.c (Flookup_key): New forward static decl.
22020 (Fcopy_keymap): Now static.
22021 * keymap.h (Flookup_key): Remove decl.
22022 * process.c (Fget_process): New forward static decl.
22023 (Fprocess_datagram_address): Mark as internal.
22024 * syntax.c (Fsyntax_table_p): New forward static decl.
22025 (skip_chars): Remove duplicate decl.
22026 * textprop.c (Fprevious_property_change): New forward static decl.
22027 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22028 Now internal.
22029 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22030 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22031
785bbd42
PE
22032 * editfns.c (Fformat): Remove unreachable code.
22033
8b913b57
AS
220342011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22035
22036 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22037 change. (Bug#8496)
22038
a6744a35
EZ
220392011-04-13 Eli Zaretskii <eliz@gnu.org>
22040
22041 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22042 when at ZV. (Bug#8487)
22043
e7974947
AS
220442011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22045
baad03f0
AS
22046 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22047 (Bug#8437)
22048 * keyboard.c (parse_tool_bar_item): Likewise.
22049 * sound.c (sound_cleanup, alsa_close): Likewise.
22050 * termcap.c (tgetent): Likewise.
22051 * xfns.c (x_default_font_parameter): Likewise.
22052 * xsettings.c (read_and_apply_settings): Likewise.
22053
e7974947
AS
22054 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22055 (overrun_check_free): Protoize.
22056
28272684
PE
220572011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22058
22059 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22060 since callers should never pass a negative size.
22061 Change the signature to match that of plain 'read' and 'write'; see
22062 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22063 * lisp.h: Update prototypes of emacs_write and emacs_read.
22064
11997c76
EZ
220652011-04-11 Eli Zaretskii <eliz@gnu.org>
22066
22067 * xdisp.c (redisplay_window): Don't try to determine the character
22068 position of the scroll margin if the window start point w->startp
e896f03c 22069 is outside the buffer's accessible region. (Bug#8468)
11997c76 22070
8a2cbd72
EZ
220712011-04-10 Eli Zaretskii <eliz@gnu.org>
22072
22073 Fix write-region and its subroutines for buffers > 2GB.
22074 * fileio.c (a_write, e_write): Modify declaration of arguments and
22075 local variables to support buffers larger than 2GB.
22076 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22077
22078 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22079 argument, local variables, and return value.
22080
22081 * lisp.h: Update prototypes of emacs_write and emacs_read.
22082
22083 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22084
4073e537 220852011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 22086
1ebfdcb6
PE
22087 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22088
b2ded58d
PE
22089 Fix more problems found by GCC 4.6.0's static checks.
22090
7d66342c
PE
22091 * xdisp.c (vmessage): Use a better test for character truncation.
22092
bbf47d44
PE
22093 * charset.c (load_charset_map): <, not <=, for optimization,
22094 and to avoid potential problems with integer overflow.
9248994d 22095 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 22096 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 22097 * editfns.c (Fformat): Likewise.
1e69125e 22098 * syntax.c (skip_chars): Likewise.
3befa583 22099
e3019616
PE
22100 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22101 This also lets GCC 4.6.0 generate slightly better loop code.
22102
becfa255
PE
22103 * callint.c (Fcall_interactively): <, not <=, for optimization.
22104 (Fcall_interactively): Count the number of arguments produced,
22105 not the number of arguments given. This is simpler and lets GCC
22106 4.6.0 generate slightly better code.
22107
dae0cd48
PE
22108 * ftfont.c: Distingish more carefully between FcChar8 and char.
22109 The previous code passed unsigned char * to a functions like
22110 strlen and xstrcasecmp that expect char *, which does not
22111 conform to the C standard.
22112 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22113 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22114 char * when the C standard requires it.
22115
76032d70
PE
22116 * keyboard.c (read_char): Remove unused var.
22117
eb3f1cc8
PE
22118 * eval.c: Port to Windows vsnprintf (Bug#8435).
22119 Include <limits.h>.
22120 (SIZE_MAX): Define if the headers do not.
22121 (verror): Do not give up if vsnprintf returns a negative count.
22122 Instead, grow the buffer. This ports to Windows vsnprintf, which
22123 does not conform to C99. Problem reported by Eli Zaretskii.
22124 Also, simplify the allocation scheme, by avoiding the need for
22125 calling realloc, and removing the ALLOCATED variable.
22126
70476b54
PE
22127 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22128
12020a9e
PE
22129 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22130 But keep the doprint source code for now, as we might revamp it
22131 and use it again (Bug#8435).
ea6c7ae6
PE
22132 * lisp.h (doprnt): Remove.
22133 * Makefile.in (base_obj): Remove doprnt.o.
22134 * deps.mk (doprnt.o): Remove.
22135
5fdb398c
PE
22136 error: Print 32- and 64-bit integers portably (Bug#8435).
22137 Without this change, on typical 64-bit hosts error ("...%d...", N)
22138 was used to print both 32- and 64-bit integers N, which relied on
22139 undefined behavior.
61bdb816 22140 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
22141 * lisp.h (error, verror): Mark as printf-like functions.
22142 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22143 Report overflow in size calculations when allocating printf buffer.
22144 Do not truncate output string at its first null byte.
22145 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22146 Truncate the output at a character boundary, since vsnprintf does not
22147 do that.
22148 * charset.c (check_iso_charset_parameter): Convert internal
22149 character to string before calling 'error', since %c now has the
22150 printf meaning.
22151 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22152 overflow when computing char to be passed to 'error'. Do not
22153 pass Lisp_Object to 'error'; pass the integer instead.
22154 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22155 formatted with plain %d.
22156
b189fa66
PE
22157 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22158
bff87ef0
PE
22159 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22160
7e2cac20
PE
22161 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22162
ce4d90b5
PE
22163 * xterm.c (x_catch_errors): Remove duplicate declaration.
22164
266c9547
PE
22165 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22166
79c49ad2
PE
22167 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22168
368f4090
JM
221692011-04-10 Jim Meyering <meyering@redhat.com>
22170
22171 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22172 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22173 return ssize_t not "int", and use size_t as the buffer length.
22174 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22175 * gnutls.h: Update declarations.
22176 * process.c (read_process_output): Use ssize_t, to match.
22177 (send_process): Likewise.
22178
a32d4040
CY
221792011-04-09 Chong Yidong <cyd@stupidchicken.com>
22180
22181 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22182
8546720e 221832011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 22184
04f2d78b
CB
22185 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22186 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 22187
8546720e
GM
22188 * xterm.c (handle_one_xevent):
22189 * xmenu.c (create_and_show_popup_menu):
22190 * xselect.c (x_decline_selection_request)
22191 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 22192
0a2f5c1a 221932011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
22194
22195 Fix some uses of `int' instead of EMACS_INT.
22196 * search.c (string_match_1, fast_string_match)
22197 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22198 (scan_buffer, find_next_newline_no_quit)
22199 (find_before_next_newline, search_command, Freplace_match)
22200 (Fmatch_data): Make some `int' variables be EMACS_INT.
22201
22202 * xdisp.c (display_count_lines): 3rd argument and return value now
22203 EMACS_INT. All callers changed.
22204 (pint2hrstr): Last argument is now EMACS_INT.
22205
22206 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22207 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22208 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22209 (decode_coding_utf_16, decode_coding_emacs_mule)
22210 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22211 (decode_coding_ccl, decode_coding_charset)
22212 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22213 (decode_coding_iso_2022, decode_coding_emacs_mule)
22214 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22215 <char_offset, last_offset>: Declare EMACS_INT.
22216 (encode_coding_utf_8, encode_coding_utf_16)
22217 (encode_coding_emacs_mule, encode_invocation_designation)
22218 (encode_designation_at_bol, encode_coding_iso_2022)
22219 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22220 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22221 Declare EMACS_INT.
22222 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22223 (encode_invocation_designation): Last argument P_NCHARS is now
22224 EMACS_INT.
22225 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22226 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22227
22228 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22229 All users changed.
22230
22231 * ccl.c (Fccl_execute_on_string): Declare some variables
22232 EMACS_INT.
22233
8546720e 222342011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
22235
22236 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22237
4e19a977
CS
222382011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22239
22240 * process.c (Fformat_network_address): Doc fix.
22241
87302331
R
222422011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22243
ee7683eb 22244 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 22245
cbb59342
CY
222462011-04-08 Chong Yidong <cyd@stupidchicken.com>
22247
22248 * keyboard.c (read_char): Call Lisp function help-form-show,
22249 instead of using internal_with_output_to_temp_buffer.
22250 (Qhelp_form_show): New var.
e0d38eeb 22251 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
22252
22253 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22254
22255 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22256
e67a13ab
CY
222572011-04-06 Chong Yidong <cyd@stupidchicken.com>
22258
04f2d78b
CB
22259 * process.c (Flist_processes): Remove to Lisp.
22260 (list_processes_1): Delete.
e67a13ab 22261
973f782d
EZ
222622011-04-06 Eli Zaretskii <eliz@gnu.org>
22263
7c106b1e
EZ
22264 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22265
973f782d
EZ
22266 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22267
41cf7d1a 222682011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 22269
ca23cc88
PE
22270 Fix more problems found by GCC 4.6.0's static checks.
22271
f390e2d5
PE
22272 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22273
42eea0d0
PE
22274 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22275
b69769da 22276 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 22277
f9541e84
PE
22278 * xdisp.c (vmessage): Mark as a printf-like function.
22279
13841b55
PE
22280 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22281
c136c10f
PE
22282 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22283
5e2d4a30
PE
22284 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22285 printf-like functions.
22286 (tiff_load): Add casts to remove these marks before passing them
22287 to system-supplied API.
22288
583f48b9
PE
22289 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22290
b25d760e
PE
22291 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22292 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
22293 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22294 directly, rather than having caller test rule sign. This avoids
22295 some unnecessary tests.
22296 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22297 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22298 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 22299
bc7b6697 22300 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 22301 (xfont_open): Avoid unnecessary tests.
bc7b6697 22302
27ccc379
PE
22303 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22304
dcd5c89a
PE
22305 * composite.h, composite.c (composition_gstring_put_cache):
22306 Use EMACS_INT, not int, for length.
22307
b13a45c6
PE
22308 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22309 breaking out part of COMPOSITION_DECODE_RULE.
22310 (COMPOSITION_DECODE_RULE): Use it.
22311 * composite.c (get_composition_id): Remove unused local vars,
22312 by using the new macro.
22313
1e792e4d
PE
22314 * textprop.c (set_text_properties_1): Change while to do-while,
22315 since the condition is always true at first.
22316
dc6c6455 22317 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
22318 (interval_deletion_adjustment): Return unsigned value.
22319 All uses changed.
dc6c6455 22320
aba7731a
PE
22321 * process.c (list_processes_1, create_pty, read_process_output):
22322 (exec_sentinel): Remove vars that were set but not used.
afd4052b 22323 (create_pty): Remove unnecessary "volatile"s.
bc57d757 22324 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 22325 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 22326 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 22327
fdfc4bf3
PE
22328 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22329
fca8fe46 22330 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 22331 (update_syntax_table): Use unsigned instead of int.
fca8fe46 22332
06a0259a 22333 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 22334 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 22335 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 22336
e7b9e80f
PE
22337 * print.c (print_error_message): Avoid int overflow.
22338
56201685
PE
22339 * font.c (font_list_entities): Redo for clarity,
22340 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22341
78834453 22342 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 22343 (font_score): Avoid potential overflow in diff calculation.
78834453 22344
0bc0b309 22345 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 22346 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 22347
e610eaca
PE
22348 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22349
b895abce
PE
22350 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22351 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22352 can always succeed if overflow has undefined behavior.
22353
1f1d9321 22354 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 22355 (wordify): Omit three unnecessary tests.
1f1d9321 22356
c59478bc
PE
22357 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22358 All callers changed. This avoids the need for an unused var.
22359
79b73827
PE
22360 * casefiddle.c (casify_region): Remove var that is set but not used.
22361
a4db5dfe
PE
22362 * dired.c (file_name_completion): Remove var that is set but not used.
22363
43aae36e
PE
22364 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22365
2a47c44d 22366 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 22367 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 22368
a37c69bf
PE
22369 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22370 Check for integer overflow on size calculations.
22371
328ab8e7
PE
22372 * buffer.c (Fprevious_overlay_change): Remove var that is set
22373 but not used.
22374
e5a2a5cb
PE
22375 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22376 Remove vars that are set but not used.
8d84a6eb 22377 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 22378 (timer_check_2): Mark vars as initialized.
e5a2a5cb 22379
a60e5f68
PE
22380 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22381
f661cb61 22382 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 22383 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 22384
f0397f5a
PE
22385 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22386 that are set but not used.
22387
8664db06 22388 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 22389 if XCreateBitmapFromData fails (Bug#8410).
8664db06 22390
6abdaa4a
PE
22391 * xselect.c (x_get_local_selection, x_handle_property_notify):
22392 Remove vars that are set but not used.
22393
0ce7538d 22394 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 22395 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 22396
9ae848fc
PE
22397 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22398 Remove var that is set but not used.
0b918413
PE
22399 (scroll_bar_windows_size): Now size_t, not int.
22400 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22401 Check for overflow.
9ae848fc 22402
a5a62657
PE
22403 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22404 (map_tty_color) [!defined MSDOS]: Likewise.
22405
5c5cdd39
PE
22406 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22407
66ebf983
PE
22408 * coding.c: Remove vars that are set but not used.
22409 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22410 All callers changed.
22411 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22412 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22413 (decode_coding_charset): Remove vars that are set but not used.
22414
1be4d761
PE
22415 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22416 that is set but not used.
22417
47553fa8
PE
22418 * print.c (print_object): Remove var that is set but not used.
22419
1f7196bf 22420 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
22421 The gnulib version avoids calling malloc in the usual case,
22422 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22423 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22424 * filelock.c (current_lock_owner): Likewise.
22425 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22426 * sysdep.c: Include allocator.h, careadlinkat.h.
22427 (emacs_no_realloc_allocator): New static constant.
22428 (emacs_readlink): New function.
fdb61804
PE
22429 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22430 ../lib/careadlinkat.h.
d1fdcab7 22431
f84c17c7
SM
224322011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22433
22434 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22435 first non-nil return value).
22436
ef3862ad
JD
224372011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22438
22439 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22440 if not defined (Bug#8403).
22441
376a7006
JB
224422011-04-02 Juanma Barranquero <lekktu@gmail.com>
22443
22444 * xdisp.c (display_count_lines): Remove parameter `start',
22445 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22446 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22447 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22448 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22449 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22450 and thereabouts. All callers changed.
22451 (get_per_char_metric): Remove parameter `f', unused since
22452 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22453
6ca3801d
JM
224542011-04-02 Jim Meyering <meyering@redhat.com>
22455
22456 do not dereference NULL upon failed strdup
22457 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22458 (ns_get_family): Likewise.
22459
d8e2b5ba
JB
224602011-04-02 Juanma Barranquero <lekktu@gmail.com>
22461
22462 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22463
8c74fcbd
JD
224642011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22465
22466 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22467 later (Bug#8403).
22468
7200d79c
SM
224692011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22470
03408648 22471 Add lexical binding.
7200d79c 22472
03408648
SM
22473 * window.c (Ftemp_output_buffer_show): New fun.
22474 (Fsave_window_excursion):
22475 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22476
22477 * lread.c (lisp_file_lexically_bound_p): New function.
22478 (Fload): Bind Qlexical_binding.
22479 (readevalloop): Remove `evalfun' arg.
22480 Bind Qinternal_interpreter_environment.
22481 (Feval_buffer): Bind Qlexical_binding.
22482 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22483 Mark as dynamic.
22484 (syms_of_lread): Declare `lexical-binding'.
22485
22486 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22487
22488 * keyboard.c (eval_dyn): New fun.
22489 (menu_item_eval_property): Use it.
ca105506
SM
22490
22491 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 22492
03408648
SM
22493 * fns.c (concat, mapcar1): Accept byte-code-functions.
22494
22495 * eval.c (Fsetq): Handle lexical vars.
22496 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22497 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22498 (FletX, Flet): Obey lexical binding.
22499 (Fcommandp): Handle closures.
22500 (Feval): New `lexical' arg.
22501 (eval_sub): New function extracted from Feval. Use it almost
22502 everywhere where Feval was used. Look up vars in lexical env.
22503 Handle closures.
22504 (Ffunctionp): Move from subr.el.
22505 (Ffuncall): Handle closures.
22506 (apply_lambda): Remove `eval_flags'.
22507 (funcall_lambda): Handle closures and new byte-code-functions.
22508 (Fspecial_variable_p): New function.
22509 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22510 but without exporting it to Lisp.
23aba0ea 22511
23aba0ea 22512 * doc.c (Fdocumentation, store_function_docstring):
03408648 22513 * data.c (Finteractive_form): Handle closures.
23aba0ea 22514
03408648
SM
22515 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22516 interactive spec.
ba83908c 22517
04f2d78b
CB
22518 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22519 New byte-codes.
03408648
SM
22520 (exec_byte_code): New function extracted from Fbyte_code to handle new
22521 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 22522
03408648 22523 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 22524
03408648 22525 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 22526
e2abce01
JB
225272011-03-31 Juanma Barranquero <lekktu@gmail.com>
22528
22529 * xdisp.c (redisplay_internal): Fix prototype.
22530
63696a73 225312011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 22532
63696a73 22533 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
22534 (try_scrolling): Use it when setting scroll_limit.
22535 Limit scrolling to 100 screen lines.
63696a73
EZ
22536 (redisplay_window): Even when falling back on "recentering",
22537 position point in the window according to scroll-conservatively,
22538 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22539
22540 (try_scrolling): When point is above the window, allow searching
22541 as far as scroll_max, or one screenful, to compute vertical
22542 distance from PT to the scroll margin position. This prevents
22543 try_scrolling from unnecessarily failing when
22544 scroll-conservatively is set to a value slightly larger than the
22545 window height. Clean up the case of PT below the margin at bottom
22546 of window: scroll_max can no longer be INT_MAX. When aggressive
22547 scrolling is in use, don't let point enter the opposite scroll
22548 margin as result of the scroll.
22549 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
22550 threshold of 100 lines for never-recentering scrolling.
22551
e4cc2dfc
JB
225522011-03-31 Juanma Barranquero <lekktu@gmail.com>
22553
22554 * dispextern.h (move_it_by_lines):
22555 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22556 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22557 (message_log_check_duplicate): Remove parameters `prev_bol' and
22558 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22559 (redisplay_internal): Remove parameter `preserve_echo_area',
22560 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22561
22562 * indent.c (Fvertical_motion):
22563 * window.c (window_scroll_pixel_based, Frecenter):
22564 Don't pass `need_y_p' to `move_it_by_lines'.
22565
1c470562
SM
225662011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22567
44f230aa
SM
22568 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22569 steal a few bits to be more compact.
22570 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22571 Remove unneeded casts.
22572
1c470562
SM
22573 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22574
888adce9
ZK
225752011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22576
22577 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22578 binding" message (bug#7967).
22579
f838ed7b
PE
225802011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22581
77861b95
PE
22582 Fix more problems found by GCC 4.6.0's static checks.
22583
de6dbc14
PE
22584 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22585 Remove unused local var.
22586
f838ed7b
PE
22587 * editfns.c (Fmessage_box): Remove unused local var.
22588
792c7b2b
PE
22589 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22590 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22591 Omit unused local vars.
c499e557 22592 * window.c (shrink_windows): Omit unused local var.
b01a1c29 22593 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
22594 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22595 Omit unused local var.
22596
ba0165e1
PE
22597 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22598 Don't assume string length fits in int.
32ad8845 22599 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 22600 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 22601
3c59b4c9
PE
22602 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22603 instead of alloca (Bug#8344).
22604
a3eed478 22605 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 22606 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 22607
eb4d412d
PE
22608 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22609
1658b401
PE
22610 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22611 concerns.
22612
22613 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22614
22615 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 22616
9a2c6e05
PE
22617 * keyboard.c (syms_of_keyboard): Use the same style as later
22618 in this function when indexing through an array. This also
22619 works around GCC bug 48267.
22620
03d0a109
PE
22621 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22622
44f730c8
PE
22623 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22624
fe75f926
PE
22625 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22626 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22627
ffa8c828
PE
22628 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22629 This avoids undefined behavior on integer overflow, and is a bit
22630 more convenient anyway since it is compared to a size_t variable.
22631
c5101a77
PE
22632 Variadic C functions now count arguments with size_t, not int.
22633 This avoids an unnecessary limitation on 64-bit machines, which
22634 caused (substring ...) to crash on large vectors (Bug#8344).
22635 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22636 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 22637 All variadic functions and their callers changed accordingly.
c5101a77
PE
22638 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22639 * data.c (arith_driver, float_arith_driver): Likewise.
22640 * editfns.c (general_insert_function): Likewise.
22641 * eval.c (struct backtrace.nargs, interactive_p)
22642 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22643 (funcall_lambda, mark_backtrace): Likewise.
22644 * fns.c (concat): Likewise.
22645 * frame.c (x_set_frame_parameters): Likewise.
22646 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22647 0 if not found, not -1. All callers changed.
22648
dd3f25f7
PE
22649 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22650 (stack_copy_size): Now size_t, not int.
22651 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22652
461c2ab9
JB
226532011-03-28 Juanma Barranquero <lekktu@gmail.com>
22654
22655 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22656 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22657 All callers changed.
22658
22659 * lisp.h (multibyte_char_to_unibyte):
22660 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22661 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22662 * character.h (CHAR_TO_BYTE8):
22663 * cmds.c (internal_self_insert):
22664 * editfns.c (general_insert_function):
22665 * keymap.c (push_key_description):
22666 * search.c (Freplace_match):
22667 * xdisp.c (message_dolog, set_message_1): All callers changed.
22668
f6d62986
SM
226692011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22670
22671 * keyboard.c (safe_run_hook_funcall): New function.
22672 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22673 don't set the hook to nil, but remove the offending function instead.
22674 (Qcommand_hook_internal): Remove, unused.
22675 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22676 Vcommand_hook_internal.
22677
22678 * eval.c (enum run_hooks_condition): Remove.
22679 (funcall_nil, funcall_not): New functions.
22680 (run_hook_with_args): Call each function through a `funcall' argument.
22681 Remove `cond' argument, now redundant.
22682 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22683 (Frun_hook_with_args_until_failure): Adjust accordingly.
22684 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22685
1db5b1ad
JB
226862011-03-28 Juanma Barranquero <lekktu@gmail.com>
22687
22688 * dispextern.h (string_buffer_position): Remove declaration.
22689
22690 * print.c (strout): Remove parameter `multibyte', unused since
22691 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22692
22693 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22694 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22695 All callers changed.
22696
22697 * w32.c (_wsa_errlist): Use braces for struct initializers.
22698
22699 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22700 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22701 All callers changed.
22702 (string_buffer_position): Likewise. Also, make static (it's never
22703 used outside xdisp.c).
22704 (cursor_row_p): Remove parameter `w', unused since
22705 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22706 (decode_mode_spec): Remove parameter `precision', introduced during
22707 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22708 All callers changed.
22709
5ffb62aa
JD
227102011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22711
22712 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22713
461c2ab9 227142011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
22715
22716 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22717 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22718 (ns_update_auto_hide_menu_bar): New functions.
22719 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22720 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22721 ns_constrain_all_frames.
22722 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22723 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22724
5c380ffb
JD
227252011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22726
22727 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22728
9af30bdf
GM
227292011-03-27 Glenn Morris <rgm@gnu.org>
22730
22731 * syssignal.h: Replace RETSIGTYPE with void.
22732 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22733 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22734 Replace SIGTYPE with void everywhere.
22735 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22736 * s/template.h (SIGTYPE): Remove commented out definition.
22737
e2abce01
JB
227382011-03-26 Eli Zaretskii <eliz@gnu.org>
22739
22740 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22741 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22742
f868cd8a
JB
227432011-03-26 Juanma Barranquero <lekktu@gmail.com>
22744
59eb0929
JB
22745 * w32.c (read_unc_volume): Use parameter `henum', instead of
22746 global variable `wget_enum_handle'.
22747
22748 * keymap.c (describe_vector): Remove parameters `indices' and
22749 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22750 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22751
f868cd8a
JB
22752 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22753
22754 * keyboard.c (timer_check): Remove parameter `do_it_now',
22755 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22756 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22757 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22758
22759 * keyboard.c (read_char):
22760 * w32menu.c (w32_menu_display_help):
22761 * xmenu.c (show_help_event, menu_help_callback):
22762 Adjust calls to `show_help_echo'.
22763
22764 * gtkutil.c (xg_maybe_add_timer):
22765 * keyboard.c (readable_events):
22766 * process.c (wait_reading_process_output):
22767 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22768
22769 * insdel.c (adjust_markers_gap_motion):
22770 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22771 (gap_left, gap_right): Don't call it.
22772
2ecf6fdb
CY
227732011-03-25 Chong Yidong <cyd@stupidchicken.com>
22774
22775 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22776 incurred during fontification.
22777
6b1f9ba4
JB
227782011-03-25 Juanma Barranquero <lekktu@gmail.com>
22779
22780 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22781 (DEFVAR_PER_BUFFER): Don't pass it.
22782
22783 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22784 (scrolling_window): Don't pass it.
22785
0f4a96b5
JB
227862011-03-25 Juanma Barranquero <lekktu@gmail.com>
22787
22788 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22789
22790 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22791 and `suffix'.
22792 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22793 of variables specific to SELinux and computation of `encoded_absname'.
22794
22795 * image.c (XPutPixel): Remove unused variable `height'.
22796
22797 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22798
22799 * unexw32.c (get_section_info): Remove unused variable `section'.
22800
22801 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22802 (system_process_attributes): Remove unused variable `sess'.
22803 (sys_read): Remove unused variable `err'.
22804
22805 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22806 (w32_wnd_proc): Remove unused variable `isdead'.
22807 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22808 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22809 (x_create_tip_frame): Remove unused variable `tem'.
22810
22811 * w32inevt.c (w32_console_read_socket):
22812 Remove unused variable `no_events'.
22813
22814 * w32term.c (x_draw_composite_glyph_string_foreground):
22815 Remove unused variable `width'.
22816
1149507c
JB
228172011-03-24 Juanma Barranquero <lekktu@gmail.com>
22818
22819 * w32term.c (x_set_glyph_string_clipping):
22820 Don't pass uninitialized region to CombineRgn.
22821
9c88f339
JB
228222011-03-23 Juanma Barranquero <lekktu@gmail.com>
22823
22824 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22825 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22826 (Fx_close_connection): Remove unused variable `i'.
22827
22828 * w32font.c (w32font_draw): Return number of glyphs.
22829 (w32font_open_internal): Remove unused variable `i'.
22830 (w32font_driver): Add missing initializer.
22831
22832 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22833 (fill_in_menu): Remove unused variable `items_added'.
22834
22835 * w32term.c (last_mouse_press_frame): Remove static global variable.
22836 (w32_clip_to_row): Remove unused variable `f'.
22837 (x_delete_terminal): Remove unused variable `i'.
22838
22839 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22840 (NOTHING): Remove unused static global variable.
22841 (uniscribe_check_otf): Remove unused variable `table'.
22842 (uniscribe_font_driver): Add missing initializers.
22843
dee091a3
JD
228442011-03-23 Julien Danjou <julien@danjou.info>
22845
22846 * term.c (Fsuspend_tty, Fresume_tty):
22847 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22848 * window.c (temp_output_buffer_show):
22849 * insdel.c (signal_before_change):
22850 * frame.c (Fhandle_switch_frame):
22851 * fileio.c (Fdo_auto_save):
22852 * emacs.c (Fkill_emacs):
22853 * editfns.c (save_excursion_restore):
22854 * cmds.c (internal_self_insert):
22855 * callint.c (Fcall_interactively):
22856 * buffer.c (Fkill_all_local_variables):
22857 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22858 Use Frun_hooks.
0f4a96b5 22859 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 22860 unconditionally since it does the check itself.
dee091a3 22861
2c520ab5 228622011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 22863
c9c49752
PE
22864 Fix more problems found by GCC 4.5.2's static checks.
22865
8abc3f12
PE
22866 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22867 the first time through the loop, since we know p0 < p1 then.
22868 This also avoids a gcc -Wstrict-overflow warning.
22869
a2d26660
PE
22870 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22871 leading to a memory leak, possible in functions like
22872 load_charset_map_from_file that can allocate an unbounded number
b12ef411 22873 of objects (Bug#8318).
a2d26660 22874
916c72e9
PE
22875 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22876 that could (at least in theory) be that large.
22877
19ab8a18
PE
22878 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22879 This is less likely to overflow, and avoids undefined behavior if
22880 overflow does occur. All callers changed. Use strtoul to scan
22881 for the unsigned long integer.
b7cbbd6f
PE
22882 (pint2hrstr): Simplify and tune code slightly.
22883 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 22884
f0641eff
PE
22885 * scroll.c (do_scrolling): Work around GCC bug 48228.
22886 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22887
7f650bb9
PE
22888 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22889 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
22890 (validate_x_resource_name): Simplify count usage.
22891 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 22892
37dd57d1
PE
22893 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22894 fail (Bug#8306).
81e56e61 22895
699979fc 22896 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 22897
401bf9b4
PE
22898 * process.c (Fmake_network_process): Use socklen_t, not int,
22899 where POSIX says socklen_t is required in portable programs.
22900 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 22901 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
22902 (Fmake_network_process, server_accept_connection):
22903 (wait_reading_process_output, read_process_output):
22904 Likewise.
22905
b93aacde
PE
22906 * process.c: Rename or move locals to avoid shadowing.
22907 (list_processes_1, Fmake_network_process):
22908 (read_process_output_error_handler, exec_sentinel_error_handler):
22909 Rename or move locals.
4dc343ee 22910 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 22911 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 22912 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 22913 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 22914 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 22915
af8a867c 22916 Make tparam.h and terminfo.c consistent.
44f230aa
SM
22917 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22918 Include tparam.h instead, since it declares them.
af8a867c
PE
22919 * cm.h (PC): Remove extern decl; tparam.h now does this.
22920 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22921 * terminfo.c: Include tparam.h, to check interfaces.
22922 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22923 (tparam): Adjust signature to match interface in tparam.h;
22924 this removes some undefined behavior. Check that outstring and len
22925 are zero, which they always are with Emacs.
22926 * tparam.h (PC, BC, UP): New extern decls.
22927
0248044d 22928 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 22929 (xftfont_open): Rename locals to avoid shadowing.
0248044d 22930
8ff096c1 22931 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
22932 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22933 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 22934 (ftfont_list): Remove unused local.
49eaafba
PE
22935 (get_adstyle_property, ftfont_pattern_entity):
22936 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22937 Rename locals to avoid shadowing.
8ff096c1 22938
e2be39f6
PE
22939 * xfont.c (xfont_list_family): Mark var as initialized.
22940
c9735e30
PE
22941 * xml.c (make_dom): Now static.
22942
8f5201ae
PE
22943 * composite.c (composition_compute_stop_pos): Rename local to
22944 avoid shadowing.
b246f932
PE
22945 (composition_reseat_it): Remove unused locals.
22946 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 22947 (composition_update_it): Mark var as initialized.
11b61122
PE
22948 (find_automatic_composition): Mark vars as initialized,
22949 with a FIXME (Bug#8290).
8f5201ae 22950
760fbc2c
PE
22951 character.h: Rename locals to avoid shadowing.
22952 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22953 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22954 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22955 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22956 to avoid shadowing.
22957
ff08eb85
PE
22958 * textprop.c (property_change_between_p): Remove; unused.
22959
fc7bf025
PE
22960 * intervals.c (interval_start_pos): Now static.
22961
235d7abc
PE
22962 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22963
44f230aa
SM
22964 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22965 Rename locals to avoid shadowing.
3e7d6594 22966
50060332
PE
22967 * sound.c (wav_play, au_play, Fplay_sound_internal):
22968 Fix pointer signedness.
d01f234b 22969 (alsa_choose_format): Remove unused local var.
c83b8872
PE
22970 (wav_play): Initialize a variable to 0, to prevent undefined
22971 behavior (Bug#8278).
50060332 22972
c4fc4e30
PE
22973 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22974
918436ed
PE
22975 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22976
c939f91b
PE
22977 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22978 clobbering (Bug#8298).
b9c7f648
PE
22979 * sysdep.c (sys_subshell): Likewise.
22980 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 22981
6bd8c144
PE
22982 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22983 This should get cleaned up, so that child_setup has the
22984 same signature on all platforms.
22985
7710357c 22986 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 22987 (relocate_fd): Rename locals to avoid shadowing.
7710357c 22988
c59da222
CY
229892011-03-22 Chong Yidong <cyd@stupidchicken.com>
22990
22991 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22992 not to be necessary, and produces flickering.
22993
66b87493
GM
229942011-03-20 Glenn Morris <rgm@gnu.org>
22995
22996 * config.in: Remove file.
22997
45b6f6d5
JB
229982011-03-20 Juanma Barranquero <lekktu@gmail.com>
22999
23000 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23001 are now in src/globals.h.
23002 (syms_of_minibuf): Remove spurious & from previous change.
23003
cd394be1 230042011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
23005
23006 * minibuf.c (completing-read-function): New variable.
23007 (completing-read-default): Rename from completing-read.
23008 (completing-read): Call completing-read-function.
23009
b14e3e21
CY
230102011-03-19 Juanma Barranquero <lekktu@gmail.com>
23011
23012 * xfaces.c (Fx_load_color_file):
23013 Read color file from absolute filename (bug#8250).
23014
f2b726e6
JB
230152011-03-19 Juanma Barranquero <lekktu@gmail.com>
23016
23017 * makefile.w32-in: Update dependencies.
23018
09f6ff02
EZ
230192011-03-17 Eli Zaretskii <eliz@gnu.org>
23020
23021 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23022
29a6015a
PE
230232011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23024
a3a6c54e
PE
23025 Fix more problems found by GCC 4.5.2's static checks.
23026
b766f867
PE
23027 * process.c (make_serial_process_unwind, send_process_trap):
23028 (sigchld_handler): Now static.
23029
be02381c
PE
23030 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23031 That way, the code declares only the vars that it needs.
23032 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23033 * s/cygwin.h (PTY_ITERATION): Likewise.
23034 * s/darwin.h (PTY_ITERATION): Likewise.
23035 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23036
57048744
PE
23037 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23038 * process.c (allocate_pty): Don't declare stb unless it's needed.
23039
7914961c 23040 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
23041 (CONSTANTLIM): Remove; unused.
23042 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23043 Define only if needed.
7914961c 23044
b3967b18
PE
23045 * unexelf.c (unexec): Name an expression,
23046 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
23047 Use a different way to cause a compilation error if anyone uses
23048 n rather than nn, a way that does not involve shadowing.
73366a00 23049 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 23050
29a6015a
PE
23051 * deps.mk (unexalpha.o): Remove; unused.
23052
43cfc33e 23053 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 23054 * unexec.h: New file.
ce701a33
PE
23055 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23056 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23057 Depend on unexec.h.
23058 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23059 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23060 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 23061 Change as necessary to match prototype in unexec.h.
ce701a33 23062
01f44d5a
PE
23063 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23064 shadowing.
4f63c6bb 23065 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 23066
a6670b0b
PE
23067 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23068 Rename locals to avoid shadowing.
23069
cef2010d 23070 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 23071 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 23072
d4d7173a
PE
23073 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23074
f08b802a
PE
23075 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23076 warning when compiling print.c.
23077
3ddb0639
PE
23078 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23079 instead of using an uninitialized var.
5ad03b97 23080 (font_sort_entities): Mark var as initialized.
3ddb0639 23081
170a2692
PE
23082 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23083
e663c700
PE
23084 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23085 pointers to constants.
89bc529a 23086 (font_parse_fcname): Remove unused vars.
7b81e2d0 23087 (font_delete_unmatched): Now static.
ea838e10 23088 (font_get_spec): Remove; unused.
13a547c6
PE
23089 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23090 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23091 Rename or move locals to avoid shadowing.
e663c700 23092
2a80c887 23093 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 23094 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 23095
1384fa33 23096 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 23097 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 23098
8b2c52e9
PE
23099 * alloc.c (mark_backtrace): Move decl from here ...
23100 * lisp.h: ... to here, so that it can be checked.
23101
475545b5 23102 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 23103 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
23104 (lisp_indirect_variable): Name an expression,
23105 to avoid gcc -Wbad-function-cast warning.
1faed8ae 23106 (Fdefvar): Rename locals to avoid shadowing.
475545b5 23107
b1349114 23108 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 23109 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 23110 Use const pointer when appropriate.
b1349114 23111
a2928364
PE
23112 * lisp.h (get_system_name, get_operating_system_release):
23113 Move decls here, to check interfaces.
23114 * process.c (get_operating_system_release): Move decl to lisp.h.
23115 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
23116 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23117 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23118 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
23119 (Fformat_time_string, Fencode_time, Finsert_char):
23120 (Ftranslate_region_internal, Fformat):
23121 Rename or remove local vars to avoid shadowing.
9710023e 23122 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 23123
a415e694
PE
23124 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23125 avoid shadowing.
23126
8ef4622d
PE
23127 * lisp.h (eassert): Check that the argument compiles, even if
23128 ENABLE_CHECKING is not defined.
23129
946f9a5b
PE
23130 * data.c (Findirect_variable): Name an expression, to avoid
23131 gcc -Wbad-function-cast warning.
112396d6 23132 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 23133 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
23134 (Fmake_variable_buffer_local, Fmake_local_variable):
23135 Mark variables as initialized.
52746918 23136 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 23137
e5aab7e7 23138 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
23139 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23140 Rename locals to avoid shadowing.
dff45157
PE
23141 (mark_stack): Move local variables into the #ifdef region where
23142 they're used.
7bc26fdb
PE
23143 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23144 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23145 needed otherwise.
23146 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23147 (GC_STRING_CHARS): Remove; not used.
d40d4be1 23148 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 23149
e5aab7e7
PE
23150 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23151 avoids undefined behavior in theory.
23152
4da60324
PE
23153 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23154
88043301
PE
23155 Use functions, not macros, for up- and down-casing (Bug#8254).
23156 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23157 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23158 to use the following functions instead of these macros.
23159 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23160 EMACS_INT, since callers assume the returned value fits in int.
23161 (upcase1): Likewise, for UPCASE_TABLE.
23162 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 23163 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 23164 the race-condition problem in the old DOWNCASE.
88043301 23165
19ed5445
PE
23166 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23167 Rename locals to avoid shadowing.
23168 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
23169 (regex_compile, re_search_2, re_match_2_internal):
23170 Remove unused local vars.
952db0d7
PE
23171 (FREE_VAR): Rewrite so as not to use empty "else",
23172 which gcc can warn about.
da053e48 23173 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
23174 (RETALLOC_IF): Define only if needed.
23175 (WORDCHAR_P): Likewise. This one is never needed, but is used
23176 only in a comment talking about a compiler bug, so put inside
23177 the #if 0 of that comment.
23178 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23179 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23180 Remove; unused.
19ed5445 23181
1f3561e4 23182 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
23183 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23184 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 23185
ded6f8f7
PE
23186 * search.c (simple_search): Remove unused var.
23187
dbd37a95
PE
23188 * dired.c (compile_pattern): Move decl from here ...
23189 * lisp.h: ... to here, so that it can be checked.
23190 (struct re_registers): New forward decl.
23191
7e47afad
PE
23192 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23193
85f24f61
PE
23194 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23195 All uses changed.
23196 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23197 Rename locals to avoid shadowing.
5671df8f 23198 (Fvertical_motion): Mark locals as initialized.
85f24f61 23199
181aa2be 23200 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 23201 (casify_region): Mark local as initialized.
181aa2be 23202
930d429c
PE
23203 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23204
7082eac6
PE
23205 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23206 New macros, so that the caller can use some names other than
23207 gcpro1, gcpro2, etc.
23208 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23209 of the new macros.
23210 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23211 argument, for consistency with GCPRO2_VAR, etc: it is now the
23212 prefix of the variable, not the variable itself. All uses
23213 changed.
38b2c076
PE
23214 * dired.c (directory_files_internal, file_name_completion):
23215 Rename locals to avoid shadowing.
23216
15206ed9
PE
23217 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23218 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23219 dired.c's scmp function, had undefined behavior.
23220 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23221 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23222 * buffer.h: ... to here, because these macros use current_buffer,
23223 and the new implementation with inline functions needs to have
23224 current_buffer in scope now, rather than later when the macros
23225 are used.
23226 (downcase, upcase1): New static inline functions.
23227 (DOWNCASE, UPCASE1): Reimplement using these functions.
23228 This avoids undefined behavior in expressions like
23229 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23230 from race conditions in accessing the global variables
23231 case_temp1 and case_temp2.
23232 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23233 * lisp.h (case_temp1, case_temp2): Remove their decls.
23234 * character.h (ASCII_CHAR_P): Move from here ...
23235 * lisp.h: ... to here, so that the inline functions mentioned
23236 above can use them.
23237
4a6bea26
PE
23238 * dired.c (directory_files_internal_unwind): Now static.
23239
f14b7e14
PE
23240 * fileio.c (file_name_as_directory, directory_file_name):
23241 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23242 Now static.
2893f146
PE
23243 (file_name_as_directory): Use const pointers when appropriate.
23244 (Fexpand_file_name): Likewise. In particular, newdir might
23245 point at constant storage, so make it a const pointer.
fd4ead52 23246 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
23247 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23248 signedness issues.
f839df0c
PE
23249 (Fset_file_times, Finsert_file_contents, auto_save_error):
23250 Rename locals to avoid shadowing.
f14b7e14 23251
5716756e 23252 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
23253 (Ftry_completion, Fall_completions): Rename or remove locals
23254 to avoid shadowing.
5716756e 23255
b4c3046a
PE
23256 * marker.c (bytepos_to_charpos): Remove; unused.
23257
b45db522
PE
23258 * lisp.h (verify_bytepos, count_markers): New decls,
23259 so that gcc does not warn that these functions aren't declared.
23260
85876d07
PE
23261 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23262 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 23263 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 23264 (copy_text): Remove unused local var.
85876d07 23265
03d78a21 23266 * filelock.c (within_one_second): Now static.
b3dd38ab 23267 (lock_file_1): Rename local to avoid shadowing.
03d78a21 23268
5df8f01b
PE
23269 * buffer.c (fix_overlays_before): Mark locals as initialized.
23270 (fix_start_end_in_overlays): Likewise. This function should be
23271 simplified by using pointers-to-pointers, but that's a different
23272 matter.
b1d876f1 23273 (switch_to_buffer_1): Now static.
8f54f30a
PE
23274 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23275 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 23276
a70072c9 23277 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 23278 Fix pointer signedness issue.
edced198
PE
23279 (sys_subshell): Mark local as volatile if checking for lint,
23280 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 23281 (MAXPATHLEN): Define only if needed.
a70072c9 23282
a0977c44
PE
23283 * process.c (serial_open, serial_configure): Move decls from here ...
23284 * systty.h: ... to here, so that they can be checked.
23285
a884fdcc
PE
23286 * fns.c (get_random, seed_random): Move extern decls from here ...
23287 * lisp.h: ... to here, so that they can be checked.
23288
604efe86 23289 * sysdep.c (reset_io): Now static.
b8950c94 23290 (wait_for_termination_signal): Remove; unused.
604efe86 23291
38fc62d9
PE
23292 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23293 (copy_keymap_item, append_key, push_text_char_description):
23294 Now static.
1004a21a 23295 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 23296 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
23297 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23298 (describe_map_tree):
23299 Rename locals to avoid shadowing.
38fc62d9 23300
2f2650da
PE
23301 * keyboard.c: Declare functions static if they are not used elsewhere.
23302 (echo_char, echo_dash, cmd_error, top_level_2):
23303 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
23304 (read_char, kbd_buffer_get_event, make_lispy_position):
23305 (make_lispy_event, make_lispy_movement, apply_modifiers):
23306 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23307 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23308 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 23309 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 23310 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 23311
a053e86c 23312 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
23313 (mark_kboards): Move decl here ...
23314 * alloc.c (mark_kboards): ... from here.
a053e86c 23315
4752793e
PE
23316 * lisp.h (force_auto_save_soon): New decl.
23317
74f10ca7 23318 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
23319 (DEFINE_DUMMY_FUNCTION): New macro.
23320 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23321 Use it.
c03cd23f
PE
23322 (main): Add casts to avoid warnings
23323 if GCC considers string literals to be constants.
74f10ca7 23324
022e70d4
PE
23325 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23326
59d6fe83
PE
23327 * dbusbind.c: Pointer signedness fixes.
23328 (xd_signature, xd_append_arg, xd_initialize):
23329 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23330 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23331 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23332 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23333
78320123
PE
23334 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23335 if GCC considers string literals to be constants.
49cebcca 23336 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 23337
35ac2a97
SM
233382011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23339
fb103ca9
SM
23340 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23341 (print_preprocess, print_object): New macro to fix last change.
23342
35ac2a97
SM
23343 * print.c (print_preprocess): Don't forget font objects.
23344
62973b41
JB
233452011-03-16 Juanma Barranquero <lekktu@gmail.com>
23346
23347 * emacs.c (USAGE3): Doc fixes.
23348
0e48bb22
AS
233492011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23350
23351 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23352 structure.
23353
7684e57b
JB
233542011-03-14 Juanma Barranquero <lekktu@gmail.com>
23355
23356 * lisp.h (VWindow_system, Qfile_name_history):
23357 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23358 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23359 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23360
23361 * w32select.c: Don't #include "keyboard.h".
c96bbc66 23362 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
23363
23364 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23365 * w32console.c (detect_input_pending, read_input_pending)
23366 (encode_terminal_code):
23367 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23368 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23369 (w32_system_caret_y, Qfile_name_history):
23370 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23371 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23372 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23373 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23374 * w32proc.c (Qlocal, report_file_error):
23375 * w32term.c (Vwindow_system, updating_frame):
23376 * w32uniscribe.c (initialized, uniscribe_font_driver):
23377 Remove unneeded extern declarations.
23378
2aa46d6c
CY
233792011-03-14 Chong Yidong <cyd@stupidchicken.com>
23380
c96bbc66 23381 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 23382
cffc6f3b
CY
233832011-03-13 Chong Yidong <cyd@stupidchicken.com>
23384
23385 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23386 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23387 These macros can no longer be used for assignment.
23388
44f230aa
SM
23389 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23390 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
23391 (record_buffer_markers, fetch_buffer_markers): New functions for
23392 recording and fetching special buffer markers.
23393 (set_buffer_internal_1, set_buffer_temp): Use them.
23394
23395 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23396
23397 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23398
23399 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23400 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23401
23402 * xdisp.c (hscroll_window_tree):
23403 (reconsider_clip_changes): Use PT instead of BUF_PT.
23404
d251f04b
EZ
234052011-03-13 Eli Zaretskii <eliz@gnu.org>
23406
23407 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23408 $(EMACS_ROOT)/lib/intprops.h.
23409
f0c77cd1
PE
234102011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23411
3eca4629
PE
23412 Fix more problems found by GCC 4.5.2's static checks.
23413
7c86ee98
PE
23414 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23415 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
23416 (xg_free_frame_widgets): Make it clear that a local variable is
23417 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
23418 (gdk_window_get_screen): Make it clear that this macro is needed
23419 only if USE_GTK_TOOLTIP.
1e5524e7
PE
23420 (int_gtk_range_get_value): New function, which avoids a diagnostic
23421 from gcc -Wbad-function-cast.
23422 (xg_set_toolkit_scroll_bar_thumb): Use it.
23423 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23424 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
23425 (get_utf8_string, xg_get_file_with_chooser):
23426 Rename locals to avoid shadowing.
23427 (create_dialog): Move locals to avoid shadowing.
7c86ee98 23428
41729b81
PE
23429 * xgselect.c (xg_select): Remove unused var.
23430
f0c77cd1
PE
23431 * image.c (four_corners_best): Mark locals as initialized.
23432 (gif_load): Initialize transparent_p to zero (Bug#8238).
23433 Mark another local as initialized.
ec6cf4c6 23434 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 23435
ce0ad53d 23436 * image.c (clear_image_cache): Now static.
d5d5a617 23437 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 23438 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
23439 (x_edge_detection): Remove unnecessary cast that
23440 gcc -Wbad-function-cast diagnoses.
2037898d 23441 (gif_load): Fix pointer signedness.
6ae141d6
PE
23442 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23443 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 23444
33383987 234452011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 23446
d32df629
PE
23447 Improve quality of tests for time stamp overflow.
23448 For example, without this patch (encode-time 0 0 0 1 1
23449 1152921504606846976) returns the obviously-bogus value (-948597
23450 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23451 reports time overflow. See
23452 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
23453 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23454 * editfns.c: Include limits.h and intprops.h.
23455 (TIME_T_MIN, TIME_T_MAX): New macros.
23456 (time_overflow): Move earlier, to before first use.
23457 (hi_time, lo_time): New functions, for an accurate test for
23458 out-of-range times.
23459 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23460 (Fget_internal_run_time): Don't assume time_t fits in int.
23461 (make_time): Use list2 instead of Fcons twice.
23462 (Fdecode_time): More accurate test for out-of-range times.
23463 (check_tm_member): New function.
23464 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
23465 (lisp_time_argument): Don't rely on undefined left-shift and
23466 right-shift behavior when checking for time stamp overflow.
8be6f318 23467
fe31d94c
PE
23468 * editfns.c (time_overflow): New function, refactoring common code.
23469 (Fformat_time_string, Fdecode_time, Fencode_time):
23470 (Fcurrent_time_string): Use it.
23471
8be6f318
PE
23472 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23473 * dired.c (make_time): Move to ...
23474 * editfns.c (make_time): ... here.
23475 * systime.h: Note the move.
23476
09d9db2c 234772011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 23478
126bc0dc
YM
23479 * fringe.c (update_window_fringes): Remove unused variables.
23480
c47cbdfd
YM
23481 * unexmacosx.c (copy_data_segment): Also copy __got section.
23482 (Bug#8223)
23483
7ac80be9
EZ
234842011-03-12 Eli Zaretskii <eliz@gnu.org>
23485
c96bbc66 23486 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
23487 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23488 Constify `char *' arguments and their references according to
23489 prototypes in tparam.h.
23490
ecb0f94d 23491 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 23492
7ac80be9
EZ
23493 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23494 Adapt all references accordingly.
23495
23496 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23497
ef1fd07e
TT
234982011-03-11 Tom Tromey <tromey@redhat.com>
23499
23500 * buffer.c (syms_of_buffer): Remove obsolete comment.
23501
7ef4b50c
EZ
235022011-03-11 Eli Zaretskii <eliz@gnu.org>
23503
23504 * termhooks.h (encode_terminal_code): Declare prototype.
23505
23506 * msdos.c (encode_terminal_code): Don't declare prototype.
23507
23508 * term.c (encode_terminal_code): Now external again, used by
23509 w32console.c and msdos.c.
23510
44f230aa
SM
23511 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23512 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 23513
4b1ec863 235142011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 23515
1714f52b 23516 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 23517
4b1ec863
PE
23518 * fringe.c (update_window_fringes): Mark locals as initialized
23519 (Bug#8227).
23520 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 23521
524c7aa6
PE
23522 * alloc.c (mark_fringe_data): Move decl from here ...
23523 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23524 to check its interface.
23525 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23526
a5c0af81 23527 * fontset.c (free_realized_fontset): Now static.
7519b8cd 23528 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 23529 (fontset_font): Mark local as initialized.
a9a06e0b 23530 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 23531
b4716021
PE
23532 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23533
811e9bac 23534 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 23535 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
23536 (x_own_selection, Fx_disown_selection_internal): Rename locals
23537 to avoid shadowing.
23538 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 23539
7e3ab302
PE
23540 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23541 so that the caller can use some name other than gcpro1.
23542 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
23543 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23544 (Fx_backspace_delete_keys_p):
23545 Use them to avoid shadowing, and rename vars to avoid shadowing.
23546 (x_decode_color, x_set_name, x_window): Now static.
6b437900 23547 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 23548 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
23549 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23550 Remove unused locals.
7e3ab302
PE
23551 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23552 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23553 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23554 macros.
f78faa98 23555
e2b13473
PE
23556 * xterm.h (x_mouse_leave): New decl.
23557
77f23912
PE
23558 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23559 Remove unused functions.
cdf4ba58
PE
23560 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23561 (x_calc_absolute_position): Now static.
7411c686 23562 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 23563 Don't declare local "event" unless it's used.
ed7bf3a5
PE
23564 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23565 unless they are used.
38d0b34a
PE
23566 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23567 (x_fatal_error_signal): Remove; not used.
a6067996
PE
23568 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23569 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23570 (x_error_catcher, x_connection_closed, x_error_handler):
23571 (x_error_quitter, xembed_send_message, x_iconify_frame):
23572 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 23573 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 23574 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 23575
44f230aa
SM
23576 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23577 Rename or move locals to avoid shadowing.
6b463e58 23578 (tty_defined_color, merge_face_heights): Now static.
5967d051 23579 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
23580 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23581 does not deduce is never used uninitialized.
73719eba
PE
23582 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23583 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 23584
426994c3 23585 * terminal.c (store_terminal_param): Now static.
5489860b 23586
032f1620 23587 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 23588 (set_frame_menubar): Remove unused local.
d4323972 23589 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
23590 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23591 since they might point to immutable storage.
281585b0
PE
23592 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23593 since it's unused otherwise.
032f1620 23594
367c19e5 23595 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 23596 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
23597 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23598 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 23599 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
23600 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23601 does not deduce are never used uninitialized.
70739cbe 23602
07b48fa9
PE
23603 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23604
8868a238 23605 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
23606 * window.c (window_loop, size_window):
23607 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 23608
7e5cf297 23609 * window.c (display_buffer): Now static.
d6550a9f
PE
23610 (size_window): Mark variables that gcc -Wuninitialized
23611 does not deduce are never used uninitialized.
a586633d
PE
23612 * window.h (check_all_windows): New decl, to forestall
23613 gcc -Wmissing-prototypes diagnostic.
5b555da1 23614 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 23615
f6095868
PE
23616 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23617 shadowing.
23618 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
23619 Include <limits.h>.
23620 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23621 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
23622 (load_charset_map): Mark variables that gcc -Wuninitialized
23623 does not deduce are never used uninitialized.
53df7c11 23624 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 23625
f38b440c
PE
23626 * coding.c (coding_set_source, coding_set_destination):
23627 Use "else { /* comment */ }" rather than "else /* comment */;"
23628 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
23629 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23630 a block, when the outer 'i' will do.
23631 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23632 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23633 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23634 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23635 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23636 Rename locals to avoid shadowing.
23637 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
23638 * coding.c (emacs_mule_char, encode_invocation_designation):
23639 Now static, since they're not used elsewhere.
413bb2db 23640 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 23641 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
23642 (decode_coding_emacs_mule): Mark variables that gcc
23643 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
23644 (detect_coding_iso_2022): Initialize a local variable that might
23645 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 23646 this initialization is needed. (Bug#8211)
5f58e762
PE
23647 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23648 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23649 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23650 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23651 Remove unused macros.
f38b440c 23652
232b38b9 23653 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 23654 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 23655 * character.c (string_count_byte8): Likewise.
232b38b9 23656
fb90da1b
PE
23657 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23658 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23659
fb93dbc2
PE
23660 * chartab.c (copy_sub_char_table): Now static, since it's not used
23661 elsewhere.
5c156ace
PE
23662 (sub_char_table_ref_and_range, char_table_ref_and_range):
23663 Rename locals to avoid shadowing.
bbcd0949 23664 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 23665
7d3b3862 23666 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 23667 (BIDI_BOB): Remove unused macro.
7d3b3862 23668
6be7d3da
PE
23669 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23670 deduce are never used uninitialized.
c2ed9c8b 23671 * term.c (encode_terminal_code): Likewise.
6be7d3da 23672
75f8807f 23673 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 23674
50938595
PE
23675 * tparam.h: New file.
23676 * term.c, tparam.h: Include it.
23677 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23678 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23679 Move these decls to tparam.h, and make them agree with what
23680 is actually in tparam.c. The previous trick of using incompatible
23681 decls in different modules does not conform to the C standard.
23682 All callers of tparam changed to use tparam's actual API.
23683 * tparam.c (tparam1, tparam, tgoto):
23684 Use const pointers where appropriate.
23685
fbceeba2
PE
23686 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23687 * cm.h (struct cm): Likewise.
23688 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23689 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23690 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23691 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23692 (turn_on_face, init_tty): Likewise.
23693 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 23694
7f3f1250
PE
23695 * term.c (term_mouse_position): Rename local to avoid shadowing.
23696
e6ca6543
PE
23697 * alloc.c (mark_ttys): Move decl from here ...
23698 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23699
c40f8d15
AS
237002011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23701
23702 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23703
cfe0661d
JB
237042011-03-09 Juanma Barranquero <lekktu@gmail.com>
23705
23706 * search.c (compile_pattern_1): Remove argument regp, unused since
23707 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23708 (compile_pattern): Don't pass it.
23709
0afb4571
J
237102011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23711
23712 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23713 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23714 for ! HAVE_GTK3.
23715 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23716
23717 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23718
23719 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23720 gdk_window_get_screen, gdk_window_get_geometry,
23721 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23722 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23723 (xg_get_pixbuf_from_pixmap): New function.
23724 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23725 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23726 Call xg_get_pixbuf_from_pixmap instead of
23727 gdk_pixbuf_get_from_drawable.
23728 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23729 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23730 (xg_check_special_colors): Use GtkStyleContext and its functions
23731 for HAVE_GTK3.
23732 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23733 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23734 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
23735 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23736 Call gtk_widget_get_preferred_size.
0afb4571
J
23737 (xg_frame_resized): gdk_window_get_geometry only takes 5
23738 parameters.
44f230aa
SM
23739 (xg_win_to_widget, xg_event_is_for_menubar):
23740 Call gdk_x11_window_lookup_for_display.
0afb4571
J
23741 (xg_set_widget_bg): New function.
23742 (delete_cb): New function.
895009e1 23743 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 23744 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
23745 (xg_set_background_color): Call xg_set_widget_bg.
23746 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23747 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23748 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23749 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23750 if ! HAVE_GTK3.
23751 (update_frame_tool_bar): Call gtk_widget_hide.
23752 (xg_initialize): Use GDK_KEY_g.
23753
23754 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23755 if ! HAVE_GTK3
23756 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23757
23758 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23759 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23760 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23761
1c2cc4ef
JB
237622011-03-08 Juanma Barranquero <lekktu@gmail.com>
23763
23764 * w32xfns.c (select_palette): Check success of RealizePalette against
23765 GDI_ERROR, not zero.
23766
33383987 23767See ChangeLog.11 for earlier changes.
aac0c6e3
MR
23768
23769;; Local Variables:
23770;; coding: utf-8
aac0c6e3
MR
23771;; End:
23772
ab422c4d 23773 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
23774
23775 This file is part of GNU Emacs.
23776
23777 GNU Emacs is free software: you can redistribute it and/or modify
23778 it under the terms of the GNU General Public License as published by
23779 the Free Software Foundation, either version 3 of the License, or
23780 (at your option) any later version.
23781
23782 GNU Emacs is distributed in the hope that it will be useful,
23783 but WITHOUT ANY WARRANTY; without even the implied warranty of
23784 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23785 GNU General Public License for more details.
23786
23787 You should have received a copy of the GNU General Public License
23788 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.